home: automatically create set of HM modules

This commit is contained in:
Tim Schubert 2024-03-02 12:23:11 +01:00
parent cfe49c73fc
commit 0a0cdf7188
Signed by: dadada
SSH key fingerprint: SHA256:bFAjFH3hR8zRBaJjzQDjc3o4jqoq5EZ87l+KXEjxIz0
4 changed files with 9 additions and 36 deletions

8
home/modules.nix Normal file
View file

@ -0,0 +1,8 @@
{ lib, ... }:
with lib; let
modules' = dir: filterAttrs (name: type: (hasSuffix ".nix" name) || (type == "directory"))
(builtins.readDir dir);
modules = dir: mapAttrs' (name: _: nameValuePair (removeSuffix ".nix" name) (import (dir + "/${name}")))
(modules' dir);
in
(modules ./modules)

View file

@ -1,16 +0,0 @@
{
alacritty = import ./alacritty;
colors = import ./colors.nix;
direnv = import ./direnv.nix;
git = import ./git.nix;
gpg = import ./gpg.nix;
gtk = import ./gtk.nix;
helix = import ./helix;
keyring = import ./keyring.nix;
session = import ./session.nix;
ssh = import ./ssh.nix;
syncthing = import ./syncthing.nix;
tmux = import ./tmux.nix;
xdg = import ./xdg.nix;
zsh = import ./zsh.nix;
}

View file

@ -1,19 +0,0 @@
[
./colors.nix
./direnv.nix
./fish.nix
./git.nix
./gpg.nix
./gtk.nix
./keyring.nix
./kitty
./mako.nix
./session.nix
./ssh.nix
./sway
./syncthing.nix
./termite.nix
./tmux.nix
./xdg.nix
./zsh.nix
]

View file

@ -36,7 +36,7 @@
})) }))
// { // {
hmModules = import ./home/modules; hmModules = import ./home/modules.nix { lib = nixpkgs.lib; };
nixosConfigurations = import ./nixos/configurations.nix inputs; nixosConfigurations = import ./nixos/configurations.nix inputs;