| 16 Nov 2024 |
inomena | I would still want to use outputs.colmena.meta and outputs.colmena.defaults in this scenario | 22:51:13 |
| 17 Nov 2024 |
inomena | think I figured it out, or atleast it seems to work:
outputs = {nixpkgs, ...}:
let
hosts = nixpkgs.lib.mapAttrs'
(filename: _: {
name = nixpkgs.lib.nameFromURL filename ".";
value = [ ./hosts/${filename} ];
})
(builtins.readDir ./hosts);
in {
colmena = hosts // {
# ...
};
};
| 08:39:26 |
ibizaman | In reply to @inomena:matrix.org
think I figured it out, or atleast it seems to work:
outputs = {nixpkgs, ...}:
let
hosts = nixpkgs.lib.mapAttrs'
(filename: _: {
name = nixpkgs.lib.nameFromURL filename ".";
value = [ ./hosts/${filename} ];
})
(builtins.readDir ./hosts);
in {
colmena = hosts // {
# ...
};
};
Oh nice you went the extra mile with readDir. I was going to suggest plain imports but that works well! | 08:57:01 |
inomena | I wanted it to be fully dynamic, so that the only thing I need to do to add a new host to the hive is to define a single <hostname>.nix file in the hosts dir and nothing else | 08:57:56 |
inomena | not having to also define it in a few other places | 08:58:09 |
inomena | * not having to also define imports in a few other places | 08:58:18 |
nixy | In reply to @ser:sergevictor.eu can colmena secrets deploy a whole directory, not single files only? I don't believe so. But you can use the keyCommand option to create an archive (tar, zip) from a directory and then use systemd services to extract it. That's what I do for this at least | 14:06:26 |
ser(ial) | that's a nice concept, i didn't think about it, thanks! | 14:08:58 |
| @jh-devv:matrix.org joined the room. | 18:39:43 |