1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-20 16:59:47 +01:00

pueue: add module

This commit is contained in:
AndersonTorres 2022-08-12 23:37:04 -03:00 committed by Robert Helgesson
parent ae474885f7
commit 7bb4576f46
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
4 changed files with 70 additions and 0 deletions

2
.github/CODEOWNERS vendored
View file

@ -421,6 +421,8 @@ Makefile @thiagokokada
/modules/services/poweralertd.nix @ThibautMarty
/modules/services/pueue.nix @AndersonTorres
/modules/services/pulseeffects.nix @jonringer
/modules/services/random-background.nix @rycee

View file

@ -653,6 +653,14 @@ in
A new module is available: 'programs.bashmount'.
'';
}
{
time = "2022-08-25T21:01:37+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.pueue'.
'';
}
];
};
}

View file

@ -244,6 +244,7 @@ let
./services/plex-mpv-shim.nix
./services/polybar.nix
./services/poweralertd.nix
./services/pueue.nix
./services/pulseeffects.nix
./services/random-background.nix
./services/recoll.nix

View file

@ -0,0 +1,59 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.pueue;
yamlFormat = pkgs.formats.yaml { };
configFile = yamlFormat.generate "pueue.yaml" cfg.settings;
in {
meta.maintainers = [ maintainers.AndersonTorres ];
options.services.pueue = {
enable = mkEnableOption "Pueue, CLI process scheduler and manager";
package = mkPackageOption pkgs "pueue" { };
settings = mkOption {
type = yamlFormat.type;
default = { };
example = literalExpression ''
{
daemon = {
default_parallel_tasks = 2;
};
}
'';
description = ''
Configuration written to
<filename>$XDG_CONFIG_HOME/pueue/pueue.yml</filename>.
'';
};
};
config = mkIf cfg.enable {
assertions =
[ (hm.assertions.assertPlatform "services.pueue" pkgs platforms.linux) ];
home.packages = [ cfg.package ];
xdg.configFile."pueue/pueue.yml".source = configFile;
systemd.user = {
services.pueued = {
Unit = {
Description = "Pueue Daemon - CLI process scheduler and manager";
};
Service = {
Restart = "on-failure";
ExecStart = "${cfg.package}/bin/pueued -v -c ${configFile}";
};
Install.WantedBy = [ "default.target" ];
};
};
};
}