!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

303 Members
A simple, stateless NixOS deployment tool - https://github.com/zhaofengli/colmena102 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
16 Nov 2024
@inomena:matrix.orginomena I would still want to use outputs.colmena.meta and outputs.colmena.defaults in this scenario 22:51:13
17 Nov 2024
@inomena:matrix.orginomena

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:matrix.orgibizaman
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:matrix.orginomenaI 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 else08:57:56
@inomena:matrix.orginomenanot having to also define it in a few other places08:58:09
@inomena:matrix.orginomena * not having to also define imports in a few other places08:58:18
@nixy:nixy.moenixy
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:sergevictor.euser(ial)that's a nice concept, i didn't think about it, thanks!14:08:58
@jh-devv:matrix.org@jh-devv:matrix.org joined the room.18:39:43

Show newer messages


Back to Room ListRoom Version: 6