deploy-rs + nixos-anywhere
This commit is contained in:
parent
469f4dcd43
commit
d28ec06ae9
8 changed files with 182 additions and 24 deletions
27
flake.nix
27
flake.nix
|
|
@ -12,6 +12,12 @@
|
|||
|
||||
declarative-jellyfin.url = "github:Sveske-Juice/declarative-jellyfin";
|
||||
declarative-jellyfin.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
deploy-rs.url = "github:serokell/deploy-rs";
|
||||
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
disko.url = "github:nix-community/disko";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
outputs = { self, nixpkgs, unstable, ... }@inputs: let
|
||||
base = [
|
||||
|
|
@ -34,6 +40,8 @@
|
|||
# use comma just in case I need to do some sysadmin stuff
|
||||
inputs.nid.nixosModules.nix-index
|
||||
{ programs.nix-index-database.comma.enable = true; }
|
||||
# disko for completly declarative machines
|
||||
inputs.disko.nixosModules.disko
|
||||
];
|
||||
|
||||
# ts so DRY it makes me wanna cry
|
||||
|
|
@ -47,11 +55,30 @@
|
|||
] ++ modules;
|
||||
}
|
||||
)) <| hosts;
|
||||
|
||||
mkNodes = nodes:
|
||||
(builtins.mapAttrs (name: options:
|
||||
nixpkgs.lib.attrsets.recursiveUpdate {
|
||||
hostname = name;
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
sshUser = "crown";
|
||||
path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.${name};
|
||||
};
|
||||
} options
|
||||
)) <| nodes;
|
||||
in {
|
||||
# define all of my machines
|
||||
nixosConfigurations = mkHosts {
|
||||
blobercraft = [];
|
||||
crayon = [];
|
||||
};
|
||||
|
||||
# and where they get deployed to
|
||||
deploy.nodes = mkNodes {
|
||||
crayon = { hostname = "squi.bid"; };
|
||||
};
|
||||
|
||||
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue