From cffd945c9a8b00164a3240f92be81bfcb821ec4d Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 11 Mar 2019 19:35:19 +0100 Subject: modules/vlock: Allow to change the user name When writing that module back then in 88a10f1a6e2ea172ff985f64bfcf82e2, I had to work around a systemd limitation (which I need to check whether this is still the case today) and hardcoded the user name for the time being. While it's still quite ugly, there was interest from @Profpatsch, so I decided to add an internal option to change that username. Signed-off-by: aszlig --- modules/user/aszlig/profiles/workstation/default.nix | 1 + modules/user/aszlig/services/vlock/default.nix | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'modules/user') diff --git a/modules/user/aszlig/profiles/workstation/default.nix b/modules/user/aszlig/profiles/workstation/default.nix index 790ca92f..e9893f29 100644 --- a/modules/user/aszlig/profiles/workstation/default.nix +++ b/modules/user/aszlig/profiles/workstation/default.nix @@ -57,6 +57,7 @@ in { vuizvui.user.aszlig.services.i3.enable = true; vuizvui.user.aszlig.services.slim.enable = true; vuizvui.user.aszlig.services.vlock.enable = true; + vuizvui.user.aszlig.services.vlock.user = "aszlig"; vuizvui.user.aszlig.programs.mpv.enable = true; vuizvui.user.aszlig.programs.taskwarrior.enable = true; diff --git a/modules/user/aszlig/services/vlock/default.nix b/modules/user/aszlig/services/vlock/default.nix index 2eced029..439c1b07 100644 --- a/modules/user/aszlig/services/vlock/default.nix +++ b/modules/user/aszlig/services/vlock/default.nix @@ -28,6 +28,16 @@ let in { options.vuizvui.user.aszlig.services.vlock = { enable = lib.mkEnableOption "console lock"; + + user = lib.mkOption { + type = lib.types.str; + example = "horst"; + internal = true; + description = '' + The user under which the locked session will run. This is a workaround + and thus this option is solely internal. + ''; + }; }; config = lib.mkIf cfg.enable { @@ -43,7 +53,7 @@ in { serviceConfig.Type = "oneshot"; #environment.USER = "%i"; XXX - environment.USER = "aszlig"; + environment.USER = cfg.user; script = '' retval=0 -- cgit 1.4.1