diff --git a/README.md b/README.md index a6e80b8..9f2e2c9 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,10 @@ sudo nixos-install --root /mnt --flake .#hermes ```bash nix run nix-darwin/release-* -- switch --flake .#mercure -``` \ No newline at end of file +``` + +# TODO +1. Create a configuration path for the directory `config` +2. Create `mkSystem` that: + 1. Inject `options.machine` + 2. Auto-import the related configurations \ No newline at end of file diff --git a/machines/persephone/off.orp b/config/openrgb/off.orp similarity index 100% rename from machines/persephone/off.orp rename to config/openrgb/off.orp diff --git a/machines/persephone.nix b/machines/persephone.nix index 188f7a0..e35648e 100644 --- a/machines/persephone.nix +++ b/machines/persephone.nix @@ -9,18 +9,24 @@ { imports = [ (modulesPath + "/installer/scan/not-detected.nix") - ./persephone/hardware.nix ./persephone/networking.nix ../profiles/minimal.linux.nix ../profiles/desktop.linux.nix ]; boot = { + blacklistedKernelModules = [ + "spd5118" + ]; extraModulePackages = [ ]; - kernelModules = [ "kvm-intel" ]; + kernelModules = [ + "i2c-dev" + "kvm-intel" + ]; kernelPackages = pkgs.linuxPackages_6_17; kernelParams = [ "i915.enable_guc=3" ]; }; + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" @@ -34,7 +40,7 @@ keyMap = "us"; font = "${pkgs.terminus_font}/share/consolefonts/ter-v28b.psf.gz"; }; - + i18n.defaultLocale = "en_US.UTF-8"; hardware.enableRedistributableFirmware = true; @@ -48,6 +54,8 @@ ]; }; + hardware.i2c.enable = true; + hardware.nvidia = { package = config.boot.kernelPackages.nvidiaPackages.stable; open = true; @@ -109,6 +117,11 @@ VDPAU_DRIVER = "va_gl"; }; + environment.systemPackages = with pkgs; [ + i2c-tools + lm_sensors + ]; + nix.settings = { substituters = [ "https://cache.nixos-cuda.org" ]; trusted-public-keys = [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ]; @@ -125,7 +138,13 @@ programs._1password.enable = true; + services.hardware.openrgb = { + enable = true; + startupProfile = "off"; + }; + services.pipewire.enable = true; + services.udev.packages = [ pkgs.openrgb ]; services.xserver.videoDrivers = [ "modesetting" diff --git a/machines/persephone/hardware.nix b/machines/persephone/hardware.nix deleted file mode 100644 index 31c60b0..0000000 --- a/machines/persephone/hardware.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ pkgs, ... }: - -{ - # I2C - environment.systemPackages = with pkgs; [ - i2c-tools - lm_sensors - ]; - - boot.kernelModules = [ "i2c-dev" ]; - boot.blacklistedKernelModules = [ - # The spd5118 driver is in conflict with openrgb by holding onto I2C adresses when using Kingston Fury DRAM. - # On boot, I need to access those i2c regions in other to poweroff the RGB lighting. - # Then, I manually enable the kernel module in any script. - # It's possible to let this module disabled, but I lose the ability to get temperature values for the DIMMs. - # https://gitlab.com/CalcProgrammer1/OpenRGB/-/merge_requests/2557 - "spd5118" - ]; - - hardware.i2c.enable = true; - - # OpenRGB - services.udev.packages = [ pkgs.openrgb ]; - services.hardware.openrgb = { - enable = true; - startupProfile = "off"; - }; - - system.activationScripts.openrgbOff = '' - mkdir -p /var/lib/OpenRGB - cp ${./off.orp} /var/lib/OpenRGB/off.orp - chmod 0644 /var/lib/OpenRGB/off.orp - ''; -} diff --git a/machines/persephone/remove_systemd_service.patch b/machines/persephone/remove_systemd_service.patch deleted file mode 100644 index bc9fbdf..0000000 --- a/machines/persephone/remove_systemd_service.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/OpenRGB.pro b/OpenRGB.pro -index df7082b6..0022e5fa 100644 ---- a/OpenRGB.pro -+++ b/OpenRGB.pro -@@ -588,9 +588,9 @@ contains(QMAKE_PLATFORM, linux) { - icon.files+=qt/org.openrgb.OpenRGB.png - metainfo.path=$$PREFIX/share/metainfo/ - metainfo.files+=qt/org.openrgb.OpenRGB.metainfo.xml -- systemd_service.path=/etc/systemd/system -- systemd_service.files+=qt/openrgb.service -- INSTALLS += target desktop icon metainfo udev_rules systemd_service -+ # systemd_service.path=/etc/systemd/system -+ # systemd_service.files+=qt/openrgb.service -+ INSTALLS += target desktop icon metainfo udev_rules # systemd_service - } - - #-----------------------------------------------------------------------------------------------# diff --git a/profiles/desktop.linux.nix b/profiles/desktop.linux.nix index 50cabd3..1943b2d 100644 --- a/profiles/desktop.linux.nix +++ b/profiles/desktop.linux.nix @@ -101,4 +101,11 @@ in pulse.enable = true; jack.enable = true; }; + + system.activationScripts.openrgbOff = + mkIf (config.services.hardware.openrgb.startupProfile == "off") '' + mkdir -p /var/lib/OpenRGB + cp ${../config/openrgb/off.orp} /var/lib/OpenRGB/off.orp + chmod 0644 /var/lib/OpenRGB/off.orp + ''; }