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