home-manager: fix error message in flake check

Before this commit, running the hasFlakeSupport function causes an
error message

    error: experimental Nix feature 'nix-command' is disabled; use
    '--extra-experimental-features nix-command' to override

when the Nix installation does not support the nix tool. The error
message should not be visible to the user since its just part of the
Flake support check.
This commit is contained in:
Robert Helgesson 2023-05-21 23:07:55 +02:00
parent 27ef11f021
commit 13a74643d7
Failed to generate hash of commit

View file

@ -53,7 +53,7 @@ function setWorkDir() {
# Checks whether the 'flakes' and 'nix-command' Nix options are enabled. # Checks whether the 'flakes' and 'nix-command' Nix options are enabled.
function hasFlakeSupport() { function hasFlakeSupport() {
type -p nix > /dev/null \ type -p nix > /dev/null \
&& nix show-config \ && nix show-config 2> /dev/null \
| grep experimental-features \ | grep experimental-features \
| grep flakes \ | grep flakes \
| grep -q nix-command | grep -q nix-command