mirror of
https://github.com/mdlayher/homelab.git
synced 2024-12-14 11:47:32 +00:00
nixos/lib: move vars, add lan0 subnets
This commit is contained in:
parent
96b37fc7d5
commit
973ef00bc9
10 changed files with 16 additions and 11 deletions
|
@ -72,9 +72,11 @@ in {
|
|||
name = "enp2s0";
|
||||
internal_domain = true;
|
||||
ipv4 = "192.168.1.1";
|
||||
ipv4_subnet = "192.168.1.0/24";
|
||||
ipv6 = {
|
||||
lla = "fe80::20d:b9ff:fe53:eacd";
|
||||
ula = "fd9e:1a04:f01d::1";
|
||||
ula_subnet = "fd9e:1a04:f01d::/64";
|
||||
};
|
||||
};
|
||||
guest0 = {
|
|
@ -5,7 +5,7 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
vars = import ./lib/vars.nix;
|
||||
unstable = import <unstable> { };
|
||||
|
||||
in {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, ... }:
|
||||
|
||||
let vars = import ./vars.nix;
|
||||
let vars = import ./lib/vars.nix;
|
||||
|
||||
in {
|
||||
systemd.services.coredns = with vars.interfaces.wg0; {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
vars = import ./lib/vars.nix;
|
||||
unstable = import <unstable> { };
|
||||
|
||||
in {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib, ... }:
|
||||
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
vars = import ./lib/vars.nix;
|
||||
|
||||
# Produces a compatible object for the dhcpd4 machines array.
|
||||
mkHost = (host: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, ... }:
|
||||
|
||||
let vars = import ./vars.nix;
|
||||
let vars = import ./lib/vars.nix;
|
||||
|
||||
in {
|
||||
services.dhcpd6 = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ ... }:
|
||||
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
vars = import ./lib/vars.nix;
|
||||
|
||||
# Produces the configuration for a LAN interface.
|
||||
mkInterface = (ifi: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib, ... }:
|
||||
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
vars = import ./lib/vars.nix;
|
||||
|
||||
# Port definitions.
|
||||
ports = {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
let
|
||||
secrets = import ./lib/secrets.nix;
|
||||
vars = import ./vars.nix;
|
||||
vars = import ./lib/vars.nix;
|
||||
|
||||
in {
|
||||
services.traefik = {
|
||||
|
|
|
@ -4,7 +4,10 @@
|
|||
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
let
|
||||
vars = import ./lib/vars.nix;
|
||||
|
||||
in {
|
||||
imports = [
|
||||
# Hardware configuration.
|
||||
./hardware-configuration.nix
|
||||
|
@ -86,8 +89,8 @@
|
|||
# Export ZFS pool via NFS to trusted LAN.
|
||||
nfs.server = {
|
||||
enable = true;
|
||||
exports = ''
|
||||
/primary 192.168.1.0/24(rw,sync,no_subtree_check,crossmnt) fd9e:1a04:f01d::/64(rw,sync,no_subtree_check,crossmnt)
|
||||
exports = with vars.interfaces.lan0; ''
|
||||
/primary ${ipv4_subnet}(rw,sync,no_subtree_check,crossmnt) ${ipv6.ula_subnet}(rw,sync,no_subtree_check,crossmnt)
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue