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