From 468c978e62582f71450ec122574db2825ea90c18 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:53:03 +0200 Subject: [PATCH] moar options --- flake.nix | 2 - modules/collections/desktop.nix | 20 ++-- modules/collections/laptop.nix | 4 + modules/collections/server.nix | 4 +- modules/graphical/default.nix | 1 + modules/graphical/noise-supression.nix | 17 +++ modules/nix/default.nix | 4 +- modules/nix/index.nix | 20 +++- modules/nix/ld.nix | 140 +++++++++++++------------ modules/nix/settings.nix | 22 ++-- modules/noise-supression.nix | 7 -- 11 files changed, 141 insertions(+), 100 deletions(-) create mode 100644 modules/graphical/noise-supression.nix delete mode 100644 modules/noise-supression.nix diff --git a/flake.nix b/flake.nix index 58c5747..1ba372a 100644 --- a/flake.nix +++ b/flake.nix @@ -91,8 +91,6 @@ ./modules/ecryptfs.nix ./modules/services/syncthing.nix ./modules/fh/scanning.nix - ./modules/nix/ld.nix - ./modules/nix/settings.nix ./modules/support/ntfs.nix ./modules/thunderbolt.nix ./modules/vmware-host.nix diff --git a/modules/collections/desktop.nix b/modules/collections/desktop.nix index e1b55f5..088ad07 100644 --- a/modules/collections/desktop.nix +++ b/modules/collections/desktop.nix @@ -5,21 +5,7 @@ #../fh/scanning.nix ../flatpak.nix ../gpg.nix - ../graphical/audio.nix - ../graphical/code.nix - ../graphical/emulators.nix - ../graphical/gamemode.nix - ../graphical/games.nix - ../graphical/ime.nix - ../graphical/obs.nix - ../graphical/openrgb.nix - ../graphical/plasma.nix - ../graphical/shared.nix ../kernel.nix # use latest kernel - ../nix/index.nix - ../nix/ld.nix - ../nix/settings.nix - ../noise-supression.nix ../services/syncthing.nix ../static-ip.nix ../support/ntfs.nix @@ -31,6 +17,11 @@ virt-manager.enable = true; nftables.enable = true; cli-tools.enable = true; + nix = { + index.enable = true; + ld.enable = true; + settings.enable = true; + }; hardware = { nvidia.enable = true; firmware.enable = true; @@ -44,6 +35,7 @@ gamemode.enable = true; games.enable = true; ime.enable = true; + noise-supression.enable = true; obs.enable = true; openrgb.enable = true; plasma.enable = true; diff --git a/modules/collections/laptop.nix b/modules/collections/laptop.nix index b1978de..6dc1b4f 100644 --- a/modules/collections/laptop.nix +++ b/modules/collections/laptop.nix @@ -8,6 +8,10 @@ tmpfs.enable = true; wireshark.enable = true; virt-manager.enable = true; + nix = { + ld.enable = true; + settings.enable = true; + }; hardware = { firmware.enable = true; ssd.enable = true; diff --git a/modules/collections/server.nix b/modules/collections/server.nix index ce85caa..64a8135 100644 --- a/modules/collections/server.nix +++ b/modules/collections/server.nix @@ -28,13 +28,15 @@ ../hdd-spindown.nix ../logging.nix ../motd.nix - ../nix/settings.nix ../static-ip.nix ]; kop = { cli-tools.enable = true; tmpfs.enable = true; + nix = { + settings.enable = true; + }; hardware = { firmware.enable = true; ssd.enable = true; diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix index dbb63a1..171772f 100644 --- a/modules/graphical/default.nix +++ b/modules/graphical/default.nix @@ -9,6 +9,7 @@ ./gnome.nix ./ime.nix ./lxqt.nix + ./noise-supression.nix ./obs.nix ./openrgb.nix ./plasma.nix diff --git a/modules/graphical/noise-supression.nix b/modules/graphical/noise-supression.nix new file mode 100644 index 0000000..d2e3fe7 --- /dev/null +++ b/modules/graphical/noise-supression.nix @@ -0,0 +1,17 @@ +{config, lib, pkgs, ...}: +with lib; +let + cfg = config.kop.graphical.noise-supression; +in +{ + options.kop.graphical.noise-supression = { + enable = mkEnableOption "Enables noise-supression"; + }; + + config = mkIf cfg.enable { + programs.noisetorch.enable = true; + environment.systemPackages = [ + pkgs.easyeffects + ]; + }; +} diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 59e291a..9f38fc9 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -1,6 +1,8 @@ { pkgs, config, ...}: { imports = [ - + ./index.nix + ./ld.nix + ./settings.nix ]; } diff --git a/modules/nix/index.nix b/modules/nix/index.nix index e8e93b3..d292168 100644 --- a/modules/nix/index.nix +++ b/modules/nix/index.nix @@ -1,7 +1,19 @@ +{config, lib, ...}: +with lib; +let + cfg = config.kop.nix.index; +in { - programs.command-not-found.enable = false; - programs.nix-index = { - enable = true; - enableZshIntegration=true; + options.kop.nix.index = { + enable = mkEnableOption "Enables nix index"; + }; + + config = mkIf cfg.enable { + programs.command-not-found.enable = false; + programs.nix-index = { + enable = true; + enableZshIntegration=true; + }; }; } + diff --git a/modules/nix/ld.nix b/modules/nix/ld.nix index 2bed0ea..8e54f0f 100644 --- a/modules/nix/ld.nix +++ b/modules/nix/ld.nix @@ -1,67 +1,77 @@ -{ pkgs, ... }: +{config, lib, pkgs, ... }: +with lib; +let + cfg = config.kop.nix.ld; +in { - programs.nix-ld.enable = true; - programs.nix-ld.libraries = with pkgs; [ - acl - alsa-lib - at-spi2-atk - at-spi2-core - atk - attr - bzip2 - cairo - cups - curl - dbus.lib - expat - fontconfig.lib - freetype - gdk-pixbuf - glib - gtk3 - icu - libGL - libappindicator-gtk3 - libdrm - libgcc.lib - libglvnd - libkrb5 - libnotify - libpulseaudio - libsodium - libssh - libusb1 - libuuid - libxkbcommon - libxml2 - mesa - nspr - nspr - nss - openssl - pango - pipewire - stdenv.cc.cc - systemd - util-linux - xorg.libX11 - xorg.libXScrnSaver - xorg.libXau - xorg.libXcomposite - xorg.libXcursor - xorg.libXdamage - xorg.libXdmcp - xorg.libXext - xorg.libXfixes - xorg.libXi - xorg.libXrandr - xorg.libXrender - xorg.libXtst - xorg.libxcb - xorg.libxkbfile - xorg.libxshmfence - xz - zlib - zstd - ]; + options.kop.nix.ld = { + enable = mkEnableOption "Enables nix ld"; + }; + + config = mkIf cfg.enable { + programs.nix-ld.enable = true; + programs.nix-ld.libraries = with pkgs; [ + acl + alsa-lib + at-spi2-atk + at-spi2-core + atk + attr + bzip2 + cairo + cups + curl + dbus.lib + expat + fontconfig.lib + freetype + gdk-pixbuf + glib + gtk3 + icu + libGL + libappindicator-gtk3 + libdrm + libgcc.lib + libglvnd + libkrb5 + libnotify + libpulseaudio + libsodium + libssh + libusb1 + libuuid + libxkbcommon + libxml2 + mesa + nspr + nspr + nss + openssl + pango + pipewire + stdenv.cc.cc + systemd + util-linux + xorg.libX11 + xorg.libXScrnSaver + xorg.libXau + xorg.libXcomposite + xorg.libXcursor + xorg.libXdamage + xorg.libXdmcp + xorg.libXext + xorg.libXfixes + xorg.libXi + xorg.libXrandr + xorg.libXrender + xorg.libXtst + xorg.libxcb + xorg.libxkbfile + xorg.libxshmfence + xz + zlib + zstd + ]; + }; } diff --git a/modules/nix/settings.nix b/modules/nix/settings.nix index ec16aae..dbbe82a 100644 --- a/modules/nix/settings.nix +++ b/modules/nix/settings.nix @@ -1,8 +1,18 @@ -{ inputs, config, pkgsVersion, ... }: +{lib, inputs, config, pkgsVersion, ... }: +with lib; +let + cfg = config.kop.nix.settings; +in { - nix.optimise.automatic = true; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - nix.registry.nixpkgs.flake = pkgsVersion; - nix.nixPath = ["nixpkgs=flake:nixpkgs"]; - home-manager.users.${config.mainUser.name}.home.sessionVariables.NIX_PATH = "nixpkgs=flake:nixpkgs$\{NIX_PATH:+:$NIX_PATH}"; + options.kop.nix.settings = { + enable = mkEnableOption "Enables various nix settings"; + }; + + config = mkIf cfg.enable { + nix.optimise.automatic = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.registry.nixpkgs.flake = pkgsVersion; + nix.nixPath = ["nixpkgs=flake:nixpkgs"]; + home-manager.users.${config.mainUser.name}.home.sessionVariables.NIX_PATH = "nixpkgs=flake:nixpkgs$\{NIX_PATH:+:$NIX_PATH}"; + }; } diff --git a/modules/noise-supression.nix b/modules/noise-supression.nix deleted file mode 100644 index e83a258..0000000 --- a/modules/noise-supression.nix +++ /dev/null @@ -1,7 +0,0 @@ -{pkgs, ...}: -{ - programs.noisetorch.enable = true; - environment.systemPackages = [ - pkgs.easyeffects - ]; -}