From 8c66b46a86afa21763766ef97d7c8be5f3954e2b Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Mon, 3 Jul 2023 11:00:10 -0400 Subject: [PATCH] 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. --- home-manager/home-manager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index 85c6da87..7b7b6fe2 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -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