| 16 Nov 2022 |
@yuka:yuka.dev | I would really support it if the actual deployment commands/logic for NixOS and non-NixOS was just part of a NixOS module system thing | 16:23:57 |
@yuka:yuka.dev | So that the cli is a dumb task runner | 16:24:04 |
@yuka:yuka.dev | basically a parallel version of nix run .#nixosConfigurations.xyz.config.system.build.deployScript | 16:24:27 |
@yuka:yuka.dev | And 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 deployment | 16:24:56 |
@yuka:yuka.dev | * basically a parallel version of nix run .#nixosConfigurations.xyz.config.system.build.deployScript | 16:25:07 |
| @omlet:matrix.org joined the room. | 20:34:25 |
| 17 Nov 2022 |
| shapr joined the room. | 22:14:10 |
| 20 Nov 2022 |
| Chinchilla Washington joined the room. | 04:41:30 |
Chinchilla 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 |
Chinchilla Washington | just switching my flake directly works fine | 04:52:29 |
Chinchilla Washington | Any ideas? | 04:52:32 |
Zhaofeng Li | What does the config look like? | 05:34:10 |
Zhaofeng Li | * Chinchilla Washington: What does the config look like? | 05:34:34 |
Chinchilla 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 |
Chinchilla 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 |
Chinchilla 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 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 |
Chinchilla 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 |
Chinchilla 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 |
Chinchilla Washington | (deleted extraneous allowLocalDeployment) | 05:42:18 |
Zhaofeng Li | It may be from the other two nodes | 05:42:24 |
Zhaofeng Li | * It may be from the other node | 05:42:41 |
Chinchilla Washington | Neither node works individually, if the other is deleted | 05:43:45 |
Chinchilla 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 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 Li | Colmena itself doesn't look at nixosConfigurations at all, so nixos-rebuild succeeding isn't really relevant. | 05:50:27 |
Chinchilla Washington | ahhh okay | 05:55:21 |
Chinchilla 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 Li | --show-trace? | 06:13:17 |
Zhaofeng 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 |