-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
executable file
·122 lines (108 loc) · 2.39 KB
/
shell.nix
File metadata and controls
executable file
·122 lines (108 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# shell.nix
{
pkgs,
hooks,
scripts,
}:
pkgs.devshell.mkShell {
name = "nix-keys";
motd = ''
{202}🔑 SSH Key Management Environment (pass + Yubikey){reset}
$(type -p menu &>/dev/null && menu)
'';
# Central provides: git, fd, rg, bat, eza, jq, nixfmt, deadnix, statix, nix-tree, nixd
packages = with pkgs; [
# Key generation
openssh
gh
fh
# Pass (password-store)
pass
gnupg
# Disk image tools
ventoy
libguestfs-with-appliance
# Archive tools
gnutar
gzip
# Utilities
coreutils
findutils
tree
util-linux
];
commands = [
# Key Generation Commands
{
category = "generate";
name = "genkey";
help = "Generate SSH keys: genkey <host|flakehub|user> <name> (--help for details)";
command = ''
${scripts.genkey}/bin/genkey "$@"
'';
}
# GitHub Integration
{
category = "github";
name = "deploy";
help = "Manage GitHub deploy keys: deploy <add|remove|list> ... (--help for details)";
command = ''
${scripts.deploy}/bin/deploy "$@"
'';
}
# Disk Creation Commands
{
category = "disk";
name = "create";
help = "Create archive or Ventoy disk: create <archive|disk> <hostname> [iso-path] (--help)";
command = ''
${scripts.create}/bin/create "$@"
'';
}
# Disk Inspection Commands
{
category = "inspect";
name = "inspect";
help = "Show contents of disk or archive: inspect <file> (--help for details)";
command = ''
${scripts.inspect}/bin/inspect "$@"
'';
}
# Utility Commands
{
category = "info";
name = "list";
help = "List all generated keys (hosts and users)";
command = ''
${scripts.list}/bin/list "$@"
'';
}
{
category = "info";
name = "show";
help = "Show keys for specific host or user: show <host|user> <name> (--help for details)";
command = ''
${scripts.show}/bin/show "$@"
'';
}
# Utilities
{
category = "utilities";
package = "openssh";
}
{
category = "utilities";
package = "gh";
}
{
category = "utilities";
package = "pass";
}
];
devshell.startup = {
git-hooks.text = hooks.shellHook;
pass-env.text = ''
export PASSWORD_STORE_DIR="./private"
'';
};
}