* Several updates to support NUC hardware
This commit is contained in:
parent
4c0b423649
commit
b51aff6757
14 changed files with 168 additions and 70 deletions
1
TODOS.md
1
TODOS.md
|
@ -21,6 +21,7 @@ TODOS
|
||||||
* [ ] If no user key on guest, complain and abort
|
* [ ] If no user key on guest, complain and abort
|
||||||
* [ ] Fix error messages that mess with getting fingerprit
|
* [ ] Fix error messages that mess with getting fingerprit
|
||||||
* [ ] Make sure uid matches <curruser>@localhost, as it tells sops where to look for keyring
|
* [ ] Make sure uid matches <curruser>@localhost, as it tells sops where to look for keyring
|
||||||
|
* [ ] Get nixos-anywhere disko config to work with LUKS with key file
|
||||||
* [ ] Move hardware config to module config
|
* [ ] Move hardware config to module config
|
||||||
* [ ] DB of hardware, similar to nixos-hardware repo
|
* [ ] DB of hardware, similar to nixos-hardware repo
|
||||||
* [ ] Backups
|
* [ ] Backups
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
../../profiles/config-editor.nix
|
../../profiles/config-editor.nix
|
||||||
../../profiles/ddclient.nix
|
../../profiles/ddclient.nix
|
||||||
../../profiles/home-assistant
|
../../profiles/home-assistant
|
||||||
|
../../profiles/git.nix
|
||||||
../../profiles/gitea.nix
|
../../profiles/gitea.nix
|
||||||
../../profiles/hardware-configuration.nix
|
../../profiles/hardware-configuration.nix
|
||||||
../../profiles/hosting.nix
|
../../profiles/hosting.nix
|
||||||
|
@ -16,7 +17,6 @@
|
||||||
../../profiles/router.nix
|
../../profiles/router.nix
|
||||||
../../profiles/unifi.nix
|
../../profiles/unifi.nix
|
||||||
../../profiles/vaultwarden.nix
|
../../profiles/vaultwarden.nix
|
||||||
../../profiles/virtual-machine.nix
|
|
||||||
../../profiles/wireguard.nix
|
../../profiles/wireguard.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -55,19 +55,19 @@
|
||||||
|
|
||||||
# @TODO: Make this UI configurable
|
# @TODO: Make this UI configurable
|
||||||
## Must be forced due to Authentik hard coding a value of UTC
|
## Must be forced due to Authentik hard coding a value of UTC
|
||||||
time.timeZone = lib.mkForce "America/Los_Angeles";
|
time.timeZone = lib.mkForce config.homefree.system.timeZone;
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
# @TODO: Make this UI configurable
|
# @TODO: Make this UI configurable
|
||||||
hostName = "homefree";
|
hostName = config.homefree.system.hostName;
|
||||||
## NetworkManager disabled in favor of networkd
|
## NetworkManager disabled in favor of networkd
|
||||||
useNetworkd = true;
|
useNetworkd = true;
|
||||||
wireless = {
|
# wireless = {
|
||||||
# Disable wpa_supplicant
|
# # Disable wpa_supplicant
|
||||||
enable = false;
|
# enable = false;
|
||||||
};
|
# };
|
||||||
interfaces = {
|
interfaces = {
|
||||||
ens3.useDHCP = true;
|
"${config.homefree.network.wan-interface}".useDHCP = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
14
module.nix
14
module.nix
|
@ -58,7 +58,7 @@
|
||||||
description = ''
|
description = ''
|
||||||
Hashed password for the system admin
|
Hashed password for the system admin
|
||||||
Generate with:
|
Generate with:
|
||||||
mkpasswd --method=SHA-512 --stdin
|
mkpasswd -m sha-512
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -117,14 +117,20 @@
|
||||||
|
|
||||||
domains = lib.mkOption {
|
domains = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = [ "*" "www" "dev" ];
|
default = [ "@" "*" "www" "dev" ];
|
||||||
description = "Domains for dynamic DNS client";
|
description = "Domains for dynamic DNS client";
|
||||||
};
|
};
|
||||||
|
|
||||||
use = lib.mkOption {
|
usev4 = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "web, web=ipinfo.io/ip";
|
default = "web, web=ipinfo.io/ip";
|
||||||
description = "Use format for dynamic DNS client";
|
description = "Use format for obtaining ipv4 for dynamic DNS client";
|
||||||
|
};
|
||||||
|
|
||||||
|
usev6 = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "web, web=v6.ipinfo.io/ip";
|
||||||
|
description = "Use format for obtaining ipv6 for dynamic DNS client";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,9 @@
|
||||||
};
|
};
|
||||||
users = [
|
users = [
|
||||||
{
|
{
|
||||||
name = "erahhal";
|
name = config.homefree.system.adminUsername;
|
||||||
password = "$2a$10$Tt4QvbLQxnspv2TbcLMP7ug8eJ0NqMsGyVPbpEqtmkyCVrFpvh4GS";
|
password = "$2a$10$Tt4QvbLQxnspv2TbcLMP7ug8eJ0NqMsGyVPbpEqtmkyCVrFpvh4GS";
|
||||||
|
# password = config.homefree.system.adminHashedPassword;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
auth_attempts = 5;
|
auth_attempts = 5;
|
||||||
|
@ -24,14 +25,17 @@
|
||||||
theme = "auto";
|
theme = "auto";
|
||||||
dns = {
|
dns = {
|
||||||
bind_hosts = [ "0.0.0.0" ];
|
bind_hosts = [ "0.0.0.0" ];
|
||||||
port = 53000;
|
port = 53;
|
||||||
anonymize_client_ip = false;
|
anonymize_client_ip = false;
|
||||||
ratelimit = 20;
|
ratelimit = 20;
|
||||||
ratelimit_subnet_len_ipv4 = 24;
|
ratelimit_subnet_len_ipv4 = 24;
|
||||||
ratelimit_subnet_len_ipv6 = 56;
|
ratelimit_subnet_len_ipv6 = 56;
|
||||||
ratelimit_whitelist = [];
|
ratelimit_whitelist = [];
|
||||||
refuse_any = true;
|
refuse_any = true;
|
||||||
upstream_dns = [ "https://dns10.quad9.net/dns-query" ];
|
upstream_dns = [
|
||||||
|
"10.0.0.1"
|
||||||
|
"https://dns10.quad9.net/dns-query"
|
||||||
|
];
|
||||||
bootstrap_dns = [
|
bootstrap_dns = [
|
||||||
"9.9.9.10"
|
"9.9.9.10"
|
||||||
"149.112.112.10"
|
"149.112.112.10"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ agenix, options, system, ... }:
|
{ config, agenix, options, system, ... }:
|
||||||
{
|
{
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
agenix.packages.${system}.default
|
agenix.packages.${system}.default
|
||||||
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
# default path is /etc/ssh/ssh_host_rsa_key
|
# default path is /etc/ssh/ssh_host_rsa_key
|
||||||
age.identityPaths = options.age.identityPaths.default ++ [
|
age.identityPaths = options.age.identityPaths.default ++ [
|
||||||
"/home/homefree/.ssh/id_rsa"
|
"/home/${config.system.homefree.adminUsername}/.ssh/id_rsa"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
openldap
|
openldap
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
# @TODO: Move secrets to this folder
|
# @TODO: Move secrets to this folder
|
||||||
sopsFile = ../secrets/authentik.yaml;
|
sopsFile = ../secrets/authentik.yaml;
|
||||||
|
|
||||||
owner = "homefree";
|
owner = config.homefree.system.adminUsername;
|
||||||
path = "/run/secrets/authentik/authentik-env";
|
path = "/run/secrets/authentik/authentik-env";
|
||||||
restartUnits = [ "authentik.service" ];
|
restartUnits = [ "authentik.service" ];
|
||||||
};
|
};
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
# @TODO: Move secrets to this folder
|
# @TODO: Move secrets to this folder
|
||||||
sopsFile = ../secrets/authentik.yaml;
|
sopsFile = ../secrets/authentik.yaml;
|
||||||
|
|
||||||
owner = "homefree";
|
owner = config.homefree.system.adminUsername;
|
||||||
path = "/run/secrets/authentik/authentik-ldap-env";
|
path = "/run/secrets/authentik/authentik-ldap-env";
|
||||||
restartUnits = [ "authentik-ldap.service" ];
|
restartUnits = [ "authentik-ldap.service" ];
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ homefree-inputs, pkgs, system, ...}:
|
{ config, homefree-inputs, pkgs, system, ...}:
|
||||||
{
|
{
|
||||||
|
|
||||||
# --------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
# this value at the release version of the first install of this system.
|
# this value at the release version of the first install of this system.
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "24.05"; # Did you read the comment?
|
system.stateVersion = "24.11"; # Did you read the comment?
|
||||||
|
|
||||||
# @TODO: Could this be useful for auto-upgrading systems out there?
|
# @TODO: Could this be useful for auto-upgrading systems out there?
|
||||||
# system.autoUpgrade = {
|
# system.autoUpgrade = {
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
# };
|
# };
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
nixPath = [ "nixpkgs=${homefree-inputs.nixpkgs}" "nixos-config=/home/homefree/nixcfg" ];
|
nixPath = [ "nixpkgs=${homefree-inputs.nixpkgs}" "nixos-config=/home/${config.homefree.system.adminUsername}/nixcfg" ];
|
||||||
|
|
||||||
# Which package collection to use system-wide.
|
# Which package collection to use system-wide.
|
||||||
package = pkgs.nixVersions.stable;
|
package = pkgs.nixVersions.stable;
|
||||||
|
@ -97,14 +97,13 @@
|
||||||
# User config
|
# User config
|
||||||
# --------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------
|
||||||
|
|
||||||
users.users.homefree = {
|
users.users."${config.homefree.system.adminUsername}" = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
home = "/home/homefree";
|
home = "/home/${config.homefree.system.adminUsername}";
|
||||||
description = "Homefree User";
|
description = "Homefree Admin";
|
||||||
extraGroups = [ "wheel" ];
|
extraGroups = [ "wheel" ];
|
||||||
# @TODO: Make this dynamic, not hard coded
|
openssh.authorizedKeys.keys= config.homefree.system.authorizedKeys;
|
||||||
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNvmGn1/uFnfgnv5qsec0GC04LeVB1Qy/G7WivvvUZVBBDzp8goe1DsE8M8iqnBSin56gQZDWsd50co2MbFAWuqH2HxY7OGay7P/V2q+SziTYFva85WGl84qWvYMmdB+alAFBT3L4eH5cegC5NhNp+OGsQuq32RdojgXXQt6vyZnaOypuz90k3rqV6Rt+iBTLz6VziasCLcYydwOvi9f1q6YQwGPLKaupDrV6gxvoX9bXLdopqwnXPSE/Eqczxgwc3PefvAJPSd6TOqIXvbtpv/B3Evt5SPe2gq+qASc5K0tzgra8KAe813kkpq4FuKJzHbT+EmO70wiJjru7zMEhd erahhal@nfml-erahhalQFL" ];
|
hashedPassword = config.homefree.system.adminHashedPassword;
|
||||||
hashedPassword = "$6$5.6V9H0g5F47ubUm$e0N.GXZ9eoqmvpO9MjZlCISC9IIxKKcf0xtnuFyuXSQEQlfaazrS4kBhplDB6GCsQgwpOxdrX2DmcwbMiX/h30";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
security.sudo.extraRules = [
|
security.sudo.extraRules = [
|
||||||
|
@ -130,6 +129,15 @@
|
||||||
# Nix mounts read-write automatically when it needs to write to it.
|
# Nix mounts read-write automatically when it needs to write to it.
|
||||||
boot.readOnlyNixStore = true;
|
boot.readOnlyNixStore = true;
|
||||||
|
|
||||||
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------------------
|
||||||
|
# Hardware
|
||||||
|
# --------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
hardware.enableAllFirmware = true;
|
||||||
|
|
||||||
# --------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------
|
||||||
# Services
|
# Services
|
||||||
# --------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------
|
||||||
|
@ -163,6 +171,15 @@
|
||||||
powertop.enable = true;
|
powertop.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Eternal Terminal
|
||||||
|
services.eternal-terminal.enable = true;
|
||||||
|
# et port
|
||||||
|
networking.firewall.allowedTCPPorts = [ 2022 ];
|
||||||
|
environment.variables = {
|
||||||
|
ET_NO_TELEMETRY = "1";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------
|
||||||
# i18n
|
# i18n
|
||||||
# --------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------
|
||||||
|
@ -190,6 +207,7 @@
|
||||||
bashmount
|
bashmount
|
||||||
bfg-repo-cleaner
|
bfg-repo-cleaner
|
||||||
bind
|
bind
|
||||||
|
btop
|
||||||
ccze # readable parsed system logs
|
ccze # readable parsed system logs
|
||||||
cpufrequtils
|
cpufrequtils
|
||||||
distrobox
|
distrobox
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
|
|
||||||
services.ddclient = {
|
services.ddclient = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interval = "10m";
|
interval = config.homefree.ddclient.interval;
|
||||||
protocol = "hetzner";
|
protocol = config.homefree.ddclient.protocol;
|
||||||
username = "erahhal";
|
username = config.homefree.ddclient.username;
|
||||||
zone = "homefree.host";
|
zone = config.homefree.ddclient.zone;
|
||||||
domains = [ "@" "*" "www" "dev" ];
|
domains = config.homefree.ddclient.domains;
|
||||||
passwordFile = "/run/secrets/ddclient/ddclient-password";
|
passwordFile = "/run/secrets/ddclient/ddclient-password";
|
||||||
usev4 = "web, web=ipinfo.io/ip";
|
usev4 = config.homefree.ddclient.usev4;
|
||||||
usev6 = "web, web=v6.ipinfo.io/ip";
|
usev6 = config.homefree.ddclient.usev6;
|
||||||
verbose = true;
|
verbose = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
format = "yaml";
|
format = "yaml";
|
||||||
sopsFile = ../secrets/ddclient.yaml;
|
sopsFile = ../secrets/ddclient.yaml;
|
||||||
|
|
||||||
owner = "homefree";
|
owner = config.homefree.system.adminUsername;
|
||||||
path = "/run/secrets/ddclient/ddclient-password";
|
path = "/run/secrets/ddclient/ddclient-password";
|
||||||
restartUnits = [ "ddclient.service" ];
|
restartUnits = [ "ddclient.service" ];
|
||||||
};
|
};
|
||||||
|
|
69
profiles/git.nix
Normal file
69
profiles/git.nix
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
lfs.enable = true;
|
||||||
|
config = {
|
||||||
|
checkout = {
|
||||||
|
defaultRemote = "origin";
|
||||||
|
};
|
||||||
|
color = {
|
||||||
|
ui = "auto";
|
||||||
|
};
|
||||||
|
core = {
|
||||||
|
# Can't specify "${pkgs.neovim}/bin/nvim" because programs.neovim
|
||||||
|
# wraps neovim-unwrapped in a special way to load plugins, so must
|
||||||
|
# expect nvim to be in $PATH here
|
||||||
|
editor = "nvim";
|
||||||
|
excludesfile = "~/.gitignore_global";
|
||||||
|
};
|
||||||
|
delta = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
# filter = {
|
||||||
|
# lfs = {
|
||||||
|
# clean = "${pkgs.git-lfs}/bin/git-lfs clean -- %f";
|
||||||
|
# smudge = "${pkgs.git-lfs}/bin/git-lfs smudge --skip -- %f";
|
||||||
|
# process = "${pkgs.git-lfs}/bin/git-lfs filter-process --skip";
|
||||||
|
# required = true;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
push = {
|
||||||
|
default = "simple";
|
||||||
|
};
|
||||||
|
rerere = {
|
||||||
|
enabled = true;
|
||||||
|
};
|
||||||
|
include = {
|
||||||
|
path = "~/.gitconfig.local";
|
||||||
|
};
|
||||||
|
|
||||||
|
#==========================
|
||||||
|
# Diff settings
|
||||||
|
#==========================
|
||||||
|
|
||||||
|
pager = {
|
||||||
|
difftool = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
#-------------------
|
||||||
|
## nvim
|
||||||
|
# - text-based
|
||||||
|
#------------------
|
||||||
|
diff = {
|
||||||
|
tool = "nvimdiff";
|
||||||
|
};
|
||||||
|
difftool = {
|
||||||
|
prompt = true;
|
||||||
|
};
|
||||||
|
merge = {
|
||||||
|
tool = "nvimdiff";
|
||||||
|
trustExitCode = false;
|
||||||
|
};
|
||||||
|
mergetool = {
|
||||||
|
trustExitCode = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -95,6 +95,7 @@ in
|
||||||
# "group ui" = "!include groups.yaml";
|
# "group ui" = "!include groups.yaml";
|
||||||
|
|
||||||
http = {
|
http = {
|
||||||
|
# @TODO: Make this a passed-in var
|
||||||
base_url = "ha.homefree.lan";
|
base_url = "ha.homefree.lan";
|
||||||
use_x_forwarded_for = true;
|
use_x_forwarded_for = true;
|
||||||
trusted_proxies = [
|
trusted_proxies = [
|
||||||
|
|
|
@ -35,7 +35,8 @@ in
|
||||||
'';
|
'';
|
||||||
## @TODO: Remove headers and check if still works
|
## @TODO: Remove headers and check if still works
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
reverse_proxy http://10.1.1.1:9000
|
# reverse_proxy http://10.1.1.1:9000
|
||||||
|
reverse_proxy http://127.0.0.1:9000
|
||||||
header {
|
header {
|
||||||
Strict-Transport-Security "max-age=31536000; includeSubdomains"
|
Strict-Transport-Security "max-age=31536000; includeSubdomains"
|
||||||
X-XSS-Protection "1; mode=block"
|
X-XSS-Protection "1; mode=block"
|
||||||
|
@ -52,7 +53,8 @@ in
|
||||||
output file ${config.services.caddy.logDir}/access-vaultwarden.log
|
output file ${config.services.caddy.logDir}/access-vaultwarden.log
|
||||||
'';
|
'';
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
reverse_proxy http://10.1.1.1:8222
|
# reverse_proxy http://10.1.1.1:8222
|
||||||
|
reverse_proxy http://127.0.0.1:8222
|
||||||
header {
|
header {
|
||||||
Strict-Transport-Security "max-age=31536000; includeSubdomains"
|
Strict-Transport-Security "max-age=31536000; includeSubdomains"
|
||||||
X-XSS-Protection "1; mode=block"
|
X-XSS-Protection "1; mode=block"
|
||||||
|
@ -71,7 +73,8 @@ in
|
||||||
# '';
|
# '';
|
||||||
## @TODO: Remove headers and check if still works
|
## @TODO: Remove headers and check if still works
|
||||||
# extraConfig = ''
|
# extraConfig = ''
|
||||||
# reverse_proxy http://10.1.1.1:8123
|
# # reverse_proxy http://10.1.1.1:8123
|
||||||
|
# reverse_proxy http://127.0.0.1:8123
|
||||||
# header {
|
# header {
|
||||||
# Strict-Transport-Security "max-age=31536000; includeSubdomains"
|
# Strict-Transport-Security "max-age=31536000; includeSubdomains"
|
||||||
# X-XSS-Protection "1; mode=block"
|
# X-XSS-Protection "1; mode=block"
|
||||||
|
@ -92,7 +95,8 @@ in
|
||||||
## Authentik
|
## Authentik
|
||||||
# reverse_proxy http://10.1.1.1:9000
|
# reverse_proxy http://10.1.1.1:9000
|
||||||
|
|
||||||
reverse_proxy http://10.1.1.1:9000
|
# reverse_proxy http://10.1.1.1:9000
|
||||||
|
reverse_proxy http://127.0.0.1:9000
|
||||||
header {
|
header {
|
||||||
Strict-Transport-Security "max-age=31536000; includeSubdomains"
|
Strict-Transport-Security "max-age=31536000; includeSubdomains"
|
||||||
X-XSS-Protection "1; mode=block"
|
X-XSS-Protection "1; mode=block"
|
||||||
|
@ -109,7 +113,8 @@ in
|
||||||
output file ${config.services.caddy.logDir}/access-git.log
|
output file ${config.services.caddy.logDir}/access-git.log
|
||||||
'';
|
'';
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
reverse_proxy http://10.1.1.1:3001
|
# reverse_proxy http://10.1.1.1:3001
|
||||||
|
reverse_proxy http://127.0.0.1:3001
|
||||||
header {
|
header {
|
||||||
Strict-Transport-Security "max-age=31536000; includeSubdomains"
|
Strict-Transport-Security "max-age=31536000; includeSubdomains"
|
||||||
X-XSS-Protection "1; mode=block"
|
X-XSS-Protection "1; mode=block"
|
||||||
|
@ -126,7 +131,8 @@ in
|
||||||
output file ${config.services.caddy.logDir}/access-adguard.log
|
output file ${config.services.caddy.logDir}/access-adguard.log
|
||||||
'';
|
'';
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
reverse_proxy http://10.1.1.1:3000
|
# reverse_proxy http://10.1.1.1:3000
|
||||||
|
reverse_proxy http://127.0.0.1:3000
|
||||||
header {
|
header {
|
||||||
Strict-Transport-Security "max-age=31536000; includeSubdomains"
|
Strict-Transport-Security "max-age=31536000; includeSubdomains"
|
||||||
X-XSS-Protection "1; mode=block"
|
X-XSS-Protection "1; mode=block"
|
||||||
|
@ -143,7 +149,8 @@ in
|
||||||
output file ${config.services.caddy.logDir}/access-unifi.log
|
output file ${config.services.caddy.logDir}/access-unifi.log
|
||||||
'';
|
'';
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
reverse_proxy https://10.1.1.1:8443 {
|
# reverse_proxy https://10.1.1.1:8443 {
|
||||||
|
reverse_proxy https://127.0.0.1:8443 {
|
||||||
transport http {
|
transport http {
|
||||||
tls
|
tls
|
||||||
tls_insecure_skip_verify
|
tls_insecure_skip_verify
|
||||||
|
|
|
@ -51,6 +51,9 @@ in
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
nameservers = dns-servers;
|
nameservers = dns-servers;
|
||||||
|
|
||||||
|
# resolvconf = {
|
||||||
|
# };
|
||||||
|
|
||||||
## Define VLANS
|
## Define VLANS
|
||||||
## https://www.breakds.org/post/vlan-configuration-by-examples/
|
## https://www.breakds.org/post/vlan-configuration-by-examples/
|
||||||
# vlans = {
|
# vlans = {
|
||||||
|
@ -75,7 +78,7 @@ in
|
||||||
interfaces = {
|
interfaces = {
|
||||||
# Don't request DHCP on the physical interfaces
|
# Don't request DHCP on the physical interfaces
|
||||||
${wan-interface} = {
|
${wan-interface} = {
|
||||||
# useDHCP = false;
|
# useDHCP = true;
|
||||||
};
|
};
|
||||||
${lan-interface} = {
|
${lan-interface} = {
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
|
@ -251,7 +254,7 @@ in
|
||||||
"${lan-interface},10.1.1.100,10.1.1.254,255.255.255.0,8h"
|
"${lan-interface},10.1.1.100,10.1.1.254,255.255.255.0,8h"
|
||||||
];
|
];
|
||||||
|
|
||||||
## Disable DNS
|
## Disable DNS, since Unbound is handling DNS
|
||||||
port = 0;
|
port = 0;
|
||||||
|
|
||||||
## Additional DHCP options
|
## Additional DHCP options
|
||||||
|
@ -283,6 +286,7 @@ in
|
||||||
include = [
|
include = [
|
||||||
"\"${adlist.unbound-adblockStevenBlack}\""
|
"\"${adlist.unbound-adblockStevenBlack}\""
|
||||||
];
|
];
|
||||||
|
port = 5353;
|
||||||
interface = [
|
interface = [
|
||||||
"127.0.0.1"
|
"127.0.0.1"
|
||||||
"::1"
|
"::1"
|
||||||
|
@ -308,12 +312,23 @@ in
|
||||||
local-data-ptr = [
|
local-data-ptr = [
|
||||||
"\"10.1.1.1 radicale.lan\""
|
"\"10.1.1.1 radicale.lan\""
|
||||||
];
|
];
|
||||||
|
|
||||||
|
hide-identity = true;
|
||||||
|
hide-version = true;
|
||||||
|
|
||||||
|
# Based on recommended settings in https://doc.pi-hole.net/guides/dns/unbound/#configure-unbound
|
||||||
|
harden-glue = true;
|
||||||
|
harden-dnssec-stripped = true;
|
||||||
|
use-caps-for-id = false;
|
||||||
|
prefetch = true;
|
||||||
|
edns-buffer-size = 1232;
|
||||||
};
|
};
|
||||||
|
|
||||||
forward-zone = [
|
forward-zone = [
|
||||||
{
|
{
|
||||||
name = ".";
|
name = ".";
|
||||||
forward-addr = [
|
forward-addr = [
|
||||||
|
"9.9.9.9#dns.quad9.net"
|
||||||
"1.1.1.1@853#cloudflare-dns.com"
|
"1.1.1.1@853#cloudflare-dns.com"
|
||||||
"1.0.0.1@853#cloudflare-dns.com"
|
"1.0.0.1@853#cloudflare-dns.com"
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
libvirt
|
|
||||||
virtiofsd
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.mounts = [
|
|
||||||
{
|
|
||||||
what = "mount_homefree_source";
|
|
||||||
where = "/home/homefree/nixcfg";
|
|
||||||
type = "virtiofs";
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
enable = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.extraModprobeConfig = "options kvm_intel nested=1";
|
|
||||||
boot.kernelParams = [
|
|
||||||
"intel_iommu=on"
|
|
||||||
"cgroup_enable=freezer"
|
|
||||||
];
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue