containers: make all variables explicit

Instead of merging the argument set just make all arguments explicit.
This commit is contained in:
steveej 2020-09-15 17:21:28 +02:00
parent fc94819a23
commit 0836c22881
5 changed files with 31 additions and 23 deletions

View file

@ -1,4 +1,7 @@
{ config, ... } @ args: { config
, hostAddress
, localAddress
}:
let let
unstablepkgs = import <channels-nixos-unstable> { config = config.nixpkgs.config; }; unstablepkgs = import <channels-nixos-unstable> { config = config.nixpkgs.config; };
@ -63,7 +66,7 @@ let
}; };
in args // { in {
config = { pkgs, ... }: { config = { pkgs, ... }: {
imports = [ imports = [
../profiles/containers/configuration.nix ../profiles/containers/configuration.nix
@ -189,4 +192,6 @@ in args // {
privateNetwork = true; privateNetwork = true;
forwardPorts = [ forwardPorts = [
]; ];
inherit hostAddress localAddress;
} }

View file

@ -1,12 +1,13 @@
{ ... } @ args: { hostAddress
, localAddress
, imapsPort ? 993
, sievePort ? 4190
}:
let let
passwords = import ../../variables/passwords.crypt.nix; passwords = import ../../variables/passwords.crypt.nix;
in in {
{ imapsPort ? 993
, sievePort ? 4190
}: args // {
config = { pkgs, ... }: { config = { pkgs, ... }: {
imports = [ imports = [
@ -158,4 +159,6 @@ in
protocol = "tcp"; protocol = "tcp";
} }
]; ];
inherit hostAddress localAddress;
} }

View file

@ -1,10 +1,9 @@
{ ... } @ args: { hostAddress
, localAddress
, syncthingPort ? 22000
}:
let {
in
{ syncthingPort ? 22000
}: args // {
config = { config, pkgs, ... }: { config = { config, pkgs, ... }: {
imports = [ imports = [
@ -41,4 +40,6 @@ in
protocol = "tcp"; protocol = "tcp";
} }
]; ];
inherit hostAddress localAddress;
} }

View file

@ -1,10 +1,7 @@
{ ... } @ args: { hostAddress
, localAddress
let , httpsPort ? 443
}: {
in
{ httpsPort ? 443
}: args // {
config = { config, pkgs, ... }: { config = { config, pkgs, ... }: {
imports = [ imports = [
../profiles/containers/configuration.nix ../profiles/containers/configuration.nix
@ -95,4 +92,6 @@ in
protocol = "tcp"; protocol = "tcp";
} }
]; ];
inherit hostAddress localAddress;
} }

View file

@ -101,7 +101,7 @@ in {
mailserver = import ../../containers/mailserver.nix { mailserver = import ../../containers/mailserver.nix {
hostAddress = "192.168.100.10"; hostAddress = "192.168.100.10";
localAddress = "192.168.100.11"; localAddress = "192.168.100.11";
} {
imapsPort = 993; imapsPort = 993;
sievePort = 4190; sievePort = 4190;
}; };
@ -109,14 +109,14 @@ in {
webserver = import ../../containers/webserver.nix { webserver = import ../../containers/webserver.nix {
hostAddress = "192.168.100.12"; hostAddress = "192.168.100.12";
localAddress = "192.168.100.13"; localAddress = "192.168.100.13";
} {
httpsPort = 443; httpsPort = 443;
}; };
syncthing = import ../../containers/syncthing.nix { syncthing = import ../../containers/syncthing.nix {
hostAddress = "192.168.100.14"; hostAddress = "192.168.100.14";
localAddress = "192.168.100.15"; localAddress = "192.168.100.15";
} {
syncthingPort = 22000; syncthingPort = 22000;
}; };