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