aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix50
1 files changed, 27 insertions, 23 deletions
diff --git a/flake.nix b/flake.nix
index dae9173..1e9f068 100644
--- a/flake.nix
+++ b/flake.nix
@@ -82,7 +82,8 @@
default = {};
};
};
- config = lib.mkIf cfg.enable ({
+ config = lib.mkIf cfg.enable lib.mkMerge [
+ {
environment = {
variables.MSCI_HOME = cfg.dataDir;
systemPackages = [self.packages."${system}".msci];
@@ -111,29 +112,32 @@
};
};
}
- // lib.mkIf cfg.webUI.enable {
- systemd.services.makeshiftci-web = {
- wantedBy = ["multi-user.target"];
- unitConfig.ConditionUser =
- if cfg.createUser
- then "makeshiftci"
- else "root";
- serviceConfig = let
- webui = pkgs.python3.withPackages (p:
- with p; [
- gunicorn
- self.packages."${system}".msci-web
- ]);
- in {
- ExecStart =
- "${webui}/bin/gunicorn "
- + "-w ${builtins.toString cfg.webUI.workers} "
- + "--timeout ${builtins.toString cfg.webUI.timeout} "
- + "-b 127.0.0.1:${builtins.toString cfg.webUI.port} "
- + "'web:create_app()'";
+ (lib.mkIf
+ cfg.webUI.enable
+ {
+ systemd.services.makeshiftci-web = {
+ wantedBy = ["multi-user.target"];
+ unitConfig.ConditionUser =
+ if cfg.createUser
+ then "makeshiftci"
+ else "root";
+ serviceConfig = let
+ webui = pkgs.python3.withPackages (p:
+ with p; [
+ gunicorn
+ self.packages."${system}".msci-web
+ ]);
+ in {
+ ExecStart =
+ "${webui}/bin/gunicorn "
+ + "-w ${builtins.toString cfg.webUI.workers} "
+ + "--timeout ${builtins.toString cfg.webUI.timeout} "
+ + "-b 127.0.0.1:${builtins.toString cfg.webUI.port} "
+ + "'web:create_app()'";
+ };
};
- };
- });
+ })
+ ];
};
};
}