add git option
This commit is contained in:
parent
2599fef92b
commit
4f386934fe
3 changed files with 60 additions and 5 deletions
|
|
@ -20,6 +20,11 @@
|
||||||
youthlic.programs = {
|
youthlic.programs = {
|
||||||
helix.enable = true;
|
helix.enable = true;
|
||||||
gpg.enable = true;
|
gpg.enable = true;
|
||||||
|
git = {
|
||||||
|
email = "uilc.youthilc@gmail.com";
|
||||||
|
name = "ulic-youthlic";
|
||||||
|
signKey = "C6FCBD7F49E1CBBABD6661F7FC02063F04331A95";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.userDirs = {
|
xdg.userDirs = {
|
||||||
|
|
@ -38,11 +43,6 @@
|
||||||
home.homeDirectory = "/home/${unixName}";
|
home.homeDirectory = "/home/${unixName}";
|
||||||
home.stateVersion = "24.11";
|
home.stateVersion = "24.11";
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
userName = "Ulic-youthlic";
|
|
||||||
userEmail = "ulic.youthlic@gmail.com";
|
|
||||||
};
|
|
||||||
programs.obs-studio = {
|
programs.obs-studio = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = with pkgs.obs-studio-plugins; [
|
plugins = with pkgs.obs-studio-plugins; [
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
./nix.nix
|
./nix.nix
|
||||||
./helix
|
./helix
|
||||||
./gpg
|
./gpg
|
||||||
|
./git.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
|
||||||
54
home/modules/git.nix
Normal file
54
home/modules/git.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
youthlic.programs.git = {
|
||||||
|
email = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = ''
|
||||||
|
git email
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
example = ''youthlic'';
|
||||||
|
description = ''
|
||||||
|
git name
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
signKey = lib.mkOption {
|
||||||
|
type = lib.types.addCheck (lib.types.nullOr lib.types.str) (
|
||||||
|
x: (x == null || config.youthlic.programs.gpg.enable)
|
||||||
|
);
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
key fingerprint for sign commit
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config =
|
||||||
|
let
|
||||||
|
cfg = config.youthlic.programs.git;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
programs.lazygit = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
programs.git = lib.mkMerge [
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
userEmail = cfg.email;
|
||||||
|
userName = cfg.name;
|
||||||
|
delta = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
(lib.mkIf (cfg.signKey != null) {
|
||||||
|
signing = {
|
||||||
|
signByDefault = true;
|
||||||
|
key = cfg.signKey;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue