Switch to colmena for system configurations and deployment
parent
b4b9f54727
commit
dab4d66124
37
flake.nix
37
flake.nix
|
@ -14,7 +14,7 @@
|
|||
{ self, nixpkgs, ... }@inputs:
|
||||
let
|
||||
outputs = self.outputs;
|
||||
utils = import ./utils.nix { inherit nixpkgs inputs outputs; };
|
||||
utils = import ./utils.nix;
|
||||
|
||||
homelabConfig = import ./config.nix;
|
||||
roles = import ./roles { inherit utils; };
|
||||
|
@ -22,21 +22,38 @@
|
|||
inherit homelabConfig roles;
|
||||
lib = nixpkgs.lib;
|
||||
};
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
in
|
||||
{
|
||||
nixosConfigurations =
|
||||
(nixpkgs.lib.mapAttrs (
|
||||
devShells.x86_64-linux.default = pkgs.mkShell {
|
||||
buildInputs = [ pkgs.colmena ];
|
||||
};
|
||||
colmena =
|
||||
{
|
||||
meta = {
|
||||
nixpkgs = import nixpkgs {
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
specialArgs = {
|
||||
inherit
|
||||
inputs
|
||||
outputs
|
||||
hosts
|
||||
;
|
||||
};
|
||||
};
|
||||
}
|
||||
// (nixpkgs.lib.mapAttrs (
|
||||
_: value:
|
||||
(utils.mkSystem {
|
||||
inherit hosts;
|
||||
hostConfig = value;
|
||||
})
|
||||
) hosts)
|
||||
// {
|
||||
template = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [ ./systems/template/configuration.nix ];
|
||||
};
|
||||
) hosts);
|
||||
nixosConfigurations = {
|
||||
template = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [ ./systems/template/configuration.nix ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
22
utils.nix
22
utils.nix
|
@ -1,23 +1,9 @@
|
|||
{
|
||||
nixpkgs,
|
||||
inputs,
|
||||
outputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
mkSystem =
|
||||
{ hostConfig, hosts }:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
inherit
|
||||
inputs
|
||||
outputs
|
||||
hostConfig
|
||||
hosts
|
||||
;
|
||||
};
|
||||
modules = [
|
||||
{ hostConfig }:
|
||||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.impermanence.nixosModules.impermanence
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
|
||||
|
|
Loading…
Reference in New Issue