8 Feb 2025 |
WYVERN | * Hi, does anyone have any working example of using colmena in a flake with disko? Passing inputs via specialArgs = {inherit inputs;}; results in error: The option "inputs" does not exist. the minute I use it within a config; even though I've found other users with it working the same way: https://discourse.nixos.org/t/colmena-how-to-push-a-flake-input-into-the-individual-nodes/36332
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
disko.url = "github:nix-community/disko";
};
outputs = { nixpkgs, self, ... }@inputs: {
colmena = {
meta = {
nixpkgs = import nixpkgs {
system = "x86_64-linux";
};
specialArgs = {inherit inputs;};
};
test = import ./disks.nix;
};
};
}
{ inputs, ...}:
{
inputs.disko.devices = {
disk = {
main = {
device = "/dev/disk/by-id/some-disk-id";
type = "disk";
content = {
type = "gpt";
partitions = {
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
}
| 20:40:52 |
WYVERN | * Hi, does anyone have any working example of using colmena in a flake with disko? Passing inputs via specialArgs = {inherit inputs;}; results in error: The option "inputs" does not exist. the minute I use it within a config; even though I've found other users with it working the same way: https://discourse.nixos.org/t/colmena-how-to-push-a-flake-input-into-the-individual-nodes/36332
As a minimum config:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
disko.url = "github:nix-community/disko";
};
outputs = { nixpkgs, self, ... }@inputs: {
colmena = {
meta = {
nixpkgs = import nixpkgs {
system = "x86_64-linux";
};
specialArgs = {inherit inputs;};
};
test = import ./disks.nix;
};
};
}
{ inputs, ...}:
{
inputs.disko.devices = {
disk = {
main = {
device = "/dev/disk/by-id/some-disk-id";
type = "disk";
content = {
type = "gpt";
partitions = {
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
}
| 20:41:47 |
WYVERN | judging from others in this chat also using disko, I think at some point a template in the docs would be good, otherwise a point about incompatibility to save time | 20:42:32 |
9 Feb 2025 |
| @tired:fairydust.space left the room. | 22:50:18 |
10 Feb 2025 |
| PuercoPop joined the room. | 00:44:43 |
| Bryan joined the room. | 19:39:12 |
11 Feb 2025 |
| @oliverpool:envs.net left the room. | 19:21:24 |
12 Feb 2025 |
| marshmallow changed their profile picture. | 01:31:25 |
13 Feb 2025 |
| gmacon joined the room. | 15:14:36 |
15 Feb 2025 |
| BenjB83 joined the room. | 10:17:41 |
| BenjB83 changed their display name from Benjamín Buske to BenjB83. | 10:43:17 |
17 Feb 2025 |
| prroet joined the room. | 19:22:46 |
18 Feb 2025 |
| Unit 1721344 [polygon] (it/its, es/ihr) changed their profile picture. | 13:02:08 |
19 Feb 2025 |
| pcarrier joined the room. | 06:44:26 |
pcarrier | Redacted or Malformed Event | 06:45:07 |
pcarrier | * It is not out of the question that I might be stupid…
pcarrier@cat ~/s/m/multiverse (pcarrier/nix) [1]> ls *.nix
.rw-r--r--@ 3.1k pcarrier 19 Feb 07:43 -N flake.nix
pcarrier@cat ~/s/m/multiverse (pcarrier/nix)> colmena apply
warning: Git tree '/Users/pcarrier/src/monorepo' is dirty
error: path '/nix/store/m2y56rx0qaiylbsg0prbjd1ah5lzfwb3-source/multiverse/flake.nix' does not exist
[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
| 06:45:25 |
pcarrier | * It is not out of the question that I might be stupid… What gives?
pcarrier@cat ~/s/m/multiverse (pcarrier/nix) [1]> ls *.nix
.rw-r--r--@ 3.1k pcarrier 19 Feb 07:43 -N flake.nix
pcarrier@cat ~/s/m/multiverse (pcarrier/nix)> colmena apply
warning: Git tree '/Users/pcarrier/src/monorepo' is dirty
error: path '/nix/store/m2y56rx0qaiylbsg0prbjd1ah5lzfwb3-source/multiverse/flake.nix' does not exist
[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
| 06:45:35 |
pcarrier | Any way to set custom attributes on my nodes, that I could then consume from the default config? | 12:53:52 |
kevinpthorne | https://nixos.wiki/wiki/NixOS_modules | 12:56:22 |
pcarrier | I'm not quite sure how to apply this here | 13:00:08 |
pcarrier | defaults = { foo = lib.mkOption { … } };
host = { foo = bar; }
doesn't work right?
| 13:00:56 |
pcarrier | ah, got it, thanks | 13:30:27 |
| @thesimplekid:matrix.org left the room. | 14:49:23 |
| sako -w- joined the room. | 18:13:40 |
pcarrier | Been stuck for a while with this error: https://gist.github.com/pcarrier/bc0173d20106cd178707f1955a1dafd8 | 19:19:35 |
pcarrier | Any ideas would be much appreciated | 19:19:40 |
gmacon | Looks like you need enable = config.roles ? etcd; since on the non-etcd hosts, config.roles will be an attrset that does not contain an etcd key, so you can't get the value of that key. Another option would be to ensure that roles always contains every possible role, but set to false for the roles this host doesn't have. | 20:18:22 |
pcarrier | well I thought I did exactly that through its default value | 20:19:22 |
pcarrier | options = {
roles = mkOption {
type = types.attrsOf types.bool;
default = {
bastion = false;
spawner = false;
etcd = false;
webserver = false;
};
};
};
| 20:20:05 |
pcarrier | that's OK, I'll switch to a single role per box | 20:22:35 |