refactor rice into config
This commit is contained in:
parent
8872a12d20
commit
e4b7d76769
64 changed files with 225 additions and 230 deletions
|
@ -1,59 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
config.hm.options = {
|
||||
quickServices =
|
||||
with lib;
|
||||
mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
};
|
||||
|
||||
quickOneShots =
|
||||
with lib;
|
||||
mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
};
|
||||
# for specifying an additional systemd target
|
||||
extraTarget =
|
||||
with lib;
|
||||
mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
config.hm.config = {
|
||||
systemd.user.services =
|
||||
builtins.mapAttrs (name: cmd: {
|
||||
Unit = {
|
||||
Description = "${name}";
|
||||
Requires = [ "graphical-session.target" ] ++ config.hm.extraTarget;
|
||||
After = [ "graphical-session.target" ] ++ config.hm.extraTarget;
|
||||
};
|
||||
Service = {
|
||||
ExecStart = cmd;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ] ++ config.hm.extraTarget;
|
||||
};
|
||||
}) config.hm.quickServices
|
||||
// builtins.mapAttrs (name: cmd: {
|
||||
Unit = {
|
||||
Description = "${name}";
|
||||
After = [ "graphical-session.target" ] ++ config.extraTarget;
|
||||
};
|
||||
Service = {
|
||||
ExecStart = cmd;
|
||||
Type = "oneshot";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ] ++ config.extraTarget;
|
||||
};
|
||||
}) config.hm.quickOneShots;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue