From a61bf012757ba1e5f9bdff043cb9cc50507a730a Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:08:13 +0200 Subject: [PATCH] moar --- flake.nix | 2 - modules/cli-tools.nix | 73 +++++++++++++++++++-------------- modules/collections/desktop.nix | 4 +- modules/collections/laptop.nix | 9 ++++ modules/collections/server.nix | 6 ++- modules/default.nix | 1 + modules/hardware/wooting.nix | 4 +- systems/laptop/main.nix | 6 --- 8 files changed, 60 insertions(+), 45 deletions(-) create mode 100644 modules/collections/laptop.nix diff --git a/flake.nix b/flake.nix index 4f9c630..8d0b45e 100644 --- a/flake.nix +++ b/flake.nix @@ -88,7 +88,6 @@ ### User specific ### ./users/kopatz ./modules - ./modules/cli-tools.nix ./modules/ecryptfs.nix ./modules/graphical/audio.nix ./modules/graphical/code.nix @@ -125,7 +124,6 @@ modules = [ #"${nixpkgs}/nixos/modules/profiles/minimal.nix" ./users/anon - ./modules/cli-tools.nix ./modules/nix/settings.nix ./systems/wsl/configuration.nix ({ config, outputs, ... }: { nixpkgs.overlays = with outputs.overlays; [additions modifications unstable-packages]; }) diff --git a/modules/cli-tools.nix b/modules/cli-tools.nix index f0cef5f..d45e451 100644 --- a/modules/cli-tools.nix +++ b/modules/cli-tools.nix @@ -1,33 +1,44 @@ -{ config, pkgs, inputs, ... }: +{lib, config, pkgs, inputs, ... }: +with lib; +let + cfg = config.kop.cli-tools; +in { - environment.systemPackages = with pkgs; [ - wget - pciutils - nixos-option - btop - git - killall - xclip - usbutils - inputs.agenix.packages."x86_64-linux".default - fastfetch - pdfgrep - ncdu - glxinfo - vulkan-tools - ffmpeg - nethogs - dig - smartmontools - bc - xxd - tldr - file - unzip - lsof - screen - tmux - fatrace # monitor filesystem events - ripgrep - ]; + options.kop.cli-tools = { + enable = mkEnableOption "Enables cli-tools"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + wget + pciutils + nixos-option + btop + git + killall + xclip + usbutils + inputs.agenix.packages."x86_64-linux".default + fastfetch + pdfgrep + ncdu + glxinfo + vulkan-tools + ffmpeg + nethogs + dig + smartmontools + bc + xxd + tldr + file + unzip + lsof + screen + tmux + fatrace # monitor filesystem events + ripgrep + ]; + }; } + diff --git a/modules/collections/desktop.nix b/modules/collections/desktop.nix index 0d6723f..ee1a5c6 100644 --- a/modules/collections/desktop.nix +++ b/modules/collections/desktop.nix @@ -1,7 +1,6 @@ {pkgs, config, ...}: { imports = [ - ../cli-tools.nix ../docker.nix #../fh/scanning.nix ../flatpak.nix @@ -30,10 +29,11 @@ ]; kop = { - wooting.enable = true; + hardware.wooting.enable = true; tmpfs.enable = true; wireshark.enable = true; virt-manager.enable = true; nftables.enable = true; + cli-tools.enable = true; }; } diff --git a/modules/collections/laptop.nix b/modules/collections/laptop.nix new file mode 100644 index 0000000..edff090 --- /dev/null +++ b/modules/collections/laptop.nix @@ -0,0 +1,9 @@ +{pkgs, config, ...}: +{ + kop = { + cli-tools.enable = true; + tmpfs.enable = true; + wireshark.enable = true; + virt-manager.enable = true; + }; +} diff --git a/modules/collections/server.nix b/modules/collections/server.nix index 681eeaf..407ac1d 100644 --- a/modules/collections/server.nix +++ b/modules/collections/server.nix @@ -20,7 +20,6 @@ ### Other Modules ### #../games/palworld.nix ../backup.nix - ../cli-tools.nix ../cron.nix ../docker.nix ../fail2ban.nix @@ -35,5 +34,8 @@ ../hardware/ssd.nix ]; - kop.tmpfs.enabled = true; + kop = { + cli-tools.enable = true; + tmpfs.enable = true; + }; } diff --git a/modules/default.nix b/modules/default.nix index 21c9afb..cc388dd 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -11,5 +11,6 @@ ./wireshark.nix ./virt-manager.nix ./nftables.nix + ./cli-tools.nix ]; } diff --git a/modules/hardware/wooting.nix b/modules/hardware/wooting.nix index 0a9315d..d9b86da 100644 --- a/modules/hardware/wooting.nix +++ b/modules/hardware/wooting.nix @@ -1,10 +1,10 @@ { config, pkgs, lib, ...}: with lib; let - cfg = config.kop.wooting; + cfg = config.kop.hardware.wooting; in { - options.kop.wooting = { + options.kop.hardware.wooting = { enable = mkEnableOption "Enable wooting hardware support"; }; diff --git a/systems/laptop/main.nix b/systems/laptop/main.nix index 84bcc99..c9b3ce2 100644 --- a/systems/laptop/main.nix +++ b/systems/laptop/main.nix @@ -14,12 +14,6 @@ # ]; - kop = { - tmpfs.enable = true; - wireshark.enable = true; - virt-manager.enable = true; - } - # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true;