add locations to configVars and apply to nixos config
This commit is contained in:
parent
93b0fd3425
commit
23edddbea1
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
fileSystems."/media/media" = {
|
||||
{configVars, ...}: let
|
||||
mediaDataMountPoint = configVars.locations.mediaDataMountPoint;
|
||||
in {
|
||||
fileSystems.${mediaDataMountPoint} = {
|
||||
device = "10.0.10.30:/mnt/media";
|
||||
fsType = "nfs";
|
||||
options = ["noatime" "_netdev"];
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
containerIp = configVars.networking.addresses.backup-server.ip;
|
||||
gatewayIp = configVars.networking.addresses.gateway.ip;
|
||||
pubKeys = lib.filesystem.listFilesRecursive ../../users/keys;
|
||||
backupContainerData = configVars.locations.backupContainerData;
|
||||
in {
|
||||
networking.nat.enable = true;
|
||||
networking.nat.internalInterfaces = ["ve-+"];
|
||||
|
@ -27,7 +28,7 @@ in {
|
|||
nixpkgs = pkgs.path;
|
||||
bindMounts = {
|
||||
"/srv/backup" = {
|
||||
hostPath = "/media/main-ssd/backup";
|
||||
hostPath = backupContainerData;
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
containerName = "docker";
|
||||
containerIp = configVars.networking.addresses.docker.ip;
|
||||
gatewayIp = configVars.networking.addresses.gateway.ip;
|
||||
dockerContainerData = configVars.locations.dockerContainerData;
|
||||
mediaDataMountPoint = configVars.locations.mediaDataMountPoint;
|
||||
pubKeys = lib.filesystem.listFilesRecursive ../../users/keys;
|
||||
arion = inputs.arion;
|
||||
sops-nix = inputs.sops-nix;
|
||||
|
@ -19,7 +21,7 @@ in {
|
|||
services.restic.backups = {
|
||||
daily = {
|
||||
paths = [
|
||||
"/media/main-ssd/docker/media-server"
|
||||
dockerContainerData
|
||||
];
|
||||
exclude = [
|
||||
];
|
||||
|
@ -76,11 +78,11 @@ in {
|
|||
isReadOnly = false;
|
||||
};
|
||||
"/media/media" = {
|
||||
hostPath = "/media/media";
|
||||
hostPath = mediaDataMountPoint;
|
||||
isReadOnly = false;
|
||||
};
|
||||
"/srv/docker" = {
|
||||
hostPath = "/media/main-ssd/docker";
|
||||
hostPath = dockerContainerData;
|
||||
isReadOnly = false;
|
||||
};
|
||||
"/etc/ssh/ssh_host_ed25519_key" = {
|
||||
|
|
|
@ -9,10 +9,24 @@
|
|||
containerName = "bitcoin-node";
|
||||
containerIp = configVars.networking.addresses.bitcoin-node.ip;
|
||||
mempoolPort = configVars.networking.addresses.bitcoin-node.services.mempool.port;
|
||||
bitcoinNodeContainerData = configVars.locations.bitcoinNodeContainerData;
|
||||
gatewayIp = configVars.networking.addresses.gateway.ip;
|
||||
allowip = configVars.networking.addresses.bitcoin-node.services.bitcoind.allowip;
|
||||
pubKeys = lib.filesystem.listFilesRecursive ../../users/keys;
|
||||
in {
|
||||
|
||||
services.restic.backups = {
|
||||
daily = {
|
||||
paths = [
|
||||
bitcoinNodeContainerData
|
||||
];
|
||||
exclude = [
|
||||
"${bitcoinNodeContainerData}/bitcoind"
|
||||
"${bitcoinNodeContainerData}/electrs"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
environment.persistence."/persist" = {
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
|
@ -20,18 +34,6 @@ in {
|
|||
];
|
||||
};
|
||||
|
||||
services.restic.backups = {
|
||||
daily = {
|
||||
paths = [
|
||||
"/media/main-ssd/nix-bitcoin/"
|
||||
];
|
||||
exclude = [
|
||||
"/media/main-ssd/nix-bitcoin/bitcoind"
|
||||
"/media/main-ssd/nix-bitcoin/electrs"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
networking.nat.enable = true;
|
||||
networking.nat.internalInterfaces = ["ve-+"];
|
||||
networking.nat.externalInterface = "br0";
|
||||
|
@ -43,7 +45,7 @@ in {
|
|||
nixpkgs = pkgs.path;
|
||||
bindMounts = {
|
||||
"/var/lib/" = {
|
||||
hostPath = "/media/main-ssd/nix-bitcoin/";
|
||||
hostPath = bitcoinNodeContainerData;
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
containerIp = configVars.networking.addresses.postgres.ip;
|
||||
subnetIp = configVars.networking.addresses.subnet.ip;
|
||||
gatewayIp = configVars.networking.addresses.gateway.ip;
|
||||
postgresContainerData = configVars.locations.postgresContainerData;
|
||||
in {
|
||||
sops.secrets = {
|
||||
"software/postgres/postgres/password" = {
|
||||
|
@ -36,7 +37,7 @@ in {
|
|||
nixpkgs = pkgs.path;
|
||||
bindMounts = {
|
||||
"/var/lib/postgresql" = {
|
||||
hostPath = "/media/main-ssd/postgresql";
|
||||
hostPath = postgresContainerData;
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -62,10 +62,6 @@ in {
|
|||
../common/optional/nixos-containers/backup-server.nix
|
||||
../common/optional/nixos-containers/docker.nix
|
||||
|
||||
# # docker containers
|
||||
# ../common/optional/arion-containers/jellyfin.nix
|
||||
# ../common/optional/arion-containers/arrstack.nix
|
||||
|
||||
# # Build nix derivations on remote machine
|
||||
# ../common/optional/distributed_builds/local-machine.nix
|
||||
];
|
||||
|
|
|
@ -4,5 +4,12 @@
|
|||
networking
|
||||
email
|
||||
;
|
||||
locations = {
|
||||
dockerContainerData = "/media/main-ssd/docker";
|
||||
mediaDataMountPoint = "/media/media";
|
||||
bitcoinNodeContainerData = "/media/main-ssd/nix-bitcoin";
|
||||
backupContainerData = "/media/main-ssd/backup";
|
||||
postgresContainerData = "/media/main-ssd/postgresql";
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue