Something went wrong. Try again.
My NixOS and nix-darwin configuration.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107{ config, lib, pkgs, ...}:{ config = { home-manager.users.${config.dc-tec.user.name} = { programs = { git = { enable = true; signing.format = "openpgp";
includes = lib.flatten [ # Always include secretz configuration on both platforms { condition = "gitdir:${config.dc-tec.user.homeDirectory}/projects/secretz/"; contents = { user = { name = config.dc-tec.user.fullName; email = "roel.decort@secretz.io"; signingKey = config.dc-tec.user.gpgKey; }; commit.gpgSign = true; core.sshCommand = if config.dc-tec.isLinux then "ssh -i ~/.ssh/id_ed25519" else "ssh -i ~/.ssh/roelc_gh"; gpg.program = if config.dc-tec.isLinux then "${pkgs.gnupg}/bin/gpg2" else "/opt/homebrew/bin/gpg"; }; }
# Darwin (work primary): override for personal projects (lib.optionals config.dc-tec.isDarwin [ { condition = "gitdir:${config.dc-tec.user.homeDirectory}/projects/personal/"; contents = { user = { name = config.dc-tec.user.fullName; email = config.dc-tec.user.email; signingKey = config.dc-tec.user.gpgKey; }; commit.gpgSign = true; core.sshCommand = "ssh -i ~/.ssh/roelc_gh"; gpg.program = "/opt/homebrew/bin/gpg"; }; } ])
# Linux (personal primary): override for work projects (lib.optionals config.dc-tec.isLinux [ { condition = "gitdir:${config.dc-tec.user.homeDirectory}/projects/work/"; contents = { user = { name = config.dc-tec.user.fullName; email = config.dc-tec.user.workEmail; signingKey = config.dc-tec.user.gpgKey; }; commit.gpgSign = true; core.sshCommand = "ssh -i ~/.ssh/id_ed25519"; gpg.program = "${pkgs.gnupg}/bin/gpg2"; }; } ]) ];
# Primary configuration (work on Darwin, personal on Linux) settings = { user = { email = if config.dc-tec.isDarwin then config.dc-tec.user.workEmail else config.dc-tec.user.email; name = config.dc-tec.user.fullName; signingkey = config.dc-tec.user.gpgKey; }; init.defaultBranch = "main"; push.autoSetupRemote = true; pull.rebase = true; core.sshCommand = if config.dc-tec.isLinux then "ssh -i ~/.ssh/id_ed25519" else "ssh -i ~/.ssh/roelc_gh"; safe.directory = "${config.dc-tec.user.homeDirectory}/projects/personal/nixos-config"; commit.gpgsign = true; gpg.program = if config.dc-tec.isLinux then "${pkgs.gnupg}/bin/gpg2" else "/opt/homebrew/bin/gpg"; }; };
lazygit = { enable = true; settings = { git = { commit = { signOff = true; }; }; }; };
gh = { enable = true; settings = { editor = "nvim"; git_protocol = "ssh"; }; }; }; }; };}