fix? flake
This commit is contained in:
parent
efcab418f1
commit
d2e051b09d
20
flake.nix
20
flake.nix
|
@ -9,7 +9,7 @@
|
|||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, crystal-flake }:
|
||||
(with flake-utils.lib; eachSystem defaultSystems) (system:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
inherit (crystal-flake.packages.${system}) crystal shards;
|
||||
|
@ -47,8 +47,9 @@
|
|||
shards
|
||||
];
|
||||
};
|
||||
|
||||
nixosModule = { config, lib, pkgs, ... }:
|
||||
}) // {
|
||||
nixosModules = {
|
||||
crystal-gauntlet = { config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.crystal-gauntlet;
|
||||
|
@ -67,7 +68,7 @@
|
|||
};
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = self.packages.${system}.default;
|
||||
default = self.defaultPackage.${pkgs.system};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -75,6 +76,10 @@
|
|||
systemd.services."crystal-gauntlet" = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
environment = {
|
||||
LISTEN_ON = "http://127.0.0.1:${toString cfg.port}";
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Restart = "on-failure";
|
||||
ExecStart = "${getExe cfg.package}";
|
||||
|
@ -88,13 +93,13 @@
|
|||
};
|
||||
};
|
||||
|
||||
services.nginx = mkIf cfg.domain {
|
||||
services.nginx = mkIf (cfg.domain != null) {
|
||||
virtualHosts."${cfg.domain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = false;
|
||||
addSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${cfg.port}/";
|
||||
proxyPass = "http://127.0.0.1:${toString cfg.port}/";
|
||||
};
|
||||
extraConfig = ''
|
||||
client_max_body_size 500M;
|
||||
|
@ -103,5 +108,6 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue