allow building with nix build
This commit is contained in:
63
flake.nix
63
flake.nix
@@ -103,22 +103,49 @@
|
||||
agenix.packages.${system}.default
|
||||
colmena.packages.${system}.colmena
|
||||
colmena.packages.${system}.manual
|
||||
(pkgs.writeShellScriptBin "build" ''
|
||||
(writeShellScriptBin "build" ''
|
||||
colmena --experimental-flake-eval build --keep-result "$@"
|
||||
'')
|
||||
(pkgs.writeShellScriptBin "apply" ''
|
||||
(writeShellScriptBin "apply" ''
|
||||
colmena --experimental-flake-eval apply --keep-result "$@"
|
||||
'')
|
||||
(pkgs.writeShellScriptBin "apply-local" ''
|
||||
(writeShellScriptBin "apply-local" ''
|
||||
colmena --experimental-flake-eval apply-local --sudo "$@"
|
||||
'')
|
||||
];
|
||||
};
|
||||
};
|
||||
flake = {
|
||||
nixosConfigurations =
|
||||
let
|
||||
mkConfiguration =
|
||||
name:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
./modules
|
||||
./hosts/${name}
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
radish = mkConfiguration "radish";
|
||||
freun-dev = mkConfiguration "freun-dev";
|
||||
apu = mkConfiguration "apu";
|
||||
};
|
||||
|
||||
colmenaHive = colmena.lib.makeHive self.outputs.colmena;
|
||||
|
||||
colmena = {
|
||||
colmena =
|
||||
let
|
||||
deploymentOptions = {
|
||||
radish = {
|
||||
allowLocalDeployment = true;
|
||||
targetHost = null;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
meta = {
|
||||
inherit specialArgs;
|
||||
|
||||
@@ -127,29 +154,11 @@
|
||||
overlays = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
defaults =
|
||||
{ name, ... }:
|
||||
{
|
||||
imports = [
|
||||
./modules
|
||||
./hosts/${name}
|
||||
];
|
||||
};
|
||||
|
||||
radish =
|
||||
{ ... }:
|
||||
{
|
||||
deployment = {
|
||||
allowLocalDeployment = true;
|
||||
targetHost = null;
|
||||
};
|
||||
};
|
||||
|
||||
freun-dev = { ... }: { };
|
||||
|
||||
apu = { ... }: { };
|
||||
};
|
||||
}
|
||||
// builtins.mapAttrs (name: config: {
|
||||
imports = config._module.args.modules;
|
||||
deployment = if builtins.hasAttr name deploymentOptions then deploymentOptions.${name} else { };
|
||||
}) self.nixosConfigurations;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user