feat: add jujutsu VCS

This commit is contained in:
2025-06-27 22:44:57 +08:00
parent 8fe95f071a
commit 64dd1077b6
5 changed files with 104 additions and 27 deletions

16
modules/cli/vcs/all.nix Normal file
View File

@@ -0,0 +1,16 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all command line tools";
optionPath = [
"cli"
"vcs"
"all"
];
config' = {
my.cli.vcs = {
git.enable = true;
jj.enable = true;
};
};
}

42
modules/cli/vcs/git.nix Normal file
View File

@@ -0,0 +1,42 @@
{
config,
lib,
pkgs,
username,
userfullname,
useremail,
...
}:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "git";
optionPath = [
"cli"
"vcs"
"git"
];
extraConfig = {
my.home = {
programs.git = {
userName = "${userfullname}";
userEmail = "${useremail}";
signing = {
format = "ssh";
signByDefault = true;
key = "/home/${username}/.ssh/id_ed25519";
};
extraConfig = {
push.autoSetupRemote = true;
gpg.ssh.allowedSignersFile =
(pkgs.writeText "allowed_signers" ''
imxyy1soope1@gmail.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOEFLUkyeaK8ZPPZdVNEmtx8zvoxi7xqS2Z6oxRBuUPO imxyy@imxyy-nix
imxyy@imxyy.top ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOEFLUkyeaK8ZPPZdVNEmtx8zvoxi7xqS2Z6oxRBuUPO imxyy@imxyy-nix
'').outPath;
};
};
programs.lazygit = {
enable = true;
};
};
};
}

45
modules/cli/vcs/jj.nix Normal file
View File

@@ -0,0 +1,45 @@
{
config,
lib,
pkgs,
userfullname,
useremail,
...
}:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "jujutsu";
optionPath = [
"cli"
"vcs"
"jj"
];
extraConfig = {
my.home = {
programs.jujutsu = {
settings = {
user = {
name = "${userfullname}";
email = "${useremail}";
};
ui = {
graph.style = "square";
default-command = "status";
};
};
};
/* programs.zsh.initContent = lib.mkAfter ''
fpath+=${
pkgs.fetchFromGitHub {
owner = "rkh";
repo = "zsh-jj";
rev = "b6453d6ff5d233d472e5088d066c6469eb05c71b";
hash = "sha256-GDHTp53uHAcyVG+YI3Q7PI8K8M3d3i2+C52zxnKbSmw=";
}
}/functions
zstyle ':vcs_info:*' enable jj
''; */
home.packages = [ pkgs.lazyjj ];
};
};
}