Compare commits
No commits in common. "40a95980208815e8269cb790d7ecb5eccd6fd9b6" and "85d4f2cbd85c72b92f6f47904242e1962601b957" have entirely different histories.
40a9598020
...
85d4f2cbd8
@ -19,6 +19,7 @@
|
|||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
raspberrypi-tools
|
raspberrypi-tools
|
||||||
git
|
git
|
||||||
|
tmux
|
||||||
htop
|
htop
|
||||||
vim
|
vim
|
||||||
];
|
];
|
||||||
@ -68,20 +69,32 @@
|
|||||||
# 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 = true;
|
allowReboot = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# 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 = "64P2YDH-S5V7PKM-XXBOSXC-WEXUSC7-B553ELI-6IJ3CPJ-ZFB3YA5-MTKAFAH"; };
|
monolith = { id = "QGDGEZQ-INE7XDY-DNX2QI4-QI7ANQJ-57REEO2-FUMH545-FZS5RYU-ULF7HA2"; };
|
||||||
roamer = { id = "XE6YPFU-TB7ARWF-7NDSJ35-2PBNNDS-VTXGGCH-KC2UBLE-UHWAXH3-MWD26A5"; };
|
roamer = { id = "DS3PJH3-J6SNMHM-XUJTDLO-DHGJL5U-J3RUMAG-4OSJWIK-VSJSDVJ-PIHZ2QP"; };
|
||||||
unit = { id = "VYHHL4A-KJ6WUYQ-4SNWNA3-YRCFTHE-52ZTRLP-4LV6ZDV-4VAJLHC-RJXYYQY"; };
|
unit = { id = "VYHHL4A-KJ6WUYQ-4SNWNA3-YRCFTHE-52ZTRLP-4LV6ZDV-4VAJLHC-RJXYYQY"; };
|
||||||
};
|
};
|
||||||
folders = {
|
folders = {
|
||||||
@ -24,18 +24,21 @@
|
|||||||
"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,6 +1,10 @@
|
|||||||
# 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;
|
||||||
@ -16,4 +20,5 @@
|
|||||||
dump.enable = true;
|
dump.enable = true;
|
||||||
appName = "Gitea";
|
appName = "Gitea";
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,22 +6,9 @@
|
|||||||
{
|
{
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
wireguard
|
ddclient
|
||||||
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;
|
||||||
@ -39,46 +26,11 @@
|
|||||||
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,8 +133,4 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# Restart nginx after
|
|
||||||
systemd.services.nginx.after = [ "gitea.service" "syncthing.service" "miniflux.service" ];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user