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.
This commit is contained in:
Payas Relekar 2022-06-08 17:35:26 +05:30
parent b706c3c4f8
commit a3de5058f3

15
modules/root-home.nix Normal file
View file

@ -0,0 +1,15 @@
{ config, pkgs, ... }:
{
imports = [
./common-home.nix
];
programs = {
git = {
extraConfig = {
safe.directory = [ "/etc/nixos" ];
};
};
};
}