!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

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

Load older messages


SenderMessageTime
3 Jan 2022
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @angerman:matrix.org
so I should initialize the nixpkgs with the controller system?
controller system?
07:15:39
@angerman:matrix.organgermanOhh... 😥07:15:46
@angerman:matrix.organgermancontroller/deployer (whatever we call the machine from which we deploy).07:16:11
@zhaofeng:zhaofeng.liZhaofeng LiYou should initialize with the target system (x86_64-linux, aarch64-linux, etc).07:17:12
@zhaofeng:zhaofeng.liZhaofeng LiCurrently you can use the remote build feature to deploy from macOS to NixOS, but not to macOS. It should be fairly easy to add, however, since the semantics are similar07:18:37
@zhaofeng:zhaofeng.liZhaofeng Li * Currently you can use the remote build feature to deploy from macOS to NixOS, but not to macOS. It should be fairly easy to add, however, since the semantics are similar (with nix-darwin)07:19:07
@angerman:matrix.organgermanHmm. Yea, I've got a variety of {x86_64,aarch64}-{linux,macos} systems in my deployment. macos for now requires ssh'ing into the machine, updagint the nix configuration and running darwin rebuild.07:24:37
4 Jan 2022
@aanderse:nixos.devaanderse joined the room.22:16:50
* @aanderse:nixos.devaanderse waves 👋22:18:54
@buckley310:matrix.orgBuckley joined the room.22:21:48
@buckley310:matrix.orgBuckley👋23:42:50
5 Jan 2022
@rgrunbla:matrix.orgRémy Grünblatt joined the room.07:40:54
@rgrunbla:matrix.orgRémy Grünblatthello there07:51:20
@necrophcodr:matrix.orgnecrophcodr joined the room.15:54:38
@necrophcodr:matrix.orgnecrophcodr

I'm getting the following error on a simple deployment at the moment:

-> % colmena apply
[INFO ] Enumerating nodes...
error: infinite recursion encountered

       at /nix/store/y41rr1klzvwrmjs6smyl8kd1ipa5m5kj-source/lib/modules.nix:305:28:

          304|         builtins.addErrorContext (context name)
          305|           (args.${name} or config._module.args.${name})
             |                            ^
          306|       ) (lib.functionArgs f);
(use '--show-trace' to show detailed location information)
[ERROR] -----
[ERROR] Operation failed with error: Nix exited with error code: 1
15:55:24
@necrophcodr:matrix.orgnecrophcodr

NixOS config is

{ config, lib, pkgs, modulesPath, home-manager, ... }:
{
  deployment = {
    targetHost = "192.168.x.y";
    targetUser = "nixos";
    tags = [ "rpi" "lab" ];
  };

  imports = [
    (home-manager + "/nixos")
  ];
}
15:55:50
@necrophcodr:matrix.orgnecrophcodrAny ideas on how I could debug that?15:57:46
@andi:kack.itandi- joined the room.16:12:32
@zhaofeng:zhaofeng.liZhaofeng LiWhat does your hive.nix look like?17:09:20
@necrophcodr:matrix.orgnecrophcodr
In reply to @zhaofeng:zhaofeng.li
What does your hive.nix look like?

Sorry for not replying earlier, but I don't have a hive.nix, just a flake.nix as follows:

{
  description = "Flake for RPI 4 Lab Infrastructure";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05";
    devshell.url = "github:numtide/devshell";
    flake-utils.url = "github:numtide/flake-utils";
    colmena.url = "github:zhaofengli/colmena/v0.2.0";
    colmena.inputs.utils.follows = "flake-utils";
    home-manager.url = "github:nix-community/home-manager/release-21.05";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
  };
  outputs = { self, nixpkgs, devshell, flake-utils, colmena, home-manager }:
    let
      nativePkgs = import nixpkgs { 
        system = ( if builtins ? currentSystem then builtins.currentSystem else "x86_64-linux" );
        };
    in
    {
      colmena = {
        meta.nixpkgs = nativePkgs;
        pi = import ./pi4.nix;
        specialArgs = {
          inherit home-manager;
        };
      };
    } // flake-utils.lib.eachDefaultSystem
      (system:
        let 
          pkgs = import nixpkgs { inherit system; overlays = [ devshell.overlay ]; };
        in
        {
          devShell = pkgs.devshell.mkShell {
            packages = with pkgs; [
              colmena.defaultPackage.${system}
            ];
          };
        }
      );
}

21:35:33
@zhaofeng:zhaofeng.liZhaofeng LiThat confirms my suspicions in https://matrix.to/#/!KqkRjyTEzAGRiZFBYT:nixos.org/$YU9o4IlsSyfFcrRGby4AGBIvMLhMH0OPdWvEG4-5Qnk?via=nixos.org&via=matrix.org&via=tchncs.de21:36:44
@zhaofeng:zhaofeng.liZhaofeng Li Change specialArgs to meta.specialArgs 21:36:53
@necrophcodr:matrix.orgnecrophcodrOh I didn't even see your reply there, so sorry!21:37:24
@necrophcodr:matrix.orgnecrophcodrWell, that does it! Thank you so much! Is this a recent change, that specialArgs are required?21:37:59
@zhaofeng:zhaofeng.liZhaofeng Li No, you need to pass it in otherwise there is no argument named home-manager 21:38:54
@necrophcodr:matrix.orgnecrophcodrThe odd thing is I've got a different system with roughly the same flake.nix setup, but for a bunch of TV settop systems. They also use home-manager in exactly the same manner, but there's no specialArgs defined there, and it still works21:39:05
@zhaofeng:zhaofeng.liZhaofeng Li Is home-manager there as part of the NixOS module arguments? That shouldn't have worked. 21:40:17
@zhaofeng:zhaofeng.liZhaofeng Li But if you put the configuration in the same file as flake.nix, then home-manager is usable from the context 21:40:47
@necrophcodr:matrix.orgnecrophcodrThe difference between the other system and this one is that this one is running NixOS, and the other is just Ubuntu with Nix slapped on top21:40:52
@zhaofeng:zhaofeng.liZhaofeng Li * But if you put the configuration in the same file as flake.nix, then home-manager is usable from the context in outputs 21:40:55

Show newer messages


Back to Room ListRoom Version: 6