modularize git

This commit is contained in:
2025-07-03 11:04:42 +02:00
parent 1e8b8434f9
commit f45e2d61f4
12 changed files with 103 additions and 92 deletions

View File

@@ -11,7 +11,6 @@
{
imports = [
./modules
./git.nix
];
# ++ lib.optionals isCnixpad [./cpmodules.nix];

View File

@@ -1,25 +1,14 @@
{
config,
pkgs,
osConfig,
lib,
...
}: let
email = config.programs.git.userEmail;
isCnixpad = osConfig.networking.hostName == "cnixpad";
isCnixlab = osConfig.networking.hostName == "cnixlab";
sshKey =
if isCnixpad
then "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIXCjkKouZrsMoswMIeueO8X/c3kuY3Gb0E9emvkqwUv cnst@cnixpad"
else if isCnixlab
then "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICiNcNex+/hrEQJYJJTj89uPXocSfChU38E5TujWdxaM cnstlab@cnixlab"
else "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEUub8vbzUn2f39ILhAJ2QeH8xxLSjiyUuo8xvHGx/VB adam@cnst.dev";
in {
}: {
home.packages = [pkgs.gh];
programs.git = {
enable = true;
userName = "cnst";
userEmail = "adam@cnst.dev";
userName = config.accounts.username;
userEmail = config.accounts.mail;
delta = {
enable = true;
options.dark = true;
@@ -57,6 +46,6 @@ in {
];
};
xdg.configFile."git/allowed_signers".text = ''
${email} namespaces="git" ${sshKey}
${config.accounts.mail} namespaces="git" ${config.accounts.sshKey}
'';
}

View File

@@ -35,6 +35,9 @@
fuzzel = {
enable = true;
};
git = {
enable = true;
};
ghostty = {
enable = true;
};

View File

@@ -1,7 +1,8 @@
{
accounts = {
username = "cnst";
hostname = "cnixtop";
mail = "adam@cnst.dev";
sshUser = "cnixtop";
};
monitors = [
{