From 530f4023fcda8c56f48630a43a9717ce6e7f8b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Wed, 2 Oct 2024 14:13:34 +0100 Subject: [PATCH] configure git for work --- nixos/boxes/cushy/default.nix | 3 ++- nixos/git/default.nix | 10 ++++++++-- nixos/git/home.nix | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/nixos/boxes/cushy/default.nix b/nixos/boxes/cushy/default.nix index 7d14ca80..01fb3394 100644 --- a/nixos/boxes/cushy/default.nix +++ b/nixos/boxes/cushy/default.nix @@ -7,7 +7,7 @@ ... }: { imports = [ - + (import ../../git { inherit pkgs; inherit lib; inherit config; cyplo.username = "Cyryl.Plotnicki"; }) ]; services.nix-daemon.enable = true; @@ -64,6 +64,7 @@ home.sessionPath = ["$HOME/bin"]; home.packages = with pkgs; []; programs = { + git.userEmail = "cyryl.plotnicki@cushon.co.uk"; }; }; } diff --git a/nixos/git/default.nix b/nixos/git/default.nix index 21b01962..f8e93032 100644 --- a/nixos/git/default.nix +++ b/nixos/git/default.nix @@ -2,7 +2,13 @@ config, pkgs, lib, + cyplo, ... -}: { - home-manager.users.cyryl = {...}: {imports = [./home.nix];}; +}: +let + username = if cyplo ? username then "${cyplo.username}" else "cyryl"; +in +{ + + home-manager.users."${username}" = {...}: {imports = [./home.nix];}; } diff --git a/nixos/git/home.nix b/nixos/git/home.nix index 0290eb8e..547fcd2b 100644 --- a/nixos/git/home.nix +++ b/nixos/git/home.nix @@ -2,13 +2,14 @@ config, pkgs, inputs, + lib, ... }: { programs.git = { enable = true; lfs.enable = true; userName = "Cyryl PÅ‚otnicki"; - userEmail = "cyplo@cyplo.dev"; + userEmail = lib.mkDefault "cyplo@cyplo.dev"; delta = { enable = true; options = {