Push these changes to a branch cause I'm kind of giving up
This commit is contained in:
parent
d9469fc321
commit
e3bacb2d84
229 changed files with 1496 additions and 1479 deletions
6
system/accounts/default.nix
Normal file
6
system/accounts/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./users
|
||||
./groups
|
||||
];
|
||||
}
|
5
system/accounts/groups/default.nix
Normal file
5
system/accounts/groups/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./nfsShare
|
||||
];
|
||||
}
|
3
system/accounts/groups/nfsShare/default.nix
Normal file
3
system/accounts/groups/nfsShare/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{ ... }: {
|
||||
users.groups.nfsShare = {};
|
||||
}
|
8
system/accounts/users/default.nix
Normal file
8
system/accounts/users/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./jimbo
|
||||
./liquidsoap
|
||||
./nextcloud
|
||||
./nginx
|
||||
];
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, outputs, ...}: {
|
||||
{ pkgs, outputs, ... }: {
|
||||
users.users = {
|
||||
jimbo = {
|
||||
description = "Jimbo";
|
|
@ -1,68 +0,0 @@
|
|||
# This is your system's configuration file (it replaces /etc/nixos/configuration.nix)
|
||||
{inputs, outputs, lib, config, pkgs, ...}: {
|
||||
# You can import other NixOS modules here
|
||||
imports = [
|
||||
./modules/networking.nix
|
||||
./modules/gpg.nix
|
||||
];
|
||||
|
||||
nixpkgs = {
|
||||
# You can add overlays here
|
||||
overlays = [
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.selfsuper
|
||||
outputs.overlays.finalprev
|
||||
];
|
||||
|
||||
# Allow unfree apps
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
|
||||
# Enable flakes and garbage collection
|
||||
nix = {
|
||||
settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 1w";
|
||||
};
|
||||
};
|
||||
|
||||
# Set timezone
|
||||
time.timeZone = outputs.secrets.timeZone;
|
||||
|
||||
# Select a terminal font
|
||||
console = {
|
||||
earlySetup = true;
|
||||
font = "${pkgs.terminus_font}/share/consolefonts/ter-u22n.psf.gz";
|
||||
packages = with pkgs; [ terminus_font ];
|
||||
keyMap = "us";
|
||||
};
|
||||
|
||||
# Enable git
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
};
|
||||
|
||||
# Basic firewall settings
|
||||
networking.nftables.enable = true;
|
||||
|
||||
# Enable the ZSH shell
|
||||
programs.zsh.enable = true;
|
||||
|
||||
# Disable Nano
|
||||
programs.nano.enable = false;
|
||||
|
||||
# Disable the HTML documentation link
|
||||
documentation = {
|
||||
nixos.enable = false;
|
||||
info.enable = false;
|
||||
};
|
||||
|
||||
# Allow binary firmware
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
}
|
38
system/default.nix
Normal file
38
system/default.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{ outputs, config, pkgs, ... }: {
|
||||
imports = [
|
||||
./accounts
|
||||
./modules/networking
|
||||
./modules/overlays
|
||||
./programs/git
|
||||
./services/garbage-collection
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
|
||||
time.timeZone = outputs.secrets.timeZone;
|
||||
|
||||
console = {
|
||||
earlySetup = true;
|
||||
font = "${pkgs.terminus_font}/share/consolefonts/ter-u22n.psf.gz";
|
||||
packages = with pkgs; [ terminus_font ];
|
||||
};
|
||||
|
||||
programs = {
|
||||
zsh.enable = true;
|
||||
nano.enable = false;
|
||||
};
|
||||
|
||||
# Disable the HTML documentation applet
|
||||
documentation = {
|
||||
nixos.enable = false;
|
||||
info.enable = false;
|
||||
};
|
||||
|
||||
# Allow binary firmware
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
# Fonts
|
||||
fonts = {
|
||||
packages = with pkgs; [
|
||||
liberation_ttf
|
||||
twitter-color-emoji
|
||||
noto-fonts
|
||||
sarasa-gothic
|
||||
ubuntu_font_family
|
||||
(nerdfonts.override {fonts = ["UbuntuMono"];})
|
||||
];
|
||||
fontconfig.defaultFonts.emoji = ["Twitter Color Emoji"];
|
||||
};
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
# Enable AppImages
|
||||
programs.appimage = {
|
||||
enable = true;
|
||||
binfmt = true;
|
||||
};
|
||||
|
||||
# Network mounts, automounts, and battery saver
|
||||
services = {
|
||||
gvfs.enable = true;
|
||||
udisks2.enable = true;
|
||||
};
|
||||
|
||||
# Security that only makes sense with a GUI
|
||||
security = {
|
||||
polkit.enable = true;
|
||||
rtkit.enable = true;
|
||||
};
|
||||
|
||||
# Install programs system-wide
|
||||
environment.systemPackages = with pkgs; [
|
||||
cifs-utils
|
||||
];
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
{
|
||||
imports = [
|
||||
# Base configs
|
||||
./../../base.nix
|
||||
|
||||
# Import users and groups
|
||||
./../../users/jimbo.nix
|
||||
./../../users/groups.nix
|
||||
|
||||
# Desktop
|
||||
./../../desktop/misc.nix
|
||||
./../../desktop/sway.nix
|
||||
./../../desktop/greetd-sway.nix
|
||||
./../../desktop/printing.nix
|
||||
./../../desktop/gaming.nix
|
||||
./../../desktop/pipewire.nix
|
||||
./../../desktop/bluetooth.nix
|
||||
./../../desktop/firewall.nix
|
||||
./../../desktop/fonts.nix
|
||||
./../../desktop/qt.nix
|
||||
|
||||
# Modules
|
||||
./../../modules/security.nix
|
||||
|
||||
# Hardware
|
||||
./hardware-configuration.nix
|
||||
./../../modules/systemdboot.nix
|
||||
./../../modules/opengl.nix
|
||||
./../../modules/filesystems.nix
|
||||
./../../modules/nvidia.nix
|
||||
#./../../modules/nouveau.nix
|
||||
|
||||
# Services
|
||||
./../../services/openssh.nix
|
||||
./../../services/gnome-keyring.nix
|
||||
./../../services/qemukvm.nix
|
||||
./../../services/udev.nix
|
||||
./../../services/sunshine.nix
|
||||
./../../services/mpd.nix
|
||||
#./../../services/waydroid.nix
|
||||
];
|
||||
|
||||
# Set hostname
|
||||
networking.hostName = "JimDesktop";
|
||||
|
||||
# Force Electron to use Wayland
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
system.stateVersion = "24.05";
|
||||
}
|
|
@ -1,113 +0,0 @@
|
|||
{ config, lib, pkgs, outputs, modulesPath, ... }: let
|
||||
# Set common boot paramaters
|
||||
commonKernelParams = [
|
||||
# Nvidia settings
|
||||
"nvidia_drm.fbdev=1"
|
||||
"nouveau.config=NvGspRm=1"
|
||||
|
||||
# VM/GPU passthrough
|
||||
"amd_iommu=on"
|
||||
"iommu=pt"
|
||||
"nested=1"
|
||||
|
||||
# Virtualization nonsense
|
||||
"transparent_hugepage=never"
|
||||
|
||||
# Isolate devices into IOMMU groups
|
||||
"pcie_acs_override=downstream,multifunction"
|
||||
"pci=routeirq"
|
||||
];
|
||||
in {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
# Set all boot options
|
||||
boot = {
|
||||
# Set a kernel version and load/blacklist drivers
|
||||
kernelPackages = pkgs.unstable.linuxPackages_zen;
|
||||
blacklistedKernelModules = [
|
||||
"pcspkr"
|
||||
];
|
||||
kernel.sysctl."vm.max_map_count" = 2147483642;
|
||||
kernelParams = commonKernelParams ++ [
|
||||
"vfio-pci.ids=10de:1f82,10de:10fa"
|
||||
];
|
||||
initrd = {
|
||||
availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
kernelModules = [
|
||||
"vfio"
|
||||
"vfio_pci"
|
||||
"vfio_iommu_type1"
|
||||
"kvm-amd"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Additional entry to boot from the second GPU
|
||||
specialisation = {
|
||||
gputwo.configuration = {
|
||||
boot.kernelParams = commonKernelParams ++ ["vfio-pci.ids=10de:2504,10de:228e"];
|
||||
};
|
||||
};
|
||||
|
||||
# Mount everything as necessary
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/f0786b07-8303-416f-87ff-276bfd696387";
|
||||
fsType = "bcachefs";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/EF6D-9009";
|
||||
fsType = "vfat";
|
||||
};
|
||||
"/etc/libvirt" = {
|
||||
device = "/dev/disk/by-label/Qemu";
|
||||
options = ["nosuid" "nodev" "nofail"];
|
||||
};
|
||||
"/var/lib/libvirt" = {
|
||||
depends = ["/etc/libvirt"];
|
||||
device = "/etc/libvirt/varlibvirt";
|
||||
options = ["bind" "rw"];
|
||||
};
|
||||
"/mnt/Linux1" = {
|
||||
device = "/dev/disk/by-label/Linux1";
|
||||
options = ["nosuid" "nodev" "nofail" "x-gvfs-show"];
|
||||
};
|
||||
"/mnt/Linux2" = {
|
||||
device = "/dev/disk/by-label/Linux2";
|
||||
options = ["nosuid" "nodev" "nofail" "x-gvfs-show"];
|
||||
};
|
||||
"/mnt/Windows1" = {
|
||||
device = "/dev/disk/by-label/Windows1";
|
||||
options = ["nosuid" "nodev" "noauto"];
|
||||
};
|
||||
"/mnt/Windows2" = {
|
||||
device = "/dev/disk/by-label/Windows2";
|
||||
options = ["nosuid" "nodev" "noauto"];
|
||||
};
|
||||
"/home/jimbo/JimboNFS" = {
|
||||
device = "${outputs.ips.server}:/export/JimboNFS";
|
||||
fsType = "nfs4";
|
||||
options = ["x-systemd.automount" "_netdev" "nofail" "noauto"];
|
||||
};
|
||||
};
|
||||
|
||||
# Set the swap partition
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/2e4c5120-716d-4cdc-84a0-c9e6391760db";}
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
{
|
||||
imports = [
|
||||
# Base configs
|
||||
./../../base.nix
|
||||
|
||||
# Import users and groups
|
||||
./../../users/jimbo.nix
|
||||
./../../users/groups.nix
|
||||
|
||||
# Desktop
|
||||
./../../desktop/misc.nix
|
||||
./../../desktop/sway.nix
|
||||
./../../desktop/greetd-sway.nix
|
||||
./../../desktop/printing.nix
|
||||
./../../desktop/gaming.nix
|
||||
./../../desktop/pipewire.nix
|
||||
./../../desktop/bluetooth.nix
|
||||
./../../desktop/firewall.nix
|
||||
./../../desktop/fonts.nix
|
||||
./../../desktop/qt.nix
|
||||
|
||||
# Laptop/Portable only
|
||||
./../../modules/wireless.nix
|
||||
|
||||
# Modules
|
||||
./../../modules/security.nix
|
||||
|
||||
# Hardware
|
||||
./hardware-configuration.nix
|
||||
./../../modules/systemdboot.nix
|
||||
./../../modules/opengl.nix
|
||||
|
||||
# Services
|
||||
./../../services/openssh.nix
|
||||
./../../services/gnome-keyring.nix
|
||||
./../../services/udev.nix
|
||||
./../../services/mpd.nix
|
||||
];
|
||||
|
||||
# Set hostname
|
||||
networking.hostName = "JimLenovo";
|
||||
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
system.stateVersion = "24.05";
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
{ config, lib, pkgs, modulesPath, ... }: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
# Set all boot options
|
||||
boot = {
|
||||
# Set a kernel version and load/blacklist drivers
|
||||
kernelPackages = pkgs.linuxPackages_zen;
|
||||
blacklistedKernelModules = [
|
||||
"pcspkr"
|
||||
];
|
||||
kernel.sysctl."vm.max_map_count" = 2147483642;
|
||||
initrd = {
|
||||
availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"sdhci_pci"
|
||||
];
|
||||
kernelModules = [
|
||||
"kvm-amd"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Mount everything as necessary
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/c0fe8419-88f9-48a0-8c5b-acd4c11f8037";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/BF2B-9AE0";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
};
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
{lib, outputs, ...}: {
|
||||
imports = [
|
||||
# Base configs
|
||||
./../../base.nix
|
||||
|
||||
# Import users and groups
|
||||
./../../users/jimbo.nix
|
||||
./../../users/groups.nix
|
||||
|
||||
# Desktop
|
||||
./../../desktop/misc.nix
|
||||
./../../desktop/sway.nix
|
||||
./../../desktop/greetd-sway.nix
|
||||
./../../desktop/printing.nix
|
||||
./../../desktop/pipewire.nix
|
||||
./../../desktop/bluetooth.nix
|
||||
./../../desktop/firewall.nix
|
||||
./../../desktop/fonts.nix
|
||||
./../../desktop/qt.nix
|
||||
./../../desktop/wireguard.nix
|
||||
|
||||
# Modules
|
||||
./../../modules/security.nix
|
||||
|
||||
# Hardware
|
||||
./hardware-configuration.nix
|
||||
./../../modules/extlinux.nix
|
||||
./../../modules/opengl.nix
|
||||
./../../modules/filesystems.nix
|
||||
./../../modules/wireless.nix
|
||||
|
||||
# Services
|
||||
./../../services/openssh.nix
|
||||
./../../services/gnome-keyring.nix
|
||||
./../../services/mpd.nix
|
||||
];
|
||||
|
||||
# Set hostname
|
||||
networking.hostName = "JimPine";
|
||||
|
||||
# Disable 32 bit graphics
|
||||
hardware.opengl.driSupport32Bit = lib.mkForce false;
|
||||
|
||||
# Set the VPN IP per machine
|
||||
networking.wireguard.interfaces."${outputs.ips.wgInt}".ips = [ "${outputs.ips.wgSpan}.17/24" ];
|
||||
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
system.stateVersion = "24.05";
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
{ config, outputs, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot = {
|
||||
initrd = {
|
||||
availableKernelModules = [ ];
|
||||
kernelModules = [ ];
|
||||
};
|
||||
blacklistedKernelModules = [
|
||||
"pcspkr"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/25738e24-385e-4bcf-bff5-d0e6274003b6";
|
||||
fsType = "btrfs";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/01D2-E962";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
"/home/jimbo/Downloads" = {
|
||||
device = "/dev/disk/by-uuid/f0b6cf4e-9576-4ab5-96ae-2a7e57599a35";
|
||||
fsType = "btrfs";
|
||||
};
|
||||
"/home/jimbo/JimboNFS" = {
|
||||
device = "${outputs.ips.wgSpan}.1:/export/JimboNFS";
|
||||
fsType = "nfs4";
|
||||
options = ["x-systemd.automount" "_netdev" "nofail" "noauto"];
|
||||
};
|
||||
"/home/jimbo/FreecornNFS" = {
|
||||
device = "${outputs.secrets.cornIP}:/export/freecornNFS";
|
||||
fsType = "nfs4";
|
||||
options = ["x-systemd.automount" "_netdev" "nofail" "noauto"];
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/95c43e5a-b53d-41fd-99a3-54181510070e"; }
|
||||
];
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
{
|
||||
imports = [
|
||||
# Base configs
|
||||
./../../base.nix
|
||||
|
||||
# Import users and groups
|
||||
./../../users/jimbo.nix
|
||||
./../../users/nextcloud.nix
|
||||
./../../users/nginx.nix
|
||||
./../../users/liquidsoap.nix
|
||||
./../../users/groups.nix
|
||||
|
||||
# Modules
|
||||
./../../modules/security.nix
|
||||
|
||||
# Hardware
|
||||
./hardware-configuration.nix
|
||||
./../../hardware/systemdboot.nix
|
||||
|
||||
# Services
|
||||
./../../services/openssh.nix
|
||||
./../../server/acme.nix
|
||||
./../../server/ddclient.nix
|
||||
./../../server/icecast.nix
|
||||
./../../server/firewall.nix
|
||||
./../../server/forgejo.nix
|
||||
./../../server/mailserver.nix
|
||||
./../../server/mariadb.nix
|
||||
./../../server/nginx.nix
|
||||
./../../server/owncast.nix
|
||||
./../../server/photoprism.nix
|
||||
./../../server/minecraft
|
||||
./../../server/vaultwarden.nix
|
||||
./../../server/transmission.nix
|
||||
./../../server/wireguard.nix
|
||||
./../../server/misc.nix
|
||||
|
||||
# File server
|
||||
./../../server/nextcloud.nix
|
||||
./../../server/nfs.nix
|
||||
./../../server/samba.nix
|
||||
|
||||
# Matrix
|
||||
./../../server/synapse.nix
|
||||
./../../server/element.nix
|
||||
./../../server/coturn.nix
|
||||
./../../server/matrix-discord.nix
|
||||
|
||||
# Federation
|
||||
./../../server/lemmy.nix
|
||||
./../../server/mastodon.nix
|
||||
./../../server/pixelfed.nix
|
||||
];
|
||||
|
||||
# Set custom openssh port
|
||||
services.openssh.ports = [ 2222 ];
|
||||
|
||||
# Set hostname
|
||||
networking.hostName = "JimServer";
|
||||
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
system.stateVersion = "24.05";
|
||||
}
|
|
@ -1,110 +0,0 @@
|
|||
{ config, outputs, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
# Set all boot options
|
||||
boot = {
|
||||
blacklistedKernelModules = [
|
||||
"pcspkr"
|
||||
];
|
||||
initrd = {
|
||||
availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ehci_pci"
|
||||
"ahci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"sd_mod"
|
||||
"sr_mod"
|
||||
];
|
||||
kernelModules = [
|
||||
"kvm-intel"
|
||||
];
|
||||
};
|
||||
swraid.mdadmConf = ''
|
||||
MAILADDR jimbo@${outputs.secrets.jimDomain}
|
||||
'';
|
||||
};
|
||||
|
||||
# Mounting options
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/8f81cab7-9381-4950-b77f-b85c5fdbad16";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/2034-754A";
|
||||
fsType = "vfat";
|
||||
};
|
||||
"/export/JimboNFS" = {
|
||||
device = "/dev/disk/by-uuid/713fcd92-534c-4153-8e04-e0c6fe5f6a51";
|
||||
fsType = "ext4";
|
||||
noCheck = true;
|
||||
};
|
||||
"/home/jimbo/JimboNFS" = {
|
||||
device = "/export/JimboNFS";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
# Atrocity of bindmounts
|
||||
"/mnt/nextcloud/data/JimboNFS" = {
|
||||
device = "/export/JimboNFS";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
"/var/lib/bitwarden_rs" = {
|
||||
device = "/export/JimboNFS/System/var/lib/bitwarden_rs";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
"/var/lib/gitea" = {
|
||||
device = "/export/JimboNFS/System/var/lib/gitea";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
"/var/lib/matrix-synapse" = {
|
||||
device = "/export/JimboNFS/System/var/lib/matrix-synapse";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
"/var/lib/nextcloud" = {
|
||||
device = "/export/JimboNFS/System/var/lib/nextcloud";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
"/var/lib/owncast" = {
|
||||
device = "/export/JimboNFS/System/var/lib/owncast";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
"/var/lib/mastodon" = {
|
||||
device = "/export/JimboNFS/System/var/lib/mastodon";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
"/srv/minecraft" = {
|
||||
device = "/export/JimboNFS/System/srv/minecraft";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
"/var/lib/private/photoprism/originals" = {
|
||||
device = "/export/JimboNFS/Photos/Galleries";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/ec422cad-bf93-4b15-b989-2c807f1073a4"; }
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
# Hardware settings
|
||||
boot.swraid.enable = true;
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
# Enable Bluetooth
|
||||
{ ... }: {
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
settings = {
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
# For ARM machines
|
||||
boot.loader = {
|
||||
generic-extlinux-compatible.enable = true;
|
||||
grub.enable = false;
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
# For UEFI machines
|
||||
boot.loader.systemd-boot = {
|
||||
enable = true;
|
||||
netbootxyz.enable = true;
|
12
system/modules/default.nix
Normal file
12
system/modules/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./bluetooth
|
||||
./filesystems
|
||||
./networking
|
||||
./pipewire
|
||||
./printing
|
||||
./security
|
||||
./udev
|
||||
./video
|
||||
];
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{lib, ...}: {
|
||||
{ lib, ... }: {
|
||||
boot.supportedFilesystems = {
|
||||
ntfs = true;
|
||||
zfs = lib.mkForce false;
|
|
@ -1,7 +1,11 @@
|
|||
{
|
||||
# Networking settings
|
||||
{ ... }: {
|
||||
imports = [
|
||||
./wireless
|
||||
];
|
||||
|
||||
networking = {
|
||||
wireless.enable = false;
|
||||
dhcpcd.enable = true;
|
||||
nftables.enable = true;
|
||||
};
|
||||
}
|
12
system/modules/networking/wireless/default.nix
Normal file
12
system/modules/networking/wireless/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ lib, config, ... }: {
|
||||
options = {
|
||||
networking.wifi.enable = lib.mkEnableOption "Enable enable Network Manager and B43";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.misc.general.enable {
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
enableB43Firmware = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
# Enable video drivers
|
||||
services.xserver.videoDrivers = ["nouveau"];
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
{pkgs, config, ...}: {
|
||||
# Enable video drivers
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
nvidiaSettings = false;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
open = false;
|
||||
};
|
||||
}
|
7
system/modules/overlays/default.nix
Normal file
7
system/modules/overlays/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ outputs, ... }: {
|
||||
nixpkgs.overlays = [
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.selfsuper
|
||||
outputs.overlays.finalprev
|
||||
];
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
{pkgs, ...}: {
|
||||
# Enable Pipewire
|
||||
{ pkgs, ... }: {
|
||||
services = {
|
||||
pipewire = {
|
||||
enable = true;
|
|
@ -1,5 +1,4 @@
|
|||
{pkgs, ...}: {
|
||||
# Enable printing
|
||||
{ pkgs, ... }: {
|
||||
services = {
|
||||
printing = {
|
||||
enable = true;
|
||||
|
@ -13,7 +12,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
# Install programs system-wide
|
||||
environment.systemPackages = with pkgs; [
|
||||
system-config-printer
|
||||
];
|
3
system/modules/security/apparmor/default.nix
Normal file
3
system/modules/security/apparmor/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{ ... }: {
|
||||
security.apparmor.enable = true;
|
||||
}
|
8
system/modules/security/default.nix
Normal file
8
system/modules/security/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./apparmor
|
||||
./doas
|
||||
./gnome-keyring
|
||||
./polkit
|
||||
];
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
# Enable AppArmor
|
||||
{ ... }: {
|
||||
security = {
|
||||
sudo.enable = false;
|
||||
doas = {
|
||||
|
@ -12,6 +11,5 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
apparmor.enable = true;
|
||||
};
|
||||
}
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
{ ... }: {
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
}
|
6
system/modules/security/polkit/default.nix
Normal file
6
system/modules/security/polkit/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }: {
|
||||
security = {
|
||||
polkit.enable = true;
|
||||
rtkit.enable = true;
|
||||
};
|
||||
}
|
20
system/modules/udev/default.nix
Normal file
20
system/modules/udev/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ pkgs, ... }: {
|
||||
# Rules to make PDP controller and Oculus Rift CV1 work
|
||||
services.udev = let
|
||||
pdpRules = pkgs.writeTextFile {
|
||||
name = "10-pdp.rules";
|
||||
text = ''SUBSYSTEM=="usb", ATTR{idVendor}=="2833", MODE="0666"'';
|
||||
destination = "/etc/udev/rules.d/10-pdp.rules";
|
||||
};
|
||||
oculusRules = pkgs.writeTextFile {
|
||||
name = "10-oculus.rules";
|
||||
text = ''KERNEL=="hidraw*", ATTRS{idVendor}=="0e6f", ATTRS{idProduct}=="0184", MODE="0660", TAG+="uaccess"'';
|
||||
destination = "/etc/udev/rules.d/10-oculus.rules";
|
||||
};
|
||||
in {
|
||||
packages = [
|
||||
oculusRules
|
||||
pdpRules
|
||||
];
|
||||
};
|
||||
}
|
|
@ -1,5 +1,9 @@
|
|||
{pkgs, ...}: {
|
||||
# Enable OpenGL
|
||||
{ pkgs, ... }: {
|
||||
imports = [
|
||||
./nvidia
|
||||
./nouveau
|
||||
];
|
||||
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport32Bit = true;
|
9
system/modules/video/nouveau/default.nix
Normal file
9
system/modules/video/nouveau/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ config, lib, ... }: {
|
||||
options = {
|
||||
drivers.nouveau.enable = lib.mkEnableOption "Enable proprietary Nvidia drivers";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.drivers.nvidia.enable {
|
||||
services.xserver.videoDrivers = [ "nouveau" ];
|
||||
};
|
||||
}
|
15
system/modules/video/nvidia/default.nix
Normal file
15
system/modules/video/nvidia/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ pkgs, config, lib, ... }: {
|
||||
options = {
|
||||
drivers.nvidia.enable = lib.mkEnableOption "Enable proprietary Nvidia drivers";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.drivers.nvidia.enable {
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
nvidiaSettings = false;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
open = false;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
# Enable wireless networkmanager
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
enableB43Firmware = true;
|
||||
};
|
||||
}
|
21
system/pc.nix
Normal file
21
system/pc.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
# Base configs
|
||||
./default.nix
|
||||
|
||||
# Users and groups
|
||||
./accounts
|
||||
|
||||
# Modules
|
||||
./modules
|
||||
|
||||
# Programs
|
||||
./programs
|
||||
|
||||
# Services
|
||||
./services/ssh
|
||||
./services/sunshine
|
||||
./services/mpd
|
||||
./services/virtualization
|
||||
];
|
||||
}
|
6
system/programs/appimage/default.nix
Normal file
6
system/programs/appimage/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }: {
|
||||
programs.appimage = {
|
||||
enable = true;
|
||||
binfmt = true;
|
||||
};
|
||||
}
|
11
system/programs/default.nix
Normal file
11
system/programs/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./appimage
|
||||
./gaming
|
||||
./git
|
||||
./school
|
||||
./sway
|
||||
./theming
|
||||
./wayland
|
||||
];
|
||||
}
|
|
@ -1,10 +1,8 @@
|
|||
{pkgs, ...}: {
|
||||
# Enable Gamemode to boost games
|
||||
{ pkgs, ... }: {
|
||||
programs.gamemode = {
|
||||
enable = true;
|
||||
settings.general.renice = 10;
|
||||
};
|
||||
|
||||
# Enable hardware like the Steam Controller
|
||||
hardware.steam-hardware.enable = true;
|
||||
}
|
10
system/programs/git/default.nix
Normal file
10
system/programs/git/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./gpg
|
||||
];
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
};
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{pkgs, ...}: {
|
||||
{ pkgs, ... }: {
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
git-crypt
|
|
@ -1,5 +1,4 @@
|
|||
{pkgs, ...}: {
|
||||
# Install programs system-wide
|
||||
{ pkgs, ... }: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
remmina
|
||||
freerdp
|
||||
|
@ -8,6 +7,5 @@
|
|||
globalprotect-openconnect
|
||||
];
|
||||
|
||||
# Enable Globalprotect VPN
|
||||
services.globalprotect.enable = true;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{pkgs, ...}: {
|
||||
{ pkgs, ... }: {
|
||||
imports = [
|
||||
./wayland.nix
|
||||
./greetd
|
||||
];
|
||||
|
||||
programs.sway = {
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, ...}: {
|
||||
{ pkgs, ... }: {
|
||||
services = {
|
||||
# Configure greetd for "auto" login (single user only)
|
||||
greetd = let
|
6
system/programs/theming/default.nix
Normal file
6
system/programs/theming/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./qt
|
||||
./fonts
|
||||
];
|
||||
}
|
19
system/programs/theming/fonts/default.nix
Normal file
19
system/programs/theming/fonts/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ pkgs, ... }: {
|
||||
fonts = {
|
||||
packages = with pkgs; [
|
||||
liberation_ttf
|
||||
twitter-color-emoji
|
||||
noto-fonts
|
||||
sarasa-gothic
|
||||
ubuntu_font_family
|
||||
(nerdfonts.override {
|
||||
fonts = [
|
||||
"UbuntuMono"
|
||||
];
|
||||
})
|
||||
];
|
||||
fontconfig.defaultFonts.emoji = [
|
||||
"Twitter Color Emoji"
|
||||
];
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
{ ... }: {
|
||||
qt = {
|
||||
enable = true;
|
||||
style = "gtk2";
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, ...}: {
|
||||
{ pkgs, ... }: {
|
||||
programs = {
|
||||
dconf.enable = true;
|
||||
light.enable = true;
|
34
system/server.nix
Normal file
34
system/server.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
# Base configs
|
||||
./default.nix
|
||||
|
||||
# Users and groups
|
||||
./accounts
|
||||
|
||||
# Modules
|
||||
./modules/security/doas
|
||||
|
||||
# Services
|
||||
./services/acme
|
||||
./services/ddclient
|
||||
./services/fileserver
|
||||
./services/firewall/server
|
||||
./services/forgejo
|
||||
./services/icecast
|
||||
./services/mailserver
|
||||
./services/minecraft
|
||||
./services/misc/server
|
||||
./services/mysql
|
||||
./services/nginx
|
||||
./services/social
|
||||
./services/ssh
|
||||
./services/transmission
|
||||
./services/vaultwarden
|
||||
./services/wireguard/server
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
mdadm
|
||||
];
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
services = {
|
||||
adguardhome.enable = true;
|
||||
nginx.virtualHosts."guard.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:3000";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
networking.firewall.allowedUDPPorts = [ 53 ];
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
{outputs, ...}: {
|
||||
services = {
|
||||
gitea = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = "gitea.${outputs.secrets.jimDomain}";
|
||||
ROOT_URL = "https://gitea.${outputs.secrets.jimDomain}:443";
|
||||
HTTP_PORT = 3115;
|
||||
SSH_PORT = 2295;
|
||||
START_SSH_SERVER = true;
|
||||
};
|
||||
mailer = {
|
||||
ENABLED = true;
|
||||
SMTP_ADDR = "mx.${outputs.secrets.jimDomain}";
|
||||
FROM = "Jimbo's Git <noreply@${outputs.secrets.jimDomain}>";
|
||||
USER = "noreply@${outputs.secrets.jimDomain}";
|
||||
PASSWD = outputs.secrets.noreplyPassword;
|
||||
PROTOCOL = "smtps";
|
||||
};
|
||||
service.REGISTER_EMAIL_CONFIRM = true;
|
||||
};
|
||||
};
|
||||
nginx.virtualHosts."gitea.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:3115";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Allow Gitea SSH to work
|
||||
networking.firewall.allowedTCPPorts = [ 2295 ];
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
{pkgs, outputs, lib, ...}: {
|
||||
services = {
|
||||
pufferpanel = {
|
||||
enable = true;
|
||||
environment = {
|
||||
PUFFER_WEB_HOST = ":5010";
|
||||
PUFFER_PANEL_SETTINGS_MASTERURL = "https://panel.${outputs.secrets.jimDomain}";
|
||||
PUFFER_PANEL_EMAIL_PROVIDER = "smtp";
|
||||
PUFFER_PANEL_EMAIL_HOST = "mx.${outputs.secrets.jimDomain}:587";
|
||||
PUFFER_PANEL_EMAIL_FROM = "noreply@${outputs.secrets.jimDomain}";
|
||||
PUFFER_PANEL_EMAIL_USERNAME = "noreply@${outputs.secrets.jimDomain}";
|
||||
PUFFER_PANEL_EMAIL_PASSWORD = outputs.secrets.noreplyPassword;
|
||||
};
|
||||
extraPackages = with pkgs; [ bash curl gawk gnutar gzip ];
|
||||
package = pkgs.buildFHSEnv {
|
||||
name = "pufferpanel-fhs";
|
||||
meta.mainProgram = "pufferpanel-fhs";
|
||||
runScript = lib.getExe pkgs.pufferpanel;
|
||||
targetPkgs = pkgs': with pkgs'; [ icu openssl zlib ];
|
||||
};
|
||||
};
|
||||
nginx.virtualHosts."panel.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:5010";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
{outputs, ...}: {
|
||||
services = {
|
||||
lemmy = {
|
||||
enable = true;
|
||||
nginx.enable = true;
|
||||
database.createLocally = true;
|
||||
settings = {
|
||||
hostname = "lemmy.${outputs.secrets.jimDomain}";
|
||||
email = {
|
||||
smtp_server = "mx.${outputs.secrets.jimDomain}:587";
|
||||
smtp_login = "noreply@${outputs.secrets.jimDomain}";
|
||||
smtp_from_address = "Jimbo's Lemmy <noreply@${outputs.secrets.jimDomain}>";
|
||||
smtp_password = outputs.secrets.noreplyPassword;
|
||||
tls_type = "starttls";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Add SSL to webpage
|
||||
nginx.virtualHosts."lemmy.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
{outputs, ...}: {
|
||||
services.matrix-appservice-discord = {
|
||||
enable = true;
|
||||
settings = {
|
||||
auth = {
|
||||
clientID = "${outputs.secrets.discordBotID}";
|
||||
botToken = "${outputs.secrets.discordBotToken}";
|
||||
usePrivilegedIntents = true;
|
||||
};
|
||||
bridge = {
|
||||
domain = "${outputs.secrets.jimDomain}";
|
||||
homeserverUrl = "https://matrix.${outputs.secrets.jimDomain}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
# Install programs system-wide
|
||||
environment.systemPackages = with pkgs; [
|
||||
mdadm
|
||||
];
|
||||
services = {
|
||||
snowflake-proxy.enable = true;
|
||||
logrotate.checkConfig = false;
|
||||
};
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{outputs, ...}: {
|
||||
services = {
|
||||
owncast = {
|
||||
enable = true;
|
||||
port = 8060;
|
||||
rtmp-port = 1945;
|
||||
listen = "0.0.0.0";
|
||||
};
|
||||
nginx.virtualHosts."live.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:8060";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
{pkgs, outputs, ...}: {
|
||||
services = {
|
||||
# Synapse Matrix server
|
||||
matrix-synapse = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server_name = "${outputs.secrets.jimDomain}";
|
||||
public_baseurl = "https://matrix.${outputs.secrets.jimDomain}";
|
||||
suppress_key_server_warning = true;
|
||||
|
||||
# Set the network config
|
||||
listeners = [{
|
||||
port = 8008;
|
||||
bind_addresses = [ "::" "0.0.0.0" ];
|
||||
resources = [ { compress = false; names = [ "client" "federation" ]; } ];
|
||||
type = "http";
|
||||
tls = false;
|
||||
x_forwarded = true;
|
||||
}];
|
||||
|
||||
# Enable smtp for password resets
|
||||
email = {
|
||||
notif_from = "Jimbo's Matrix <noreply@${outputs.secrets.jimDomain}>";
|
||||
smtp_host = "mx.${outputs.secrets.jimDomain}";
|
||||
smtp_user = "noreply@${outputs.secrets.jimDomain}";
|
||||
smtp_pass = outputs.secrets.noreplyPassword;
|
||||
enable_tls = true;
|
||||
smtp_port = 587;
|
||||
require_transport_security = true;
|
||||
};
|
||||
|
||||
# Allows a Discord/Matrix bridge, comment on first use and copy using instructions
|
||||
app_service_config_files = [
|
||||
# cp /var/lib/matrix-appservice-discord/discord-registration.yaml /var/lib/matrix-synapse/
|
||||
# chown matrix-synapse:matrix-synapse /var/lib/matrix-synapse/discord-registration.yaml
|
||||
"/var/lib/matrix-synapse/discord-registration.yaml"
|
||||
];
|
||||
|
||||
# Disable registration without email
|
||||
registrations_require_3pid = [ "email" ];
|
||||
|
||||
# Allow only this range of emails
|
||||
allowed_local_3pids = [{
|
||||
medium = "email";
|
||||
pattern = "^[^@]+@jimbosfiles\\.com$";
|
||||
}];
|
||||
|
||||
# Set the type of database
|
||||
database.name = "sqlite3";
|
||||
|
||||
# Allow account registration
|
||||
enable_registration = true;
|
||||
|
||||
# General settings
|
||||
url_preview_enabled = true;
|
||||
max_upload_size = "50M";
|
||||
report_stats = false;
|
||||
|
||||
# Ratelimiting
|
||||
burst_count = 15;
|
||||
};
|
||||
};
|
||||
|
||||
# Sliding sync proxy for Matrix
|
||||
matrix-sliding-sync = let
|
||||
matrixSecretFile = pkgs.writeText "matrixsecret" ''
|
||||
SYNCV3_SECRET=${outputs.secrets.matrixSecret}
|
||||
'';
|
||||
in {
|
||||
enable = true;
|
||||
settings = {
|
||||
SYNCV3_SERVER = "https://matrix.${outputs.secrets.jimDomain}";
|
||||
SYNCV3_BINDADDR = "0.0.0.0:8009";
|
||||
};
|
||||
environmentFile = "${matrixSecretFile}";
|
||||
};
|
||||
|
||||
# Proxy for both Synapse and Sliding Sync
|
||||
nginx.virtualHosts."matrix.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations = {
|
||||
"/".extraConfig = ''return 403;'';
|
||||
"/client".proxyPass = "http://127.0.0.1:8009";
|
||||
"/_matrix".proxyPass = "http://127.0.0.1:8008";
|
||||
"/_matrix/client/unstable/org.matrix.msc3575/sync".proxyPass = "http://127.0.0.1:8009";
|
||||
"/_synapse/client".proxyPass = "http://127.0.0.1:8008";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{pkgs, outputs, ...}: {
|
||||
services = {
|
||||
transmission = {
|
||||
enable = true;
|
||||
credentialsFile = pkgs.writeText "credentials" outputs.secrets.transmissionCredFile;
|
||||
openPeerPorts = true;
|
||||
settings = {
|
||||
rpc-authentication-required = true;
|
||||
};
|
||||
};
|
||||
nginx.virtualHosts."torrent.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:9091";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
{outputs, ...}: {
|
||||
services = {
|
||||
vaultwarden = {
|
||||
enable = true;
|
||||
config = {
|
||||
DOMAIN = "https://warden.${outputs.secrets.jimDomain}";
|
||||
SIGNUPS_ALLOWED = false;
|
||||
ROCKET_ADDRESS = "127.0.0.1";
|
||||
ROCKET_PORT = 8222;
|
||||
ROCKET_LOG = "critical";
|
||||
|
||||
# Smtp email
|
||||
SMTP_HOST = "mx.${outputs.secrets.jimDomain}";
|
||||
SMTP_FROM = "Jimbo's Vaultwarden <noreply@${outputs.secrets.jimDomain}>";
|
||||
SMTP_FROM_NAME = "Vaultwarden";
|
||||
SMTP_USERNAME = "noreply@${outputs.secrets.jimDomain}";
|
||||
SMTP_PASSWORD = outputs.secrets.noreplyPassword;
|
||||
SMTP_SECURITY = "starttls";
|
||||
SMTP_PORT = 587;
|
||||
SMTP_TIMEOUT = 15;
|
||||
};
|
||||
};
|
||||
nginx.virtualHosts."warden.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:8222";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{outputs, ...}: {
|
||||
{ outputs, ... }: {
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = outputs.secrets.jimEmail;
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, outputs, ...}: {
|
||||
{ pkgs, outputs, ... }: {
|
||||
# Dynamic IPs for Cloudflare records
|
||||
services.ddclient = {
|
||||
enable = true;
|
6
system/services/fileserver/default.nix
Normal file
6
system/services/fileserver/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./local
|
||||
./public
|
||||
];
|
||||
}
|
6
system/services/fileserver/local/default.nix
Normal file
6
system/services/fileserver/local/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./nfs
|
||||
./samba
|
||||
];
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
{ ... }: {
|
||||
services.nfs.server = {
|
||||
enable = true;
|
||||
exports = ''
|
|
@ -1,4 +1,4 @@
|
|||
{outputs, ...}: {
|
||||
{ outputs, ... }: {
|
||||
services = {
|
||||
samba = {
|
||||
enable = true;
|
6
system/services/fileserver/public/default.nix
Normal file
6
system/services/fileserver/public/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./nextcloud
|
||||
./photoprism
|
||||
];
|
||||
}
|
|
@ -14,8 +14,6 @@
|
|||
trusted_proxies = [ "127.0.0.1" ];
|
||||
trusted_domains = [ "cloud.${outputs.secrets.jimDomain}" ];
|
||||
overwriteprotocol = "https";
|
||||
|
||||
# Mailserver settings
|
||||
mail_smtphost = "mx.${outputs.secrets.jimDomain}";
|
||||
mail_domain = "${outputs.secrets.jimDomain}";
|
||||
mail_from_address = "noreply";
|
||||
|
@ -26,6 +24,7 @@
|
|||
mail_smtpport = 587;
|
||||
};
|
||||
};
|
||||
|
||||
nginx.virtualHosts."cloud.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
addSSL = true;
|
|
@ -1,4 +1,4 @@
|
|||
{outputs, ...}: {
|
||||
{ outputs, ... }: {
|
||||
services = {
|
||||
photoprism = {
|
||||
enable = true;
|
|
@ -1,4 +1,4 @@
|
|||
{outputs, ...}: {
|
||||
{ outputs, ... }: {
|
||||
# Allow forwarding
|
||||
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
# This is a hard fork of Gitea.
|
||||
{outputs, ...}: {
|
||||
{ outputs, ... }: {
|
||||
imports = [
|
||||
./nginx
|
||||
];
|
||||
|
||||
services = {
|
||||
forgejo = {
|
||||
enable = true;
|
||||
|
@ -28,14 +31,6 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
nginx.virtualHosts."git.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:3110";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Allow Forgejo's SSH to work
|
10
system/services/forgejo/nginx/default.nix
Normal file
10
system/services/forgejo/nginx/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ outputs, ... }: {
|
||||
services.nginx.virtualHosts."git.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:3110";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
}
|
7
system/services/garbage-collection/default.nix
Normal file
7
system/services/garbage-collection/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ ... }: {
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 1w";
|
||||
};
|
||||
}
|
|
@ -1,14 +1,16 @@
|
|||
{pkgs, outputs, ...}: {
|
||||
# Icecast, replacing Azuracast maybe
|
||||
{ pkgs, outputs, ... }: {
|
||||
imports = [
|
||||
./nginx
|
||||
];
|
||||
|
||||
services = {
|
||||
# The host service
|
||||
icecast = {
|
||||
enable = true;
|
||||
listen.port = 265;
|
||||
hostname = "icecast.${outputs.secrets.jimDomain}";
|
||||
admin = {
|
||||
user = "jimbo";
|
||||
password = "${outputs.secrets.castAdminPass}";
|
||||
password = "${outputs.secrets.castAdminPass}";
|
||||
};
|
||||
extraConf = ''
|
||||
<authentication>
|
||||
|
@ -31,9 +33,8 @@
|
|||
};
|
||||
|
||||
# The audio stream
|
||||
liquidsoap.streams = let
|
||||
JimBops = ''
|
||||
# CONFIGURATION
|
||||
liquidsoap.streams = {
|
||||
jimbops = pkgs.writeText "liquidjim" ''
|
||||
settings.log.stdout.set(true)
|
||||
settings.init.allow_root.set(true)
|
||||
settings.scheduler.fast_queues.set(2)
|
||||
|
@ -58,21 +59,6 @@
|
|||
jimbops_fallback
|
||||
)
|
||||
'';
|
||||
in {
|
||||
jimbops = pkgs.writeText "liquidjim" JimBops;
|
||||
};
|
||||
|
||||
# The web frontend
|
||||
nginx.virtualHosts."icecast.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:265";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
add_header Ice-Public "1";
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
13
system/services/icecast/nginx/default.nix
Normal file
13
system/services/icecast/nginx/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ pkgs, outputs, ... }: {
|
||||
services.nginx.virtualHosts."icecast.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:265";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
add_header Ice-Public "1";
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,5 +1,9 @@
|
|||
{pkgs, outputs, ...}: rec {
|
||||
# Mail server
|
||||
{ pkgs, outputs, ... }: rec {
|
||||
imports = [
|
||||
./nginx
|
||||
./roundcube
|
||||
];
|
||||
|
||||
mailserver = rec {
|
||||
enable = true;
|
||||
openFirewall = false;
|
||||
|
@ -39,30 +43,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
# Related services
|
||||
services = {
|
||||
# Roundcube mail server
|
||||
roundcube = {
|
||||
enable = true;
|
||||
hostName = "mail.${outputs.secrets.jimDomain}";
|
||||
extraConfig = ''
|
||||
$config['smtp_server'] = "tls://${mailserver.fqdn}";
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
'';
|
||||
};
|
||||
|
||||
# Force the mailserver to use a different redis port
|
||||
redis.servers.rspamd.port = 1515;
|
||||
|
||||
# The hostname mail ports use
|
||||
nginx.virtualHosts."mx.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:1390";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
# Assign the correct port
|
||||
services.redis.servers.rspamd.port = 1515;
|
||||
}
|
10
system/services/mailserver/nginx/default.nix
Normal file
10
system/services/mailserver/nginx/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ pkgs, outputs, ... }: rec {
|
||||
services.nginx.virtualHosts."mx.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:1390";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
}
|
11
system/services/mailserver/roundcube/default.nix
Normal file
11
system/services/mailserver/roundcube/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ pkgs, outputs, ... }: rec {
|
||||
services.roundcube = {
|
||||
enable = true;
|
||||
hostName = "mail.${outputs.secrets.jimDomain}";
|
||||
extraConfig = ''
|
||||
$config['smtp_server'] = "tls://${mailserver.fqdn}";
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,13 +1,14 @@
|
|||
{inputs, ...}: {
|
||||
{ inputs, ... }: {
|
||||
imports = [
|
||||
inputs.minecraft.nixosModules.minecraft-servers
|
||||
./servers/velocity.nix
|
||||
./servers/dewdemolisher.nix
|
||||
./servers/johnside.nix
|
||||
./servers/roguecraft.nix
|
||||
#./servers/blockworld.nix
|
||||
#./servers/uberbeta.nix
|
||||
./servers/velocity
|
||||
./servers/dewdemolisher
|
||||
./servers/johnside
|
||||
./servers/roguecraft
|
||||
./servers/blockworld
|
||||
./servers/uberbeta
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [ inputs.minecraft.overlay ];
|
||||
|
||||
services.minecraft-servers = {
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, ...}: let
|
||||
{ pkgs, ... }: let
|
||||
common = import ../common.nix { inherit pkgs; };
|
||||
in {
|
||||
services.minecraft-servers.servers.blockworld = {
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, ...}: let
|
||||
{ pkgs, ... }: let
|
||||
common = import ../common.nix { inherit pkgs; };
|
||||
in {
|
||||
services.minecraft-servers.servers.dewdemolisher = {
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, outputs, ...}: let
|
||||
{ pkgs, outputs, ... }: let
|
||||
common = import ../common.nix { inherit pkgs; };
|
||||
in {
|
||||
services = {
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, outputs, ...}: let
|
||||
{ pkgs, outputs, ... }: let
|
||||
common = import ../common.nix { inherit pkgs; };
|
||||
in {
|
||||
services = {
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, ...}: let
|
||||
{ pkgs, ... }: let
|
||||
common = import ../common.nix { inherit pkgs; };
|
||||
uberBukkitZip = pkgs.fetchzip {
|
||||
url = "https://github.com/Moresteck/Project-Poseidon-Uberbukkit/releases/download/2.0.0/uberbukkit-2.0.0-java17.zip";
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, ...}: let
|
||||
{ pkgs, ... }: let
|
||||
common = import ../common.nix { inherit pkgs; };
|
||||
in {
|
||||
services.minecraft-servers.servers.velocity = {
|
6
system/services/misc/pc/default.nix
Normal file
6
system/services/misc/pc/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{pkgs, ...}: {
|
||||
services = {
|
||||
gvfs.enable = true;
|
||||
udisks2.enable = true;
|
||||
};
|
||||
}
|
6
system/services/misc/server/default.nix
Normal file
6
system/services/misc/server/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }: {
|
||||
services = {
|
||||
snowflake-proxy.enable = true;
|
||||
logrotate.checkConfig = false;
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{config, pkgs, ...}: {
|
||||
{ config, pkgs, ... }: {
|
||||
services.mpd = {
|
||||
enable = true;
|
||||
user = "jimbo";
|
||||
|
@ -12,6 +12,7 @@
|
|||
}
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.services.mpd.environment = {
|
||||
XDG_RUNTIME_DIR = "/run/user/${toString config.users.users.jimbo.uid}";
|
||||
};
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, ...}: {
|
||||
{ pkgs, ... }: {
|
||||
services.mysql = {
|
||||
enable = true;
|
||||
package = pkgs.mariadb;
|
|
@ -1,4 +1,4 @@
|
|||
{pkgs, outputs, ...}: {
|
||||
{ pkgs, outputs, ... }: {
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
package = (pkgs.nginx.override {
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue