From fa292da0f00502249e8cae7818b52e6f95b05096 Mon Sep 17 00:00:00 2001 From: cybrneko Date: Sat, 25 Jul 2026 03:58:23 -0500 Subject: [PATCH] separated out the bits of my config so I can have two computers --- ....nix => artemis-hardware-configuration.nix | 0 artemis.nix | 10 ++++ athena.nix | 10 ++++ configuration.nix | 46 +++++++++------- flake.nix | 54 ++++++++++++------- 5 files changed, 80 insertions(+), 40 deletions(-) rename hardware-configuration.nix => artemis-hardware-configuration.nix (100%) create mode 100644 artemis.nix create mode 100644 athena.nix diff --git a/hardware-configuration.nix b/artemis-hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to artemis-hardware-configuration.nix diff --git a/artemis.nix b/artemis.nix new file mode 100644 index 0000000..b1e429e --- /dev/null +++ b/artemis.nix @@ -0,0 +1,10 @@ +{ ... }: + +{ + imports = [ + ./configuration.nix + ./artemis-hardware-configuration.nix + ]; + + networking.hostName = "artemis"; +} diff --git a/athena.nix b/athena.nix new file mode 100644 index 0000000..1cdae81 --- /dev/null +++ b/athena.nix @@ -0,0 +1,10 @@ +{ ... }: + +{ + imports = [ + ./configuration.nix + ./athena-hardware-configuration.nix + ]; + + networking.hostName = "athena"; +} diff --git a/configuration.nix b/configuration.nix index a021aa4..25c0241 100644 --- a/configuration.nix +++ b/configuration.nix @@ -5,19 +5,12 @@ { config, pkgs, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; # Use latest kernel. boot.kernelPackages = pkgs.linuxPackages_zen; - - networking.hostName = "artemis"; # Define your hostname. networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # Configure network proxy if necessary @@ -83,22 +76,31 @@ }; musnix.enable = true; + musnix.kernel.realtime = false; # force non-RT while we tune everything else + musnix.rtirq.enable = true; # IRQ thread priority tuning — helps USB audio specifically + musnix.rtirq.nameList = "snd usb"; # prioritize sound + USB IRQs # realtime audio shenanigans security.pam.loginLimits = [ - { - domain = "@audio"; - type = "-"; - item = "rtprio"; - value = "95"; - } - { - domain = "@audio"; - type = "-"; - item = "memlock"; - value = "unlimited"; - } -]; + { + domain = "@audio"; + type = "-"; + item = "rtprio"; + value = "95"; + } + { + domain = "@audio"; + type = "-"; + item = "memlock"; + value = "unlimited"; + } + ]; + + systemd.user.services.pipewire.serviceConfig.CPUAffinity = "8-15"; + systemd.user.services.wireplumber.serviceConfig.CPUAffinity = "8-15"; + systemd.services.rtkit-daemon.serviceConfig.CPUAffinity = "8-15"; + + programs.nix-ld.enable = true; # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; @@ -132,6 +134,7 @@ hydrapaper nextcloud-client fastfetch + epson-escpr2 ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; @@ -158,6 +161,9 @@ }) ]; + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1235", ATTR{power/control}="on" + ''; # Enable the OpenSSH daemon. # services.openssh.enable = true; diff --git a/flake.nix b/flake.nix index c776421..2ede9f4 100644 --- a/flake.nix +++ b/flake.nix @@ -15,29 +15,43 @@ outputs = { self, nixpkgs, home-manager, nix-flatpak, musnix, ... }: let system = "x86_64-linux"; + + commonModules = [ + musnix.nixosModules.musnix + + home-manager.nixosModules.home-manager + + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + + home-manager.users.cybrneko = { pkgs, ... }: { + imports = [ + nix-flatpak.homeManagerModules.nix-flatpak + ./home.nix + ./users/cybrneko.nix + ]; + }; + } + ]; in { - nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { - inherit system; + nixosConfigurations = { + artemis = nixpkgs.lib.nixosSystem { + inherit system; - modules = [ - ./configuration.nix - - musnix.nixosModules.musnix + modules = [ + ./artemis.nix + ] ++ commonModules; + }; - home-manager.nixosModules.home-manager + athena = nixpkgs.lib.nixosSystem { + inherit system; - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.cybrneko = { pkgs, ... }: { - imports = [ - nix-flatpak.homeManagerModules.nix-flatpak - ./home.nix - ./users/cybrneko.nix - ]; - }; - } - ]; + modules = [ + ./athena.nix + ] ++ commonModules; + }; }; - }; + }; } +