summary refs log tree commit diff stats
path: root/modules/by-name/ru
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name/ru')
-rw-r--r--modules/by-name/ru/rust-motd/module.nix20
1 files changed, 15 insertions, 5 deletions
diff --git a/modules/by-name/ru/rust-motd/module.nix b/modules/by-name/ru/rust-motd/module.nix
index ee88762..a6998f4 100644
--- a/modules/by-name/ru/rust-motd/module.nix
+++ b/modules/by-name/ru/rust-motd/module.nix
@@ -5,6 +5,20 @@
   ...
 }: let
   cfg = config.vhack.rust-motd;
+
+  # List all users that can login
+  pred = n: v: (
+    false # <- just here for neat formatting
+    || v.initialHashedPassword != null
+    || v.initialPassword != null
+    || v.hashedPassword != null
+    || v.hashedPasswordFile != null
+    || v.password != null
+    || v.passwordFile != null
+    || v.openssh.authorizedKeys.keys != []
+    || v.openssh.authorizedKeys.keyFiles != []
+  );
+  userList = builtins.mapAttrs (n: v: 2) (lib.filterAttrs pred config.users.users);
 in {
   options.vhack.rust-motd = {
     enable = lib.mkEnableOption "rust-motd";
@@ -69,11 +83,7 @@ in {
           jails = ["sshd"]; #, "anotherjail"]
         };
 
-        last_login = {
-          sils = 2;
-          soispha = 2;
-          nightingale = 2;
-        };
+        last_login = userList;
 
         last_run = {};
       };