Compare commits
2 commits
ddd49ed84f
...
59e99a54a7
Author | SHA1 | Date | |
---|---|---|---|
59e99a54a7 | |||
b72c4a2150 |
2 changed files with 10 additions and 5 deletions
|
@ -6,23 +6,26 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib) mkEnableOption mkIf;
|
inherit (lib) mkEnableOption mkIf getExe;
|
||||||
|
|
||||||
cfg = config.marleyos.services.screen-locker;
|
cfg = config.marleyos.services.screen-locker;
|
||||||
hasXorg = config.xsession.enable;
|
hasXorg = config.xsession.enable;
|
||||||
hasI3 = config.xsession.windowManager.i3.enable;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.marleyos.services.screen-locker.enable = mkEnableOption "screen-locker";
|
options.marleyos.services.screen-locker.enable = mkEnableOption "screen-locker";
|
||||||
|
|
||||||
config = mkIf (cfg.enable && hasXorg) {
|
config = mkIf (cfg.enable && hasXorg) {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
betterlockscreen
|
||||||
|
];
|
||||||
|
|
||||||
services.screen-locker = {
|
services.screen-locker = {
|
||||||
enable = true;
|
enable = true;
|
||||||
inactiveInterval = 20;
|
inactiveInterval = 20;
|
||||||
|
|
||||||
# exec xss-lock {xss-lock.extraOptions} -- {lockCmd}
|
# exec xss-lock {xss-lock.extraOptions} -- {lockCmd}
|
||||||
xss-lock.extraOptions = [ "--transfer-sleep-lock" ];
|
xss-lock.extraOptions = [ "--transfer-sleep-lock" ];
|
||||||
lockCmd = if hasI3 then "${pkgs.i3lock}/bin/i3lock --nofork" else "";
|
lockCmd = "${getExe pkgs.betterlockscreen} -l";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,10 @@ let
|
||||||
listToAttrs
|
listToAttrs
|
||||||
getExe
|
getExe
|
||||||
;
|
;
|
||||||
inherit (lib.marleyos) enabled;
|
inherit (lib.marleyos) enabled disabled;
|
||||||
|
|
||||||
cfg = config.marleyos.xorg.i3;
|
cfg = config.marleyos.xorg.i3;
|
||||||
|
isGenericLinux = config.targets.genericLinux.enable;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.marleyos.xorg.i3.enable = mkEnableOption "i3";
|
options.marleyos.xorg.i3.enable = mkEnableOption "i3";
|
||||||
|
@ -28,7 +29,8 @@ in
|
||||||
dunst = enabled;
|
dunst = enabled;
|
||||||
picom = enabled;
|
picom = enabled;
|
||||||
polybar = enabled;
|
polybar = enabled;
|
||||||
screen-locker = enabled;
|
# broken on non-nixOS
|
||||||
|
screen-locker = if isGenericLinux then enabled else disabled;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue