]> Git — Sourcephile - sourcephile-nix.git/blob - hosts/losurdo/users.nix
ssh: cleanup old config
[sourcephile-nix.git] / hosts / losurdo / users.nix
1 { inputs, pkgs, lib, config, ... }:
2 let
3 inherit (config.security) gnupg;
4 inherit (config.users) users;
5 in
6 {
7 imports = [
8 ../../members/julm.nix
9 ];
10
11 nix.trustedUsers = [
12 users."julm".name
13 ];
14
15 users = {
16 mutableUsers = false;
17 users = {
18 root = {
19 openssh.authorizedKeys.keys =
20 users."julm".openssh.authorizedKeys.keys;
21 hashedPassword = "!";
22 };
23 gnupg = {
24 openssh.authorizedKeys.keys =
25 users."root".openssh.authorizedKeys.keys;
26 };
27 julm = {
28 openssh.authorizedKeys.keys = [
29 (lib.readFile (inputs.secrets + "/members/ssh/julm-carotte.pub"))
30 ];
31 };
32 };
33 groups = {
34 adbusers.members = [
35 users."julm".name
36 ];
37 dialout.members = [
38 users."julm".name
39 ];
40 tor.members = [
41 users."julm".name
42 ];
43 wheel.members = [
44 users."julm".name
45 ];
46 gpg-agent.members = [
47 users."julm".name
48 ];
49 };
50 };
51
52 #security.gnupg.secrets."/root/.ssh/id_ed25519" = {
53 # gpg = "${gnupg.store}/ssh/root.ssh-ed25519.gpg";
54 #};
55
56 networking.nftables.ruleset = lib.concatMapStringsSep "\n"
57 (rule: "add rule inet filter fw2net meta skuid ${users.julm.name} " + rule) [
58 ''tcp dport {25,465} counter accept comment "SMTP"''
59 ''tcp dport 43 counter accept comment "Whois"''
60 ''tcp dport 993 counter accept comment "IMAPS"''
61 ''tcp dport 6697 counter accept comment "IRCS"''
62 ''tcp dport 2222 counter accept comment "SSH(boot)"''
63 ''tcp dport 5222 counter accept comment "XMPP"''
64 ''tcp dport 11371 counter accept comment "HKP"''
65 ''tcp dport {9009,9010,9011,9012,9013} counter accept comment "croc"''
66 ''udp dport 33434-33523 counter accept comment "traceroute"''
67 ''udp dport 60000-61000 counter accept comment "Mosh"''
68 #''ip protocol tcp counter accept comment "all"''
69 ];
70 }