Skip to content

Commit 09f9eab

Browse files
committed
move custom swaylock to lpkgs
1 parent efea797 commit 09f9eab

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

home-manager/fragments/sway.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
config,
33
lib,
44
pkgs,
5+
lpkgs,
56

67
isDarwin,
78
...
89
}:
910

1011
let
12+
inherit (config.local) flags;
1113
cfg = config.local.fragment.sway;
1214
cfg-sway = config.wayland.windowManager.sway.config;
1315

@@ -30,12 +32,13 @@ in
3032

3133
programs.swaylock = {
3234
enable = true;
35+
package = if !flags.onlyCached then lpkgs.swaylock else pkgs.swaylock;
3336
settings = {
3437
ignore-empty-password = true;
3538
show-failed-attempts = true;
3639

3740
# relies on custom swaylock version in `overlays/patches.nix`
38-
indicator-y-position = -100;
41+
indicator-y-position = if !flags.onlyCached then -100 else 100;
3942
indicator-x-position = 100;
4043
};
4144
};
@@ -250,7 +253,7 @@ in
250253
sleep 1
251254
252255
${grim} $tmpimg
253-
${lib.getExe pkgs.swaylock} --image $tmpimg
256+
${lib.getExe config.programs.swaylock.package} --image $tmpimg
254257
255258
rm $tmpimg
256259
''}";

overlays/patches.nix

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
final: prev:
22

3-
with final.lib;
4-
53
{
6-
# TODO: remove once github:swaywm/swaylock#369 is merged
7-
swaylock = prev.swaylock.overrideAttrs (old: {
8-
src = prev.fetchFromGitHub {
9-
owner = "mrnossiom";
10-
repo = "swaylock";
11-
rev = "1e949610081ea0788d9fba6f0d7c909d7b62e9e0";
12-
hash = "sha256-3YN6n5mYB7r1Xk22AGYMusNbA6aBD6OMU3Gn9OOuS6o=";
13-
};
14-
});
154
}

pkgs/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ in
2222
lsr = callPackage ./lsr { };
2323
names = callPackage ./names.nix { };
2424
probe-rs-udev-rules = callPackage ./probe-rs-udev-rules.nix { };
25+
swaylock = callPackage ./swaylock.nix { };
2526

2627
# Import packages defined in foreign repositories
2728
inherit (agenix.packages.${system}) agenix;

pkgs/swaylock.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
swaylock,
3+
fetchFromGitHub,
4+
...
5+
}:
6+
7+
# TODO: remove once github:swaywm/swaylock#369 is merged
8+
swaylock.overrideAttrs (old: {
9+
src = fetchFromGitHub {
10+
owner = "mrnossiom";
11+
repo = "swaylock";
12+
rev = "1e949610081ea0788d9fba6f0d7c909d7b62e9e0";
13+
hash = "sha256-3YN6n5mYB7r1Xk22AGYMusNbA6aBD6OMU3Gn9OOuS6o=";
14+
};
15+
})

0 commit comments

Comments
 (0)