From 9064b8e5ce92c3380b8765d55e5ba722361286aa Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 19 Oct 2017 18:42:09 +0200 Subject: l: make screenlock configureable --- lass/1systems/helios/config.nix | 2 ++ lass/2configs/baseX.nix | 2 +- lass/2configs/screenlock.nix | 17 ----------------- lass/3modules/default.nix | 1 + lass/3modules/screenlock.nix | 37 +++++++++++++++++++++++++++++++++++++ lass/5pkgs/xmonad-lass.nix | 2 +- 6 files changed, 42 insertions(+), 19 deletions(-) delete mode 100644 lass/2configs/screenlock.nix create mode 100644 lass/3modules/screenlock.nix (limited to 'lass') diff --git a/lass/1systems/helios/config.nix b/lass/1systems/helios/config.nix index 6db6f8fd1..70aa3832d 100644 --- a/lass/1systems/helios/config.nix +++ b/lass/1systems/helios/config.nix @@ -115,4 +115,6 @@ with import ; (pkgs.fetchurl { url = "http://pki.dcso.de/ca/PEM/DCSOCAIDENC2G1.pem"; sha256 = "1z2qkyhgjvri13bvi06ynkb7mjmpcznmc9yw8chx1lnwc3cxa7kf"; }) (pkgs.fetchurl { url = "http://pki.dcso.de/ca/PEM/DCSOCAIDENC3G1.pem"; sha256 = "0smdjjvz95n652cb45yhzdb2lr83zg52najgbzf6lm3w71f8mv7f"; }) ]; + + lass.screenlock.command = "${pkgs.i3lock}/bin/i3lock -i /home/lass/lock.png -t -f"; } diff --git a/lass/2configs/baseX.nix b/lass/2configs/baseX.nix index 5669eb77d..a8bb8693f 100644 --- a/lass/2configs/baseX.nix +++ b/lass/2configs/baseX.nix @@ -6,7 +6,6 @@ in { imports = [ ./mpv.nix ./power-action.nix - ./screenlock.nix ./copyq.nix ./xresources.nix ./livestream.nix @@ -136,4 +135,5 @@ in { }; services.urxvtd.enable = true; + lass.screenlock.enable = true; } diff --git a/lass/2configs/screenlock.nix b/lass/2configs/screenlock.nix deleted file mode 100644 index b5bc4ee2a..000000000 --- a/lass/2configs/screenlock.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, config, ... }: - -{ - systemd.services.screenlock = { - before = [ "sleep.target" ]; - wantedBy = [ "sleep.target" ]; - environment = { - DISPLAY = ":0"; - }; - serviceConfig = { - SyslogIdentifier = "screenlock"; - ExecStart = "${pkgs.i3lock}/bin/i3lock -i /var/lib/wallpaper/wallpaper -f"; - Type = "forking"; - User = "lass"; - }; - }; -} diff --git a/lass/3modules/default.nix b/lass/3modules/default.nix index e7744395d..e14e39bc2 100644 --- a/lass/3modules/default.nix +++ b/lass/3modules/default.nix @@ -8,6 +8,7 @@ _: ./mysql-backup.nix ./news.nix ./pyload.nix + ./screenlock.nix ./umts.nix ./usershadow.nix ./xresources.nix diff --git a/lass/3modules/screenlock.nix b/lass/3modules/screenlock.nix new file mode 100644 index 000000000..cf38f8357 --- /dev/null +++ b/lass/3modules/screenlock.nix @@ -0,0 +1,37 @@ +{ pkgs, config, ... }: + +with import ; + +let + cfg = config.lass.screenlock; + + out = { + options.lass.screenlock = api; + config = mkIf cfg.enable imp; + }; + + api = { + enable = mkEnableOption "news"; + command = mkOption { + type = types.str; + default = "${pkgs.i3lock}/bin/i3lock -i /var/lib/wallpaper/wallpaper -f"; + }; + }; + + imp = { + systemd.services.screenlock = { + before = [ "sleep.target" ]; + wantedBy = [ "sleep.target" ]; + environment = { + DISPLAY = ":0"; + }; + serviceConfig = { + SyslogIdentifier = "screenlock"; + ExecStart = cfg.command; + Type = "forking"; + User = "lass"; + }; + }; + }; + +in out diff --git a/lass/5pkgs/xmonad-lass.nix b/lass/5pkgs/xmonad-lass.nix index fe391fef9..12c078940 100644 --- a/lass/5pkgs/xmonad-lass.nix +++ b/lass/5pkgs/xmonad-lass.nix @@ -97,7 +97,7 @@ displaySomeException = displayException myKeyMap :: [([Char], X ())] myKeyMap = - [ ("M4-", spawn "${pkgs.i3lock}/bin/i3lock -i /var/lib/wallpaper/wallpaper -f") + [ ("M4-", spawn "${config.lass.screenlock.command}") , ("M4-C-p", spawn "${pkgs.scrot}/bin/scrot ~/public_html/scrot.png") , ("M4-p", spawn "${pkgs.pass}/bin/passmenu --type") , ("M4-o", spawn "${pkgs.brain}/bin/brainmenu --type") -- cgit v1.2.3