Compare commits
2 Commits
85d4f2cbd8
...
40a9598020
Author | SHA1 | Date | |
---|---|---|---|
40a9598020 | |||
ea06ff9985 |
@ -19,7 +19,6 @@
|
|||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
raspberrypi-tools
|
raspberrypi-tools
|
||||||
git
|
git
|
||||||
tmux
|
|
||||||
htop
|
htop
|
||||||
vim
|
vim
|
||||||
];
|
];
|
||||||
@ -69,32 +68,20 @@
|
|||||||
# Auto-upgrade the system and reboot if needed
|
# Auto-upgrade the system and reboot if needed
|
||||||
system.autoUpgrade = {
|
system.autoUpgrade = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowReboot = false;
|
allowReboot = true;
|
||||||
};
|
|
||||||
|
|
||||||
# Enable zeroconf
|
|
||||||
services.avahi = {
|
|
||||||
enable = true;
|
|
||||||
nssmdns = true;
|
|
||||||
publish = {
|
|
||||||
enable = true;
|
|
||||||
userServices = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Run Nix garbage collector daily
|
# Run Nix garbage collector daily
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
dates = "03:15";
|
dates = "03:15";
|
||||||
|
options = "--delete-older-than 14d";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Configure fish shell
|
# Configure fish shell
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
users.users.root.shell = "/run/current-system/sw/bin/fish";
|
users.users.root.shell = "/run/current-system/sw/bin/fish";
|
||||||
|
|
||||||
# Start a tmux session
|
|
||||||
#programs.tmux.enable = true;
|
|
||||||
|
|
||||||
# Import other configuration modules
|
# Import other configuration modules
|
||||||
imports = [
|
imports = [
|
||||||
./modules/printing.nix
|
./modules/printing.nix
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
dataDir = "/vault/syncthing";
|
dataDir = "/vault/syncthing";
|
||||||
declarative = {
|
declarative = {
|
||||||
devices = {
|
devices = {
|
||||||
monolith = { id = "QGDGEZQ-INE7XDY-DNX2QI4-QI7ANQJ-57REEO2-FUMH545-FZS5RYU-ULF7HA2"; };
|
monolith = { id = "64P2YDH-S5V7PKM-XXBOSXC-WEXUSC7-B553ELI-6IJ3CPJ-ZFB3YA5-MTKAFAH"; };
|
||||||
roamer = { id = "DS3PJH3-J6SNMHM-XUJTDLO-DHGJL5U-J3RUMAG-4OSJWIK-VSJSDVJ-PIHZ2QP"; };
|
roamer = { id = "XE6YPFU-TB7ARWF-7NDSJ35-2PBNNDS-VTXGGCH-KC2UBLE-UHWAXH3-MWD26A5"; };
|
||||||
unit = { id = "VYHHL4A-KJ6WUYQ-4SNWNA3-YRCFTHE-52ZTRLP-4LV6ZDV-4VAJLHC-RJXYYQY"; };
|
unit = { id = "VYHHL4A-KJ6WUYQ-4SNWNA3-YRCFTHE-52ZTRLP-4LV6ZDV-4VAJLHC-RJXYYQY"; };
|
||||||
};
|
};
|
||||||
folders = {
|
folders = {
|
||||||
@ -24,21 +24,18 @@
|
|||||||
"Notes" = { devices = [ "monolith" "roamer" "unit" ]; id = "kafhz-bfmzm"; };
|
"Notes" = { devices = [ "monolith" "roamer" "unit" ]; id = "kafhz-bfmzm"; };
|
||||||
"Music" = { devices = [ "monolith" "roamer" "unit" ]; id = "2aqt7-vpprc"; };
|
"Music" = { devices = [ "monolith" "roamer" "unit" ]; id = "2aqt7-vpprc"; };
|
||||||
"Photos" = { devices = [ "monolith" "roamer" "unit" ]; id = "mjibc-ustcg"; };
|
"Photos" = { devices = [ "monolith" "roamer" "unit" ]; id = "mjibc-ustcg"; };
|
||||||
"Security" = { devices = [ "monolith" "roamer" "unit" ]; id = "z4lpn-pmm3v"; };
|
|
||||||
"Projects" = { devices = [ "monolith" "unit" ]; id = "cjhmu-avy9v"; };
|
"Projects" = { devices = [ "monolith" "unit" ]; id = "cjhmu-avy9v"; };
|
||||||
|
|
||||||
Documents.type = "receiveonly";
|
Documents.type = "receiveonly";
|
||||||
Notes.type = "receiveonly";
|
Notes.type = "receiveonly";
|
||||||
Music.type = "receiveonly";
|
Music.type = "receiveonly";
|
||||||
Photos.type = "receiveonly";
|
Photos.type = "receiveonly";
|
||||||
Security.type = "receiveonly";
|
|
||||||
Projects.type = "receiveonly";
|
Projects.type = "receiveonly";
|
||||||
|
|
||||||
Documents.path = "/vault/syncthing/Documents";
|
Documents.path = "/vault/syncthing/Documents";
|
||||||
Notes.path = "/vault/syncthing/Notes";
|
Notes.path = "/vault/syncthing/Notes";
|
||||||
Music.path = "/vault/syncthing/Music";
|
Music.path = "/vault/syncthing/Music";
|
||||||
Photos.path = "/vault/syncthing/Photos";
|
Photos.path = "/vault/syncthing/Photos";
|
||||||
Security.path = "/vault/syncthing/Security";
|
|
||||||
Projects.path = "/vault/syncthing/Projects";
|
Projects.path = "/vault/syncthing/Projects";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
# Software development configuration
|
# Software development configuration
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
gitea
|
|
||||||
];
|
|
||||||
|
|
||||||
# Gitea setup with daily backup
|
# Gitea setup with daily backup
|
||||||
services.gitea = {
|
services.gitea = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -20,5 +16,4 @@
|
|||||||
dump.enable = true;
|
dump.enable = true;
|
||||||
appName = "Gitea";
|
appName = "Gitea";
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,22 @@
|
|||||||
{
|
{
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
ddclient
|
wireguard
|
||||||
|
wireguard-tools
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
# Enable zeroconf
|
||||||
|
services.avahi = {
|
||||||
|
enable = true;
|
||||||
|
nssmdns = true;
|
||||||
|
publish = {
|
||||||
|
enable = true;
|
||||||
|
userServices = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
# Dynamic DNS configuration
|
# Dynamic DNS configuration
|
||||||
services.ddclient = {
|
services.ddclient = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -26,11 +39,46 @@
|
|||||||
80
|
80
|
||||||
443
|
443
|
||||||
];
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
51820 # Wireguard
|
||||||
|
];
|
||||||
autoLoadConntrackHelpers = true;
|
autoLoadConntrackHelpers = true;
|
||||||
connectionTrackingModules = [ "sane" ];
|
connectionTrackingModules = [ "sane" ];
|
||||||
|
extraCommands = ''
|
||||||
|
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Disable IPv6
|
# Disable IPv6
|
||||||
networking.enableIPv6 = false;
|
networking.enableIPv6 = false;
|
||||||
|
|
||||||
|
# Enable NAT for wireguard
|
||||||
|
networking.nat = {
|
||||||
|
enable = true;
|
||||||
|
externalInterface = "eth0";
|
||||||
|
internalInterfaces = [ "wg0" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Wireguard setup
|
||||||
|
networking.wireguard.interfaces = {
|
||||||
|
wg0 = {
|
||||||
|
ips = [ "10.8.0.1/24" ];
|
||||||
|
listenPort = 51820;
|
||||||
|
privateKeyFile = "/home/coolneng/.wg/keys/privatekey";
|
||||||
|
peers = [
|
||||||
|
# Monolith
|
||||||
|
{
|
||||||
|
publicKey = "ka9a/VB49XMtrMw/ZJmZHThfk2Y5D/8wErLPtN+KvHE=";
|
||||||
|
allowedIPs = [ "10.8.0.2/32" ];
|
||||||
|
}
|
||||||
|
# Roamer
|
||||||
|
{
|
||||||
|
publicKey = "gS5VIUFL74kTs3zxVNT/ijWyOjeAFLEqWynD0Pefh1o=";
|
||||||
|
allowedIPs = [ "10.8.0.3/32" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,4 +133,8 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
# Restart nginx after
|
||||||
|
systemd.services.nginx.after = [ "gitea.service" "syncthing.service" "miniflux.service" ];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user