lambda to import recursive files on all modules

This commit is contained in:
2024-10-02 19:22:53 -06:00
parent 933f52d4ee
commit 46f6fc626f
27 changed files with 72 additions and 85 deletions

View File

@@ -1,12 +1,12 @@
{ lib, ... }:
{
imports = [
./services/network.nix
./services/nvidia.nix
./services/printing.nix
./services/sound.nix
./services/wireguard.nix
];
imports =
let
serviceFiles = builtins.filter (file: builtins.match ".*\\.nix" file != null) (
builtins.attrNames (builtins.readDir ./services)
);
in
map (file: ./services/${file}) serviceFiles;
my.services = {
network.enable = lib.mkDefault false;
nvidia.enable = lib.mkDefault false;