Started work on modularized machine config, does not quite work yet. Changed Ophanim's kernel to hardened.

This commit is contained in:
Kevin Baensch 2019-03-17 11:43:14 +01:00
parent 2efae4f888
commit a0f361425a
10 changed files with 162 additions and 63 deletions

70
options/machine.nix Normal file
View file

@ -0,0 +1,70 @@
{ config, pkgs, lib, ... }:
with lib;
{
options.machine = {
confPath = mkOption {
type = types.path;
description = ''
Path to the machines configuration.nix
'';
};
allowUnfree = mkOption {
type = types.bool;
description = ''
Wether to allow the installation of unfree packages.
'';
};
pkgs = mkOption {
type = types.listOf types.string;
description = ''
The list of metapackages to be installed.
'';
};
services = mkOption {
type = types.listOf types.path;
description = ''
List of services to be enabled.
'';
};
hostName = mkOption {
type = types.str;
description = ''
The Machines HostName
'';
};
firewall = {
allowPing = mkOption {
type = types.bool;
description = ''
See networking.firewall.allowPing.
'';
};
allowedUDPPorts = mkOption {
type = types.listOf types.int;
description = ''
See networking.firewall.allowerdUDPPorts.
'';
};
allowedTCPPorts = mkOption {
type = types.listOf types.int;
description = ''
See networking.firewall.allowedTCPPorts.
'';
};
allowedUDPPortRanges = mkOption {
type = types.listOf (types.attrsOf types.int);
description = ''
See networking.firewall.allowerdUDPPortRanges.
'';
};
allowedTCPPortRanges = mkOption {
type = types.listOf (types.attrsOf types.int);
description = ''
See networking.firewall.allowedTCPPortRanges.
'';
};
};
};
}