From 44422516d438bb40d57673d7a451af3a8c9a42a5 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sun, 31 Mar 2024 19:23:01 -0400 Subject: [PATCH] feat(nix): Automatically import module outputs This drastically simplifies things since we no longer have to worry about adding and removing files from a default.nix. --- flake.nix | 4 ++++ home/default.nix | 30 ------------------------------ modules/default.nix | 35 ----------------------------------- 3 files changed, 4 insertions(+), 65 deletions(-) delete mode 100644 home/default.nix delete mode 100644 modules/default.nix diff --git a/flake.nix b/flake.nix index 0e26a43b..776a4ec4 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,8 @@ ./. { nixpkgs.overlays = builtins.attrValues self.overlays; + imports = builtins.attrValues self.nixosModules; + home-manager.sharedModules = builtins.attrValues self.homeManagerModules; } ]; }; @@ -39,5 +41,7 @@ builtins.mapAttrs (name: value: callPackage ./packages/${name}) (builtins.readDir ./packages); overlays = builtins.mapAttrs (name: value: import ./overlays/${name}) (builtins.readDir ./overlays); + nixosModules = builtins.mapAttrs (name: value: import ./modules/${name}) (builtins.readDir ./modules); + homeManagerModules = builtins.mapAttrs (name: value: import ./home/${name}) (builtins.readDir ./home); }; } diff --git a/home/default.nix b/home/default.nix deleted file mode 100644 index 24fb0132..00000000 --- a/home/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - home-manager.sharedModules = [ - ./dunst.nix - ./eww.nix - ./fcitx.nix - ./fish.nix - ./git.nix - ./gpg.nix - ./gtk.nix - ./htop.nix - ./hyprland.nix - ./ironbar.nix - ./kitty.nix - ./librewolf.nix - ./mime-apps.nix - ./mpv.nix - ./ncmpcpp.nix - ./neovim.nix - ./pqiv.nix - ./qutebrowser.nix - ./rofi.nix - ./thunar.nix - ./udiskie.nix - ./xcursor.nix - ./xdg-user-dirs.nix - ./xresources.nix - ./yazi.nix - ./zathura.nix - ]; -} diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100644 index 8b81ab7d..00000000 --- a/modules/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - imports = [ - ./boot.nix - ./cdemu.nix - ./docker.nix - ./dual-function-keys.nix - ./fish.nix - ./fonts.nix - ./greetd.nix - ./home-manager.nix - ./hyprland.nix - ./locale.nix - ./logind.nix - ./mullvad.nix - ./neovim.nix - ./networking.nix - ./nix.nix - ./packages.nix - ./piper.nix - ./pipewire.nix - ./postgres.nix - ./resolved.nix - ./starship.nix - ./stylix.nix - ./system.nix - ./systemd.nix - ./thunar.nix - ./timezone.nix - ./udev.nix - ./user.nix - ./virtualization.nix - ./wine.nix - ./zram.nix - ]; -}