From caa0179f1d5927d989f800e8be06585c43e5e081 Mon Sep 17 00:00:00 2001 From: Romain Paquet Date: Wed, 31 Dec 2025 00:32:37 +0100 Subject: [PATCH] refactor nix module list --- modules/flake-module.nix | 51 +++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/modules/flake-module.nix b/modules/flake-module.nix index 11aad72..fba0311 100644 --- a/modules/flake-module.nix +++ b/modules/flake-module.nix @@ -1,31 +1,28 @@ { lib, ... }: { - flake.nixosModules = { - gitea.imports = [ - ./gitea.nix - ]; + flake.nixosModules = + ( + (builtins.readDir ./.) + |> lib.filterAttrs (path: type: type == "regular" && (lib.hasSuffix ".nix" path)) + |> lib.mapAttrs' ( + path: _: { + name = lib.removeSuffix ".nix" path; + value = { + imports = [ ./${path} ]; + }; + } + ) + ) + // { + server.imports = [ + ./motd.nix + ]; - desktop.imports = [ - ./desktop.nix - ]; - - dev.imports = [ ./dev.nix ]; - nix-defaults.imports = [ ./nix-defaults.nix ]; - tailscale.imports = [ ./tailscale.nix ]; - user-rpqt.imports = [ ./user-rpqt.nix ]; - hardened-ssh-server.imports = [ ./hardened-ssh-server.nix ]; - nextcloud.imports = [ ./nextcloud.nix ]; - radicle.imports = [ ./radicle.nix ]; - - server.imports = [ - ./motd.nix - ]; - - common.imports = [ - { - users.mutableUsers = lib.mkDefault false; - services.userborn.enable = lib.mkDefault true; - } - ]; - }; + common.imports = [ + { + users.mutableUsers = lib.mkDefault false; + services.userborn.enable = lib.mkDefault true; + } + ]; + }; }