fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Kylie McClainsxhkd: allow usage of derivations as keybind commands (#4169)44d1a854

master
736 B42 linesraw
1{ config, pkgs, ... }:
2
3let
4  script = pkgs.writeShellScript "script.sh" ''
5    echo "test"
6  '';
7in {
8  services.sxhkd = {
9    enable = true;
10
11    package = config.lib.test.mkStubPackage { outPath = "@sxhkd@"; };
12
13    keybindings = {
14      "super + a" = "run command a";
15      "super + b" = null;
16      "super + Shift + b" = "run command b";
17      "super + s" = script;
18    };
19
20    extraConfig = ''
21      super + c
22        call command c
23
24      # comment
25      super + d
26        call command d
27    '';
28  };
29
30  nmt.script = ''
31    sxhkdrc=home-files/.config/sxhkd/sxhkdrc
32
33    assertFileExists $sxhkdrc
34
35    assertFileContent $sxhkdrc ${
36      pkgs.substituteAll {
37        src = ./sxhkdrc;
38        inherit script;
39      }
40    }
41  '';
42}