diff --git a/home/default.nix b/home/default.nix index 0ea3853..90c64a0 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,13 +1,9 @@ -{ - config, - lib, - inputs, - self, - ... -}: let +{ config, lib, inputs, self, ... }: +let myHmConf = config.myOptions.home-manager; username = config.myOptions.system.username; -in { +in +{ home-manager = lib.mkIf myHmConf.enable { # Use verbose mode for home-manager verbose = true; @@ -27,7 +23,7 @@ in { backupFileExtension = "hm.old"; # These will be passed to all hm modules - extraSpecialArgs = {inherit inputs self;}; + extraSpecialArgs = { inherit inputs self; }; users.${username} = { # These imports will be scoped under this key so all settings diff --git a/home/impermanence/default.nix b/home/impermanence/default.nix index 98b026c..998659c 100644 --- a/home/impermanence/default.nix +++ b/home/impermanence/default.nix @@ -7,21 +7,18 @@ inherit (lib) mkIf; cfg = osConfig.myOptions.system.impermanence.home; in { - imports = [inputs.impermanence.nixosModules.home-manager.impermanence]; + imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ]; config = mkIf cfg.enable { home.persistence."${cfg.persistentMountPoint}" = { - directories = - [ - ".cache/nix" - ".cache/nix-index" - ] - ++ cfg.extraDirectories; + directories = [ + ".cache/nix" + ".cache/nix-index" + ] ++ cfg.extraDirectories; - files = - [ - ] - ++ cfg.extraFiles; + files = [ + + ] ++ cfg.extraFiles; # Allow other users (such as root), to access files through the bind # mounted directories listed in `directories`. Useful for `sudo` operations, @@ -30,15 +27,13 @@ in { }; home.persistence."${cfg.persistentDataMountPoint}" = { - directories = - [ - ] - ++ cfg.extraDataDirectories; + directories = [ - files = - [ - ] - ++ cfg.extraDataFiles; + ] ++ cfg.extraDataDirectories; + + files = [ + + ] ++ cfg.extraDataFiles; # See comment for this above allowOther = true; diff --git a/home/packages/cli/desktop.nix b/home/packages/cli/desktop.nix index 6c44aba..731345d 100644 --- a/home/packages/cli/desktop.nix +++ b/home/packages/cli/desktop.nix @@ -7,7 +7,7 @@ inherit (lib) mkIf; devType = osConfig.myOptions.device.roles.type; - acceptedTypes = ["laptop" "desktop"]; + acceptedTypes = [ "laptop" "desktop" ]; in { config = mkIf (builtins.elem devType acceptedTypes) { home.packages = with pkgs; [ diff --git a/home/packages/cli/scripts/default.nix b/home/packages/cli/scripts/default.nix index 852942f..1149e67 100644 --- a/home/packages/cli/scripts/default.nix +++ b/home/packages/cli/scripts/default.nix @@ -1,11 +1,15 @@ -{pkgs, ...}: let - scriptPkgs = import ./packages {inherit pkgs;}; +{ + pkgs, + ... +}: let + + scriptPkgs = (import ./packages {inherit pkgs;}); in { - home.packages = with scriptPkgs; [ - bitcoin - cheatsh - colors256 - unix - gh-notify - ]; + home.packages = with scriptPkgs; [ + bitcoin + cheatsh + colors256 + unix + gh-notify + ]; } diff --git a/home/packages/cli/scripts/packages/bitcoin.nix b/home/packages/cli/scripts/packages/bitcoin.nix index e13f49d..737e0d4 100644 --- a/home/packages/cli/scripts/packages/bitcoin.nix +++ b/home/packages/cli/scripts/packages/bitcoin.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: (pkgs.writeShellApplication { +{pkgs, ...}: +(pkgs.writeShellApplication { name = "bitcoin"; runtimeInputs = with pkgs; [coreutils curl jq]; text = '' diff --git a/home/packages/cli/scripts/packages/cheatsh/default.nix b/home/packages/cli/scripts/packages/cheatsh/default.nix index a6841ed..d210476 100644 --- a/home/packages/cli/scripts/packages/cheatsh/default.nix +++ b/home/packages/cli/scripts/packages/cheatsh/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: (pkgs.writeShellApplication { +{pkgs, ...}: +(pkgs.writeShellApplication { name = "cheat.sh"; runtimeInputs = with pkgs; [coreutils curl jq gnugrep fzf]; text = '' diff --git a/home/packages/cli/scripts/packages/colors256/default.nix b/home/packages/cli/scripts/packages/colors256/default.nix index 6a99d2c..ef40b74 100644 --- a/home/packages/cli/scripts/packages/colors256/default.nix +++ b/home/packages/cli/scripts/packages/colors256/default.nix @@ -1,7 +1,9 @@ -{pkgs, ...}: (pkgs.writeShellApplication { +{pkgs, ...}: +(pkgs.writeShellApplication { name = "colors-256"; runtimeInputs = with pkgs; [coreutils]; text = '' ${builtins.readFile ./colors-256.sh} ''; }) + diff --git a/home/packages/cli/scripts/packages/default.nix b/home/packages/cli/scripts/packages/default.nix index 51639e6..d4c4f7f 100644 --- a/home/packages/cli/scripts/packages/default.nix +++ b/home/packages/cli/scripts/packages/default.nix @@ -1,4 +1,7 @@ -{pkgs, ...}: let +{ + pkgs, + ... +}: let packages = { bitcoin = pkgs.callPackage ./bitcoin.nix {}; cheatsh = pkgs.callPackage ./cheatsh {}; @@ -8,3 +11,4 @@ }; in packages + diff --git a/home/packages/cli/scripts/packages/gh-notify/default.nix b/home/packages/cli/scripts/packages/gh-notify/default.nix index 81471c7..cd35398 100644 --- a/home/packages/cli/scripts/packages/gh-notify/default.nix +++ b/home/packages/cli/scripts/packages/gh-notify/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: (pkgs.writeShellApplication { +{pkgs, ...}: +(pkgs.writeShellApplication { name = "gh-notify"; runtimeInputs = with pkgs; [ coreutils @@ -11,3 +12,5 @@ ${builtins.readFile ./gh-notify.sh} ''; }) + + diff --git a/home/packages/cli/scripts/packages/unix/default.nix b/home/packages/cli/scripts/packages/unix/default.nix index fdd4353..1788100 100644 --- a/home/packages/cli/scripts/packages/unix/default.nix +++ b/home/packages/cli/scripts/packages/unix/default.nix @@ -1,7 +1,10 @@ -{pkgs, ...}: (pkgs.writeShellApplication { +{pkgs, ...}: +(pkgs.writeShellApplication { name = "unix"; runtimeInputs = with pkgs; [coreutils]; text = '' ${builtins.readFile ./unix.sh} ''; }) + + diff --git a/home/packages/gui/wayland/swappy.nix b/home/packages/gui/wayland/swappy.nix index 245e48e..6f32ec1 100644 --- a/home/packages/gui/wayland/swappy.nix +++ b/home/packages/gui/wayland/swappy.nix @@ -7,9 +7,10 @@ ... }: let inherit (lib) mkIf; + in { config = mkIf osConfig.myOptions.home-manager.wms.isWayland { - home.packages = with pkgs; [swappy]; + home.packages = with pkgs; [ swappy ]; xdg.configFile."swappy/config".text = lib.generators.toINI {} { Default = { diff --git a/home/packages/gui/wayland/wlogout.nix b/home/packages/gui/wayland/wlogout.nix index c2c7d28..4a47ec5 100644 --- a/home/packages/gui/wayland/wlogout.nix +++ b/home/packages/gui/wayland/wlogout.nix @@ -5,8 +5,11 @@ ... }: let inherit (lib) mkIf; + in { config = mkIf osConfig.myOptions.home-manager.wms.isWayland { - home.packages = with pkgs; [wlogout]; + home.packages = with pkgs; [ wlogout ]; }; } + + diff --git a/home/programs/graphical/apps/obs.nix b/home/programs/graphical/apps/obs.nix index 0c514ad..202d7df 100644 --- a/home/programs/graphical/apps/obs.nix +++ b/home/programs/graphical/apps/obs.nix @@ -16,3 +16,6 @@ in { ]; }; } + + + diff --git a/home/programs/graphical/apps/qalculate-gtk.nix b/home/programs/graphical/apps/qalculate-gtk.nix index 019cf30..a7ff8f8 100644 --- a/home/programs/graphical/apps/qalculate-gtk.nix +++ b/home/programs/graphical/apps/qalculate-gtk.nix @@ -9,6 +9,6 @@ cfg = osConfig.myOptions.home-manager.programs.applications.qalculate-gtk; in { config = mkIf cfg.enable { - home.packages = with pkgs; [qalculate-gtk]; + home.packages = with pkgs; [ qalculate-gtk ]; }; } diff --git a/home/programs/graphical/apps/qbittorrent.nix b/home/programs/graphical/apps/qbittorrent.nix index ceceecf..2275b25 100644 --- a/home/programs/graphical/apps/qbittorrent.nix +++ b/home/programs/graphical/apps/qbittorrent.nix @@ -14,3 +14,4 @@ in { ]; }; } + diff --git a/home/programs/graphical/apps/stremio.nix b/home/programs/graphical/apps/stremio.nix index f1dbf80..4147642 100644 --- a/home/programs/graphical/apps/stremio.nix +++ b/home/programs/graphical/apps/stremio.nix @@ -14,3 +14,4 @@ in { ]; }; } + diff --git a/home/programs/graphical/apps/vesktop/default.nix b/home/programs/graphical/apps/vesktop/default.nix index 2338aad..87f563e 100644 --- a/home/programs/graphical/apps/vesktop/default.nix +++ b/home/programs/graphical/apps/vesktop/default.nix @@ -9,13 +9,13 @@ cfg = osConfig.myOptions.home-manager.programs.applications.vesktop; in { config = mkIf cfg.enable { - home.packages = with pkgs; [vesktop]; + home.packages = with pkgs; [ vesktop ]; systemd.user.services."vesktop" = mkIf cfg.autoStart { Unit = { Description = "Vesktop (An alternate client for Discord with Vencord built-in)"; - After = ["graphical-session.target"]; - PartOf = ["graphical-session.target"]; + After = [ "graphical-session.target" ]; + PartOf = [ "graphical-session.target" ]; }; Service = { @@ -24,7 +24,7 @@ in { ExecStart = "${pkgs.vesktop}/bin/vesktop"; }; - Install.WantedBy = ["graphical-session.target"]; + Install.WantedBy = [ "graphical-session.target" ]; }; }; } diff --git a/home/programs/graphical/apps/webcord/default.nix b/home/programs/graphical/apps/webcord/default.nix index 6828feb..dad3236 100644 --- a/home/programs/graphical/apps/webcord/default.nix +++ b/home/programs/graphical/apps/webcord/default.nix @@ -9,7 +9,7 @@ cfg = osConfig.myOptions.home-manager.programs.applications.webcord; in { config = mkIf cfg.enable { - home.packages = with pkgs; [ + home.packages = with pkgs; [ # Webcord with vencord extension installed webcord-vencord ]; @@ -17,8 +17,8 @@ in { systemd.user.services."webcord" = mkIf cfg.autoStart { Unit = { Description = "Webcord (An electron-based Discord client implemented without Discord API with Vencord built-in)"; - After = ["graphical-session.target"]; - PartOf = ["graphical-session.target"]; + After = [ "graphical-session.target" ]; + PartOf = [ "graphical-session.target" ]; }; Service = { @@ -27,7 +27,8 @@ in { ExecStart = "${pkgs.webcord-vencord}/bin/webcord"; }; - Install.WantedBy = ["graphical-session.target"]; + Install.WantedBy = [ "graphical-session.target" ]; }; }; } + diff --git a/home/programs/graphical/bars/eww/default.nix b/home/programs/graphical/bars/eww/default.nix index f10dd02..a6a680f 100644 --- a/home/programs/graphical/bars/eww/default.nix +++ b/home/programs/graphical/bars/eww/default.nix @@ -1,4 +1,4 @@ -{ +{ lib, pkgs, osConfig, @@ -6,7 +6,7 @@ }: let inherit (lib) mkIf; - scriptPkgs = import ../../../../packages/cli/scripts/packages {inherit pkgs;}; + scriptPkgs = (import ../../../../packages/cli/scripts/packages {inherit pkgs;}); cfg = osConfig.myOptions.home-manager.programs.bars.eww; in { @@ -17,7 +17,7 @@ in { }; systemd.user.services = { - "eww" = let + "eww" = let # All dependencies required for eww and for the scripts/widgets it uses dependencies = with pkgs; [ python3 @@ -44,8 +44,8 @@ in { in { Unit = { Description = "ElKowar's Wacky Widgets (eww) daemon"; - After = ["graphical-session-pre.target"]; - PartOf = ["graphical-session.target"]; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; }; Service = { @@ -63,14 +63,14 @@ in { Nice = 19; }; - Install.WantedBy = ["graphical-session.target"]; + Install.WantedBy = [ "graphical-session.target" ]; }; "eww-window-bar0" = { Unit = { Description = "Open bar0 eww (ElKowar's Wacky Widgets) window"; - After = ["eww.service"]; - PartOf = ["graphical-session.target" "eww.service"]; + After = [ "eww.service" ]; + PartOf = [ "graphical-session.target" "eww.service" ]; }; Service = { @@ -82,7 +82,7 @@ in { Restart = "on-failure"; }; - Install.WantedBy = ["graphical-session.target"]; + Install.WantedBy = [ "graphical-session.target" ]; }; }; }; diff --git a/home/programs/graphical/browsers/chromium/default.nix b/home/programs/graphical/browsers/chromium/default.nix index e428076..dae25da 100644 --- a/home/programs/graphical/browsers/chromium/default.nix +++ b/home/programs/graphical/browsers/chromium/default.nix @@ -14,8 +14,7 @@ in { enable = true; package = pkgs.ungoogled-chromium.override { - commandLineArgs = - [ + commandLineArgs = [ # Ungoogled features "--disable-search-engine-collection" "--extension-mime-request-handling=always-prompt-for-install" @@ -61,12 +60,12 @@ in { "--disable-sync" "--disable-speech-api" "--disable-speech-synthesis-api" - ] - ++ optionals isWayland [ + ] ++ optionals isWayland [ "--ozone-platform=wayland" "--enable-features=UseOzonePlatform" - ]; + ]; }; }; }; } + diff --git a/home/programs/graphical/browsers/default.nix b/home/programs/graphical/browsers/default.nix index d38399c..23b88ae 100644 --- a/home/programs/graphical/browsers/default.nix +++ b/home/programs/graphical/browsers/default.nix @@ -6,3 +6,4 @@ _: { ./firefox ]; } + diff --git a/home/programs/graphical/browsers/schizofox/default.nix b/home/programs/graphical/browsers/schizofox/default.nix index 0582a72..82c93a1 100644 --- a/home/programs/graphical/browsers/schizofox/default.nix +++ b/home/programs/graphical/browsers/schizofox/default.nix @@ -34,7 +34,7 @@ in { search = { defaultSearchEngine = "Brave"; - removeEngines = ["Bing" "Amazon.com" "eBay" "Twitter" "Wikipedia" "LibRedirect"]; + removeEngines = [ "Bing" "Amazon.com" "eBay" "Twitter" "Wikipedia" "LibRedirect" ]; searxUrl = "https://searx.be"; searxQuery = "https://searx.be/search?q={searchTerms}&categories=general"; @@ -47,32 +47,32 @@ in { URLTemplate = "https://search.brave.com/search?q={searchTerms}"; } { - Name = "NixOS Packages"; - Description = "NixOS Unstable package search"; - Alias = "!np"; - Method = "GET"; - URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}"; + Name = "NixOS Packages"; + Description = "NixOS Unstable package search"; + Alias = "!np"; + Method = "GET"; + URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}"; } { - Name = "NixOS Options"; - Description = "NixOS Unstable option search"; - Alias = "!no"; - Method = "GET"; - URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}"; + Name = "NixOS Options"; + Description = "NixOS Unstable option search"; + Alias = "!no"; + Method = "GET"; + URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}"; } { - Name = "NixOS Wiki"; - Description = "NixOS Wiki search"; - Alias = "!nw"; - Method = "GET"; - URLTemplate = "https://nixos.wiki/index.php?search={searchTerms}"; + Name = "NixOS Wiki"; + Description = "NixOS Wiki search"; + Alias = "!nw"; + Method = "GET"; + URLTemplate = "https://nixos.wiki/index.php?search={searchTerms}"; } { - Name = "Home Manager Options"; - Description = "Home Manager option search"; - Alias = "!hm"; - Method = "GET"; - URLTemplate = "https://mipmip.github.io/home-manager-option-search?query={searchTerms}"; + Name = "Home Manager Options"; + Description = "Home Manager option search"; + Alias = "!hm"; + Method = "GET"; + URLTemplate = "https://mipmip.github.io/home-manager-option-search?query={searchTerms}"; } { Name = "MyNixOS"; @@ -82,25 +82,25 @@ in { URLTemplate = "https://mynixos.com/search?q={searchTerms}"; } { - Name = "Arch Wiki"; - Description = "Arch Wiki search"; - Alias = "!aw"; - Method = "GET"; - URLTemplate = "https://wiki.archlinux.org/index.php?search={searchTerms}"; + Name = "Arch Wiki"; + Description = "Arch Wiki search"; + Alias = "!aw"; + Method = "GET"; + URLTemplate = "https://wiki.archlinux.org/index.php?search={searchTerms}"; } { - Name = "Gentoo Wiki"; - Description = "Gentoo Wiki search"; - Alias = "!gw"; - Method = "GET"; - URLTemplate = "https://wiki.gentoo.org/index.php?search={searchTerms}"; + Name = "Gentoo Wiki"; + Description = "Gentoo Wiki search"; + Alias = "!gw"; + Method = "GET"; + URLTemplate = "https://wiki.gentoo.org/index.php?search={searchTerms}"; } { - Name = "Debian Wiki"; - Description = "Debian Wiki search"; - Alias = "!dw"; - Method = "GET"; - URLTemplate = "https://wiki.debian.org/FrontPage?action=fullsearch&value={searchTerms}"; + Name = "Debian Wiki"; + Description = "Debian Wiki search"; + Alias = "!dw"; + Method = "GET"; + URLTemplate = "https://wiki.debian.org/FrontPage?action=fullsearch&value={searchTerms}"; } ]; }; @@ -142,10 +142,10 @@ in { } ]; - extraExtensions = builtins.foldl' (acc: ext: acc // {ext.id = {install_url = mkUrl ext.name;};}) {} extensions; - in - extraExtensions; + extraExtensions = builtins.foldl' (acc: ext: acc // {ext.id = { install_url = mkUrl ext.name;};}) {} extensions; + in extraExtensions; }; }; }; } + diff --git a/home/programs/graphical/file-managers/pcmanfm-qt/default.nix b/home/programs/graphical/file-managers/pcmanfm-qt/default.nix index b2973e0..5aa35da 100644 --- a/home/programs/graphical/file-managers/pcmanfm-qt/default.nix +++ b/home/programs/graphical/file-managers/pcmanfm-qt/default.nix @@ -10,7 +10,7 @@ cfgPreferences = osConfig.myOptions.home-manager.preferences; in { config = mkIf cfg.enable { - home.packages = with pkgs; [lxqt.pcmanfm-qt]; + home.packages = with pkgs; [ lxqt.pcmanfm-qt ]; xdg.configFile."pcmanfm-qt/default/settings.conf".text = lib.generators.toINI {} { Behavior = { @@ -109,7 +109,7 @@ in { Thumbnail = { MaxExternalThumbnailFileSize = -1; - MaxThumbnailFileSize = 40960; # 40 MB + MaxThumbnailFileSize = 40960; # 40 MB ShowThumbnails = true; ThumbnailLocalFilesOnly = true; }; diff --git a/home/programs/graphical/games/prismlauncher.nix b/home/programs/graphical/games/prismlauncher.nix index 6fb6856..ce39cb8 100644 --- a/home/programs/graphical/games/prismlauncher.nix +++ b/home/programs/graphical/games/prismlauncher.nix @@ -9,6 +9,6 @@ cfg = osConfig.myOptions.home-manager.programs.games.prismlauncher; in { config = mkIf cfg.enable { - home.packages = with pkgs; [prismlauncher]; + home.packages = with pkgs; [ prismlauncher ]; }; } diff --git a/home/programs/graphical/launchers/walker/default.nix b/home/programs/graphical/launchers/walker/default.nix index c96f0b2..091daad 100644 --- a/home/programs/graphical/launchers/walker/default.nix +++ b/home/programs/graphical/launchers/walker/default.nix @@ -8,7 +8,7 @@ inherit (lib) mkIf; cfg = osConfig.myOptions.home-manager.programs.launchers.walker; in { - imports = [inputs.walker.homeManagerModules.walker]; + imports = [ inputs.walker.homeManagerModules.walker ]; config = mkIf cfg.enable { programs.walker = { enable = true; @@ -25,13 +25,13 @@ in { fullscreen = false; scrollbar_policy = "automatic"; websearch = { - engines = ["google" "duckduckgo"]; + engines = ["google" "duckduckgo"]; }; hyprland = { context_aware_history = false; }; applications = { - enable_cache = false; # disabling doesn't cause slowdowns, and allows picking up new apps automatically + enable_cache = false; # disabling doesn't cause slowdowns, and allows picking up new apps automatically }; # Mode for picking the entry with keyboard using labels @@ -48,7 +48,7 @@ in { hide_spinner = false; }; runner = { - excludes = ["rm"]; # commands to be excluded from the runner + excludes = ["rm"]; # commands to be excluded from the runner }; clipboard = { max_entries = 10; @@ -82,7 +82,7 @@ in { }; orientation = "vertical"; icons = { - theme = ""; # GTK Icon theme (default) + theme = ""; # GTK Icon theme (default) hide = false; size = 28; image_height = 200; @@ -127,7 +127,7 @@ in { switcher_exclusive = true; } { - name = "websearch"; # uses google + name = "websearch"; # uses google prefix = ""; switcher_exclusive = true; } diff --git a/home/programs/graphical/wms/hyprland/config/gestures.nix b/home/programs/graphical/wms/hyprland/config/gestures.nix index 81d4ac0..7c3923d 100644 --- a/home/programs/graphical/wms/hyprland/config/gestures.nix +++ b/home/programs/graphical/wms/hyprland/config/gestures.nix @@ -10,3 +10,4 @@ }; }; } + diff --git a/home/programs/graphical/wms/hyprland/config/input.nix b/home/programs/graphical/wms/hyprland/config/input.nix index 31ca064..e5a49b4 100644 --- a/home/programs/graphical/wms/hyprland/config/input.nix +++ b/home/programs/graphical/wms/hyprland/config/input.nix @@ -1,4 +1,7 @@ -{osConfig, ...}: let +{ + osConfig, + ... +}: let cfg = osConfig.myOptions.home-manager.wms.hyprland; in { wayland.windowManager.hyprland.settings = { @@ -26,3 +29,4 @@ in { monitor = cfg.monitor; }; } + diff --git a/home/programs/graphical/wms/hyprland/config/keybinds.nix b/home/programs/graphical/wms/hyprland/config/keybinds.nix index e1f632e..cfa21d1 100644 --- a/home/programs/graphical/wms/hyprland/config/keybinds.nix +++ b/home/programs/graphical/wms/hyprland/config/keybinds.nix @@ -1,8 +1,4 @@ -{ - config, - osConfig, - ... -}: let +{ config, osConfig, ... }: let cfgPreferences = osConfig.myOptions.home-manager.preferences; in { wayland.windowManager.hyprland = { @@ -19,13 +15,13 @@ in { "$SCREENSHOT_DELAY" = "2000"; bind = [ - # + # # Active window # "SUPER, W, killactive," "SUPER, F, togglefloating," "SUPER, Space, fullscreen, 0" - "SUPER_SHIFT, Space, fullscreen, 1" # maximize + "SUPER_SHIFT, Space, fullscreen, 1" # maximize "CTRL_SHIFT, Space, exec, toggle-fake-fullscreen" # fake fullscreen + custom border "SUPER_SHIFT, S, layoutmsg, togglesplit" @@ -195,6 +191,7 @@ in { # Global keybinds (passing keys to other programs) # "CTRL, F10, pass, ^(com\.obsproject\.Studio)$" + ]; # Mouse bindings diff --git a/home/programs/graphical/wms/hyprland/config/layout.nix b/home/programs/graphical/wms/hyprland/config/layout.nix index 93b3c2d..a35c564 100644 --- a/home/programs/graphical/wms/hyprland/config/layout.nix +++ b/home/programs/graphical/wms/hyprland/config/layout.nix @@ -1,6 +1,6 @@ { wayland.windowManager.hyprland.settings = { - general.layout = "dwindle"; + general.layout = "dwindle"; dwindle = { # Don't change the split (side/top) regardless of what happens to the container diff --git a/home/programs/graphical/wms/hyprland/config/misc.nix b/home/programs/graphical/wms/hyprland/config/misc.nix index 1deeff8..b101754 100644 --- a/home/programs/graphical/wms/hyprland/config/misc.nix +++ b/home/programs/graphical/wms/hyprland/config/misc.nix @@ -9,7 +9,7 @@ focus_on_activate = true; # Auto-reload is unnecessary on NixOS, config is readonly - disable_autoreload = true; + disable_autoreload = true; # Enable DPMS on these actions mouse_move_enables_dpms = true; diff --git a/home/programs/graphical/wms/hyprland/config/style.nix b/home/programs/graphical/wms/hyprland/config/style.nix index a29ad00..d3cdedf 100644 --- a/home/programs/graphical/wms/hyprland/config/style.nix +++ b/home/programs/graphical/wms/hyprland/config/style.nix @@ -1,5 +1,10 @@ -{config, ...}: { +{ + config, + ... +}: +{ wayland.windowManager.hyprland.settings = { + # # Window gaps # @@ -29,12 +34,12 @@ group = { # Groupped windows - "col.border_active" = "rgba(00A500FF)"; # green - "col.border_inactive" = "rgba(5AA500FF)"; # transparent green + "col.border_active" = "rgba(00A500FF)"; # green + "col.border_inactive" = "rgba(5AA500FF)"; # transparent green # Locked groupped windows - "col.border_locked_active" = "rgba(A0A500FF)"; # yellow - "col.border_locked_inactive" = "rgba(A0A500AA)"; # transparent yellow + "col.border_locked_active" = "rgba(A0A500FF)"; # yellow + "col.border_locked_inactive" = "rgba(A0A500AA)"; # transparent yellow }; # @@ -47,7 +52,7 @@ render_titles = false; # disable, looks kinda bad font_family = "Monaspace Krypton"; font_size = 11; - text_color = "rgba(FFFFFFFF)"; # white + text_color = "rgba(FFFFFFFF)"; # white # Gradients should be enabled only if title rendering is also enabled # on their own, they look really bad @@ -76,6 +81,7 @@ "col.shadow_inactive" = "rgba(0F0F0F99)"; }; + # # Window Blur # @@ -86,6 +92,7 @@ passes = 1; }; + # # Dim inactive windows # @@ -100,7 +107,7 @@ # # Animation # - + animations = { enabled = true; first_launch_animation = true; # fade in on first launch @@ -117,3 +124,4 @@ misc.animate_manual_resizes = true; }; } + diff --git a/home/programs/graphical/wms/hyprland/config/window_rules.nix b/home/programs/graphical/wms/hyprland/config/window_rules.nix index c242816..a1eca99 100644 --- a/home/programs/graphical/wms/hyprland/config/window_rules.nix +++ b/home/programs/graphical/wms/hyprland/config/window_rules.nix @@ -109,3 +109,4 @@ ]; }; } + diff --git a/home/programs/graphical/wms/hyprland/default.nix b/home/programs/graphical/wms/hyprland/default.nix index a17cde1..3c6f834 100644 --- a/home/programs/graphical/wms/hyprland/default.nix +++ b/home/programs/graphical/wms/hyprland/default.nix @@ -6,7 +6,7 @@ }: let inherit (lib) mkIf; - hyprPkgs = import ./packages {inherit pkgs;}; + hyprPkgs = (import ./packages {inherit pkgs;}); # TODO: Switch to flake hyprlandPkg = pkgs.hyprland; @@ -15,7 +15,7 @@ cfg = osConfig.myOptions.home-manager.wms.hyprland; in { imports = [ - ./config + ./config ]; config = mkIf cfg.enable { diff --git a/home/programs/graphical/wms/hyprland/packages/brightness/default.nix b/home/programs/graphical/wms/hyprland/packages/brightness/default.nix index e06b956..609c6ff 100644 --- a/home/programs/graphical/wms/hyprland/packages/brightness/default.nix +++ b/home/programs/graphical/wms/hyprland/packages/brightness/default.nix @@ -1,4 +1,4 @@ {pkgs, ...}: -pkgs.writeShellScriptBin "brightness" '' - ${builtins.readFile ./brightness.sh} -'' + pkgs.writeShellScriptBin "brightness" '' + ${builtins.readFile ./brightness.sh} + '' diff --git a/home/programs/graphical/wms/hyprland/packages/default.nix b/home/programs/graphical/wms/hyprland/packages/default.nix index 32f5cf4..715d5f4 100644 --- a/home/programs/graphical/wms/hyprland/packages/default.nix +++ b/home/programs/graphical/wms/hyprland/packages/default.nix @@ -1,4 +1,7 @@ -{pkgs, ...}: let +{ + pkgs, + ... +}: let packages = { hyprland-move-window = pkgs.callPackage ./hyprland-move-window {}; brightness = pkgs.callPackage ./brightness {}; diff --git a/home/programs/graphical/wms/hyprland/packages/hyprland-move-window/default.nix b/home/programs/graphical/wms/hyprland/packages/hyprland-move-window/default.nix index 12748e6..1bcd3a6 100644 --- a/home/programs/graphical/wms/hyprland/packages/hyprland-move-window/default.nix +++ b/home/programs/graphical/wms/hyprland/packages/hyprland-move-window/default.nix @@ -1,4 +1,5 @@ {pkgs, ...}: -pkgs.writeShellScriptBin "hyprland-move-window" '' - ${builtins.readFile ./hyprland-move-window.sh} -'' + pkgs.writeShellScriptBin "hyprland-move-window" '' + ${builtins.readFile ./hyprland-move-window.sh} + '' + diff --git a/home/programs/graphical/wms/hyprland/packages/quick-record/default.nix b/home/programs/graphical/wms/hyprland/packages/quick-record/default.nix index 3b145ba..7d85224 100644 --- a/home/programs/graphical/wms/hyprland/packages/quick-record/default.nix +++ b/home/programs/graphical/wms/hyprland/packages/quick-record/default.nix @@ -13,3 +13,4 @@ pkgs.writeShellApplication { ${builtins.readFile ./quick-record.sh} ''; } + diff --git a/home/programs/graphical/wms/hyprland/packages/toggle-fake-fullscreen/default.nix b/home/programs/graphical/wms/hyprland/packages/toggle-fake-fullscreen/default.nix index 071f1ce..27f8303 100644 --- a/home/programs/graphical/wms/hyprland/packages/toggle-fake-fullscreen/default.nix +++ b/home/programs/graphical/wms/hyprland/packages/toggle-fake-fullscreen/default.nix @@ -10,3 +10,5 @@ pkgs.writeShellApplication { ${builtins.readFile ./toggle-fake-fullscreen.sh} ''; } + + diff --git a/home/programs/graphical/wms/hyprland/packages/toggle-notifications/default.nix b/home/programs/graphical/wms/hyprland/packages/toggle-notifications/default.nix index 81f688c..bf909f0 100644 --- a/home/programs/graphical/wms/hyprland/packages/toggle-notifications/default.nix +++ b/home/programs/graphical/wms/hyprland/packages/toggle-notifications/default.nix @@ -10,3 +10,6 @@ pkgs.writeShellApplication { ${builtins.readFile ./toggle-notifications.sh} ''; } + + + diff --git a/home/programs/terminal/coding/python/ipython.nix b/home/programs/terminal/coding/python/ipython.nix index a82d0b0..13c3b22 100644 --- a/home/programs/terminal/coding/python/ipython.nix +++ b/home/programs/terminal/coding/python/ipython.nix @@ -9,6 +9,6 @@ cfg = osConfig.myOptions.home-manager.programs.coding.python; in { config = mkIf cfg.enable { - home.packages = with pkgs; [python312Packages.ipython]; + home.packages = with pkgs; [ python312Packages.ipython ]; }; } diff --git a/home/programs/terminal/coding/python/mypy.nix b/home/programs/terminal/coding/python/mypy.nix index b56d9b4..1d086f5 100644 --- a/home/programs/terminal/coding/python/mypy.nix +++ b/home/programs/terminal/coding/python/mypy.nix @@ -9,6 +9,6 @@ cfg = osConfig.myOptions.home-manager.programs.coding.python; in { config = mkIf cfg.enable { - home.packages = with pkgs; [python312Packages.mypy]; + home.packages = with pkgs; [ python312Packages.mypy ]; }; } diff --git a/home/programs/terminal/coding/python/pyright.nix b/home/programs/terminal/coding/python/pyright.nix index b709147..58c884a 100644 --- a/home/programs/terminal/coding/python/pyright.nix +++ b/home/programs/terminal/coding/python/pyright.nix @@ -9,6 +9,6 @@ cfg = osConfig.myOptions.home-manager.programs.coding.python; in { config = mkIf cfg.enable { - home.packages = with pkgs; [pyright]; + home.packages = with pkgs; [ pyright ]; }; } diff --git a/home/programs/terminal/coding/python/ruff.nix b/home/programs/terminal/coding/python/ruff.nix index cd0d49f..0ed47be 100644 --- a/home/programs/terminal/coding/python/ruff.nix +++ b/home/programs/terminal/coding/python/ruff.nix @@ -15,52 +15,52 @@ in { line-length = 119; lint = { select = [ - "F" # Pyflakes - "E" # Pycodestyle (errors) - "W" # Pycodestyle (warnigns) - "N" # pep8-naming - "D" # pydocstyle - "UP" # pyupgrade - "YTT" # flake8-2020 - "ANN" # flake8-annotations + "F" # Pyflakes + "E" # Pycodestyle (errors) + "W" # Pycodestyle (warnigns) + "N" # pep8-naming + "D" # pydocstyle + "UP" # pyupgrade + "YTT" # flake8-2020 + "ANN" # flake8-annotations "ASYNC" # flake8-async - "S" # flake8-bandit - "BLE" # flake8-blind-except - "B" # flake8-bugbear - "A" # flake8-builtins - "COM" # flake8-commas - "C4" # flake8-comprehensions - "DTZ" # flake8-datetimez - "T10" # flake8-debugger - "EM" # flake8-errmsg - "EXE" # flake8-executable - "FA" # flake8-future-annotations - "ISC" # flake8-implicit-str-concat - "ICN" # flake8-import-conventions - "LOG" # flake8-logging - "G" # flake8-logging-format - "INP" # flake8-no-pep420 - "PIE" # flake8-pie - "T20" # flake8-print - "PYI" # flake8-pyi - "PT" # flake8-pytest-style - "Q" # flake8-quotes - "RSE" # flake8-raise - "RET" # flake8-return - "SLOT" # flake8-slots - "SIM" # flake8-simplify - "TID" # flake8-tidy-imports - "TCH" # flake8-type-checking - "INT" # flake8-gettext - "PTH" # flake8-use-pathlib - "TD" # flake8-todos - "ERA" # flake8-eradicate - "PGH" # pygrep-hooks - "PL" # pylint - "TRY" # tryceratops - "FLY" # flynt - "PERF" # perflint - "RUF" # ruff-specific rules + "S" # flake8-bandit + "BLE" # flake8-blind-except + "B" # flake8-bugbear + "A" # flake8-builtins + "COM" # flake8-commas + "C4" # flake8-comprehensions + "DTZ" # flake8-datetimez + "T10" # flake8-debugger + "EM" # flake8-errmsg + "EXE" # flake8-executable + "FA" # flake8-future-annotations + "ISC" # flake8-implicit-str-concat + "ICN" # flake8-import-conventions + "LOG" # flake8-logging + "G" # flake8-logging-format + "INP" # flake8-no-pep420 + "PIE" # flake8-pie + "T20" # flake8-print + "PYI" # flake8-pyi + "PT" # flake8-pytest-style + "Q" # flake8-quotes + "RSE" # flake8-raise + "RET" # flake8-return + "SLOT" # flake8-slots + "SIM" # flake8-simplify + "TID" # flake8-tidy-imports + "TCH" # flake8-type-checking + "INT" # flake8-gettext + "PTH" # flake8-use-pathlib + "TD" # flake8-todos + "ERA" # flake8-eradicate + "PGH" # pygrep-hooks + "PL" # pylint + "TRY" # tryceratops + "FLY" # flynt + "PERF" # perflint + "RUF" # ruff-specific rules ]; ignore = [ "D100" # Missing docstring in public module @@ -100,25 +100,25 @@ in { "TD002" # Missing author in TODO "TD003" # Missing issue link on the line following this TODO - "PT011" # pytest.raises without match parameter is too broad # TODO: Unignore this - "TRY003" # No f-strings in raise statements - "EM101" # No string literals in exception init - "EM102" # No f-strings in exception init - "UP024" # Using errors that alias OSError + "PT011" # pytest.raises without match parameter is too broad # TODO: Unignore this + "TRY003" # No f-strings in raise statements + "EM101" # No string literals in exception init + "EM102" # No f-strings in exception init + "UP024" # Using errors that alias OSError "PLR2004" # Using unnamed numerical constants - "PGH003" # Using specific rule codes in type ignores - "E731" # Don't asign a lambda expression, use a def + "PGH003" # Using specific rule codes in type ignores + "E731" # Don't asign a lambda expression, use a def # Redundant rules with ruff-format: - "E111" # Indentation of a non-multiple of 4 spaces - "E114" # Comment with indentation of a non-multiple of 4 spaces - "E117" # Cheks for over-indented code - "D206" # Checks for docstrings indented with tabs - "D300" # Checks for docstring that use ''' instead of """ - "Q000" # Checks of inline strings that use wrong quotes (' instead of ") - "Q001" # Multiline string that use wrong quotes (''' instead of """) - "Q002" # Checks for docstrings that use wrong quotes (''' instead of """) - "Q003" # Checks for avoidable escaped quotes ("\"" -> '"') + "E111" # Indentation of a non-multiple of 4 spaces + "E114" # Comment with indentation of a non-multiple of 4 spaces + "E117" # Cheks for over-indented code + "D206" # Checks for docstrings indented with tabs + "D300" # Checks for docstring that use ''' instead of """ + "Q000" # Checks of inline strings that use wrong quotes (' instead of ") + "Q001" # Multiline string that use wrong quotes (''' instead of """) + "Q002" # Checks for docstrings that use wrong quotes (''' instead of """) + "Q003" # Checks for avoidable escaped quotes ("\"" -> '"') "COM812" # Missing trailing comma (in multi-line lists/tuples/...) "COM819" # Prohibited trailing comma (in single-line lists/tuples/...) "ISC001" # Single line implicit string concatenation ("hi" "hey" -> "hihey") @@ -126,7 +126,7 @@ in { ]; extend-per-file-ignores = { "tests/*" = [ - "ANN" # flake8-annotations + "ANN" # flake8-annotations "S101" # Use of assert ]; "docs/conf.py" = [ @@ -139,10 +139,10 @@ in { combine-as-imports = true; # Redundant rules with ruff-format - force-single-line = false; # forces all imports to appear on their own line - force-wrap-aliases = false; # Split imports with multiple members and at least one alias - lines-after-imports = -1; # The number of blank lines to place after imports - lines-between-types = 0; # Number of lines to place between "direct" and import from imports + force-single-line = false; # forces all imports to appear on their own line + force-wrap-aliases = false; # Split imports with multiple members and at least one alias + lines-after-imports = -1; # The number of blank lines to place after imports + lines-between-types = 0; # Number of lines to place between "direct" and import from imports split-on-trailing-comma = false; # if last member of multiline import has a comma, don't fold it to single line }; pylint = { diff --git a/home/programs/terminal/coding/python/rye.nix b/home/programs/terminal/coding/python/rye.nix index 8dae6fa..3ac8e9a 100644 --- a/home/programs/terminal/coding/python/rye.nix +++ b/home/programs/terminal/coding/python/rye.nix @@ -13,7 +13,7 @@ in { config = mkIf cfg.enable { home = { - packages = with pkgs; [rye]; + packages = with pkgs; [ rye ]; sessionVariables = { RYE_HOME = "${config.xdg.configHome}/rye"; @@ -32,7 +32,7 @@ in { # see: xdg.configFile."rye/config.toml".source = toTOML "config.toml" { default.license = "GPL-3.0-or-later"; - behavior.global-python = true; + behavior.global-python=true; }; }; } diff --git a/home/programs/terminal/editors/default.nix b/home/programs/terminal/editors/default.nix index eef3419..48dfee4 100644 --- a/home/programs/terminal/editors/default.nix +++ b/home/programs/terminal/editors/default.nix @@ -1,6 +1,6 @@ _: { imports = [ ./neovim - ./helix ]; } + diff --git a/home/programs/terminal/editors/helix/default.nix b/home/programs/terminal/editors/helix/default.nix deleted file mode 100644 index 40947d3..0000000 --- a/home/programs/terminal/editors/helix/default.nix +++ /dev/null @@ -1,49 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - enable = true; - - settings = { - theme = "tokyonight"; - editor = { - line-number = "relative"; - bufferline = "multiple"; - cursor-shape.insert = "bar"; - lsp.display-messages = true; - }; - keys = { - normal = { - esc = ["collapse_selection" "keep_primary_selection"]; - }; - }; - }; - - languages = { - language = [ - { - name = "python"; - scope = "source.python"; - injection-regex = "python"; - file-types = ["py" "pyi" "py3" "pyw" ".pythonstartup" ".pythonrc"]; - shebangs = ["python"]; - roots = ["." "pyproject.toml" "pyrightconfig.json"]; - comment-token = "#"; - language-servers = ["basedpyright" "ruff"]; - indent = { - tab-width = 4; - unit = " "; - }; - auto-format = true; - } - ]; - language-server = { - ruff = { - command = "ruff-lsp"; - }; - basedpyright = { - command = "basedpyright-langserver"; - args = ["--stdio"]; - }; - }; - }; - }; -} diff --git a/home/programs/terminal/emulators/default.nix b/home/programs/terminal/emulators/default.nix index 9655557..6be43fd 100644 --- a/home/programs/terminal/emulators/default.nix +++ b/home/programs/terminal/emulators/default.nix @@ -1,4 +1,4 @@ -# Note: Pretty much all of these configurations were copied from +# Note: Pretty much all of these configurations were copied from # https://git.notashelf.dev/NotAShelf/nyx, there may be some small # adjustments made to them but the majority of the credit goes to # notashelf. @@ -8,3 +8,5 @@ _: { ./kitty.nix ]; } + + diff --git a/home/programs/terminal/emulators/foot.nix b/home/programs/terminal/emulators/foot.nix index f57cafc..f780e38 100644 --- a/home/programs/terminal/emulators/foot.nix +++ b/home/programs/terminal/emulators/foot.nix @@ -1,4 +1,7 @@ -{pkgs, ...}: { +{ + pkgs, + ... +}: { home.packages = with pkgs; [ libsixel # for displaying images ]; @@ -59,3 +62,4 @@ }; }; } + diff --git a/home/programs/terminal/emulators/kitty.nix b/home/programs/terminal/emulators/kitty.nix index 9fec6fb..98e1389 100644 --- a/home/programs/terminal/emulators/kitty.nix +++ b/home/programs/terminal/emulators/kitty.nix @@ -92,3 +92,4 @@ in { }; }; } + diff --git a/home/programs/terminal/file-managers/default.nix b/home/programs/terminal/file-managers/default.nix index aacd692..da5226a 100644 --- a/home/programs/terminal/file-managers/default.nix +++ b/home/programs/terminal/file-managers/default.nix @@ -1,4 +1,4 @@ -# Note: Pretty much all of these configurations were copied from +# Note: Pretty much all of these configurations were copied from # https://git.notashelf.dev/NotAShelf/nyx, there may be some small # adjustments made to them but the majority of the credit goes to # notashelf. @@ -9,3 +9,4 @@ _: { ./ranger.nix ]; } + diff --git a/home/programs/terminal/file-managers/ranger.nix b/home/programs/terminal/file-managers/ranger.nix index 21be2e7..5013ee7 100644 --- a/home/programs/terminal/file-managers/ranger.nix +++ b/home/programs/terminal/file-managers/ranger.nix @@ -16,3 +16,4 @@ in { ${(optionalString config.programs.kitty.enable "set preview_images_method kitty")} ''; } + diff --git a/home/programs/terminal/file-managers/xplr/default.nix b/home/programs/terminal/file-managers/xplr/default.nix index 94f6109..271714f 100644 --- a/home/programs/terminal/file-managers/xplr/default.nix +++ b/home/programs/terminal/file-managers/xplr/default.nix @@ -49,3 +49,4 @@ } ''; } + diff --git a/home/programs/terminal/file-managers/xplr/plugins.nix b/home/programs/terminal/file-managers/xplr/plugins.nix index 8a7687f..e299b24 100644 --- a/home/programs/terminal/file-managers/xplr/plugins.nix +++ b/home/programs/terminal/file-managers/xplr/plugins.nix @@ -12,3 +12,4 @@ pkgs: { hash = "sha256-k/yre9SYNPYBM2W1DPpL6Ypt3w3EMO9dznHwa+fw/n0="; }; } + diff --git a/home/programs/terminal/file-managers/yazi/default.nix b/home/programs/terminal/file-managers/yazi/default.nix index d61ccb5..e9c6e2a 100644 --- a/home/programs/terminal/file-managers/yazi/default.nix +++ b/home/programs/terminal/file-managers/yazi/default.nix @@ -38,3 +38,4 @@ }; }; } + diff --git a/home/programs/terminal/file-managers/yazi/theme/icons.nix b/home/programs/terminal/file-managers/yazi/theme/icons.nix index 987527a..fb46856 100644 --- a/home/programs/terminal/file-managers/yazi/theme/icons.nix +++ b/home/programs/terminal/file-managers/yazi/theme/icons.nix @@ -144,3 +144,4 @@ "*.pkg" = ""; }; } + diff --git a/home/programs/terminal/file-managers/yazi/theme/manager.nix b/home/programs/terminal/file-managers/yazi/theme/manager.nix index 53e67a7..13acca3 100644 --- a/home/programs/terminal/file-managers/yazi/theme/manager.nix +++ b/home/programs/terminal/file-managers/yazi/theme/manager.nix @@ -61,3 +61,4 @@ syntect_theme = ""; }; } + diff --git a/home/programs/terminal/file-managers/yazi/theme/status.nix b/home/programs/terminal/file-managers/yazi/theme/status.nix index 878deb7..8393f1a 100644 --- a/home/programs/terminal/file-managers/yazi/theme/status.nix +++ b/home/programs/terminal/file-managers/yazi/theme/status.nix @@ -43,3 +43,4 @@ permissions_s = {fg = "darkgray";}; }; } + diff --git a/home/programs/terminal/shell/zsh/aliases.nix b/home/programs/terminal/shell/zsh/aliases.nix index ac03bf3..2abf7c9 100644 --- a/home/programs/terminal/shell/zsh/aliases.nix +++ b/home/programs/terminal/shell/zsh/aliases.nix @@ -1,11 +1,8 @@ -{ - config, - pkgs, - lib, - ... -}: let +{ config, pkgs, lib, ... }: +let nr = "${pkgs.nixos-rebuild}/bin/nixos-rebuild"; -in { +in +{ programs.zsh.shellAliases = { # I'm not the greatest typist sl = "ls"; diff --git a/home/programs/terminal/shell/zsh/default.nix b/home/programs/terminal/shell/zsh/default.nix index 48743cb..7d6094f 100644 --- a/home/programs/terminal/shell/zsh/default.nix +++ b/home/programs/terminal/shell/zsh/default.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{ config, pkgs, ... }: { imports = [ ./plugins.nix ./aliases.nix diff --git a/home/programs/terminal/shell/zsh/init.nix b/home/programs/terminal/shell/zsh/init.nix index e9759b1..6d81346 100644 --- a/home/programs/terminal/shell/zsh/init.nix +++ b/home/programs/terminal/shell/zsh/init.nix @@ -1,9 +1,12 @@ -_: let +_: +let inherit (builtins) readFile; -in { - # I prefer having the rc files split across multiple files in my system rather +in +{ + + # I prefer having the rc files split across multiple files in my system rather # than just using readFile and putting them all into the generated zshrc - # this also allows me to source them individually if I need to + # this also allows me to source them individually if I need to # (like in the anonymize function with my prompt) home.file = { # TODO: Load these dynamically, by going over all files in ./rc diff --git a/home/programs/terminal/shell/zsh/plugins.nix b/home/programs/terminal/shell/zsh/plugins.nix index 80201c0..8f0c72a 100644 --- a/home/programs/terminal/shell/zsh/plugins.nix +++ b/home/programs/terminal/shell/zsh/plugins.nix @@ -1,10 +1,8 @@ -{ - config, - pkgs, - ... -}: let +{ config, pkgs, ... }: +let inherit (pkgs) fetchFromGitHub; -in { +in +{ programs.zsh.plugins = [ { name = "zsh-nix-shell"; diff --git a/home/programs/terminal/tools/direnv.nix b/home/programs/terminal/tools/direnv.nix index 212361d..03abe16 100644 --- a/home/programs/terminal/tools/direnv.nix +++ b/home/programs/terminal/tools/direnv.nix @@ -1,6 +1,6 @@ {pkgs, ...}: { home.sessionVariables = { - DIRENV_LOG_FORMAT = ""; + DIRENV_LOG_FORMAT=""; }; programs.direnv = { enable = true; diff --git a/home/programs/terminal/tools/fastfetch.nix b/home/programs/terminal/tools/fastfetch.nix index 5cb26c1..ae82717 100644 --- a/home/programs/terminal/tools/fastfetch.nix +++ b/home/programs/terminal/tools/fastfetch.nix @@ -11,3 +11,4 @@ in { programs.fastfetch.enable = true; }; } + diff --git a/home/programs/terminal/tools/git/aliases.nix b/home/programs/terminal/tools/git/aliases.nix index ea2ea75..7972a97 100644 --- a/home/programs/terminal/tools/git/aliases.nix +++ b/home/programs/terminal/tools/git/aliases.nix @@ -1,5 +1,9 @@ -{pkgs, ...}: let - scriptPkgs = import ./bin {inherit pkgs;}; +{ + pkgs, + ... +}: let + + scriptPkgs = (import ./bin {inherit pkgs;}); in { programs.git = { aliases = { @@ -66,8 +70,6 @@ in { set-upstream = "!git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`"; - fixup-picker = "!git log -n 50 --pretty=format:'%h %s' --no-merges | fzf | cut -c -7 | xargs -o git commit --fixup"; - staash = "stash --all"; stash-staged = "!sh -c 'git stash --keep-index; git stash push -m \"staged\" --keep-index; git stash pop stash@{1}'"; diff --git a/home/programs/terminal/tools/git/bin/better-git-branch/default.nix b/home/programs/terminal/tools/git/bin/better-git-branch/default.nix index 0dd693c..80b4517 100644 --- a/home/programs/terminal/tools/git/bin/better-git-branch/default.nix +++ b/home/programs/terminal/tools/git/bin/better-git-branch/default.nix @@ -1,4 +1,4 @@ {pkgs, ...}: -pkgs.writeShellScriptBin "better-git-branch" '' - ${builtins.readFile ./better-git-branch.sh} -'' + pkgs.writeShellScriptBin "better-git-branch" '' + ${builtins.readFile ./better-git-branch.sh} + '' diff --git a/home/programs/terminal/tools/git/bin/default.nix b/home/programs/terminal/tools/git/bin/default.nix index 5952aac..8cf9cb0 100644 --- a/home/programs/terminal/tools/git/bin/default.nix +++ b/home/programs/terminal/tools/git/bin/default.nix @@ -1,4 +1,7 @@ -{pkgs, ...}: let +{ + pkgs, + ... +}: let packages = { better-git-branch = pkgs.callPackage ./better-git-branch {}; }; diff --git a/home/programs/terminal/tools/git/default.nix b/home/programs/terminal/tools/git/default.nix index df6e673..2bb104d 100644 --- a/home/programs/terminal/tools/git/default.nix +++ b/home/programs/terminal/tools/git/default.nix @@ -1,10 +1,8 @@ -{ - osConfig, - pkgs, - ... -}: let +{ osConfig, pkgs, ... }: +let myGitConf = osConfig.myOptions.home-manager.git; -in { +in +{ imports = [ ./gh.nix ./ignores.nix diff --git a/home/programs/terminal/tools/git/gh.nix b/home/programs/terminal/tools/git/gh.nix index b8c8f3d..05e2e69 100644 --- a/home/programs/terminal/tools/git/gh.nix +++ b/home/programs/terminal/tools/git/gh.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +{ pkgs, ... }: { programs.gh = { enable = true; gitCredentialHelper.enable = false; diff --git a/home/programs/terminal/tools/gpg.nix b/home/programs/terminal/tools/gpg.nix index 4650756..eb75a87 100644 --- a/home/programs/terminal/tools/gpg.nix +++ b/home/programs/terminal/tools/gpg.nix @@ -1,4 +1,4 @@ -{config, ...}: { +{ config, ... }: { programs = { gpg = { enable = true; diff --git a/home/programs/terminal/tools/iamb.nix b/home/programs/terminal/tools/iamb.nix index 1e10f95..31ad96d 100644 --- a/home/programs/terminal/tools/iamb.nix +++ b/home/programs/terminal/tools/iamb.nix @@ -10,7 +10,7 @@ cfg = osConfig.myOptions.home-manager.programs.applications.iamb; in { config = mkIf cfg.enable { - home.packages = with pkgs; [iamb]; + home.packages = with pkgs; [ iamb ]; xdg.configFile."iamb/config.json".text = builtins.toJSON { settings = { @@ -33,12 +33,10 @@ in { }; default_profile = cfg.defaultProfile; - profiles = - lib.mapAttrs (name: profile: { - user_id = profile.userId; - url = profile.homeServer; - }) - cfg.profiles; + profiles = lib.mapAttrs (name: profile: { + user_id = profile.userId; + url = profile.homeServer; + }) cfg.profiles; dirs = { cache = "${config.xdg.cacheHome}/iamb/"; diff --git a/home/programs/terminal/tools/newsboat/default.nix b/home/programs/terminal/tools/newsboat/default.nix index 3075475..9b538b6 100644 --- a/home/programs/terminal/tools/newsboat/default.nix +++ b/home/programs/terminal/tools/newsboat/default.nix @@ -1,9 +1,5 @@ # Config copied from https://git.notashelf.dev/NotAShelf/nyx -{ - pkgs, - lib, - ... -}: let +{ pkgs, lib, ... }: let inherit (lib) getExe; mpv = "${getExe pkgs.mpv}"; @@ -73,5 +69,5 @@ in { macro v set browser "${mpv} %u" ; open-in-browser ; set browser "firefox %u" -- "Open video on mpv" macro , open-in-browser ''; - }; + }; } diff --git a/home/programs/terminal/tools/newsboat/urls.nix b/home/programs/terminal/tools/newsboat/urls.nix index 0b93e3c..5164589 100644 --- a/home/programs/terminal/tools/newsboat/urls.nix +++ b/home/programs/terminal/tools/newsboat/urls.nix @@ -57,3 +57,4 @@ {url = "https://kiszamolo.hu/feed";} ]; } + diff --git a/home/programs/terminal/tools/nix-index.nix b/home/programs/terminal/tools/nix-index.nix index 6d6eca9..5b4df13 100644 --- a/home/programs/terminal/tools/nix-index.nix +++ b/home/programs/terminal/tools/nix-index.nix @@ -1,4 +1,4 @@ -{config, ...}: { +{ config, ... }: { programs = { # nix-index is a file database for nixpkgs # this provides `nix-locate` command. diff --git a/home/programs/terminal/tools/ssh.nix b/home/programs/terminal/tools/ssh.nix index 281ebfe..76864dd 100644 --- a/home/programs/terminal/tools/ssh.nix +++ b/home/programs/terminal/tools/ssh.nix @@ -1,6 +1,7 @@ { programs = { ssh = { + # TODO: Enable this after figuring out how to add protected/encrypted blocks here. # I don't like the idea of expising IPs/hostnames in the config. # For now, I just persist the .ssh directory, managing stuff manually. diff --git a/home/programs/xdg/config-files.nix b/home/programs/xdg/config-files.nix index 6810d97..18c1abf 100644 --- a/home/programs/xdg/config-files.nix +++ b/home/programs/xdg/config-files.nix @@ -1,5 +1,5 @@ # Attribute set of files to link into the user's XDG directories -{config, ...}: let +{ config, ... }: let XDG_CACHE_HOME = config.xdg.cacheHome; XDG_CONFIG_HOME = config.xdg.configHome; XDG_DATA_HOME = config.xdg.dataHome; @@ -7,6 +7,7 @@ XDG_RUNTIME_DIR = config.home.sessionVariables.XDG_RUNTIME_DIR; XDG_BIN_HOME = config.home.sessionVariables.XDG_BIN_HOME; in { + # Variables set to force apps into the XDG base directories # These will get set at login # Defined in /etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh @@ -46,7 +47,7 @@ in { }; # Create the following files in XDG_CONFIG_HOME, for purposes of - # forcing apps to use the XDG base directories + # forcing apps to use the XDG base directories xdg.configFile = { "npm/npmrc".text = '' prefix=${XDG_DATA_HOME}/npm @@ -76,7 +77,7 @@ in { # https://github.com/python/cpython/issues/105694 if not history.is_file(): - readline.write_history_file(str(history)) # breaks on macos + python3 without this. + readline.write_history_file(str(history)) # breaks on macos + python3 without this. readline.read_history_file(str(history)) atexit.register(readline.write_history_file, str(history)) diff --git a/home/programs/xdg/default.nix b/home/programs/xdg/default.nix index b98884d..9365821 100644 --- a/home/programs/xdg/default.nix +++ b/home/programs/xdg/default.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{config, pkgs, ...}: { imports = [ ./mime-apps.nix ./user-dirs.nix @@ -27,5 +23,5 @@ # xdg-ninja is a CLI tool that checks $HOME for unwanted # files/dirs and shows how to move them to XDG dirs - home.packages = [pkgs.xdg-ninja]; + home.packages = [ pkgs.xdg-ninja ]; } diff --git a/home/programs/xdg/mime-apps.nix b/home/programs/xdg/mime-apps.nix index 47ca574..a61b17c 100644 --- a/home/programs/xdg/mime-apps.nix +++ b/home/programs/xdg/mime-apps.nix @@ -1,8 +1,11 @@ # Manage $XDG_CONFIG_HOME/mimeapps.list -{osConfig, ...}: let +{ + osConfig, + ... +}: let cfgPreferences = osConfig.myOptions.home-manager.preferences; in { - xdg.mimeApps = let + xdg.mimeApps = let browser = cfgPreferences.browser.desktop; textEditor = cfgPreferences.textEditor.desktop; emailClient = cfgPreferences.emailClient.desktop; diff --git a/home/programs/xdg/user-dirs.nix b/home/programs/xdg/user-dirs.nix index 8ea584d..e7af269 100644 --- a/home/programs/xdg/user-dirs.nix +++ b/home/programs/xdg/user-dirs.nix @@ -1,5 +1,5 @@ # Manage $XDG_CONFIG_HOME/user-dirs.dirs -{config, ...}: { +{ config, ... }: { xdg.userDirs = { enable = true; createDirectories = true; diff --git a/home/services/default.nix b/home/services/default.nix index ce60b8e..fa9f89a 100644 --- a/home/services/default.nix +++ b/home/services/default.nix @@ -1,5 +1,5 @@ _: { - imports = [ + imports = [ ./dunst.nix ./hyprpaper.nix ]; diff --git a/home/services/hyprpaper.nix b/home/services/hyprpaper.nix index ce14050..aad3a6a 100644 --- a/home/services/hyprpaper.nix +++ b/home/services/hyprpaper.nix @@ -12,11 +12,11 @@ in { config = mkIf (cfg.enable && cfgIsWayland) { systemd.user.services.hyprpaper = { - Install.WantedBy = ["hyprland-session.target"]; + Install.WantedBy = [ "hyprland-session.target" ]; Unit = { Description = "Hyprpaper (Hyprland wallpaper daemon)"; - PartOf = ["graphical-session.target"]; - After = ["graphical-session.target"]; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; }; Service = { Type = "simple"; @@ -31,3 +31,4 @@ in { ''; }; } + diff --git a/home/themes/cursor.nix b/home/themes/cursor.nix index cb85e04..265bdd2 100644 --- a/home/themes/cursor.nix +++ b/home/themes/cursor.nix @@ -1,4 +1,7 @@ -{osConfig, ...}: let +{ + osConfig, + ... +}: let cfg = osConfig.myOptions.home-manager.theme.cursor; in { home = { diff --git a/home/themes/gtk.nix b/home/themes/gtk.nix index 3905fa0..9c882c6 100644 --- a/home/themes/gtk.nix +++ b/home/themes/gtk.nix @@ -18,11 +18,7 @@ in { GTK_THEME = "${cfg.theme.name}"; # gtk applications should use filepickers specified by xdg - GTK_USE_PORTAL = "${toString ( - if cfg.usePortal - then 1 - else 0 - )}"; + GTK_USE_PORTAL = "${toString (if cfg.usePortal then 1 else 0)}"; }; }; diff --git a/home/themes/qt.nix b/home/themes/qt.nix index 6d4c007..fadc173 100644 --- a/home/themes/qt.nix +++ b/home/themes/qt.nix @@ -11,8 +11,8 @@ in { qt = { enable = true; # just an override for QT_QPA_PLATFORMTHEME, takes "gtk", "gnome", "qtct" or "kde" - platformTheme.name = - if cfg.forceGtk + platformTheme.name = + if cfg.forceGtk then "gtk" else "qtct"; style = mkIf (!cfg.forceGtk) { @@ -80,6 +80,7 @@ in { }; "Kvantum/${cfg.kvantumTheme.name}".source = "${cfg.kvantumTheme.package}/share/Kvantum/${cfg.kvantumTheme.name}"; + # Set icon theme using qtct "qt5ct/qt5ct.conf".text = lib.generators.toINI {} { Appearance = { diff --git a/hosts/default.nix b/hosts/default.nix index ae296c6..084916d 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,4 +1,5 @@ -{inputs, ...}: let +{ inputs, ... }: +let inherit (inputs) self; inherit (inputs.nixpkgs) lib; @@ -8,30 +9,27 @@ ../home ../options ]; -in { +in +{ herugrim = lib.nixosSystem { system = "x86_64-linux"; - specialArgs = {inherit lib inputs self;}; - modules = - [ - ./herugrim - inputs.home-manager.nixosModules.home-manager - inputs.impermanence.nixosModules.impermanence - inputs.lanzaboote.nixosModules.lanzaboote - ] - ++ shared; + specialArgs = { inherit lib inputs self; }; + modules = [ + ./herugrim + inputs.home-manager.nixosModules.home-manager + inputs.impermanence.nixosModules.impermanence + inputs.lanzaboote.nixosModules.lanzaboote + ] ++ shared; }; voyager = lib.nixosSystem { system = "x86_64-linux"; - specialArgs = {inherit lib inputs self;}; - modules = - [ - ./voyager - inputs.home-manager.nixosModules.home-manager - inputs.impermanence.nixosModules.impermanence - inputs.lanzaboote.nixosModules.lanzaboote - ] - ++ shared; + specialArgs = { inherit lib inputs self; }; + modules = [ + ./voyager + inputs.home-manager.nixosModules.home-manager + inputs.impermanence.nixosModules.impermanence + inputs.lanzaboote.nixosModules.lanzaboote + ] ++ shared; }; } diff --git a/hosts/herugrim/default.nix b/hosts/herugrim/default.nix index 2a83745..894c92d 100644 --- a/hosts/herugrim/default.nix +++ b/hosts/herugrim/default.nix @@ -1,13 +1,10 @@ +{ lib, pkgs, ... }: { - lib, - pkgs, - ... -}: { imports = [ ./hardware-configuration.nix ]; - boot.supportedFilesystems = ["btrfs"]; + boot.supportedFilesystems = [ "btrfs" ]; # My flake disables this by default for security reasons. However, # with an encrypted setup, which requires entering password before @@ -45,7 +42,7 @@ # Configure automatic root subvolume wiping on boot from initrd autoWipeBtrfs = { enable = true; - devices."/dev/disk/by-label/NIXROOT".subvolumes = ["root"]; + devices."/dev/disk/by-label/NIXROOT".subvolumes = [ "root" ]; }; }; diff --git a/hosts/herugrim/hardware-configuration.nix b/hosts/herugrim/hardware-configuration.nix index 147a539..28065df 100644 --- a/hosts/herugrim/hardware-configuration.nix +++ b/hosts/herugrim/hardware-configuration.nix @@ -1,64 +1,60 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; +{ config, lib, pkgs, modulesPath, ... }: - boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = []; +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; boot.initrd.luks.devices."cryptfs".device = "/dev/disk/by-label/NIXCRYPTROOT"; - fileSystems."/" = { - device = "/dev/disk/by-label/NIXROOT"; - fsType = "btrfs"; - options = ["subvol=root" "noatime" "compress=zstd:3"]; - }; + fileSystems."/" = + { device = "/dev/disk/by-label/NIXROOT"; + fsType = "btrfs"; + options = [ "subvol=root" "noatime" "compress=zstd:3" ]; + }; - fileSystems."/home" = { - device = "/dev/disk/by-label/NIXROOT"; - fsType = "btrfs"; - options = ["subvol=home" "noatime" "compress=zstd:3"]; - }; + fileSystems."/home" = + { device = "/dev/disk/by-label/NIXROOT"; + fsType = "btrfs"; + options = [ "subvol=home" "noatime" "compress=zstd:3" ]; + }; - fileSystems."/nix" = { - device = "/dev/disk/by-label/NIXROOT"; - fsType = "btrfs"; - options = ["subvol=nix" "noatime" "compress=zstd:3"]; - }; + fileSystems."/nix" = + { device = "/dev/disk/by-label/NIXROOT"; + fsType = "btrfs"; + options = [ "subvol=nix" "noatime" "compress=zstd:3" ]; + }; - fileSystems."/var/log" = { - device = "/dev/disk/by-label/NIXROOT"; - fsType = "btrfs"; - options = ["subvol=log" "noatime" "compress=zstd:3"]; - neededForBoot = true; - }; + fileSystems."/var/log" = + { device = "/dev/disk/by-label/NIXROOT"; + fsType = "btrfs"; + options = [ "subvol=log" "noatime" "compress=zstd:3" ]; + neededForBoot = true; + }; - fileSystems."/persist" = { - device = "/dev/disk/by-label/NIXROOT"; - fsType = "btrfs"; - options = ["subvol=persist" "noatime" "compress=zstd:3"]; - neededForBoot = true; - }; + fileSystems."/persist" = + { device = "/dev/disk/by-label/NIXROOT"; + fsType = "btrfs"; + options = [ "subvol=persist" "noatime" "compress=zstd:3" ]; + neededForBoot = true; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-label/NIXBOOT"; - fsType = "vfat"; - }; + fileSystems."/boot" = + { device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + }; - swapDevices = [ - {device = "/dev/disk/by-label/SWAP";} - ]; + swapDevices = + [ { device = "/dev/disk/by-label/SWAP"; } + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/hosts/voyager/default.nix b/hosts/voyager/default.nix index f7b668e..0999736 100644 --- a/hosts/voyager/default.nix +++ b/hosts/voyager/default.nix @@ -1,18 +1,16 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page, on # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ - config, - lib, - pkgs, - ... -}: { - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - boot.supportedFilesystems = ["btrfs"]; +{ config, lib, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + boot.supportedFilesystems = [ "btrfs" ]; hardware.enableAllFirmware = true; # My flake disables this by default for security reasons. However, with an encrypted setup, @@ -85,7 +83,6 @@ ".local/state/nvim" ".config/github-copilot" ".config/ipython" - ".cache/pre-commit" # Services ".local/state/wireplumber" # volume settings @@ -122,7 +119,7 @@ # Configure automatic root subvolume wiping on boot from initrd autoWipeBtrfs = { enable = true; - devices."/dev/disk/by-label/NIXOS-FS".subvolumes = ["root"]; + devices."/dev/disk/by-label/NIXOS-FS".subvolumes = [ "root" ]; }; }; @@ -135,7 +132,7 @@ device = { roles = { type = "laptop"; - virtual-machine = false; + virtual-machine = false; }; cpu.type = "amd"; gpu.type = "amd"; @@ -146,7 +143,7 @@ security = { auditd = { enable = true; - autoPrune.enable = true; + autoPrune.enable = true; }; }; @@ -163,28 +160,28 @@ git = { userName = "ItsDrike"; - userEmail = "itsdrike@protonmail.com"; - signing = { - enable = true; + userEmail = "itsdrike@protonmail.com"; + signing = { + enable = true; key = "FA2745890B7048C0"; - }; + }; }; wms.hyprland = { enable = true; - monitor = [ - # Primary / laptop display - "eDP-1, 1920x1200@60, 0x1080, 1" + monitor = [ + # Primary / laptop display + "eDP-1, 1920x1200@60, 0x1080, 1" # HDMI-A-1 above primary - "HDMI-A-1, 1920x1080@60, 0x0, 1" + "HDMI-A-1, 1920x1080@60, 0x0, 1" - # HDMI-A-1 left to primary - #"HDMI-A-1, 1920x1080@60, 1920x1080, 1" + # HDMI-A-1 left to primary + #"HDMI-A-1, 1920x1080@60, 1920x1080, 1" - # Mirror the primary (laptop) monitor on externals - ", preferred, auto, 1, mirror, eDP-1" - ]; + # Mirror the primary (laptop) monitor on externals + ", preferred, auto, 1, mirror, eDP-1" + ]; }; programs = { @@ -207,7 +204,7 @@ }; webcord.enable = true; mpv.enable = true; - nomacs.enable = true; # TODO: probably disable + nomacs.enable = true; # TODO: probably disable qimgv.enable = true; qbittorrent.enable = true; obs.enable = true; diff --git a/hosts/voyager/hardware-configuration.nix b/hosts/voyager/hardware-configuration.nix index 53c3cf4..9edebd4 100644 --- a/hosts/voyager/hardware-configuration.nix +++ b/hosts/voyager/hardware-configuration.nix @@ -1,64 +1,60 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; +{ config, lib, pkgs, modulesPath, ... }: - boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = []; +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; boot.initrd.luks.devices."cryptfs".device = "/dev/disk/by-label/NIXOS-CRYPTFS"; - fileSystems."/" = { - device = "/dev/disk/by-label/NIXOS-FS"; - fsType = "btrfs"; - options = ["subvol=root" "noatime" "compress=zstd:3"]; - }; + fileSystems."/" = + { device = "/dev/disk/by-label/NIXOS-FS"; + fsType = "btrfs"; + options = [ "subvol=root" "noatime" "compress=zstd:3" ]; + }; - fileSystems."/nix" = { - device = "/dev/disk/by-label/NIXOS-FS"; - fsType = "btrfs"; - options = ["subvol=nix" "noatime" "compress=zstd:3"]; - }; + fileSystems."/nix" = + { device = "/dev/disk/by-label/NIXOS-FS"; + fsType = "btrfs"; + options = [ "subvol=nix" "noatime" "compress=zstd:3" ]; + }; - fileSystems."/persist" = { - device = "/dev/disk/by-label/NIXOS-FS"; - fsType = "btrfs"; - options = ["subvol=persist" "noatime" "compress=zstd:3"]; - neededForBoot = true; - }; + fileSystems."/persist" = + { device = "/dev/disk/by-label/NIXOS-FS"; + fsType = "btrfs"; + options = [ "subvol=persist" "noatime" "compress=zstd:3" ]; + neededForBoot = true; + }; - fileSystems."/data" = { - device = "/dev/disk/by-label/NIXOS-FS"; - fsType = "btrfs"; - options = ["subvol=data" "noatime" "compress=zstd:3"]; - }; + fileSystems."/data" = + { device = "/dev/disk/by-label/NIXOS-FS"; + fsType = "btrfs"; + options = [ "subvol=data" "noatime" "compress=zstd:3" ]; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-label/EFI"; - fsType = "vfat"; - options = ["fmask=0022" "dmask=0022"]; - }; + fileSystems."/boot" = + { device = "/dev/disk/by-label/EFI"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; - fileSystems."/.btrfs" = { - device = "/dev/disk/by-label/NIXOS-FS"; - fsType = "btrfs"; - options = ["noatime" "compress=zstd:3"]; - }; + fileSystems."/.btrfs" = + { device = "/dev/disk/by-label/NIXOS-FS"; + fsType = "btrfs"; + options = [ "noatime" "compress=zstd:3" ]; + }; - swapDevices = [ - {device = "/dev/disk/by-label/SWAP";} - ]; + swapDevices = + [ { device = "/dev/disk/by-label/SWAP"; } + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/options/device/hardware.nix b/options/device/hardware.nix index 3d62397..c097978 100644 --- a/options/device/hardware.nix +++ b/options/device/hardware.nix @@ -1,9 +1,10 @@ -{lib, ...}: let +{ lib, ... }: let inherit (lib) mkOption mkEnableOption types; -in { +in +{ options.myOptions.device = { cpu.type = mkOption { - type = with types; nullOr (enum ["intel" "amd"]); + type = with types; nullOr (enum [ "intel" "amd" ]); default = null; description = '' The manifaturer/type of the primary system CPU. @@ -15,7 +16,7 @@ in { }; gpu.type = mkOption { - type = with types; nullOr (enum ["nvidia" "amd" "intel" "hybrid-nvidia" "hybrid-amd"]); + type = with types; nullOr (enum [ "nvidia" "amd" "intel" "hybrid-nvidia" "hybrid-amd" ]); default = null; description = '' The manifaturer/type of the primary system GPU. diff --git a/options/device/roles.nix b/options/device/roles.nix index 9554a7e..834ed42 100644 --- a/options/device/roles.nix +++ b/options/device/roles.nix @@ -1,8 +1,4 @@ -{ - lib, - config, - ... -}: let +{ lib, config, ... }: let inherit (lib) mkOption types; cfg = config.myOptions.device.roles; diff --git a/options/home/default.nix b/options/home/default.nix index e7ca437..eb6ff70 100644 --- a/options/home/default.nix +++ b/options/home/default.nix @@ -1,7 +1,7 @@ -{lib, ...}: -with lib; let +{ lib, ... }: with lib; let inherit (lib) mkEnableOption mkOption; -in { +in +{ imports = [ ./programs ./git.nix @@ -21,3 +21,4 @@ in { }; }; } + diff --git a/options/home/git.nix b/options/home/git.nix index 288b493..b9f148a 100644 --- a/options/home/git.nix +++ b/options/home/git.nix @@ -1,7 +1,7 @@ -{lib, ...}: -with lib; let +{ lib, ... }: with lib; let inherit (lib) mkEnableOption mkOption; -in { +in +{ options.myOptions.home-manager.git = { userName = mkOption { type = types.str; diff --git a/options/home/preferences.nix b/options/home/preferences.nix index 3da13c4..0e899cf 100644 --- a/options/home/preferences.nix +++ b/options/home/preferences.nix @@ -1,25 +1,24 @@ -{lib, ...}: let +{ lib, ... }: let inherit (lib) mkOption types; - mkPreferenceCmdOption = name: commandDefault: - mkOption { - type = types.str; - description = "The command to start your preferred ${name}."; - default = commandDefault; - }; + mkPreferenceCmdOption = name: commandDefault: mkOption { + type = types.str; + description = "The command to start your preferred ${name}."; + default = commandDefault; + }; - mkPreferenceDesktopOption = name: desktopDefault: - mkOption { - type = types.str; - description = "The desktop (application) file for your preferred ${name}."; - default = desktopDefault; - }; + mkPreferenceDesktopOption = name: desktopDefault: mkOption { + type = types.str; + description = "The desktop (application) file for your preferred ${name}."; + default = desktopDefault; + }; mkPreferenceOptions = name: commandDefault: desktopDefault: { - command = mkPreferenceCmdOption name commandDefault; + command = mkPreferenceCmdOption name commandDefault; desktop = mkPreferenceDesktopOption name desktopDefault; }; -in { +in +{ options.myOptions.home-manager.preferences = { browser = mkPreferenceOptions "browser" "firefox" "firefox.desktop"; terminalEmulator = mkPreferenceOptions "terminal emulator" "kitty" "kitty.desktop"; diff --git a/options/home/programs/default.nix b/options/home/programs/default.nix index 9bd7d60..4490585 100644 --- a/options/home/programs/default.nix +++ b/options/home/programs/default.nix @@ -1,7 +1,7 @@ -{lib, ...}: -with lib; let +{ lib, ... }: with lib; let inherit (lib) mkEnableOption mkOption types; -in { +in +{ imports = [ ./iamb.nix ]; diff --git a/options/home/programs/iamb.nix b/options/home/programs/iamb.nix index adeabc9..fc99bd3 100644 --- a/options/home/programs/iamb.nix +++ b/options/home/programs/iamb.nix @@ -1,4 +1,4 @@ -{ +{ lib, config, ... @@ -6,7 +6,8 @@ inherit (lib) mkEnableOption mkOption types mkIf; cfg = config.myOptions.home-manager.programs.applications.iamb; -in { +in +{ options.myOptions.home-manager.programs.applications.iamb = { enable = mkEnableOption "iamb (vim-inspired terminal Matrix client)"; defaultProfile = mkOption { @@ -47,3 +48,4 @@ in { ]; }; } + diff --git a/options/home/services.nix b/options/home/services.nix index 4488fc6..bd2ec2c 100644 --- a/options/home/services.nix +++ b/options/home/services.nix @@ -1,7 +1,7 @@ -{lib, ...}: -with lib; let +{ lib, ... }: with lib; let inherit (lib) mkEnableOption mkOption types; -in { +in +{ options.myOptions.home-manager.services = { dunst.enable = mkEnableOption "Dunst (lightweight notification daemon)"; hyprpaper = { @@ -14,3 +14,4 @@ in { }; }; } + diff --git a/options/home/theme.nix b/options/home/theme.nix index 21fc1db..1503539 100644 --- a/options/home/theme.nix +++ b/options/home/theme.nix @@ -1,10 +1,7 @@ -{ - lib, - pkgs, - ... -}: let +{ lib, pkgs, ... }: let inherit (lib) mkEnableOption mkOption types; -in { +in +{ options.myOptions.home-manager.theme = { gtk = { enable = mkEnableOption "GTK theming optionss"; @@ -51,7 +48,7 @@ in { size = mkOption { type = types.int; description = "The size of the font"; - default = 10; # 10 + default = 10; # 10 }; }; }; @@ -144,5 +141,6 @@ in { description = "The size of the cursor"; }; }; + }; } diff --git a/options/home/wms.nix b/options/home/wms.nix index 6807cd5..67407ff 100644 --- a/options/home/wms.nix +++ b/options/home/wms.nix @@ -11,6 +11,7 @@ in { Hyprland wayland compositor. ''; + monitor = mkOption { type = types.listOf types.str; default = []; diff --git a/options/security/auditd.nix b/options/security/auditd.nix index c381707..fccb222 100644 --- a/options/security/auditd.nix +++ b/options/security/auditd.nix @@ -1,11 +1,7 @@ -{ - lib, - config, - ... -}: -with lib; let +{ lib, config, ... }: with lib; let inherit (lib) mkEnableOption mkOption literalExpression types; -in { +in +{ options.myOptions.security.auditd = { enable = mkEnableOption "the audit daemon."; autoPrune = { @@ -62,3 +58,4 @@ in { }; }; } + diff --git a/options/system/boot/default.nix b/options/system/boot/default.nix index a110de1..50b82d9 100644 --- a/options/system/boot/default.nix +++ b/options/system/boot/default.nix @@ -1,9 +1,4 @@ -{ - config, - lib, - pkgs, - ... -}: let +{ config, lib, pkgs, ...}: let inherit (lib) mkOption mkEnableOption literalExpression; cfg = config.myOptions.system.boot; @@ -21,17 +16,17 @@ in { description = "The kernel to use for the system."; }; - tmpOnTmpfs = mkEnableOption '' - `/tmp` living on tmpfs. false means it will be cleared manually on each reboot - - This option defaults to `true` if the host provides patches to the kernel package in - `boot.kernelPatches` - ''; - - silentBoot = + tmpOnTmpfs = mkEnableOption '' - almost entirely silent boot process through `quiet` kernel parameter - '' - // {default = cfg.plymouth.enable;}; + `/tmp` living on tmpfs. false means it will be cleared manually on each reboot + + This option defaults to `true` if the host provides patches to the kernel package in + `boot.kernelPatches` + ''; + + silentBoot = mkEnableOption '' + almost entirely silent boot process through `quiet` kernel parameter + '' + // { default = cfg.plymouth.enable; }; }; } diff --git a/options/system/boot/plymouth.nix b/options/system/boot/plymouth.nix index 66c0a5a..e4bad4d 100644 --- a/options/system/boot/plymouth.nix +++ b/options/system/boot/plymouth.nix @@ -1,7 +1,7 @@ -{lib, ...}: -with lib; let +{ lib, ... }: with lib; let inherit (lib) mkEnableOption mkOption types; -in { +in +{ options.myOptions.system.boot.plymouth = { enable = mkEnableOption '' Plymouth boot splash. diff --git a/options/system/boot/secure-boot.nix b/options/system/boot/secure-boot.nix index 1f24c52..489a632 100644 --- a/options/system/boot/secure-boot.nix +++ b/options/system/boot/secure-boot.nix @@ -1,9 +1,9 @@ -{lib, ...}: -with lib; let +{ lib, ... }: with lib; let inherit (lib) mkEnableOption; -in { +in +{ options.myOptions.system.boot.secure-boot = { - enable = mkEnableOption '' + enable = mkEnableOption '' secure-boot using lanzaboote. Note that you will need to have UEFI firmware, and the rebuild @@ -18,6 +18,6 @@ in { sudo sbctl enroll-keys -m ``` Then reboot, and secure-boot should be enabled. - ''; + ''; }; } diff --git a/options/system/default.nix b/options/system/default.nix index 2b66816..eed9bcf 100644 --- a/options/system/default.nix +++ b/options/system/default.nix @@ -1,7 +1,7 @@ -{lib, ...}: -with lib; let +{ lib, ... }: with lib; let inherit (lib) mkOption; -in { +in +{ imports = [ ./boot ./impermanence.nix diff --git a/options/system/impermanence.nix b/options/system/impermanence.nix index f29b113..a5fe4ff 100644 --- a/options/system/impermanence.nix +++ b/options/system/impermanence.nix @@ -1,13 +1,9 @@ -{ - lib, - config, - ... -}: -with lib; let +{ lib, config, ... }: with lib; let inherit (lib) mkEnableOption mkOption literalExpression types; cfg = config.myOptions.system.impermanence; -in { +in +{ options.myOptions.system.impermanence = { root = { enable = mkEnableOption '' @@ -92,7 +88,7 @@ in { This does not create any subdirectories, all of the persistent home files fill be put directly in here. The user should be the owner of this directory. - If you don't wish to distinguish between data and system / configuration files, + If you don't wish to distinguish between data and system / configuration files, you can point this to the same location. ''; }; @@ -133,16 +129,16 @@ in { }; in { enable = mkEnableOption '' - automatic wiping of specified BTRFS subvolumes from initrd. + automatic wiping of specified BTRFS subvolumes from initrd. - If you're using BTRFS, you will generally want to enable this, however - with a non-BTRFS system, or in case you wish to set up some custom handling - which this module doesn't support, you will need to write your own logic - for automatic root wiping. + If you're using BTRFS, you will generally want to enable this, however + with a non-BTRFS system, or in case you wish to set up some custom handling + which this module doesn't support, you will need to write your own logic + for automatic root wiping. - One option is is to simply have your root get mounted from tmpfs, making it - live in RAM. This does however require dedicating a concrete chunk of RAM. - ''; + One option is is to simply have your root get mounted from tmpfs, making it + live in RAM. This does however require dedicating a concrete chunk of RAM. + ''; devices = mkOption { default = {}; diff --git a/options/workstation/default.nix b/options/workstation/default.nix index e6d10c1..d47b613 100644 --- a/options/workstation/default.nix +++ b/options/workstation/default.nix @@ -1,13 +1,9 @@ -{ - lib, - config, - ... -}: -with lib; let +{ lib, config, ... }: with lib; let inherit (lib) mkEnableOption mkOption literalExpression types; cfg = config.myOptions.workstation; -in { +in +{ options.myOptions.workstation = { printing = { enable = mkEnableOption '' diff --git a/shells/default.nix b/shells/default.nix index 7fd5694..5934283 100644 --- a/shells/default.nix +++ b/shells/default.nix @@ -1,4 +1,4 @@ -{inputs, ...}: let +{inputs, ...}: let inherit (inputs) nixpkgs; system = "x86_64-linux"; diff --git a/system/roles/laptop/power/acpi.nix b/system/roles/laptop/power/acpi.nix index c4924bc..795cb57 100644 --- a/system/roles/laptop/power/acpi.nix +++ b/system/roles/laptop/power/acpi.nix @@ -1,9 +1,4 @@ -{ - pkgs, - lib, - config, - ... -}: let +{ pkgs, lib, config, ...}: let inherit (lib) mkIf; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop"]; @@ -11,7 +6,7 @@ in { config = mkIf (builtins.elem deviceType acceptedTypes) { hardware.acpilight.enable = true; - environment.systemPackages = with pkgs; [acpi]; + environment.systemPackages = with pkgs; [ acpi ]; # handle ACPI events services.acpid.enable = true; @@ -25,3 +20,4 @@ in { }; }; } + diff --git a/system/roles/laptop/power/default.nix b/system/roles/laptop/power/default.nix index 673e56a..6ffaf07 100644 --- a/system/roles/laptop/power/default.nix +++ b/system/roles/laptop/power/default.nix @@ -1,9 +1,4 @@ -{ - pkgs, - lib, - config, - ... -}: let +{ pkgs, lib, config, ...}: let inherit (lib) mkIf; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop"]; @@ -15,6 +10,6 @@ in { ]; config = mkIf (builtins.elem deviceType acceptedTypes) { - environment.systemPackages = with pkgs; [powertop]; + environment.systemPackages = with pkgs; [ powertop ]; }; } diff --git a/system/roles/laptop/power/power-profiles-daemon/default.nix b/system/roles/laptop/power/power-profiles-daemon/default.nix index bc74e65..89c7371 100644 --- a/system/roles/laptop/power/power-profiles-daemon/default.nix +++ b/system/roles/laptop/power/power-profiles-daemon/default.nix @@ -1,9 +1,4 @@ -{ - pkgs, - lib, - config, - ... -}: let +{ pkgs, lib, config, ...}: let inherit (lib) mkIf; inherit (lib.modules) mkForce; inherit (lib.strings) makeBinPath; diff --git a/system/roles/laptop/power/upower.nix b/system/roles/laptop/power/upower.nix index 0f0c1d5..2e59b30 100644 --- a/system/roles/laptop/power/upower.nix +++ b/system/roles/laptop/power/upower.nix @@ -1,9 +1,4 @@ -{ - pkgs, - lib, - config, - ... -}: let +{ pkgs, lib, config, ...}: let inherit (lib) mkIf; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop"]; @@ -21,3 +16,4 @@ in { }; }; } + diff --git a/system/roles/laptop/touchpad.nix b/system/roles/laptop/touchpad.nix index 9bb8a99..aa05640 100644 --- a/system/roles/laptop/touchpad.nix +++ b/system/roles/laptop/touchpad.nix @@ -1,8 +1,4 @@ -{ - lib, - config, - ... -}: let +{ lib, config, ...}: let inherit (lib) mkIf; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop"]; diff --git a/system/roles/workstation/display/login/greetd.nix b/system/roles/workstation/display/login/greetd.nix index 22d9157..c2671c2 100644 --- a/system/roles/workstation/display/login/greetd.nix +++ b/system/roles/workstation/display/login/greetd.nix @@ -7,6 +7,7 @@ inherit (lib) mkIf getExe; inherit (lib.strings) concatStringsSep; + deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop" "desktop"]; @@ -73,6 +74,6 @@ in { }; # Persist info about previous session & user - myOptions.system.impermanence.root.extraDirectories = ["/var/cache/tuigreet"]; + myOptions.system.impermanence.root.extraDirectories = [ "/var/cache/tuigreet" ]; }; } diff --git a/system/roles/workstation/display/login/pam.nix b/system/roles/workstation/display/login/pam.nix index 16b4e77..7848f9a 100644 --- a/system/roles/workstation/display/login/pam.nix +++ b/system/roles/workstation/display/login/pam.nix @@ -1,8 +1,4 @@ -{ - lib, - config, - ... -}: let +{lib, config, ...}: let inherit (lib) mkIf; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop" "desktop"]; diff --git a/system/roles/workstation/display/wayland/services.nix b/system/roles/workstation/display/wayland/services.nix index be2afce..0cf06e4 100644 --- a/system/roles/workstation/display/wayland/services.nix +++ b/system/roles/workstation/display/wayland/services.nix @@ -11,7 +11,7 @@ in { config = mkIf cfgEnabled { systemd.services = { # Seat management daemon - # (Takes care of mediating access to shared devices (graphics, input), without requiring + # (Takes care of mediating access to shared devices (graphics, input), without requiring # applications like Wayland compositors being granted root privileges) seatd = { enable = true; diff --git a/system/roles/workstation/display/wayland/xdg-portals.nix b/system/roles/workstation/display/wayland/xdg-portals.nix index 4284129..864b220 100644 --- a/system/roles/workstation/display/wayland/xdg-portals.nix +++ b/system/roles/workstation/display/wayland/xdg-portals.nix @@ -19,14 +19,11 @@ in { # Specify which portals should be used by the individual interfaces # see: - config.common = let + config.common = let # Note: this assumes a wlroots based compositor if it's not hyprland # which may not always actually be the case, however, I can't be bothered to handle # everything here and I don't plan on moving WMs any time soon. - portal = - if cfgHyprlandEnabled - then "hyprland" - else "wlr"; + portal = if cfgHyprlandEnabled then "hyprland" else "wlr"; in { # Use this portal for every interface, unless a specific override is present default = ["gtk"]; diff --git a/system/roles/workstation/fonts.nix b/system/roles/workstation/fonts.nix index 03b5586..4d2a0b6 100644 --- a/system/roles/workstation/fonts.nix +++ b/system/roles/workstation/fonts.nix @@ -1,9 +1,4 @@ -{ - pkgs, - lib, - config, - ... -}: let +{pkgs, lib, config, ...}: let inherit (lib) mkIf; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop" "desktop"]; @@ -20,33 +15,29 @@ in { "Noto Color Emoji" ]; in { - monospace = - [ - "Monaspace Krypton" - "Source Code Pro Medium" - "Source Han Mono" - ] - ++ common; + monospace = [ + "Monaspace Krypton" + "Source Code Pro Medium" + "Source Han Mono" + ] + ++ common; - sansSerif = - [ - "Noto Sans" - "Jost" - "Lexend" - ] - ++ common; + sansSerif = [ + "Noto Sans" + "Jost" + "Lexend" + ] + ++ common; - serif = - [ - "Noto Serif" - ] - ++ common; + serif = [ + "Noto Serif" + ] + ++ common; - emoji = - [ - "Noto Color Emoji" - ] - ++ common; + emoji = [ + "Noto Color Emoji" + ] + ++ common; }; }; @@ -112,8 +103,8 @@ in { }; environment.systemPackages = with pkgs; [ - # Tool for searching and previewing installed fonts - font-manager + # Tool for searching and previewing installed fonts + font-manager ]; }; } diff --git a/system/roles/workstation/programs/misc.nix b/system/roles/workstation/programs/misc.nix index 2348696..db97a18 100644 --- a/system/roles/workstation/programs/misc.nix +++ b/system/roles/workstation/programs/misc.nix @@ -1,8 +1,4 @@ -{ - lib, - config, - ... -}: let +{ lib, config, ...}: let inherit (lib) mkIf; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop" "desktop"]; diff --git a/system/roles/workstation/programs/physlock.nix b/system/roles/workstation/programs/physlock.nix index 00f3c6d..574ec41 100644 --- a/system/roles/workstation/programs/physlock.nix +++ b/system/roles/workstation/programs/physlock.nix @@ -1,8 +1,4 @@ -{ - lib, - config, - ... -}: let +{ lib, config, ...}: let inherit (lib) mkIf; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop" "desktop"]; diff --git a/system/roles/workstation/programs/steam.nix b/system/roles/workstation/programs/steam.nix index c976970..02843ff 100644 --- a/system/roles/workstation/programs/steam.nix +++ b/system/roles/workstation/programs/steam.nix @@ -16,3 +16,4 @@ in { }; }; } + diff --git a/system/roles/workstation/programs/thunar.nix b/system/roles/workstation/programs/thunar.nix index 820df05..513b2ec 100644 --- a/system/roles/workstation/programs/thunar.nix +++ b/system/roles/workstation/programs/thunar.nix @@ -1,7 +1,7 @@ -{ - lib, - pkgs, - config, +{ + lib, + pkgs, + config, ... }: let inherit (lib) mkIf; @@ -9,7 +9,7 @@ acceptedTypes = ["laptop" "desktop"]; in { config = mkIf (builtins.elem deviceType acceptedTypes) { - # Unconditionally enable thunar file manager here as a relatively + # Unconditionally enable thunar file manager here as a relatively # lightweight fallback option for my default file manager. programs.thunar = { enable = true; @@ -34,3 +34,4 @@ in { services.tumbler.enable = true; }; } + diff --git a/system/roles/workstation/programs/virtualbox.nix b/system/roles/workstation/programs/virtualbox.nix index d764732..a890e84 100644 --- a/system/roles/workstation/programs/virtualbox.nix +++ b/system/roles/workstation/programs/virtualbox.nix @@ -18,6 +18,6 @@ in { headless = true; }; - users.extraGroups.vboxusers.members = ["${cfgUser}"]; + users.extraGroups.vboxusers.members = [ "${cfgUser}" ]; }; } diff --git a/system/roles/workstation/services/default.nix b/system/roles/workstation/services/default.nix index f84bb73..ec9cd53 100644 --- a/system/roles/workstation/services/default.nix +++ b/system/roles/workstation/services/default.nix @@ -8,3 +8,4 @@ ./gnome-keyring.nix ]; } + diff --git a/system/roles/workstation/services/earlyoom.nix b/system/roles/workstation/services/earlyoom.nix index 8972be7..b2f2c05 100644 --- a/system/roles/workstation/services/earlyoom.nix +++ b/system/roles/workstation/services/earlyoom.nix @@ -1,9 +1,4 @@ -{ - pkgs, - lib, - config, - ... -}: let +{pkgs, lib, config, ...}: let inherit (lib) mkIf; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop" "desktop"]; diff --git a/system/roles/workstation/services/gnome-keyring.nix b/system/roles/workstation/services/gnome-keyring.nix index 4d7a6a5..23d8589 100644 --- a/system/roles/workstation/services/gnome-keyring.nix +++ b/system/roles/workstation/services/gnome-keyring.nix @@ -1,9 +1,4 @@ -{ - pkgs, - lib, - config, - ... -}: let +{pkgs, lib, config, ...}: let inherit (lib) mkIf; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop" "desktop"]; @@ -19,7 +14,7 @@ in { programs.seahorse.enable = true; xdg.portal.config.common = { - "org.freedesktop.impl.portal.Secret" = ["gnome-keyring"]; + "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ]; }; }; } diff --git a/system/roles/workstation/services/logind.nix b/system/roles/workstation/services/logind.nix index b86731a..86f778b 100644 --- a/system/roles/workstation/services/logind.nix +++ b/system/roles/workstation/services/logind.nix @@ -1,8 +1,4 @@ -{ - lib, - config, - ... -}: let +{lib, config, ...}: let inherit (lib) mkIf; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop" "desktop"]; diff --git a/system/roles/workstation/services/mount.nix b/system/roles/workstation/services/mount.nix index 0f77780..d4bfe65 100644 --- a/system/roles/workstation/services/mount.nix +++ b/system/roles/workstation/services/mount.nix @@ -1,8 +1,4 @@ -{ - lib, - config, - ... -}: let +{ lib, config, ...}: let inherit (lib) mkIf; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop" "desktop"]; diff --git a/system/shared/boot/generic.nix b/system/shared/boot/generic.nix index e4560cb..7efa56a 100644 --- a/system/shared/boot/generic.nix +++ b/system/shared/boot/generic.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: let +{ config, lib, ... }: let inherit (lib) mkDefault optionals; cfg = config.myOptions.system.boot; @@ -29,7 +25,7 @@ in { tmp = { # /tmp on tmpfs, lets it live on your ram - # it defaults to false, which means you will use disk space instead of ram + # it defaults to false, which means you will use disk space instead of ram # enable tmpfs tmp on anything where you have ram to spare useTmpfs = cfg.tmpOnTmpfs; @@ -43,7 +39,7 @@ in { tmpfsSize = mkDefault "50%"; }; - kernelParams = optionals cfg.silentBoot [ + kernelParams = (optionals cfg.silentBoot [ # tell the kernel to not be verbose "quiet" @@ -57,6 +53,6 @@ in { # disable systemd status messages "systemd.show_status=auto" "rd.systemd.show_status=auto" - ]; + ]); }; } diff --git a/system/shared/boot/loaders/systemd-boot.nix b/system/shared/boot/loaders/systemd-boot.nix index c6bc965..68c406b 100644 --- a/system/shared/boot/loaders/systemd-boot.nix +++ b/system/shared/boot/loaders/systemd-boot.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: let +{ config, lib, ... }: let cfg = config.myOptions.system.boot; in { boot.loader.systemd-boot = { diff --git a/system/shared/boot/numlock.nix b/system/shared/boot/numlock.nix index 26df48a..64bb6e7 100644 --- a/system/shared/boot/numlock.nix +++ b/system/shared/boot/numlock.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +{ pkgs, ... }: { boot.initrd.systemd = { # Include setleds binary in the initrd # (the nix store doesn't exists in there yet, so we need to include @@ -12,12 +12,12 @@ services."numlock" = { enable = true; description = "Activate Numlock"; - wantedBy = ["initrd.target"]; + wantedBy = [ "initrd.target" ]; # Delay disk decryption until this unit is started - before = ["systemd-cryptsetup@cryptfs.service"]; + before = [ "systemd-cryptsetup@cryptfs.service" ]; unitConfig.DefaultDependencies = "no"; serviceConfig.Type = "oneshot"; - # This is essentially runs the same code as present in the + # This is essentially runs the same code as present in the # mkinitcpio-numlock hook on Arch Linux (AUR). script = '' #!/bin/bash diff --git a/system/shared/boot/plymouth.nix b/system/shared/boot/plymouth.nix index 0fea4e7..ad6041c 100644 --- a/system/shared/boot/plymouth.nix +++ b/system/shared/boot/plymouth.nix @@ -1,26 +1,20 @@ -{ - config, - lib, - pkgs, - ... -}: let +{ config, lib, pkgs, ...}: let inherit (lib) mkIf; cfg = config.myOptions.system.boot.plymouth; in { config = mkIf cfg.enable { boot = { - plymouth = - { - enable = true; - theme = cfg.selectedTheme; - } - // lib.optionalAttrs cfg.withThemes { - themePackages = [ - (pkgs.adi1090x-plymouth-themes.override { - selected_themes = [cfg.selectedTheme]; - }) - ]; - }; + plymouth = { + enable = true; + theme = cfg.selectedTheme; + } + // lib.optionalAttrs cfg.withThemes { + themePackages = [ + (pkgs.adi1090x-plymouth-themes.override { + selected_themes = [ cfg.selectedTheme ]; + }) + ]; + }; kernelParams = ["splash"]; }; diff --git a/system/shared/boot/secure-boot.nix b/system/shared/boot/secure-boot.nix index 627a525..5dc1e34 100644 --- a/system/shared/boot/secure-boot.nix +++ b/system/shared/boot/secure-boot.nix @@ -1,16 +1,11 @@ -{ - config, - pkgs, - lib, - ... -}: let +{ config, pkgs, lib, ... }: let inherit (lib) mkIf; cfg = config.myOptions.system.boot.secure-boot; in { config = mkIf cfg.enable { # Secure Boot Key Manager - environment.systemPackages = [pkgs.sbctl]; + environment.systemPackages = [ pkgs.sbctl ]; # Persist the secure boot keys (for impermanence) myOptions.system.impermanence.root.extraDirectories = [ diff --git a/system/shared/hardware/bluetooth.nix b/system/shared/hardware/bluetooth.nix index 3dbf379..a4ef4d1 100644 --- a/system/shared/hardware/bluetooth.nix +++ b/system/shared/hardware/bluetooth.nix @@ -12,7 +12,7 @@ in { hardware.bluetooth = { enable = true; package = pkgs.bluez5-experimental; - powerOnBoot = cfg.powerOnBoot; + powerOnBoot = cfg.powerOnBoot; #hsphfpd.enable = true; disabledPlugins = ["sap"]; settings = { diff --git a/system/shared/hardware/cpu/amd.nix b/system/shared/hardware/cpu/amd.nix index 9f5a7f3..6ef2db0 100644 --- a/system/shared/hardware/cpu/amd.nix +++ b/system/shared/hardware/cpu/amd.nix @@ -1,10 +1,8 @@ -{ - config, - lib, - ... -}: let +{ config, lib, ... }: +let dev = config.myOptions.device; -in { +in +{ config = lib.mkIf (dev.cpu.type == "amd") { hardware.cpu.amd.updateMicrocode = true; }; diff --git a/system/shared/hardware/cpu/intel.nix b/system/shared/hardware/cpu/intel.nix index 9cf4c55..9fd113b 100644 --- a/system/shared/hardware/cpu/intel.nix +++ b/system/shared/hardware/cpu/intel.nix @@ -1,10 +1,8 @@ -{ - config, - lib, - ... -}: let +{ config, lib, ... }: +let dev = config.myOptions.device; -in { +in +{ config = lib.mkIf (dev.cpu.type == "intel") { hardware.cpu.intel.updateMicrocode = true; }; diff --git a/system/shared/hardware/generic.nix b/system/shared/hardware/generic.nix index 85fd8d6..9e34b69 100644 --- a/system/shared/hardware/generic.nix +++ b/system/shared/hardware/generic.nix @@ -6,3 +6,4 @@ # Without this, it defaults to `config.hardware.enableAllFirmware`. hardware.enableRedistributableFirmware = lib.mkDefault true; } + diff --git a/system/shared/hardware/gpu/amd.nix b/system/shared/hardware/gpu/amd.nix index 05d6d63..173d886 100644 --- a/system/shared/hardware/gpu/amd.nix +++ b/system/shared/hardware/gpu/amd.nix @@ -1,18 +1,15 @@ -# WARNING: This file is currently untested +# WARNING: This file is currently untested # (I didn't yet run this NixOS config on any AMD GPU systems) -{ - config, - lib, - pkgs, - ... -}: let +{ config, lib, pkgs, ... }: +let dev = config.myOptions.device; -in { +in +{ config = lib.mkIf (dev.gpu.type == "amd") { services.xserver.videoDrivers = lib.mkDefault ["modesetting" "amdgpu"]; boot = { - initrd.kernelModules = ["amdgpu"]; # load amdgpu kernel module as early as initrd + initrd.kernelModules = ["amdgpu"]; # load amdgpu kernel module as early as initrd kernelModules = ["amdgpu"]; # if loading somehow fails during initrd but the boot continues, try again later }; @@ -29,7 +26,7 @@ in { graphics = { enable = true; - extraPackages = with pkgs; [ + extraPackages = with pkgs; [ # Enable AMDVLK (AMD's open-source Vulkan driver) amdvlk @@ -38,14 +35,14 @@ in { rocmPackages.clr.icd ]; # AMDVLK for 32-bit applications - extraPackages32 = with pkgs; [driversi686Linux.amdvlk]; + extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ]; }; }; # HIP (SDK that allows running CUDA code on AMD GPUs) # Most software has the paths hard-coded systemd.tmpfiles.rules = [ - "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" + "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ]; }; } diff --git a/system/shared/hardware/gpu/default.nix b/system/shared/hardware/gpu/default.nix index 35f8693..4a57cf9 100644 --- a/system/shared/hardware/gpu/default.nix +++ b/system/shared/hardware/gpu/default.nix @@ -4,3 +4,4 @@ _: { ./nvidia.nix ]; } + diff --git a/system/shared/hardware/gpu/nvidia.nix b/system/shared/hardware/gpu/nvidia.nix index 1f2107c..8480875 100644 --- a/system/shared/hardware/gpu/nvidia.nix +++ b/system/shared/hardware/gpu/nvidia.nix @@ -1,14 +1,11 @@ -{ - config, - lib, - pkgs, - ... -}: let +{ config, lib, pkgs, ... }: +let dev = config.myOptions.device; isWayland = config.myOptions.home-manager.wms.isWayland; inherit (lib) mkIf mkDefault mkMerge; -in { +in +{ config = mkIf (builtins.elem dev.gpu.type ["nvidia" "hybrid-nvidia"]) { # Nvidia drivers are unfree software nixpkgs.config.allowUnfree = true; @@ -38,9 +35,9 @@ in { # 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 + # supported GPUs is at: https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus # - # Enable this by default, hosts may override this option if their gpu is not + # Enable this by default, hosts may override this option if their gpu is not # supported by the open source drivers open = mkDefault true; @@ -91,7 +88,7 @@ in { ]; sessionVariables = mkMerge [ - {LIBVA_DRIVER_NAME = "nvidia";} + { LIBVA_DRIVER_NAME = "nvidia"; } (mkIf isWayland { WLR_NO_HARDWARE_CURSORS = "1"; diff --git a/system/shared/hardware/tpm.nix b/system/shared/hardware/tpm.nix index d918470..d6ae3e6 100644 --- a/system/shared/hardware/tpm.nix +++ b/system/shared/hardware/tpm.nix @@ -1,9 +1,4 @@ -{ - config, - lib, - pkgs, - ... -}: let +{ config, lib, pkgs, ... }: let inherit (lib) mkIf mkDefault; enabled = config.myOptions.device.hasTPM; @@ -26,6 +21,6 @@ in { pkcs11.enable = mkDefault false; }; - environment.systemPackages = with pkgs; [tpm2-tss tpm2-tools]; + environment.systemPackages = with pkgs; [ tpm2-tss tpm2-tools ]; }; } diff --git a/system/shared/impermanence/autowipe.nix b/system/shared/impermanence/autowipe.nix index b261f6d..71618d5 100644 --- a/system/shared/impermanence/autowipe.nix +++ b/system/shared/impermanence/autowipe.nix @@ -1,11 +1,8 @@ -{ - config, - lib, - ... -}: let +{ config, lib, ... }: let inherit (lib) mkIf concatStringsSep flatten mapAttrsToList; cfg = config.myOptions.system.impermanence.autoWipeBtrfs; -in { +in +{ config = mkIf cfg.enable { boot.initrd.systemd = { enable = true; # This enables systemd support in stage 1 - required for below setup @@ -13,11 +10,11 @@ in { services.rollback = { description = "Rollback BTRFS subvolumes to a pristine state"; enable = true; - wantedBy = ["initrd.target"]; + wantedBy = [ "initrd.target" ]; # Make sure it's done after decryption (i.e. LUKS/TPM process) - after = ["systemd-cryptsetup@cryptfs.service"]; + after = [ "systemd-cryptsetup@cryptfs.service" ]; # mount the root fs before clearing - before = ["sysroot.mount"]; + before = [ "sysroot.mount" ]; unitConfig.DefaultDependencies = "no"; serviceConfig.Type = "oneshot"; script = let @@ -34,10 +31,9 @@ in { # Recreate each specified subvolume ${concatStringsSep "\n" (map (subvolume: '' - delete_subvolume_recursively "/mnt/${subvolume}" - btrfs subvolume create "/mnt/${subvolume}" - '') - subvolumes)} + delete_subvolume_recursively "/mnt/${subvolume}" + btrfs subvolume create "/mnt/${subvolume}" + '') subvolumes)} # Cleanup: unmount the device echo "Unmounting BTRFS root from ${devicePath}" @@ -66,11 +62,9 @@ in { btrfs subvolume delete "$1" } - ${concatStringsSep "\n" (mapAttrsToList ( - devicePath: deviceOpts: - wipeScript devicePath deviceOpts.subvolumes - ) - cfg.devices)} + ${concatStringsSep "\n" (mapAttrsToList (devicePath: deviceOpts: + wipeScript devicePath deviceOpts.subvolumes + ) cfg.devices)} ''; }; }; diff --git a/system/shared/impermanence/default.nix b/system/shared/impermanence/default.nix index 24f42fd..e09594e 100644 --- a/system/shared/impermanence/default.nix +++ b/system/shared/impermanence/default.nix @@ -1,4 +1,5 @@ -{inputs, ...}: { +{ inputs, ... }: +{ imports = [ ./root.nix ./autowipe.nix diff --git a/system/shared/impermanence/root.nix b/system/shared/impermanence/root.nix index 6adbfc3..4633728 100644 --- a/system/shared/impermanence/root.nix +++ b/system/shared/impermanence/root.nix @@ -1,13 +1,10 @@ -{ - config, - lib, - ... -}: let +{ config, lib, ... }: let inherit (lib) mkIf mkForce; cfgSystem = config.myOptions.system; cfg = config.myOptions.system.impermanence.root; -in { +in +{ config = mkIf cfg.enable { users = { # This option makes it that users are not mutable outside of our configuration. @@ -31,23 +28,19 @@ in { environment.persistence."${cfg.persistentMountPoint}/system" = { hideMounts = true; - directories = - [ - "/etc/nixos" # NixOS configuration source - "/etc/NetworkManager/system-connections" # saved network connections - "/var/db/sudo" # keeps track of who got the sudo lecture already - # "/var/log" # I sometimes use a subvolume for this, added manually if not - "/var/lib/nixos" - "/var/lib/bluetooth" - "/var/lib/systemd/coredump" # captured coredumps - ] - ++ cfg.extraDirectories; + directories = [ + "/etc/nixos" # NixOS configuration source + "/etc/NetworkManager/system-connections" # saved network connections + "/var/db/sudo" # keeps track of who got the sudo lecture already + # "/var/log" # I sometimes use a subvolume for this, added manually if not + "/var/lib/nixos" + "/var/lib/bluetooth" + "/var/lib/systemd/coredump" # captured coredumps + ] ++ cfg.extraDirectories; - files = - [ - "/etc/machine-id" - ] - ++ cfg.extraFiles; + files = [ + "/etc/machine-id" + ] ++ cfg.extraFiles; }; # For some reason, NetworkManager needs this instead of the impermanence mode diff --git a/system/shared/network.nix b/system/shared/network.nix index 6bc0e9e..3065391 100644 --- a/system/shared/network.nix +++ b/system/shared/network.nix @@ -1,4 +1,5 @@ -{lib, ...}: { +{ lib, ... }: +{ networking = { firewall.enable = false; diff --git a/system/shared/nix/default.nix b/system/shared/nix/default.nix index dbabd38..bac6426 100644 --- a/system/shared/nix/default.nix +++ b/system/shared/nix/default.nix @@ -1,4 +1,6 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ + imports = [ ./cachix.nix ./gc.nix @@ -9,7 +11,7 @@ nix = { settings = { # enable flakes support - experimental-features = ["nix-command" "flakes"]; + experimental-features = [ "nix-command" "flakes" ]; # Keep the built outputs of derivations in Nix store, even if the package is no longer needed # - prevents the need to rebuild/redownload if it becomes a dependency again @@ -23,13 +25,13 @@ # Give these users/groups additional rights when connecting to the Nix daemon # like specifying extra binary caches - trusted-users = ["root" "@wheel"]; + trusted-users = [ "root" "@wheel" ]; # Tell nix to use xdg base directories # If you're just setting this, you will need to move the directories # manually, nix won't do it for you: # - mv "$HOME/.nix-defexpr" "$XDG_STATE_HOME/nix/defexpr" - # - mv "$HOME/.nix-profile" "$XDG_STATE_HOME/nix/profile" + # - mv "$HOME/.nix-profile" "$XDG_STATE_HOME/nix/profile" use-xdg-base-directories = true; }; }; @@ -37,5 +39,5 @@ nixpkgs.config.allowUnfree = true; # Git is needed for flakes - environment.systemPackages = [pkgs.git]; + environment.systemPackages = [ pkgs.git ]; } diff --git a/system/shared/programs.nix b/system/shared/programs.nix index 7ae924a..9e00d59 100644 --- a/system/shared/programs.nix +++ b/system/shared/programs.nix @@ -1,6 +1,7 @@ {lib, ...}: let inherit (lib) mkForce; in { + programs = { # Explicitly disable nano, it sucks and I don't want it nano.enable = mkForce false; diff --git a/system/shared/security/apparmor.nix b/system/shared/security/apparmor.nix index 7c2b902..716c4c4 100644 --- a/system/shared/security/apparmor.nix +++ b/system/shared/security/apparmor.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{ config, pkgs, ... }: { services.dbus.apparmor = "enabled"; environment.systemPackages = with pkgs; [ diff --git a/system/shared/security/auditd.nix b/system/shared/security/auditd.nix index 4c58db0..3691d6f 100644 --- a/system/shared/security/auditd.nix +++ b/system/shared/security/auditd.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: let +{ config, lib, ... }: let inherit (lib) mkIf; cfg = config.myOptions.security.auditd; diff --git a/system/shared/security/polkit.nix b/system/shared/security/polkit.nix index 21d7dd8..ac8d279 100644 --- a/system/shared/security/polkit.nix +++ b/system/shared/security/polkit.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: { +{ config, lib, ... }: { security.polkit = { enable = true; debug = lib.mkDefault true; diff --git a/system/shared/services/fstrim.nix b/system/shared/services/fstrim.nix index 746b545..01bda11 100644 --- a/system/shared/services/fstrim.nix +++ b/system/shared/services/fstrim.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: let +{ config, lib, ... }: let inherit (lib.modules) mkIf; in { # if lvm is enabled, then tell it to issue discards diff --git a/system/shared/services/fwupd.nix b/system/shared/services/fwupd.nix index 120ba77..6178ecc 100644 --- a/system/shared/services/fwupd.nix +++ b/system/shared/services/fwupd.nix @@ -2,6 +2,6 @@ # firmware updater for machine hardware services.fwupd = { enable = true; - daemonSettings.EspLocation = config.boot.loader.efi.efiSysMountPoint; + daemonSettings.EspLocation = config.boot.loader.efi.efiSysMountPoint; }; } diff --git a/system/shared/services/logrotate.nix b/system/shared/services/logrotate.nix index 9212ab4..b31d870 100644 --- a/system/shared/services/logrotate.nix +++ b/system/shared/services/logrotate.nix @@ -1,8 +1,4 @@ -{ - pkgs, - lib, - ... -}: { +{ pkgs, lib, ... }: { services.logrotate.settings.header = { # general global = true; diff --git a/system/shared/services/oomd.nix b/system/shared/services/oomd.nix index 605589d..717382f 100644 --- a/system/shared/services/oomd.nix +++ b/system/shared/services/oomd.nix @@ -1,4 +1,4 @@ -{lib, ...}: { +{ lib, ... }: { systemd = { # OOMd: Out Of Memory daemon # By default, this will only kill cgroups. So either systemd services diff --git a/system/shared/services/ssh.nix b/system/shared/services/ssh.nix index 01f5a31..535827c 100644 --- a/system/shared/services/ssh.nix +++ b/system/shared/services/ssh.nix @@ -1,4 +1,4 @@ -{...}: { +{ ... }: { # TODO: This really shouldn't be a default service in system/ services.openssh = { enable = true; @@ -9,3 +9,4 @@ }; }; } + diff --git a/system/shared/system.nix b/system/shared/system.nix index b91da9d..28e4c9e 100644 --- a/system/shared/system.nix +++ b/system/shared/system.nix @@ -1,12 +1,7 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let +{ config, lib, pkgs, ... }: with lib; let cfg = config.myOptions.system; -in { +in +{ networking.hostName = cfg.hostname; # Default shell for the user @@ -15,7 +10,7 @@ in { users = { users.${cfg.username} = { isNormalUser = true; - extraGroups = ["wheel"]; + extraGroups = [ "wheel" ]; shell = pkgs.zsh; }; };