forked from Fediversity/Fediversity
closes #93. note that this includes classes: - `nixos` - `nixosTest` - `nixops4Resource` - `nixops4Deployment` .. and my (made-up, as per the [docs](https://ryantm.github.io/nixpkgs/module-system/module-system/#module-system-lib-evalModules-param-class)): - `nix-unit` - `package` .. while i did not manage to cover: - service tests, given `pkgs.nixosTest` seemed to not actually like `_class = "nixosTest"` (?!) ... nor #93's mentioned destructured arguments for that matter, as per Fediversity/Fediversity#93 (comment) - let me know if that is still desired as well. Reviewed-on: Fediversity/Fediversity#398 Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io> Co-authored-by: Kiara Grouwstra <kiara@procolix.eu> Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
65 lines
1.3 KiB
Nix
65 lines
1.3 KiB
Nix
{ config, lib, ... }:
|
|
|
|
let
|
|
inherit (lib) mkDefault;
|
|
|
|
in
|
|
{
|
|
_class = "nixos";
|
|
|
|
config = {
|
|
services.openssh = {
|
|
enable = true;
|
|
settings.PasswordAuthentication = false;
|
|
};
|
|
|
|
networking = {
|
|
hostName = config.fediversityVm.name;
|
|
domain = config.fediversityVm.domain;
|
|
|
|
## REVIEW: Do we actually need that, considering that we have static IPs?
|
|
useDHCP = mkDefault true;
|
|
|
|
interfaces = {
|
|
eth0 = {
|
|
ipv4 = {
|
|
addresses = [
|
|
{
|
|
inherit (config.fediversityVm.ipv4) address prefixLength;
|
|
}
|
|
];
|
|
};
|
|
ipv6 = {
|
|
addresses = [
|
|
{
|
|
inherit (config.fediversityVm.ipv6) address prefixLength;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
defaultGateway = {
|
|
address = config.fediversityVm.ipv4.gateway;
|
|
interface = "eth0";
|
|
};
|
|
defaultGateway6 = {
|
|
address = config.fediversityVm.ipv6.gateway;
|
|
interface = "eth0";
|
|
};
|
|
|
|
nameservers = [
|
|
"95.215.185.6"
|
|
"95.215.185.7"
|
|
"2a00:51c0::5fd7:b906"
|
|
"2a00:51c0::5fd7:b907"
|
|
];
|
|
|
|
firewall.enable = false;
|
|
nftables = {
|
|
enable = true;
|
|
rulesetFile = ./nftables-ruleset.nft;
|
|
};
|
|
};
|
|
};
|
|
}
|