net
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
_:
|
||||
{ lib, namespace, ... }:
|
||||
let
|
||||
net = lib.${namespace}.network;
|
||||
defaultNetworkShareOptions = [
|
||||
"sec=none"
|
||||
"nofail"
|
||||
@@ -16,19 +17,19 @@ in
|
||||
fileSystems = {
|
||||
# Network shares
|
||||
"/media/nas/backup" = {
|
||||
device = "//10.0.1.3/Backup";
|
||||
device = "//${net.hosts.nas.lan}/Backup";
|
||||
fsType = "cifs";
|
||||
options = defaultNetworkShareOptions;
|
||||
};
|
||||
|
||||
"/media/nas/isos" = {
|
||||
device = "//10.0.1.3/isos";
|
||||
device = "//${net.hosts.nas.lan}/isos";
|
||||
fsType = "cifs";
|
||||
options = defaultNetworkShareOptions;
|
||||
};
|
||||
|
||||
"/media/nas/3d_printer" = {
|
||||
device = "//10.0.1.3/3d_printer";
|
||||
device = "//${net.hosts.nas.lan}/3d_printer";
|
||||
fsType = "cifs";
|
||||
options = defaultNetworkShareOptions;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{ lib, ... }:
|
||||
{ lib, namespace, ... }:
|
||||
let
|
||||
net = lib.${namespace}.network;
|
||||
in
|
||||
{
|
||||
services.resolved.enable = lib.mkForce false;
|
||||
services.adguardhome = {
|
||||
@@ -30,7 +33,7 @@
|
||||
trusted_proxies = [
|
||||
"127.0.0.0/8"
|
||||
"::1/128"
|
||||
"10.0.1.3"
|
||||
net.hosts.nas.lan
|
||||
];
|
||||
cache_optimistic = true;
|
||||
};
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
net = lib.${namespace}.network;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./adguard.nix
|
||||
@@ -119,11 +122,11 @@
|
||||
# ###################################################
|
||||
|
||||
network = {
|
||||
hostName = "pi5";
|
||||
hostName = net.hosts.pi5.hostname;
|
||||
ipv4 = {
|
||||
method = "manual";
|
||||
address = "10.0.1.2/24";
|
||||
gateway = "10.0.1.1";
|
||||
address = net.hosts.pi5.lan4;
|
||||
gateway = net.hosts.pi5.gateway;
|
||||
dns = "1.1.1.1";
|
||||
interface = "end0";
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
}:
|
||||
let
|
||||
inherit (lib.${namespace}) enabled disabled;
|
||||
net = lib.${namespace}.network;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
@@ -122,11 +123,11 @@ in
|
||||
# ###################################################
|
||||
|
||||
network = {
|
||||
hostName = "jallen-nas";
|
||||
hostName = net.hosts.nas.hostname;
|
||||
ipv4 = {
|
||||
address = "10.0.1.3";
|
||||
address = net.hosts.nas.lan;
|
||||
method = "manual";
|
||||
gateway = "10.0.1.1";
|
||||
gateway = net.hosts.nas.gateway;
|
||||
dns = "1.1.1.1";
|
||||
interface = "enp197s0";
|
||||
};
|
||||
@@ -215,6 +216,7 @@ in
|
||||
|
||||
samba = {
|
||||
enable = true;
|
||||
# Allow the LAN /24 subnet (strip the last octet from the NAS LAN IP for the prefix)
|
||||
hostsAllow = "10.0.1. 127.0.0.1 localhost";
|
||||
forceGroup = "jallen-nas";
|
||||
forceUser = "nix-apps";
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{ namespace, ... }:
|
||||
{ lib, namespace, ... }:
|
||||
let
|
||||
net = lib.${namespace}.network;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
@@ -31,12 +34,12 @@
|
||||
};
|
||||
|
||||
network = {
|
||||
hostName = "nuc-nixos";
|
||||
hostName = net.hosts.nuc.hostname;
|
||||
ipv4 = {
|
||||
method = "manual";
|
||||
address = "10.0.1.4/24";
|
||||
gateway = "10.0.1.1";
|
||||
dns = "10.0.1.1";
|
||||
address = net.hosts.nuc.lan4;
|
||||
gateway = net.hosts.nuc.gateway;
|
||||
dns = net.hosts.router.lan;
|
||||
interface = "enp2s0";
|
||||
};
|
||||
firewall = {
|
||||
|
||||
Reference in New Issue
Block a user