!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

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

Load older messages


SenderMessageTime
1 Apr 2023
@plg:matrix.orgmel (they/them)I think this is what you want: https://flake.parts/define-custom-flake-attribute.html21:05:00
2 Apr 2023
@buckley310:matrix.orgBuckley left the room.02:26:51
3 Apr 2023
@dhl:edgerunners.eu.org@dhl:edgerunners.eu.org joined the room.08:35:33
@dhl:edgerunners.eu.org@dhl:edgerunners.eu.org left the room.08:43:48
5 Apr 2023
@redstone-menace:matrix.orgR̴̨͕͇͍̞̮̐̅͆̌̀̉̐͋̈́̃̀͒́̎̅̚̚̚͠͝Ĕ̵̡̛͖͖̟̙̫̱͈̘̞̭͍͍͑̌̄͑̓̋̓̀̈̏̈́͊̇͊͆̉͂̏̀̃̚͘͝͝ͅͅD̶̡̢͔̱̖̮͙͉̘̺͓͍̩̮͈͍͗̃̀̏͌͘͜ͅŚ̸̬̭̯̬͙͇͓̬̩̳̤͚͓̤̩̺͉͖̉͛̓̿̎͊̿̆́̐͂̇͌̄̇̓͘ͅͅT̴̞̫̘̝͇͔̟̪̪̦͂̔̎̀̎ͅŎ̷̡̬̹̪͈̭̣͈̭̭͉̦̖̝̘̪͖͔̥̦̘̻̳Ṋ̶̛̫͈̳̘͚̜̔̋͆̅̈́͊̑͊̉̌̈́̾͑̈́̚ͅË̸̡̨̨̛͇̜̖͔͖̻̟̗̠̙͓̘̗̥͉͇̜͑͆͊͑͑̀̓͒͜͝͝ joined the room.05:47:55
@sef:exotic.shsefidel changed their display name from sef to sefidel.13:55:17
6 Apr 2023
@rgrunbla:matrix.orgReventlovhey11:56:22
8 Apr 2023
@egor:sgf.ltegor joined the room.18:26:49
9 Apr 2023
@dantefromhell:matrix.orgdantefromhell

I was wondering if tags could be used to map nixpkgs overrides?

I do like the idea of each machines definition being fully contained within a single file/ directory. Needing to do per-machine meta.nodeNixpkgs feels "unclean".
I would rather prefer to use tags for grouping different machines together and than override the specific nixpkgs for this tag.

Is that possibly as of today?

00:58:07
@me:indeednotjames.comemily
In reply to @dantefromhell:matrix.org

I was wondering if tags could be used to map nixpkgs overrides?

I do like the idea of each machines definition being fully contained within a single file/ directory. Needing to do per-machine meta.nodeNixpkgs feels "unclean".
I would rather prefer to use tags for grouping different machines together and than override the specific nixpkgs for this tag.

Is that possibly as of today?

You might want to follow https://github.com/zhaofengli/colmena/issues/55 and https://github.com/zhaofengli/colmena/issues/71
01:07:44
@rendakuenthusiast:imperishable.name@rendakuenthusiast:imperishable.namewhat's the correct way to pin the nixpkgs version when using colmena with a falke?04:44:07
@rendakuenthusiast:imperishable.name@rendakuenthusiast:imperishable.name * what's the correct way to pin the nixpkgs version when using colmena with a flake?04:44:09
@me:indeednotjames.comemily
In reply to @rendakuenthusiast:imperishable.name
what's the correct way to pin the nixpkgs version when using colmena with a flake?
can you elaborate?
you should have an auto-generated flake.lock
17:42:10
@rendakuenthusiast:imperishable.name@rendakuenthusiast:imperishable.name
In reply to @me:indeednotjames.com
can you elaborate?
you should have an auto-generated flake.lock
so in my current non-flake colmena setup, I have meta.nixpkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/<hash>/.tar.gz");, in order to pin the nixpkgs for my remote machines to a specific version
20:58:19
@rendakuenthusiast:imperishable.name@rendakuenthusiast:imperishable.nameI would like to replicate this with a flake.nix setup, but I am not sure how to do that from the documentation at https://colmena.cli.rs/unstable/tutorial/flakes.html20:58:46
@dantefromhell:matrix.orgdantefromhell
In reply to @me:indeednotjames.com
You might want to follow https://github.com/zhaofengli/colmena/issues/55 and https://github.com/zhaofengli/colmena/issues/71
thx a ton for the hints!
21:49:23
@me:indeednotjames.comemily
In reply to @rendakuenthusiast:imperishable.name
I would like to replicate this with a flake.nix setup, but I am not sure how to do that from the documentation at https://colmena.cli.rs/unstable/tutorial/flakes.html

oicic
you might want to read up some generic flake tutorials

an extremely brief introduction would be that inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable" you can see in the example you linked to sets the nixpkgs of your nodes to the nixos-unstable branch.
when you run colmena the first time with a flake.nix, nix will automatically create a flake.lock, containing a rev of a commit of that branch from github.com/NixOS/nixpkgs

you can use any branch you like, e.g. nixos-22.11 or nixos-22.11-small

to update the rev in the flake.lock, you can use nix flake update

23:17:34
10 Apr 2023
@rendakuenthusiast:imperishable.name@rendakuenthusiast:imperishable.name
In reply to @me:indeednotjames.com

oicic
you might want to read up some generic flake tutorials

an extremely brief introduction would be that inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable" you can see in the example you linked to sets the nixpkgs of your nodes to the nixos-unstable branch.
when you run colmena the first time with a flake.nix, nix will automatically create a flake.lock, containing a rev of a commit of that branch from github.com/NixOS/nixpkgs

you can use any branch you like, e.g. nixos-22.11 or nixos-22.11-small

to update the rev in the flake.lock, you can use nix flake update

is there a way to set the rev to an explicit value from the beginning, like I'm doing with the non-flake version?
09:34:38
@dantefromhell:matrix.orgdantefromhell
In reply to @zhaofeng:zhaofeng.li
Good idea! We can add aliases, and the whole config will be generated as a string by eval.nix
Reading through some old message, I am wondering if the idea of an SSH config generated by eval.nix has already been implemented and/ or an issue/ FR to it?
Github search did not prove helpful to me 🤔 <-- beginner pondering
16:15:49
@dantefromhell:matrix.orgdantefromhell
In reply to @me:indeednotjames.com
You might want to follow https://github.com/zhaofengli/colmena/issues/55 and https://github.com/zhaofengli/colmena/issues/71

Thinking through this more, just moving the nodeNixpkgs option is not the only goal.

One process I was hoping the tag idea allows to build is answering queries like:

Which hosts require an apply after submitting a patch/ security fix/ bugfix to one of the source repos?

16:18:05
@me:indeednotjames.comemily
In reply to @dantefromhell:matrix.org

Thinking through this more, just moving the nodeNixpkgs option is not the only goal.

One process I was hoping the tag idea allows to build is answering queries like:

Which hosts require an apply after submitting a patch/ security fix/ bugfix to one of the source repos?

Which hosts require an apply after submitting a patch/ security fix/ bugfix to one of the source repos?

you could probably also just colmena build all nodes and check which nodes produce a different outpath and then only apply those

17:28:41
@me:indeednotjames.comemily
In reply to @rendakuenthusiast:imperishable.name
is there a way to set the rev to an explicit value from the beginning, like I'm doing with the non-flake version?
See https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#examples for valid urls. You can specify your rev in them as well
17:31:09
@dantefromhell:matrix.orgdantefromhell
In reply to @me:indeednotjames.com

Which hosts require an apply after submitting a patch/ security fix/ bugfix to one of the source repos?

you could probably also just colmena build all nodes and check which nodes produce a different outpath and then only apply those

building to verify feels wrong in an environment where all inputs (config & packages) is managed declaratively.

the list of affected hosts should be queryable - e.g. within a CI/CD pipeline because we have all the inventory information available

19:44:51
@me:indeednotjames.comemily
In reply to @dantefromhell:matrix.org

building to verify feels wrong in an environment where all inputs (config & packages) is managed declaratively.

the list of affected hosts should be queryable - e.g. within a CI/CD pipeline because we have all the inventory information available

I am confused.
colmena is stateless by design. and to know which nodes need to updated, you would have to keep track of the nodes closures/generations.

you can probably use a pre-apply hook, to fetch the current system generation and compare it with your locally build one (you are trying to apply) and stop if they are already the same or whatever.
are you thinking of something like that?

19:55:09
@whentze:matrix.orgWanja Hentzewe built something like that at work, kinda20:21:19
@whentze:matrix.orgWanja Hentzebut it's quite intertwined with our own CI logic20:21:34
@whentze:matrix.orgWanja Hentzedefinitely works20:21:37
@dantefromhell:matrix.orgdantefromhell
In reply to @me:indeednotjames.com

Which hosts require an apply after submitting a patch/ security fix/ bugfix to one of the source repos?

you could probably also just colmena build all nodes and check which nodes produce a different outpath and then only apply those

*

building to verify feels wrong in an environment where all inputs (config & packages) are managed declaratively.

the list of affected hosts should be queryable - e.g. within a CI/CD pipeline because we have all the inventory information available

22:56:02
@dantefromhell:matrix.orgdantefromhell

Emily:

colmena is stateless by design. and to know which nodes need to updated, you would have to keep track of the nodes closures/generations.

I disagree. For 1 commit this query should always be doable without contacting any host because the desired inventory state is declared.

The situation I can think of where you need to check the deployed closures is if you are trying to solve "configuration drift" and deployment of patches with a single solution - which is kinda the common pattern in non-declarative environments.

But if you're looking at config drift (which I'm still wondering if that can actually be a reasonable thing within NixOS given the generations mechanism 🤔) and the "affected query" as 2 separate problems the aforementioned query actually becomes independent of colmena itself (and therefore the stateless limitation).

23:01:33
@dantefromhell:matrix.orgdantefromhell *

Emily:

colmena is stateless by design. and to know which nodes need to updated, you would have to keep track of the nodes closures/generations.

I disagree. For 1 commit this query should always be doable without contacting a host because the old & new desired state is clearly defined.

The situation I can think of where you need to check the deployed closures is if you are trying to solve "configuration drift" and deployment of patches with a single solution - which is kinda the common pattern in non-declarative environments.

But if you're looking at config drift (which I'm still wondering if that can actually be a reasonable thing within NixOS given the generations mechanism 🤔) and the "affected query" as 2 separate problems the aforementioned query actually becomes independent of colmena itself (and therefore the stateless limitation).

23:03:20

Show newer messages


Back to Room ListRoom Version: 6