mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-05 15:15:39 +01:00
Compare commits
No commits in common. "c6601da4e073364aeb4c0ab6c22c20939b024259" and "71d816fe804925da5d3c4fbdf8a885346040c16e" have entirely different histories.
c6601da4e0
...
71d816fe80
5 changed files with 12 additions and 137 deletions
|
|
@ -1,88 +1,15 @@
|
||||||
{
|
{ pkgs, config, ... }:
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
externalInterface = "wan0";
|
|
||||||
# networks = config.homelab.networks.local;
|
|
||||||
# internalInterfaces = lib.mapAttrsToList (_: val: val.interface) networks;
|
|
||||||
# internalIPs = lib.mapAttrsToList (
|
|
||||||
# _: val: lib.strings.removeSuffix ".1" val.cidr + ".0/24"
|
|
||||||
# ) networks;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./variables.nix
|
./variables.nix
|
||||||
./../../modules/core/default.router.nix
|
./../../modules/core/default.server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
liv = {
|
|
||||||
server.enable = true;
|
|
||||||
router.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
boot = {
|
|
||||||
supportedFilesystems = [ "zfs" ];
|
|
||||||
loader.grub = {
|
|
||||||
enable = true;
|
|
||||||
device = "/dev/sda";
|
|
||||||
useOSProber = true;
|
|
||||||
};
|
|
||||||
kernel = {
|
|
||||||
sysctl = {
|
|
||||||
# Forward both IPv4 and IPv6 on all interfaces
|
|
||||||
"net.ipv4.conf.all.forwarding" = true;
|
|
||||||
"net.ipv6.conf.all.forwarding" = false;
|
|
||||||
|
|
||||||
# By default, do not automatically configure any IPv6 addresses.
|
|
||||||
# "net.ipv6.conf.all.accept_ra" = 0;
|
|
||||||
# "net.ipv6.conf.all.autoconf" = 0;
|
|
||||||
# "net.ipv6.conf.all.use_tempaddr" = 0;
|
|
||||||
|
|
||||||
# Allow IPv6 autoconfiguration and tempory address use on WAN.
|
|
||||||
"net.ipv6.conf.${externalInterface}.accept_ra" = 2;
|
|
||||||
"net.ipv6.conf.${externalInterface}.autoconf" = 1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
firewall = {
|
|
||||||
enable = true;
|
|
||||||
allowPing = true;
|
|
||||||
|
|
||||||
# allow ssh on *all* interfaces, even wan.
|
|
||||||
allowedTCPPorts = lib.mkForce [ 22 ];
|
|
||||||
allowedUDPPorts = lib.mkForce [ 22 ];
|
|
||||||
|
|
||||||
# interface-specific rules
|
|
||||||
interfaces = {
|
|
||||||
"lan0" = {
|
|
||||||
allowedTCPPorts = [
|
|
||||||
22
|
|
||||||
53
|
|
||||||
];
|
|
||||||
allowedUDPPorts = [
|
|
||||||
22
|
|
||||||
53
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.udev.extraRules = ''
|
|
||||||
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:47:67:6e", ATTR{type}=="1", NAME="wan0"
|
|
||||||
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:47:67:6f", ATTR{type}=="1", NAME="lan0"
|
|
||||||
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:63:0f:80", ATTR{type}=="1", NAME="lan1"
|
|
||||||
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:63:0f:81", ATTR{type}=="1", NAME="lan2"
|
|
||||||
'';
|
|
||||||
|
|
||||||
networking.hostName = "lily";
|
networking.hostName = "lily";
|
||||||
|
|
||||||
|
liv.server.enable = true;
|
||||||
|
|
||||||
time.timeZone = "Europe/Amsterdam";
|
time.timeZone = "Europe/Amsterdam";
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
|
@ -90,6 +17,10 @@ in
|
||||||
zfs
|
zfs
|
||||||
];
|
];
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
supportedFilesystems = [ "zfs" ];
|
||||||
|
};
|
||||||
|
|
||||||
networking.hostId = "8ddb2a9b";
|
networking.hostId = "8ddb2a9b";
|
||||||
|
|
||||||
services.zfs = {
|
services.zfs = {
|
||||||
|
|
@ -97,6 +28,10 @@ in
|
||||||
trim.enable = true;
|
trim.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boot.loader.grub.enable = true;
|
||||||
|
boot.loader.grub.device = "/dev/sda";
|
||||||
|
boot.loader.grub.useOSProber = true;
|
||||||
|
|
||||||
# boot.zfs.extraPools = [ "terrabite" ];
|
# boot.zfs.extraPools = [ "terrabite" ];
|
||||||
|
|
||||||
# fileSystems."/terrabite/main" = {
|
# fileSystems."/terrabite/main" = {
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ (import ./hardware.nix) ]
|
|
||||||
++ [ (import ./program.nix) ]
|
|
||||||
++ [ (import ./sshd.nix) ]
|
|
||||||
++ [ (import ./security.nix) ]
|
|
||||||
++ [ (import ./services.nix) ]
|
|
||||||
++ [ (import ./system.nix) ]
|
|
||||||
++ [ (import ./user.nix) ];
|
|
||||||
}
|
|
||||||
|
|
@ -23,8 +23,6 @@
|
||||||
[ ./../home/default.server.nix ]
|
[ ./../home/default.server.nix ]
|
||||||
else if (host == "dandelion") then
|
else if (host == "dandelion") then
|
||||||
[ ./../home/default.server.nix ]
|
[ ./../home/default.server.nix ]
|
||||||
else if (host == "lily") then
|
|
||||||
[ ./../home/default.server.nix ]
|
|
||||||
# else if (host == "yoshino") then
|
# else if (host == "yoshino") then
|
||||||
# [ ./../home/default.nix ]
|
# [ ./../home/default.nix ]
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
++ [ (import ./amdgpu.nix) ]
|
++ [ (import ./amdgpu.nix) ]
|
||||||
++ [ (import ./nvidia.nix) ]
|
++ [ (import ./nvidia.nix) ]
|
||||||
++ [ (import ./server.nix) ]
|
++ [ (import ./server.nix) ]
|
||||||
++ [ (import ./router.nix) ]
|
|
||||||
++ [ (import ./desktop.nix) ]
|
++ [ (import ./desktop.nix) ]
|
||||||
++ [ (import ./wine.nix) ]
|
++ [ (import ./wine.nix) ]
|
||||||
++ [ (import ./creative.nix) ]
|
++ [ (import ./creative.nix) ]
|
||||||
|
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
username,
|
|
||||||
home-manager,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.liv.router;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.liv.router = {
|
|
||||||
enable = mkEnableOption "Enable router";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
pkgs.kitty.terminfo
|
|
||||||
powertop
|
|
||||||
bind
|
|
||||||
];
|
|
||||||
|
|
||||||
services = {
|
|
||||||
thermald.enable = true;
|
|
||||||
vnstat.enable = true;
|
|
||||||
# cpupower-gui.enable = true;
|
|
||||||
# power-profiles-daemon.enable = true;
|
|
||||||
|
|
||||||
# auto-cpufreq = {
|
|
||||||
# enable = true;
|
|
||||||
# settings = {
|
|
||||||
# battery = {
|
|
||||||
# governor = "powersave";
|
|
||||||
# turbo = "auto";
|
|
||||||
# };
|
|
||||||
# charger = {
|
|
||||||
# governor = "performance";
|
|
||||||
# turbo = "auto";
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue