Imports all modules with colmena. Cleaner node declaration

This commit is contained in:
pazpi 2024-08-27 09:47:20 +02:00
parent eb9f742b1e
commit f8eb1bb696

View file

@ -20,30 +20,39 @@
}; };
}; };
outputs = { self, nixpkgs, agenix, home-manager, ... }@flakeInputs: outputs =
{
self,
nixpkgs,
nixpkgs-unstable,
agenix,
home-manager,
...
}@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs { inherit system; };
inherit system;
};
in in
{ {
# used with: `nix fmt`
formatter.${system} = pkgs.nixfmt-rfc-style;
colmena = { colmena = {
meta = { meta = {
nixpkgs = import nixpkgs { nixpkgs = pkgs;
inherit system; specialArgs = {
overlays = [ ]; inherit inputs;
# modules = [
# ./modules
# ];
}; };
}; };
defaults = {
imports = [
"${nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
./modules
];
};
# childnixos = { # childnixos = {
# deployment = { # deployment = {
# targetHost = "10.233.244.63"; # targetHost = "10.233.244.63";
@ -61,11 +70,7 @@
targetUser = "root"; targetUser = "root";
}; };
imports = [ imports = [ ./hosts/arr ];
<nixpkgs/nixos/modules/virtualisation/proxmox-lxc.nix>
./modules
./hosts/arr
];
}; };
# deadbeef = { # deadbeef = {
@ -83,26 +88,27 @@
}; };
formatter.${system} = pkgs.nixpkgs-fmt;
nixosConfigurations = nixosConfigurations =
let let
mkNixosConfiguration = name: extraModules: nixpkgs.lib.nixosSystem { mkNixosConfiguration =
inherit system; name: extraModules:
specialArgs = { inherit flakeInputs; }; nixpkgs.lib.nixosSystem {
modules = [ inherit system;
{ specialArgs = {
networking.hostName = name; inherit inputs;
nixpkgs.overlays = [ (_: _: { nixfiles = self.packages.${system}; }) ]; };
# sops.defaultSopsFile = ./hosts + "/${name}" + /secrets.yaml; modules = [
} {
./modules networking.hostName = name;
(./hosts + "/${name}") nixpkgs.overlays = [ (_: _: { nixfiles = self.packages.${system}; }) ];
# (./hosts + "/${name}" + /hardware.nix) # sops.defaultSopsFile = ./hosts + "/${name}" + /secrets.yaml;
# sops-nix.nixosModules.sops }
] ++ extraModules; ./modules
}; (./hosts + "/${name}")
# (./hosts + "/${name}" + /hardware.nix)
# sops-nix.nixosModules.sops
] ++ extraModules;
};
in in
{ {
deadbeef = mkNixosConfiguration "deadbeef" [ ]; deadbeef = mkNixosConfiguration "deadbeef" [ ];
@ -110,8 +116,6 @@
}; };
}; };
# formatter.${system} = pkgs.nixpkgs-fmt; # formatter.${system} = pkgs.nixpkgs-fmt;
# nixosConfigurations = { # nixosConfigurations = {
@ -129,7 +133,6 @@
# ./hosts/deadbeef # ./hosts/deadbeef
# ]; # ];
# }; # };
# }; # };