Skip to content

Commit

Permalink
Remove extraTools (use modules); clean up https code
Browse files Browse the repository at this point in the history
  • Loading branch information
3noch committed Sep 24, 2017
1 parent e196a96 commit a3bad29
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
2 changes: 0 additions & 2 deletions default-app-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ in lib.makeExtensible (self: {
maxUploadMb = 50;

# --- ADVANCED CONFIGURATION ---
extraTools = pkgs: []; # Add tools to the server, e.g. [pkgs.git]

imports = []; # module imports for the server

# raw nginx location directives to insert above the WordPress locations
Expand Down
34 changes: 19 additions & 15 deletions server/logical.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,24 @@ in {
};

phpIni = import ./php-config.nix { inherit pkgs config appConfig; };

httpsModule = {
security.acme.certs.${appConfig.host} = {
webroot = acmeChallengesDir;
email = appConfig.adminEmail;
extraDomains = pkgs.lib.genAttrs appConfig.hostRedirects (x: null);
postRun = "systemctl reload nginx.service";
};

# Depending on hardware, first-time deploy could take a good 5-15 minutes for this to generate.
security.dhparams.params = { nginx = 3072; };
};

in {
imports = appConfig.imports;

imports = [
(if appConfig.enableHttps then httpsModule else {})
] ++ appConfig.imports;

networking = {
hostName = machineName;
Expand All @@ -62,7 +78,7 @@ in {

environment.systemPackages = with pkgs; [
gzip htop unzip nix-repl php vim wp-cli zip
] ++ appConfig.extraTools pkgs;
];

time.timeZone = appConfig.timezone;

Expand Down Expand Up @@ -127,17 +143,5 @@ in {
customIni = pkgs.writeTextDir "wp-cli-custom.ini" phpIni;
in "${pkgs.php}/etc:${customIni}";
};
}
//
(if !appConfig.enableHttps then {} else {
security.acme.certs.${appConfig.host} = {
webroot = acmeChallengesDir;
email = appConfig.adminEmail;
extraDomains = pkgs.lib.genAttrs appConfig.hostRedirects (x: null);
postRun = "systemctl reload nginx.service";
};

# Depending on hardware, first-time deploy could take a good 5-15 minutes for this to generate.
security.dhparams.params = { nginx = 3072; };
});
};
}

0 comments on commit a3bad29

Please sign in to comment.