!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

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

Load older messages


SenderMessageTime
1 Sep 2024
@khalil:ksantana.netKhalil Santana joined the room.12:47:46
@khalil:ksantana.netKhalil Santana

Hi, can anyone provide me a full working example of a colmena hive.nix for deploying a single host? Unfortunately, the documentation hasn't been of much help since it doesn't describe which flake to use for a host, etc.

Currently my hive.nix is this:

{
  # description = "A NixOS configuration using Flakes";

  inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; };
  outputs = { self, nixpkgs, ... }:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs { inherit system; };
    in {
      # packages.${system} = { default = pkgs.callPackage ./default.nix { }; };
      colmena = {
        meta = {
          nixpkgs = import nixpkgs {
            system = "x86_64-linux";
            overlays = [ ];
          };
        };
        # nixosConfigurations = {
        andromeda = {
          system = "x86_64-linux";
          imports = [ ./hosts/andromeda/andromeda.nix ];
          deployment.targetHost = "andromeda";
        };
        # };
      };
    };
}

Which gives me errors:

[nix-shell:~/Documentos/NixOS]$ : 1725162633:0;colmena apply 
[INFO ] Using configuration: /home/khalil/Documentos/NixOS/hive.nix
[INFO ] Enumerating nodes...
error:
       … while evaluating attribute 'inputs'

         at /nix/store/3m9sp0j8i8032nin10vbfm548q1brlb7-nixos-24.05/nixos/lib/attrsets.nix:984:14:

          983|     value:
          984|     { inherit name value; };
             |              ^
          985|

       … while evaluating the attribute 'config.deployment'

         at /nix/store/3m9sp0j8i8032nin10vbfm548q1brlb7-nixos-24.05/nixos/lib/modules.nix:322:9:

          321|         options = checked options;
          322|         config = checked (removeAttrs config [ "_module" ]);
             |         ^
          323|         _module = checked (config._module);

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `nixpkgs.url' does not exist. Definition values:
       - In `/tmp/colmena-assets-l0SXJi/eval.nix': "github:NixOS/nixpkgs/nixos-unstable"
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
Hint: Backtrace available - Use `RUST_BACKTRACE=1` environment variable to display a backtrace
12:52:50
@ibizaman:matrix.orgibizaman
In reply to @khalil:ksantana.net

Hi, can anyone provide me a full working example of a colmena hive.nix for deploying a single host? Unfortunately, the documentation hasn't been of much help since it doesn't describe which flake to use for a host, etc.

Currently my hive.nix is this:

{
  # description = "A NixOS configuration using Flakes";

  inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; };
  outputs = { self, nixpkgs, ... }:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs { inherit system; };
    in {
      # packages.${system} = { default = pkgs.callPackage ./default.nix { }; };
      colmena = {
        meta = {
          nixpkgs = import nixpkgs {
            system = "x86_64-linux";
            overlays = [ ];
          };
        };
        # nixosConfigurations = {
        andromeda = {
          system = "x86_64-linux";
          imports = [ ./hosts/andromeda/andromeda.nix ];
          deployment.targetHost = "andromeda";
        };
        # };
      };
    };
}

Which gives me errors:

[nix-shell:~/Documentos/NixOS]$ : 1725162633:0;colmena apply 
[INFO ] Using configuration: /home/khalil/Documentos/NixOS/hive.nix
[INFO ] Enumerating nodes...
error:
       … while evaluating attribute 'inputs'

         at /nix/store/3m9sp0j8i8032nin10vbfm548q1brlb7-nixos-24.05/nixos/lib/attrsets.nix:984:14:

          983|     value:
          984|     { inherit name value; };
             |              ^
          985|

       … while evaluating the attribute 'config.deployment'

         at /nix/store/3m9sp0j8i8032nin10vbfm548q1brlb7-nixos-24.05/nixos/lib/modules.nix:322:9:

          321|         options = checked options;
          322|         config = checked (removeAttrs config [ "_module" ]);
             |         ^
          323|         _module = checked (config._module);

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `nixpkgs.url' does not exist. Definition values:
       - In `/tmp/colmena-assets-l0SXJi/eval.nix': "github:NixOS/nixpkgs/nixos-unstable"
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
Hint: Backtrace available - Use `RUST_BACKTRACE=1` environment variable to display a backtrace
I never used hive.nix but at first glance your snippet looks more like a flake.nix ?
13:26:52
3 Sep 2024
@mfossen:matrix.orgMitch joined the room.02:03:00
@toloktir:matrix.orgtoloktir joined the room.20:55:53
4 Sep 2024
@lychee:wires.cafelychee removed their profile picture.02:52:16
@lychee:wires.cafelychee set a profile picture.02:52:20
5 Sep 2024
@lingo5080:matrix.orglingo5080 joined the room.15:52:08
12 Sep 2024
@tcurdt:matrix.orgtcurdt

I am bit lost trying to get colmena working. Especially the meta is a bit of mystery

      colmena = {
        meta = {
          nixpkgs = nixpkgs-stable;
          # nixpkgs = import nixpkgs-stable {
          #   system = "x86_64-linux";
          #   overlays = [];
          # };
          # nixpkgs = <nixpkgs-stable>;
          # nixpkgs = import <nixpkgs-stable> {
          #   system = "x86_64-linux";
          #   overlays = [];
          # };
          # specialArgs = { inherit inputs; };
        };

        utm-arm = import self.nixosConfigurations.utm-arm {
          deployment = {
15:49:19
@tcurdt:matrix.orgtcurdtwhy would one specify the nixpkgs system in meta?15:50:18
@raitobezarius:matrix.orgraitobezariusYou can specify it for cross compilation for example16:58:55
16 Sep 2024
@galaxyyy:matrix.orgSaturn joined the room.18:33:55
@silentlurker:matrix.orgsilentlurker joined the room.20:02:25
17 Sep 2024
@tomherbers:matrix.orgTom (deprecated) joined the room.21:04:44
22 Sep 2024
@moira:raccoon.college@moira:raccoon.college removed their profile picture.10:26:59
@moira:raccoon.college@moira:raccoon.college changed their display name from Moira to Moira (moving to @moira:omg.lol).10:27:21
26 Sep 2024
@fabianhjr:matrix.orgFabián Heredia set a profile picture.01:16:01
29 Sep 2024
@firethorn123:matrix.orgMartin Kuhn joined the room.07:14:47
@firethorn123:matrix.orgMartin KuhnI think you can also specify per node if it helps :) https://colmena.cli.rs/unstable/reference/meta.html?highlight=meta#nodespecialargs07:17:11
@firethorn123:matrix.orgMartin Kuhnstill in the meta though07:17:35
@firethorn123:matrix.orgMartin KuhnDoes anyone know if colmena currently works with disko for an initial install? Got a few pi's I need to install manually :( 07:20:20
@craige:mcwhirter.iocraigeI don't know but I normally build an SD image from my configs, write it SD and plug that in as my initial deployment.21:45:16
30 Sep 2024
@dantefromhell:matrix.orgdantefromhelli'm doing initial installs of rpis with nixos-anywhere because of its disko integration. Not sure if/how one implement that in colmena - nixos-anywhere runs the whole partitioning -> formatting FSs -> install OS via a shell script on the destination01:14:00
@moira:raccoon.college@moira:raccoon.college left the room.19:45:19
1 Oct 2024
@-_o:matrix.org-_o joined the room.21:05:20
4 Oct 2024
@test-user:c.imperishable.namerendakuenthusiast⚡️ left the room.10:20:09
@test-user:c.imperishable.namerendakuenthusiast⚡️ joined the room.10:22:27
6 Oct 2024
@ser:sergevictor.euser(ial)why colmena does not have an option to delete old garbage?04:37:03
@dstengele:pango.placeDennis StengeleI have just configured automatic gc in the default node config:13:00:29
@dstengele:pango.placeDennis Stengeleimage.png
Download image.png
13:00:31

Show newer messages


Back to Room ListRoom Version: 6