mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-02 23:21:02 +01:00
treewide: flatten single file modules
Some files don't need nesting and can be root level again to reduce conflicts with other PRs. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
bda9deb791
commit
86402a17b6
424 changed files with 15 additions and 15 deletions
75
modules/services/unclutter.nix
Normal file
75
modules/services/unclutter.nix
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.unclutter;
|
||||
|
||||
in
|
||||
{
|
||||
options.services.unclutter = {
|
||||
|
||||
enable = lib.mkEnableOption "unclutter";
|
||||
|
||||
package = lib.mkPackageOption pkgs "unclutter-xfixes" { };
|
||||
|
||||
timeout = mkOption {
|
||||
description = "Number of seconds before the cursor is marked inactive.";
|
||||
type = types.int;
|
||||
default = 1;
|
||||
};
|
||||
|
||||
threshold = mkOption {
|
||||
description = "Minimum number of pixels considered cursor movement.";
|
||||
type = types.int;
|
||||
default = 1;
|
||||
};
|
||||
|
||||
extraOptions = mkOption {
|
||||
description = "More arguments to pass to the unclutter command.";
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [
|
||||
"exclude-root"
|
||||
"ignore-scrolling"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.unclutter" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.unclutter = {
|
||||
Unit = {
|
||||
Description = "unclutter";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = ''
|
||||
${cfg.package}/bin/unclutter \
|
||||
--timeout ${toString cfg.timeout} \
|
||||
--jitter ${toString (cfg.threshold - 1)} \
|
||||
${lib.concatMapStrings (x: " --${x}") cfg.extraOptions}
|
||||
'';
|
||||
RestartSec = 3;
|
||||
Restart = "always";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue