feat(hm): add git config to rafiq home, use forAllUsers'

This commit is contained in:
Mohammad Rafiq 2025-07-07 09:25:48 +08:00
parent 46f631aab1
commit a71cbb544a
No known key found for this signature in database
2 changed files with 25 additions and 1 deletions

23
nix/homes/rafiq/git.nix Normal file
View file

@ -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";
};
};
};
}

View file

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