Make a hosts folder for system and home, remove legacy.nix cause I never used it, change some comments

This commit is contained in:
Jimbo 2024-10-02 21:35:29 -04:00
parent 1a096662e1
commit d9469fc321
36 changed files with 380 additions and 402 deletions

View file

@ -0,0 +1,63 @@
{
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";
}

View file

@ -0,0 +1,110 @@
{ 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";
}