flake.nix: use flake-parts
All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m28s
All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m28s
This commit is contained in:
60
nix/hosts.nix
Normal file
60
nix/hosts.nix
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
flake =
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
domain = "mesh.vimium.net";
|
||||
mkDeployNode = hostName: {
|
||||
hostname = "${hostName}.${domain}";
|
||||
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
path =
|
||||
inputs.deploy-rs.lib.${
|
||||
config.nixosConfigurations.${hostName}.config.system.build.toplevel.system
|
||||
}.activate.nixos
|
||||
config.nixosConfigurations.${hostName};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
nixosConfigurations = lib.pipe ../hosts [
|
||||
builtins.readDir
|
||||
(lib.filterAttrs (name: value: value == "directory"))
|
||||
(lib.mapAttrs (
|
||||
name: value:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs; };
|
||||
|
||||
modules = [
|
||||
{
|
||||
networking = {
|
||||
inherit domain;
|
||||
hostName = name;
|
||||
};
|
||||
}
|
||||
../hosts/${name}
|
||||
];
|
||||
}
|
||||
))
|
||||
];
|
||||
|
||||
deploy = {
|
||||
magicRollback = true;
|
||||
autoRollback = true;
|
||||
sshUser = "root";
|
||||
nodes = lib.genAttrs [
|
||||
"artemis"
|
||||
"mail"
|
||||
"pi"
|
||||
"skycam"
|
||||
"vps1"
|
||||
"vps2"
|
||||
] mkDeployNode;
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user