| 16 Nov 2022 |
@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 Optional joined the room. | 04:41:30 |
Chinchilla Optional | 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 Optional | just switching my flake directly works fine | 04:52:29 |
Chinchilla Optional | 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 Optional | 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 Optional | (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 Optional | 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 Optional | 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 Optional | 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 Optional | (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 Optional | Neither node works individually, if the other is deleted | 05:43:45 |
Chinchilla Optional | 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 Optional | ahhh okay | 05:55:21 |
Chinchilla Optional | 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 |
Chinchilla Optional | 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);
… while evaluating the module argument `zero' in "/nix/store/g7018b1j9a4qgrmd5xqx3qc5qilrfbs3-source/users/cw.nix":
… while evaluating anonymous lambda
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:494:44:
493| context = name: ''while evaluating the module argument `${name}' in "${key}":'';
494| extraArgs = builtins.mapAttrs (name: _:
| ^
495| builtins.addErrorContext (context name)
… from call site
… while evaluating 'isFunction'
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/trivial.nix:441:16:
440| */
441| isFunction = f: builtins.isFunction f ||
| ^
442| (f ? __functor && isFunction (f.__functor f));
… from call site
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:377:12:
376| loadModule = args: fallbackFile: fallbackKey: m:
377| if isFunction m || isAttrs m then
| ^
378| unifyModuleSyntax fallbackFile fallbackKey (applyModuleArgsIfFunction fallbackKey m args)
… while evaluating 'loadModule'
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:376:53:
375| # Like unifyModuleSyntax, but also imports paths and calls functions if necessary
376| loadModule = args: fallbackFile: fallbackKey: m:
| ^
377| if isFunction m || isAttrs m then
… from call site
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:417:22:
416| let
417| module = loadModule args parentFile "${parentKey}:anon-${toString n}" x;
| ^
418| collectedImports = collectStructuredModules module._file module.key module.imports args;
… while evaluating the attribute 'disabled'
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:412:13:
411| collectResults = modules: {
412| disabled = concatLists (catAttrs "disabled" modules);
| ^
413| inherit modules;
… while evaluating the attribute 'disabled'
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:412:13:
411| collectResults = modules: {
412| disabled = concatLists (catAttrs "disabled" modules);
| ^
413| inherit modules;
… while evaluating the attribute 'disabled'
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:412:13:
411| collectResults = modules: {
412| disabled = concatLists (catAttrs "disabled" modules);
| ^
413| inherit modules;
… while evaluating the attribute 'disabled'
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:412:13:
411| collectResults = modules: {
412| disabled = concatLists (catAttrs "disabled" modules);
| ^
413| inherit modules;
… while evaluating anonymous lambda
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:434:31:
433| disabledKeys = map moduleKey disabled;
434| keyFilter = filter (attrs: ! elem attrs.key disabledKeys);
| ^
435| in map (attrs: attrs.module) (builtins.genericClosure {
… from call site
… while evaluating 'filterModules'
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:430:36:
429| # modules recursively. It returns the final list of unique-by-key modules
430| filterModules = modulesPath: { disabled, modules }:
| ^
431| let
… from call site
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:441:7:
440| in modulesPath: initialModules: args:
441| filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);
| ^
442|
… while evaluating anonymous lambda
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:440:37:
439|
440| in modulesPath: initialModules: args:
| ^
441| filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);
… from call site
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:284:25:
283| merged =
284| let collected = collectModules
| ^
285| (specialArgs.modulesPath or "")
… while evaluating 'reverseList'
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/lists.nix:394:17:
393| */
394| reverseList = xs:
| ^
395| let l = length xs; in genList (n: elemAt xs (l - n - 1)) l;
… from call site
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:288:33:
287| ({ inherit lib options config specialArgs; } // specialArgs);
288| in mergeModules prefix (reverseList collected);
| ^
289|
… while evaluating 'byName'
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:555:25:
554| */
555| byName = attr: f: modules:
| ^
556| zipAttrsWith (n: concatLists)
… from call site
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:572:21:
571| # an attrset 'name' => list of submodules that declare ‘name’.
572| declsByName = byName "options" (module: option:
| ^
573| [{ inherit (module) _file; options = option; }]
… while evaluating the attribute 'matchedOptions'
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:651:14:
650| in {
651| inherit matchedOptions;
| ^
652|
… while evaluating 'mapAttrsRecursiveCond'
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/attrsets.nix:393:36:
392| */
393| mapAttrsRecursiveCond = cond: f: set:
| ^
394| let
… from call site
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:296:28:
295| # For definitions that have an associated option
296| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
| ^
297|
… while evaluating the attribute 'nodes.powerbook.config.deployment'
at /nix/store/zxdl289v07dxcsvwnb202sgmrv97b0nf-source/lib/modules.nix:363:9:
362| options = checked options;
363| config = checked (removeAttrs config [ "_module" ]);
| ^
364| _module = checked (config._module);
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ChildFailure { exit_code: 1 }', src/command/apply_local.rs:109:74
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
| 06:15:11 |
Chinchilla Optional | In reply to @zhaofeng:zhaofeng.li For those extra arguments, you either need to pass them in with _module.args or meta.specialArgs You answered my next question before I was even able ot ask it, hah | 06:15:36 |
Chinchilla Optional | that fixed it... but why? | 06:16:54 |