Add hosts to common options
This commit is contained in:
parent
9317c6ceba
commit
5fb373088d
4 changed files with 32 additions and 15 deletions
26
common/default.nix
Normal file
26
common/default.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
imports = [ ./secret ];
|
||||||
|
options = {
|
||||||
|
m-0.private = mkOption {
|
||||||
|
default = {};
|
||||||
|
type = types.attrs;
|
||||||
|
};
|
||||||
|
m-0.prefix = mkOption {
|
||||||
|
default = "2a02:c207:3002:7584";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
m-0.hosts = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = let p = config.m-0.prefix; in {
|
||||||
|
hera = "${p}::1";
|
||||||
|
hera-intern = "${p}::3:1";
|
||||||
|
git = "${p}::3:2";
|
||||||
|
borg = "${p}::3:3";
|
||||||
|
apollo = "${p}::1:1";
|
||||||
|
athene = "${p}::2:1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,10 +0,0 @@
|
||||||
{ config, pkgs, lib, ... }:
|
|
||||||
with lib;
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
m-0.private = mkOption {
|
|
||||||
default = {};
|
|
||||||
type = types.attrs;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -19,8 +19,7 @@ imports = [
|
||||||
./modules/eventd.nix
|
./modules/eventd.nix
|
||||||
./modules/unlock.nix
|
./modules/unlock.nix
|
||||||
./modules/weechat
|
./modules/weechat
|
||||||
../common/private-options.nix
|
../common
|
||||||
../common/secret
|
|
||||||
# ./sort-mail.nix
|
# ./sort-mail.nix
|
||||||
# ./morgenreport.nix
|
# ./morgenreport.nix
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
{ pkgs, config, lib, ... }:
|
{ pkgs, config, lib, ... }:
|
||||||
{
|
let
|
||||||
|
me = config.m-0.private.me;
|
||||||
|
in {
|
||||||
# channel = 18.03
|
# channel = 18.03
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
<home-manager/nixos>
|
<home-manager/nixos>
|
||||||
../common/secret
|
../common
|
||||||
../common/private-options.nix
|
|
||||||
./modules/laptop.nix
|
./modules/laptop.nix
|
||||||
./modules/server
|
./modules/server
|
||||||
./modules/standalone
|
./modules/standalone
|
||||||
|
@ -23,6 +24,7 @@
|
||||||
networking = {
|
networking = {
|
||||||
firewall.allowPing = true;
|
firewall.allowPing = true;
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
|
hosts = lib.zipAttrs (lib.mapAttrsToList (host: ip: {"${ip}" = host; } ) config.m-0.hosts);
|
||||||
};
|
};
|
||||||
|
|
||||||
users = {
|
users = {
|
||||||
|
|
Loading…
Reference in a new issue