mirror of
https://github.com/smg1024/nix-darwin.git
synced 2026-05-22 20:32:59 +09:00
refactor: migrate nix-darwin config to a flake-parts dendritic layout
This commit is contained in:
parent
f80b0b0d4f
commit
09801ac429
84 changed files with 1029 additions and 687 deletions
6
modules/aspects/_git/default.nix
Normal file
6
modules/aspects/_git/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./git.nix
|
||||
./gh.nix
|
||||
];
|
||||
}
|
||||
8
modules/aspects/_git/gh.nix
Executable file
8
modules/aspects/_git/gh.nix
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
programs.gh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
git_protocol = "ssh";
|
||||
};
|
||||
};
|
||||
}
|
||||
35
modules/aspects/_git/git.nix
Executable file
35
modules/aspects/_git/git.nix
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
{config, ...}: let
|
||||
signingPrincipal = "87608318+smg1024@users.noreply.github.com";
|
||||
signingPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFuQ4STNnixjNDo38AyI0yABKAVfF3hupo66613IgfC7";
|
||||
signingKeyPath = "${config.home.homeDirectory}/.config/sops-nix/secrets/github_ssh_key";
|
||||
allowedSignersPath = "${config.home.homeDirectory}/.config/git/allowed_signers";
|
||||
in {
|
||||
home.file.".config/git/allowed_signers".text = ''
|
||||
${signingPrincipal} ${signingPublicKey}
|
||||
'';
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
signing = {
|
||||
format = "ssh";
|
||||
key = signingKeyPath;
|
||||
signByDefault = true;
|
||||
signer = "ssh-keygen";
|
||||
};
|
||||
settings = {
|
||||
user = {
|
||||
name = "Poby";
|
||||
email = signingPrincipal;
|
||||
};
|
||||
gpg = {
|
||||
ssh = {
|
||||
allowedSignersFile = allowedSignersPath;
|
||||
};
|
||||
};
|
||||
init.defaultBranch = "master";
|
||||
push = {
|
||||
autoSetupRemote = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue