!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

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

Load older messages


SenderMessageTime
17 Feb 2025
@prroet:prroet.dynv6.netprroet joined the room.19:22:46
18 Feb 2025
@polygon:catgirl.cloudUnit 1721344 [polygon] (it/its, es/ihr) changed their profile picture.13:02:08
19 Feb 2025
@pc:rrier.frpcarrier joined the room.06:44:26
@pc:rrier.frpcarrierRedacted or Malformed Event06:45:07
@pc:rrier.frpcarrier *

It is not out of the question that I might be stupid…

pcarrier@cat ~/s/m/multiverse (pcarrier/nix) [1]> ls *.nix
.rw-r--r--@ 3.1k pcarrier 19 Feb 07:43 -N  flake.nix
pcarrier@cat ~/s/m/multiverse (pcarrier/nix)> colmena apply
warning: Git tree '/Users/pcarrier/src/monorepo' is dirty
error: path '/nix/store/m2y56rx0qaiylbsg0prbjd1ah5lzfwb3-source/multiverse/flake.nix' does not exist
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
Hint: Backtrace available - Use `RUST_BACKTRACE=1` environment variable to display a backtrace
06:45:25
@pc:rrier.frpcarrier *

It is not out of the question that I might be stupid… What gives?

pcarrier@cat ~/s/m/multiverse (pcarrier/nix) [1]> ls *.nix
.rw-r--r--@ 3.1k pcarrier 19 Feb 07:43 -N  flake.nix
pcarrier@cat ~/s/m/multiverse (pcarrier/nix)> colmena apply
warning: Git tree '/Users/pcarrier/src/monorepo' is dirty
error: path '/nix/store/m2y56rx0qaiylbsg0prbjd1ah5lzfwb3-source/multiverse/flake.nix' does not exist
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
Hint: Backtrace available - Use `RUST_BACKTRACE=1` environment variable to display a backtrace
06:45:35
@pc:rrier.frpcarrierAny way to set custom attributes on my nodes, that I could then consume from the default config?12:53:52
@kevinpthorne:matrix.orgkevinpthornehttps://nixos.wiki/wiki/NixOS_modules12:56:22
@pc:rrier.frpcarrierI'm not quite sure how to apply this here13:00:08
@pc:rrier.frpcarrier
defaults = { foo = lib.mkOption { … } };
host = { foo = bar; }

doesn't work right?

13:00:56
@pc:rrier.frpcarrierah, got it, thanks13:30:27
@thesimplekid:matrix.org@thesimplekid:matrix.org left the room.14:49:23
@sako:sako.lolsako -w- joined the room.18:13:40
@pc:rrier.frpcarrierBeen stuck for a while with this error: https://gist.github.com/pcarrier/bc0173d20106cd178707f1955a1dafd819:19:35
@pc:rrier.frpcarrierAny ideas would be much appreciated19:19:40
@gmacon:matrix.orggmacon Looks like you need enable = config.roles ? etcd; since on the non-etcd hosts, config.roles will be an attrset that does not contain an etcd key, so you can't get the value of that key. Another option would be to ensure that roles always contains every possible role, but set to false for the roles this host doesn't have. 20:18:22
@pc:rrier.frpcarrierwell I thought I did exactly that through its default value20:19:22
@pc:rrier.frpcarrier
          options = {
            roles = mkOption {
              type = types.attrsOf types.bool;
              default = {
                bastion = false;
                spawner = false;
                etcd = false;
                webserver = false;
              };
            };
          };
20:20:05
@pc:rrier.frpcarrierthat's OK, I'll switch to a single role per box20:22:35
@pc:rrier.frpcarrierperfect :)20:37:06
@pc:rrier.frpcarrierRedacted or Malformed Event20:43:00
@pc:rrier.frpcarrier* I'm trying to make nix run .#deploy args... run the colmena version as imported, can't find how to access the binary to put in a pkgs.writeShellScriptBin though20:43:20
@gmacon:matrix.orggmaconAh; the assignment overrides the default value instead of being merged with it, you need types.submodule with each role having its own default to do that.20:48:17
@kevinpthorne:matrix.orgkevinpthorne

From the cheap seats: Why not use an array of enum type? The kubernetes pkgs does it and makes it clean to check

Roles = [ “bastion” “etc” ]; for example

20:50:11
@pc:rrier.frpcarriermaybe I should ask for what I'm actually after: how can I run colmena unstable?20:56:44
@pc:rrier.frpcarrier* maybe I should ask for what I'm actually after: how can I run colmena unstable, ideally through instructions in my flake?21:02:01
@pc:rrier.frpcarrier * maybe I should ask for what I'm actually after: how can I run colmena unstable, ideally through instructions in my flake? (I was hoping to expose a wrapper à la nix run .#c) 21:02:23
@pc:rrier.frpcarrier
      deployTool = pkgs.writeShellScriptBin "deployTool" ''
        ${colmena.packages.${system}.colmena}/bin/colmena "$@"
      '';
fails with:
21:08:47
@pc:rrier.frpcarrier *
      deployTool = pkgs.writeShellScriptBin "deployTool" ''
        ${colmena.packages.${system}.colmena}/bin/colmena "$@"
      '';

fails with:

error: builder for '/nix/store/h8hz7zb1vllgws7sw9fbhm1cjpbrmpww-nix-eval-jobs-2.14.0-colmena.drv' failed with exit code 1;
       last 8 log lines:
       > unpacking sources
       > unpacking source archive /nix/store/wj7x28pyf2230189fw788mm31z8zmzm3-source
       > source root is source
       > patching sources
       > applying patch /nix/store/v5farz7ph5afn6hw2hi0r343lhhpv8dd-nix-eval-jobs-stable.patch
       > patching file src/nix-eval-jobs.cc
       > Hunk #1 FAILED at 342.
       > 1 out of 1 hunk FAILED -- saving rejects to file src/nix-eval-jobs.cc.rej
       For full logs, run:
         nix-store -l /nix/store/h8hz7zb1vllgws7sw9fbhm1cjpbrmpww-nix-eval-jobs-2.14.0-colmena.drv
21:09:14
20 Feb 2025
@gmacon:matrix.orggmacon This looks like the correct approach to me, but it seems that the build is broken with the versions you have pinned. Maybe nix flake update? 13:44:38

Show newer messages


Back to Room ListRoom Version: 6