| 6 Mar 2024 |
| @sammy:cherrykitten.dev joined the room. | 19:05:26 |
| 7 Mar 2024 |
| DrEtrange joined the room. | 14:09:36 |
| 10 Mar 2024 |
| Bonus joined the room. | 12:48:17 |
| 13 Mar 2024 |
| @ktemkin:katesiria.org changed their display name from Kate Temkin to [K]ate Temkin. | 02:56:13 |
| 14 Mar 2024 |
| @federicodschonborn:matrix.org left the room. | 02:04:46 |
| NixOS Moderation Botchanged room power levels. | 18:44:59 |
| 15 Mar 2024 |
pgibson | Does Colmena (or NixOS) support automatic rollback for failed deployments? I had a deploy hang during testing (possible the SSH connection was interrupted) and I had to reboot the server | 04:02:47 |
pgibson | SSH was down and I hadn't configured a password to log in via the console | 04:03:23 |
emily | no, see https://github.com/zhaofengli/colmena/issues/38 | 04:08:18 |
pgibson | Thanks | 04:09:39 |
@sammy:cherrykitten.dev | is there a way to build a VM from a colmena node config without duplicating the node config into an extra nixos configuration output (in a flake)? | 17:23:01 |
@sammy:cherrykitten.dev | so uh, an equivalent to nixos-rebuild build-vm | 17:23:54 |
| @grahamc:nixos.org joined the room. | 23:05:21 |
| 17 Mar 2024 |
tcurdt | I have my hosts setup like this:
nixosConfigurations = {
utm = import ./machines/utm.nix {};
I really don't get the example config:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { nixpkgs, ... }: {
colmena = {
meta = {
nixpkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [];
};
};
host-a = { name, nodes, pkgs, ... }: {
boot.isContainer = true;
time.timeZone = nodes.host-b.config.time.timeZone;
};
host-b = {
deployment = {
targetHost = "somehost.tld";
targetPort = 1234;
targetUser = "luser";
};
boot.isContainer = true;
time.timeZone = "America/Los_Angeles";
};
};
};
}
No nixosConfigurations?
| 00:35:19 |
hexa | colmena is a specific output that does not provide nixosConfigurations | 00:59:12 |
hexa | but you can create nixosConfigurations and transform them into colmena outputs | 00:59:25 |
hexa | e.g. https://github.com/zhaofengli/colmena/issues/60#issuecomment-1047199551 | 00:59:53 |
tcurdt | Urgh. That looks quite complicated. Hoping this would work feels naiv now
colema = {
meta = {};
utm = {
deployment = {
targetHost = "192.168.71.3";
targetUser = "root";
};
};
utm = self.nixosConfigurations.utm // {
deployment = {
targetHost = "192.168.71.3";
targetUser = "root";
};
};
};
| 01:13:12 |
tcurdt | * Urgh. That looks quite complicated. Hoping this would work feels naiv now
colema = {
meta = {};
utm = self.nixosConfigurations.utm // {
deployment = {
targetHost = "192.168.71.3";
targetUser = "root";
};
};
};
| 01:16:51 |
| 18 Mar 2024 |
dmoonfire | I struggle a lot translating those two concepts. Mostly I use a lot if Just file to handle what I couldn't figure out on my own.
And trying to get home-manager into colmena took me months to puzzle out. | 02:23:17 |
tcurdt | In reply to @dmoonfire:matrix.org I struggle a lot translating those two concepts. Mostly I use a lot if Just file to handle what I couldn't figure out on my own.
And trying to get home-manager into colmena took me months to puzzle out. Not good. | 12:34:33 |
| 19 Mar 2024 |
| NixOS Moderation Botchanged room power levels. | 00:30:23 |
dmoonfire | Its only been eighteen months if daily driving Nix. I'm sure in another couple years and I'll have it down. | 01:03:27 |
emily | In reply to @hexa:lossy.network but you can create nixosConfigurations and transform them into colmena outputs you can also specify colmena as a flake input and pass your colmenaHive attrset to nixosConfiguration, one sec | 01:21:22 |
emily | take this slightly modified example from https://github.com/zhaofengli/colmena/blob/v0.4.0/src/nix/hive/tests/makehive-flake/flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
colmena.url = "github:zhaofengli/colmena";
};
outputs = { nixpkgs, colmena, ... }: rec {
colmenaHive = colmena.lib.makeHive {
meta = {
nixpkgs = import nixpkgs {
system = "x86_64-linux";
};
};
host-a = { name, nodes, pkgs, ... }: {
boot.isContainer = true;
time.timeZone = nodes.host-b.config.time.timeZone;
};
host-b = {
deployment = {
targetHost = "somehost.tld";
targetPort = 1234;
targetUser = "luser";
};
boot.isContainer = true;
time.timeZone = "America/Los_Angeles";
};
};
nixosConfigurations = colmenaHive.nodes;
};
}
the diff to the upstream test is:
diff --git a/upstream-flake.nix b/flake.nix
index 11c7f62..a1f59d7 100644
--- a/upstream-flake.nix
+++ b/flake.nix
@@ -1,9 +1,9 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
- colmena.url = "git+file://@repoPath@";
+ colmena.url = "github:zhaofengli/colmena";
};
- outputs = { nixpkgs, colmena, ... }: {
+ outputs = { nixpkgs, colmena, ... }: rec {
colmenaHive = colmena.lib.makeHive {
meta = {
nixpkgs = import nixpkgs {
@@ -25,5 +25,6 @@
time.timeZone = "America/Los_Angeles";
};
};
+ nixosConfigurations = colmenaHive.nodes;
};
}
you can then use nix v3 (unstable) cli and nixos-rebuild as you wish:
❯ nixos-rebuild --flake .#host-a build
building the system configuration...
trace: warning: system.stateVersion is not set, defaulting to 24.05. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion.
| 01:39:01 |
emily | i am honestly a bit surprised this isn't documented lol | 01:39:20 |
emily | you can also mix colmena nodes and your "vanilla" lib.nixosSystem in nixosConfigurations that way (for use with nixos-rebuild):
https://git.geklaute.cloud/emilylange/nixos-config/src/commit/22570786b24b606484447bef7a29fe565d475db7/flake.nix#L48-L76
| 01:41:46 |
ari ❄ | here's how I do this: https://code.hackerspace.pl/ar/nibylandia/src/branch/main/flake.nix#L115-L123 | 10:35:29 |
ari ❄ | tl;dr: automatically generate nixosConfiguration entries based on contents of a directory, and then generating colmena nodes based off of that | 10:37:39 |
| 21 Mar 2024 |
| craige joined the room. | 05:41:34 |