Skip to content

Commit 8654d88

Browse files
git: sign commits if ssh verficiations unlock a secret password (#79)
Co-authored-by: @zimeg <zim@o526.net> Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com>
1 parent 47d4647 commit 8654d88

File tree

13 files changed

+141
-36
lines changed

13 files changed

+141
-36
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ versioning is done in a continuous fashion without worries of breaking changes.
66

77
## patches
88

9+
- `git`: sign commits if ssh verficiations unlock a secret password 2026-03-28
910
- `codex`: call additional provider for agentic development process 2026-03-28
1011
- `node`: follow the unstable channels for active releases in shell 2026-03-28
1112
- `git`: skip signing commits with default unused as warning appear 2026-03-28

machines/puma/programs/git/default.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,21 @@
22
{
33
programs.git = {
44
settings = {
5+
gpg = {
6+
ssh = {
7+
allowedSignersFile = "~/.config/git/allowed_signers";
8+
};
9+
};
510
user = {
611
email = "zim@o526.net";
712
name = "@zimeg";
813
};
914
};
15+
signing = {
16+
key = "~/.ssh/id_ed25519";
17+
};
1018
};
19+
home.file.".config/git/allowed_signers".text = ''
20+
zim@o526.net ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDZQSWnGNtSoSAaK90h3FYsxTlevad8+BpTzR2DwiT1C
21+
'';
1122
}

machines/tim/configuration.nix

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,43 +54,63 @@
5454
};
5555
secrets = {
5656
"github/runners/dotfiles" = {
57-
owner = "dotfiles";
58-
group = "dotfiles";
57+
group = "_github-runner";
58+
owner = "_github-runner";
59+
path = "/run/secrets/github/runners/dotfiles";
5960
};
60-
"github/ssh" = {
61-
key = "ssh/private";
62-
owner = "dotfiles";
63-
group = "dotfiles";
61+
"github/accounts/theorderingmachine" = {
62+
key = "ssh/accounts/theorderingmachine/private";
63+
group = "_github-runner";
64+
owner = "_github-runner";
65+
path = "/run/secrets/github/accounts/theorderingmachine";
6466
};
65-
"ssh/public" = {
67+
"ssh/accounts/theorderingmachine/private" = {
6668
owner = input.config.users.users.ez.name;
67-
path = "/Users/ez/.ssh/id_ed25519.pub";
69+
path = "/Users/ez/.ssh/accounts/theorderingmachine";
70+
};
71+
"ssh/accounts/theorderingmachine/public" = {
72+
owner = input.config.users.users.ez.name;
73+
path = "/Users/ez/.ssh/accounts/theorderingmachine.pub";
74+
};
75+
"ssh/accounts/zimeg/private" = {
76+
owner = input.config.users.users.ez.name;
77+
path = "/Users/ez/.ssh/accounts/zimeg";
6878
};
69-
"ssh/private" = {
79+
"ssh/accounts/zimeg/public" = {
80+
owner = input.config.users.users.ez.name;
81+
path = "/Users/ez/.ssh/accounts/zimeg.pub";
82+
};
83+
"ssh/default/private" = {
84+
key = "ssh/accounts/theorderingmachine/private";
7085
owner = input.config.users.users.ez.name;
7186
path = "/Users/ez/.ssh/id_ed25519";
7287
};
88+
"ssh/default/public" = {
89+
key = "ssh/accounts/theorderingmachine/public";
90+
owner = input.config.users.users.ez.name;
91+
path = "/Users/ez/.ssh/id_ed25519.pub";
92+
};
7393
};
7494
};
7595
system = {
7696
configurationRevision = self.rev or self.dirtyRev or null;
7797
stateVersion = 5;
7898
};
7999
users = {
80-
knownGroups = [ "dotfiles" ];
81-
knownUsers = [ "dotfiles" ];
100+
knownGroups = [ "_github-runner" ];
101+
knownUsers = [ "_github-runner" ];
82102
groups = {
83-
dotfiles = {
84-
gid = 534;
103+
_github-runner = {
104+
gid = 533;
85105
};
86106
};
87107
users = {
88-
dotfiles = {
89-
createHome = true;
90-
gid = 534;
91-
home = "/private/var/lib/dotfiles";
92-
name = "dotfiles";
93-
uid = 534;
108+
_github-runner = {
109+
createHome = false;
110+
gid = 533;
111+
home = "/private/var/lib/github-runners";
112+
name = "_github-runner";
113+
uid = 533;
94114
};
95115
ez = {
96116
home = /Users/ez;

machines/tim/home.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
imports = [
44
./programs/gh
5+
./programs/ssh
56
./programs/wd
67
];
78
}

machines/tim/programs/gh/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# gh
2+
3+
swapping accounts in certain projects takes commands:
4+
5+
```sh
6+
$ git config user.name "@zimeg"
7+
$ git config user.email "zim@o526.net"
8+
$ git config user.signingKey "~/.ssh/accounts/zimeg"
9+
```

machines/tim/programs/gh/default.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,22 @@
1010
};
1111
programs.git = {
1212
settings = {
13+
gpg = {
14+
ssh = {
15+
allowedSignersFile = "~/.config/git/allowed_signers";
16+
};
17+
};
1318
user = {
1419
email = "tom@deorr.co";
1520
name = "@theorderingmachine";
1621
};
1722
};
23+
signing = {
24+
key = "~/.ssh/accounts/theorderingmachine";
25+
};
1826
};
27+
home.file.".config/git/allowed_signers".text = ''
28+
tom@deorr.co ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBEZymM2zPOY+aa0nDpUlvWqA5q74zrNS8uzJN6/84DQ
29+
zim@o526.net ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+dGTTCom1yRR0tjxJSFMSgMpGhAULcMqeTA6dF0hrD
30+
'';
1931
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# https://github.com/openssh/openssh-portable
2+
{
3+
programs.ssh.matchBlocks = {
4+
theorderingmachine = {
5+
hostname = "github.com";
6+
identitiesOnly = true;
7+
identityFile = "~/.ssh/accounts/theorderingmachine";
8+
};
9+
zimeg = {
10+
hostname = "github.com";
11+
identitiesOnly = true;
12+
identityFile = "~/.ssh/accounts/zimeg";
13+
};
14+
};
15+
}

machines/tim/secrets/vault.yaml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
github:
22
runners:
3-
dotfiles: ENC[AES256_GCM,data:DnuiyzT8zyHIkfd0gds1//PSjv1PSOo/9a/JnFqQLW5QrMxEkQfgi37l2doVP84SDBjJF2vcuYNaoB/MCLUbbDrmh4+xIOLgrB5murLRs6n4n3MrLbefh7lIipeu,iv:LU1quTHniQWWSBtrwsY0dZwqzp58cMYXyvkmBJWgoX8=,tag:M7WjyNC4aj/kgDNrGZhpsA==,type:str]
3+
dotfiles: ENC[AES256_GCM,data:CLkBrlPi2KXyC5uw0Xzvcw6v2pMbbxj/ZPpg9P3F1XQ++mtp6TyjoMwv7JUZxjwxAxU5bMUjmuE9Ge1j4GHHDdTwsEfhhntaZTRUmUCJo1Hy+N4XbQuB/gUuv9c5,iv:4uBGUllCDuVSo0IG6qHb8kHNxQIOnc1YMHHDJwBTinQ=,tag:jhbcKoqGN2U+baJuRbYegA==,type:str]
44
ssh:
5-
public: ENC[AES256_GCM,data:4sdsm6WRY1ELv8N20zsiCdG19fmyvdWrse7GmYFzlR/MdkIRIWXZLcawEYW6tEk4FOGQDtWc82rSP6dCzAEywYHFrIS4lVzTMztF+5sOaEgcfoqLHuEpc1rOLaRD,iv:Iy6MIjOHkHb1J2Y7M+cDNyWfRIrGdb1HMFZEQkXl/Xk=,tag:7IXbitgZEFTnrMHOym2WJg==,type:str]
6-
private: ENC[AES256_GCM,data:9I8Noox6cFuQOgYhDVaSKsr/bTi1GbRWMrvPiJr3oZRz0f+fKOrVFSDxIwmC40O/rAlToQQHf0rY2KhriT0TWweIVwnCCTMDNcyXUw0GVxVcUlMo/fkXrUsuZnxUHwyPefYDrvjnqKYNKOT2XG2pjiOMt36YM1QHb8uME72wnDz5LlgdhjcaFR5uepTHwZRfJkOcc80xWirEFEikTxKTikYWcoXyGvEMidIVYQqNicFFdvYJ9rk5k7yZ/3hhMNo/6GwFWl6XP/S8JP8URLQZlLFT0UmV5p9jEVBYnUuT6Y4pcYFKYtAVFNnTvDe25GUjMCf8kgOoyzhGaxWPtf6oU15jNHxL1vYItlHgV4JXWbuh7wu3SRAKCEtFW+zAH9lZFv99xXuYxWqQVU0KIfsd9RRZJCHsB2/YnPhVVTtdQPbyKQ8R1UxyP0F7Rp0X9I0u9hm5r8SbRAnkhbJoVmQdJGMY+gCiB6L7RkLRqDEzkYatpqry9kTMvzAkQu1WKTbCmWd2UN7TvPW2BYpraibm,iv:KTjokJcK0hcLx0yaWswdPioMJc0+bHYbpcuFm6o99D4=,tag:FtDChakJm1ox8sJ3LJC0ww==,type:str]
5+
accounts:
6+
theorderingmachine:
7+
private: ENC[AES256_GCM,data:YiLC08VqAkNasy50FK0IwOwe4o/0S4eQ7ElXEnhTrLeK94Qk/IpSiw3D5EVY7E8JmydBQsBT7M4M6Qx3TXNMq//1kaPbQPQkSKIw1Dv/hf1I5OVAeXiP8DMLy3vcWDMutZptjdt0OCkAzh9pCvU52dtKu1zUWkh05KEuHOiXso7bcihL/B9EeqjPpnUxzk/cgOx80gFmjH2yr7YH1kzo+0d00FI1rRh0xicIefD3HBB8o3gx4LDWUp8x1ICft+OrXIRO7ly7zLJXsxtyPZmEH3U0SApYozxSfoK0RFxU308YGRd5IFOshOQwpiEFjmpSSquDIagVuwK4YinGxDJZT6qk+xYtgOCRaWyUcS3QJ0QOadiaY6vDauWqueFB1p2GyWNcRzP6R041KgddDwVIq99zS9iLZFHoHfYFG2pjs2EvzWOqW21lqHjhODyCZd6Nkr83yONHZ3crghgQzsHingrsPkhTL3UWVXYi0kcTqVdp6CMuf4c4CcmnVbiP8LH0oiFgzYK17wY4f0mJW8ge,iv:XPhzszBiVBpvbI4WuzLKbXxQlg+jioW8M1PA07LFHPI=,tag:B/ZTh/4yzDf7WtOM02blqg==,type:str]
8+
public: ENC[AES256_GCM,data:9miSUHEGNvW4dFDNPPcR/J4KGuAvGio7+lH3Bu2qcM379h91Y3R1PEgspQG8IvC6UFBAqAnqDC6G22Ale0+MV9sd9qQUJw6jabDLr63QGu1N5ZeFUL1rGqcQOl/f,iv:2+mntQ3rLM3l/m5tKJoMswkBfe7lKHBL1l1FZkowjtg=,tag:0uopOiMYwh/rFF8e8SRzgg==,type:str]
9+
zimeg:
10+
private: ENC[AES256_GCM,data:R4aMYjwW+RGdfFdg6fc48tPPea18sKlM5v4N/vBqWHkN4qW1nBoNkGd/ngviT+JRuCAhEAveZFClYuvfwpeJ7QCz1pzqDRK9uNE83br3YPyrhoWFIv3+WAKwp1pQdFPttrzJOY+QqcS2twgADTADfX4hDN77+sKCNE/Lgm59WzUWMCQyTm4H5nPYZe4q1vYAInCYl7v6bfbm17ns55/ulUTtAg6jcWxpe0heXdpdt7uY3EWJDiUpv7my988xWfGOfvwOdLljaLu0eRYMjC4JY0ZFAyqxNP6I5G8kv5HeqPYdv86ftUc9FNiyyDFjVoWY9fGi6029lRkbvpFMOwi9YfEBqMW1QIf+0ERFCOkWjbV7/oJghBpMOQ1kcrZXoAOox317wG9NLkSI1y9e42T6PWrSfNftrewysQvW5D5Y4Y26XgtW/wsNAESLFib6j/Z/eT3CQtW6rO6mLE1MY7IKZ6daEbugdtu/TyK4belMfbvLU4qllxG5NY4bUCXWrlpwuhNpcLj6lZirZnYgBnxL,iv:AnF8m/LcJ9IFYwSvvUL+39JfJWSHdmuQHOteAYQOpa4=,tag:K3Hfyz4nNnM8JGz+ILwqbw==,type:str]
11+
public: ENC[AES256_GCM,data:Xm/4F/lJ9cJaY9e+If/B+36u/9NFkJnliqqoaNaTf5yWYIAnj5+dIa6MO68tD4tPokum0ddoF+N7O2l1dwD/hJohiPGrvUHFu6midelpUk70HuByI5BMK8b2fJYt,iv:6FUbzaVUxa/7uOQFJezN/nGr5KG/P+UWolf+wJye6HY=,tag:KVBZYIwIL4FTUR3U4bjpSg==,type:str]
712
sops:
813
age:
914
- recipient: age1ym7363kc42kwm3zr5uqnwsvrqjthypj6k4dxs42cckh6cjl90qyskr05tp
1015
enc: |
1116
-----BEGIN AGE ENCRYPTED FILE-----
12-
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSByUENBOUF2STJHMVpLT2E5
13-
V3U0bkRpZ25Ya0lheGwrYmVONmhPdkcvMkJZCnVoSENuOTJzYnNhdVZ4Q0ZOQzAz
14-
SGdDczVyZW9PTEhodmR5UUZqanAvUDQKLS0tIE1oejVqRGtFSndjeklqQ1JBSTNj
15-
OEc2RUFIT2hGYVhTSjh4TnB6VTZXZ0EK3vBA/+YIBeFf1ZQ8X8AMS3lcPmqQnnQU
16-
qy2hAzJwMO7j5uUaPpfsFaAOCyPpviTT4xUNc876ZVxQUgJCgYVB+w==
17+
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBzeFM4bUoybnYydVVCM0xN
18+
YnZTTFN5M0M2SzAvWExaWHVKVUNzVy9qUG00CmtTTVRta09HNUV3bTNrTWVCczlK
19+
dXpDN1hlaldaaWJsa3ovWkI3TGlkV2cKLS0tIGRxaGpuMmRWR1JiU3htNkVKQ2lQ
20+
dlRqRHQ5TVBzT2l1SVVWSkRiZytkQm8KDq9QcFcx4CMZACFSW5yP1zAPAamnmK8U
21+
NcZ5cJbqFIcMWFDfd+nV9aMoa1n1aLAfybZ/WkMKbQCfEzpM231snA==
1722
-----END AGE ENCRYPTED FILE-----
18-
lastmodified: "2026-01-09T05:31:31Z"
19-
mac: ENC[AES256_GCM,data:+ztP5fbVTHMthENjil/u2WWs8yuEEW+6O7a//hOohldmRMdKp/DBQ8WOre/RIUGFK7s3EmZ9BuZj1DlpYyCIbACsibh7jsXTZ4PTIZs05yBqyuyhq4+RgnKgiprVDA5CWpnVELnHdgfCBMWSDcTB/rLWZdlCW0WBY5qtHXA1p8E=,iv:eOJTdNp1mfz40zved/GNItxnU0uWVD330kBK8vrGvzk=,tag:fwJ4mu3nFGT7qBRAPYT1nQ==,type:str]
23+
lastmodified: "2026-03-29T06:16:31Z"
24+
mac: ENC[AES256_GCM,data:AwwjcOAdVyZ9u3WOfdec17Si4dw9n3a45zDcmmFbWLIT+q3UHDwbBXQz/hu71x58CJPQFYaDeW5vgGdtyNpTGeUImCmRmr46fHoDCMliGmVYq/6zLSj0TbfTElSpI6cEiD+9+Yk4yKULFeI5o0YqHUcm4i1AZUXkJtJ5w3Q9rAE=,iv:SWA7WAKosc1UQsGeds/UlQIxht4tEv77CyQtRX7ZEtc=,tag:f++bKIj0H4W9vq5L/nftFA==,type:str]
2025
unencrypted_suffix: _unencrypted
21-
version: 3.11.0
26+
version: 3.12.2
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# github runners
2+
3+
some runs tim requires a restart:
4+
5+
```sh
6+
$ sudo launchctl kickstart -k system/org.nixos.github-runner-dotfiles
7+
```

machines/tim/services/github-runners/default.nix

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@
55
dotfiles = {
66
enable = true;
77
ephemeral = true;
8+
extraEnvironment = {
9+
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = "1";
10+
GIT_SSH_COMMAND = "ssh -i /run/secrets/github/accounts/theorderingmachine -o StrictHostKeyChecking=accept-new";
11+
};
812
extraLabels = [
913
"tim"
1014
];
11-
extraEnvironment = {
12-
GIT_SSH_COMMAND = "ssh -i /run/secrets/github/ssh -o StrictHostKeyChecking=accept-new";
13-
};
1415
extraPackages = [
1516
pkgs.openssh # https://github.com/openssh/openssh-portable
1617
pkgs.fastfetch # https://github.com/fastfetch-cli/fastfetch
1718
];
18-
group = "dotfiles";
19+
group = "_github-runner";
1920
name = "tim";
2021
replace = true;
2122
tokenFile = "/run/secrets/github/runners/dotfiles";
2223
url = "https://github.com/zimeg/.DOTFILES";
23-
user = "dotfiles";
24+
user = "_github-runner";
2425
};
2526
};
2627
}

0 commit comments

Comments
 (0)