feat(home-manager): manage git config from upstream dotfiles repository
This commit is contained in:
parent
e85351d49e
commit
20cc8bee1b
@ -22,5 +22,5 @@
|
||||
nix-diff
|
||||
];
|
||||
};
|
||||
home-manager.users.transcaffeine = import ./home-manager.nix;
|
||||
home-manager.users.transcaffeine = import ./home-manager/default.nix;
|
||||
}
|
||||
|
@ -1,4 +1,7 @@
|
||||
{ lib, pkgs, ... }: {
|
||||
imports = [
|
||||
./git.nix
|
||||
];
|
||||
home.stateVersion = "24.11";
|
||||
services.darkman = {
|
||||
enable = true;
|
||||
@ -9,4 +12,6 @@
|
||||
dbusserver = true;
|
||||
};
|
||||
};
|
||||
|
||||
home.preferXdgDirectories = true;
|
||||
}
|
31
users/transcaffeine/home-manager/git.nix
Normal file
31
users/transcaffeine/home-manager/git.nix
Normal file
@ -0,0 +1,31 @@
|
||||
{ lib, ... }: {
|
||||
programs.git = let
|
||||
gitconfig = builtins.fromTOML (
|
||||
lib.readFile
|
||||
((builtins.fetchGit {
|
||||
url = "https://git.finally.coffee/transcaffeine/dotfiles.git";
|
||||
ref = "main";
|
||||
rev = "3811febee134e62d3539c472005f04710d913611";
|
||||
shallow = false;
|
||||
}).outPath + "/config/git/gitconfig")
|
||||
);
|
||||
key = gitconfig.user.signingKey;
|
||||
aliases = gitconfig.alias;
|
||||
in {
|
||||
enable = true;
|
||||
userName = gitconfig.user.name;
|
||||
userEmail = gitconfig.user.email;
|
||||
signing = {
|
||||
signByDefault = true;
|
||||
inherit key;
|
||||
};
|
||||
inherit aliases;
|
||||
extraConfig = {
|
||||
format = gitconfig.format;
|
||||
commit = gitconfig.commit;
|
||||
tag = gitconfig.tag;
|
||||
pull = gitconfig.pull;
|
||||
rebase = gitconfig.rebase;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user