Add server config to flake.nix

This commit is contained in:
Jez Cope 2021-09-10 21:25:46 +01:00
parent a7be6d1b37
commit c5e84d6387
1 changed files with 18 additions and 2 deletions

View File

@ -5,7 +5,7 @@
inputs.flake-utils.url = "github:numtide/flake-utils"; inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }: outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: (flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; let pkgs = nixpkgs.legacyPackages.${system};
in { in {
defaultPackage = pkgs.stdenv.mkDerivation { defaultPackage = pkgs.stdenv.mkDerivation {
@ -18,6 +18,7 @@
cp -R public/* $out cp -R public/* $out
''; '';
}; };
devShell = pkgs.mkShell { devShell = pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
(python38.withPackages (python38.withPackages
@ -26,5 +27,20 @@
hugo hugo
]; ];
}; };
}); })) // {
nixosModule = {
services.nginx = {
enable = true;
virtualHosts."erambler.co.uk" = {
enableACME = true;
forceSSL = true;
root = "/srv/www/erambler.co.uk";
};
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
};
};
} }