!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

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

Load older messages


SenderMessageTime
13 Feb 2022
@grw00:matrix.orggrw002.613:41:31
@grw00:matrix.orggrw00
In reply to @schnecfk:ruhr-uni-bochum.de
Do you want to use a "shim" to populate outputs.colmena from outputs.nixosConfigurations?
yeah i thought maybe i had to do this, wasn't sure if it was necessary and i just didnt use right command
13:42:10
@schnecfk:ruhr-uni-bochum.deCRTified

iirc Buckley changed the approach for the shim, while I found the following solution.
In the flake.nix, I populate colmena from nixosConfigurations.

      colmena = {
        meta = {
          description = "My personal machines";
          nixpkgs = import nixpkgs {
            system = "x86_64-linux";
            overlays = [ nur.overlay ];
          };
        };

      } // builtins.mapAttrs (name: value: {
        nixpkgs.system = value.config.nixpkgs.system;
        imports = value._module.args.modules;
      }) (self.nixosConfigurations);

But to have the deployment options available (and not conflicting with colmena), I had to add:

        extraModules = [ colmena.nixosModules.deploymentOptions ];

in the nixpkgs.lib.nixosSystem call

13:44:22
@schnecfk:ruhr-uni-bochum.deCRTified extraModules is not part of value._module.args.modules, so you retain the ability to nixos-rebuild --flake .#hostname build, while also being able to deploy with colmena 13:45:16
@schnecfk:ruhr-uni-bochum.deCRTified *

iirc Buckley changed the approach for the shim, while I found the following solution.
In the flake.nix, I populate colmena from nixosConfigurations.

      colmena = {
        meta = {
          description = "My personal machines";
          nixpkgs = import nixpkgs {
            system = "x86_64-linux";
            overlays = [ nur.overlay ];
          };
        };

      } // builtins.mapAttrs (name: value: {
        nixpkgs.system = value.config.nixpkgs.system;
        imports = value._module.args.modules;
      }) (self.nixosConfigurations);

But to have the deployment options available (and not conflicting with colmena), I had to add this (note that you'd typically use the argument modules):

        extraModules = [ colmena.nixosModules.deploymentOptions ];

in the nixpkgs.lib.nixosSystem call

13:45:44
@grw00:matrix.orggrw00perfect- thanks !13:56:59
14 Feb 2022
@heph:matrix.orgheph joined the room.20:14:58
15 Feb 2022
@finn:sunbutt.faithfinn joined the room.20:41:24
@finn:sunbutt.faithfinn left the room.20:41:33
16 Feb 2022
@github:maunium.net@github:maunium.net [zhaofengli/colmena] zhaofengli synchronize pull request #58: streaming evaluator: respect eval-nodes-limit 09:10:45
@github:maunium.net@github:maunium.net [zhaofengli/colmena] zhaofengli merged pull request #58: streaming evaluator: respect eval-nodes-limit 09:10:54
@github:maunium.net@github:maunium.net [zhaofengli/colmena] zhaofengli merged pull request #51: eval.nix: Add "${name}-key.service" units for keys 18:23:29
@github:maunium.net@github:maunium.net [zhaofengli/colmena] zhaofengli closed issue #48: Add `${name}-key.service` unit files for `deployment.keys` entries 18:23:30
18 Feb 2022
@cw:kernelpanic.cafeChinchilla Wetreat changed their display name from Chuck Winter to Chuck Winter (vi/vim).04:12:20
@cw:kernelpanic.cafeChinchilla Wetreat changed their display name from Chuck Winter (vi/vim) to Chuck Winter.04:20:45
19 Feb 2022
@github:maunium.net@github:maunium.net [zhaofengli/colmena] lheckemann opened issue #59: add --no-substitute option

Nix itself accepts the option --no-substitute, while colmena's similar option is called --no-substitutes. This is unnecessarily confusing, and renaming the option would resolve this.

16:32:57
@github:maunium.net@github:maunium.net [zhaofengli/colmena] cole-h closed pull request #56: WIP: add deployment.nixpkgs option 19:05:24
21 Feb 2022
@cw:kernelpanic.cafeChinchilla Wetreat changed their display name from Chuck Winter to Chinchilla Wetreat.00:47:29
@github:maunium.net@github:maunium.net [zhaofengli/colmena] tv42 opened issue #60: Using nixosSystem? Flake future?

Hi. It seems mainstream NixOS is heading toward using nixpkgs.lib.nixosSystem, and standard ways of defining nixos hosts in a flake.nix: https://nixos.wiki/wiki/Flakes#Using_nix_flakes_with_NixOS

Any thoughts on integrating with that world with colmena? I'm keen to keep my configuration as close to "mainstream" as I can, while using remote deploys (some of my hosts are definitely too weak to build themselves).

It seems mainstream NixOS is getting remote deploys too: nixos-rebuild --flake .#mymachine --target-host mymachine-hostname --build-host localhost switch

20:06:05
22 Feb 2022
@n0emis:noemis.men0emis Os there a easy way to acces the merged nixos-config, e.g. to build a vm with it (via nixos-rebuild build-vm or something like it)? 15:41:28
@n0emis:noemis.men0emis * Is there a easy way to acces the merged nixos-config, e.g. to build a vm with it (via nixos-rebuild build-vm or something like it)? 15:42:39
@schnecfk:ruhr-uni-bochum.deCRTified
In reply to @n0emis:noemis.me
Is there a easy way to acces the merged nixos-config, e.g. to build a vm with it (via nixos-rebuild build-vm or something like it)?
In the end, you "just" need to evaluate the configuration and get the derivation at the attribute path config.system.build.vm from that evaluation 🙂
15:45:21
@schnecfk:ruhr-uni-bochum.deCRTifiedAs far as I can tell, it's easier with flakes if you use a helper function as I've documented here: https://github.com/zhaofengli/colmena/issues/60#issuecomment-104719955115:46:11
@schnecfk:ruhr-uni-bochum.deCRTified If you do so, you can access the evaluated configuration within the packages output of the flake - for example, you can reference self.nixosConfigurations.HOSTNAME.config.system.build.vm and add it to the packages attrset 15:47:10
@schnecfk:ruhr-uni-bochum.deCRTified * If you do so, you can access the evaluated configuration within the packages output of the flake - for example, you can reference self.nixosConfigurations.HOSTNAME.config.system.build.vm and add it to the packages attrset (I'm doing something similar to build aarch64 sd-images) 15:47:36
@schnecfk:ruhr-uni-bochum.deCRTifiedFor non-flakes configs, you could just eval-config and get that attribute out of the result, check https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/eval-config.nix for that. But that's probably a bit out of scope for the colmena channel, as it only relies on nixpkgs 🙂15:56:08
23 Feb 2022
@github:maunium.net@github:maunium.net [zhaofengli/colmena] utsl42 opened issue #61: override deployment.targetUser in CLI

Could we have a CLI argument or environment variable to override the deployment.targetUser? Useful in cases where the remote user isn't the same, but someone else might need to use a different username to deploy, so setting it in the Nix configuration isn't helpful.

19:42:46
2 Mar 2022
@phaer:matrix.orgPaul Haerle set a profile picture.13:09:06
@phaer:matrix.orgPaul Haerle changed their display name from phaer to Paul Haerle.13:09:24
6 Mar 2022
@winterqt:nixos.devWinter (she/her) there's no way to parallelize/improve the efficiency of the copying path ... to ... stage when using buildOnTarget, right? 18:42:57

There are no newer messages yet.


Back to Room ListRoom Version: 6