From fdbe09e914d94419be815ef2e642985794009b7d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 28 May 2009 14:37:30 +0000 Subject: [PATCH] * Moved the guest-users.nix module to modules/config. Clearing the passwords is now done in an activation scriptlet rather than an Upstart job (not tested). BTW, we should get rid of this module and add support to the users-groups.nix module for creating accounts with an empty password. svn path=/nixos/branches/modular-nixos/; revision=15769 --- .../config}/guest-users.nix | 38 +++++++------------ modules/legacy.nix | 1 - modules/module-list.nix | 6 +++ .../x11/xserver/display-managers/kdm.nix | 8 ++-- 4 files changed, 24 insertions(+), 29 deletions(-) rename {upstart-jobs => modules/config}/guest-users.nix (62%) diff --git a/upstart-jobs/guest-users.nix b/modules/config/guest-users.nix similarity index 62% rename from upstart-jobs/guest-users.nix rename to modules/config/guest-users.nix index dcebf7a12af9..29a9740a7336 100644 --- a/upstart-jobs/guest-users.nix +++ b/modules/config/guest-users.nix @@ -1,6 +1,7 @@ -{pkgs, config, ...}: +{pkgs, config, ...}: + let - inherit(pkgs.lib) mkOption; + inherit (pkgs.lib) mkOption; options = { services = { @@ -53,26 +54,15 @@ in { require = options; - services = { - # !!! Better to do this as an activation script plugin rather - # than an Upstart job. - extraJobs = optional enable { - name = "clear-passwords"; - job = '' - description "Clear guest passwords" - start on startup - script - for i in ${nameString}; do - echo | ${pkgs.pwdutils}/bin/passwd --stdin $i - done - end script - ''; - }; - mingetty = { - helpLine = optionalString enable "\nThese users have empty passwords: ${nameString}"; - }; - }; - users = { - extraUsers = map userEntry users; - }; + + system.activationScripts = pkgs.lib.fullDepEntry + '' + for i in ${nameString}; do + echo | ${pkgs.pwdutils}/bin/passwd --stdin $i + done + '' ["defaultPath" "users" "groups"]; + + services.mingetty.helpLine = optionalString enable "\nThese users have empty passwords: ${nameString}"; + + users.extraUsers = map userEntry users; } diff --git a/modules/legacy.nix b/modules/legacy.nix index 6359682f17c2..7a2f223fc987 100644 --- a/modules/legacy.nix +++ b/modules/legacy.nix @@ -5,7 +5,6 @@ ../system/nixos-installer.nix ../upstart-jobs/cron/locate.nix ../upstart-jobs/filesystems.nix - ../upstart-jobs/guest-users.nix ../upstart-jobs/kbd.nix ../upstart-jobs/ldap ../upstart-jobs/lvm.nix diff --git a/modules/module-list.nix b/modules/module-list.nix index b10905fc35e0..6a08aa276d48 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -1,5 +1,6 @@ [ # This file has been generated by gen-module-list.sh ./config/fonts.nix + ./config/guest-users.nix ./config/i18n.nix ./config/networking.nix ./config/nsswitch.nix @@ -118,6 +119,11 @@ ./system/boot/stage-1.nix ./system/boot/stage-2.nix ./system/etc/etc.nix +##### ./system/etc/make-etc.nix +# error: while evaluating the attribute `' at `(string):2:8': +# while evaluating the function at `(string):3:22': +# while evaluating the function at `/home/eelco/Dev/modular-nixos/modules/system/etc/make-etc.nix:1:2': +# the argument named `stdenv' required by the function is missing ./system/upstart-events/ctrl-alt-delete.nix ./system/upstart-events/halt.nix ./system/upstart-events/maintenance-shell.nix diff --git a/modules/services/x11/xserver/display-managers/kdm.nix b/modules/services/x11/xserver/display-managers/kdm.nix index 556519472e38..031f5c18a1e9 100644 --- a/modules/services/x11/xserver/display-managers/kdm.nix +++ b/modules/services/x11/xserver/display-managers/kdm.nix @@ -4,9 +4,9 @@ let inherit (pkgs.lib) mkOption; - options = { services = { xserver = { displayManager = { + options = { - kdm = { + services.xserver.displayManager.kdm = { enable = mkOption { default = false; description = " @@ -15,7 +15,7 @@ let }; }; - }; /* displayManager */ }; /* xserver */ }; /* services */ }; + }; in @@ -31,7 +31,7 @@ let kdmrc = stdenv.mkDerivation { name = "kdmrc"; -# -e "s|Session=${kdebase_workspace}/share/config/kdm/Xsession|Session=${dmcfg.session.script}|" \ + # -e "s|Session=${kdebase_workspace}/share/config/kdm/Xsession|Session=${dmcfg.session.script}|" \ buildCommand = '' cp ${kdebase_workspace}/share/config/kdm/kdmrc . sed -i -e "s|#HaltCmd=|HaltCmd=${pkgs.upstart}/sbin/halt|" \