!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

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

Load older messages


SenderMessageTime
18 Jan 2024
@dmoonfire:matrix.orgdmoonfire
In reply to @jannik:introverts.xyz

Mhhh let me rephrase, the flake.nix has

{
  inputs = {
    # ...
    customPackage.url = "github:jeyemwey/customPackage";
  };
  outputs = { customPackage, ... }: {
    colmena.myHost = {pkgs, ...}: {
      imports = [ ./hosts/myHost ];
      
      services.nginx.virtualHosts."myPackage.example.com".root = "${customPackage.packages."${pkgs.hostPlatform.system}".default}";
    };
  }; 
}

and I can reference the customPackage in the flake outputs function just fine, but I'm not sure how I can reference it in the imports target in ./hosts/myHost/default.nix:

{...}: {
	services.nginx.enable = true;
	services.nginx.virtualHosts."myPackage.example.com" = {
		forceSSL = true;
		enableACME = true;
		
		## TODO: Find way to reference customPackage here
		# root = ...;
	};
}

If that is at all possible? Your answer seems to reference on the inputs of the customPackage which is not what I need here.

I asked that question earlier this year. You use specialArgs. I have an example at https://d.moonfire.us/blog/2023/12/03/passing-nixos-flake-inputs-through-colmena/ based on the response at https://discourse.nixos.org/t/colmena-how-to-push-a-flake-input-into-the-individual-nodes/36332
02:05:22
@jannik:introverts.xyz@jannik:introverts.xyzThank you, that solves my question exactly. That's for the write up06:40:55
20 Jan 2024
@dtrace:matrix.org@dtrace:matrix.org joined the room.01:58:28
@dtrace:matrix.org@dtrace:matrix.org

I was banging my head around for hours trying to figure out how to get the home-manager nixos module to work with colmena apply.
Question #1 Is it possible to get Colmena and home-manager module to work with one another? (I've read conflicting statements).
Question #2 Assuming it is possible does someone have a working flake using Colmena and home-manager?

My config for my nixos systems using flakes and colmena (this is the commit when I had attempted using home-manager and sops-nix): https://github.com/tracyde/nixos-config/tree/62b5b5810e2e4541a6c147a34ebb640f0bea44ba

20:38:51
21 Jan 2024
@dmoonfire:matrix.orgdmoonfire

Cross-platform question. I just got a Raspberry Pi and I'm trying to set it up, but right now colmena apply --on cm4 is pushing x86_64 binaries, instead of aarch64 ones. I figured I'm doing something wrong, just not sure what. This is a flake setup and I think the relevant lines are:

{
  outputs = inputs @ { self, nix, nixpkgs, nixpkgs-stable, ... }: {
      colmena = {
        meta = {
          nixpkgs = import inputs.nixpkgs {
            system = "x86_64-linux";
          };
        };

        laptop = import ./laptop.nix;
        cm4 = import ./cm4.nix;
      };
    };
}

In cm4.nix, I have this:

inputs @ { config, pkgs, system, flakes, ... }: {
    imports = [
      ./configuration.nix
    ];
  
    nixpkgs.system = "aarch64-linux";
  };  

Any suggestions of what I'm doing wrong?

00:02:47
@raphi:tapesoftware.netraphi
In reply to @dmoonfire:matrix.org

Cross-platform question. I just got a Raspberry Pi and I'm trying to set it up, but right now colmena apply --on cm4 is pushing x86_64 binaries, instead of aarch64 ones. I figured I'm doing something wrong, just not sure what. This is a flake setup and I think the relevant lines are:

{
  outputs = inputs @ { self, nix, nixpkgs, nixpkgs-stable, ... }: {
      colmena = {
        meta = {
          nixpkgs = import inputs.nixpkgs {
            system = "x86_64-linux";
          };
        };

        laptop = import ./laptop.nix;
        cm4 = import ./cm4.nix;
      };
    };
}

In cm4.nix, I have this:

inputs @ { config, pkgs, system, flakes, ... }: {
    imports = [
      ./configuration.nix
    ];
  
    nixpkgs.system = "aarch64-linux";
  };  

Any suggestions of what I'm doing wrong?

try

          nixpkgs = import inputs.nixpkgs {
            system = "x86_64-linux";
            crossSystem = "aarch64-linux";
          };
13:01:20
@khalilsantana:matrix.org@khalilsantana:matrix.org left the room.17:41:25
@dmoonfire:matrix.orgdmoonfire raphi: Will that cause problems with my seven other x86-64 systems? I don't want to turn on binfmt for those. Right now, I have my laptop {x86), three homeland (x86), four remote (x86), and this new aarch64 (which will by x6 eventually). 18:55:03
@dmoonfire:matrix.orgdmoonfireAnd slight knowlege gap for me, does the same package (like file-5.44l have a different hash for x86 verses aarch64?18:58:58
@raphi:tapesoftware.netraphioh, if you have target systems with different arches this wouldn't work, right19:12:57
@dmoonfire:matrix.orgdmoonfire Yeah, I'm mostly in the x86_64 world, just trying to play with Raspberry Pi. Is there is something I can do with colmena.meta.nodeNixpkgs that would let me build on the x86 but for the aarch? I can make a run that all building has to be done on a x86 build server. 19:33:26
@dmoonfire:matrix.orgdmoonfireI'm also hoping to avoid cross compiling because Ceph takes ~6 hours to build normally.19:34:47
@dmoonfire:matrix.orgdmoonfireAnd I want to run Ceph on both the x86 servers and the aarch64. šŸ™‚19:35:34
22 Jan 2024
@mariosangiorgio:matrix.org@mariosangiorgio:matrix.org

Hello, I have a noob question: I am running NixOS in a LXC container. If I run colmena apply my changes (I added nginx) are applied fine.
If I reboot the container I cannot see nginx any longer until I run colmena apply again.
The docs says that the detail deployment goal is switch, which as far as I understand should persist after a reboot.

I’m very likely missing something obvious but I need some help :)

18:41:00
23 Jan 2024
@polygon:gaykitty.lolpolygon (she/it) - migrating to @polygon:catgirl.cloud āš”ļø changed their profile picture.18:44:38
@dtracy:matrix.orgdtracy joined the room.19:43:19
@dtracy:matrix.orgdtracy

I am trying to pass the home-manager nixosModule onto a colmena deployed node using the colmena.meta.specialArgs.inputs parameter and setting it equal to the inputs, as described here: https://discourse.nixos.org/t/colmena-how-to-push-a-flake-input-into-the-individual-nodes/36332/2

I keep getting an error during deployment error: The option inputs does not exist. Definition values: ...

I really would love to use home-manager with colmena to deploy all of my machines configurations.

You can see how I set this up in the flake.nix and users/testUser.nix files: https://github.com/tracyde/nixos-config

I would also welcome feedback on how I am starting to configure things, new to the nix ecosystem.

22:38:14
@dtrace:matrix.org@dtrace:matrix.org removed their display name Derek Tracy.22:39:09
@dtrace:matrix.org@dtrace:matrix.org left the room.22:39:09
@dtracy:matrix.orgdtracy dmoonfire: I would love your input as I got inspiration to try this from your previous post, how does what I have differ from what you have gotten to work? 22:42:39
24 Jan 2024
@dmoonfire:matrix.orgdmoonfireI use `inputs @ { nixpkgs, ... }` a lot. That means inputs has everything plus they are destructured into individual inputs with the {}.00:53:48
@dmoonfire:matrix.orgdmoonfireYou can also use { ... } @ bob if you prefer the @ at the end or want to use something other than "inputs"00:55:07
@dmoonfire:matrix.orgdmoonfireYou can also use specialArgs= { home-manager = home-manage; } if you don't want to use the @ either.00:57:17
@dmoonfire:matrix.orgdmoonfireNix, like Perl, has many ways to say the same thing. šŸ˜‹00:57:37
@sbc64:matrix.orgsbc64 joined the room.19:07:43
27 Jan 2024
@lehmanator:gnulinux.club@lehmanator:gnulinux.club removed their profile picture.16:55:31
@lehmanator:gnulinux.club@lehmanator:gnulinux.club removed their display name Sam Lehman.17:02:45
@lehmanator:gnulinux.club@lehmanator:gnulinux.club left the room.17:05:47
29 Jan 2024
@lehmanator:tchncs.deSam Lehman joined the room.11:00:30
@lehmanator:tchncs.deSam Lehman set a profile picture.11:06:02

Show newer messages


Back to Room ListRoom Version: 6