feat(lib): add listModules to import modules

This commit is contained in:
Moritz Böhme 2023-05-07 13:51:09 +02:00
parent c9e2642e96
commit 326b14d39a
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
6 changed files with 16 additions and 56 deletions

View file

@ -45,4 +45,6 @@ lib.makeExtensible (_: rec {
lib.mapAttrs' mkModule modulesInDir;
mapModules' = f: dir: lib.attrValues (mapModules f dir);
listModules = mapModules' (path: path);
})

View file

@ -1,10 +1,5 @@
{ lib, ... }:
{
imports = [
./bin
./nix.nix
./shell.nix
./theming
./wallpapers.nix
./yubikey.nix
];
imports = lib.my.listModules ./.;
}

View file

@ -1,33 +1,5 @@
{ lib, ... }:
{
imports = [
./adb.nix
./bspwm
./chromium.nix
./code.nix
./direnv.nix
./firefox.nix
./fish.nix
./git.nix
./gnome.nix
./gpg.nix
./helix.nix
./hub.nix
./hyprland
./kakoune.nix
./kitty.nix
./ledger
./logseq.nix
./miracast.nix
./navi
./nvim
./python.nix
./rofi
./spotify.nix
./ssh.nix
./sway.nix
./thunar.nix
./tmux.nix
./zathura.nix
./zsh.nix
];
imports = lib.my.listModules ./.;
}

View file

@ -1,13 +1,5 @@
{ lib, ... }:
{
imports = [
./dunst.nix
./gammastep.nix
./kdeconnect.nix
./mullvad.nix
./openconnect.nix
./picom.nix
./printing.nix
./synology-drive.nix
./wireguard.nix
];
imports = lib.my.listModules ./.;
}

View file

@ -1,6 +1,5 @@
{ lib, ... }:
{
imports = [
./podman.nix
./virtualisation.nix
];
imports = lib.my.listModules ./.;
}

View file

@ -1,4 +1,4 @@
{ inputs, lib }:
{ lib, ... }@args:
lib.composeManyExtensions
(lib.my.mapModules' (file: import file { inherit inputs lib; }) ./.)
(lib.my.mapModules' (file: import file args) ./.)