diff options
| author | Caroline Larimore <caroline@larimo.re> | 2025-04-14 18:39:55 -0700 |
|---|---|---|
| committer | Caroline Larimore <caroline@larimo.re> | 2025-04-14 18:58:54 -0700 |
| commit | 03d21c96eac95ea2d042366168c2510118ab44a5 (patch) | |
| tree | 55ee0786d4815d479d57b3a62d25e9c35ab20c59 | |
| parent | b651c0fbf47f58a6b1ba0663615832dbc578ebe1 (diff) | |
migration: openssh server
| -rw-r--r-- | hosts/copenhagen/configuration.nix | 8 | ||||
| -rw-r--r-- | snowfall/modules/nixos/services/ssh/default.nix | 28 | ||||
| -rw-r--r-- | snowfall/systems/x86_64-linux/copenhagen/default.nix | 5 |
3 files changed, 33 insertions, 8 deletions
diff --git a/hosts/copenhagen/configuration.nix b/hosts/copenhagen/configuration.nix index 0b4e83e..3f6c089 100644 --- a/hosts/copenhagen/configuration.nix +++ b/hosts/copenhagen/configuration.nix @@ -24,14 +24,6 @@ services = { pcscd.enable = true; - openssh = { - enable = true; - ports = [ 42069 ]; - settings = { - PermitRootLogin = "no"; - PasswordAuthentication = false; - }; - }; }; environment.systemPackages = with pkgs; [ diff --git a/snowfall/modules/nixos/services/ssh/default.nix b/snowfall/modules/nixos/services/ssh/default.nix new file mode 100644 index 0000000..6856897 --- /dev/null +++ b/snowfall/modules/nixos/services/ssh/default.nix @@ -0,0 +1,28 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.services.ssh; + impermanence = config.${namespace}.system.impermanence; +in { + options.${namespace}.services.ssh = with types; { + enable = mkEnableOption "ssh server"; + + port = mkOption { + type = types.port; + default = 22; + description = "ssh server port"; + }; + }; + + config = mkIf cfg.enable { + openssh = { + enable = true; + ports = [ cfg.port ]; + + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + }; + }; +} diff --git a/snowfall/systems/x86_64-linux/copenhagen/default.nix b/snowfall/systems/x86_64-linux/copenhagen/default.nix index b980271..00bd761 100644 --- a/snowfall/systems/x86_64-linux/copenhagen/default.nix +++ b/snowfall/systems/x86_64-linux/copenhagen/default.nix @@ -16,6 +16,11 @@ with lib; with lib.${namespace}; { }; services = { + ssh = { + enable = true; + port = 42069; + }; + web = { personal.enable = true; landing.enable = true; |