feat(lib): add listModules to import modules

nixos
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) ./.)