Make custom swaylock wrapper own derivation
Hopefully fix issues with swayidle not being able to find wrapped script by passing derivation directly
This commit is contained in:
parent
93d1867f5f
commit
8e7bc3aeaf
|
@ -1,11 +1,19 @@
|
|||
{...}: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [../swaylock/default.nix];
|
||||
services.swayidle = {
|
||||
services.swayidle = let
|
||||
swaylockfx =
|
||||
pkgs.callPackage ../swaylock/swaylockfx.nix
|
||||
{swaylock-effects = config.programs.swaylock.package;};
|
||||
in {
|
||||
enable = true;
|
||||
timeouts = [
|
||||
{
|
||||
timeout = 60 * 15; # 15 minutes
|
||||
command = "swaylockfx";
|
||||
command = "${swaylockfx}/bin/swaylockfx";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
(writeShellScriptBin "swaylockfx"
|
||||
"${config.programs.swaylock.package}/bin/swaylock --screenshots --clock --indicator --grace-no-mouse")
|
||||
(callPackage ./swaylockfx.nix
|
||||
{swaylock-effects = config.programs.swaylock.package;})
|
||||
];
|
||||
programs.swaylock = {
|
||||
enable = true;
|
||||
|
|
6
programs/sway/swaylock/swaylockfx.nix
Normal file
6
programs/sway/swaylock/swaylockfx.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
writeShellScriptBin,
|
||||
swaylock-effects,
|
||||
...
|
||||
}:
|
||||
writeShellScriptBin "swaylockfx" "${swaylock-effects}/bin/swaylock --screenshots --clock --indicator --grace-no-mouse"
|
Reference in a new issue