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 {
|
||||
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};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue