Lix cache does not match release hash, forces compilation #489

Closed
opened 2024-08-26 22:56:44 +00:00 by ifreilicht · 4 comments
Member

Describe the bug

TL;DR: Trying to avoid compiling Lix (because my NixOS servers are potatoes), I thought simply pinning to a tagged version should work, as that's available in the cache, but it doesn't. The difference seems to come from evaluating the package directly when doing the release, but using callPackage in the NixOS module.

Steps To Reproduce

This is just to show how the two evaluation methods produce different derivations with differing output paths:

$ tar -xzf <(curl https://releases.lix.systems/lix/lix-2.91.0/lix-2.91.0.tar.gz)
$ nix-instantiate lix-2.91.0/
/nix/store/qrz3ix4hbhbfprcpad96lp81ryig1qjh-lix-2.91.0.drv
$ nix-store -q /nix/store/qrz3ix4hbhbfprcpad96lp81ryig1qjh-lix-2.91.0.drv
/nix/store/k4m31q5ralky3z58b37jsr8hlc4ccarj-lix-2.91.0
/nix/store/m2hv0gj4nskfp3y19hmn2y1fhjcn10ad-lix-2.91.0-dev
/nix/store/m58lnpg2kl82bsqndnkyb7nmr1b1hfjy-lix-2.91.0-debug
/nix/store/zdgzpskqgq4nimw3xrnkv13rqd8cxddp-lix-2.91.0-doc
$
$ nix repl
Welcome to Nix 2.18.5. Type :? for help.

nix-repl> :lf nixpkgs                                                                               
Added 13 variables.

nix-repl> legacyPackages.x86_64-linux.callPackage ''${builtins.fetchTarball "https://releases.lix.systems/lix/lix-2.91.0/lix-2.91.0.tar.gz"}/package.nix'' {}
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
«derivation /nix/store/ns2xnz8gf9x94sg8a92v3hn3nd004a6j-lix-2.91.0.drv»

nix-repl> ^C
$ nix-store -q /nix/store/ns2xnz8gf9x94sg8a92v3hn3nd004a6j-lix-2.91.0.drv
/nix/store/33jad81fbr4rpycka83z7qrwgz73xm8r-lix-2.91.0
/nix/store/59km1ars6nz7nr639p0g6bpp9k5if0hz-lix-2.91.0-debug
/nix/store/kkwb3lnrdp6lng9i2zq9c36f8zhjrciz-lix-2.91.0-doc
/nix/store/l7a6fair3gzgbfff3msc0imcx4hr2b0p-lix-2.91.0-dev

Real-life steps to show the issue for users

I want to install Lix on a NixOS-machine, but want to avoid compiling because the CPU is slow. I first modify my configuration to include cache.lix.systems as a trusted cache:

  nix = {
    settings = {
      experimental-features = [ "nix-command" "flakes" ];

      substituters = [
        "https://cache.lix.systems"
      ];
      trusted-public-keys = [
        "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
      ];
    };

I then nixos-rebuild test and verify the cache has been added:

$ tail -7 /etc/nix/nix.conf | head -3
substituters = https://cache.lix.systems https://cache.nixos.org/
system-features = nixos-test benchmark big-parallel kvm
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=

Now, I follow the installation guide, but instead of using main, I use the tagged version 2.91.0; in flake.nix:

    lix = {
      # Only use tagged versions to avoid having to compile Lix from main
      url = "https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz";
      flake = false;
    };

    lix-module = {
      url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
      inputs = {
        nixpkgs.follows = "nixpkgs";
        lix.follows = "lix";
        flakey-profile.follows = "flakey-profile";
        flake-utils.follows = "flake-utils";
      };
    };

And later, in configuration.nix:

{ pkgs, nixpkgs, lix-module, ... }:

{
  imports = [
    lix-module.nixosModules.default
  ];

Now, when I run nixos-rebuild, I can see that Lix will not be substituted, but built:

$ nixos-rebuild test --flake path:.#junction --target-host junction --build-host junction --fast --use-remote-sudo
building the system configuration...
warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/2crvp1p4s1z0c9j83h3pb1xwi8pr73jj-nixos-system-junction-24.11.20240809.5e0ca22.drv^*'
these 38 derivations will be built:
  /nix/store/82mivpsc3zcgc67rsbwfzgxchqw1c4hk-rnix-0.11.0.drv
  /nix/store/ml3ppynk1bypbni93rgdw18jjqqhg6rx-cargo-vendor-dir.drv
  /nix/store/glkabcjla4h1z7js0jqn7qad24qd4k6j-lix-doc.drv
  /nix/store/hbiw4vmywh6fd5zqiybgnv0j8a7jjzaz-aws-sdk-cpp-1.11.336.drv
  /nix/store/y4adja2fc4h2av6fdicyrqaalgshvf03-editline-1.17.1.drv
  /nix/store/ns2xnz8gf9x94sg8a92v3hn3nd004a6j-lix-2.91.0.drv
  ...

And indeed, when I query the derivation output path, it seems to not be available in the store:

$ nix-store -q /nix/store/ns2xnz8gf9x94sg8a92v3hn3nd004a6j-lix-2.91.0.drv
/nix/store/33jad81fbr4rpycka83z7qrwgz73xm8r-lix-2.91.0
/nix/store/59km1ars6nz7nr639p0g6bpp9k5if0hz-lix-2.91.0-debug
/nix/store/kkwb3lnrdp6lng9i2zq9c36f8zhjrciz-lix-2.91.0-doc
/nix/store/l7a6fair3gzgbfff3msc0imcx4hr2b0p-lix-2.91.0-dev
$ nix path-info --store https://cache.lix.systems /nix/store/33jad81fbr4rpycka83z7qrwgz73xm8r-lix-2.91.0
don't know how to build these paths:
  /nix/store/33jad81fbr4rpycka83z7qrwgz73xm8r-lix-2.91.0
error: path '/nix/store/33jad81fbr4rpycka83z7qrwgz73xm8r-lix-2.91.0' is not valid

So I took a look at https://releases.lix.systems/lix/lix-2.91.0/manifest.nix, and that contains a different hash for this output:

# This file was generated by releng/create_release.xsh in Lix
{
  aarch64-linux = "/nix/store/b3gh503pjpn2rsj9p7sarp238qzrkdpz-lix-2.91.0";
  aarch64-darwin = "/nix/store/93ni93d5g2v62kz9a0v3cwn5p0qrq8nl-lix-2.91.0";
  x86_64-darwin = "/nix/store/q1kjx10sv7q6iz0l9xkvwiigqxxzr0bz-lix-2.91.0";
  x86_64-linux = "/nix/store/k4m31q5ralky3z58b37jsr8hlc4ccarj-lix-2.91.0";
}

Which is the one that is available in the cache:

$ nix path-info --store https://cache.lix.systems /nix/store/k4m31q5ralky3z58b37jsr8hlc4ccarj-lix-2.91.0
/nix/store/k4m31q5ralky3z58b37jsr8hlc4ccarj-lix-2.91.0

And looking at the closure at https://releases.lix.systems/lix/lix-2.91.0/lix-2.91.0-x86_64-linux.tar.xz, I can also see that it contains the k4m3... path, not the one that's generated directly from the archive.

I also tried to change https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz to https://releases.lix.systems/lix/lix-2.91.0/lix-2.91.0.tar.gz, but these two archives seem to be identical, as they both output the 33ja... path. There's a slight difference in the name of their root folder, but I guess Nix doesn't care about that.

$ diff -s <(tar -tzf <(curl -s https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz)) <(tar -tzf <(curl -s https://releases.lix.systems/lix/lix-2.91.0/lix-2.91.0.tar.gz) | sed 's/^lix-2.91.0/lix/g')
Files /dev/fd/14 and /dev/fd/15 are identical

Expected behavior

I would expect a tagged and released versions of lix to be available in the cache, and I would like that to be the default installation method, not something hidden I can only find by reading the source code.

nix --version output

nix (Nix) 2.18.5

Additional context

Right now there is one other option: lix-module.nixosModules.lixFromNixpkgs, but that will lag behind for quite a while (2.91.0 just hit nixpkgs yesterday), and it's currently hard to discover (or I missed the docs for it).

My assumption is that the hashes change because of the version of nixpkgs Lix is built against, but as the current lix closure is <30MB small, it seems okay to me to just not care about what version of nixpkgs is installed and instead fetch the entire closure. I believe most people would prefer that to running a >20min compilation.

## Describe the bug **TL;DR:** Trying to avoid compiling Lix (because my NixOS servers are potatoes), I thought simply pinning to a tagged version should work, as that's available in the cache, but it doesn't. The difference seems to come from evaluating the package directly when doing the release, but using `callPackage` in the NixOS module. ## Steps To Reproduce This is just to show how the two evaluation methods produce different derivations with differing output paths: ```sh $ tar -xzf <(curl https://releases.lix.systems/lix/lix-2.91.0/lix-2.91.0.tar.gz) $ nix-instantiate lix-2.91.0/ /nix/store/qrz3ix4hbhbfprcpad96lp81ryig1qjh-lix-2.91.0.drv $ nix-store -q /nix/store/qrz3ix4hbhbfprcpad96lp81ryig1qjh-lix-2.91.0.drv /nix/store/k4m31q5ralky3z58b37jsr8hlc4ccarj-lix-2.91.0 /nix/store/m2hv0gj4nskfp3y19hmn2y1fhjcn10ad-lix-2.91.0-dev /nix/store/m58lnpg2kl82bsqndnkyb7nmr1b1hfjy-lix-2.91.0-debug /nix/store/zdgzpskqgq4nimw3xrnkv13rqd8cxddp-lix-2.91.0-doc $ $ nix repl Welcome to Nix 2.18.5. Type :? for help. nix-repl> :lf nixpkgs Added 13 variables. nix-repl> legacyPackages.x86_64-linux.callPackage ''${builtins.fetchTarball "https://releases.lix.systems/lix/lix-2.91.0/lix-2.91.0.tar.gz"}/package.nix'' {} warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring «derivation /nix/store/ns2xnz8gf9x94sg8a92v3hn3nd004a6j-lix-2.91.0.drv» nix-repl> ^C $ nix-store -q /nix/store/ns2xnz8gf9x94sg8a92v3hn3nd004a6j-lix-2.91.0.drv /nix/store/33jad81fbr4rpycka83z7qrwgz73xm8r-lix-2.91.0 /nix/store/59km1ars6nz7nr639p0g6bpp9k5if0hz-lix-2.91.0-debug /nix/store/kkwb3lnrdp6lng9i2zq9c36f8zhjrciz-lix-2.91.0-doc /nix/store/l7a6fair3gzgbfff3msc0imcx4hr2b0p-lix-2.91.0-dev ``` ### Real-life steps to show the issue for users I want to install Lix on a NixOS-machine, but want to avoid compiling because the CPU is slow. I first modify my configuration to include `cache.lix.systems` as a trusted cache: ```nix nix = { settings = { experimental-features = [ "nix-command" "flakes" ]; substituters = [ "https://cache.lix.systems" ]; trusted-public-keys = [ "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" ]; }; ``` I then `nixos-rebuild test` and verify the cache has been added: ```sh $ tail -7 /etc/nix/nix.conf | head -3 substituters = https://cache.lix.systems https://cache.nixos.org/ system-features = nixos-test benchmark big-parallel kvm trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o= ``` Now, I follow the installation guide, but instead of using `main`, I use the tagged version `2.91.0`; in `flake.nix`: ```nix lix = { # Only use tagged versions to avoid having to compile Lix from main url = "https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz"; flake = false; }; lix-module = { url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz"; inputs = { nixpkgs.follows = "nixpkgs"; lix.follows = "lix"; flakey-profile.follows = "flakey-profile"; flake-utils.follows = "flake-utils"; }; }; ``` And later, in `configuration.nix`: ```nix { pkgs, nixpkgs, lix-module, ... }: { imports = [ lix-module.nixosModules.default ]; ``` Now, when I run `nixos-rebuild`, I can see that Lix will not be substituted, but built: ```sh $ nixos-rebuild test --flake path:.#junction --target-host junction --build-host junction --fast --use-remote-sudo building the system configuration... warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/2crvp1p4s1z0c9j83h3pb1xwi8pr73jj-nixos-system-junction-24.11.20240809.5e0ca22.drv^*' these 38 derivations will be built: /nix/store/82mivpsc3zcgc67rsbwfzgxchqw1c4hk-rnix-0.11.0.drv /nix/store/ml3ppynk1bypbni93rgdw18jjqqhg6rx-cargo-vendor-dir.drv /nix/store/glkabcjla4h1z7js0jqn7qad24qd4k6j-lix-doc.drv /nix/store/hbiw4vmywh6fd5zqiybgnv0j8a7jjzaz-aws-sdk-cpp-1.11.336.drv /nix/store/y4adja2fc4h2av6fdicyrqaalgshvf03-editline-1.17.1.drv /nix/store/ns2xnz8gf9x94sg8a92v3hn3nd004a6j-lix-2.91.0.drv ... ``` And indeed, when I query the derivation output path, it seems to not be available in the store: ```sh $ nix-store -q /nix/store/ns2xnz8gf9x94sg8a92v3hn3nd004a6j-lix-2.91.0.drv /nix/store/33jad81fbr4rpycka83z7qrwgz73xm8r-lix-2.91.0 /nix/store/59km1ars6nz7nr639p0g6bpp9k5if0hz-lix-2.91.0-debug /nix/store/kkwb3lnrdp6lng9i2zq9c36f8zhjrciz-lix-2.91.0-doc /nix/store/l7a6fair3gzgbfff3msc0imcx4hr2b0p-lix-2.91.0-dev $ nix path-info --store https://cache.lix.systems /nix/store/33jad81fbr4rpycka83z7qrwgz73xm8r-lix-2.91.0 don't know how to build these paths: /nix/store/33jad81fbr4rpycka83z7qrwgz73xm8r-lix-2.91.0 error: path '/nix/store/33jad81fbr4rpycka83z7qrwgz73xm8r-lix-2.91.0' is not valid ``` So I took a look at https://releases.lix.systems/lix/lix-2.91.0/manifest.nix, and that contains a different hash for this output: ```nix # This file was generated by releng/create_release.xsh in Lix { aarch64-linux = "/nix/store/b3gh503pjpn2rsj9p7sarp238qzrkdpz-lix-2.91.0"; aarch64-darwin = "/nix/store/93ni93d5g2v62kz9a0v3cwn5p0qrq8nl-lix-2.91.0"; x86_64-darwin = "/nix/store/q1kjx10sv7q6iz0l9xkvwiigqxxzr0bz-lix-2.91.0"; x86_64-linux = "/nix/store/k4m31q5ralky3z58b37jsr8hlc4ccarj-lix-2.91.0"; } ``` Which is the one that **is** available in the cache: ```sh $ nix path-info --store https://cache.lix.systems /nix/store/k4m31q5ralky3z58b37jsr8hlc4ccarj-lix-2.91.0 /nix/store/k4m31q5ralky3z58b37jsr8hlc4ccarj-lix-2.91.0 ``` And looking at the closure at https://releases.lix.systems/lix/lix-2.91.0/lix-2.91.0-x86_64-linux.tar.xz, I can also see that it contains the `k4m3...` path, not the one that's generated directly from the archive. I also tried to change `https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz` to `https://releases.lix.systems/lix/lix-2.91.0/lix-2.91.0.tar.gz`, but these two archives seem to be identical, as they both output the `33ja...` path. There's a slight difference in the name of their root folder, but I guess Nix doesn't care about that. ```sh $ diff -s <(tar -tzf <(curl -s https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz)) <(tar -tzf <(curl -s https://releases.lix.systems/lix/lix-2.91.0/lix-2.91.0.tar.gz) | sed 's/^lix-2.91.0/lix/g') Files /dev/fd/14 and /dev/fd/15 are identical ``` ## Expected behavior I would expect a tagged and released versions of lix to be available in the cache, and I would like that to be the default installation method, not something hidden I can only find by reading the source code. ## `nix --version` output ``` nix (Nix) 2.18.5 ``` ## Additional context Right now there is one other option: `lix-module.nixosModules.lixFromNixpkgs`, but that will lag behind for quite a while (2.91.0 just hit nixpkgs yesterday), and it's currently hard to discover (or I missed the docs for it). My assumption is that the hashes change because of the version of nixpkgs Lix is built against, but as the current lix closure is <30MB small, it seems okay to me to just not care about what version of nixpkgs is installed and instead fetch the entire closure. I believe most people would prefer that to running a >20min compilation.
ifreilicht added the
bug
label 2024-08-26 22:56:44 +00:00
ifreilicht added the
Area/releng
label 2024-08-26 23:03:06 +00:00
Author
Member

I now also tried to just remove all follows from the module, but that doesn't make a difference:

    inputs.lix-module.url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";

I still get the same derivation path:

warning: updating lock file '/Users/feuh/.dotfiles/flake.lock':
• Removed input 'lix'
• Updated input 'lix-module/flake-utils':
    follows 'flake-utils'
  → 'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a' (2024-03-11)
• Added input 'lix-module/flake-utils/systems':
    'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09)
• Updated input 'lix-module/flakey-profile':
    follows 'flakey-profile'
  → 'github:lf-/flakey-profile/243c903fd8eadc0f63d205665a92d4df91d42d9d' (2024-04-12)
• Updated input 'lix-module/lix':
    follows 'lix'
  → 'https://git.lix.systems/api/v1/repos/lix-project/lix/archive/bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2.tar.gz?narHash=sha256-Rosl9iA9MybF5Bud4BTAQ9adbY81aGmPfV8dDBGl34s%3D' (2024-08-12)
• Updated input 'lix-module/nixpkgs':
    follows 'nixpkgs'
  → 'github:nixos/nixpkgs/d0e1602ddde669d5beb01aec49d71a51937ed7be' (2024-08-24)
building the system configuration...
warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/2crvp1p4s1z0c9j83h3pb1xwi8pr73jj-nixos-system-junction-24.11.20240809.5e0ca22.drv^*'
these 32 derivations will be built:
  /nix/store/ns2xnz8gf9x94sg8a92v3hn3nd004a6j-lix-2.91.0.drv

This means that it doesn't matter in my case which nixpkgs version I'm following, though I guess that's just because there were no updates to Lix' dependencies between the locked nixpkgs in nixos-module and in my flake.

I now also tried to just remove all `follows` from the module, but that doesn't make a difference: ``` inputs.lix-module.url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz"; ``` I still get the same derivation path: ``` warning: updating lock file '/Users/feuh/.dotfiles/flake.lock': • Removed input 'lix' • Updated input 'lix-module/flake-utils': follows 'flake-utils' → 'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a' (2024-03-11) • Added input 'lix-module/flake-utils/systems': 'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09) • Updated input 'lix-module/flakey-profile': follows 'flakey-profile' → 'github:lf-/flakey-profile/243c903fd8eadc0f63d205665a92d4df91d42d9d' (2024-04-12) • Updated input 'lix-module/lix': follows 'lix' → 'https://git.lix.systems/api/v1/repos/lix-project/lix/archive/bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2.tar.gz?narHash=sha256-Rosl9iA9MybF5Bud4BTAQ9adbY81aGmPfV8dDBGl34s%3D' (2024-08-12) • Updated input 'lix-module/nixpkgs': follows 'nixpkgs' → 'github:nixos/nixpkgs/d0e1602ddde669d5beb01aec49d71a51937ed7be' (2024-08-24) building the system configuration... warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/2crvp1p4s1z0c9j83h3pb1xwi8pr73jj-nixos-system-junction-24.11.20240809.5e0ca22.drv^*' these 32 derivations will be built: /nix/store/ns2xnz8gf9x94sg8a92v3hn3nd004a6j-lix-2.91.0.drv ``` This means that it *doesn't* matter in my case which nixpkgs version I'm following, though I guess that's just because there were no updates to Lix' dependencies between the locked nixpkgs in `nixos-module` and in my flake.
Owner

Not a bug. The only version of nixpkgs that the cache is built with is exactly the one locked in the Lix flake at the release tag. Not the version in the NixOS module (that exists purely for testing). Not the version in your flake registry as obtained by :lf nixpkgs.

If you want Lix from a binary cache on NixOS, use the build from nixpkgs.

Not a bug. The only version of nixpkgs that the cache is built with is exactly the one locked in the Lix flake at the release tag. Not the version in the NixOS module (that exists purely for testing). Not the version in your flake registry as obtained by :lf nixpkgs. If you want Lix from a binary cache on NixOS, use the build from nixpkgs.
jade closed this issue 2024-08-27 16:27:46 +00:00
Owner

If you want to construct some kind of contraption that does this as described, it is possible to write such an overlay. However this is unsupported and probably broken by operating nixpkgs in ways it is not designed.

final: prev: { lix = lixFlake.packages.${prev.system}; }, then put it before lix-module.overlays.lixFromNixpkgs and don't override the nixpkgs of the lix flake. This is unsupported for several reasons: the resulting nix-eval-jobs will probably be broken because it links to lix from 24.05 while itself being built with unstable, because that's how overlays work, and there's nothing stopping something else from linking to lix with the same problem either.

I dislike flakes very much because they lead to wishful thinking about how overlays work which then wastes a lot of your time diagnosing something that will never work. An overlay will only ever build things from the version of nixpkgs it is evaluated in. It doesn't matter which flake inputs go into the flake exposing the overlay.

The reason lixFromNixpkgs is not documented except in the module readme is that if it were documented elsewhere before lix 2.91 is in both 24.05 and unstable, we would receive several support messages a day asking why it doesn't work. It's much easier to write down the installation method that will always work and which leads to some building while waiting for reviews in nixpkgs (and our own getting the code right).

Also I do see you mention your servers being potatoes. You could set up a binary cache to fix this problem using s3 or cachix or nix-serve-ng or something else entirely, then build it on your fast machine and put it in the cache. Or use nixos-rebuild --target-host to deploy an entire built NixOS system from your fast machine directly to the server without needing a cache.

If you want to construct some kind of contraption that does this as described, it is possible to write such an overlay. However this is *unsupported and probably broken by operating nixpkgs in ways it is not designed*. `final: prev: { lix = lixFlake.packages.${prev.system}; }`, then put it before lix-module.overlays.lixFromNixpkgs and *don't* override the nixpkgs of the lix flake. This is *unsupported* for several reasons: the resulting nix-eval-jobs will probably be broken because it links to lix from 24.05 while itself being built with unstable, because that's how overlays work, and there's nothing stopping something else from linking to lix with the same problem either. I dislike flakes very much because they lead to wishful thinking about how overlays work which then wastes a lot of your time diagnosing something that will never work. An overlay will only ever build things from the version of nixpkgs it is evaluated in. It doesn't matter which flake inputs go into the flake exposing the overlay. The reason lixFromNixpkgs is not documented except in the module readme is that if it were documented elsewhere before lix 2.91 is in both 24.05 and unstable, we would receive several support messages a day asking why it doesn't work. It's much easier to write down the installation method that will always work and which leads to some building while waiting for reviews in nixpkgs (and our own getting the code right). Also I do see you mention your *servers* being potatoes. You could set up a binary cache to fix this problem using s3 or cachix or nix-serve-ng or something else entirely, then build it on your fast machine and put it in the cache. Or use nixos-rebuild --target-host to deploy an entire built NixOS system from your fast machine directly to the server without needing a cache.
Author
Member

Thank you for the detailed answer, this really helps a lot!

I dislike flakes very much because they lead to wishful thinking about how overlays work which then wastes a lot of your time diagnosing something that will never work.

That's exactly what happened. I thought that the nixpkgs version the Lix uses would be independent from the nixpkgs version that was installed on my system. And I spent multiple hours working out this detailed bug report.

The reason lixFromNixpkgs is not documented except in the module readme is that if it were documented elsewhere before lix 2.91 is in both 24.05 and unstable, we would receive several support messages a day asking why it doesn't work.

That's very reasonable, thanks for explaining that.

You could set up a binary cache to fix this problem using s3 or cachix or nix-serve-ng or something else entirely, then build it on your fast machine and put it in the cache.

Yeah that's kind-of what I did. I set up the fastest machine I have as a remote builder for the slower ones, then deployed Lix to it first. Serving the store directly might be an option to explore in the future.

Thank you for the detailed answer, this really helps a lot! > I dislike flakes very much because they lead to wishful thinking about how overlays work which then wastes a lot of your time diagnosing something that will never work. That's exactly what happened. I thought that the nixpkgs version the Lix uses would be independent from the nixpkgs version that was installed on my system. And I spent multiple hours working out this detailed bug report. > The reason lixFromNixpkgs is not documented except in the module readme is that if it were documented elsewhere before lix 2.91 is in both 24.05 and unstable, we would receive several support messages a day asking why it doesn't work. That's very reasonable, thanks for explaining that. > You could set up a binary cache to fix this problem using s3 or cachix or nix-serve-ng or something else entirely, then build it on your fast machine and put it in the cache. Yeah that's kind-of what I did. I set up the fastest machine I have as a remote builder for the slower ones, then deployed Lix to it first. Serving the store directly might be an option to explore in the future.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#489
No description provided.