mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
parent
4b772fd698
commit
8127799f79
3 changed files with 23 additions and 6 deletions
|
@ -22,6 +22,20 @@ in
|
||||||
options.services.sxhkd = {
|
options.services.sxhkd = {
|
||||||
enable = mkEnableOption "simple X hotkey daemon";
|
enable = mkEnableOption "simple X hotkey daemon";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.sxhkd;
|
||||||
|
defaultText = "pkgs.sxhkd";
|
||||||
|
description = "Package containing the <command>sxhkd</command> executable.";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraOptions = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
|
description = "Command line arguments to invoke <command>sxhkd</command> with.";
|
||||||
|
example = literalExample ''[ "-m 1" ]'';
|
||||||
|
};
|
||||||
|
|
||||||
keybindings = mkOption {
|
keybindings = mkOption {
|
||||||
type = types.attrsOf (types.nullOr types.str);
|
type = types.attrsOf (types.nullOr types.str);
|
||||||
default = {};
|
default = {};
|
||||||
|
@ -75,7 +89,7 @@ in
|
||||||
+ "${config.home.profileDirectory}/bin"
|
+ "${config.home.profileDirectory}/bin"
|
||||||
+ optionalString (cfg.extraPath != "") ":"
|
+ optionalString (cfg.extraPath != "") ":"
|
||||||
+ cfg.extraPath;
|
+ cfg.extraPath;
|
||||||
ExecStart = "${pkgs.sxhkd}/bin/sxhkd";
|
ExecStart = "${cfg.package}/bin/sxhkd ${toString cfg.extraOptions}";
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = {
|
Install = {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
services.sxhkd = {
|
services.sxhkd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
package = pkgs.runCommandLocal "dummy-package" { } "mkdir $out" // {
|
||||||
|
outPath = "@sxhkd@";
|
||||||
|
};
|
||||||
|
|
||||||
keybindings = {
|
keybindings = {
|
||||||
"super + a" = "run command a";
|
"super + a" = "run command a";
|
||||||
"super + b" = null;
|
"super + b" = null;
|
||||||
|
@ -19,9 +23,6 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.overlays =
|
|
||||||
[ (self: super: { sxhkd = pkgs.writeScriptBin "dummy-sxhkd" ""; }) ];
|
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
sxhkdrc=home-files/.config/sxhkd/sxhkdrc
|
sxhkdrc=home-files/.config/sxhkd/sxhkdrc
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
{ config, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
services.sxhkd = {
|
services.sxhkd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
package = pkgs.runCommandLocal "dummy-package" { } "mkdir $out" // { outPath = "@sxhkd@"; };
|
||||||
|
extraOptions = [ "-m 1" ];
|
||||||
extraPath = "/home/the-user/bin:/extra/path/bin";
|
extraPath = "/home/the-user/bin:/extra/path/bin";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,7 +13,7 @@
|
||||||
|
|
||||||
assertFileExists $serviceFile
|
assertFileExists $serviceFile
|
||||||
|
|
||||||
assertFileRegex $serviceFile 'ExecStart=.*/bin/sxhkd'
|
assertFileRegex $serviceFile 'ExecStart=@sxhkd@/bin/sxhkd -m 1'
|
||||||
|
|
||||||
assertFileRegex $serviceFile \
|
assertFileRegex $serviceFile \
|
||||||
'Environment=PATH=.*\.nix-profile/bin:/home/the-user/bin:/extra/path/bin'
|
'Environment=PATH=.*\.nix-profile/bin:/home/the-user/bin:/extra/path/bin'
|
||||||
|
|
Loading…
Reference in a new issue