!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

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

Load older messages


SenderMessageTime
16 Nov 2022
@yuka:yuka.dev@yuka:yuka.devI would really support it if the actual deployment commands/logic for NixOS and non-NixOS was just part of a NixOS module system thing16:23:57
@yuka:yuka.dev@yuka:yuka.devSo that the cli is a dumb task runner16:24:04
@yuka:yuka.dev@yuka:yuka.dev basically a parallel version of nix run .#nixosConfigurations.xyz.config.system.build.deployScript 16:24:27
@yuka:yuka.dev@yuka:yuka.devAnd nix-darwin or nixos containers or completely custom targets can set this deployScript option in their nixos module system to override what happens on a deployment16:24:56
@yuka:yuka.dev@yuka:yuka.dev * basically a parallel version of nix run .#nixosConfigurations.xyz.config.system.build.deployScript 16:25:07
@omlet:matrix.org@omlet:matrix.org joined the room.20:34:25
17 Nov 2022
@shapr:cofree.coffeeshapr joined the room.22:14:10
20 Nov 2022
@cw:kernelpanic.cafeChinchilla Washington joined the room.04:41:30
@cw:kernelpanic.cafeChinchilla Washington

Colmena is throwing this error message when I try to deploy a flake:

[ERROR]   stderr)        Failed assertions:
[ERROR]   stderr)        - The ‘fileSystems’ option does not specify your root file system.
[ERROR]   stderr)        - You must set the option ‘boot.loader.grub.devices’ or 'boot.loader.grub.mirroredBoots' to make the system bootable.

But the root filesystem is specified. I tried setting it directly in the colmena block like git shows and it's still complaining

04:51:24
@cw:kernelpanic.cafeChinchilla Washingtonjust switching my flake directly works fine04:52:29
@cw:kernelpanic.cafeChinchilla WashingtonAny ideas?04:52:32
@zhaofeng:zhaofeng.liZhaofeng LiWhat does the config look like?05:34:10
@zhaofeng:zhaofeng.liZhaofeng Li* Chinchilla Washington: What does the config look like?05:34:34
@cw:kernelpanic.cafeChinchilla Washington
In reply to @zhaofeng:zhaofeng.li
Chinchilla Washington: What does the config look like?

flake.nix

{
  description = "the simplest flake for nixos-rebuild";

  inputs = {
    nixpkgs = {
      # Using the nixos-unstable branch specifically, which is the
      # closest you can get to following the channel with flakes.
      url = "github:NixOS/nixpkgs/nixos-22.05";
    };
    # inputs.emacs-overlay.url = "github:nix-community/emacs-overlay";
    # inputs.coricamu.url = "github:danth/coricamu";
    unstable.url = "github:nixos/nixpkgs/nixos-unstable";
    zero = {
      url = "git+file:/home/cw/0x00";
      # url = "git+https://gitea.kernelpanic.cafe/cw/0x00";
      flake = false;
    };
    nix-doom-emacs = {
      url = "github:nix-community/nix-doom-emacs";
    };
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "unstable";
    };
    # alfis.url = "github:Revertron/Alfis";
    sops-nix.url = "github:Mic92/sops-nix";
    stylix.url = "github:danth/stylix";
    deploy-rs.url = "github:serokell/deploy-rs";
  };

  # Outputs can be anything, but the wiki + some commands define their own
  # specific keys. Wiki page: https://nixos.wiki/wiki/Flakes#Output_schema
  outputs = {
    self,
    nixpkgs,
    unstable,
    home-manager,
    stylix,
    nix-doom-emacs,
    # alfis,
    sops-nix,
    # colmena,
    ...
  } @inputs: {
    # packages."x86_64-linux".powerbook = "powerbook";
    nixosConfigurations = {
      powerbook = unstable.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = inputs;
        # Import our old system configuration.nix
        modules = [
          ./hosts/powerbook.nix
          home-manager.nixosModules.home-manager
          stylix.nixosModules.stylix
          sops-nix.nixosModules.sops
        ];
      };
      telescreen = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = inputs;
        # Import our old system configuration.nix
        modules = [
          ./hosts/telescreen.nix
          home-manager.nixosModules.home-manager
          stylix.nixosModules.stylix
        ];
      };
    };
    colmena = {
      meta = {
        nixpkgs = import nixpkgs {
          system = "x86_64-linux";
          overlays = [];
        };
      };
      powerbook = {
        deployment = {
          allowLocalDeployment = true;
          targetHost = null;
        };
      };
      telescreen = {
        deployment = {
          allowLocalDeployment = true;
          targetHost = "10.200.1.35";
        };
      };
      # boot.loader.grub.device = "/dev/disk/by-uuid/4864-3681";
      # fileSystems."/" = {
      #   device = "/dev/disk/by-uuid/cbc949e8-303e-405a-97e1-6fcf7df3fdea";
      #   fsType = "ext4";
      # };
    };
  };
}
05:38:47
@cw:kernelpanic.cafeChinchilla Washington(I'm trying to deploy on telescreen, but powerbook and deploy-local was used as a sanity check and it reports the same two errors)05:39:17
@cw:kernelpanic.cafeChinchilla Washington

Relevant part of telescreen.nix:

{ pkgs, config, lib, unstable, zero, alfis, sops, ... }:
{
  imports = [
    ../hardware/telescreen.nix
    ../hardware/wifi.nix
    "${zero}/profiles/syncthing.nix"
  ];
05:40:23
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @cw:kernelpanic.cafe

flake.nix

{
  description = "the simplest flake for nixos-rebuild";

  inputs = {
    nixpkgs = {
      # Using the nixos-unstable branch specifically, which is the
      # closest you can get to following the channel with flakes.
      url = "github:NixOS/nixpkgs/nixos-22.05";
    };
    # inputs.emacs-overlay.url = "github:nix-community/emacs-overlay";
    # inputs.coricamu.url = "github:danth/coricamu";
    unstable.url = "github:nixos/nixpkgs/nixos-unstable";
    zero = {
      url = "git+file:/home/cw/0x00";
      # url = "git+https://gitea.kernelpanic.cafe/cw/0x00";
      flake = false;
    };
    nix-doom-emacs = {
      url = "github:nix-community/nix-doom-emacs";
    };
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "unstable";
    };
    # alfis.url = "github:Revertron/Alfis";
    sops-nix.url = "github:Mic92/sops-nix";
    stylix.url = "github:danth/stylix";
    deploy-rs.url = "github:serokell/deploy-rs";
  };

  # Outputs can be anything, but the wiki + some commands define their own
  # specific keys. Wiki page: https://nixos.wiki/wiki/Flakes#Output_schema
  outputs = {
    self,
    nixpkgs,
    unstable,
    home-manager,
    stylix,
    nix-doom-emacs,
    # alfis,
    sops-nix,
    # colmena,
    ...
  } @inputs: {
    # packages."x86_64-linux".powerbook = "powerbook";
    nixosConfigurations = {
      powerbook = unstable.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = inputs;
        # Import our old system configuration.nix
        modules = [
          ./hosts/powerbook.nix
          home-manager.nixosModules.home-manager
          stylix.nixosModules.stylix
          sops-nix.nixosModules.sops
        ];
      };
      telescreen = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = inputs;
        # Import our old system configuration.nix
        modules = [
          ./hosts/telescreen.nix
          home-manager.nixosModules.home-manager
          stylix.nixosModules.stylix
        ];
      };
    };
    colmena = {
      meta = {
        nixpkgs = import nixpkgs {
          system = "x86_64-linux";
          overlays = [];
        };
      };
      powerbook = {
        deployment = {
          allowLocalDeployment = true;
          targetHost = null;
        };
      };
      telescreen = {
        deployment = {
          allowLocalDeployment = true;
          targetHost = "10.200.1.35";
        };
      };
      # boot.loader.grub.device = "/dev/disk/by-uuid/4864-3681";
      # fileSystems."/" = {
      #   device = "/dev/disk/by-uuid/cbc949e8-303e-405a-97e1-6fcf7df3fdea";
      #   fsType = "ext4";
      # };
    };
  };
}
Colmena itself doesn't use nixosSystems and you need to define the system configurations in outputs.colmena.<name>
05:40:42
@cw:kernelpanic.cafeChinchilla Washington
In reply to @zhaofeng:zhaofeng.li
Colmena itself doesn't use nixosSystems and you need to define the system configurations in outputs.colmena.<name>
lines 82-84
05:41:15
@cw:kernelpanic.cafeChinchilla Washington
In reply to @zhaofeng:zhaofeng.li
Colmena itself doesn't use nixosSystems and you need to define the system configurations in outputs.colmena.<name>
* lines 82-87
05:41:25
@cw:kernelpanic.cafeChinchilla Washington (deleted extraneous allowLocalDeployment) 05:42:18
@zhaofeng:zhaofeng.liZhaofeng LiIt may be from the other two nodes05:42:24
@zhaofeng:zhaofeng.liZhaofeng Li* It may be from the other node05:42:41
@cw:kernelpanic.cafeChinchilla WashingtonNeither node works individually, if the other is deleted05:43:45
@cw:kernelpanic.cafeChinchilla Washington powerbook works just fine when I run sudo nixos-rebuild switch --flake .#powerbook but I get ^ error on colmena apply-local --node powerbook --sudo 05:44:33
@zhaofeng:zhaofeng.liZhaofeng Li

It's supposed to look something like:

telescreen = {
  imports = [
    ./hosts/powerbook.nix
    home-manager.nixosModules.home-manager
    # ...
  ];
  deployment = {
    allowLocalDeployment = true;
    targetHost = "10.200.1.35";
  };
};
05:49:40
@zhaofeng:zhaofeng.liZhaofeng Li Colmena itself doesn't look at nixosConfigurations at all, so nixos-rebuild succeeding isn't really relevant. 05:50:27
@cw:kernelpanic.cafeChinchilla Washingtonahhh okay05:55:21
@cw:kernelpanic.cafeChinchilla Washington
error: infinite recursion encountered

       at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:496:28:

          495|         builtins.addErrorContext (context name)
          496|           (args.${name} or config._module.args.${name})
             |                            ^
          497|       ) (lib.functionArgs f);
05:56:48
@zhaofeng:zhaofeng.liZhaofeng Li --show-trace? 06:13:17
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @cw:kernelpanic.cafe

Relevant part of telescreen.nix:

{ pkgs, config, lib, unstable, zero, alfis, sops, ... }:
{
  imports = [
    ../hardware/telescreen.nix
    ../hardware/wifi.nix
    "${zero}/profiles/syncthing.nix"
  ];
For those extra arguments, you either need to pass them in with _module.args or meta.specialArgs
06:13:47

Show newer messages


Back to Room ListRoom Version: 6