mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-06-19 14:33:16 -04:00
Merge 63d49a4b11 into 8e356692f6
This commit is contained in:
commit
22260be8e5
1 changed files with 11 additions and 6 deletions
|
|
@ -11,10 +11,15 @@ let
|
|||
variables = lib.concatStringsSep " " cfg.systemd.variables;
|
||||
extraCommands = lib.concatStringsSep " && " cfg.systemd.extraCommands;
|
||||
systemdActivation = "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables}; ${extraCommands}";
|
||||
autostart_sh = pkgs.writeShellScript "autostart.sh" ''
|
||||
${lib.optionalString cfg.systemd.enable systemdActivation}
|
||||
${cfg.autostart_sh}
|
||||
'';
|
||||
addAutostartScript = cfg.autostart_sh != "" || cfg.systemd.enable;
|
||||
autostart_sh =
|
||||
if addAutostartScript then
|
||||
pkgs.writeShellScript "autostart.sh" ''
|
||||
${lib.optionalString cfg.systemd.enable systemdActivation}
|
||||
${cfg.autostart_sh}
|
||||
''
|
||||
else
|
||||
null;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
|
|
@ -228,7 +233,7 @@ in
|
|||
)
|
||||
)
|
||||
+ lib.optionalString (cfg.extraConfig != "") cfg.extraConfig
|
||||
+ lib.optionalString (cfg.autostart_sh != "") "\nexec-once=~/.config/mango/autostart.sh\n";
|
||||
+ lib.optionalString (addAutostartScript) "\nexec-once=~/.config/mango/autostart.sh\n";
|
||||
|
||||
validatedConfig = pkgs.runCommand "mango-config.conf" { } ''
|
||||
cp ${pkgs.writeText "mango-config.conf" finalConfigText} "$out"
|
||||
|
|
@ -251,7 +256,7 @@ in
|
|||
{
|
||||
source = validatedConfig;
|
||||
};
|
||||
"mango/autostart.sh" = lib.mkIf (cfg.autostart_sh != "") {
|
||||
"mango/autostart.sh" = lib.mkIf addAutostartScript {
|
||||
source = autostart_sh;
|
||||
executable = true;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue