From 9f61ec8200365405cf4053e233a741b9e13d6ddd Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Mon, 10 Aug 2026 22:02:49 -0400 Subject: [PATCH 1/6] add: add estinien configuration --- modules/machine/estinien/configuration.nix | 104 ++++++++++++++++++ modules/machine/estinien/default.nix | 6 + .../estinien/hardware-configuration.nix | 0 3 files changed, 110 insertions(+) create mode 100644 modules/machine/estinien/configuration.nix create mode 100644 modules/machine/estinien/default.nix create mode 100644 modules/machine/estinien/hardware-configuration.nix diff --git a/modules/machine/estinien/configuration.nix b/modules/machine/estinien/configuration.nix new file mode 100644 index 0000000..25c03ee --- /dev/null +++ b/modules/machine/estinien/configuration.nix @@ -0,0 +1,104 @@ +{ + pkgs, + userName, + nur, + ... +}: let + nurPkgs = import "${nur.outPath}/pkgs" { + inherit pkgs; + hildibrand = nur.inputs.hildibrand.packages.${pkgs.stdenv.hostPlatform.system}.default; + }; +in { + imports = [ + ../../pwrMgmt + ../../networking/core.nix + ]; + + # Enable flakes for NixOS + nix.settings.experimental-features = ["nix-command" "flakes"]; + + # Custom kernel/boot stuff + boot.kernelPackages = pkgs.linuxPackages_latest; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Set your timezone + time.timeZone = "America/Detroit"; + + # Enable OpenSSH + services.openssh.enable = true; + + # Enable keyring + services.gnome.gnome-keyring.enable = true; + + # Enable GnuPG + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + # Enable SUID wrappers (some programs need them) + programs.mtr.enable = true; + + # Enable Polkit + security.polkit.enable = true; + + # Power management (see ../../pwrMgmt/default.nix) + pwrMgmt = { + enable = true; + cpuFreqGovernor = "performance"; + powertop.enable = false; + }; + + network = { + firewall = { + enable = true; + }; + networkManager.enable = true; + }; + + environment.systemPackages = [ + nurPkgs.hildibrand + ]; + + systemd.services.vintagestory-server = { + description = "Vintage Story Server"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + serviceConfig = { + Type = "simple"; + User = userName; + WorkingDirectory = "/home/${userName}"; + ExecStart = "${nurPkgs.hildibrand}/bin/hildibrand"; + Restart = "on-failure"; + RestartSec = "5s"; + }; + }; + + # Add username to groups "wheel" and "video" - more may be added here later + users = { + groups.hazel = {}; + users = { + ${userName} = { + extraGroups = [ "wheel" "network" ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFV9eSc9L+aJLoKoexq2f/jb5rpyZnhuGiyhS8YQAbaS wyatt@wyattjmiller.com" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO4WKvKnnYpTbzZHFEslOKyfiiMqWxhW3AfX6E7ACmYU wyatt@wyattjmiller.com" + ]; + }; + }; + }; + + services.fail2ban = { + enable = true; + package = pkgs.fail2ban; + maxretry = 5; + bantime = "3h"; + bantime-increment = { + enable = true; + rndtime = "10m"; + }; + }; + + system.stateVersion = "24.11"; +} diff --git a/modules/machine/estinien/default.nix b/modules/machine/estinien/default.nix new file mode 100644 index 0000000..3c4d411 --- /dev/null +++ b/modules/machine/estinien/default.nix @@ -0,0 +1,6 @@ +{ ... }: { + imports = [ + ./configuration.nix + ./hardware-configuration.nix + ]; +} diff --git a/modules/machine/estinien/hardware-configuration.nix b/modules/machine/estinien/hardware-configuration.nix new file mode 100644 index 0000000..e69de29 From 7bc8e821b5ca46a320c608292d2a11023dd354eb Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Mon, 10 Aug 2026 22:36:24 -0400 Subject: [PATCH 2/6] mod: adjust flake to add new config --- flake.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/flake.nix b/flake.nix index c41215c..8ce2878 100644 --- a/flake.nix +++ b/flake.nix @@ -213,6 +213,32 @@ ]; }; + # Discord bot server + nixosConfigurations."estinien" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit userName userEmail; + hostname = "estinien"; + role = "server"; + }; + modules = [ + myOverlays + ./modules/common + ./modules/machine/estinien + + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = extraSpecialArgs // { isNixOS = true; role = "server"; }; + home-manager.backupFileExtension = "bak"; + home-manager.users.${userName}.imports = [ + ./home + ]; + } + ]; + }; + # generic non-NixOS Linux machine homeConfigurations."generic" = let hostname = builtins.getEnv "HOSTNAME"; From fee14618b8a5967af93a205c1b9d0073a5452d38 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Mon, 10 Aug 2026 22:44:07 -0400 Subject: [PATCH 3/6] mod: added input --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 8ce2878..6caf02c 100644 --- a/flake.nix +++ b/flake.nix @@ -191,7 +191,7 @@ nixosConfigurations."yshtola" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { - inherit userName userEmail; + inherit userName userEmail nur; hostname = "yshtola"; role = "server"; }; From 0769fe1e0d33e6a5adbf5bb1f4b6d3f942c959df Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Mon, 10 Aug 2026 23:01:53 -0400 Subject: [PATCH 4/6] mod: adjusted again --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 6caf02c..57559ab 100644 --- a/flake.nix +++ b/flake.nix @@ -191,7 +191,7 @@ nixosConfigurations."yshtola" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { - inherit userName userEmail nur; + inherit userName userEmail; hostname = "yshtola"; role = "server"; }; @@ -217,7 +217,7 @@ nixosConfigurations."estinien" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { - inherit userName userEmail; + inherit userName userEmail nur; hostname = "estinien"; role = "server"; }; From 04518129d50cdf8269399ff099e5bc2d87a859d0 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Mon, 10 Aug 2026 23:38:39 -0400 Subject: [PATCH 5/6] mod: adjusted hildibrand --- modules/machine/estinien/configuration.nix | 16 +++------- .../estinien/hardware-configuration.nix | 32 +++++++++++++++++++ 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/modules/machine/estinien/configuration.nix b/modules/machine/estinien/configuration.nix index 25c03ee..2074082 100644 --- a/modules/machine/estinien/configuration.nix +++ b/modules/machine/estinien/configuration.nix @@ -3,12 +3,7 @@ userName, nur, ... -}: let - nurPkgs = import "${nur.outPath}/pkgs" { - inherit pkgs; - hildibrand = nur.inputs.hildibrand.packages.${pkgs.stdenv.hostPlatform.system}.default; - }; -in { +}: { imports = [ ../../pwrMgmt ../../networking/core.nix @@ -58,18 +53,18 @@ in { }; environment.systemPackages = [ - nurPkgs.hildibrand + nur.packages.${pkgs.stdenv.hostPlatform.system}.hildibrand ]; - systemd.services.vintagestory-server = { - description = "Vintage Story Server"; + systemd.services.hildibrand = { + description = "Hildibrand - trivia buzzer bot"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; serviceConfig = { Type = "simple"; User = userName; WorkingDirectory = "/home/${userName}"; - ExecStart = "${nurPkgs.hildibrand}/bin/hildibrand"; + ExecStart = "${nur.packages.${pkgs.stdenv.hostPlatform.system}.hildibrand}/bin/hildibrand"; Restart = "on-failure"; RestartSec = "5s"; }; @@ -77,7 +72,6 @@ in { # Add username to groups "wheel" and "video" - more may be added here later users = { - groups.hazel = {}; users = { ${userName} = { extraGroups = [ "wheel" "network" ]; diff --git a/modules/machine/estinien/hardware-configuration.nix b/modules/machine/estinien/hardware-configuration.nix index e69de29..b4e90ba 100644 --- a/modules/machine/estinien/hardware-configuration.nix +++ b/modules/machine/estinien/hardware-configuration.nix @@ -0,0 +1,32 @@ +# 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, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/498ce176-f090-46d8-96bf-9e6141cffa19"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/09A6-B803"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/4a64a2ee-2b32-4e53-b00f-7b1f127162aa"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} From d7a2d4cf380c9e542645c8780b66e894d61f844d Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Tue, 11 Aug 2026 00:21:04 -0400 Subject: [PATCH 6/6] mod: update flake --- flake.lock | 91 +++++++++++++++++++--- modules/machine/estinien/configuration.nix | 8 +- 2 files changed, 86 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index 9023792..37e2f6e 100644 --- a/flake.lock +++ b/flake.lock @@ -96,6 +96,20 @@ "type": "github" } }, + "flake-schemas": { + "locked": { + "lastModified": 1780327564, + "narHash": "sha256-HiRPtA0spK+Dkgbhz/1zW9glXxNVB+L4Rj2VYmdawb8=", + "rev": "6cc9bd98891b1fc6bb2b8cb3277df8bc72799ca6", + "revCount": 149, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.5.0/019e83cf-9af3-78b1-ac5b-70e68ad1efe1/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%2A" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -197,6 +211,26 @@ "type": "github" } }, + "hildibrand": { + "inputs": { + "flake-schemas": "flake-schemas", + "nixpkgs": "nixpkgs_3", + "rust-overlay": "rust-overlay_2" + }, + "locked": { + "lastModified": 1785717646, + "narHash": "sha256-j6MlkwaYOLa3bogK4SbOnVI5eMZ9j2GdExSiKMaELPo=", + "ref": "refs/heads/master", + "rev": "9588520925513ed0e47711a5798c6e9958143a0a", + "revCount": 5, + "type": "git", + "url": "https://scm.wyattjmiller.com/wymiller/hildibrand.git" + }, + "original": { + "type": "git", + "url": "https://scm.wyattjmiller.com/wymiller/hildibrand.git" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -220,7 +254,7 @@ }, "home-manager_2": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1779507042, @@ -285,6 +319,20 @@ } }, "nixpkgs_3": { + "locked": { + "lastModified": 1784280462, + "narHash": "sha256-DtoqIqM7VkR6NxAkcLpMwmi02USwWb3JdmNGLyhthc0=", + "rev": "293d6abedf0478e681a4dfcfcb35b30fc796a32f", + "revCount": 1009740, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2605.1009740%2Brev-293d6abedf0478e681a4dfcfcb35b30fc796a32f/019f73de-20f7-7ec2-98c8-65726640dbf9/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/%2A" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1778443072, "narHash": "sha256-zi7/fsqM/kFdNuED//4WOCUtezGtKKqRNORjMvfwjnA=", @@ -300,7 +348,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1780902259, "narHash": "sha256-q8yYEC5f1mFlQO9RGna4LTc9QrcvWunX6FYp83munkQ=", @@ -316,7 +364,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1744536153, "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", @@ -336,15 +384,16 @@ "inputs": { "darwin": "darwin_2", "flake-utils": "flake-utils_2", + "hildibrand": "hildibrand", "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1783886399, - "narHash": "sha256-pcHOwEcr5xFGFRUriCdWFcBFBU5oouFW3iO65HCZ3cI=", + "lastModified": 1786304454, + "narHash": "sha256-2ovOgwFWnKqUMoQfxbobtIWQ+TSN62llX9eJVb9hFoY=", "ref": "refs/heads/master", - "rev": "b43f2ace4941315daabccc716e151a0ca47276db", - "revCount": 32, + "rev": "ea7094e4e33fbb030edf28383de37073fc8b84e0", + "revCount": 43, "type": "git", "url": "https://scm.wyattjmiller.com/wymiller/nur.git" }, @@ -362,7 +411,7 @@ "nix-flatpak": "nix-flatpak", "nixpkgs": "nixpkgs_2", "nur": "nur", - "rust-overlay": "rust-overlay_2" + "rust-overlay": "rust-overlay_3" } }, "rust-overlay": { @@ -388,7 +437,29 @@ }, "rust-overlay_2": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": [ + "nur", + "hildibrand", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1784438913, + "narHash": "sha256-NYF7ZM5ip0u+w1pBFDpIGEbrbgN/wpnLFAmBkWkYMXw=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "afacd6819d3765a05814ee8e3de74c77d42ac799", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_3": { + "inputs": { + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1783834461, diff --git a/modules/machine/estinien/configuration.nix b/modules/machine/estinien/configuration.nix index 2074082..f93bd45 100644 --- a/modules/machine/estinien/configuration.nix +++ b/modules/machine/estinien/configuration.nix @@ -3,7 +3,9 @@ userName, nur, ... -}: { +}: let + hildibrand = nur.packages.${pkgs.stdenv.hostPlatform.system}.hildibrand; + in { imports = [ ../../pwrMgmt ../../networking/core.nix @@ -53,7 +55,7 @@ }; environment.systemPackages = [ - nur.packages.${pkgs.stdenv.hostPlatform.system}.hildibrand + hildibrand ]; systemd.services.hildibrand = { @@ -64,7 +66,7 @@ Type = "simple"; User = userName; WorkingDirectory = "/home/${userName}"; - ExecStart = "${nur.packages.${pkgs.stdenv.hostPlatform.system}.hildibrand}/bin/hildibrand"; + ExecStart = "${hildibrand}/bin/hildebrand"; Restart = "on-failure"; RestartSec = "5s"; };