Added username to allow usage of git and made the folder a safe folder for git

This commit is contained in:
ediblerope 2025-05-08 20:11:09 +01:00
parent c3098ef8c9
commit 67c30c86e6

View file

@ -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 #
########################