From a71cbb544a54751982f581586712661446991d80 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Mon, 7 Jul 2025 09:25:48 +0800 Subject: [PATCH] feat(hm): add git config to rafiq home, use forAllUsers' --- nix/homes/rafiq/git.nix | 23 +++++++++++++++++++++++ nix/modules/home-manager.nix | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 nix/homes/rafiq/git.nix diff --git a/nix/homes/rafiq/git.nix b/nix/homes/rafiq/git.nix new file mode 100644 index 0000000..8745879 --- /dev/null +++ b/nix/homes/rafiq/git.nix @@ -0,0 +1,23 @@ +{ + flake.homes.rafiq = { + # Testing the import in home-manager.nix + home.shellAliases = { + gs = "git status"; + gc = "git commit"; + gcam = "git commit -am"; + gu = "git push"; + gy = "git pull"; + gdh = "git diff HEAD"; + }; + programs.git = { + signing.signByDefault = true; + extraConfig = { + init.defaultBranch = "prime"; + push.autoSetupRemote = true; + pull.rebase = false; + core.editor = "$EDITOR"; + gpg.format = "ssh"; + }; + }; + }; +} diff --git a/nix/modules/home-manager.nix b/nix/modules/home-manager.nix index 2d6bf83..8726798 100644 --- a/nix/modules/home-manager.nix +++ b/nix/modules/home-manager.nix @@ -1,6 +1,6 @@ { inputs, config, ... }: let - inherit (cfg.lib) flattenAttrs; + inherit (cfg.lib) forAllUsers' flattenAttrs; cfg = config.flake; hm = inputs.home-manager; globalCfg = { @@ -9,6 +9,7 @@ let sharedModules = [ (flattenAttrs (cfg.modules.homeManager or { })) ]; + users = forAllUsers' (name: _: cfg.homes.${name}); }; in {