Skip to content

nix copy: Add --profile and --out-link flags#11657

Merged
edolstra merged 8 commits into
NixOS:masterfrom
DeterminateSystems:nix-copy-gc
Nov 20, 2024
Merged

nix copy: Add --profile and --out-link flags#11657
edolstra merged 8 commits into
NixOS:masterfrom
DeterminateSystems:nix-copy-gc

Conversation

@edolstra

@edolstra edolstra commented Oct 8, 2024

Copy link
Copy Markdown
Member

Motivation

This allows nix copy to atomically copy a store path and point a profile to it, without the risk that the store path might be GC'ed in between. This is useful for instance when deploying a new NixOS system profile from a remote store.

Context

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

This allows `nix copy` to atomically copy a store path and point a
profile to it, without the risk that the store path might be GC'ed in
between. This is useful for instance when deploying a new NixOS system
profile from a remote store.
@github-actions github-actions Bot added documentation new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority labels Oct 8, 2024

@fricklerhandwerk fricklerhandwerk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Needs release notes and some way to document in the command reference that this will exhibit the behavior outlined in the PR description. Right now --profile just says "The profile to operate on", and that will show on every command that uses the mixin - not very informative.

The cheap way to add the relevant docs for this command is adding an appropriate blurb to the new example. Ideally though we'd have a way to annotate what a flag, which enabled by a mixin, means for each command that uses it. Probably overkill, but mixins seem to add a set of possible behaviors, so we'd need to describe which behaviors are used how.

@edolstra edolstra changed the title nix copy: Add --profile flag nix copy: Add --profile and --out-link flags Oct 8, 2024
@edolstra

edolstra commented Oct 8, 2024

Copy link
Copy Markdown
Member Author

@fricklerhandwerk I agree, but that's a bit of a general problem beyond the scope of this PR, since currently every MixProfile command has this issue.

What do you mean with "appropriate blurb"?

@edolstra

edolstra commented Oct 8, 2024

Copy link
Copy Markdown
Member Author

#11659 for the --profile documentation issue.

@arianvp

arianvp commented Nov 14, 2024

Copy link
Copy Markdown
Member

Fixes #11790

@tomberek tomberek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like there are some formatting things. Otherwise it looks like it works as expected. (x86-64_linux)

@edolstra edolstra enabled auto-merge November 20, 2024 20:07
@edolstra edolstra merged commit 18ab72a into NixOS:master Nov 20, 2024
@edolstra edolstra deleted the nix-copy-gc branch November 20, 2024 20:48
@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nix-2-26-released/59211/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants