Compare commits

...

2 Commits

Author SHA1 Message Date
8b6bc354bd Peer to peer connection keepalive task 2023-03-07 22:54:26 -07:00
aff5611cdb Update renamed nixos options 2023-03-07 22:52:31 -07:00
4 changed files with 27 additions and 16 deletions

View File

@ -30,7 +30,9 @@ in
services.openssh = { services.openssh = {
enable = true; enable = true;
passwordAuthentication = false; settings = {
PasswordAuthentication = false;
};
}; };
programs.mosh.enable = true; programs.mosh.enable = true;
@ -70,7 +72,9 @@ in
users.users.root = { users.users.root = {
openssh.authorizedKeys.keys = sshHigherTrustKeys; openssh.authorizedKeys.keys = sshHigherTrustKeys;
}; };
nix.trustedUsers = [ "root" "googlebot" ]; nix.settings = {
trusted-users = [ "root" "googlebot" ];
};
nix.gc.automatic = true; nix.gc.automatic = true;

View File

@ -9,6 +9,7 @@ in
imports = [ imports = [
./hosts.nix ./hosts.nix
./pia-openvpn.nix ./pia-openvpn.nix
./ping.nix
./tailscale.nix ./tailscale.nix
./vpn.nix ./vpn.nix
./zerotier.nix ./zerotier.nix

View File

@ -3,6 +3,10 @@
with builtins; with builtins;
let let
# TODO: remove when all systems are updated to new enough nixpkgs
concatMapAttrs =
f: with lib; flip pipe [ (mapAttrs f) attrValues (foldl' mergeAttrs { }) ];
system = (import ../ssh.nix).system; system = (import ../ssh.nix).system;
# hostnames that resolve on clearnet for LUKS unlocking # hostnames that resolve on clearnet for LUKS unlocking
@ -18,13 +22,18 @@ let
ponyo = "cfamr6artx75qvt7ho3rrbsc7mkucmv5aawebwflsfuorusayacffryd.onion"; ponyo = "cfamr6artx75qvt7ho3rrbsc7mkucmv5aawebwflsfuorusayacffryd.onion";
s0 = "r3zvf7f2ppaeithzswigma46pajt3hqytmkg3rshgknbl3jbni455fqd.onion"; s0 = "r3zvf7f2ppaeithzswigma46pajt3hqytmkg3rshgknbl3jbni455fqd.onion";
}; };
in {
networking.hosts = { zerotierHosts = {
# some DNS providers filter local ip results from DNS request "s0.zt.neet.dev" = "172.30.145.180";
"172.30.145.180" = [ "s0.zt.neet.dev" ]; "ponyo.zt.neet.dev" = "172.30.109.9";
"172.30.109.9" = [ "ponyo.zt.neet.dev" ]; "ray.zt.neet.dev" = "172.30.189.212";
"172.30.189.212" = [ "ray.zt.neet.dev" ];
}; };
in {
# some DNS providers filter local ip results from DNS request
networking.hosts = concatMapAttrs (host: ip: {ip = [host];}) zerotierHosts;
# TODO only add if zerotier is enabled
keepalive-ping.hosts = attrNames zerotierHosts;
programs.ssh.knownHosts = { programs.ssh.knownHosts = {
liza = { liza = {
@ -95,12 +104,7 @@ in {
# prebuilt cmds for easy ssh LUKS unlock # prebuilt cmds for easy ssh LUKS unlock
environment.shellAliases = environment.shellAliases =
let concatMapAttrs (host: addr: {"unlock-over-tor_${host}" = "torsocks ssh root@${addr}";}) unlock-onion-hosts
# TODO: remove when all systems are updated to new enough nixpkgs //
concatMapAttrs = concatMapAttrs (host: addr: {"unlock_${host}" = "torsocks ssh root@${addr}";}) unlock-clearnet-hosts;
f: with lib; flip pipe [ (mapAttrs f) attrValues (foldl' mergeAttrs { }) ];
in
concatMapAttrs (host: addr: {"unlock-over-tor_${host}" = "torsocks ssh root@${addr}";}) unlock-onion-hosts
//
concatMapAttrs (host: addr: {"unlock_${host}" = "torsocks ssh root@${addr}";}) unlock-clearnet-hosts;
} }

View File

@ -4,6 +4,8 @@ let
cfg = config.services.zerotierone; cfg = config.services.zerotierone;
in { in {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
keepalive-ping.enable = true;
services.zerotierone.joinNetworks = [ services.zerotierone.joinNetworks = [
"565799d8f6d654c0" "565799d8f6d654c0"
]; ];