| 19 Aug 2023 |
@khalilsantana:matrix.org | My question is centered around package versions rather than anything else. Say all my hosts have foo-bar-v1.0, then at a later point the nixos-channel provides foo-bar-v2.0, since the config.nix didn't change I don't think colmena will fetch & apply the new binaries to the remote hosts, correct? | 19:29:07 |
@khalilsantana:matrix.org | Or does a colmena apply also applies package upgrades, not only installs/uninstalls? | 19:29:50 |
Zhaofeng Li | Nix works fundamentally differently from other package managers. The package versions are decided when you evaluate the expression, and for Colmena everything is evaluated locally on the host you are deploying from | 19:31:33 |
Zhaofeng Li | so with channels, it will follow whatever you have on the machine running colmena | 19:31:59 |
@khalilsantana:matrix.org | Pretty neat! So I guess I don't need to do anything special, just run an apply once in a while | 19:33:55 |
@khalilsantana:matrix.org | (I've seen there's an auto-upgrade option in nixos itself, but I'd rather have more control) | 19:34:29 |
Zhaofeng Li | As a more concrete demonstration, run nix-build '<nixpkgs>' -A hello and you will get a path. This path is unique to this specific version of hello, tied to everything that it depends on:
$ nix-store -qR /nix/store/qi2wm8z1m8c8x164ki6r4fbpfl7is735-hello-2.12.1
/nix/store/2y9zl8ky5ac28ali6ly1zfz11d4fq48b-xgcc-12.3.0-libgcc
/nix/store/ic9wnagwh22yhqh3lcdlnv5m178w6f0f-libunistring-1.1
/nix/store/a9mxddm4a5p4kp84vys4n2nrmwqgk7kr-libidn2-2.3.4
/nix/store/1x4ijm9r1a88qk7zcmbbfza324gx1aac-glibc-2.37-8
/nix/store/qi2wm8z1m8c8x164ki6r4fbpfl7is735-hello-2.12.1
| 19:37:53 |
Wanja Hentze | In reply to @khalilsantana:matrix.org (I've seen there's an auto-upgrade option in nixos itself, but I'd rather have more control) yes, I don't think the auto-upgrade feature will work well at all with colmena | 19:40:23 |
Zhaofeng Li | Say later there's a vulnerability that requires you to patch glibc-2.37-8. Nothing changes about this specific hello - It will still use the same exact unpatched glibc-2.37-8 as you originally built it. Therefore there aren't really upgrades - Any change results in a totally different package in a different path | 19:41:45 |
Zhaofeng Li | Sorry if this is too verbose - I wanted to clear some things up, as the questions about "upgrades" and "adding new packages" suggested some misunderstanding | 19:43:04 |
@khalilsantana:matrix.org | Understood. I like the in-depth explanations since I'm pretty new to nix, so I'm still getting my mind wrapped around it. It certainly doesn't help that the nix pkg in my distro was/is busted | 19:45:57 |
Zhaofeng Li | The core thing is that system profiles themselves are packages as well and follow the same rules. In other words, when you deploy, you always apply the whole coherent configuration and there's no way to not to fetch upgrades depending on what the host currently has | 19:55:35 |
Zhaofeng Li | * The core thing is that system profiles themselves are packages as well and follow the same rules. In other words, when you deploy, you always apply the whole coherent configuration and there's no way to not fetch upgrades depending on what the host currently has | 19:55:48 |
Zhaofeng Li | The older versions of packages are still there in the store, just "dormant" until you garbage collect them | 19:56:37 |
Wanja Hentze | also, I recommend puttinf something like this in your colmena config for all hosts
```nix
environment.etc."nixos/configuration.nix".text = ''
throw "sorry, no nixos-rebuild, use colmena"
'';
``` | 20:07:50 |
Wanja Hentze | * also, I recommend puttinf something like this in your colmena config for all hosts
```
environment.etc."nixos/configuration.nix".text = ''
throw "sorry, no nixos-rebuild, use colmena"
'';
``` | 20:08:08 |
Wanja Hentze | hmm no formating? okay then element | 20:08:18 |
Zhaofeng Li | Eledroid requires enabling in the settings, if you are using that | 20:12:12 |
Wanja Hentze | oooh nice thanks | 20:13:48 |
Wanja Hentze | * also, I recommend puttinf something like this in your colmena config for all hosts
```
environment.etc."nixos/configuration.nix".text = ''
throw "sorry, no nixos-rebuild, use colmena"
'';
``` | 20:13:55 |
Wanja Hentze | * also, I recommend putting something like this in your colmena config for all hosts
environment.etc."nixos/configuration.nix".text = ''
throw "sorry, no nixos-rebuild, use colmena"
'';
| 20:14:23 |
Wanja Hentze | * also, I recommend putting something like this in your colmena config for all hosts
```nix
environment.etc."nixos/configuration.nix".text = ''
throw "sorry, no nixos-rebuild, use colmena"
'';
``` | 20:14:34 |
Wanja Hentze | anyway that makes it so you don't accidentally keep using nixos-rebuild on your hosts and clobber the colmena-defined config | 20:15:19 |
| 20 Aug 2023 |
rendakuenthusiast⚡️ | In reply to @sumner:nevarro.space are you in the #community-rooms:nixos.org subspace ? oh apparently not | 07:59:17 |
rendakuenthusiast⚡️ | is there a way I can have colmena not use every single core on my local machine when deploying, so I can still use my machine for other things while it's happening in the background? | 08:00:17 |
rendakuenthusiast⚡️ | I'm not sure if this is a colmena setting or a general nix setting | 08:00:26 |
| 21 Aug 2023 |
@lab-cat:ag-link.xyz | I don't know of a colmena-specific solution to this, but take a look at NIX_BUILD_CORES and nix.maxjobs | 06:53:04 |
| 23 Aug 2023 |
| @sfkvso:matrix.org left the room. | 08:49:48 |
| 25 Aug 2023 |
| ibizaman set a profile picture. | 16:18:48 |
| 27 Aug 2023 |
| @obsidianical:matrix.org left the room. | 15:53:57 |