From c8dbef379eeb9a7cc3a03575c9bf0e8a744be2d4 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Mon, 17 Nov 2025 19:06:35 +0100 Subject: [PATCH] Set up 'andromache' host --- flake.nix | 4 ++ home/hosts/andromache/default.nix | 1 + hosts/andromache/configuration.nix | 93 ++++++++++++++++++++++++++++++ hosts/andromache/hard.nix | 26 +++++++++ 4 files changed, 124 insertions(+) create mode 100644 home/hosts/andromache/default.nix create mode 100644 hosts/andromache/configuration.nix create mode 100644 hosts/andromache/hard.nix diff --git a/flake.nix b/flake.nix index f5352be..98ec6d8 100644 --- a/flake.nix +++ b/flake.nix @@ -64,6 +64,10 @@ modules = [ ./hosts/vm/configuration.nix ]; specialArgs = { inherit inputs; }; }; + andromache = nixpkgs.lib.nixosSystem { + modules = [ ./hosts/andromache/configuration.nix ]; + specialArgs = { inherit inputs; }; + }; astyanax = nixpkgs.lib.nixosSystem { modules = [ ./hosts/astyanax/configuration.nix ]; specialArgs = { inherit inputs; }; diff --git a/home/hosts/andromache/default.nix b/home/hosts/andromache/default.nix new file mode 100644 index 0000000..8548ecf --- /dev/null +++ b/home/hosts/andromache/default.nix @@ -0,0 +1 @@ +import ../astyanax diff --git a/hosts/andromache/configuration.nix b/hosts/andromache/configuration.nix new file mode 100644 index 0000000..1637a9b --- /dev/null +++ b/hosts/andromache/configuration.nix @@ -0,0 +1,93 @@ +{ + inputs, + config, + pkgs, + ... +}: + +{ + system.stateVersion = "25.05"; + + imports = [ + inputs.disko.nixosModules.disko + inputs.home-manager.nixosModules.default + ./hard.nix + ../../modules/bootloader.nix + ../../modules/disko.zfs-encrypted-root.nix + ../../modules/gnome.nix + ../../modules/bluetooth.nix + ../../modules/keyboard + (import ../../modules/networking.nix { hostName = "andromache"; }) + ../../modules/users.nix + ../../modules/audio.nix + ../../modules/printing.nix + ../../modules/localization.nix + ../../modules/fonts + ../../modules/ssh/hardened-openssh.nix + ]; + + hardware = { + graphics.enable = true; + nvidia = { + modesetting.enable = true; + powerManagement.enable = true; + powerManagement.finegrained = false; + open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + }; + + environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ]; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + nixpkgs.config.allowUnfree = true; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.h = import ../../home/hosts/andromache { + inherit inputs; + inherit config; + inherit pkgs; + }; + }; + + networking = { + hostId = "80eef97e"; + }; + + services.xserver = { + videoDrivers = [ "nvidia" ]; + }; + + services.openssh = { + enable = true; + harden = true; + }; + + services.syncthing = { + enable = true; + openDefaultPorts = true; + folders = { + "/home/h/sync" = { + id = "sync"; + devices = [ ]; + }; + }; + devices = { + # "device1" = { + # id = "DEVICE-ID-GOES-HERE"; + # }; + }; + }; + + services.locate = { + enable = true; + package = pkgs.plocate; + }; +} diff --git a/hosts/andromache/hard.nix b/hosts/andromache/hard.nix new file mode 100644 index 0000000..8a19891 --- /dev/null +++ b/hosts/andromache/hard.nix @@ -0,0 +1,26 @@ +# 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 + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "uas" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}