In flakes, inputs.nixpkgs.follows = "lix/nixpkgs" causes it to be relocked to the latest revision #648

Open
opened 2025-01-24 18:49:13 +00:00 by jade · 1 comment
Owner
~/lix » git clone https://git.lix.systems/lix-project/nix-eval-jobs foo
Cloning into 'foo'...
remote: Enumerating objects: 1946, done.
remote: Counting objects: 100% (137/137), done.
remote: Compressing objects: 100% (137/137), done.
remote: Total 1946 (delta 87), reused 0 (delta 0), pack-reused 1809 (from 1)
Receiving objects: 100% (1946/1946), 488.63 KiB | 3.54 MiB/s, done.
Resolving deltas: 100% (1118/1118), done.

~/lix » cd foo

lix/foo » git rev-parse HEAD
6482bee40b89ab2c28d2e988848aa9ae0429d78c

lix/foo » nvim flake.nix # make some edits, see below

lix/foo » git diff flake.nix | cat

diff flake.nix:

diff --git a/flake.nix b/flake.nix
index cc805f2..93bf1f1 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,7 +1,7 @@
 {
   description = "Hydra's builtin hydra-eval-jobs as a standalone";

-  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small";
+  inputs.nixpkgs.follows = "lix/nixpkgs";
   inputs.flake-parts.url = "github:hercules-ci/flake-parts";
   inputs.flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
   inputs.treefmt-nix.url = "github:numtide/treefmt-nix";
@@ -10,7 +10,6 @@
   inputs.nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
   inputs.lix = {
     url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
-    inputs.nixpkgs.follows = "nixpkgs";
   };

   outputs = inputs @ { flake-parts, ... }:

Lock it:

lix/foo » nix flake lock
warning: updating lock file '/Users/jade/lix/foo/flake.lock':
• Updated input 'lix/nixpkgs':
    follows 'nixpkgs'
  → 'github:NixOS/nixpkgs/035f8c0853c2977b24ffc4d0a42c74f00b182cd8' (2025-01-23)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/bf68d76e54ac5da0d77f82656a37552996195e80' (2025-01-18)
  → follows 'lix/nixpkgs'

Note revision of nixpkgs from 2025-01-23! Yet see what Lix has locked:

lix/foo » nix flake metadata --inputs-from . lix
Resolved URL:  https://git.lix.systems/api/v1/repos/lix-project/lix/archive/079528098f5998ba13c88821a2eca1005c1695de.tar.gz?narHash=sha256-pgDJZjj4jpzkFxsqBTI/9Yb0n3gW%2BDvDtuv9SwQZZcs%3D&rev=079528098f5998ba13c88821a2eca1005c1695de
Locked URL:    https://git.lix.systems/api/v1/repos/lix-project/lix/archive/079528098f5998ba13c88821a2eca1005c1695de.tar.gz?narHash=sha256-pgDJZjj4jpzkFxsqBTI/9Yb0n3gW%2BDvDtuv9SwQZZcs%3D&rev=079528098f5998ba13c88821a2eca1005c1695de
Description:   Lix: A modern, delicious implementation of the Nix package manager
Path:          /nix/store/gl8c7im641zwckcchp82fh1cn2w339i5-source
Revision:      079528098f5998ba13c88821a2eca1005c1695de
Last modified: 2025-01-18 13:04:46
Inputs:
├───flake-compat: github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33
│   Last modified: 2023-10-04 06:37:54
├───nix2container: github:nlewo/nix2container/fa6bb0a1159f55d071ba99331355955ae30b3401
│   Last modified: 2024-08-29 22:48:55
├───nixpkgs: github:NixOS/nixpkgs/9ecb50d2fae8680be74c08bb0a995c5383747f89
│   Last modified: 2024-12-04 13:42:25
├───nixpkgs-regression: github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2
│   Last modified: 2022-01-24 11:20:45
└───pre-commit-hooks: github:cachix/git-hooks.nix/6f4e2a2112050951a314d2733a994fbab94864c6
    Last modified: 2024-12-04 05:28:28

So it took the spec from lix and relocked it! Busted.

Here's what it did to the lock file:

lix/foo » git cat-file -p HEAD:flake.lock > flake.lock.old
lix/foo » json-diff flake.lock.old flake.lock
 {
   nodes: {
     lix: {
       inputs: {
-        nixpkgs: [
-          "nixpkgs"
-        ]
+        nixpkgs: "nixpkgs"
       }
     }
     nixpkgs: {
       locked: {
-        lastModified: 1737226685
+        lastModified: 1737672001
-        narHash: "sha256-34x0t/x5SkClo04gaG+KPBwN9JtXjFSQGTl//Yry4Gc="
+        narHash: "sha256-YnHJJ19wqmibLQdUeq9xzE6CjrMA568KN/lFPuSVs4I="
-        rev: "bf68d76e54ac5da0d77f82656a37552996195e80"
+        rev: "035f8c0853c2977b24ffc4d0a42c74f00b182cd8"
       }
     }
     root: {
       inputs: {
-        nixpkgs: "nixpkgs"
+        nixpkgs: [
+          "lix"
+          "nixpkgs"
+        ]
       }
     }
   }
 }
nix (Lix, like Nix) 2.93.0-dev-pre20250122-1fe6064
System type: aarch64-darwin
Additional system types: x86_64-darwin
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /Users/jade/.config/nix/nix.conf:/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/xivaab7i0ndb84r0gc46jszfzdfhwimg-lix-2.93.0-dev-pre20250122-1fe6064/share
``` ~/lix » git clone https://git.lix.systems/lix-project/nix-eval-jobs foo Cloning into 'foo'... remote: Enumerating objects: 1946, done. remote: Counting objects: 100% (137/137), done. remote: Compressing objects: 100% (137/137), done. remote: Total 1946 (delta 87), reused 0 (delta 0), pack-reused 1809 (from 1) Receiving objects: 100% (1946/1946), 488.63 KiB | 3.54 MiB/s, done. Resolving deltas: 100% (1118/1118), done. ~/lix » cd foo lix/foo » git rev-parse HEAD 6482bee40b89ab2c28d2e988848aa9ae0429d78c lix/foo » nvim flake.nix # make some edits, see below lix/foo » git diff flake.nix | cat ``` diff flake.nix: ```diff diff --git a/flake.nix b/flake.nix index cc805f2..93bf1f1 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "Hydra's builtin hydra-eval-jobs as a standalone"; - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small"; + inputs.nixpkgs.follows = "lix/nixpkgs"; inputs.flake-parts.url = "github:hercules-ci/flake-parts"; inputs.flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"; inputs.treefmt-nix.url = "github:numtide/treefmt-nix"; @@ -10,7 +10,6 @@ inputs.nix-github-actions.inputs.nixpkgs.follows = "nixpkgs"; inputs.lix = { url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz"; - inputs.nixpkgs.follows = "nixpkgs"; }; outputs = inputs @ { flake-parts, ... }: ``` Lock it: ``` lix/foo » nix flake lock warning: updating lock file '/Users/jade/lix/foo/flake.lock': • Updated input 'lix/nixpkgs': follows 'nixpkgs' → 'github:NixOS/nixpkgs/035f8c0853c2977b24ffc4d0a42c74f00b182cd8' (2025-01-23) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/bf68d76e54ac5da0d77f82656a37552996195e80' (2025-01-18) → follows 'lix/nixpkgs' ``` Note revision of nixpkgs from 2025-01-23! Yet see what Lix has locked: ``` lix/foo » nix flake metadata --inputs-from . lix Resolved URL: https://git.lix.systems/api/v1/repos/lix-project/lix/archive/079528098f5998ba13c88821a2eca1005c1695de.tar.gz?narHash=sha256-pgDJZjj4jpzkFxsqBTI/9Yb0n3gW%2BDvDtuv9SwQZZcs%3D&rev=079528098f5998ba13c88821a2eca1005c1695de Locked URL: https://git.lix.systems/api/v1/repos/lix-project/lix/archive/079528098f5998ba13c88821a2eca1005c1695de.tar.gz?narHash=sha256-pgDJZjj4jpzkFxsqBTI/9Yb0n3gW%2BDvDtuv9SwQZZcs%3D&rev=079528098f5998ba13c88821a2eca1005c1695de Description: Lix: A modern, delicious implementation of the Nix package manager Path: /nix/store/gl8c7im641zwckcchp82fh1cn2w339i5-source Revision: 079528098f5998ba13c88821a2eca1005c1695de Last modified: 2025-01-18 13:04:46 Inputs: ├───flake-compat: github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33 │ Last modified: 2023-10-04 06:37:54 ├───nix2container: github:nlewo/nix2container/fa6bb0a1159f55d071ba99331355955ae30b3401 │ Last modified: 2024-08-29 22:48:55 ├───nixpkgs: github:NixOS/nixpkgs/9ecb50d2fae8680be74c08bb0a995c5383747f89 │ Last modified: 2024-12-04 13:42:25 ├───nixpkgs-regression: github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2 │ Last modified: 2022-01-24 11:20:45 └───pre-commit-hooks: github:cachix/git-hooks.nix/6f4e2a2112050951a314d2733a994fbab94864c6 Last modified: 2024-12-04 05:28:28 ``` So it took the spec from lix and relocked it! Busted. Here's what it did to the lock file: ``` lix/foo » git cat-file -p HEAD:flake.lock > flake.lock.old lix/foo » json-diff flake.lock.old flake.lock ``` ```diff { nodes: { lix: { inputs: { - nixpkgs: [ - "nixpkgs" - ] + nixpkgs: "nixpkgs" } } nixpkgs: { locked: { - lastModified: 1737226685 + lastModified: 1737672001 - narHash: "sha256-34x0t/x5SkClo04gaG+KPBwN9JtXjFSQGTl//Yry4Gc=" + narHash: "sha256-YnHJJ19wqmibLQdUeq9xzE6CjrMA568KN/lFPuSVs4I=" - rev: "bf68d76e54ac5da0d77f82656a37552996195e80" + rev: "035f8c0853c2977b24ffc4d0a42c74f00b182cd8" } } root: { inputs: { - nixpkgs: "nixpkgs" + nixpkgs: [ + "lix" + "nixpkgs" + ] } } } } ``` ``` nix (Lix, like Nix) 2.93.0-dev-pre20250122-1fe6064 System type: aarch64-darwin Additional system types: x86_64-darwin Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /Users/jade/.config/nix/nix.conf:/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/xivaab7i0ndb84r0gc46jszfzdfhwimg-lix-2.93.0-dev-pre20250122-1fe6064/share ```
Author
Owner

This might be a generic problem with changing follows inputs to non-follows inputs for dependencies? I seem to have gotten it to happen by just renaming nixpkgs to nixpkgs2 in the root inputs and removing the follows line for the dependency.

This might be a generic problem with changing follows inputs to non-follows inputs for dependencies? I seem to have gotten it to happen by just renaming nixpkgs to nixpkgs2 in the root inputs and removing the follows line for the dependency.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#648
No description provided.