From 252a9d0e0ff4040b25227ae40a758d14e1b84f1a Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Fri, 10 Sep 2021 00:42:41 -0400 Subject: [PATCH] shrink modules list --- flake.nix | 30 ++++++++---------------------- modules/_template.nix | 16 ---------------- 2 files changed, 8 insertions(+), 38 deletions(-) delete mode 100644 modules/_template.nix diff --git a/flake.nix b/flake.nix index 6344f0e..e4bdac7 100644 --- a/flake.nix +++ b/flake.nix @@ -19,28 +19,14 @@ }); in { - nixosModules = { - inherit (impermanence.nixosModules) impermanence; - - alacritty = import ./modules/alacritty.nix; - baseline = import ./modules/baseline.nix; - cli = import ./modules/cli.nix; - desktop = import ./modules/desktop.nix; - gnome = import ./modules/gnome.nix; - gnome-monitor-settings-tweak = import ./modules/gnome-monitor-settings-tweak; - i3 = import ./modules/i3; - mouse-dpi = import ./modules/mouse-dpi.nix; - phpipam = import ./modules/phpipam.nix; - pipewire = import ./modules/pipewire.nix; - plasma = import ./modules/plasma.nix; - profiles = import ./modules/profiles.nix; - scansnap_s1300 = import ./modules/scansnap_s1300.nix; - scroll-boost = import ./modules/scroll-boost; - security-tools = import ./modules/security-tools.nix; - server = import ./modules/server.nix; - status-on-console = import ./modules/status-on-console.nix; - sway = import ./modules/sway.nix; - }; + nixosModules = + { inherit (impermanence.nixosModules) impermanence; } // + nixpkgs.lib.mapAttrs' + (name: type: { + name = if (type == "regular") then (nixpkgs.lib.removeSuffix ".nix" name) else name; + value = import (./modules + "/${name}"); + }) + (builtins.readDir ./modules); nixosModule = { pkgs, ... }: { imports = builtins.attrValues self.nixosModules; diff --git a/modules/_template.nix b/modules/_template.nix deleted file mode 100644 index 07db0f0..0000000 --- a/modules/_template.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, pkgs, lib, ... }: -let - cfg = config.sconfig._options_name_; -in -{ - options.sconfig._options_name_ = lib.mkEnableOption "Do a Barrel Roll"; - options.sconfig._options_name_ = lib.mkOption { - default = true; - type = lib.types.bool; - description = "Do a Barrel Roll"; - }; - - config = lib.mkIf cfg { - environment.systemPackages = with pkgs; [ hello ]; - }; -}