Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --reference-lock-file to mirror nix 1.15.0 feature #210

Closed
wants to merge 4 commits into from

Conversation

colemickens
Copy link
Member

Fixes #209 by adding --reference-lock-file to the CLI.

Still testing, so draft.

Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/dcc36e45d054d7bb554c9cdab69093debd91a0b5' (2023-04-01)
  → 'github:hercules-ci/flake-parts/006c75898cf814ef9497252b022e91c946ba8e17' (2023-05-08)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/1a9d9175ecc48ecd033062fa09b1834d13ae9c69' (2023-04-13)
  → 'github:NixOS/nixpkgs/ff79501f458bcb4aa3633f3d1cc599a080b14e21' (2023-05-11)
@@ -101,6 +102,11 @@ struct MyArgs : MixEvalArgs, MixCommonArgs {
addFlag({.longName = "flake",
.description = "build a flake",
.handler = {&flake, true}});

addFlag({.longName = "reference-lock-file",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Please also update the README.

@@ -43,6 +43,7 @@ using namespace nlohmann;
struct MyArgs : MixEvalArgs, MixCommonArgs {
std::string releaseExpr;
Path gcRootsDir;
Path referenceLockFilePath;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Path referenceLockFilePath;
std::optional<std::string> referenceLockFilePath;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows to override more flake lock flags later
@Mic92
Copy link
Member

Mic92 commented May 11, 2023

macos build failures are unrelated.

@colemickens
Copy link
Member Author

I added your commit. Initial testing... is not working though.

[cole@zeph:~/code/nixcfg]$ nix-eval-jobs --flake .#toplevels.zeph --reference-lock-file ./flake.test.lock
warning: unknown setting 'allowed-users'
warning: unknown setting 'trusted-users'
warning: `--gc-roots-dir' not specified
warning: Git tree '/home/cole/code/nixcfg' is dirty
error: derivation must have valid outputs: error:
              … while calling the 'getAttr' builtin

                at //builtin/derivation.nix:19:19: (source not available)

              … while calling the 'derivationStrict' builtin

                at //builtin/derivation.nix:9:12: (source not available)

              (stack trace truncated; use '--show-trace' to show the full trace)

              error: getting status of '/nix/store/7p9mlmjkk51rc72v0640xlwmx4hv0qay-source/flake.lock': No such file or directory
{"attr":"","attrPath":[],"error":"error: derivation must have valid outputs: error:\n              … while calling the 'getAttr' builtin\n\n                at //builtin/derivation.nix:19:19: (source not available)\n\n              … while calling the 'derivationStrict' builtin\n\n                at //builtin/derivation.nix:9:12: (source not available)\n\n              (stack trace truncated; use '--show-trace' to show the full trace)\n\n              error: getting status of '/nix/store/7p9mlmjkk51rc72v0640xlwmx4hv0qay-source/flake.lock': No such file or directory"}

@Mic92
Copy link
Member

Mic92 commented Dec 10, 2023

This pull request seems to be stalled. Please re-open if you intend to continue working on this.

@Mic92 Mic92 closed this Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flakes: support the new nix feature --reference-lock-file
2 participants