From 1fae0a73d3960a6e880c629d1532ac3d2108e14f Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 22 Nov 2023 15:33:16 -0500 Subject: [PATCH] feat: add nix code formatter --- common/cachix.nix | 2 +- common/default.nix | 79 ++++--- common/device-vars.nix | 4 +- common/home/bash/default.nix | 43 ++-- common/home/bash/programs.nix | 2 +- common/home/git.nix | 15 +- common/home/neovim/base.lua | 2 + common/home/neovim/default.nix | 45 ++-- common/home/tmux.nix | 2 +- common/modules/locale.nix | 30 +-- common/modules/programs.nix | 3 +- common/overlays/blueberry.nix | 16 +- common/overlays/default.nix | 2 +- common/overlays/dracula-theme.nix | 105 ++++----- common/overlays/pkgs/coloryou/default.nix | 5 +- common/overlays/pkgs/coloryou/shell.nix | 11 +- common/overlays/pkgs/input-emulator.nix | 16 +- common/overlays/pkgs/pam-fprint-grosshack.nix | 26 +-- common/overlays/pkgs/spotifywm.nix | 50 ++--- common/overlays/regreet.nix | 2 +- common/overlays/squeekboard.nix | 8 +- devices/binto/default.nix | 3 +- devices/binto/hardware-configuration.nix | 20 +- devices/binto/home/packages.nix | 4 +- devices/binto/modules/desktop.nix | 6 +- devices/binto/modules/gpu-replay.nix | 28 ++- devices/binto/modules/nix-gaming.nix | 6 +- devices/binto/modules/nvidia.nix | 12 +- devices/wim/default.nix | 2 +- devices/wim/hardware-configuration.nix | 13 +- devices/wim/home/dotfiles.nix | 27 ++- devices/wim/home/hyprland.nix | 15 +- devices/wim/home/packages.nix | 139 ++++++------ devices/wim/modules/desktop.nix | 6 +- devices/wim/modules/security.nix | 11 +- flake.nix | Bin 2008 -> 2245 bytes home/alacritty.nix | 2 +- home/dconf.nix | 4 +- home/firefox/addons/default.nix | 65 +++--- .../addons/generated-firefox-addons.nix | 209 +++++++++--------- home/firefox/default.nix | 151 +++++++------ home/firefox/firefox-gx/default.nix | 60 ++--- home/theme.nix | 22 +- home/wofi/default.nix | 2 +- modules/audio.nix | 2 +- modules/greetd/default.nix | 11 +- modules/kmscon.nix | 2 +- modules/plymouth.nix | 4 +- modules/printer.nix | 5 +- modules/proton-bridge.nix | 8 +- modules/sddm-wayland.nix | 2 +- modules/tailscale.nix | 2 +- 52 files changed, 702 insertions(+), 609 deletions(-) create mode 100644 common/home/neovim/base.lua diff --git a/common/cachix.nix b/common/cachix.nix index 7e2a1df7..e1b39973 100644 --- a/common/cachix.nix +++ b/common/cachix.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { nix = { settings = { substituters = [ diff --git a/common/default.nix b/common/default.nix index 9589a3e1..504d424b 100644 --- a/common/default.nix +++ b/common/default.nix @@ -1,16 +1,17 @@ -{ config -, home-manager -, lib -, nixpkgs -, nixpkgs-wayland -, nix-index-database -, nh -, nur -, nix-melt -, nurl -, coc-stylelintplus -, pkgs -, ... +{ + config, + home-manager, + lib, + nixpkgs, + nixpkgs-wayland, + nix-index-database, + nh, + nur, + nix-melt, + nurl, + coc-stylelintplus, + pkgs, + ... }: { imports = [ ./cachix.nix @@ -29,7 +30,7 @@ nix = { # Edit nix.conf settings = { - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = ["nix-command" "flakes"]; keep-outputs = true; keep-derivations = true; auto-optimise-store = true; @@ -83,36 +84,34 @@ ./home/tmux.nix ./device-vars.nix - ({ osConfig, ... }: { + ({osConfig, ...}: { services.device-vars = osConfig.services.device-vars; }) ]; - home.packages = [ - nix-melt.packages.x86_64-linux.default - nurl.packages.x86_64-linux.default - ] ++ - - (with config.nur.repos.rycee; [ - mozilla-addons-to-nix - ]) ++ - - (with pkgs.nodePackages; [ - undollar - ]) ++ - - (with pkgs; [ - dracula-theme - neofetch - progress - wget - tree - mosh - rsync - killall - imagemagick - usbutils - ]); + home.packages = + [ + nix-melt.packages.x86_64-linux.default + nurl.packages.x86_64-linux.default + ] + ++ (with config.nur.repos.rycee; [ + mozilla-addons-to-nix + ]) + ++ (with pkgs.nodePackages; [ + undollar + ]) + ++ (with pkgs; [ + dracula-theme + neofetch + progress + wget + tree + mosh + rsync + killall + imagemagick + usbutils + ]); home.stateVersion = lib.mkDefault "23.05"; }; diff --git a/common/device-vars.nix b/common/device-vars.nix index ef89ae47..5f171c99 100644 --- a/common/device-vars.nix +++ b/common/device-vars.nix @@ -1,10 +1,10 @@ -{ lib, ... }: { +{lib, ...}: { options.services.device-vars = with lib; { username = mkOption { description = '' Username that was defined at the initial setup process ''; - type = types.nullOr types.str; + type = types.nullOr types.str; }; configDir = mkOption { diff --git a/common/home/bash/default.nix b/common/home/bash/default.nix index 472768be..d4c94713 100644 --- a/common/home/bash/default.nix +++ b/common/home/bash/default.nix @@ -1,15 +1,18 @@ -{ config, lib, ... }: { +{ + config, + lib, + ... +}: { imports = [ ./programs.nix ]; programs = { - starship = let - textColor = "#e3e5e5"; - firstColor = "#bd93f9"; + textColor = "#e3e5e5"; + firstColor = "#bd93f9"; secondColor = "#715895"; - thirdColor = "#382c4a"; + thirdColor = "#382c4a"; fourthColor = "#120e18"; in { enable = true; @@ -93,10 +96,10 @@ enable = true; enableCompletion = true; - historyFile = "\$HOME/.cache/.bash_history"; + historyFile = "\$HOME/.cache/.bash_history"; historyFileSize = 100000; # default - historySize = 10000; # default - historyControl = [ + historySize = 10000; # default + historyControl = [ "erasedups" "ignorespace" ]; @@ -119,29 +122,29 @@ ]; shellAliases = { - sudo = "sudo "; + sudo = "sudo "; frick = "sudo $(fc -ln -1)"; - nivm = "nvim"; + nivm = "nvim"; nivim = "nvim"; - tmux = "tmux -2"; - ls = "ls -lah --color=auto"; - tree = "tree -a -I node_modules"; - cp = "cp -r"; + tmux = "tmux -2"; + ls = "ls -lah --color=auto"; + tree = "tree -a -I node_modules"; + cp = "cp -r"; chore = "(cd ~/.nix; git add flake.lock; git commit -m 'chore: update flake.lock'; git push)"; - tup = "tailscale up --login-server https://headscale.nelim.org"; + tup = "tailscale up --login-server https://headscale.nelim.org"; - pc = "mosh matt@binto -- tmux -2u new -At laptop"; + pc = "mosh matt@binto -- tmux -2u new -At laptop"; oksys = "mosh matt@oksys -- tmux -2u new -At laptop"; - pve = "mosh matt@pve -- tmux -2u new -At laptop"; + pve = "mosh matt@pve -- tmux -2u new -At laptop"; - mc = "mosh mc@mc -- tmux -2u new -At laptop"; - pod = "mosh matt@pve -- ssh -t -p 6768 matt@10.0.0.122 'tmux -2u new -At laptop'"; + mc = "mosh mc@mc -- tmux -2u new -At laptop"; + pod = "mosh matt@pve -- ssh -t -p 6768 matt@10.0.0.122 'tmux -2u new -At laptop'"; jelly = "mosh matt@pve -- ssh -t matt@10.0.0.123 'tmux -2u new -At laptop'"; - qbit = "mosh matt@pve -- ssh -t matt@10.0.0.128 'tmux -2u new -At laptop'"; + qbit = "mosh matt@pve -- ssh -t matt@10.0.0.128 'tmux -2u new -At laptop'"; }; sessionVariables = { # FIXME: why is this not set by home-manager? diff --git a/common/home/bash/programs.nix b/common/home/bash/programs.nix index e5143c2b..61a46875 100644 --- a/common/home/bash/programs.nix +++ b/common/home/bash/programs.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { programs = { fzf = { enable = true; diff --git a/common/home/git.nix b/common/home/git.nix index 842f6998..7da51ccd 100644 --- a/common/home/git.nix +++ b/common/home/git.nix @@ -1,6 +1,5 @@ -{ pkgs, ... }: { +{pkgs, ...}: { programs = { - git = { enable = true; lfs.enable = true; @@ -9,7 +8,7 @@ userEmail = "matt@nelim.org"; includes = [ - { path = "${pkgs.dracula-theme}/git-colors"; } + {path = "${pkgs.dracula-theme}/git-colors";} ]; delta = { @@ -24,11 +23,11 @@ extraConfig.pager = let cmd = "LESS='LRc --mouse' ${pkgs.delta}/bin/delta"; in { - diff = cmd; - show = cmd; - stash = cmd; - log = cmd; - reflog = cmd; + diff = cmd; + show = cmd; + stash = cmd; + log = cmd; + reflog = cmd; }; }; }; diff --git a/common/home/neovim/base.lua b/common/home/neovim/base.lua new file mode 100644 index 00000000..28bb7406 --- /dev/null +++ b/common/home/neovim/base.lua @@ -0,0 +1,2 @@ +-- Add `:Format` command to format current buffer +vim.api.nvim_create_user_command("Format", "call CocAction('format')", {}) diff --git a/common/home/neovim/default.nix b/common/home/neovim/default.nix index a179c793..7bea1353 100644 --- a/common/home/neovim/default.nix +++ b/common/home/neovim/default.nix @@ -1,28 +1,32 @@ -{ pkgs, lib, ... }: let +{ + pkgs, + lib, + ... +}: let # installs a vim plugin from git with a given tag / branch - plugin = owner: repo: rev: hash: pkgs.vimUtils.buildVimPlugin { - pname = "${lib.strings.sanitizeDerivationName repo}"; - version = rev; - src = pkgs.fetchFromGitHub { - inherit rev owner repo hash; + plugin = owner: repo: rev: hash: + pkgs.vimUtils.buildVimPlugin { + pname = "${lib.strings.sanitizeDerivationName repo}"; + version = rev; + src = pkgs.fetchFromGitHub { + inherit rev owner repo hash; + }; }; - }; fileContents = lib.strings.fileContents; in { # TODO: make a gradle module and have java in device-vars.nix xdg.dataFile = { - ".gradle/gradle.properties".source = - pkgs.writeText "gradle.properties" '' - org.gradle.java.home = ${pkgs.temurin-bin-17} - ''; + ".gradle/gradle.properties".source = pkgs.writeText "gradle.properties" '' + org.gradle.java.home = ${pkgs.temurin-bin-17} + ''; }; home.packages = with pkgs; [ gradle gradle-completion # FIXME: not working + alejandra ]; programs = { - java = { enable = true; package = pkgs.temurin-bin-17; @@ -95,8 +99,13 @@ in { languageserver = { nix = { command = "nil"; - filetypes = [ "nix" ]; - rootPatterns = [ "flake.nix" ]; + filetypes = ["nix"]; + rootPatterns = ["flake.nix"]; + settings = { + nil = { + formatting = {command = ["alejandra"];}; + }; + }; }; }; @@ -107,6 +116,7 @@ in { }; extraConfig = fileContents ./base.vim; + extraLuaConfig = fileContents ./base.lua; plugins = with pkgs.vimPlugins; [ # Coc configured @@ -173,9 +183,10 @@ in { config = fileContents ./plugins/treesitter.vim; } { - plugin = (plugin "lukas-reineke" "indent-blankline.nvim" - "046e2cf04e08ece927bacbfb87c5b35c0b636546" - "sha256-bhoep8aTYje5K/dZ/XmpwBPn4PBEMPrmw33QJdfFe6M="); + plugin = + plugin "lukas-reineke" "indent-blankline.nvim" + "046e2cf04e08ece927bacbfb87c5b35c0b636546" + "sha256-bhoep8aTYje5K/dZ/XmpwBPn4PBEMPrmw33QJdfFe6M="; type = "lua"; config = fileContents ./plugins/indent.lua; } diff --git a/common/home/tmux.nix b/common/home/tmux.nix index 9a358440..782dfd1d 100644 --- a/common/home/tmux.nix +++ b/common/home/tmux.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { programs = { tmux = { enable = true; diff --git a/common/modules/locale.nix b/common/modules/locale.nix index ebd1d974..3357ee8b 100644 --- a/common/modules/locale.nix +++ b/common/modules/locale.nix @@ -1,25 +1,27 @@ -{ pkgs, ... }: { +{pkgs, ...}: { fonts = { fontconfig = { enable = true; defaultFonts = { - emoji = [ "Noto Color Emoji" ]; - monospace = [ "Noto Nerd Font" ]; - sansSerif = [ "Noto Nerd Font" ]; - serif = [ "Noto Nerd Font" ]; + emoji = ["Noto Color Emoji"]; + monospace = ["Noto Nerd Font"]; + sansSerif = ["Noto Nerd Font"]; + serif = ["Noto Nerd Font"]; }; }; packages = with pkgs; [ - (nerdfonts.override { fonts = [ - "JetBrainsMono" - "Go-Mono" - "Iosevka" - "NerdFontsSymbolsOnly" - "SpaceMono" - "Ubuntu" - "Noto" - ]; }) + (nerdfonts.override { + fonts = [ + "JetBrainsMono" + "Go-Mono" + "Iosevka" + "NerdFontsSymbolsOnly" + "SpaceMono" + "Ubuntu" + "Noto" + ]; + }) noto-fonts noto-fonts-cjk noto-fonts-emoji diff --git a/common/modules/programs.nix b/common/modules/programs.nix index 6bc11e15..5c5e84df 100644 --- a/common/modules/programs.nix +++ b/common/modules/programs.nix @@ -1,6 +1,5 @@ -{ pkgs, ... }: { +{pkgs, ...}: { services = { - fwupd.enable = true; upower.enable = true; diff --git a/common/overlays/blueberry.nix b/common/overlays/blueberry.nix index a6dfd3a0..27a5dedd 100644 --- a/common/overlays/blueberry.nix +++ b/common/overlays/blueberry.nix @@ -1,10 +1,14 @@ final: prev: { blueberry = prev.blueberry.overrideAttrs (o: { - patches = (o.patches or [ ]) ++ [ - ./patches/wayland.patch - ]; - buildInputs = (o.buildInputs or [ ]) ++ [ - prev.libappindicator - ]; + patches = + (o.patches or []) + ++ [ + ./patches/wayland.patch + ]; + buildInputs = + (o.buildInputs or []) + ++ [ + prev.libappindicator + ]; }); } diff --git a/common/overlays/default.nix b/common/overlays/default.nix index 110bc6fc..4998cdce 100644 --- a/common/overlays/default.nix +++ b/common/overlays/default.nix @@ -1,4 +1,4 @@ -{ neovim-flake, ... }: { +{neovim-flake, ...}: { imports = [ ./dracula-theme.nix ./regreet.nix diff --git a/common/overlays/dracula-theme.nix b/common/overlays/dracula-theme.nix index 46304ba2..c821c407 100644 --- a/common/overlays/dracula-theme.nix +++ b/common/overlays/dracula-theme.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: let +{pkgs, ...}: let plymouth = pkgs.fetchFromGitHub { owner = "dracula"; repo = "plymouth"; @@ -27,74 +27,75 @@ hash = "sha256-f9FwSOSvqTeDj4bOjYUQ6TM+/carCD9o5dhg/MnP/lk="; }; in { - nixpkgs.overlays = [ (final: prev: { - dracula-theme = prev.dracula-theme.overrideAttrs (oldAttrs: rec { + nixpkgs.overlays = [ + (final: prev: { + dracula-theme = prev.dracula-theme.overrideAttrs (oldAttrs: rec { + src = prev.fetchFromGitHub { + owner = "dracula"; + repo = "gtk"; + rev = "84dd7a3021938ceec8a0ee292a8561f8a6d47ebe"; + hash = "sha256-xHf+f0RGMtbprJX+3c0cmp5LKkf0V7BHKcoiAW60du8="; + }; - src = prev.fetchFromGitHub { - owner = "dracula"; - repo = "gtk"; - rev = "84dd7a3021938ceec8a0ee292a8561f8a6d47ebe"; - hash = "sha256-xHf+f0RGMtbprJX+3c0cmp5LKkf0V7BHKcoiAW60du8="; - }; + installPhase = '' + runHook preInstall - installPhase = '' - runHook preInstall + # Git colors + cp -a ${git-colors}/config/gitconfig ./git-colors + chmod 777 ./git-colors - # Git colors - cp -a ${git-colors}/config/gitconfig ./git-colors - chmod 777 ./git-colors + line=$(grep -n 'Dracula Dark Theme' ./git-colors | cut -d: -f1) + sed -i "1,$((line-1))d" ./git-colors - line=$(grep -n 'Dracula Dark Theme' ./git-colors | cut -d: -f1) - sed -i "1,$((line-1))d" ./git-colors + mkdir -p $out + cp -a ./git-colors $out - mkdir -p $out - cp -a ./git-colors $out + # Bat colors + mkdir -p ./bat $out/bat + cp -a ${bat-theme}/Dracula.tmTheme ./bat/dracula-bat.tmTheme + chmod 777 ./bat/dracula-bat.tmTheme - # Bat colors - mkdir -p ./bat $out/bat - cp -a ${bat-theme}/Dracula.tmTheme ./bat/dracula-bat.tmTheme - chmod 777 ./bat/dracula-bat.tmTheme + cp -a ./bat/dracula-bat.tmTheme $out/bat - cp -a ./bat/dracula-bat.tmTheme $out/bat + # Plymouth + cp -a ${plymouth}/dracula ./dracula + chmod 777 ./dracula - # Plymouth - cp -a ${plymouth}/dracula ./dracula - chmod 777 ./dracula + rm ./dracula/dracula.script + cp -a ${dracula-script} ./dracula/dracula.script - rm ./dracula/dracula.script - cp -a ${dracula-script} ./dracula/dracula.script + sed -i "s@\/usr\/@$out\/@" ./dracula/dracula.plymouth - sed -i "s@\/usr\/@$out\/@" ./dracula/dracula.plymouth + mkdir -p $out/share/plymouth/themes + cp -a ./dracula $out/share/plymouth/themes/ - mkdir -p $out/share/plymouth/themes - cp -a ./dracula $out/share/plymouth/themes/ + # Wallpapers + cp -a ${wallpaper} ./waves.png - # Wallpapers - cp -a ${wallpaper} ./waves.png - - mkdir -p $out/wallpapers - cp -a ./waves.png $out/wallpapers/ + mkdir -p $out/wallpapers + cp -a ./waves.png $out/wallpapers/ - # ------------------------------------------- - mkdir -p $out/share/themes/Dracula - cp -a {assets,cinnamon,gnome-shell,gtk-2.0,gtk-3.0,gtk-3.20,gtk-4.0,index.theme,metacity-1,unity,xfwm4} $out/share/themes/Dracula + # ------------------------------------------- + mkdir -p $out/share/themes/Dracula + cp -a {assets,cinnamon,gnome-shell,gtk-2.0,gtk-3.0,gtk-3.20,gtk-4.0,index.theme,metacity-1,unity,xfwm4} $out/share/themes/Dracula - cp -a kde/{color-schemes,plasma} $out/share/ - cp -a kde/kvantum $out/share/Kvantum + cp -a kde/{color-schemes,plasma} $out/share/ + cp -a kde/kvantum $out/share/Kvantum - mkdir -p $out/share/aurorae/themes - cp -a kde/aurorae/* $out/share/aurorae/themes/ + mkdir -p $out/share/aurorae/themes + cp -a kde/aurorae/* $out/share/aurorae/themes/ - mkdir -p $out/share/sddm/themes - cp -a kde/sddm/* $out/share/sddm/themes/ + mkdir -p $out/share/sddm/themes + cp -a kde/sddm/* $out/share/sddm/themes/ - mkdir -p $out/share/icons/Dracula-cursors - mv kde/cursors/Dracula-cursors/index.theme $out/share/icons/Dracula-cursors/cursor.theme - mv kde/cursors/Dracula-cursors/cursors $out/share/icons/Dracula-cursors/cursors + mkdir -p $out/share/icons/Dracula-cursors + mv kde/cursors/Dracula-cursors/index.theme $out/share/icons/Dracula-cursors/cursor.theme + mv kde/cursors/Dracula-cursors/cursors $out/share/icons/Dracula-cursors/cursors - runHook postInstall - ''; - }); - }) ]; + runHook postInstall + ''; + }); + }) + ]; } diff --git a/common/overlays/pkgs/coloryou/default.nix b/common/overlays/pkgs/coloryou/default.nix index 36fdbd7c..6e19edd1 100644 --- a/common/overlays/pkgs/coloryou/default.nix +++ b/common/overlays/pkgs/coloryou/default.nix @@ -1,12 +1,11 @@ -{ python3Packages }: - +{python3Packages}: python3Packages.buildPythonPackage rec { pname = "coloryou"; version = "0.0.1"; src = ./.; - propagatedBuildInputs = with python3Packages; [ utils material-color-utilities ]; + propagatedBuildInputs = with python3Packages; [utils material-color-utilities]; postInstall = '' mv -v $out/bin/coloryou.py $out/bin/coloryou diff --git a/common/overlays/pkgs/coloryou/shell.nix b/common/overlays/pkgs/coloryou/shell.nix index 9cb68ec6..761114d9 100644 --- a/common/overlays/pkgs/coloryou/shell.nix +++ b/common/overlays/pkgs/coloryou/shell.nix @@ -1,8 +1,7 @@ with import {}; with pkgs.python311Packages; - -buildPythonPackage rec { - name = "coloryou"; - src = ./.; - propagatedBuildInputs = [ material-color-utilities utils ]; -} + buildPythonPackage rec { + name = "coloryou"; + src = ./.; + propagatedBuildInputs = [material-color-utilities utils]; + } diff --git a/common/overlays/pkgs/input-emulator.nix b/common/overlays/pkgs/input-emulator.nix index c9162cae..0779b512 100644 --- a/common/overlays/pkgs/input-emulator.nix +++ b/common/overlays/pkgs/input-emulator.nix @@ -1,12 +1,12 @@ -{ stdenv -, meson -, ninja -, pkg-config -, cmake -, bash-completion -, fetchFromGitHub +{ + stdenv, + meson, + ninja, + pkg-config, + cmake, + bash-completion, + fetchFromGitHub, }: - stdenv.mkDerivation rec { pname = "input-emulator"; version = "6c35040e6fc4f65ce0519ee76d00d60490bcb987"; diff --git a/common/overlays/pkgs/pam-fprint-grosshack.nix b/common/overlays/pkgs/pam-fprint-grosshack.nix index 857d49fe..cdc44ab5 100644 --- a/common/overlays/pkgs/pam-fprint-grosshack.nix +++ b/common/overlays/pkgs/pam-fprint-grosshack.nix @@ -1,17 +1,17 @@ -{ stdenv -, meson -, ninja -, pkg-config -, glib -, libfprint -, polkit -, dbus -, systemd -, pam -, libpam-wrapper -, fetchFromGitLab +{ + stdenv, + meson, + ninja, + pkg-config, + glib, + libfprint, + polkit, + dbus, + systemd, + pam, + libpam-wrapper, + fetchFromGitLab, }: - stdenv.mkDerivation rec { pname = "pam-fprint-grosshack"; version = "v0.3.0"; diff --git a/common/overlays/pkgs/spotifywm.nix b/common/overlays/pkgs/spotifywm.nix index c15430b3..aa65898a 100644 --- a/common/overlays/pkgs/spotifywm.nix +++ b/common/overlays/pkgs/spotifywm.nix @@ -1,5 +1,4 @@ # https://github.com/NixOS/nixpkgs/blob/77b27fdb6a9ba01f60b8f5c48038938cf14b7d2f/pkgs/applications/audio/spotifywm/default.nix - { lib, stdenv, @@ -8,8 +7,7 @@ makeBinaryWrapper, spotify, symlinkJoin, -}: -let +}: let spotifywm = stdenv.mkDerivation { pname = "spotifywm"; version = "unstable-2022-10-25"; @@ -34,31 +32,31 @@ let ''; }; in -symlinkJoin { - inherit (spotifywm) name; + symlinkJoin { + inherit (spotifywm) name; - nativeBuildInputs = [ - makeBinaryWrapper - ]; + nativeBuildInputs = [ + makeBinaryWrapper + ]; - paths = [ - spotify - spotifywm - ]; + paths = [ + spotify + spotifywm + ]; - postBuild = '' - wrapProgram $out/bin/spotify \ - --suffix LD_PRELOAD : "$out/lib/spotifywm.so" + postBuild = '' + wrapProgram $out/bin/spotify \ + --suffix LD_PRELOAD : "$out/lib/spotifywm.so" - ln -sf $out/bin/spotify $out/bin/spotifywm - ''; + ln -sf $out/bin/spotify $out/bin/spotifywm + ''; - meta = { - homepage = "https://github.com/dasJ/spotifywm"; - description = "Wrapper around Spotify that correctly sets class name before opening the window"; - license = lib.licenses.mit; - platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [ jqueiroz the-argus ]; - mainProgram = "spotify"; - }; -} + meta = { + homepage = "https://github.com/dasJ/spotifywm"; + description = "Wrapper around Spotify that correctly sets class name before opening the window"; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [jqueiroz the-argus]; + mainProgram = "spotify"; + }; + } diff --git a/common/overlays/regreet.nix b/common/overlays/regreet.nix index 4fbe5c31..a6632fe1 100644 --- a/common/overlays/regreet.nix +++ b/common/overlays/regreet.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { programs.regreet = { package = pkgs.greetd.regreet.overrideAttrs (self: super: rec { version = "0.1.1-patched"; diff --git a/common/overlays/squeekboard.nix b/common/overlays/squeekboard.nix index 260aa348..8f8a4eb9 100644 --- a/common/overlays/squeekboard.nix +++ b/common/overlays/squeekboard.nix @@ -1,7 +1,9 @@ final: prev: { squeekboard = prev.squeekboard.overrideAttrs (o: { - patches = (o.patches or [ ]) ++ [ - ./patches/remove-panel.patch - ]; + patches = + (o.patches or []) + ++ [ + ./patches/remove-panel.patch + ]; }); } diff --git a/devices/binto/default.nix b/devices/binto/default.nix index 8db28a12..2d42d35d 100644 --- a/devices/binto/default.nix +++ b/devices/binto/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { imports = [ ./hardware-configuration.nix @@ -32,7 +32,6 @@ }; home-manager.users = { matt = { - imports = [ ../../home/alacritty.nix ../../home/dconf.nix diff --git a/devices/binto/hardware-configuration.nix b/devices/binto/hardware-configuration.nix index dc1caa5e..f21ac7f1 100644 --- a/devices/binto/hardware-configuration.nix +++ b/devices/binto/hardware-configuration.nix @@ -1,21 +1,27 @@ -{ config, lib, modulesPath, pkgs, ... }: { - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; +{ + config, + lib, + modulesPath, + pkgs, + ... +}: { + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; boot = { kernelPackages = pkgs.linuxPackages_xanmod_latest; - kernelModules = [ "kvm-amd" ]; + kernelModules = ["kvm-amd"]; extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; - supportedFilesystems = [ "ntfs" ]; + supportedFilesystems = ["ntfs"]; consoleLogLevel = 0; initrd = { verbose = false; systemd.enable = true; - availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; }; loader = { @@ -35,10 +41,10 @@ }; fileSystems = { - "/" ={ + "/" = { device = "/dev/disk/by-uuid/560976b6-85e0-44ca-bb73-e15a78e9c449"; fsType = "btrfs"; - options = [ "subvol=@" ]; + options = ["subvol=@"]; }; "/boot" = { diff --git a/devices/binto/home/packages.nix b/devices/binto/home/packages.nix index 632ab931..6c468fe5 100644 --- a/devices/binto/home/packages.nix +++ b/devices/binto/home/packages.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { # Disable compositor in X11 for best performance # TODO: add mic sound xdg.configFile."gpu-screen-recorder.env".text = '' @@ -21,7 +21,7 @@ icon = "com.github.iwalton3.jellyfin-media-player"; terminal = false; type = "Application"; - categories = [ "AudioVideo" "Video" "Player" "TV" ]; + categories = ["AudioVideo" "Video" "Player" "TV"]; settings = { Version = "1.0"; StartupWMClass = "jellyfin-media-player"; diff --git a/devices/binto/modules/desktop.nix b/devices/binto/modules/desktop.nix index a3deb14f..f6f5127b 100644 --- a/devices/binto/modules/desktop.nix +++ b/devices/binto/modules/desktop.nix @@ -1,4 +1,8 @@ -{ pkgs, lib, ... }: { +{ + pkgs, + lib, + ... +}: { programs.dconf.enable = true; services = { diff --git a/devices/binto/modules/gpu-replay.nix b/devices/binto/modules/gpu-replay.nix index e6380754..c242b479 100644 --- a/devices/binto/modules/gpu-replay.nix +++ b/devices/binto/modules/gpu-replay.nix @@ -1,19 +1,25 @@ -{ pkgs, lib, ... }: let - gsr = (pkgs.gpu-screen-recorder.overrideAttrs (o: { +{ + pkgs, + lib, + ... +}: let + gsr = pkgs.gpu-screen-recorder.overrideAttrs (o: { src = pkgs.fetchgit { url = "https://repo.dec05eba.com/gpu-screen-recorder"; rev = "1ac862d155e10f050e6f6cca5381f9f5a3528d98"; hash = "sha256-wLiBn4VIi+IWY4qVkdFzkHhECTFH97snogVTEwM5yx8="; }; - buildInputs = (o.buildInputs or [ ]) ++ (with pkgs; [ - wayland - wayland-protocols - libdrm - libva - xorg.libXrandr - libglvnd - ]); + buildInputs = + (o.buildInputs or []) + ++ (with pkgs; [ + wayland + wayland-protocols + libdrm + libva + xorg.libXrandr + libglvnd + ]); postPatch = ""; @@ -30,7 +36,7 @@ pkgs.libglvnd ]}" ''; - })); + }); in { environment.systemPackages = with pkgs; [ pulseaudio # for getting audio sink diff --git a/devices/binto/modules/nix-gaming.nix b/devices/binto/modules/nix-gaming.nix index d352c347..81bf8dd0 100644 --- a/devices/binto/modules/nix-gaming.nix +++ b/devices/binto/modules/nix-gaming.nix @@ -1,4 +1,8 @@ -{ nix-gaming, pkgs, ... }: { +{ + nix-gaming, + pkgs, + ... +}: { imports = [ nix-gaming.nixosModules.steamCompat ]; diff --git a/devices/binto/modules/nvidia.nix b/devices/binto/modules/nvidia.nix index 92217f48..5681d63a 100644 --- a/devices/binto/modules/nvidia.nix +++ b/devices/binto/modules/nvidia.nix @@ -1,5 +1,4 @@ -{ config, ... }: -{ +{config, ...}: { # Enable OpenGL hardware.opengl = { enable = true; @@ -11,7 +10,6 @@ services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { - # Modesetting is required. modesetting.enable = true; @@ -23,15 +21,15 @@ # Use the NVidia open source kernel module (not to be confused with the # independent third-party "nouveau" open source driver). - # Support is limited to the Turing and later architectures. Full list of - # supported GPUs is at: - # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus + # Support is limited to the Turing and later architectures. Full list of + # supported GPUs is at: + # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus # Only available from driver 515.43.04+ # Do not disable this unless your GPU is unsupported or if you have a good reason to. open = true; # Enable the Nvidia settings menu, - # accessible via `nvidia-settings`. + # accessible via `nvidia-settings`. nvidiaSettings = true; # Optionally, you may need to select the appropriate driver version for your specific GPU. diff --git a/devices/wim/default.nix b/devices/wim/default.nix index 76175783..7d29eab7 100644 --- a/devices/wim/default.nix +++ b/devices/wim/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { imports = [ ./hardware-configuration.nix diff --git a/devices/wim/hardware-configuration.nix b/devices/wim/hardware-configuration.nix index aad4573a..c5d88342 100644 --- a/devices/wim/hardware-configuration.nix +++ b/devices/wim/hardware-configuration.nix @@ -1,10 +1,15 @@ -{ config, modulesPath, pkgs, ... }: { +{ + config, + modulesPath, + pkgs, + ... +}: { nixpkgs.hostPlatform = "x86_64-linux"; - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; boot = { kernelPackages = pkgs.linuxPackages_latest; - kernelModules = [ "kvm-amd" ]; + kernelModules = ["kvm-amd"]; extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; @@ -19,7 +24,7 @@ initrd = { verbose = false; systemd.enable = true; - availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ]; + availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod"]; luks.devices."root" = { device = "/dev/disk/by-uuid/ab82b477-2477-453f-b95f-28e5553ad10d"; diff --git a/devices/wim/home/dotfiles.nix b/devices/wim/home/dotfiles.nix index 8a301183..584c9b01 100644 --- a/devices/wim/home/dotfiles.nix +++ b/devices/wim/home/dotfiles.nix @@ -1,23 +1,26 @@ -{ config, pkgs, ... }: let +{ + config, + pkgs, + ... +}: let configDir = config.services.device-vars.configDir; symlink = config.lib.file.mkOutOfStoreSymlink; -in -{ +in { xdg.configFile = { - "gtklock/config.ini".source = pkgs.writeText "config.ini" '' + "gtklock/config.ini".source = pkgs.writeText "config.ini" '' [main] modules=${builtins.concatStringsSep ";" [ "${pkgs.gtklock-powerbar-module}/lib/gtklock/powerbar-module.so" "${pkgs.gtklock-playerctl-module}/lib/gtklock/playerctl-module.so" ]} - ''; - "gtklock/style.css".source = symlink "${configDir}/gtklock/style.css"; + ''; + "gtklock/style.css".source = symlink "${configDir}/gtklock/style.css"; - "dolphinrc".source = symlink "${configDir}/dolphinrc"; - "kdeglobals".source = symlink "${configDir}/kdeglobals"; - "kiorc".source = symlink "${configDir}/kiorc"; - "mimeapps.list".source = symlink "${configDir}/mimeapps.list"; - "neofetch".source = symlink "${configDir}/neofetch"; - "swappy".source = symlink "${configDir}/swappy"; + "dolphinrc".source = symlink "${configDir}/dolphinrc"; + "kdeglobals".source = symlink "${configDir}/kdeglobals"; + "kiorc".source = symlink "${configDir}/kiorc"; + "mimeapps.list".source = symlink "${configDir}/mimeapps.list"; + "neofetch".source = symlink "${configDir}/neofetch"; + "swappy".source = symlink "${configDir}/swappy"; }; } diff --git a/devices/wim/home/hyprland.nix b/devices/wim/home/hyprland.nix index 1c113838..37e64db9 100644 --- a/devices/wim/home/hyprland.nix +++ b/devices/wim/home/hyprland.nix @@ -1,4 +1,12 @@ -{ pkgs, config, hyprland, hyprgrass, ags, osConfig, ... }: let +{ + pkgs, + config, + hyprland, + hyprgrass, + ags, + osConfig, + ... +}: let configDir = config.services.device-vars.configDir; symlink = config.lib.file.mkOutOfStoreSymlink; @@ -13,7 +21,7 @@ in { enable = true; configDir = symlink "${configDir}/ags"; package = ags.packages.x86_64-linux.default; - extraPackages = [ pkgs.libgudev ]; + extraPackages = [pkgs.libgudev]; }; wayland.windowManager.hyprland = { @@ -43,7 +51,7 @@ in { "swww init --no-cache && swww img -t none ${pkgs.dracula-theme}/wallpapers/waves.png" ]; - source = [ "~/.config/hypr/main.conf" ]; + source = ["~/.config/hypr/main.conf"]; }; }; @@ -68,7 +76,6 @@ in { networkmanagerapplet # TODO: replace with ags widget blueberry # TODO: replace with ags widget - # Hyprland swww swayidle diff --git a/devices/wim/home/packages.nix b/devices/wim/home/packages.nix index 390142b4..e384ad8d 100644 --- a/devices/wim/home/packages.nix +++ b/devices/wim/home/packages.nix @@ -1,8 +1,11 @@ -{ pkgs, nixpkgs-wayland, ... }: let +{ + pkgs, + nixpkgs-wayland, + ... +}: let waypkgs = nixpkgs-wayland.packages.x86_64-linux; in { programs = { - obs-studio = { enable = true; plugins = with waypkgs; [ @@ -13,76 +16,74 @@ in { btop.enable = true; }; - home.packages = (with pkgs.python311Packages; [ - python - pyclip - ]) ++ + home.packages = + (with pkgs.python311Packages; [ + python + pyclip + ]) + ++ (with pkgs.plasma5Packages; [ + polkit-kde-agent + ark + kcharselect + kdenlive + okular - (with pkgs.plasma5Packages; [ - polkit-kde-agent - ark - kcharselect - kdenlive - okular + # Dolphin & co + dolphin + dolphin-plugins + kdegraphics-thumbnailers + ffmpegthumbs + kio + kio-admin # needs to be both here and in system pkgs + kio-extras + kmime + ]) + ++ (with pkgs.gnome; [ + gnome-calculator + seahorse + ]) + ++ (with pkgs; [ + # School + virt-manager + bluej + #camunda-modeler - # Dolphin & co - dolphin - dolphin-plugins - kdegraphics-thumbnailers - ffmpegthumbs - kio - kio-admin # needs to be both here and in system pkgs - kio-extras - kmime - ]) ++ + # Misc Apps + thunderbird # TODO: use programs.thunderbird + spotifywm + zeal + libreoffice-fresh # TODO: add spelling stuff and declarative conf? + photoqt + gimp-with-plugins # TODO: set plugins using nix + vlc + nextcloud-client + jellyfin-media-player + xournalpp + (pkgs.discord.override { + withOpenASAR = true; + withVencord = true; + }) + prismlauncher-qt5 - (with pkgs.gnome; [ - gnome-calculator - seahorse - ]) ++ + # Misc CLI + acpi + alsa-utils + fontfor - (with pkgs; [ - # School - virt-manager - bluej - #camunda-modeler - - # Misc Apps - thunderbird # TODO: use programs.thunderbird - spotifywm - zeal - libreoffice-fresh # TODO: add spelling stuff and declarative conf? - photoqt - gimp-with-plugins # TODO: set plugins using nix - vlc - nextcloud-client - jellyfin-media-player - xournalpp - (pkgs.discord.override { - withOpenASAR = true; - withVencord = true; - }) - prismlauncher-qt5 - - # Misc CLI - acpi - alsa-utils - fontfor - - (writeShellScriptBin "Gparted" '' - ( - sleep 1.5 - while killall -r -0 ksshaskpass > /dev/null 2>&1 - do - sleep 0.1 - if [[ $(hyprctl activewindow | grep Ksshaskpass) == "" ]]; then - killall -r ksshaskpass - fi - done - ) & - exec env SUDO_ASKPASS=${pkgs.plasma5Packages.ksshaskpass}/bin/${pkgs.plasma5Packages.ksshaskpass.pname} sudo -k -EA "${gparted}/bin/${gparted.pname}" "$@" - '') - ]); + (writeShellScriptBin "Gparted" '' + ( + sleep 1.5 + while killall -r -0 ksshaskpass > /dev/null 2>&1 + do + sleep 0.1 + if [[ $(hyprctl activewindow | grep Ksshaskpass) == "" ]]; then + killall -r ksshaskpass + fi + done + ) & + exec env SUDO_ASKPASS=${pkgs.plasma5Packages.ksshaskpass}/bin/${pkgs.plasma5Packages.ksshaskpass.pname} sudo -k -EA "${gparted}/bin/${gparted.pname}" "$@" + '') + ]); xdg.desktopEntries.gparted = { name = "GParted"; @@ -92,7 +93,7 @@ in { icon = "gparted"; terminal = false; type = "Application"; - categories = [ "GNOME" "System" "Filesystem" ]; + categories = ["GNOME" "System" "Filesystem"]; startupNotify = true; settings = { Keywords = "Partition"; diff --git a/devices/wim/modules/desktop.nix b/devices/wim/modules/desktop.nix index a06bc19d..30a96d53 100644 --- a/devices/wim/modules/desktop.nix +++ b/devices/wim/modules/desktop.nix @@ -1,4 +1,8 @@ -{ hyprland, pkgs, ... }: { +{ + hyprland, + pkgs, + ... +}: { programs.dconf.enable = true; services = { diff --git a/devices/wim/modules/security.nix b/devices/wim/modules/security.nix index 762e9a7f..2068eb9d 100644 --- a/devices/wim/modules/security.nix +++ b/devices/wim/modules/security.nix @@ -1,11 +1,13 @@ -{ pkgs, lib, ... }: - { + pkgs, + lib, + ... +}: { services.fprintd.enable = true; # https://www.reddit.com/r/NixOS/comments/z7i83r/fingertip_tip_start_fprintd_at_boot_for_a_quick/ systemd.services.fprintd = { - wantedBy = [ "multi-user.target" ]; + wantedBy = ["multi-user.target"]; serviceConfig.Type = "simple"; }; @@ -16,11 +18,10 @@ ''; security.pam.services = { - gtklock = {}; # all the changes in /etc/pam.d/* - sddm.text = lib.mkBefore '' + sddm.text = lib.mkBefore '' auth [success=1 new_authtok_reqd=1 default=ignore] pam_unix.so try_first_pass likeauth nullok auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so ''; diff --git a/flake.nix b/flake.nix index 9db6e284590eced3d2111bb02ee1bbdfa7375a24..6bec637cd3d318445968460687c645a564f75522 100644 GIT binary patch delta 412 zcmcb?e^hY8BbGoe1t2I+%}LV%voi8?Q+0C_^Agijiy$I-nH9R}iMg41>2Q8Qc6u?C zQwmk3r>6(hU#sAtFj<^6iw$g+!sbR+Uq)958)S__N@`kSX-qc!Ph#BNkJI;?$fp9fiEiih}I)VjYEy{M=OC+{C=Z^wc7ta4Cq$tk6wQ%+1V8 z*HO^Z(^IH*m~70N#iUR@`9G`J=H0BOjG_uDscDI&IVHaNDWy57#R}Tm3ejAXrP&oG b+p@RdkbT3hBo%ATr2q!C5C)h6617|a;CL|< diff --git a/home/alacritty.nix b/home/alacritty.nix index 768193f3..fbd6ac9c 100644 --- a/home/alacritty.nix +++ b/home/alacritty.nix @@ -1,4 +1,4 @@ -{ config, ... }: { +{config, ...}: { programs.alacritty = { enable = true; settings = { diff --git a/home/dconf.nix b/home/dconf.nix index 15ffc810..86f22c47 100644 --- a/home/dconf.nix +++ b/home/dconf.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { dconf.settings = { "org/virt-manager/virt-manager/connections" = { autoconnect = ["qemu:///system"]; @@ -6,7 +6,7 @@ }; "apps/seahorse/listing" = { - keyrings-selected = [ "gnupg://" ]; + keyrings-selected = ["gnupg://"]; }; "org/gtk/settings/file-chooser" = { diff --git a/home/firefox/addons/default.nix b/home/firefox/addons/default.nix index 7d238259..1cce2b63 100644 --- a/home/firefox/addons/default.nix +++ b/home/firefox/addons/default.nix @@ -1,16 +1,25 @@ -{ fetchurl, lib, stdenv }@args: - -let - - buildFirefoxXpiAddon = lib.makeOverridable ({ stdenv ? args.stdenv - , fetchurl ? args.fetchurl, pname, version, addonId, url, sha256, meta, ... - }: +{ + fetchurl, + lib, + stdenv, +} @ args: let + buildFirefoxXpiAddon = lib.makeOverridable ({ + stdenv ? args.stdenv, + fetchurl ? args.fetchurl, + pname, + version, + addonId, + url, + sha256, + meta, + ... + }: stdenv.mkDerivation { name = "${pname}-${version}"; inherit meta; - src = fetchurl { inherit url sha256; }; + src = fetchurl {inherit url sha256;}; preferLocalBuild = true; allowSubstitutes = true; @@ -25,23 +34,25 @@ let packages = import ./generated-firefox-addons.nix { inherit buildFirefoxXpiAddon fetchurl lib stdenv; }; +in + packages + // { + inherit buildFirefoxXpiAddon; -in packages // { - inherit buildFirefoxXpiAddon; - - seventv = let - version = "v3.0.10.1000"; - in buildFirefoxXpiAddon { - pname = "seventv"; - inherit version; - addonId = "moz-addon@7tv.app"; - url = "https://extension.7tv.gg/${version}/ext.xpi"; - sha256 = "sha256-dZyjFayvnLebSZHjMTTQFjcsxxpmc1aL5q17mLF3kG8="; - meta = with lib; { - homepage = "https://7tv.app/"; - description = "The Web Extension for 7TV, bringing new features, emotes, vanity and performance to Twitch, Kick & YouTube"; - license = licenses.asl20; - platforms = platforms.all; - }; - }; -} + seventv = let + version = "v3.0.10.1000"; + in + buildFirefoxXpiAddon { + pname = "seventv"; + inherit version; + addonId = "moz-addon@7tv.app"; + url = "https://extension.7tv.gg/${version}/ext.xpi"; + sha256 = "sha256-dZyjFayvnLebSZHjMTTQFjcsxxpmc1aL5q17mLF3kG8="; + meta = with lib; { + homepage = "https://7tv.app/"; + description = "The Web Extension for 7TV, bringing new features, emotes, vanity and performance to Twitch, Kick & YouTube"; + license = licenses.asl20; + platforms = platforms.all; + }; + }; + } diff --git a/home/firefox/addons/generated-firefox-addons.nix b/home/firefox/addons/generated-firefox-addons.nix index b46b882c..bc031965 100644 --- a/home/firefox/addons/generated-firefox-addons.nix +++ b/home/firefox/addons/generated-firefox-addons.nix @@ -1,105 +1,104 @@ -{ buildFirefoxXpiAddon, fetchurl, lib, stdenv }: - { - "600-sound-volume" = buildFirefoxXpiAddon { - pname = "600-sound-volume"; - version = "1.5.3"; - addonId = "{c4b582ec-4343-438c-bda2-2f691c16c262}"; - url = "https://addons.mozilla.org/firefox/downloads/file/4133303/600_sound_volume-1.5.3.xpi"; - sha256 = "7045a812608338f95181459ae3e518bb51c8dc9a724a4083afb687d14075c304"; - meta = with lib; - { - homepage = "http://resourcefulman.net/"; - description = "Up to 600% volume boost"; - license = licenses.mpl20; - mozPermissions = [ "" "tabs" "activeTab" "storage" ]; - platforms = platforms.all; - }; - }; - "checkmarks-web-ext" = buildFirefoxXpiAddon { - pname = "checkmarks-web-ext"; - version = "1.6.1"; - addonId = "{bd97f89b-17ba-4539-9fec-06852d07f917}"; - url = "https://addons.mozilla.org/firefox/downloads/file/3594420/checkmarks_web_ext-1.6.1.xpi"; - sha256 = "c3ccf4b302ee96c9b883c4a1f7d26395ab4e276b976cab2d65c9cd898964e4f0"; - meta = with lib; - { - homepage = "https://github.com/tanwald/checkmarks"; - description = "Checks, sorts, formats bookmarks and loads favicons."; - license = licenses.gpl3; - mozPermissions = [ - "" - "bookmarks" - "browsingData" - "storage" - "tabs" - "webNavigation" - "webRequest" - "webRequestBlocking" - ]; - platforms = platforms.all; - }; - }; - "google-container" = buildFirefoxXpiAddon { - pname = "google-container"; - version = "1.5.4"; - addonId = "@contain-google"; - url = "https://addons.mozilla.org/firefox/downloads/file/3736912/google_container-1.5.4.xpi"; - sha256 = "47a7c0e85468332a0d949928d8b74376192cde4abaa14280002b3aca4ec814d0"; - meta = with lib; - { - homepage = "https://github.com/containers-everywhere/contain-google"; - description = "THIS IS NOT AN OFFICIAL ADDON FROM MOZILLA!\nIt is a fork of the Facebook Container addon.\n\nPrevent Google from tracking you around the web. The Google Container extension helps you take control and isolate your web activity from Google."; - license = licenses.mpl20; - mozPermissions = [ - "" - "contextualIdentities" - "cookies" - "management" - "tabs" - "webRequestBlocking" - "webRequest" - "storage" - ]; - platforms = platforms.all; - }; - }; - "opera-gx-witchcraft-purple" = buildFirefoxXpiAddon { - pname = "opera-gx-witchcraft-purple"; - version = "2.0"; - addonId = "{bf197856-a3c2-4280-84c5-9b556379b706}"; - url = "https://addons.mozilla.org/firefox/downloads/file/3522842/opera_gx_witchcraft_purple-2.0.xpi"; - sha256 = "aa3c6377b8571c42a3988de042694be70ec6a250a9aea7ae1cc262acdc9374eb"; - meta = with lib; - { - description = "inspired by Opera GX"; - license = licenses.cc-by-sa-30; - mozPermissions = []; - platforms = platforms.all; - }; - }; - "ttv-lol-pro" = buildFirefoxXpiAddon { - pname = "ttv-lol-pro"; - version = "2.2.1"; - addonId = "{76ef94a4-e3d0-4c6f-961a-d38a429a332b}"; - url = "https://addons.mozilla.org/firefox/downloads/file/4179399/ttv_lol_pro-2.2.1.xpi"; - sha256 = "83d012878021fb5fe25bee1101a7a760974ae9e2949b80fd99b73d3da48b1f99"; - meta = with lib; - { - homepage = "https://github.com/younesaassila/ttv-lol-pro"; - description = "TTV LOL PRO removes most livestream ads from Twitch."; - license = licenses.gpl3; - mozPermissions = [ - "proxy" - "storage" - "webRequest" - "webRequestBlocking" - "https://*.ttvnw.net/*" - "https://*.twitch.tv/*" - "https://perfprod.com/ttvlolpro/telemetry" - "https://www.twitch.tv/*" - "https://m.twitch.tv/*" - ]; - platforms = platforms.all; - }; - }; - } \ No newline at end of file +{ + buildFirefoxXpiAddon, + fetchurl, + lib, + stdenv, +}: { + "600-sound-volume" = buildFirefoxXpiAddon { + pname = "600-sound-volume"; + version = "1.5.3"; + addonId = "{c4b582ec-4343-438c-bda2-2f691c16c262}"; + url = "https://addons.mozilla.org/firefox/downloads/file/4133303/600_sound_volume-1.5.3.xpi"; + sha256 = "7045a812608338f95181459ae3e518bb51c8dc9a724a4083afb687d14075c304"; + meta = with lib; { + homepage = "http://resourcefulman.net/"; + description = "Up to 600% volume boost"; + license = licenses.mpl20; + mozPermissions = ["" "tabs" "activeTab" "storage"]; + platforms = platforms.all; + }; + }; + "checkmarks-web-ext" = buildFirefoxXpiAddon { + pname = "checkmarks-web-ext"; + version = "1.6.1"; + addonId = "{bd97f89b-17ba-4539-9fec-06852d07f917}"; + url = "https://addons.mozilla.org/firefox/downloads/file/3594420/checkmarks_web_ext-1.6.1.xpi"; + sha256 = "c3ccf4b302ee96c9b883c4a1f7d26395ab4e276b976cab2d65c9cd898964e4f0"; + meta = with lib; { + homepage = "https://github.com/tanwald/checkmarks"; + description = "Checks, sorts, formats bookmarks and loads favicons."; + license = licenses.gpl3; + mozPermissions = [ + "" + "bookmarks" + "browsingData" + "storage" + "tabs" + "webNavigation" + "webRequest" + "webRequestBlocking" + ]; + platforms = platforms.all; + }; + }; + "google-container" = buildFirefoxXpiAddon { + pname = "google-container"; + version = "1.5.4"; + addonId = "@contain-google"; + url = "https://addons.mozilla.org/firefox/downloads/file/3736912/google_container-1.5.4.xpi"; + sha256 = "47a7c0e85468332a0d949928d8b74376192cde4abaa14280002b3aca4ec814d0"; + meta = with lib; { + homepage = "https://github.com/containers-everywhere/contain-google"; + description = "THIS IS NOT AN OFFICIAL ADDON FROM MOZILLA!\nIt is a fork of the Facebook Container addon.\n\nPrevent Google from tracking you around the web. The Google Container extension helps you take control and isolate your web activity from Google."; + license = licenses.mpl20; + mozPermissions = [ + "" + "contextualIdentities" + "cookies" + "management" + "tabs" + "webRequestBlocking" + "webRequest" + "storage" + ]; + platforms = platforms.all; + }; + }; + "opera-gx-witchcraft-purple" = buildFirefoxXpiAddon { + pname = "opera-gx-witchcraft-purple"; + version = "2.0"; + addonId = "{bf197856-a3c2-4280-84c5-9b556379b706}"; + url = "https://addons.mozilla.org/firefox/downloads/file/3522842/opera_gx_witchcraft_purple-2.0.xpi"; + sha256 = "aa3c6377b8571c42a3988de042694be70ec6a250a9aea7ae1cc262acdc9374eb"; + meta = with lib; { + description = "inspired by Opera GX"; + license = licenses.cc-by-sa-30; + mozPermissions = []; + platforms = platforms.all; + }; + }; + "ttv-lol-pro" = buildFirefoxXpiAddon { + pname = "ttv-lol-pro"; + version = "2.2.1"; + addonId = "{76ef94a4-e3d0-4c6f-961a-d38a429a332b}"; + url = "https://addons.mozilla.org/firefox/downloads/file/4179399/ttv_lol_pro-2.2.1.xpi"; + sha256 = "83d012878021fb5fe25bee1101a7a760974ae9e2949b80fd99b73d3da48b1f99"; + meta = with lib; { + homepage = "https://github.com/younesaassila/ttv-lol-pro"; + description = "TTV LOL PRO removes most livestream ads from Twitch."; + license = licenses.gpl3; + mozPermissions = [ + "proxy" + "storage" + "webRequest" + "webRequestBlocking" + "https://*.ttvnw.net/*" + "https://*.twitch.tv/*" + "https://perfprod.com/ttvlolpro/telemetry" + "https://www.twitch.tv/*" + "https://m.twitch.tv/*" + ]; + platforms = platforms.all; + }; + }; +} diff --git a/home/firefox/default.nix b/home/firefox/default.nix index f515192b..5c6252f6 100644 --- a/home/firefox/default.nix +++ b/home/firefox/default.nix @@ -1,14 +1,17 @@ -{ config, pkgs, ... }: let - firefox-addons = pkgs.recurseIntoAttrs (pkgs.callPackage ./addons { }); +{ + config, + pkgs, + ... +}: let + firefox-addons = pkgs.recurseIntoAttrs (pkgs.callPackage ./addons {}); sound-volume = firefox-addons."600-sound-volume"; - firefox-gx = pkgs.callPackage ./firefox-gx { }; -in -{ + firefox-gx = pkgs.callPackage ./firefox-gx {}; +in { home.file = { - ".mozilla/firefox/matt/chrome/components".source = "${firefox-gx}/chrome/components"; - ".mozilla/firefox/matt/chrome/icons".source = "${firefox-gx}/chrome/icons"; - ".mozilla/firefox/matt/chrome/images".source = "${firefox-gx}/chrome/images"; + ".mozilla/firefox/matt/chrome/components".source = "${firefox-gx}/chrome/components"; + ".mozilla/firefox/matt/chrome/icons".source = "${firefox-gx}/chrome/icons"; + ".mozilla/firefox/matt/chrome/images".source = "${firefox-gx}/chrome/images"; ".mozilla/firefox/matt/chrome/userContent.css".source = "${firefox-gx}/chrome/userContent.css"; }; @@ -76,69 +79,89 @@ in force = true; engines = { "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake-white.svg"; - definedAliases = [ "@np" ]; + definedAliases = ["@np"]; }; "NixOS Wiki" = { - urls = [{ template = - "https://nixos.wiki/index.php?search={searchTerms}"; - }]; + urls = [ + { + template = "https://nixos.wiki/index.php?search={searchTerms}"; + } + ]; iconUpdateURL = "https://nixos.wiki/favicon.png"; updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ "@nw" ]; + definedAliases = ["@nw"]; }; "MyNixos" = { - urls = [{ template = - "https://mynixos.com/search?q={searchTerms}"; - }]; + urls = [ + { + template = "https://mynixos.com/search?q={searchTerms}"; + } + ]; iconUpdateURL = "https://mynixos.com/favicon.ico"; updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ "@mn" ]; + definedAliases = ["@mn"]; }; "Noogle" = { - urls = [{ template = - "https://noogle.dev/?term={searchTerms}"; - }]; + urls = [ + { + template = "https://noogle.dev/?term={searchTerms}"; + } + ]; iconUpdateURL = "https://noogle.dev/favicon.ico"; updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ "@ng" ]; + definedAliases = ["@ng"]; }; "Firefox Add-ons" = { - urls = [{ template = - "https://addons.mozilla.org/en-US/firefox/search/?q={searchTerms}"; - }]; + urls = [ + { + template = "https://addons.mozilla.org/en-US/firefox/search/?q={searchTerms}"; + } + ]; iconUpdateURL = "https://addons.mozilla.org/favicon.ico"; updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ "@fa" ]; + definedAliases = ["@fa"]; }; "ProtonDB" = { - urls = [{ template = - "https://www.protondb.com/search?q={searchTerms}"; - }]; + urls = [ + { + template = "https://www.protondb.com/search?q={searchTerms}"; + } + ]; iconUpdateURL = "https://www.protondb.com/favicon.ico"; updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ "@pdb" ]; + definedAliases = ["@pdb"]; }; "YouTube" = { - urls = [{ template = - "https://www.youtube.com/results?search_query={searchTerms}"; - }]; + urls = [ + { + template = "https://www.youtube.com/results?search_query={searchTerms}"; + } + ]; iconUpdateURL = "https://www.youtube.com/favicon.ico"; updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ "@yt" "@youtube" ]; + definedAliases = ["@yt" "@youtube"]; }; "Bing".metaData.hidden = true; @@ -160,31 +183,29 @@ in }; extensions = with config.nur.repos; - (with bandithedoge.firefoxAddons; [ - sponsorblock - stylus - #tridactyl - ublock-origin - ]) ++ - - (with rycee.firefox-addons; [ - bitwarden - darkreader - floccus - istilldontcareaboutcookies - image-search-options - return-youtube-dislikes - undoclosetabbutton - ]) ++ - - (with firefox-addons; [ - sound-volume - google-container - checkmarks-web-ext - ttv-lol-pro - seventv - opera-gx-witchcraft-purple - ]); + (with bandithedoge.firefoxAddons; [ + sponsorblock + stylus + #tridactyl + ublock-origin + ]) + ++ (with rycee.firefox-addons; [ + bitwarden + darkreader + floccus + istilldontcareaboutcookies + image-search-options + return-youtube-dislikes + undoclosetabbutton + ]) + ++ (with firefox-addons; [ + sound-volume + google-container + checkmarks-web-ext + ttv-lol-pro + seventv + opera-gx-witchcraft-purple + ]); }; }; } diff --git a/home/firefox/firefox-gx/default.nix b/home/firefox/firefox-gx/default.nix index dbabd9e5..55fc5bc4 100644 --- a/home/firefox/firefox-gx/default.nix +++ b/home/firefox/firefox-gx/default.nix @@ -1,40 +1,44 @@ -{ lib, stdenvNoCC, fetchFromGitHub, writeText }: -let +{ + lib, + stdenvNoCC, + fetchFromGitHub, + writeText, +}: let pname = "firefox-gx"; version = "8.5"; custom-menu = writeText "menu" "${builtins.readFile ./ogx_menu.css}"; custom-sidebar = writeText "sidebar" "${builtins.readFile ./ogx_left-sidebar.css}"; in -stdenvNoCC.mkDerivation { - inherit pname version; + stdenvNoCC.mkDerivation { + inherit pname version; - src = fetchFromGitHub { - owner = "Godiesc"; - repo = pname; - rev = "v.${version}"; - sha256 = "sha256-llffq16PZz5GxkLIJDeWN1d04SCCJFqwCLzOrxgwhYI="; - }; + src = fetchFromGitHub { + owner = "Godiesc"; + repo = pname; + rev = "v.${version}"; + sha256 = "sha256-llffq16PZz5GxkLIJDeWN1d04SCCJFqwCLzOrxgwhYI="; + }; - installPhase = '' - # Personal changes - sed -i 's/var(--fuchsia))/var(--purple))/' ./chrome/components/ogx_root-personal.css + installPhase = '' + # Personal changes + sed -i 's/var(--fuchsia))/var(--purple))/' ./chrome/components/ogx_root-personal.css - # Fix new tab background for nix - substituteInPlace ./chrome/components/ogx_root-personal.css \ - --replace '../images/newtab/wallpaper-dark.png' "$out/chrome/images/newtab/private-dark.png" + # Fix new tab background for nix + substituteInPlace ./chrome/components/ogx_root-personal.css \ + --replace '../images/newtab/wallpaper-dark.png' "$out/chrome/images/newtab/private-dark.png" - # TODO: make patch instead - cp -a ${custom-menu} ./chrome/components/ogx_menu.css - cp -a ${custom-sidebar} ./chrome/components/ogx_left-sidebar.css + # TODO: make patch instead + cp -a ${custom-menu} ./chrome/components/ogx_menu.css + cp -a ${custom-sidebar} ./chrome/components/ogx_left-sidebar.css - mkdir -p $out - cp -r ./* $out - ''; + mkdir -p $out + cp -r ./* $out + ''; - meta = with lib; { - description = "Firefox Theme CSS to Opera GX Lovers "; - homepage = "https://github.com/Godiesc/firefox-gx"; - license = licenses.mspl; - }; -} + meta = with lib; { + description = "Firefox Theme CSS to Opera GX Lovers "; + homepage = "https://github.com/Godiesc/firefox-gx"; + license = licenses.mspl; + }; + } diff --git a/home/theme.nix b/home/theme.nix index 07d87f3b..47af0921 100644 --- a/home/theme.nix +++ b/home/theme.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, config, ... }: let +{ + pkgs, + lib, + config, + ... +}: let fontSize = config.services.device-vars.fontSize; dracula-xresources = pkgs.fetchFromGitHub { owner = "dracula"; @@ -6,8 +11,7 @@ rev = "539ef24e9b0c5498a82d59bfa2bad9b618d832a3"; sha256 = "sha256-6fltsAluqOqYIh2NX0I/LC3WCWkb9Fn8PH6LNLBQbrY="; }; -in -{ +in { home.pointerCursor = { name = "Dracula-cursors"; package = pkgs.dracula-theme; @@ -48,7 +52,7 @@ in platformTheme = "qtct"; }; - xresources.extraConfig = builtins.readFile("${dracula-xresources}/Xresources"); + xresources.extraConfig = builtins.readFile "${dracula-xresources}/Xresources"; xdg.configFile = let qtconf = '' @@ -58,13 +62,11 @@ in [Appearance] icon_theme=Flat-Remix-Violet-Dark - style='' - ; - in - { + style=''; + in { "Kvantum/Dracula/Dracula.kvconfig".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula-purple-solid/Dracula-purple-solid.kvconfig"; - "Kvantum/Dracula/Dracula.svg".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula-purple-solid/Dracula-purple-solid.svg"; - "Kvantum/kvantum.kvconfig".text = "[General]\ntheme=Dracula"; + "Kvantum/Dracula/Dracula.svg".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula-purple-solid/Dracula-purple-solid.svg"; + "Kvantum/kvantum.kvconfig".text = "[General]\ntheme=Dracula"; "qt5ct/qt5ct.conf".text = qtconf + "kvantum"; }; diff --git a/home/wofi/default.nix b/home/wofi/default.nix index a243fdc1..03838d16 100644 --- a/home/wofi/default.nix +++ b/home/wofi/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { programs = { wofi = { enable = true; diff --git a/modules/audio.nix b/modules/audio.nix index f8a38ac0..32e347e3 100644 --- a/modules/audio.nix +++ b/modules/audio.nix @@ -1,4 +1,4 @@ -{ nix-gaming, ... }: { +{nix-gaming, ...}: { imports = [ nix-gaming.nixosModules.pipewireLowLatency ]; diff --git a/modules/greetd/default.nix b/modules/greetd/default.nix index 64b90220..7f8f1824 100644 --- a/modules/greetd/default.nix +++ b/modules/greetd/default.nix @@ -1,8 +1,9 @@ -{ lib -, pkgs -, config -, hyprland -, ... +{ + lib, + pkgs, + config, + hyprland, + ... }: let regreetBin = "${lib.getExe config.programs.regreet.package}"; hyprBin = "${hyprland.packages.x86_64-linux.default}/bin"; diff --git a/modules/kmscon.nix b/modules/kmscon.nix index 84577190..c218da82 100644 --- a/modules/kmscon.nix +++ b/modules/kmscon.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { services.kmscon = { enable = true; hwRender = false; diff --git a/modules/plymouth.nix b/modules/plymouth.nix index c3a96d27..b5e64f88 100644 --- a/modules/plymouth.nix +++ b/modules/plymouth.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { boot = { initrd = { verbose = false; @@ -18,7 +18,7 @@ plymouth = { enable = true; - themePackages = [ pkgs.dracula-theme ]; + themePackages = [pkgs.dracula-theme]; theme = "dracula"; }; }; diff --git a/modules/printer.nix b/modules/printer.nix index f9cb7f72..43fd5fd6 100644 --- a/modules/printer.nix +++ b/modules/printer.nix @@ -1,7 +1,6 @@ -{ pkgs, ... }: { - +{pkgs, ...}: { services = { - # Enable CUPS to print documents. + # Enable CUPS to print documents. printing = { enable = true; drivers = with pkgs; [ diff --git a/modules/proton-bridge.nix b/modules/proton-bridge.nix index 12b00f3b..e35729a6 100644 --- a/modules/proton-bridge.nix +++ b/modules/proton-bridge.nix @@ -1,10 +1,10 @@ -{ pkgs, ... }: { +{pkgs, ...}: { systemd.user.services.protonmail-bridge = { description = "Protonmail Bridge"; enable = true; script = "${pkgs.protonmail-bridge}/bin/protonmail-bridge --noninteractive --log-level info"; - path = [ pkgs.gnome.gnome-keyring ]; # HACK: https://github.com/ProtonMail/proton-bridge/issues/176 - wantedBy = [ "graphical-session.target" ]; - partOf = [ "graphical-session.target" ]; + path = [pkgs.gnome.gnome-keyring]; # HACK: https://github.com/ProtonMail/proton-bridge/issues/176 + wantedBy = ["graphical-session.target"]; + partOf = ["graphical-session.target"]; }; } diff --git a/modules/sddm-wayland.nix b/modules/sddm-wayland.nix index 81d54404..51e4c080 100644 --- a/modules/sddm-wayland.nix +++ b/modules/sddm-wayland.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { environment.systemPackages = with pkgs; [ dracula-theme ]; diff --git a/modules/tailscale.nix b/modules/tailscale.nix index 53c6f264..13539439 100644 --- a/modules/tailscale.nix +++ b/modules/tailscale.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { services = { tailscale = { enable = true;