From 67c30c86e654354bbb649cf10242cdae4689edfb Mon Sep 17 00:00:00 2001 From: ediblerope Date: Thu, 8 May 2025 20:11:09 +0100 Subject: [PATCH] Added username to allow usage of git and made the folder a safe folder for git --- configuration.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/configuration.nix b/configuration.nix index f32736a..fac5f6f 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,6 +4,10 @@ { config, lib, pkgs, ... }: +let + username = "fred"; +in + { imports = [ # Include the results of the hardware scan. @@ -45,6 +49,19 @@ boot.loader = { ############## users.users.fred = { isNormalUser = true; initialPassword = "123"; extraGroups = [ "wheel" "networkmanager" ];}; +system.activationScripts.fix-nixos-perms = '' + chown -R ${username}:users /etc/nixos/.git + chmod -R g+rw /etc/nixos/.git + ''; + +############# +# git setup # +############# +environment.etc."gitconfig".text = '' + [safe] + directory = /etc/nixos +''; + ######################## # User personalisation # ########################