Skip to content

Commit

Permalink
feat(secrets/keys/comfy-gh): add github ssh key
Browse files Browse the repository at this point in the history
  • Loading branch information
comfysage committed Dec 1, 2024
1 parent eea2748 commit 5eba84b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
10 changes: 2 additions & 8 deletions home/comfy/packages/misc/git/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@ in
programs.git = mkIf cfg.enable {
enable = true;
inherit (cfg) package;
userName = "comfy";
userName = "comfysage";
userEmail = "[email protected]";

# git commit signing
signing = {
key = cfg.signingKey;
signByDefault = true;
};

extraConfig = {
core.editor = osConfig.garden.programs.defaults.editor;

Expand All @@ -35,7 +29,7 @@ in
};
commit.gpgsign = true;
gpg.format = "ssh";
user.signingkey = "~/.ssh/id_rsa.pub";
user.signingkey = osConfig.age.secrets.keys-comfy-gh.path;
# personal preference
init.defaultBranch = "main";
# prevent data corruption
Expand Down
5 changes: 5 additions & 0 deletions home/comfy/system/ssh.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{ osConfig, ... }:
let
inherit (osConfig.age) secrets;
in
{
programs.ssh = {
enable = true;
Expand All @@ -9,6 +13,7 @@
"github.com" = {
user = "git";
hostname = "github.com";
identityFile = secrets.keys-comfy-gh.path;
};

"gitlab.com" = {
Expand Down
10 changes: 10 additions & 0 deletions modules/base/secrets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ in
owner = mainUser;
group = userGroup;
};
keys-comfy-gh = mkSecret {
file = "keys/comfy-gh";
owner = mainUser;
group = userGroup;
};
keys-comfy-gh-pub = mkSecret {
file = "keys/comfy-gh-pub";
owner = mainUser;
group = userGroup;
};
keys-aur = mkSecret {
file = "keys/aur";
owner = mainUser;
Expand Down
Binary file added secrets/keys/comfy-gh-pub.age
Binary file not shown.
Binary file added secrets/keys/comfy-gh.age
Binary file not shown.
2 changes: 2 additions & 0 deletions secrets/secrets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,6 @@ in

# comfys keys
"keys/comfy.age" = defAccessComfy (types.workstations ++ types.servers);
"keys/comfy-gh.age" = defAccessComfy (types.workstations ++ types.servers);
"keys/comfy-gh-pub.age" = defAccessComfy (types.workstations ++ types.servers);
}

0 comments on commit 5eba84b

Please sign in to comment.