allow building with nix build

This commit is contained in:
Joakim Repomaa
2025-03-03 11:29:51 +02:00
parent abd970755a
commit a1f5e2acf7

View File

@@ -103,53 +103,62 @@
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 = {
colmenaHive = colmena.lib.makeHive self.outputs.colmena;
colmena = {
meta = {
inherit specialArgs;
nixpkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ ];
};
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";
};
defaults =
{ name, ... }:
{
imports = [
./modules
./hosts/${name}
];
};
colmenaHive = colmena.lib.makeHive self.outputs.colmena;
radish =
{ ... }:
{
deployment = {
colmena =
let
deploymentOptions = {
radish = {
allowLocalDeployment = true;
targetHost = null;
};
};
in
{
meta = {
inherit specialArgs;
freun-dev = { ... }: { };
apu = { ... }: { };
};
nixpkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ ];
};
};
}
// builtins.mapAttrs (name: config: {
imports = config._module.args.modules;
deployment = if builtins.hasAttr name deploymentOptions then deploymentOptions.${name} else { };
}) self.nixosConfigurations;
};
}
);