From a3de5058f339cd2476ee452742df2b4580aae55a Mon Sep 17 00:00:00 2001 From: Payas Relekar Date: Wed, 8 Jun 2022 17:35:26 +0530 Subject: [PATCH] Hermes: Attempt to fix nixos-rebuild issue due to git git fixed a CVE that makes directories not owned by the user to appear as not git repo. Since my /etc/nixos is owned by my user, but nixos-rebuild is performed by root, this is an issue. Simplest and best workaround is to add this repo as safe directory. This commit fixes this by way of setting default config for root user. I also decided to go all in and setup full home-manager config identical to my user here. I'll probably remove the FIsh config, but will see how it goes. --- modules/root-home.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 modules/root-home.nix diff --git a/modules/root-home.nix b/modules/root-home.nix new file mode 100644 index 0000000..c80cb82 --- /dev/null +++ b/modules/root-home.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./common-home.nix + ]; + + programs = { + git = { + extraConfig = { + safe.directory = [ "/etc/nixos" ]; + }; + }; + }; +}