Commit c2dc7885a311

Vincent Demeester <vincent@sbr.pm>
2018-11-23 17:49:25
modules: add ssh
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 4e70cc2
Changed files (3)
modules
profiles
modules/profiles/ssh.nix
@@ -0,0 +1,26 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+let
+  cfg = config.profiles.ssh;
+in
+{
+  options = {
+    profiles.ssh = {
+      enable = mkOption {
+        default = false;
+        description = "Enable ssh profile";
+        type = types.bool;
+      };
+    };
+  };
+  config = mkIf cfg.enable {
+    services = {
+      openssh = {
+        enable = true;
+        startWhenNeeded = false;
+      };
+    };
+    programs.mosh.enable = true;
+  };
+}
modules/module-list.nix
@@ -15,6 +15,7 @@
     ./profiles/printing.nix
     ./profiles/pulseaudio.nix
     ./profiles/scanning.nix
+    ./profiles/ssh.nix
     ./profiles/syncthing.nix
     ./profiles/users.nix
     ./profiles/virtualization.nix
profiles/ssh.nix
@@ -1,11 +0,0 @@
-{ config, pkgs, ... }:
-
-{
-  services = {
-    openssh = {
-      enable = true;
-      startWhenNeeded = false;
-    };
-  };
-  programs.mosh.enable = true;
-}