Flake inputs of type file have no last modified timestamp #616

Open
opened 2025-01-07 19:00:04 +00:00 by jade · 0 comments
Owner

It seems that if you create a flake with an input that is of type file, that input will not get a last modified timestamp in the lock file.

/tmp/flake-foo » nix flake metadata
warning: creating lock file '/private/tmp/flake-foo/flake.lock':
• Added input 'hackage-index':
    'https://api.github.com/repos/commercialhaskell/all-cabal-hashes/tarball/e35b6f1d9b94a00f20f2678d1124b611f902690b?narHash=sha256-TWAW17HUZoScyc6sFDk3umz9i3XCxTiIaLImn7Gu%2B8Y%3D'
Resolved URL:  path:/private/tmp/flake-foo
Locked URL:    path:/private/tmp/flake-foo?lastModified=1736276518&narHash=sha256-FIj21gdkfS5QFFKfTtM3F4t2ZBfiZvteCSNluQ/uUYI%3D
Path:          /nix/store/ynf84i28jq7hy02sxplqs6b111ykkkd0-source
Last modified: 2025-01-07 11:01:58
Inputs:
└───hackage-index: https://api.github.com/repos/commercialhaskell/all-cabal-hashes/tarball/e35b6f1d9b94a00f20f2678d1124b611f902690b?narHash=sha256-TWAW17HUZoScyc6sFDk3umz9i3XCxTiIaLImn7Gu%2B8Y%3D
/tmp/flake-foo » cat flake.nix
{

  inputs.hackage-index = {
    type = "file";
    flake = false;
    url = "https://api.github.com/repos/commercialhaskell/all-cabal-hashes/tarball/e35b6f1d9b94a00f20f2678d1124b611f902690b";
  };

  outputs = { hackage-index }: {};
}
/tmp/flake-foo » cat flake.lock
{
  "nodes": {
    "hackage-index": {
      "flake": false,
      "locked": {
        "narHash": "sha256-TWAW17HUZoScyc6sFDk3umz9i3XCxTiIaLImn7Gu+8Y=",
        "type": "file",
        "url": "https://api.github.com/repos/commercialhaskell/all-cabal-hashes/tarball/e35b6f1d9b94a00f20f2678d1124b611f902690b"
      },
      "original": {
        "type": "file",
        "url": "https://api.github.com/repos/commercialhaskell/all-cabal-hashes/tarball/e35b6f1d9b94a00f20f2678d1124b611f902690b"
      }
    },
    "root": {
      "inputs": {
        "hackage-index": "hackage-index"
      }
    }
  },
  "root": "root",
  "version": 7
}

Note that this probably is impossible to fix on the Lix team since it would probably cause incompatibilities with CppNix due to flake.lock being generally busted, but I am filing it since it is still annoying behaviour.

It seems that if you create a flake with an input that is of type `file`, that input will not get a last modified timestamp in the lock file. ``` /tmp/flake-foo » nix flake metadata warning: creating lock file '/private/tmp/flake-foo/flake.lock': • Added input 'hackage-index': 'https://api.github.com/repos/commercialhaskell/all-cabal-hashes/tarball/e35b6f1d9b94a00f20f2678d1124b611f902690b?narHash=sha256-TWAW17HUZoScyc6sFDk3umz9i3XCxTiIaLImn7Gu%2B8Y%3D' Resolved URL: path:/private/tmp/flake-foo Locked URL: path:/private/tmp/flake-foo?lastModified=1736276518&narHash=sha256-FIj21gdkfS5QFFKfTtM3F4t2ZBfiZvteCSNluQ/uUYI%3D Path: /nix/store/ynf84i28jq7hy02sxplqs6b111ykkkd0-source Last modified: 2025-01-07 11:01:58 Inputs: └───hackage-index: https://api.github.com/repos/commercialhaskell/all-cabal-hashes/tarball/e35b6f1d9b94a00f20f2678d1124b611f902690b?narHash=sha256-TWAW17HUZoScyc6sFDk3umz9i3XCxTiIaLImn7Gu%2B8Y%3D /tmp/flake-foo » cat flake.nix { inputs.hackage-index = { type = "file"; flake = false; url = "https://api.github.com/repos/commercialhaskell/all-cabal-hashes/tarball/e35b6f1d9b94a00f20f2678d1124b611f902690b"; }; outputs = { hackage-index }: {}; } /tmp/flake-foo » cat flake.lock { "nodes": { "hackage-index": { "flake": false, "locked": { "narHash": "sha256-TWAW17HUZoScyc6sFDk3umz9i3XCxTiIaLImn7Gu+8Y=", "type": "file", "url": "https://api.github.com/repos/commercialhaskell/all-cabal-hashes/tarball/e35b6f1d9b94a00f20f2678d1124b611f902690b" }, "original": { "type": "file", "url": "https://api.github.com/repos/commercialhaskell/all-cabal-hashes/tarball/e35b6f1d9b94a00f20f2678d1124b611f902690b" } }, "root": { "inputs": { "hackage-index": "hackage-index" } } }, "root": "root", "version": 7 } ``` Note that this probably is impossible to fix on the Lix team since it would probably cause incompatibilities with CppNix due to flake.lock being generally busted, but I am filing it since it is still annoying behaviour.
jade changed title from Flakes to Flakes with inputs of type file have no last modified timestamp 2025-01-07 19:00:34 +00:00
jade changed title from Flakes with inputs of type file have no last modified timestamp to Flake inputs of type file have no last modified timestamp 2025-01-07 19:00:45 +00:00
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#616
No description provided.