Fix deploy-rs
This commit is contained in:
parent
b23046ea5d
commit
a4fb022930
1 changed files with 48 additions and 46 deletions
94
helpers.nix
94
helpers.nix
|
@ -53,60 +53,62 @@ with inputs.nixpkgs.lib; {
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
nixosConfigurations.${hostname} = nixosSystem {
|
{
|
||||||
inherit system pkgs;
|
nixosConfigurations.${hostname} = nixosSystem {
|
||||||
|
inherit system pkgs;
|
||||||
|
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
# Pass variables to config.
|
# Pass variables to config.
|
||||||
inherit inputs secrets hostname;
|
inherit inputs secrets hostname;
|
||||||
};
|
};
|
||||||
|
|
||||||
modules =
|
modules =
|
||||||
[
|
[
|
||||||
nixvim.nixosModules.nixvim # Neovim.
|
nixvim.nixosModules.nixvim # Neovim.
|
||||||
lanzaboote.nixosModules.lanzaboote # Secure boot.
|
lanzaboote.nixosModules.lanzaboote # Secure boot.
|
||||||
sops-nix.nixosModules.sops # Secrets management.
|
sops-nix.nixosModules.sops # Secrets management.
|
||||||
|
|
||||||
./suites/${suite} # Collection of configuration options for different types of systems.
|
./suites/${suite} # Collection of configuration options for different types of systems.
|
||||||
./hosts/${hostname} # Host-specific config.
|
./hosts/${hostname} # Host-specific config.
|
||||||
|
|
||||||
# Home manager.
|
# Home manager.
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
backupFileExtension = "backup";
|
backupFileExtension = "backup";
|
||||||
users.fern = {
|
users.fern = {
|
||||||
# Me!
|
# Me!
|
||||||
home.username = "fern";
|
home.username = "fern";
|
||||||
home.homeDirectory = "/home/fern";
|
home.homeDirectory = "/home/fern";
|
||||||
|
|
||||||
# Home manager version.
|
# Home manager version.
|
||||||
home.stateVersion = "25.05";
|
home.stateVersion = "25.05";
|
||||||
|
|
||||||
# Let Home Manager install and manage itself.
|
# Let Home Manager install and manage itself.
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
# Import config.
|
# Import config.
|
||||||
imports = [./suites/${suite}/home.nix];
|
imports = [./suites/${suite}/home.nix];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
}
|
]
|
||||||
]
|
++ hostModules # Host-specific modules.
|
||||||
++ hostModules # Host-specific modules.
|
++ optionals (docker == true) [./suites/server/docker] # Enable docker if required.
|
||||||
++ optionals (docker == true) [./suites/server/docker] # Enable docker if required.
|
++ (filesystem.listFilesRecursive ./modules); # Custom modules.
|
||||||
++ (filesystem.listFilesRecursive ./modules); # Custom modules.
|
};
|
||||||
};
|
}
|
||||||
|
// optionalAttrs (strings.hasPrefix "server" suite) {
|
||||||
deploy.nodes.${hostname} = mkIf (strings.hasPrefix "server" suite) {
|
deploy.nodes.${hostname} = {
|
||||||
hostname = "${hostname}.local";
|
hostname = "${hostname}.local";
|
||||||
profiles.system = {
|
profiles.system = {
|
||||||
user = "root";
|
user = "root";
|
||||||
sshuser = "fern";
|
sshuser = "fern";
|
||||||
path = deployPkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.${hostname};
|
path = deployPkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.${hostname};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue