1
0
Fork 0

Modules: Tweak fever dream merging for autostart attribute

This commit is contained in:
Aires 2024-07-02 16:19:15 -04:00
parent 20212e406c
commit 84885450a2
4 changed files with 137 additions and 156 deletions

View file

@ -32,8 +32,7 @@ in
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
config = lib.mkIf cfg.enable {
aux.system.users.media.enable = true;
users.users.airsonic.extraGroups = [ "media" ];
@ -63,10 +62,7 @@ in
};
systemd.services.nginx.wants = [ config.systemd.services.airsonic.name ];
})
(lib.mkIf (!cfg.autostart) {
# Disable autostart if needed
systemd.services.airsonic.wantedBy = lib.mkForce [ ];
})
];
# Disable autostart if configured
systemd.services.airsonic = lib.mkIf (!cfg.autostart) { wantedBy = lib.mkForce [ ]; };
};
}

View file

@ -28,15 +28,14 @@ rec {
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
config = lib.mkIf cfg.enable {
nixpkgs.config.allowUnfree = true;
environment.systemPackages = [ duplicacy-web ];
networking.firewall.allowedTCPPorts = [ 3875 ];
# Install systemd service.
systemd.services."duplicacy-web" = {
systemd.services.duplicacy-web = {
enable = true;
wants = [ "network-online.target" ];
after = [
@ -54,13 +53,6 @@ rec {
environment = {
HOME = cfg.environment;
};
} // lib.optionalAttrs (!cfg.autostart) { wantedBy = lib.mkForce [ ]; };
};
})
(lib.mkIf (!cfg.autostart) {
# Disable autostart if needed
systemd.services.duplicacy-web.wantedBy = lib.mkForce [ ];
})
];
}

View file

@ -55,8 +55,7 @@ in
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
config = lib.mkIf cfg.enable {
environment.systemPackages = [
forgejo-cli
pkgs.podman-tui
@ -126,10 +125,7 @@ in
allowedTCPPorts = [ 53 ];
allowedUDPPorts = [ 53 ];
};
})
(lib.mkIf (!cfg.autostart) {
# Disable autostart if needed
systemd.services.forgejo.wantedBy = lib.mkForce [ ];
})
];
# Disable autostart if configured
systemd.services.forgejo = lib.mkIf (!cfg.autostart) { wantedBy = lib.mkForce [ ]; };
};
}

View file

@ -17,8 +17,7 @@ in
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
config = lib.mkIf cfg.enable {
services.nginx = {
enable = true;
@ -38,10 +37,8 @@ in
443
];
};
})
(lib.mkIf (!cfg.autostart) {
# Disable autostart if needed
systemd.services.nginx.wantedBy = lib.mkForce [ ];
})
];
# Disable autostart if configured
systemd.services.nginx = lib.mkIf (!cfg.autostart) { wantedBy = lib.mkForce [ ]; };
};
}