refactor in synaptic style
This commit is contained in:
parent
ce295da1c1
commit
a27b02276d
119 changed files with 1099 additions and 3109 deletions
|
@ -1,71 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
ezServices =
|
||||
with lib;
|
||||
mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
};
|
||||
|
||||
ezOneShots =
|
||||
with lib;
|
||||
mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
};
|
||||
ezConf =
|
||||
with lib;
|
||||
mkOption {
|
||||
type = with types; attrsOf path;
|
||||
default = { };
|
||||
};
|
||||
|
||||
# for specifying an additional systemd target
|
||||
extraTarget =
|
||||
with lib;
|
||||
mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
systemd.user.services =
|
||||
builtins.mapAttrs (name: cmd: {
|
||||
Unit = {
|
||||
Description = "${name}";
|
||||
Requires = [ "graphical-session.target" ] ++ config.extraTarget;
|
||||
After = [ "graphical-session.target" ] ++ config.extraTarget;
|
||||
};
|
||||
Service = {
|
||||
ExecStart = cmd;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ] ++ config.extraTarget;
|
||||
};
|
||||
}) config.ezServices
|
||||
// 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.ezOneShots;
|
||||
|
||||
xdg.configFile = builtins.mapAttrs (_name: value: {
|
||||
enable = true;
|
||||
source = value;
|
||||
}) config.ezConf;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue