pwa module, jay, many thing
This commit is contained in:
parent
d4d04d7d6d
commit
6271f4b54a
32 changed files with 5580 additions and 333 deletions
|
|
@ -4,24 +4,44 @@
|
|||
mainUser,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkOption types mkIf;
|
||||
inherit (types)
|
||||
attrsOf
|
||||
str
|
||||
bool
|
||||
submodule
|
||||
;
|
||||
in
|
||||
scope "options.quick" {
|
||||
services =
|
||||
with lib;
|
||||
mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
};
|
||||
oneShots =
|
||||
with lib;
|
||||
mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
};
|
||||
services = mkOption {
|
||||
type = attrsOf (
|
||||
submodule (
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
cmd = mkOption {
|
||||
type = str;
|
||||
};
|
||||
restart = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
);
|
||||
default = { };
|
||||
};
|
||||
oneShots = mkOption {
|
||||
type = attrsOf str;
|
||||
default = { };
|
||||
};
|
||||
}
|
||||
// scope "config.user.systemd" {
|
||||
enable = true;
|
||||
services =
|
||||
builtins.mapAttrs (name: cmd: {
|
||||
builtins.mapAttrs (name: opts: {
|
||||
environment.PATH = lib.mkForce "/run/current-system/sw/bin:/run/current-system/sw/sbin:/etc/profiles/per-user/${mainUser}/bin:/etc/profiles/per-user/${mainUser}/sbin";
|
||||
unitConfig = {
|
||||
Description = "${name}";
|
||||
|
|
@ -35,8 +55,8 @@ scope "options.quick" {
|
|||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
serviceConfig = {
|
||||
ExecStart = cmd;
|
||||
Restart = "always";
|
||||
ExecStart = opts.cmd;
|
||||
Restart = mkIf (opts.restart) "always";
|
||||
};
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
}) config.quick.services
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue