forked from fediversity/fediversity
Compare commits
1 commit
54623a589b
...
9f04edc071
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f04edc071 |
2 changed files with 44 additions and 62 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkDefault mkIf mkMerge;
|
inherit (lib) mkDefault;
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
@ -13,49 +13,53 @@ in
|
||||||
settings.PasswordAuthentication = false;
|
settings.PasswordAuthentication = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = mkMerge [
|
networking = {
|
||||||
{
|
hostName = config.fediversityVm.name;
|
||||||
hostName = config.fediversityVm.name;
|
domain = config.fediversityVm.domain;
|
||||||
domain = config.fediversityVm.domain;
|
|
||||||
|
|
||||||
## REVIEW: Do we actually need that, considering that we have static IPs?
|
## REVIEW: Do we actually need that, considering that we have static IPs?
|
||||||
useDHCP = mkDefault true;
|
useDHCP = mkDefault true;
|
||||||
|
|
||||||
nameservers = [
|
interfaces = {
|
||||||
"95.215.185.6"
|
eth0 = {
|
||||||
"95.215.185.7"
|
ipv4 = {
|
||||||
"2a00:51c0::5fd7:b906"
|
addresses = [
|
||||||
"2a00:51c0::5fd7:b907"
|
{
|
||||||
];
|
inherit (config.fediversityVm.ipv4) address prefixLength;
|
||||||
|
}
|
||||||
firewall.enable = false;
|
];
|
||||||
nftables = {
|
};
|
||||||
enable = true;
|
ipv6 = {
|
||||||
rulesetFile = ./nftables-ruleset.nft;
|
addresses = [
|
||||||
|
{
|
||||||
|
inherit (config.fediversityVm.ipv6) address prefixLength;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
## IPv4
|
defaultGateway = {
|
||||||
(mkIf config.fediversityVm.ipv4.enable {
|
address = config.fediversityVm.ipv4.gateway;
|
||||||
interfaces.${config.fediversityVm.ipv4.interface}.ipv4.addresses = [
|
interface = "eth0";
|
||||||
{ inherit (config.fediversityVm.ipv4) address prefixLength; }
|
};
|
||||||
];
|
defaultGateway6 = {
|
||||||
defaultGateway = {
|
address = config.fediversityVm.ipv6.gateway;
|
||||||
address = config.fediversityVm.ipv4.gateway;
|
interface = "eth0";
|
||||||
interface = config.fediversityVm.ipv4.interface;
|
};
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|
||||||
## IPv6
|
nameservers = [
|
||||||
(mkIf config.fediversityVm.ipv6.enable {
|
"95.215.185.6"
|
||||||
interfaces.${config.fediversityVm.ipv6.interface}.ipv6.addresses = [
|
"95.215.185.7"
|
||||||
{ inherit (config.fediversityVm.ipv6) address prefixLength; }
|
"2a00:51c0::5fd7:b906"
|
||||||
];
|
"2a00:51c0::5fd7:b907"
|
||||||
defaultGateway6 = {
|
];
|
||||||
address = config.fediversityVm.ipv6.gateway;
|
|
||||||
interface = config.fediversityVm.ipv6.interface;
|
firewall.enable = false;
|
||||||
};
|
nftables = {
|
||||||
})
|
enable = true;
|
||||||
];
|
rulesetFile = ./nftables-ruleset.nft;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,17 +91,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
ipv4 = {
|
ipv4 = {
|
||||||
enable = mkOption {
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface = mkOption {
|
|
||||||
description = ''
|
|
||||||
The interface that carries the machine's IPv4 network.
|
|
||||||
'';
|
|
||||||
default = "eth0";
|
|
||||||
};
|
|
||||||
|
|
||||||
address = mkOption {
|
address = mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
The IP address of the machine, version 4. It will be injected as a
|
The IP address of the machine, version 4. It will be injected as a
|
||||||
|
|
@ -127,17 +116,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
ipv6 = {
|
ipv6 = {
|
||||||
enable = mkOption {
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface = mkOption {
|
|
||||||
description = ''
|
|
||||||
The interface that carries the machine's IPv6 network.
|
|
||||||
'';
|
|
||||||
default = "eth0";
|
|
||||||
};
|
|
||||||
|
|
||||||
address = mkOption {
|
address = mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
The IP address of the machine, version 6. It will be injected as a
|
The IP address of the machine, version 6. It will be injected as a
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue