Add hosts to common options
This commit is contained in:
parent
9317c6ceba
commit
5fb373088d
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/unlock.nix
|
||||
./modules/weechat
|
||||
../common/private-options.nix
|
||||
../common/secret
|
||||
../common
|
||||
# ./sort-mail.nix
|
||||
# ./morgenreport.nix
|
||||
];
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
let
|
||||
me = config.m-0.private.me;
|
||||
in {
|
||||
# channel = 18.03
|
||||
|
||||
imports = [
|
||||
<home-manager/nixos>
|
||||
../common/secret
|
||||
../common/private-options.nix
|
||||
../common
|
||||
./modules/laptop.nix
|
||||
./modules/server
|
||||
./modules/standalone
|
||||
|
@ -23,6 +24,7 @@
|
|||
networking = {
|
||||
firewall.allowPing = true;
|
||||
useDHCP = false;
|
||||
hosts = lib.zipAttrs (lib.mapAttrsToList (host: ip: {"${ip}" = host; } ) config.m-0.hosts);
|
||||
};
|
||||
|
||||
users = {
|
||||
|
|
Loading…
Reference in a new issue