Apply lix.overlays.default when not using Lix from nixpkgs #112

Merged
ma27 merged 1 commit from lix-flake-consistent into main 2026-08-21 15:51:22 +00:00
Member

⚠️ Warning: I don't use this and I don't know very well how people are interacting with this. Please review carefully.

That way we get the exact same package as in the Lix flake (with
additional capnproto patches).

This also means you get the same Lix as it's cached in Hydra.

For instance,

$ nix build -L .\#default --override-input lix git+file://$(pwd)/../lix --override-input nixpkgs github:nixos/nixpkgs/e2587caef70cea85dd97d7daab492899902dbf5d

is a cache-hit for me now.

⚠️ **Warning:** I don't use this and I don't know very well how people are interacting with this. Please review carefully. That way we get the exact same package as in the Lix flake (with additional capnproto patches). This also means you get the same Lix as it's cached in Hydra. For instance, $ nix build -L .\#default --override-input lix git+file://$(pwd)/../lix --override-input nixpkgs github:nixos/nixpkgs/e2587caef70cea85dd97d7daab492899902dbf5d is a cache-hit for me now.
Apply lix.overlays.default when not using Lix from nixpkgs
Some checks failed
/ build (aarch64-linux) (pull_request) Failing after 47s
/ build (x86_64-linux) (pull_request) Failing after 2m11s
239f623b26
That way we get the exact same package as in the Lix flake (with
additional capnproto patches).

This also means you get the same Lix as it's cached in Hydra.

For instance,

    $ nix build -L .\#default --override-input lix git+file://$(pwd)/../lix --override-input nixpkgs github:nixos/nixpkgs/e2587caef70cea85dd97d7daab492899902dbf5d

is a cache-hit for me now.
ma27 force-pushed lix-flake-consistent from 239f623b26
Some checks failed
/ build (aarch64-linux) (pull_request) Failing after 47s
/ build (x86_64-linux) (pull_request) Failing after 2m11s
to f04da67df4
All checks were successful
/ build (aarch64-linux) (pull_request) Successful in 8m10s
/ build (x86_64-linux) (pull_request) Successful in 22m55s
2026-07-25 19:40:35 +00:00
Compare
xaltsc left a comment

Haven't tested if the hashes now match, but except for the small comments I made, LGTM.

The hashes match 🎊

~~Haven't tested if the hashes now match~~, but except for the small comments I made, LGTM. The hashes match 🎊
flake.nix Outdated
@ -2,7 +2,6 @@
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.lix = {
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
flake = false;
First-time contributor

The issue with this is that instructions https://wiki.lix.systems/books/contributing/page/running-lix-main#bkmrk-flakes need to be updated to reflect the fact that now lix is considered a flake. This is not an issue with this PR though.

The issue with this is that instructions https://wiki.lix.systems/books/contributing/page/running-lix-main#bkmrk-flakes need to be updated to reflect the fact that now `lix` is considered a flake. This is not an issue with this PR though.
ma27 marked this conversation as resolved
module.nix Outdated
@ -14,3 +14,3 @@
config = lib.mkIf cfg.enable {
nixpkgs.overlays = [ (import ./overlay.nix { inherit lix versionSuffix; }) ];
nixpkgs.overlays = [ (import ./overlay.nix { inherit lix versionSuffix; inherit lib; }) ];
First-time contributor

Why not inherit lix versionSuffix lib; directly ?

Why not `inherit lix versionSuffix lib;` directly ?
ma27 marked this conversation as resolved
flake.nix Outdated
@ -2,7 +2,6 @@
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.lix = {
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
First-time contributor

I'm unsure about this, but now that the lix input is a flake, shouldn't it follow nixpkgs ? If so, this should also be stated in the docs I mentioned in the other comment. Anyways, in the updated docs, as it will be told that lix needs to be a flake, and that the lix input of this module should be overridden, it will also be told to follow the user's nixpkgs (if, again, that's needed).

I'm unsure about this, but now that the `lix` input is a flake, shouldn't it follow `nixpkgs` ? If so, this should also be stated in the docs I mentioned in the other comment. Anyways, in the updated docs, as it will be told that `lix` needs to be a flake, and that the `lix` input of this module should be overridden, it will also be told to follow the user's `nixpkgs` (if, again, that's needed).
First-time contributor

Upon further thought, in the perspective of the cache, since lix is built against newer versions of nixpkgs, I think it's best to make the nixpkgs input of lix follow nixpkgs. It's one less line to explicitly specify in users' flake inputs.

Upon further thought, in the perspective of the cache, since `lix` is built against newer versions of `nixpkgs`, I think it's best to make the `nixpkgs` input of `lix` follow `nixpkgs`. It's one less line to explicitly specify in users' flake inputs.
ma27 marked this conversation as resolved
First-time contributor

So I've noticed another hash mismatch: those of nix-eval-jobs differ. I can't say for nix-doc and system-profile as these seem not to be built by hydra or provided by lix.

So I've noticed another hash mismatch: those of `nix-eval-jobs` differ. I can't say for `nix-doc` and `system-profile` as these seem not to be built by hydra or provided by `lix`.
ma27 force-pushed lix-flake-consistent from f04da67df4
All checks were successful
/ build (aarch64-linux) (pull_request) Successful in 8m10s
/ build (x86_64-linux) (pull_request) Successful in 22m55s
to 6a0d1ff12c
All checks were successful
/ build (x86_64-linux) (pull_request) Successful in 1m24s
/ build (aarch64-linux) (pull_request) Successful in 2m27s
2026-07-29 21:37:38 +00:00
Compare
Author
Member

@xaltsc I think our changes belong into one unit, so I squashed them and added a co-authored-by to not lose attribution here. Is that OK for you?

If so, @raito , I believe this is good to go.

@xaltsc I think our changes belong into one unit, so I squashed them and added a co-authored-by to not lose attribution here. Is that OK for you? If so, @raito , I believe this is good to go.
xaltsc approved these changes 2026-07-30 03:53:11 +00:00
First-time contributor

@ma27 wrote in #112 (comment):

@xaltsc I think our changes belong into one unit, so I squashed them and added a co-authored-by to not lose attribution here. Is that OK for you?

If so, @raito , I believe this is good to go.

Fine for me :)

@ma27 wrote in https://git.lix.systems/lix-project/nixos-module/pulls/112#issuecomment-19636: > @xaltsc I think our changes belong into one unit, so I squashed them and added a co-authored-by to not lose attribution here. Is that OK for you? > > If so, @raito , I believe this is good to go. Fine for me :)
overlay.nix Outdated
@ -60,3 +63,3 @@
# If it's not available, I guess just do pkgs.lix.
# FIXME: does this cause problems in support channels?
lixPackageToUse = if lix != null then lixPackageFromSource else (prev.lixPackageSets."${lixAttrName}".lix or prev.lix);
lixPackageToUse = branchLix (prev.lixPackageSets."${lixAttrName}".lix or prev.lix) prev.nix;
First-time contributor

You just forgot to mention in the commit message that lix now also comes from the overlay.

You just forgot to mention in the commit message that `lix` now also comes from the overlay.
Author
Member

Isn't that what the commit message says though? Apply lix.overlays.default when not using Lix from nixpkgs

Isn't that what the commit message says though? `Apply lix.overlays.default when not using Lix from nixpkgs`
First-time contributor

Well, the overlay doesn't provide a lix package (hence prev.nix, which is Lix from the overlay), so it's a tiny bit more than applying the overlay. It's a detail anyway and kind of confusing.

Well, the overlay doesn't provide a `lix` package (hence `prev.nix`, which is Lix from the overlay), so it's a tiny bit more than applying the overlay. It's a detail anyway and kind of confusing.
Author
Member

You're talking about the overlay from inputs.lix?
Sure, but it's been the case before that the overlay in this repo has lix = maybeWarnWrongMajor (maybeWarnDuplicate lixPackageToUse);. This is nothing new.

You're talking about the overlay from `inputs.lix`? Sure, but it's been the case before that the overlay in this repo has `lix = maybeWarnWrongMajor (maybeWarnDuplicate lixPackageToUse);`. This is nothing new.
Author
Member

ping @xaltsc

ping @xaltsc
First-time contributor

It's just that before, IIRC, lixPackageToUse was repackaged and did not come from the overlay's nix. Again, it's a minor issue, do as you please, I don't think it impacts the overall quality of the PR that much.

It's just that before, IIRC, `lixPackageToUse` was repackaged and did not come from the overlay's `nix`. Again, it's a minor issue, do as you please, I don't think it impacts the overall quality of the PR that much.
ma27 marked this conversation as resolved
First-time contributor

Could you ping me everywhere you can when this gets merged, so that I update the wiki as soon as possible ?

Perhaps this is worth an announcement as well on the matrix channel(s) ?

Could you ping me everywhere you can when this gets merged, so that I update the wiki as soon as possible ? Perhaps this is worth an announcement as well on the matrix channel(s) ?
@ -1,10 +1,10 @@
{ lix, versionSuffix ? "" }:
Owner

This is an API break theoretically but that sounds reasonable to me. Perhaps, keep it as an option and warn over it and don't use it?

This is an API break theoretically but that sounds reasonable to me. Perhaps, keep it as an option and warn over it and don't use it?
ma27 marked this conversation as resolved
module.nix Outdated
@ -1,5 +1,5 @@
{ lix, versionSuffix ? "" }:
Owner

This is an API break theoretically but that sounds reasonable to me. Perhaps, keep it as an option and warn over it and don't use it?

This is an API break theoretically but that sounds reasonable to me. Perhaps, keep it as an option and warn over it and don't use it?
ma27 marked this conversation as resolved
nixos-module.nix Outdated
@ -1,5 +1,5 @@
{ lix, versionSuffix ? "" }:
Owner

This is an API break theoretically but that sounds reasonable to me. Perhaps, keep it as an option and warn over it and don't use it?

This is an API break theoretically but that sounds reasonable to me. Perhaps, keep it as an option and warn over it and don't use it?
ma27 marked this conversation as resolved
overlay.nix Outdated
@ -1,11 +1,14 @@
{ lix, versionSuffix ? "" }:
Owner

This is an API break theoretically but that sounds reasonable to me. Perhaps, keep it as an option and warn over it and don't use it?

This is an API break theoretically but that sounds reasonable to me. Perhaps, keep it as an option and warn over it and don't use it?
Author
Member

I'm not sure how this helps though?
You're now expected to pass in lib and that won't appear magically, so breakage will be there in any case.

I'm not sure how this helps though? You're now expected to pass in `lib` and that won't appear magically, so breakage will be there in any case.
Author
Member

As discussed in person, the breakage is inevitable here, so the arg can be removed right away.

As discussed in person, the breakage is inevitable here, so the arg can be removed right away.
ma27 marked this conversation as resolved
raito approved these changes 2026-07-31 14:26:14 +00:00
raito left a comment

LGTM, modulo the API breakage. I'd like to keep versionSuffix and warn on it. (I know I use it).

LGTM, modulo the API breakage. I'd like to keep `versionSuffix` and warn on it. (I know I use it).
Author
Member

@raito I don't remember where and who, but somebody pointed out that it's hard to get cache hits when not using flakes.
The reason is the usage of lastModifiedDate which doesn't exist in fetchGit or rather any non-experimental fetch API.

Doesn't have to happen in this PR, but something we should also fix. What's your take on this?
Remove it or expose lastModifiedDate as well? Not sure I even see potential for backwards-incompatibility with such a change.

@raito I don't remember where and who, but somebody pointed out that it's hard to get cache hits when not using flakes. The reason is the usage of `lastModifiedDate` which doesn't exist in fetchGit or rather any non-experimental fetch API. Doesn't have to happen in this PR, but something we should also fix. What's your take on this? Remove it or expose lastModifiedDate as well? Not sure I even see potential for backwards-incompatibility with such a change.
ma27 force-pushed lix-flake-consistent from 6a0d1ff12c
All checks were successful
/ build (x86_64-linux) (pull_request) Successful in 1m24s
/ build (aarch64-linux) (pull_request) Successful in 2m27s
to 45ef34e4c7
Some checks failed
/ build (aarch64-linux) (pull_request) Has been cancelled
/ build (x86_64-linux) (pull_request) Has been cancelled
2026-08-21 15:29:21 +00:00
Compare
ma27 force-pushed lix-flake-consistent from 45ef34e4c7
Some checks failed
/ build (aarch64-linux) (pull_request) Has been cancelled
/ build (x86_64-linux) (pull_request) Has been cancelled
to 4e1764c6be
All checks were successful
/ build (x86_64-linux) (pull_request) Successful in 5m24s
/ build (aarch64-linux) (pull_request) Successful in 6m3s
2026-08-21 15:31:20 +00:00
Compare
ma27 merged commit b88667e364 into main 2026-08-21 15:51:22 +00:00
ma27 deleted branch lix-flake-consistent 2026-08-21 15:51:22 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 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/nixos-module!112
No description provided.