From 536b3fb883ddb6aa75756755f61b76806fe71009 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Mon, 6 Feb 2023 23:11:00 -0500 Subject: [PATCH] home-manager: Use path: URI type for flake default 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 85c6da8716f6..7b7b6fe26dfb 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