home-manager: Use path: URI type for flake default (#3646)

Nix interprets a path-like URI as a git repository if any of the path's
parents is a git repository. Since home-manager uses a default flake URI
of ~/.config/nixpkgs/flake.nix, if you have a git repository as your
home directory and a '*' .gitignore it leads to the following problems:

    evaluating derivation 'git+file:///Users/dongcarl?dir=.config%2fnixpkgs#homeConfigurations."dongcarl".activationPackage'
    The following paths are ignored by one of your .gitignore files:
    .config

This is solved by explicitly specifying the `path:` URI type prefix for
the default flake URI argument.
This commit is contained in:
Carl Dong 2023-07-03 11:00:10 -04:00 committed by GitHub
parent c85d9137db
commit 8c66b46a86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -156,7 +156,7 @@ function setFlakeAttribute() {
fi
if [[ -v configFlake ]]; then
FLAKE_ARG="$(dirname "$(readlink -f "$configFlake")")"
FLAKE_ARG="path:$(dirname "$(readlink -f "$configFlake")")"
fi
fi