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

Switch to specialization (or no specialization) without building etc. #216

Open
dschrempf opened this issue Jan 17, 2025 · 0 comments
Open

Comments

@dschrempf
Copy link

dschrempf commented Jan 17, 2025

I am writing this ticket, because nh has replaced nearly all of my custom NixOS related scripts (which is great), but one:

We can use nh os switch -s X or nh os switch -S to build the system, and activate the specialization (next to other side effects).

However, many times, I only want to switch the specialization, without building anything nor changing the boot default.

function switch {
    if [[ $1 == "none" ]]; then
        path="/nix/var/nix/profiles/system"
    else
        path="/nix/var/nix/profiles/system/specialisation/$1"
    fi
    sudo "${path}/bin/switch-to-configuration" test
}

(Note the test part, which only activates the configuration, but does nothing else).

What are your thoughts?

EDIT: I just saw there is nh os test, but it also builds the derivation.

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

No branches or pull requests

1 participant