!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

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

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


SenderMessageTime
25 Jan 2022
@buckley310:matrix.orgBuckley
In reply to @buckley310:matrix.org

the stub:

colmena =
    { meta.nixpkgs = nixpkgs.legacyPackages."x86_64-linux"; } //
    builtins.mapAttrs
      (name: value: {
        nixpkgs.system = value.config.nixpkgs.system;
        imports = value.extraArgs.modules ++ [
          ({ config, ... }: { inherit (config.sconfig) deployment; })
        ];
      })
      (nixosConfigurations);
FWIW, my colmena machines have the correct nixpkgs info instead of the pre-git thing, because i build them in nixosConfigurations and then shim them into colmena
15:45:59
@buckley310:matrix.orgBuckley
$ nixos-version 
21.11.20211229.8588b14 (Porcupine)
15:46:43
@linus.heckemann:matrix.mayflower.deLinux Hackerman
In reply to @buckley310:matrix.org

the stub:

colmena =
    { meta.nixpkgs = nixpkgs.legacyPackages."x86_64-linux"; } //
    builtins.mapAttrs
      (name: value: {
        nixpkgs.system = value.config.nixpkgs.system;
        imports = value.extraArgs.modules ++ [
          ({ config, ... }: { inherit (config.sconfig) deployment; })
        ];
      })
      (nixosConfigurations);
hm, why do you set nixpkgs.system again? Shouldn't imports already take care of that?
17:41:43
@buckley310:matrix.orgBuckleyi originally thought so, but if i remove that line my pi doesnt deploy right17:42:22
@linus.heckemann:matrix.mayflower.deLinux HackermanI also don't see how that will play along with use of meta.nodeNixpkgs17:42:25
@linus.heckemann:matrix.mayflower.deLinux Hackerman that is, if I use meta.nodeNixpkgs it will deploy using the nixpkgs I want it to, but have an incorrect version string 17:44:49
@0x4a6f:matrix.org[0x4A6F]

Linux Hackerman: something along this in flake outputs?

    colmena.defaults = {
      system.nixos.version = "nixos-${nixpkgs.shortRev}";
    };
17:45:10
@linus.heckemann:matrix.mayflower.deLinux Hackerman
In reply to @linus.heckemann:matrix.mayflower.de
that is, if I use meta.nodeNixpkgs it will deploy using the nixpkgs I want it to, but have an incorrect version string
[0x4A6F]: that also has ^ this problem
17:45:36
@buckley310:matrix.orgBuckley
In reply to @linus.heckemann:matrix.mayflower.de
that is, if I use meta.nodeNixpkgs it will deploy using the nixpkgs I want it to, but have an incorrect version string
not sure. i dont use meta.nodePackages.
17:46:04
@buckley310:matrix.orgBuckley
In reply to @linus.heckemann:matrix.mayflower.de
that is, if I use meta.nodeNixpkgs it will deploy using the nixpkgs I want it to, but have an incorrect version string
* not sure. i dont use meta.nodeNixpkgs
17:46:42
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @linus.heckemann:matrix.mayflower.de
that is, if I use meta.nodeNixpkgs it will deploy using the nixpkgs I want it to, but have an incorrect version string
Hmm, interesting. Do you have a minimal repro? Or I can try doing it sometime today
18:26:09
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @linus.heckemann:matrix.mayflower.de
Is there a way to pass the flake inputs on to all machine configs? I'd like to do things like imports = [ "${inputs.nixos-mailserver}/default.nix" ]; in my machine configs.
You can pass the inputs using either meta.specialArgs.inputs = inputs; or _module.args.inputs = inputs; in a node config
18:27:23
@zhaofeng:zhaofeng.liZhaofeng Li Then inputs will be available as a NixOS module parameter. You can also go the overlays way, though. 18:28:09
@linus.heckemann:matrix.mayflower.deLinux Hackerman
In reply to @zhaofeng:zhaofeng.li
You can pass the inputs using either meta.specialArgs.inputs = inputs; or _module.args.inputs = inputs; in a node config
I tried the latter, it resulted in infinite recursion in combination with imports = [ inputs.nixos-mailserver ];
19:36:43

Show newer messages


Back to Room ListRoom Version: 6