aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/caladan
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/caladan')
-rw-r--r--hosts/caladan/default.nix171
-rw-r--r--hosts/caladan/disks.nix132
-rw-r--r--hosts/caladan/hardware-configuration.nix57
-rw-r--r--hosts/caladan/services.nix35
4 files changed, 395 insertions, 0 deletions
diff --git a/hosts/caladan/default.nix b/hosts/caladan/default.nix
new file mode 100644
index 0000000..5ec1e96
--- /dev/null
+++ b/hosts/caladan/default.nix
@@ -0,0 +1,171 @@
+{ config, inputs, outputs, pkgs, ... }: {
+ boot = {
+ initrd.kernelModules = [ "amdgpu" "zfs" ];
+ kernelPackages = pkgs.master.linuxPackages_6_14;
+ kernelParams = [
+ "amdgpu.ppfeaturemask=0xfffd3fff"
+ "split_lock_detect=off"
+ ];
+ loader = {
+ efi = {
+ canTouchEfiVariables = true;
+ efiSysMountPoint = "/efiboot/efi1";
+ };
+ systemd-boot = {
+ enable = true;
+ extraInstallCommands = ''
+ ${pkgs.rsync}/bin/rsync -av --delete /efiboot/efi1/ /efiboot/efi2
+ '';
+ };
+ timeout = 3;
+ };
+ supportedFilesystems = [ "zfs" ];
+ zfs.package = pkgs.master.zfs;
+ };
+
+ environment.systemPackages = [
+ pkgs.angband
+ #pkgs.assaultcube
+ pkgs.bsdgames
+ pkgs.bzflag
+ pkgs.extremetuxracer
+ pkgs.fastfetch
+ #pkgs.frozen-bubble
+ pkgs.hedgewars
+ pkgs.kobodeluxe
+ pkgs.mailutils
+ pkgs.moc
+ pkgs.nethack
+ #pkgs.openttd
+ pkgs.qbittorrent-nox
+ pkgs.rdiff-backup
+ #pkgs.scorched3d
+ pkgs.signal-desktop
+ pkgs.superTux
+ pkgs.superTuxKart
+ pkgs.umoria
+ pkgs.vial
+ pkgs.warzone2100
+ #pkgs.wine9_22.wineWowPackages.stagingFull
+ pkgs.wpa_supplicant
+ pkgs.xonotic-sdl
+ #pkgs.xpilot-ng
+ ];
+
+ imports = [
+ ./disks.nix
+ ./hardware-configuration.nix
+ ./services.nix
+ ../common/core
+ ../common/optional/adb.nix
+ ../common/optional/db.nix
+ ../common/optional/dev.nix
+ ../common/optional/ebooks.nix
+ ../common/optional/games.nix
+ ../common/optional/google-authenticator.nix
+ ../common/optional/misc.nix
+ ../common/optional/multimedia.nix
+ ../common/optional/pipewire.nix
+ ../common/optional/sdr.nix
+ ../common/optional/services/chrony.nix
+ ../common/optional/services/openssh.nix
+ ../common/optional/services/xorg.nix
+ ../common/optional/sound.nix
+ ../common/optional/wdt.nix
+ ../common/optional/zfs.nix
+ ../common/users/nipsy
+ ../common/users/root
+ ];
+
+ networking = {
+ defaultGateway = {
+ address = "192.168.1.1";
+ interface = "wlp15s0";
+ };
+ domain = "bitgnome.net";
+ hostId = "8981d1e5";
+ hostName = "caladan";
+ interfaces = {
+ wlp15s0 = {
+ ipv4.addresses = [
+ { address = "192.168.1.4"; prefixLength = 24; }
+ ];
+ };
+ };
+ nameservers = [ "192.168.1.1" ];
+ nftables.enable = true;
+ useDHCP = false;
+ wireless = {
+ enable = true;
+ networks = {
+ "Crystal Palace" = {
+ pskRaw = "ext:psk_crystal_palace";
+ };
+ };
+ secretsFile = "${config.sops.secrets."wpa_supplicant".path}";
+ };
+ };
+
+ nixpkgs = {
+ config = {
+ allowUnfree = true;
+ };
+ hostPlatform = "x86_64-linux";
+ overlays = [
+ #inputs.nvidia-patch.overlays.default
+ outputs.overlays.additions
+ outputs.overlays.modifications
+ outputs.overlays.master-packages
+ outputs.overlays.stable-packages
+ #outputs.overlays.wine9_22-packages
+ ];
+ };
+
+ services.openssh.settings.X11Forwarding = true;
+ services.xserver.videoDrivers = [ "amdgpu" ];
+
+ sops = {
+ age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
+ defaultSopsFile = ../secrets/caladan.yaml;
+
+ secrets = {
+ "nftables/ssh" = {};
+ "nix-access-token-github" = {};
+ "ssh_config".path = "/root/.ssh/config";
+ "wpa_supplicant" = {};
+ };
+ };
+
+ system.stateVersion = "23.11";
+
+ systemd.services = {
+
+ "nftables-extra" = let rules_script = ''
+ ${pkgs.nftables}/bin/nft insert rule inet nixos-fw input 'iifname "enp6s0" udp dport { 2456, 2457 } counter accept # Valheim dedicated server'
+ ${pkgs.nftables}/bin/nft insert rule inet nixos-fw input 'iifname "enp6s0" udp dport 5121 counter accept # Neverwinter Nights Server'
+ ${pkgs.nftables}/bin/nft insert rule inet nixos-fw input 'iifname "enp6s0" udp dport 15637 counter accept # Enshrouded'
+ ${pkgs.nftables}/bin/nft insert rule inet nixos-fw input 'iifname "enp6s0" ip saddr 192.168.1.0/24 udp dport { 27031, 27036 } counter accept # Steam Remote Play'
+ ${pkgs.nftables}/bin/nft insert rule inet nixos-fw input 'iifname "enp6s0" ip saddr 192.168.1.0/24 tcp dport { 27036, 27037 } counter accept # Steam Remote Play'
+ ${pkgs.nftables}/bin/nft -f ${config.sops.secrets."nftables/ssh".path}
+ ''; in {
+ description = "nftables extra firewall rules";
+ reload = rules_script;
+ script = rules_script;
+ serviceConfig = {
+ RemainAfterExit = true;
+ Type = "oneshot";
+ };
+ unitConfig = {
+ ConditionPathExists = [
+ config.sops.secrets."nftables/ssh".path
+ ];
+ ReloadPropagatedFrom = "nftables.service";
+ };
+ wantedBy = [ "multi-user.target" ];
+ after = [ "nftables.service" ];
+ partOf = [ "nftables.service" ];
+ };
+
+ };
+
+}
diff --git a/hosts/caladan/disks.nix b/hosts/caladan/disks.nix
new file mode 100644
index 0000000..8961361
--- /dev/null
+++ b/hosts/caladan/disks.nix
@@ -0,0 +1,132 @@
+{
+ disko.devices = {
+ disk = {
+ nvme0n1 = {
+ type = "disk";
+ device = "/dev/disk/by-id/nvme-CT4000P3PSSD8_2512E9B12C42";
+ content = {
+ type = "gpt";
+ partitions = {
+ ESP = {
+ size = "1G";
+ type = "EF00";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/efiboot/efi1";
+ mountOptions = [ "X-mount.mkdir" "umask=0077" ];
+ extraArgs = [ "-nESP1" ];
+ };
+ };
+ swap = {
+ size = "32G";
+ type = "8200";
+ content = {
+ type = "swap";
+ extraArgs = [ "-L swap1" ];
+ };
+ };
+ zfs = {
+ size = "100%";
+ content = {
+ type = "zfs";
+ pool = "rpool";
+ };
+ };
+ };
+ };
+ };
+ nvme1n1 = {
+ type = "disk";
+ device = "/dev/disk/by-id/nvme-CT4000P3PSSD8_2512E9B12C44";
+ content = {
+ type = "gpt";
+ partitions = {
+ ESP = {
+ size = "1G";
+ type = "EF00";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/efiboot/efi2";
+ mountOptions = [ "X-mount.mkdir" "umask=0077" ];
+ extraArgs = [ "-nESP2" ];
+ };
+ };
+ swap = {
+ size = "32G";
+ type = "8200";
+ content = {
+ type = "swap";
+ extraArgs = [ "-L swap2" ];
+ };
+ };
+ zfs = {
+ size = "100%";
+ content = {
+ type = "zfs";
+ pool = "rpool";
+ };
+ };
+ };
+ };
+ };
+ };
+ zpool = {
+ rpool = {
+ mode = "mirror";
+ type = "zpool";
+ rootFsOptions = {
+ acltype = "posixacl";
+ canmount = "off";
+ compression = "on";
+ dnodesize = "auto";
+ relatime = "on";
+ xattr = "sa";
+ };
+ options = {
+ ashift = "12";
+ autotrim = "on";
+ };
+ datasets = {
+ "local" = {
+ type = "zfs_fs";
+ options.mountpoint = "none";
+ };
+ "local/root" = {
+ type = "zfs_fs";
+ options.mountpoint = "legacy";
+ mountpoint = "/";
+ };
+ "local/nix" = {
+ type = "zfs_fs";
+ options = {
+ atime = "off";
+ mountpoint = "legacy";
+ };
+ mountpoint = "/nix";
+ };
+ "user" = {
+ type = "zfs_fs";
+ options.mountpoint = "none";
+ };
+ "user/home" = {
+ type = "zfs_fs";
+ options.mountpoint = "legacy";
+ mountpoint = "/home";
+ };
+ "user/home/root" = {
+ type = "zfs_fs";
+ options.mountpoint = "legacy";
+ mountpoint = "/root";
+ };
+ "user/home/nipsy" = {
+ type = "zfs_fs";
+ options.mountpoint = "legacy";
+ mountpoint = "/home/nipsy";
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/hosts/caladan/hardware-configuration.nix b/hosts/caladan/hardware-configuration.nix
new file mode 100644
index 0000000..de0e516
--- /dev/null
+++ b/hosts/caladan/hardware-configuration.nix
@@ -0,0 +1,57 @@
+# Do not modify this file! It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations. Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, inputs, lib, outputs, pkgs, modulesPath, ... }:
+
+{
+ imports =
+ [ #(modulesPath + "/installer/scan/not-detected.nix")
+ ];
+
+ boot = {
+ extraModulePackages = [ ];
+ initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ];
+ initrd.kernelModules = [ ];
+ kernelModules = [ "kvm-amd" ];
+ #zfs.extraPools = [ "data" ];
+ };
+
+ environment.sessionVariables = {
+ #LIBVA_DRIVER_NAME = "nvidia";
+ MOZ_DISABLE_RDD_SANDBOX = "1";
+ };
+
+ hardware = {
+ bluetooth.enable = true;
+
+ graphics = {
+ enable = true;
+ #extraPackages = [ pkgs.nvidia-vaapi-driver ];
+ #extraPackages32 = [ pkgs.pkgsi686Linux.nvidia-vaapi-driver ];
+ };
+
+ #nvidia = let
+ # betaPkg = config.boot.kernelPackages.nvidiaPackages.beta;
+ # pkgAfterFbc = if builtins.hasAttr betaPkg.version pkgs.nvidia-patch-list.fbc then pkgs.nvidia-patch.patch-fbc betaPkg else betaPkg;
+ # finalPkg = if builtins.hasAttr betaPkg.version pkgs.nvidia-patch-list.nvenc then pkgs.nvidia-patch.patch-nvenc pkgAfterFbc else pkgAfterFbc;
+ #in {
+ # modesetting.enable = true;
+ # open = true;
+ # package = if finalPkg == betaPkg then betaPkg else finalPkg;
+ #};
+
+ printers = let
+ brother = "Brother_HL-L2340D";
+ ip = "192.168.1.20";
+ in {
+ ensureDefaultPrinter = brother;
+ ensurePrinters = [{
+ name = brother;
+ deviceUri = "ipp://${ip}/ipp";
+ model = "everywhere";
+ description = lib.replaceStrings [ "_" ] [ " " ] brother;
+ location = "home";
+ }];
+ };
+ };
+}
diff --git a/hosts/caladan/services.nix b/hosts/caladan/services.nix
new file mode 100644
index 0000000..4644188
--- /dev/null
+++ b/hosts/caladan/services.nix
@@ -0,0 +1,35 @@
+{ config, lib, pkgs, ... }: {
+
+ services = {
+
+ clamav.updater.enable = true;
+
+ cron.enable = true;
+
+ dictd.enable = true;
+
+ iperf3.openFirewall = true;
+
+ printing.enable = true;
+
+ #smartd = let my_email_addr = "nipsy@bitgnome.net"; in {
+ # enable = true;
+ # devices = [
+ # {
+ # device = "/dev/disk/by-id/nvme-WD_BLACK_SN850X_4000GB_23162P800005";
+ # options = "-a -o on -S on -m ${my_email_addr}";
+ # }
+ # {
+ # device = "/dev/disk/by-id/nvme-WD_BLACK_SN850X_4000GB_23162P800014";
+ # options = "-a -o on -S on -m ${my_email_addr}";
+ # }
+ # ];
+ #};
+
+ udev.packages = [
+ pkgs.vial
+ ];
+
+ };
+
+}