1
0
Fork 0

fix build

This commit is contained in:
Malte Brandy 2020-10-01 07:38:26 +02:00
parent d4fddef96b
commit 8ba9163b39
3 changed files with 26 additions and 24 deletions

View file

@ -3,7 +3,7 @@ let configPath = "/etc/nixos";
in { in {
update-system = pkgs.writeHaskellScript { update-system = pkgs.writeHaskellScript {
name = "update-system"; name = "update-system";
bins = [ nixos-rebuild pkgs.git ]; bins = [ nixos-rebuild ];
} '' } ''
privatePath = "${configPath}/private" privatePath = "${configPath}/private"
canaryPath = privatePath <> "/submodule-is-checked-out" canaryPath = privatePath <> "/submodule-is-checked-out"
@ -11,8 +11,8 @@ in {
main = do main = do
paths <- myNixPath "${configPath}" paths <- myNixPath "${configPath}"
args <- getArgs args <- getArgs
bracket (rm canaryPath) (\() -> git "-C" privatePath "restore" canaryPath) $ \() -> bracket (rm canaryPath) (\() -> exe "/run/wrappers/bin/sudo" "-u" "maralorn" "git" "-C" privatePath "restore" canaryPath) $ \() ->
nixos_rebuild (paths ++ ["build"] ++ remoteBuildParams ++ fmap toString args) nixos_rebuild (paths ++ ["build", "--no-out-link"] ++ remoteBuildParams ++ fmap toString args)
nixos_rebuild (paths ++ ["switch"] ++ fmap toString args) nixos_rebuild (paths ++ ["switch"] ++ fmap toString args)
''; '';
} }

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
let let
locations = { locations = {
"/" = { "/" = {
@ -16,27 +16,29 @@ in {
security.acme.certs."hera.m-0.eu".keyType = "rsa4096"; security.acme.certs."hera.m-0.eu".keyType = "rsa4096";
services = { services = {
nginx = { nginx = {
enable = true; enable = lib.mkForce pkgs.withSecrets;
virtualHosts."tasks.maralorn.de" = { virtualHosts = {
basicAuthFile = pkgs.privatePath "basic-auth/kassandra"; "tasks.maralorn.de" = {
forceSSL = true; basicAuthFile = pkgs.privatePath "basic-auth/kassandra";
enableACME = true; forceSSL = true;
locations = { enableACME = true;
"/" = { locations = {
proxyPass = "http://[::1]:8000"; "/" = {
proxyWebsockets = true; proxyPass = "http://[::1]:8000";
proxyWebsockets = true;
};
}; };
}; };
}; "hera.m-0.eu" = {
virtualHosts."hera.m-0.eu" = { enableACME = true;
enableACME = true; forceSSL = true;
forceSSL = true; inherit locations;
inherit locations; };
}; "maralorn.de" = {
virtualHosts."maralorn.de" = { enableACME = true;
enableACME = true; forceSSL = true;
forceSSL = true; inherit locations;
inherit locations; };
}; };
}; };
}; };

View file

@ -7,7 +7,7 @@ with lib; {
network = { network = {
enable = true; enable = true;
ssh = { ssh = {
enable = true; enable = pkgs.withSecrets;
authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys; authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
hostKeys = [ config.m-0.server.initSSHKey ]; hostKeys = [ config.m-0.server.initSSHKey ];
}; };