Преглед на файлове

feat(odin+all): quick-setup and formatter

Zander Hawke преди 9 месеца
родител
ревизия
d74202db6e
променени са 54 файла, в които са добавени 1666 реда и са изтрити 631 реда
  1. 2 5
      .envrc
  2. 0 39
      devenv.nix
  3. 53 60
      flake.nix
  4. 9 8
      home/features/cli/fish.nix
  5. 5 4
      home/features/cli/gnupg.nix
  6. 940 151
      home/features/cli/zellij.nix
  7. 8 9
      home/features/core.nix
  8. 32 8
      home/features/desktop/aerospace.nix
  9. 4 2
      home/features/desktop/default.nix
  10. 2 1
      home/features/desktop/fonts.nix
  11. 5 4
      home/features/desktop/ghostty.nix
  12. 6 4
      home/features/desktop/yubikey.nix
  13. 10 4
      home/features/desktop/zen-browser.nix
  14. 75 15
      home/features/nvim/default.nix
  15. 26 5
      home/features/nvim/opencode.nix
  16. 60 10
      home/features/nvim/telescope.nix
  17. 4 1
      home/features/nvim/treesitter.nix
  18. 30 6
      home/features/nvim/which-key.nix
  19. 5 4
      home/meili.nix
  20. 6 4
      hosts/common/default.nix
  21. 8 6
      hosts/common/home-manager.nix
  22. 16 15
      hosts/common/nix.nix
  23. 7 8
      hosts/meili/default.nix
  24. 2 1
      hosts/meili/software.nix
  25. 1 1
      hosts/meili/system.nix
  26. 2 1
      hosts/modgud/default.nix
  27. 6 4
      hosts/modgud/disk.nix
  28. 6 4
      hosts/modgud/hardware.nix
  29. 6 6
      hosts/odin/default.nix
  30. 1 2
      hosts/odin/services/cloudflared.nix
  31. 3 6
      hosts/odin/services/immich.nix
  32. 1 2
      hosts/odin/services/ntfy.nix
  33. 31 26
      hosts/odin/services/samba.nix
  34. 1 2
      hosts/odin/services/vaultwarden.nix
  35. 7 14
      hosts/odin/system/age.nix
  36. 13 6
      hosts/odin/system/default.nix
  37. 40 22
      hosts/odin/system/disko.nix
  38. 6 1
      hosts/odin/system/impermanence.nix
  39. 4 3
      hosts/odin/system/mergerfs.nix
  40. 5 1
      hosts/odin/users/thomas.nix
  41. 45 43
      lib/default.nix
  42. 13 7
      modules/darwin/kanata.nix
  43. 6 4
      modules/darwin/networking/remote-login.nix
  44. 42 40
      modules/darwin/security/pam-reattach.nix
  45. 6 4
      modules/darwin/system/rosetta.nix
  46. 16 15
      modules/global/nix-config.nix
  47. 8 11
      overlays/default.nix
  48. 6 1
      packages/aerospace-tmux-focus.nix
  49. 14 2
      packages/default.nix
  50. 20 19
      packages/go-avahi-cname.nix
  51. 3 2
      packages/opencode-nvim.nix
  52. 4 3
      packages/photo-cli.nix
  53. 8 5
      packages/quick-setup.nix
  54. 27 0
      shell.nix

+ 2 - 5
.envrc

@@ -4,8 +4,5 @@ fi
 
 watch_file flake.nix
 watch_file flake.lock
-watch_file devenv.nix
-if ! use flake . --no-pure-eval
-then
-  echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
-fi
+watch_file shell.nix
+use flake .

+ 0 - 39
devenv.nix

@@ -1,39 +0,0 @@
-{ pkgs, lib, ... }:
-{
-  packages = with pkgs; [ gemini-cli ];
-
-  git-hooks.hooks = {
-    deadnix.enable = true;
-    nixpkgs-fmt.enable = true;
-  };
-
-  scripts = rec {
-    update.exec = "nix flake update";
-    home-manager.exec = "${lib.getExe pkgs.home-manager} $@";
-    nixos-rebuild.exec = "${lib.getExe pkgs.nixos-rebuild} $@";
-
-    hmb.exec = ''
-      ${home-manager.exec} build --flake .#$(whoami)@$(hostname);
-    '';
-    hms.exec = ''
-      ${home-manager.exec} switch --flake .#$(whoami)@$(hostname);
-    '';
-
-    nrb.exec = ''
-      sudo ${nixos-rebuild.exec} build --flake .#$(hostname);
-    '';
-    nrt.exec = ''
-      sudo ${nixos-rebuild.exec} test --flake .#$(hostname);
-    '';
-    nrs.exec = ''
-      sudo ${nixos-rebuild.exec} switch --flake .#$(hostname);
-    '';
-
-    drb.exec = ''
-      sudo darwin-rebuild build --flake .#$(hostname);
-    '';
-    drs.exec = ''
-      sudo darwin-rebuild switch --flake .#$(hostname);
-    '';
-  };
-}

+ 53 - 60
flake.nix

@@ -31,74 +31,67 @@
     disko.inputs.nixpkgs.follows = "nixpkgs";
   };
 
-  outputs = { self, ... } @ inputs: rec {
-    lib = import ./lib {
-      inherit inputs;
+  outputs =
+    { self, ... }@inputs:
+    let
       inherit (self) outputs;
-    };
-
-    homeConfigurations = {
-      "thomas@meili" = lib.mkHome {
-        system = "aarch64-darwin";
-        modules = [ ./home/meili.nix ];
+    in
+    rec {
+
+      lib = import ./lib { inherit inputs outputs; };
+      modules = import ./modules { inherit inputs outputs; };
+      overlays = import ./overlays { inherit inputs outputs; };
+
+      formatter = lib.eachSystem (pkgs: pkgs.nixfmt-tree);
+      packages = lib.eachSystem (pkgs: import ./packages { inherit pkgs; });
+      devShells = lib.eachSystem (pkgs: import ./shell.nix { inherit pkgs; });
+
+      templates = {
+        devenv = {
+          path = ./templates/devenv;
+          description = "A template for a devenv environment";
+        };
       };
 
-      "thomas@modgud" = lib.mkHome {
-        system = "x86_64-linux";
-        modules = [ ./home/modgud.nix ];
+      homeConfigurations = {
+        "thomas@meili" = lib.mkHome {
+          system = "aarch64-darwin";
+          modules = [ ./home/meili.nix ];
+        };
+
+        "thomas@modgud" = lib.mkHome {
+          system = "x86_64-linux";
+          modules = [ ./home/modgud.nix ];
+        };
+
+        "thomas@fedora" = lib.mkHome {
+          system = "aarch64-linux";
+          modules = [ ./home/fedora.nix ];
+        };
+
+        "thomas@odin" = lib.mkHome {
+          system = "x86_64-linux";
+          modules = [ ./home/odin.nix ];
+        };
       };
 
-      "thomas@fedora" = lib.mkHome {
-        system = "aarch64-linux";
-        modules = [ ./home/fedora.nix ];
-      };
+      nixosConfigurations = {
+        # modgud = lib.mkSystem {
+        #   system = "x86_64-linux";
+        #   modules = [ ./hosts/modgud ];
+        # };
 
-      "thomas@odin" = lib.mkHome {
-        system = "x86_64-linux";
-        modules = [ ./home/odin.nix ];
+        odin = lib.mkSystem {
+          system = "x86_64-linux";
+          modules = [ ./hosts/odin ];
+        };
       };
-    };
-
-    nixosConfigurations = {
-      # modgud = lib.mkSystem {
-      #   system = "x86_64-linux";
-      #   modules = [ ./hosts/modgud ];
-      # };
 
-      odin = lib.mkSystem {
-        system = "x86_64-linux";
-        modules = [ ./hosts/odin ];
+      darwinConfigurations = {
+        meili = lib.mkDarwin {
+          system = "aarch64-darwin";
+          modules = [ ./hosts/meili ];
+        };
       };
     };
-
-    darwinConfigurations = {
-      meili = lib.mkDarwin {
-        system = "aarch64-darwin";
-        modules = [ ./hosts/meili ];
-      };
-    };
-
-    devShells = lib.mkDevenvShell {
-      default = import ./devenv.nix;
-    };
-
-    modules = import ./modules;
-    overlays = import ./overlays { inherit inputs; };
-
-    packages = lib.eachSystem (system: {
-      devenv-up = self.devShells.${system}.default.config.procfileScript;
-      devenv-test = self.devShells.${system}.default.config.test;
-    } // import ./packages { });
-
-    templates = {
-      devenv = {
-        path = ./templates/devenv;
-        description = "A template for a devenv environment";
-      };
-    };
-
-    apps = lib.eachSystem (system: {
-      quick-setup = packages.${system}.quick-setup;
-    });
-  };
 }

+ 9 - 8
home/features/cli/fish.nix

@@ -6,12 +6,13 @@
     grep = "rg";
   };
 
-  xdg.configFile."fish/conf.d/kanagawa.fish".text =
-    lib.strings.fileContents (pkgs.fetchFromGitHub
-      {
-        owner = "rebelot";
-        repo = "kanagawa.nvim";
-        rev = "83e377c";
-        sha256 = "sha256-IBZFfQRNvIEIFiQF5Gm4LGTmRc2VCWy4Gx51RhtDNDM=";
-      } + "/extras/fish/kanagawa.fish");
+  xdg.configFile."fish/conf.d/kanagawa.fish".text = lib.strings.fileContents (
+    pkgs.fetchFromGitHub {
+      owner = "rebelot";
+      repo = "kanagawa.nvim";
+      rev = "83e377c";
+      sha256 = "sha256-IBZFfQRNvIEIFiQF5Gm4LGTmRc2VCWy4Gx51RhtDNDM=";
+    }
+    + "/extras/fish/kanagawa.fish"
+  );
 }

+ 5 - 4
home/features/cli/gnupg.nix

@@ -1,7 +1,8 @@
-{ config
-, lib
-, pkgs
-, ...
+{
+  config,
+  lib,
+  pkgs,
+  ...
 }:
 let
   configHome = "${config.xdg.configHome}/gnupg";

Файловите разлики са ограничени, защото са твърде много
+ 940 - 151
home/features/cli/zellij.nix


+ 8 - 9
home/features/core.nix

@@ -1,8 +1,10 @@
-{ pkgs
-, outputs
-, lib
-, ...
-}: {
+{
+  pkgs,
+  outputs,
+  lib,
+  ...
+}:
+{
   imports = [
     # INFO: this is shared between home-manager, nixos, and darwin
     outputs.modules.global.nix-config
@@ -16,10 +18,7 @@
     enableNixpkgsReleaseCheck = false;
 
     username = "thomas";
-    homeDirectory =
-      if pkgs.stdenv.isDarwin
-      then "/Users/thomas"
-      else "/home/thomas";
+    homeDirectory = if pkgs.stdenv.isDarwin then "/Users/thomas" else "/home/thomas";
 
     packages = with pkgs; [
       cachix

+ 32 - 8
home/features/desktop/aerospace.nix

@@ -42,14 +42,38 @@
         ctrl-shift-8 = "move-node-to-workspace 8";
 
         # follow window to workspace
-        ctrl-cmd-1 = [ "move-node-to-workspace 1" "workspace 1" ];
-        ctrl-cmd-2 = [ "move-node-to-workspace 2" "workspace 2" ];
-        ctrl-cmd-3 = [ "move-node-to-workspace 3" "workspace 3" ];
-        ctrl-cmd-4 = [ "move-node-to-workspace 4" "workspace 4" ];
-        ctrl-cmd-5 = [ "move-node-to-workspace 5" "workspace 5" ];
-        ctrl-cmd-6 = [ "move-node-to-workspace 6" "workspace 6" ];
-        ctrl-cmd-7 = [ "move-node-to-workspace 7" "workspace 7" ];
-        ctrl-cmd-8 = [ "move-node-to-workspace 8" "workspace 8" ];
+        ctrl-cmd-1 = [
+          "move-node-to-workspace 1"
+          "workspace 1"
+        ];
+        ctrl-cmd-2 = [
+          "move-node-to-workspace 2"
+          "workspace 2"
+        ];
+        ctrl-cmd-3 = [
+          "move-node-to-workspace 3"
+          "workspace 3"
+        ];
+        ctrl-cmd-4 = [
+          "move-node-to-workspace 4"
+          "workspace 4"
+        ];
+        ctrl-cmd-5 = [
+          "move-node-to-workspace 5"
+          "workspace 5"
+        ];
+        ctrl-cmd-6 = [
+          "move-node-to-workspace 6"
+          "workspace 6"
+        ];
+        ctrl-cmd-7 = [
+          "move-node-to-workspace 7"
+          "workspace 7"
+        ];
+        ctrl-cmd-8 = [
+          "move-node-to-workspace 8"
+          "workspace 8"
+        ];
 
         # window management
         ctrl-q = "close";

+ 4 - 2
home/features/desktop/default.nix

@@ -4,9 +4,11 @@
     ./fonts.nix
     ./ghostty.nix
     ./yubikey.nix
-  ] ++ lib.optionals (isDarwin) [
+  ]
+  ++ lib.optionals (isDarwin) [
     ./aerospace.nix
-  ] ++ lib.optionals (!isDarwin) [ ];
+  ]
+  ++ lib.optionals (!isDarwin) [ ];
 
   services.syncthing.enable = true;
 }

+ 2 - 1
home/features/desktop/fonts.nix

@@ -1,4 +1,5 @@
-{ pkgs, ... }: {
+{ pkgs, ... }:
+{
   fonts.fontconfig.enable = true;
 
   home.packages = with pkgs; [

+ 5 - 4
home/features/desktop/ghostty.nix

@@ -1,7 +1,8 @@
-{ config
-, lib
-, isDarwin
-, ...
+{
+  config,
+  lib,
+  isDarwin,
+  ...
 }:
 {
   programs.ghostty = {

+ 6 - 4
home/features/desktop/yubikey.nix

@@ -1,8 +1,10 @@
-{ lib
-, pkgs
-, ...
+{
+  lib,
+  pkgs,
+  ...
 }:
-with lib; let
+with lib;
+let
   inherit (pkgs.stdenv.hostPlatform) isLinux;
 in
 {

+ 10 - 4
home/features/desktop/zen-browser.nix

@@ -1,4 +1,10 @@
-{ inputs, pkgs, lib, config, ... }:
+{
+  inputs,
+  pkgs,
+  lib,
+  config,
+  ...
+}:
 
 let
   locked = value: {
@@ -67,7 +73,7 @@ in
         "extensions.formautofill.addresses.enabled" = false;
         "extensions.formautofill.addresses.capture.enabled" = false;
 
-        # AutofillCreditCardEnabled = false  
+        # AutofillCreditCardEnabled = false
         "extensions.formautofill.creditCards.enabled" = false;
         "extensions.formautofill.creditCards.available" = false;
 
@@ -106,7 +112,7 @@ in
         "browser.newtabpage.activity-stream.feeds.telemetry" = false;
         "browser.newtabpage.activity-stream.telemetry" = false;
 
-        # DontCheckDefaultBrowser = true  
+        # DontCheckDefaultBrowser = true
         "browser.shell.checkDefaultBrowser" = false;
 
         # NoDefaultBookmarks = true
@@ -137,7 +143,7 @@ in
 
   home.activation.zenExtensions = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
     ZEN_PROFILES_DIR="$HOME/Library/Application Support/zen/Profiles"
-    
+
     if [ -d "$ZEN_PROFILES_DIR" ]; then
       # Extract extension settings from the configuration
       EXTENSIONS_CONFIG='${builtins.toJSON config.programs.zen-browser.policies.ExtensionSettings}'

+ 75 - 15
home/features/nvim/default.nix

@@ -1,6 +1,7 @@
-{ inputs
-, pkgs
-, ...
+{
+  inputs,
+  pkgs,
+  ...
 }:
 {
   imports = [
@@ -98,7 +99,11 @@
     };
 
     keymaps = [
-      { key = "<Esc>"; action = "<cmd>nohlsearch<CR>"; mode = "n"; }
+      {
+        key = "<Esc>";
+        action = "<cmd>nohlsearch<CR>";
+        mode = "n";
+      }
       # Diagnostic keymaps
       # { key = "<leader>q"; action.__raw = "vim.diagnostic.setloclist"; mode = "n"; options.desc = "Open diagnostic [Q]uickfix list"; }
       # Exit terminal mode in the builtin terminal
@@ -109,21 +114,76 @@
       # { key = "<C-j>"; action = "<C-w>j"; mode = "n"; options.desc = "Move focus to the lower window"; }
       # { key = "<C-k>"; action = "<C-w>k"; mode = "n"; options.desc = "Move focus to the upper window"; }
       # Move highlighed blocks of code up and down
-      { key = "K"; action = ":m '<-2<CR>gv=gv"; mode = "v"; options.desc = "Move highlighted block up"; }
-      { key = "J"; action = ":m '>+1<CR>gv=gv"; mode = "v"; options.desc = "Move highlighted block down"; }
+      {
+        key = "K";
+        action = ":m '<-2<CR>gv=gv";
+        mode = "v";
+        options.desc = "Move highlighted block up";
+      }
+      {
+        key = "J";
+        action = ":m '>+1<CR>gv=gv";
+        mode = "v";
+        options.desc = "Move highlighted block down";
+      }
 
-      { key = "J"; action = "mzJ`z"; mode = "n"; options.desc = "Join lines without losing cursor position"; }
+      {
+        key = "J";
+        action = "mzJ`z";
+        mode = "n";
+        options.desc = "Join lines without losing cursor position";
+      }
 
-      { key = "<C-d>"; action = "<C-d>zz"; mode = "n"; options.desc = "Scroll down and center cursor"; }
-      { key = "<C-u>"; action = "<C-u>zz"; mode = "n"; options.desc = "Scroll up and center cursor"; }
+      {
+        key = "<C-d>";
+        action = "<C-d>zz";
+        mode = "n";
+        options.desc = "Scroll down and center cursor";
+      }
+      {
+        key = "<C-u>";
+        action = "<C-u>zz";
+        mode = "n";
+        options.desc = "Scroll up and center cursor";
+      }
 
-      { key = "n"; action = "nzzzv"; mode = "n"; options.desc = "Find next and center cursor"; }
-      { key = "N"; action = "Nzzzv"; mode = "n"; options.desc = "Find previous and center cursor"; }
+      {
+        key = "n";
+        action = "nzzzv";
+        mode = "n";
+        options.desc = "Find next and center cursor";
+      }
+      {
+        key = "N";
+        action = "Nzzzv";
+        mode = "n";
+        options.desc = "Find previous and center cursor";
+      }
 
-      { key = "<c-h>"; action = "<cmd>ZellijNavigateLeftTab<cr>"; options.silent = true; options.desc = "navigate left or tab"; }
-      { key = "<c-j>"; action = "<cmd>ZellijNavigateDown<cr>"; options.silent = true; options.desc = "navigate down"; }
-      { key = "<c-k>"; action = "<cmd>ZellijNavigateUp<cr>"; options.silent = true; options.desc = "navigate up"; }
-      { key = "<c-l>"; action = "<cmd>ZellijNavigateRightTab<cr>"; options.silent = true; options.desc = "navigate right or tab"; }
+      {
+        key = "<c-h>";
+        action = "<cmd>ZellijNavigateLeftTab<cr>";
+        options.silent = true;
+        options.desc = "navigate left or tab";
+      }
+      {
+        key = "<c-j>";
+        action = "<cmd>ZellijNavigateDown<cr>";
+        options.silent = true;
+        options.desc = "navigate down";
+      }
+      {
+        key = "<c-k>";
+        action = "<cmd>ZellijNavigateUp<cr>";
+        options.silent = true;
+        options.desc = "navigate up";
+      }
+      {
+        key = "<c-l>";
+        action = "<cmd>ZellijNavigateRightTab<cr>";
+        options.silent = true;
+        options.desc = "navigate right or tab";
+      }
     ];
   };
 }

+ 26 - 5
home/features/nvim/opencode.nix

@@ -9,11 +9,32 @@
     extraPlugins = with pkgs; [ unstable.vimPlugins.opencode-nvim ];
 
     keymaps = [
-      { key = "<leader>ot"; action = "<cmd>lua require('opencode').toggle()<CR>"; }
-      { key = "<leader>oa"; action = "<cmd>lua require('opencode').ask()<CR>"; mode = "n"; }
-      { key = "<leader>oa"; action = "<cmd>lua require('opencode').ask('@selection: ')<CR>"; mode = "v"; }
-      { key = "<leader>oe"; action = "<cmd>lua require('opencode').select_prompt()<CR>"; mode = [ "n" "v" ]; }
-      { key = "<leader>on"; action = "<cmd>lua require('opencode').command('session_new')<CR>"; }
+      {
+        key = "<leader>ot";
+        action = "<cmd>lua require('opencode').toggle()<CR>";
+      }
+      {
+        key = "<leader>oa";
+        action = "<cmd>lua require('opencode').ask()<CR>";
+        mode = "n";
+      }
+      {
+        key = "<leader>oa";
+        action = "<cmd>lua require('opencode').ask('@selection: ')<CR>";
+        mode = "v";
+      }
+      {
+        key = "<leader>oe";
+        action = "<cmd>lua require('opencode').select_prompt()<CR>";
+        mode = [
+          "n"
+          "v"
+        ];
+      }
+      {
+        key = "<leader>on";
+        action = "<cmd>lua require('opencode').command('session_new')<CR>";
+      }
     ];
   };
 }

+ 60 - 10
home/features/nvim/telescope.nix

@@ -13,16 +13,66 @@
     };
 
     keymaps = [
-      { mode = "n"; key = "<leader>sh"; action.__raw = "require('telescope.builtin').help_tags"; options.desc = "[S]earch [H]elp"; }
-      { mode = "n"; key = "<leader>sk"; action.__raw = "require('telescope.builtin').keymaps"; options.desc = "[S]earch [K]eymaps"; }
-      { mode = "n"; key = "<leader>sf"; action.__raw = "require('telescope.builtin').find_files"; options.desc = "[S]earch [F]iles"; }
-      { mode = "n"; key = "<leader>ss"; action.__raw = "require('telescope.builtin').builtin"; options.desc = "[S]earch [S]elect Telescope"; }
-      { mode = "n"; key = "<leader>sw"; action.__raw = "require('telescope.builtin').grep_string"; options.desc = "[S]earch current [W]ord"; }
-      { mode = "n"; key = "<leader>sg"; action.__raw = "require('telescope.builtin').live_grep"; options.desc = "[S]earch by [G]rep"; }
-      { mode = "n"; key = "<leader>s."; action.__raw = "require('telescope.builtin').oldfiles"; options.desc = "[S]earch Recent Files (\".\" for repeat)"; }
-      { mode = "n"; key = "<leader>sd"; action.__raw = "require('telescope.builtin').diagnostics"; options.desc = "[S]earch [D]iagnostics"; }
-      { mode = "n"; key = "<leader>sr"; action.__raw = "require('telescope.builtin').resume"; options.desc = "[S]earch [R]esume"; }
-      { mode = "n"; key = "<leader><leader>"; action.__raw = "require('telescope.builtin').buffers"; options.desc = "[ ] Find existing buffers"; }
+      {
+        mode = "n";
+        key = "<leader>sh";
+        action.__raw = "require('telescope.builtin').help_tags";
+        options.desc = "[S]earch [H]elp";
+      }
+      {
+        mode = "n";
+        key = "<leader>sk";
+        action.__raw = "require('telescope.builtin').keymaps";
+        options.desc = "[S]earch [K]eymaps";
+      }
+      {
+        mode = "n";
+        key = "<leader>sf";
+        action.__raw = "require('telescope.builtin').find_files";
+        options.desc = "[S]earch [F]iles";
+      }
+      {
+        mode = "n";
+        key = "<leader>ss";
+        action.__raw = "require('telescope.builtin').builtin";
+        options.desc = "[S]earch [S]elect Telescope";
+      }
+      {
+        mode = "n";
+        key = "<leader>sw";
+        action.__raw = "require('telescope.builtin').grep_string";
+        options.desc = "[S]earch current [W]ord";
+      }
+      {
+        mode = "n";
+        key = "<leader>sg";
+        action.__raw = "require('telescope.builtin').live_grep";
+        options.desc = "[S]earch by [G]rep";
+      }
+      {
+        mode = "n";
+        key = "<leader>s.";
+        action.__raw = "require('telescope.builtin').oldfiles";
+        options.desc = "[S]earch Recent Files (\".\" for repeat)";
+      }
+      {
+        mode = "n";
+        key = "<leader>sd";
+        action.__raw = "require('telescope.builtin').diagnostics";
+        options.desc = "[S]earch [D]iagnostics";
+      }
+      {
+        mode = "n";
+        key = "<leader>sr";
+        action.__raw = "require('telescope.builtin').resume";
+        options.desc = "[S]earch [R]esume";
+      }
+      {
+        mode = "n";
+        key = "<leader><leader>";
+        action.__raw = "require('telescope.builtin').buffers";
+        options.desc = "[ ] Find existing buffers";
+      }
 
       {
         mode = "n";

+ 4 - 1
home/features/nvim/treesitter.nix

@@ -2,7 +2,10 @@
   programs.nixvim.plugins.treesitter = {
     enable = true;
     settings.ensure_installed = "all";
-    settings.ignore_install = [ "norg" "ipkg" ];
+    settings.ignore_install = [
+      "norg"
+      "ipkg"
+    ];
     settings.highlight.enable = true;
     settings.highlight.disable = [ ];
     settings.incremental_selection.enable = true;

+ 30 - 6
home/features/nvim/which-key.nix

@@ -2,12 +2,36 @@
   programs.nixvim = {
     plugins.which-key.enable = true;
     plugins.which-key.settings.spec = [
-      { __unkeyed-1 = "<leader>c"; group = "[C]ode"; icon = "󰄄 "; }
-      { __unkeyed-1 = "<leader>d"; group = "[D]ocuments"; icon = "󰄄 "; }
-      { __unkeyed-1 = "<leader>r"; group = "[R]ename"; icon = "󰄄 "; }
-      { __unkeyed-1 = "<leader>s"; group = "[S]earch"; icon = "󰄄 "; }
-      { __unkeyed-1 = "<leader>w"; group = "[W]orkspace"; icon = "󰄄 "; }
-      { __unkeyed-1 = "<leader>t"; group = "[T]oggle"; icon = "󰄄 "; }
+      {
+        __unkeyed-1 = "<leader>c";
+        group = "[C]ode";
+        icon = "󰄄 ";
+      }
+      {
+        __unkeyed-1 = "<leader>d";
+        group = "[D]ocuments";
+        icon = "󰄄 ";
+      }
+      {
+        __unkeyed-1 = "<leader>r";
+        group = "[R]ename";
+        icon = "󰄄 ";
+      }
+      {
+        __unkeyed-1 = "<leader>s";
+        group = "[S]earch";
+        icon = "󰄄 ";
+      }
+      {
+        __unkeyed-1 = "<leader>w";
+        group = "[W]orkspace";
+        icon = "󰄄 ";
+      }
+      {
+        __unkeyed-1 = "<leader>t";
+        group = "[T]oggle";
+        icon = "󰄄 ";
+      }
       {
         __unkeyed-1 = "<leader>h";
         group = "Git [H]unk";

+ 5 - 4
home/meili.nix

@@ -1,7 +1,8 @@
-{ config
-, lib
-, pkgs
-, ...
+{
+  config,
+  lib,
+  pkgs,
+  ...
 }:
 let
   configHome = "${config.xdg.configHome}/gnupg";

+ 6 - 4
hosts/common/default.nix

@@ -1,7 +1,9 @@
-{ pkgs
-, outputs
-, ...
-}: {
+{
+  pkgs,
+  outputs,
+  ...
+}:
+{
   imports = [
     outputs.modules.global
 

+ 8 - 6
hosts/common/home-manager.nix

@@ -1,12 +1,14 @@
-{ inputs
-, outputs
-, ...
+{
+  inputs,
+  outputs,
+  ...
 }:
 let
   home-manager-module =
-    if builtins.runCommand "uname" ''{ outFile = "/dev/stdout"; }'' == "Darwin"
-    then inputs.home-manager.darwinModules.home-manager
-    else inputs.home-manager.nixosModules.home-manager;
+    if builtins.runCommand "uname" ''{ outFile = "/dev/stdout"; }'' == "Darwin" then
+      inputs.home-manager.darwinModules.home-manager
+    else
+      inputs.home-manager.nixosModules.home-manager;
 in
 {
   imports = [ home-manager-module ];

+ 16 - 15
hosts/common/nix.nix

@@ -1,9 +1,11 @@
-{ lib
-, pkgs
-, config
-, outputs
-, ...
-}: {
+{
+  lib,
+  pkgs,
+  config,
+  outputs,
+  ...
+}:
+{
   nix = {
     settings = {
       substituters = [
@@ -27,15 +29,14 @@
 
     optimise.automatic = lib.mkDefault true;
 
-    extraOptions =
-      ''
-        warn-dirty = false
-        experimental-features = nix-command flakes impure-derivations
-        auto-optimise-store = true
-      ''
-      + lib.optionalString (pkgs.system == "aarch64-darwin") ''
-        extra-platforms = x86_64-darwin aarch64-darwin x86_64-linux aarch64-linux
-      '';
+    extraOptions = ''
+      warn-dirty = false
+      experimental-features = nix-command flakes impure-derivations
+      auto-optimise-store = true
+    ''
+    + lib.optionalString (pkgs.system == "aarch64-darwin") ''
+      extra-platforms = x86_64-darwin aarch64-darwin x86_64-linux aarch64-linux
+    '';
 
     gc = {
       automatic = true;

+ 7 - 8
hosts/meili/default.nix

@@ -1,13 +1,12 @@
 { outputs, config, ... }:
 {
-  imports =
-    [
-      outputs.modules.global.nix-config
-      ./kanata.nix
-      ./system.nix
-      ./software.nix
-    ]
-    ++ (builtins.attrValues outputs.modules.darwin);
+  imports = [
+    outputs.modules.global.nix-config
+    ./kanata.nix
+    ./system.nix
+    ./software.nix
+  ]
+  ++ (builtins.attrValues outputs.modules.darwin);
 
   # NOTE: might be valuable to put this in it's own file
   # nix.linux-builder = {

+ 2 - 1
hosts/meili/software.nix

@@ -1,4 +1,5 @@
-{ pkgs, ... }: {
+{ pkgs, ... }:
+{
   # TODO:
   #   - Proton Mail Bridge
   #   - Proton Drive set up home folders

+ 1 - 1
hosts/meili/system.nix

@@ -24,7 +24,7 @@
       # hotkeys, but I don't know if that's possible with nix-darwin
       # Preferences -> Keyboard -> Keyboard Shortcuts -> Input Sources
       # "com.apple.symbolichotkeys" = {
-      #   "60" = 0; 
+      #   "60" = 0;
       #   "61" = 0;
       # };
 

+ 2 - 1
hosts/modgud/default.nix

@@ -1,4 +1,5 @@
-{ outputs, ... }: {
+{ outputs, ... }:
+{
   imports = [
     ./hardware.nix
 

+ 6 - 4
hosts/modgud/disk.nix

@@ -1,7 +1,9 @@
-{ lib
-, inputs
-, ...
-}: {
+{
+  lib,
+  inputs,
+  ...
+}:
+{
   imports = [
     inputs.disko.nixosModules.disko
   ];

+ 6 - 4
hosts/modgud/hardware.nix

@@ -1,7 +1,9 @@
-{ lib
-, modulesPath
-, ...
-}: {
+{
+  lib,
+  modulesPath,
+  ...
+}:
+{
   imports = [
     (modulesPath + "/installer/scan/not-detected.nix")
     (modulesPath + "/profiles/qemu-guest.nix")

+ 6 - 6
hosts/odin/default.nix

@@ -1,8 +1,9 @@
-{ config
-, lib
-, pkgs
-, outputs
-, ...
+{
+  config,
+  lib,
+  pkgs,
+  outputs,
+  ...
 }:
 {
   imports = [
@@ -51,7 +52,6 @@
       };
     };
 
-
     # Drive spin-down management
     # hdparm.devices = [
     #   {

+ 1 - 2
hosts/odin/services/cloudflared.nix

@@ -1,6 +1,5 @@
 { config, ... }:
 {
   services.cloudflared.enable = true;
-  services.cloudflared.certificateFile =
-    config.age.secrets."odin/services/cloudflared".path;
+  services.cloudflared.certificateFile = config.age.secrets."odin/services/cloudflared".path;
 }

+ 3 - 6
hosts/odin/services/immich.nix

@@ -34,11 +34,9 @@ in
   };
 
   services.cloudflared.tunnels."71c89a7f-2467-444c-9fda-4864860dc8c4" = {
-    credentialsFile =
-      config.age.secrets."odin/services/cloudflared-tunnel".path;
+    credentialsFile = config.age.secrets."odin/services/cloudflared-tunnel".path;
     default = "http_status:404";
-    ingress."${domain}".service =
-      "http://${cfg.host}:${toString cfg.port}";
+    ingress."${domain}".service = "http://${cfg.host}:${toString cfg.port}";
   };
 
   services.caddy.virtualHosts.immich = {
@@ -50,8 +48,7 @@ in
   };
 
   systemd.tmpfiles = {
-    settings.immich."${cfg.mediaLocation}".e.mode =
-      lib.mkForce "0750";
+    settings.immich."${cfg.mediaLocation}".e.mode = lib.mkForce "0750";
 
     rules = [
       "d  /var/cache/immich 0750 immich storage - -"

+ 1 - 2
hosts/odin/services/ntfy.nix

@@ -7,8 +7,7 @@
     allowed_uuids = [ "fa14700c-a870-4f6d-8cfc-3be1466903c6" ];
   };
   services.mollysocket.logLevel = "debug";
-  services.mollysocket.environmentFile =
-    config.age.secrets."odin/services/mollysocket".path;
+  services.mollysocket.environmentFile = config.age.secrets."odin/services/mollysocket".path;
 
   services.caddy.virtualHosts.mollysocket = {
     hostName = "mollysocket.odin.t5.st";

+ 31 - 26
hosts/odin/services/samba.nix

@@ -1,10 +1,14 @@
-{ config
-, lib
-, pkgs
-, ...
+{
+  config,
+  lib,
+  pkgs,
+  ...
 }:
 let
-  shares = [ "thomas" "christine" ];
+  shares = [
+    "thomas"
+    "christine"
+  ];
 in
 {
   services.samba = {
@@ -27,31 +31,32 @@ in
         "preferred master" = "no";
       };
 
-    } // builtins.listToAttrs
-      (map
-        (name: {
-          inherit name;
-          value = {
-            path = "/mnt/storage/samba/${name}";
-            "preserve case" = "yes";
-            "short preserve case" = "yes";
-            "browseable" = "yes";
-            "writeable" = "yes";
-            "read only" = "no";
-            "guest ok" = "no";
-            "create mask" = "0644";
-            "directory mask" = "0750";
-            "valid users" = "${name}";
-            "fruit:aapl" = "yes";
-            "vfs objects" = "catia fruit streams_xattr";
-          };
-        })
-        shares);
+    }
+    // builtins.listToAttrs (
+      map (name: {
+        inherit name;
+        value = {
+          path = "/mnt/storage/samba/${name}";
+          "preserve case" = "yes";
+          "short preserve case" = "yes";
+          "browseable" = "yes";
+          "writeable" = "yes";
+          "read only" = "no";
+          "guest ok" = "no";
+          "create mask" = "0644";
+          "directory mask" = "0750";
+          "valid users" = "${name}";
+          "fruit:aapl" = "yes";
+          "vfs objects" = "catia fruit streams_xattr";
+        };
+      }) shares
+    );
   };
 
   systemd.tmpfiles.rules = [
     "d /mnt/storage/samba 0750 root storage -"
-  ] ++ map (name: "d /mnt/storage/samba/${name} 0750 ${name} storage -") shares;
+  ]
+  ++ map (name: "d /mnt/storage/samba/${name} 0750 ${name} storage -") shares;
 
   system.activationScripts.addSambaUsers = {
     text = ''

+ 1 - 2
hosts/odin/services/vaultwarden.nix

@@ -9,8 +9,7 @@ in
     ROCKET_ADDRESS = "127.0.0.1";
     ROCKET_PORT = 8222;
   };
-  services.vaultwarden.environmentFile =
-    config.age.secrets."odin/services/vaultwarden".path;
+  services.vaultwarden.environmentFile = config.age.secrets."odin/services/vaultwarden".path;
 
   users.users.vaultwarden.extraGroups = [ "storage" ];
   systemd.tmpfiles.rules = [

+ 7 - 14
hosts/odin/system/age.nix

@@ -9,23 +9,16 @@
       owner = config.services.caddy.user;
       group = config.services.caddy.group;
     };
-    "odin/services/cloudflared".file =
-      inputs.secrets."odin/services/cloudflared.age";
-    "odin/services/cloudflared-tunnel".file =
-      inputs.secrets."odin/services/cloudflared-tunnel.age";
-    "odin/services/mollysocket".file =
-      inputs.secrets."odin/services/mollysocket.age";
+    "odin/services/cloudflared".file = inputs.secrets."odin/services/cloudflared.age";
+    "odin/services/cloudflared-tunnel".file = inputs.secrets."odin/services/cloudflared-tunnel.age";
+    "odin/services/mollysocket".file = inputs.secrets."odin/services/mollysocket.age";
     "odin/services/nullmailer" = {
       file = inputs.secrets."odin/services/nullmailer.age";
       owner = config.services.nullmailer.user;
     };
-    "odin/services/samba".file =
-      inputs.secrets."odin/services/samba.age";
-    "odin/services/tailscale".file =
-      inputs.secrets."odin/services/tailscale.age";
-    "odin/services/vaultwarden".file =
-      inputs.secrets."odin/services/vaultwarden.age";
-    "odin/users/thomas".file =
-      inputs.secrets."odin/users/thomas.age";
+    "odin/services/samba".file = inputs.secrets."odin/services/samba.age";
+    "odin/services/tailscale".file = inputs.secrets."odin/services/tailscale.age";
+    "odin/services/vaultwarden".file = inputs.secrets."odin/services/vaultwarden.age";
+    "odin/users/thomas".file = inputs.secrets."odin/users/thomas.age";
   };
 }

+ 13 - 6
hosts/odin/system/default.nix

@@ -1,7 +1,8 @@
-{ config
-, inputs
-, pkgs
-, ...
+{
+  config,
+  inputs,
+  pkgs,
+  ...
 }:
 {
   imports = [
@@ -27,8 +28,14 @@
 
     blacklistedKernelModules = [ "k10temp" ];
     extraModulePackages = [ config.boot.kernelPackages.zenpower ];
-    kernelParams = [ "rootflags=compress=zstd:1,noatime" "amd_pstate=active" ];
-    kernelModules = [ "zenpower" "nct6775" ];
+    kernelParams = [
+      "rootflags=compress=zstd:1,noatime"
+      "amd_pstate=active"
+    ];
+    kernelModules = [
+      "zenpower"
+      "nct6775"
+    ];
 
     kernel.sysctl = {
       "kernel.sysrq" = 1;

+ 40 - 22
hosts/odin/system/disko.nix

@@ -42,27 +42,43 @@ in
                 subvolumes = {
                   "@root" = {
                     mountpoint = "/";
-                    mountOptions = [ "compress=zstd1" "noatime" ];
+                    mountOptions = [
+                      "compress=zstd1"
+                      "noatime"
+                    ];
                   };
 
                   "@nix" = {
                     mountpoint = "/nix";
-                    mountOptions = [ "compress=zstd1" "noatime" ];
+                    mountOptions = [
+                      "compress=zstd1"
+                      "noatime"
+                    ];
                   };
 
                   "@persist" = {
                     mountpoint = "/persist";
-                    mountOptions = [ "compress=zstd1" "noatime" ];
+                    mountOptions = [
+                      "compress=zstd1"
+                      "noatime"
+                    ];
                   };
 
                   "@services" = {
                     mountpoint = "/var/lib";
-                    mountOptions = [ "compress=zstd1" "noatime" "space_cache=v2" ];
+                    mountOptions = [
+                      "compress=zstd1"
+                      "noatime"
+                      "space_cache=v2"
+                    ];
                   };
 
                   "@logs" = {
                     mountpoint = "/var/log";
-                    mountOptions = [ "compress=zstd1" "noatime" ];
+                    mountOptions = [
+                      "compress=zstd1"
+                      "noatime"
+                    ];
                   };
                 };
               };
@@ -71,25 +87,27 @@ in
         };
       };
 
-    } // lib.attrsets.mapAttrs
-      (name: value: {
-        type = "disk";
-        device = "/dev/disk/by-id/${value}";
-        content = {
-          type = "gpt";
-          partitions = {
-            primary = {
-              size = "100%";
-              content = {
-                type = "filesystem";
-                format = "xfs";
-                mountpoint = "/mnt/${name}";
-                mountOptions = [ "defaults" "noatime" ];
-              };
+    }
+    // lib.attrsets.mapAttrs (name: value: {
+      type = "disk";
+      device = "/dev/disk/by-id/${value}";
+      content = {
+        type = "gpt";
+        partitions = {
+          primary = {
+            size = "100%";
+            content = {
+              type = "filesystem";
+              format = "xfs";
+              mountpoint = "/mnt/${name}";
+              mountOptions = [
+                "defaults"
+                "noatime"
+              ];
             };
           };
         };
-      })
-      disks;
+      };
+    }) disks;
   };
 }

+ 6 - 1
hosts/odin/system/impermanence.nix

@@ -1,4 +1,9 @@
-{ config, inputs, lib, ... }:
+{
+  config,
+  inputs,
+  lib,
+  ...
+}:
 {
   imports = [
     inputs.impermanence.nixosModules.impermanence

+ 4 - 3
hosts/odin/system/mergerfs.nix

@@ -1,6 +1,7 @@
-{ config
-, pkgs
-, ...
+{
+  config,
+  pkgs,
+  ...
 }:
 {
   environment.systemPackages = with pkgs; [

+ 5 - 1
hosts/odin/users/thomas.nix

@@ -2,7 +2,11 @@
 {
   users.users.thomas = {
     isNormalUser = true;
-    extraGroups = [ "wheel" "users" "storage" ];
+    extraGroups = [
+      "wheel"
+      "users"
+      "storage"
+    ];
     shell = config.programs.fish.package;
     hashedPasswordFile = config.age.secrets."odin/users/thomas".path;
     openssh.authorizedKeys.keys = [

+ 45 - 43
lib/default.nix

@@ -1,26 +1,25 @@
-{ inputs
-, outputs
-,
+{
+  inputs,
+  outputs,
 }:
 
 let
-  inherit (inputs) darwin devenv home-manager nixpkgs;
+  inherit (inputs)
+    darwin
+    home-manager
+    nixpkgs
+    nixpkgs-darwin
+    ;
   inherit (nixpkgs) lib;
-  # Helper to determine if a system is Darwin
-  isDarwin = system: builtins.elem "darwin" (builtins.split "-" system);
 
-  # Helper to get the appropriate nixpkgs for a system
-  getPkgsForSystem = system:
-    if isDarwin system
-    then inputs.nixpkgs-darwin.legacyPackages.${system}
-    else inputs.nixpkgs.legacyPackages.${system};
+  isDarwin = system: builtins.elem "darwin" (builtins.split "-" system);
 in
 
 rec {
   mkSystem =
-    { system
-    , modules ? [ ]
-    ,
+    {
+      system,
+      modules ? [ ],
     }:
     lib.nixosSystem {
       inherit system modules;
@@ -28,9 +27,9 @@ rec {
     };
 
   mkDarwin =
-    { system
-    , modules ? [ ]
-    ,
+    {
+      system,
+      modules ? [ ],
     }:
     darwin.lib.darwinSystem {
       inherit system modules;
@@ -38,33 +37,19 @@ rec {
     };
 
   mkHome =
-    { system
-    , modules ? [ ]
-    ,
+    {
+      system,
+      modules ? [ ],
     }:
     home-manager.lib.homeManagerConfiguration {
       inherit modules;
-      pkgs = getPkgsForSystem system;
+      pkgs = pkgsFor.${system};
       extraSpecialArgs = {
         inherit inputs outputs;
         isDarwin = isDarwin system;
       };
     };
 
-  mkDevenvShell = config:
-    eachSystemWithPkgs (
-      { pkgs }:
-      lib.mapAttrs
-        (
-          _name: module:
-            devenv.lib.mkShell {
-              inherit inputs pkgs;
-              modules = [ module ];
-            }
-        )
-        config
-    );
-
   allSystems = [
     "x86_64-linux"
     "x86_64-darwin"
@@ -72,17 +57,34 @@ rec {
     "aarch64-darwin"
   ];
 
-  eachSystem = lib.genAttrs allSystems;
+  eachSystem = f: lib.genAttrs allSystems (system: f pkgsFor.${system});
 
-  eachSystemWithPkgs = f:
-    eachSystem (
-      system:
-      f {
-        pkgs = getPkgsForSystem system;
+  pkgsFor = lib.genAttrs allSystems (
+    system:
+    if isDarwin system then
+      import nixpkgs {
+        inherit system;
+        config.allowUnfree = true;
+        overlays = [
+          outputs.overlays.additions
+          outputs.overlays.modifications
+          outputs.overlays.unstable-packages
+        ];
+      }
+    else
+      import nixpkgs-darwin {
+        inherit system;
+        config.allowUnfree = true;
+        overlays = [
+          outputs.overlays.additions
+          outputs.overlays.modifications
+          outputs.overlays.unstable-packages
+        ];
       }
-    );
+  );
 
-  print = text:
+  print =
+    text:
     let
       json = builtins.toJSON text;
     in

+ 13 - 7
modules/darwin/kanata.nix

@@ -1,7 +1,8 @@
-{ config
-, lib
-, pkgs
-, ...
+{
+  config,
+  lib,
+  pkgs,
+  ...
 }:
 let
   cfg = config.services.kanata;
@@ -10,8 +11,9 @@ let
     sha256 = "sha256-S14c06v/L/PraLekzIroG6FQnV5dpx0cyJNb9ylB458=";
   };
 
-  configFile = lib.mkIf (cfg.config != "")
-    "${pkgs.writeScript "kanata.kbd" ("\n" + cfg.config + "\n")}";
+  configFile =
+    lib.mkIf (cfg.config != "")
+      "${pkgs.writeScript "kanata.kbd" ("\n" + cfg.config + "\n")}";
 in
 {
   options.services.kanata = {
@@ -118,7 +120,11 @@ in
         "--port"
         "10000"
         # "--debug"
-      ] ++ lib.optionals (cfg.config != "") [ "-c" configFile ];
+      ]
+      ++ lib.optionals (cfg.config != "") [
+        "-c"
+        configFile
+      ];
 
       RunAtLoad = true;
       KeepAlive = true;

+ 6 - 4
modules/darwin/networking/remote-login.nix

@@ -1,8 +1,10 @@
-{ config
-, lib
-, ...
+{
+  config,
+  lib,
+  ...
 }:
-with lib; let
+with lib;
+let
   cfg = config.networking;
 
   remoteLogin = optionalString (cfg.remote-login) ''

+ 42 - 40
modules/darwin/security/pam-reattach.nix

@@ -1,12 +1,15 @@
-{ config
-, lib
-, pkgs
-, ...
+{
+  config,
+  lib,
+  pkgs,
+  ...
 }:
-with lib; let
+with lib;
+let
   cfg = config.security.pam;
 
-  mkPamReattachScript = isEnabled:
+  mkPamReattachScript =
+    isEnabled:
     let
       file = "/etc/pam.d/sudo";
       option = "security.pam.reattach";
@@ -14,49 +17,48 @@ with lib; let
     in
     ''
       ${
-        if isEnabled
-        then ''
-          # If enable and in file, remove and re-add in case the store path has
-          # changed
-          if grep '${option}' ${file} > /dev/null; then
-            ${sed} -i '/${option}/d' ${file}
-          fi
+        if isEnabled then
+          ''
+            # If enable and in file, remove and re-add in case the store path has
+            # changed
+            if grep '${option}' ${file} > /dev/null; then
+              ${sed} -i '/${option}/d' ${file}
+            fi
 
-          ${sed} -i '2i\
-          auth       optional       ${pkgs.pam-reattach}/lib/pam/pam_reattach.so ignore_ssh # nix-darwin: ${option}
-          ' ${file}
-        ''
-        else ''
-          # Disable pam_reattach, if added by nix-darwin
-          if grep '${option}' ${file} > /dev/null; then
-            ${sed} -i '/${option}/d' ${file}
-          fi
-        ''
+            ${sed} -i '2i\
+            auth       optional       ${pkgs.pam-reattach}/lib/pam/pam_reattach.so ignore_ssh # nix-darwin: ${option}
+            ' ${file}
+          ''
+        else
+          ''
+            # Disable pam_reattach, if added by nix-darwin
+            if grep '${option}' ${file} > /dev/null; then
+              ${sed} -i '/${option}/d' ${file}
+            fi
+          ''
       }
     '';
 in
 {
   options = {
-    security.pam.enablePamReattach =
-      mkEnableOption ""
-      // {
-        description = lib.mdDoc ''
-          Enable pam_reattach sudo authentication with Touch ID in tmux/screen.
+    security.pam.enablePamReattach = mkEnableOption "" // {
+      description = lib.mdDoc ''
+        Enable pam_reattach sudo authentication with Touch ID in tmux/screen.
 
-          When enabled, this option adds the following line to
-          {file}`/etc/pam.d/sudo`:
+        When enabled, this option adds the following line to
+        {file}`/etc/pam.d/sudo`:
 
-          ```
-          auth       optional     pam_reattach.so ignore_ssh
-          ```
+        ```
+        auth       optional     pam_reattach.so ignore_ssh
+        ```
 
-          ::: {.note}
-          macOS resets this file when doing a system update. As such,
-          pam_reattach won't work after a system update
-          until the nix-darwin configuration is reapplied.
-          :::
-        '';
-      };
+        ::: {.note}
+        macOS resets this file when doing a system update. As such,
+        pam_reattach won't work after a system update
+        until the nix-darwin configuration is reapplied.
+        :::
+      '';
+    };
   };
 
   config = {

+ 6 - 4
modules/darwin/system/rosetta.nix

@@ -1,8 +1,10 @@
-{ config
-, lib
-, ...
+{
+  config,
+  lib,
+  ...
 }:
-with lib; let
+with lib;
+let
   cfg = config.system.rosetta;
 in
 {

+ 16 - 15
modules/global/nix-config.nix

@@ -1,9 +1,11 @@
-{ lib
-, pkgs
-, config
-, outputs
-, ...
-}: {
+{
+  lib,
+  pkgs,
+  config,
+  outputs,
+  ...
+}:
+{
   nix = {
     package = pkgs.nix;
 
@@ -31,15 +33,14 @@
       ];
     };
 
-    extraOptions =
-      ''
-        warn-dirty = false
-        experimental-features = nix-command flakes impure-derivations
-        auto-optimise-store = true
-      ''
-      + lib.optionalString (pkgs.system == "aarch64-darwin") ''
-        extra-platforms = x86_64-darwin aarch64-darwin x86_64-linux aarch64-linux
-      '';
+    extraOptions = ''
+      warn-dirty = false
+      experimental-features = nix-command flakes impure-derivations
+      auto-optimise-store = true
+    ''
+    + lib.optionalString (pkgs.system == "aarch64-darwin") ''
+      extra-platforms = x86_64-darwin aarch64-darwin x86_64-linux aarch64-linux
+    '';
 
     gc = {
       automatic = true;

+ 8 - 11
overlays/default.nix

@@ -1,4 +1,5 @@
-{ inputs, ... }: rec {
+{ inputs, ... }:
+rec {
   # This one brings our custom packages from the 'pkgs' directory
   additions = final: _prev: import ../packages { pkgs = final; };
 
@@ -16,17 +17,13 @@
       old: inputs.nixpkgs.lib.recursiveUpdate old { meta.broken = false; }
     );
 
-    tmuxPlugins =
-      prev.tmuxPlugins
-      // {
-        tmux-select-pane-no-wrap = prev.tmux-select-pane-no-wrap;
-      };
+    tmuxPlugins = prev.tmuxPlugins // {
+      tmux-select-pane-no-wrap = prev.tmux-select-pane-no-wrap;
+    };
 
-    vimPlugins =
-      prev.vimPlugins
-      // {
-        opencode-nvim = prev.opencode-nvim;
-      };
+    vimPlugins = prev.vimPlugins // {
+      opencode-nvim = prev.opencode-nvim;
+    };
   };
 
   # When applied, the unstable nixpkgs set (declared in the flake inputs) will

+ 6 - 1
packages/aerospace-tmux-focus.nix

@@ -1,4 +1,9 @@
-{ writeShellScriptBin, lib, tmux, aerospace }:
+{
+  writeShellScriptBin,
+  lib,
+  tmux,
+  aerospace,
+}:
 
 let
   aerospaceBin = "${lib.getExe aerospace}";

+ 14 - 2
packages/default.nix

@@ -1,9 +1,21 @@
-{ pkgs ? (import <nixpkgs>) { } }: {
+{
+  pkgs ? # If pkgs is not defined, instanciate nixpkgs from locked commit
+    let
+      lock = (builtins.fromJSON (builtins.readFile ../flake.lock)).nodes.nixpkgs.locked;
+      nixpkgs = fetchTarball {
+        url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
+        sha256 = lock.narHash;
+      };
+    in
+    import nixpkgs { overlays = [ ]; },
+  ...
+}:
+{
   aerospace-tmux-focus = pkgs.callPackage ./aerospace-tmux-focus.nix { };
+  default = pkgs.callPackage ./quick-setup.nix { };
   go-avahi-cname = pkgs.callPackage ./go-avahi-cname.nix { };
   hello = pkgs.callPackage ./hello.nix { };
   nct6775-pwm-udev-package = pkgs.callPackage ./nct6775-pwm-udev-package.nix { };
   opencode-nvim = pkgs.callPackage ./opencode-nvim.nix { };
   photo-cli = pkgs.callPackage ./photo-cli.nix { };
-  quick-setup = pkgs.callPackage ./quick-setup.nix { };
 }

+ 20 - 19
packages/go-avahi-cname.nix

@@ -1,25 +1,26 @@
-{ buildGoModule
-, fetchFromGitHub
-, go_1_25
-, ...
+{
+  buildGoModule,
+  fetchFromGitHub,
+  go_1_25,
+  ...
 }:
 
 buildGoModule.override
-{
-  go = go_1_25;
-}
-rec {
-  pname = "go-avahi-cname";
-  version = "2.2.6";
+  {
+    go = go_1_25;
+  }
+  rec {
+    pname = "go-avahi-cname";
+    version = "2.2.6";
 
-  src = fetchFromGitHub {
-    owner = "grishy";
-    repo = "go-avahi-cname";
-    rev = "v${version}";
-    hash = "sha256-MLCG2QkJZXtgopdG6IT7y/mpyXSiSJvThGD534KVpx4=";
-  };
+    src = fetchFromGitHub {
+      owner = "grishy";
+      repo = "go-avahi-cname";
+      rev = "v${version}";
+      hash = "sha256-MLCG2QkJZXtgopdG6IT7y/mpyXSiSJvThGD534KVpx4=";
+    };
 
-  vendorHash = "sha256-Y87nIzOSe8UEp07RbVhVDolwjfmjXVCV0qGqvURSuRw=";
+    vendorHash = "sha256-Y87nIzOSe8UEp07RbVhVDolwjfmjXVCV0qGqvURSuRw=";
 
-  meta.mainProgram = "go-avahi-cname";
-}
+    meta.mainProgram = "go-avahi-cname";
+  }

+ 3 - 2
packages/opencode-nvim.nix

@@ -1,5 +1,6 @@
-{ fetchFromGitHub
-, vimUtils
+{
+  fetchFromGitHub,
+  vimUtils,
 }:
 
 vimUtils.buildVimPlugin {

+ 4 - 3
packages/photo-cli.nix

@@ -1,6 +1,7 @@
-{ buildDotnetGlobalTool
-, lib
-, ...
+{
+  buildDotnetGlobalTool,
+  lib,
+  ...
 }:
 buildDotnetGlobalTool {
   pname = "photo-cli";

+ 8 - 5
packages/quick-setup.nix

@@ -1,12 +1,14 @@
-{ coreutils
-, git
-, lib
-, nix
-, writeShellScriptBin
+{
+  coreutils,
+  git,
+  lib,
+  nix,
+  writeShellScriptBin,
 }:
 
 let
   mkdirBin = lib.getExe' coreutils "mkdir";
+  rmBin = lib.getExe' coreutils "rm";
   gitBin = lib.getExe git;
   nixBin = lib.getExe nix;
 in
@@ -17,6 +19,7 @@ writeShellScriptBin "quick-setup" ''
   cd ~/workspace/control
   ${gitBin} clone [email protected]:control/home
   cd home
+  ${rmBin} -r ~/.config/fish/
   ${nixBin} run github:nix-community/home-manager -- \
     switch --flake .#$(whoami)@$(hostname)
 ''

+ 27 - 0
shell.nix

@@ -0,0 +1,27 @@
+{
+  pkgs ?
+    let
+      lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
+      nixpkgs = fetchTarball {
+        url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
+        sha256 = lock.narHash;
+      };
+    in
+    import nixpkgs { overlays = [ ]; },
+  ...
+}:
+{
+  default = pkgs.mkShell {
+    NIX_CONFIG = "extra-experimental-features = nix-command flakes";
+    nativeBuildInputs = with pkgs; [
+      nix
+      nixfmt-tree
+      home-manager
+      git
+
+      ragenix
+      gnupg
+      age
+    ];
+  };
+}

Някои файлове не бяха показани, защото твърде много файлове са промени