Compare commits

...

2 commits

Author SHA1 Message Date
Katherina Walshe-Grey 691c180ac1 flake: define flake-parts options for colmena
This allows us to define options on the top level, so that we can write
modules to generate config for multiple hosts.

Idea from
1c51514586
2025-03-03 21:26:32 +00:00
Katherina Walshe-Grey c70b287890 treewide: define fqdn, use as default deployment target host 2025-03-03 19:54:32 +00:00
6 changed files with 32 additions and 8 deletions

View file

@ -70,7 +70,7 @@
outputs = inputs@{ self, nixpkgs, nixpkgs-small, nixpkgs-unstable, flake-parts, colmena, ... }: outputs = inputs@{ self, nixpkgs, nixpkgs-small, nixpkgs-unstable, flake-parts, colmena, ... }:
flake-parts.lib.mkFlake { inherit inputs; } { flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ ]; imports = [ ./flake ];
systems = [ "x86_64-linux" "aarch64-linux" ]; systems = [ "x86_64-linux" "aarch64-linux" ];
@ -125,9 +125,7 @@
}; };
defaults = { config, lib, pkgs, ... }: { defaults = { config, lib, pkgs, ... }: {
# disable remote deployment by default deployment.targetHost = lib.mkDefault config.networking.fqdn;
# (can stil build locally with nixos-rebuild)
deployment.targetHost = lib.mkDefault null;
deployment.buildOnTarget = lib.mkDefault true; deployment.buildOnTarget = lib.mkDefault true;
imports = [ imports = [
@ -142,10 +140,9 @@
]; ];
}; };
elucredassa.deployment.targetHost = "10.127.3.2"; kilgharrah.deployment.targetHost = null; # disable remote deployment
yevaud.deployment.targetHost = "yevaud.birdsong.network"; tohru.deployment.targetHost = null; # disable remote deployment
orm.deployment.targetHost = "orm.birdsong.network"; elucredassa.deployment.targetHost = "10.127.3.2"; # no fqdn yet
kalessin.deployment.targetHost = "kalessin.birdsong.network";
kilgharrah.imports = [ ./hosts/kilgharrah ]; kilgharrah.imports = [ ./hosts/kilgharrah ];
tohru.imports = [ ./hosts/tohru ]; tohru.imports = [ ./hosts/tohru ];

19
flake/colmena.nix Normal file
View file

@ -0,0 +1,19 @@
# https://git.lix.systems/the-distro/infra/src/commit/fbb23bf517206175764f154ddfd304b9ec501f87/colmena.nix
{ lib, ... }: {
options.flake.colmena = lib.mkOption {
type = lib.types.submodule {
freeformType = lib.types.attrsOf (lib.mkOptionType {
name = "NixOS module";
description = "module containing NixOS options and/or config";
descriptionClass = "noun";
check = value: builtins.isAttrs value || builtins.isFunction value || builtins.isPath value;
merge = loc: defs: {
imports = map (def: def.value) defs;
};
});
options.meta = lib.mkOption {
type = lib.types.attrs;
};
};
};
}

5
flake/default.nix Normal file
View file

@ -0,0 +1,5 @@
{
imports = [
./colmena.nix
];
}

View file

@ -12,6 +12,7 @@ in
nixpkgs.hostPlatform = "aarch64-linux"; nixpkgs.hostPlatform = "aarch64-linux";
networking.hostName = "kalessin"; networking.hostName = "kalessin";
networking.hostId = "534b538e"; networking.hostId = "534b538e";
networking.domain = "birdsong.network";
fountain.users.qenya.enable = true; fountain.users.qenya.enable = true;
users.users.qenya.extraGroups = [ "wheel" ]; users.users.qenya.extraGroups = [ "wheel" ];

View file

@ -9,6 +9,7 @@
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs.hostPlatform = "x86_64-linux";
networking.hostName = "orm"; networking.hostName = "orm";
networking.hostId = "00000000"; networking.hostId = "00000000";
networking.domain = "birdsong.network";
fountain.users.qenya.enable = true; fountain.users.qenya.enable = true;
users.users.qenya.extraGroups = [ "wheel" ]; users.users.qenya.extraGroups = [ "wheel" ];

View file

@ -13,6 +13,7 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
networking.hostName = "yevaud"; networking.hostName = "yevaud";
networking.hostId = "09673d65"; networking.hostId = "09673d65";
networking.domain = "birdsong.network";
fountain.users.qenya.enable = true; fountain.users.qenya.enable = true;
users.users.qenya.extraGroups = [ "wheel" ]; users.users.qenya.extraGroups = [ "wheel" ];