From a4fb022930e50fe93c631373323c1f1e50111a36 Mon Sep 17 00:00:00 2001 From: Fern Garden Date: Fri, 29 Aug 2025 11:54:27 +0800 Subject: [PATCH] Fix deploy-rs --- helpers.nix | 94 +++++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/helpers.nix b/helpers.nix index 747dd8c..65206b9 100644 --- a/helpers.nix +++ b/helpers.nix @@ -53,60 +53,62 @@ with inputs.nixpkgs.lib; { }) ]; }; - in { - nixosConfigurations.${hostname} = nixosSystem { - inherit system pkgs; + in + { + nixosConfigurations.${hostname} = nixosSystem { + inherit system pkgs; - specialArgs = { - # Pass variables to config. - inherit inputs secrets hostname; - }; + specialArgs = { + # Pass variables to config. + inherit inputs secrets hostname; + }; - modules = - [ - nixvim.nixosModules.nixvim # Neovim. - lanzaboote.nixosModules.lanzaboote # Secure boot. - sops-nix.nixosModules.sops # Secrets management. + modules = + [ + nixvim.nixosModules.nixvim # Neovim. + lanzaboote.nixosModules.lanzaboote # Secure boot. + sops-nix.nixosModules.sops # Secrets management. - ./suites/${suite} # Collection of configuration options for different types of systems. - ./hosts/${hostname} # Host-specific config. + ./suites/${suite} # Collection of configuration options for different types of systems. + ./hosts/${hostname} # Host-specific config. - # Home manager. - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - backupFileExtension = "backup"; - users.fern = { - # Me! - home.username = "fern"; - home.homeDirectory = "/home/fern"; + # Home manager. + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "backup"; + users.fern = { + # Me! + home.username = "fern"; + home.homeDirectory = "/home/fern"; - # Home manager version. - home.stateVersion = "25.05"; + # Home manager version. + home.stateVersion = "25.05"; - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; - # Import config. - imports = [./suites/${suite}/home.nix]; + # Import config. + imports = [./suites/${suite}/home.nix]; + }; }; - }; - } - ] - ++ hostModules # Host-specific modules. - ++ optionals (docker == true) [./suites/server/docker] # Enable docker if required. - ++ (filesystem.listFilesRecursive ./modules); # Custom modules. - }; - - deploy.nodes.${hostname} = mkIf (strings.hasPrefix "server" suite) { - hostname = "${hostname}.local"; - profiles.system = { - user = "root"; - sshuser = "fern"; - path = deployPkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.${hostname}; + } + ] + ++ hostModules # Host-specific modules. + ++ optionals (docker == true) [./suites/server/docker] # Enable docker if required. + ++ (filesystem.listFilesRecursive ./modules); # Custom modules. + }; + } + // optionalAttrs (strings.hasPrefix "server" suite) { + deploy.nodes.${hostname} = { + hostname = "${hostname}.local"; + profiles.system = { + user = "root"; + sshuser = "fern"; + path = deployPkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.${hostname}; + }; }; }; - }; }