l: make screenlock configureable

This commit is contained in:
lassulus 2017-10-19 18:42:09 +02:00
parent cef1c830b1
commit 9064b8e5ce
6 changed files with 42 additions and 19 deletions

View File

@ -115,4 +115,6 @@ with import <stockholm/lib>;
(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";
}

View File

@ -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;
}

View File

@ -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";
};
};
}

View File

@ -8,6 +8,7 @@ _:
./mysql-backup.nix
./news.nix
./pyload.nix
./screenlock.nix
./umts.nix
./usershadow.nix
./xresources.nix

View File

@ -0,0 +1,37 @@
{ pkgs, config, ... }:
with import <stockholm/lib>;
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

View File

@ -97,7 +97,7 @@ displaySomeException = displayException
myKeyMap :: [([Char], X ())]
myKeyMap =
[ ("M4-<F11>", spawn "${pkgs.i3lock}/bin/i3lock -i /var/lib/wallpaper/wallpaper -f")
[ ("M4-<F11>", 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")