Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ee24f8a4a9 |
@@ -49,7 +49,6 @@ in
|
|||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://10.0.0.10";
|
proxyPass = "http://10.0.0.10";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
client_max_body_size 10G;
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -86,15 +86,10 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
authorizedKeys = sshKeys.admins;
|
authorizedKeys = sshKeys.admins;
|
||||||
ethernetDrivers = ["r8169"];
|
ethernetDrivers = ["r8169"];
|
||||||
zfsExtraPools = [ "storage" ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.initrd = {
|
boot.initrd = {
|
||||||
availableKernelModules = [ "wireguard" ];
|
availableKernelModules = [ "wireguard" ];
|
||||||
# postMountCommands = ''
|
|
||||||
# ip address flush dev wg-initrd
|
|
||||||
# ip link set dev wg-initrd down
|
|
||||||
# '';
|
|
||||||
systemd = {
|
systemd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
network = {
|
network = {
|
||||||
@@ -106,15 +101,15 @@ in
|
|||||||
};
|
};
|
||||||
wireguardConfig = { PrivateKeyFile = "/etc/secrets/30-wg-initrd.key"; };
|
wireguardConfig = { PrivateKeyFile = "/etc/secrets/30-wg-initrd.key"; };
|
||||||
wireguardPeers = [{
|
wireguardPeers = [{
|
||||||
AllowedIPs = peers.vpn.allowedIPs;
|
AllowedIPs = peers.fanny-initrd.allowedIPs;
|
||||||
PublicKey = peers.vpn.publicKey;
|
PublicKey = peers.fanny-initrd.publicKey;
|
||||||
Endpoint = "${peers.vpn.publicIp}:${builtins.toString(peers.vpn.listenPort)}";
|
Endpoint = "${peers.vpn.publicIp}:${builtins.toString(peers.vpn.listenPort)}";
|
||||||
PersistentKeepalive = 25;
|
PersistentKeepalive = 25;
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
networks."30-wg-initrd" = {
|
networks."30-wg-initrd" = {
|
||||||
name = "wg-initrd";
|
name = "wg-initrd";
|
||||||
addresses = [{ Address = "${peers.fanny-initrd.address}/24"; }];
|
addresses = [{ Address = peers.fanny-initrd.address; }];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -165,7 +160,7 @@ in
|
|||||||
proxyPass = "http://10.0.0.13";
|
proxyPass = "http://10.0.0.13";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
client_max_body_size ${inputs.self.nixosConfigurations.nextcloud.config.services.nextcloud.maxUploadSize};
|
client_max_body_size 10G;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,11 +22,6 @@ in
|
|||||||
description = "Ethernet drivers to load: run `lspci -k | grep -iA4 ethernet`";
|
description = "Ethernet drivers to load: run `lspci -k | grep -iA4 ethernet`";
|
||||||
example = "r8169";
|
example = "r8169";
|
||||||
};
|
};
|
||||||
zfsExtraPools = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
default = [ ];
|
|
||||||
description = "Name or GUID of extra ZFS pools that you wish to import during boot.";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf (cfg.enable && config.malobeo.disks.encryption) {
|
config = lib.mkIf (cfg.enable && config.malobeo.disks.encryption) {
|
||||||
@@ -37,41 +32,33 @@ in
|
|||||||
zfs = {
|
zfs = {
|
||||||
forceImportAll = true;
|
forceImportAll = true;
|
||||||
requestEncryptionCredentials = true;
|
requestEncryptionCredentials = true;
|
||||||
extraPools = cfg.zfsExtraPools;
|
|
||||||
};
|
};
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = cfg.ethernetDrivers;
|
availableKernelModules = cfg.ethernetDrivers;
|
||||||
systemd = {
|
systemd = {
|
||||||
initrdBin = [ pkgs.busybox pkgs.wireguard-tools pkgs.iproute2 ];
|
|
||||||
enable = true;
|
enable = true;
|
||||||
network.enable = true;
|
network.enable = true;
|
||||||
services."stopInitVpn" = {
|
|
||||||
description = "stop init vpn";
|
|
||||||
wantedBy = [
|
|
||||||
"initrd.target"
|
|
||||||
];
|
|
||||||
after = [
|
|
||||||
"zfs.target"
|
|
||||||
];
|
|
||||||
serviceConfig.StandardOutput = "journal+console";
|
|
||||||
script = ''
|
|
||||||
networkctl down wg-initrd
|
|
||||||
'';
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
};
|
};
|
||||||
};
|
network.ssh = {
|
||||||
network = {
|
|
||||||
flushBeforeStage2 = true;
|
|
||||||
ssh = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
port = 222;
|
port = 222;
|
||||||
authorizedKeys = cfg.authorizedKeys;
|
authorizedKeys = cfg.authorizedKeys;
|
||||||
hostKeys = [ "/etc/ssh/initrd" ];
|
hostKeys = [ "/etc/ssh/initrd" ];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
secrets = {
|
secrets = {
|
||||||
"/etc/ssh/initrd" = "/etc/ssh/initrd";
|
"/etc/ssh/initrd" = "/etc/ssh/initrd";
|
||||||
};
|
};
|
||||||
|
systemd.services.zfs-remote-unlock = {
|
||||||
|
description = "Prepare for ZFS remote unlock";
|
||||||
|
wantedBy = ["initrd.target"];
|
||||||
|
after = ["systemd-networkd.service"];
|
||||||
|
path = with pkgs; [ zfs ];
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
script = ''
|
||||||
|
echo "zfs load-key -a; killall zfs; systemctl default" >> /var/empty/.profile
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
kernelParams = [ "ip=::::${hostName}-initrd::dhcp" ];
|
kernelParams = [ "ip=::::${hostName}-initrd::dhcp" ];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -31,10 +31,6 @@ with lib;
|
|||||||
lokiHost = "10.0.0.14";
|
lokiHost = "10.0.0.14";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.postgresqlBackup = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.nextcloud31;
|
package = pkgs.nextcloud31;
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ with lib;
|
|||||||
proxyPass = "http://10.100.0.101";
|
proxyPass = "http://10.100.0.101";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
client_max_body_size ${inputs.self.nixosConfigurations.nextcloud.config.services.nextcloud.maxUploadSize};
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user