lib: don't define defaults that require config

This commit is contained in:
tv 2016-10-13 21:49:04 +02:00
parent 1a5f52234e
commit 7c91a19549
4 changed files with 4 additions and 13 deletions

View File

@ -791,6 +791,7 @@ TNs2RYfwDy/r6H/hDeB/BSngPouedEVcPwIDAQAB
} // { # hosts only maintained in stockholm, not owned by me
muhbaasu = rec {
owner = config.krebs.users.root;
cores = 1;
nets = {
internet = {

View File

@ -8,6 +8,7 @@ let
"test-centos7"
"test-all-krebs-modules"
] (name: {
owner = config.krebs.users.shared;
inherit name;
cores = 1;
nets = {
@ -34,6 +35,7 @@ let
in {
hosts = {
wolf = {
owner = config.krebs.users.shared;
nets = {
shack = {
ip4.addr = "10.42.2.150" ;

View File

@ -19,7 +19,6 @@ let out = lib // rec {
]));
types = import ./types.nix {
inherit config;
lib = lib // { inherit genid optionalTrace; };
};

View File

@ -1,14 +1,9 @@
{ config, lib, ... }:
{ lib, ... }:
with builtins;
with lib;
with types;
let
# Inherited attributes are used in submodules that have their own `config`.
inherit (config.krebs) build users;
in
types // rec {
host = submodule ({ config, ... }: {
@ -27,7 +22,6 @@ types // rec {
owner = mkOption {
type = user;
default = users.krebs;
};
extraZones = mkOption {
@ -49,10 +43,6 @@ types // rec {
ssh.pubkey = mkOption {
type = nullOr ssh-pubkey;
default = null;
apply = x:
optionalTrace (x == null && config.owner.name == build.user.name)
"The option `krebs.hosts.${config.name}.ssh.pubkey' is unused."
x;
};
ssh.privkey = mkOption {
type = nullOr ssh-privkey;
@ -187,7 +177,6 @@ types // rec {
};
owner = mkOption {
type = user;
default = users.root;
};
group-name = mkOption {
type = str;