]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/ssh/default.nix
Move rest of the modules outside of nixops
[perso/Immae/Config/Nix.git] / nixops / modules / ssh / default.nix
diff --git a/nixops/modules/ssh/default.nix b/nixops/modules/ssh/default.nix
deleted file mode 100644 (file)
index beedaff..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-{ lib, pkgs, config, myconfig, ... }:
-{
-  config = {
-    networking.firewall.allowedTCPPorts = [ 22 ];
-
-    services.openssh.extraConfig = ''
-      AuthorizedKeysCommand     /etc/ssh/ldap_authorized_keys
-      AuthorizedKeysCommandUser nobody
-      '';
-
-    secrets.keys = [{
-      dest = "ssh-ldap";
-      user = "nobody";
-      group = "nogroup";
-      permissions = "0400";
-      text = myconfig.env.sshd.ldap.password;
-    }];
-    system.activationScripts.sshd = {
-      deps = [ "secrets" ];
-      text = ''
-      install -Dm400 -o nobody -g nogroup -T /var/secrets/ssh-ldap /etc/ssh/ldap_password
-      '';
-    };
-    # ssh is strict about parent directory having correct rights, don't
-    # move it in the nix store.
-    environment.etc."ssh/ldap_authorized_keys" = let
-      ldap_authorized_keys =
-        pkgs.mylibs.wrap {
-          name = "ldap_authorized_keys";
-          file = ./ldap_authorized_keys.sh;
-          paths = [ pkgs.which pkgs.gitolite pkgs.openldap pkgs.stdenv.shellPackage pkgs.gnugrep pkgs.gnused pkgs.coreutils ];
-        };
-    in {
-      enable = true;
-      mode = "0755";
-      user = "root";
-      source = ldap_authorized_keys;
-    };
-  };
-}