!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

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

Load older messages


SenderMessageTime
4 Feb 2022
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @winterqt:nixos.dev
Zhaofeng Li: why do you exit with 0 when the file doesn't exist in https://github.com/zhaofengli/colmena/pull/51/files#diff-c5cb072f3843e65103369a68e92494e5ab2915080d0930c0c4fd6b7cb2620a96R502?
* The service is supposed to die when the key file ceases to exist. The activation of the service is triggered by the path unit.
00:19:12
@zhaofeng:zhaofeng.liZhaofeng Li * The service is supposed to die when the key file doesn't exist or ceases to exist. The activation of the service is triggered by the path unit. 00:19:36
@winterqt:nixos.devWinter (she/her)
In reply to @zhaofeng:zhaofeng.li
The service is supposed to die when the key file doesn't exist or ceases to exist. The activation of the service is triggered by the path unit.
got it.
why Restart = "on-failure"; btw?
00:27:38
@winterqt:nixos.devWinter (she/her)like, when would it want to be restarted? if inotifywait fails?00:27:53
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @winterqt:nixos.dev
like, when would it want to be restarted? if inotifywait fails?
Yes
00:28:02
@winterqt:nixos.devWinter (she/her)got it, thanks00:28:22
@zhaofeng:zhaofeng.liZhaofeng LiYou can also take a look at NixOps' implementation which uses inotifywait both ways: https://github.com/NixOS/nixops/blob/ce1c57ec104636954296c229468bb65fa4ec7f8d/nix/keys.nix#L234-L26200:28:54
@zhaofeng:zhaofeng.liZhaofeng LiIf the key file doesn't exist, the service is stuck in "activating" (ExecStartPre) with an infinite timeout00:29:39
@winterqt:nixos.devWinter (she/her)
In reply to @zhaofeng:zhaofeng.li
If the key file doesn't exist, the service is stuck in "activating" (ExecStartPre) with an infinite timeout
so did you go the path unit route for simplicity?
00:33:43
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @winterqt:nixos.dev
so did you go the path unit route for simplicity?
Yeah, feels cleaner to me, though path units don't support deactivation so I still ended up doing an inotifywait in the service itself.
00:35:57
@linus.heckemann:matrix.mayflower.deLinux Hackerman
In reply to @buckley310:matrix.org
because colmena was created before flakes were stable
Flakes still isn't stable.
08:39:16
@linus.heckemann:matrix.mayflower.deLinux HackermanThat's why it's guarded behind experimental-features, breaking changes can still happen.08:45:39
@buckley310:matrix.orgBuckleyThat' true.15:17:37
@buckley310:matrix.orgBuckleyI just mean like, the output attribute name for machine configs probably isnt going to change anymore now, so that aspect has stabilized 15:18:35
@buckley310:matrix.orgBuckleyBut yeah, flakes, totally not officially "stable" yet.15:19:04
@schnecfk:ruhr-uni-bochum.deCRTified Buckley: Regarding your colmena/nixosConfigurations-shim, how did you get it working at all? My flakes don't have an extraArgs.modules attribute, so I seem to be missing something. The configs build properly with nixos-rebuild --flake .#hostname build 17:46:12
@buckley310:matrix.orgBuckley Each machine should have the extraArga attribute, not the flake itself. Not sure if that’s what you mean 17:47:23
@schnecfk:ruhr-uni-bochum.deCRTified
In reply to @buckley310:matrix.org
So I'm curious. In my setup my servers all exist inside of my flake outputs.nixosConfigurations, and my outputs.colmena is just a stub that consumes nixosConfigurations and emits a colmena configuration. Is anyone else doing it this way, or just me? I really like the portability of keeping my hosts in nixosConfigurations
imports = value.extraArgs.modules;

This does not work, due to extraArgs.modules missing

17:48:19
@buckley310:matrix.orgBuckley

what happens if you run these terminal commands in your repo?

$ nix repl
nix-repl> :lf .
nix-repl> nixosConfigurations.<hostname>.extraArgs.modules
17:49:41
@schnecfk:ruhr-uni-bochum.deCRTified

Same error as when running colmena build:

error: attribute 'modules' missing

       at «string»:1:1:

            1| nixosConfigurations.mailbox.extraArgs.modules
             | ^
            2|


17:50:33
@buckley310:matrix.orgBuckley🤔17:51:08
@buckley310:matrix.orgBuckleydunno17:51:39
@buckley310:matrix.orgBuckleyare you on unstable or 21.11 ?17:51:44
@schnecfk:ruhr-uni-bochum.deCRTified
  • system: "x86_64-linux"
  • host os: Linux 5.16.2, NixOS, 22.05 (Quokka)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.6.0pre20211217_6e6e998

If it helps

17:51:47
@schnecfk:ruhr-uni-bochum.deCRTifiedUnstable17:51:51
@schnecfk:ruhr-uni-bochum.deCRTified
$ nix --version
nix (Nix) 2.6.0pre20211217_6e6e998
17:52:12
@buckley310:matrix.orgBuckleyim on 21.11. i wonder if they changed something? 🤔17:52:17
@buckley310:matrix.orgBuckleyoh im on nix 2.4 as well17:52:23
@schnecfk:ruhr-uni-bochum.deCRTified AFAIK, extraArgs in nixpkgs.lib.nixosSystem got deprecated 🤔 17:52:44
@buckley310:matrix.orgBuckley🎉 i guess i need to figure out how else to do this then17:53:06

Show newer messages


Back to Room ListRoom Version: 6