diff --git a/machines/memere/default.nix b/machines/memere/default.nix index f56b02e..bddb68f 100644 --- a/machines/memere/default.nix +++ b/machines/memere/default.nix @@ -6,6 +6,7 @@ /etc/nixos/modules/nix.nix /etc/nixos/modules/tailscale.nix /etc/nixos/modules/ssl.nix + /etc/nixos/modules/ssh.nix ./hardware-configuration.nix ./users.nix @@ -18,17 +19,6 @@ "/nix/var/nix/profiles/per-user/root/channels" ]; - services.openssh.enable = true; - services.openssh.listenAddresses = [ - { - addr = "0.0.0.0"; - port = 22; - } - ]; - services.openssh.ports = [ 22 ]; - services.openssh.settings.PermitRootLogin = "yes"; - services.openssh.settings.AllowUsers = [ "root" ]; - networking.hostName = "pepere"; networking.networkmanager.enable = true; diff --git a/machines/niczos/default.nix b/machines/niczos/default.nix index 4d40c71..3cc8f49 100644 --- a/machines/niczos/default.nix +++ b/machines/niczos/default.nix @@ -17,6 +17,7 @@ in /etc/nixos/modules/ssl.nix /etc/nixos/modules/tailscale.nix /etc/nixos/modules/backup + /etc/nixos/modules/ssh.nix # machine-specific config ./bootloader.nix diff --git a/modules/ssh.nix b/modules/ssh.nix new file mode 100644 index 0000000..a0d0ee3 --- /dev/null +++ b/modules/ssh.nix @@ -0,0 +1,12 @@ +{ + services.openssh.enable = true; + services.openssh.ports = [ 22 ]; + services.openssh.settings.PermitRootLogin = "yes"; + services.openssh.settings.AllowUsers = [ "root" ]; + + # Firewall + services.openssh.openFirewall = false; + networking.firewall.interfaces."tailscale0".allowedTCPPorts = [ + 22 + ]; +} diff --git a/npins/sources.json b/npins/sources.json index 91cb1e4..3dc2409 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -9,9 +9,9 @@ }, "branch": "release-26.05", "submodules": false, - "revision": "d4fd24667c8cbef124bb70a20380cab75ec8474d", - "url": "https://github.com/nix-community/home-manager/archive/d4fd24667c8cbef124bb70a20380cab75ec8474d.tar.gz", - "hash": "sha256-Rgs2xKnGLFWQscxUaXX07oyZeuMDOHEbqDOsgliLFGM=" + "revision": "173b7e8d40fdc8c296a9c99854314f17a3a1704c", + "url": "https://github.com/nix-community/home-manager/archive/173b7e8d40fdc8c296a9c99854314f17a3a1704c.tar.gz", + "hash": "sha256-YbRcLdU/yK4gWsQg7V8WTKZHfXL33g8+wSFUX3wyevs=" }, "jail.nix": { "type": "Git", @@ -34,9 +34,9 @@ }, "branch": "release", "submodules": false, - "revision": "e2c327cc00fd5243685fee69e90e4c7eb2f6e8ba", - "url": "https://github.com/xddxdd/nix-cachyos-kernel/archive/e2c327cc00fd5243685fee69e90e4c7eb2f6e8ba.tar.gz", - "hash": "sha256-bh1OUi/3AMR7hytDwhQL+FMr/MklvjcJrlp5ijJKtJw=" + "revision": "c9a4fc582b213bfc8cc9068302c7ad72abc36c7c", + "url": "https://github.com/xddxdd/nix-cachyos-kernel/archive/c9a4fc582b213bfc8cc9068302c7ad72abc36c7c.tar.gz", + "hash": "sha256-k6HoyMr33AtlCxdxEmq15uLbwosj1KNxN/H2DYlFrwg=" }, "nixpkgs": { "type": "Tarball", @@ -52,9 +52,9 @@ }, "branch": "master", "submodules": false, - "revision": "f1406619a3884cd5c47992a70b8b35c9c0fcb4c9", - "url": "https://github.com/Mic92/sops-nix/archive/f1406619a3884cd5c47992a70b8b35c9c0fcb4c9.tar.gz", - "hash": "sha256-aCWC8ngycU7OdJrU2+Je3qf+1a2ykuBvpPhZT/9tXMc=" + "revision": "a8627b21b9107c5711c96b84f32a9a4b3d45295f", + "url": "https://github.com/Mic92/sops-nix/archive/a8627b21b9107c5711c96b84f32a9a4b3d45295f.tar.gz", + "hash": "sha256-gkig4nPi1CWc4Z50GBsjE4ygSE7hMpl/TwID2an2Cck=" } }, "version": 7