aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hosts/copenhagen/configuration.nix8
-rw-r--r--snowfall/modules/nixos/services/ssh/default.nix28
-rw-r--r--snowfall/systems/x86_64-linux/copenhagen/default.nix5
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;