nix/host/desktop/Container.nix

55 lines
1.2 KiB
Nix
Raw Normal View History

2024-06-01 10:37:49 +03:00
{ pkgs, const, lib, config, util, ... }: let
args = let
storage = "/storage/hot/container";
domain = "local";
host = "192.168.1.3";
in {
inherit storage domain host pkgs const lib config util;
2024-06-09 15:31:53 +03:00
mkContainer = address: cfg: lib.recursiveUpdate cfg {
autoStart = true;
hostAddress = host;
localAddress = address;
privateNetwork = true;
2024-06-01 10:37:49 +03:00
};
mkContainerConfig = cfg: lib.recursiveUpdate cfg {
system.stateVersion = const.stateVersion;
users.users.root.password = "";
users.mutableUsers = false;
networking = {
useHostResolvConf = lib.mkForce false;
firewall.enable = false;
};
};
2024-06-09 15:31:53 +03:00
mkContainerDir = path: "d '${path}' 1777 root root - -";
2024-06-01 10:37:49 +03:00
mkServer = cfg: lib.recursiveUpdate cfg {
forceSSL = false;
};
};
in {
networking.nat = {
enable = true;
internalInterfaces = [ "ve-+" ];
externalInterface = "enp4s0";
};
2024-06-09 15:17:40 +03:00
# TODO: Remove this.
2024-06-01 10:37:49 +03:00
networking.extraHosts = ''
10.1.0.2 paste.local
2024-06-09 15:17:40 +03:00
10.1.0.2 change.local
10.1.0.2 local
2024-06-01 10:37:49 +03:00
'';
imports = [
2024-06-09 15:17:40 +03:00
(import ../../container/Change.nix args)
2024-06-01 10:37:49 +03:00
(import ../../container/Paste.nix args)
(import ../../container/Postgres.nix args)
(import ../../container/Proxy.nix args)
];
}