changed imports to mkImports

This commit is contained in:
Bryan Ramos 2024-11-07 15:41:50 -05:00
parent 649d9e83b6
commit 930f5272b8
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
34 changed files with 66 additions and 448 deletions

View file

@ -2,7 +2,7 @@
{
imports = [
../../../user/configs
../../../user/config
./hardware.nix
./system.nix
];

View file

@ -2,7 +2,7 @@
{
imports = [
../../../user/configs
../../../user/config
./hardware.nix
./system.nix
];

View file

@ -2,7 +2,7 @@
{
imports = [
../../../user/configs
../../../user/config
./hardware.nix
./system.nix
];

View file

@ -2,7 +2,7 @@
{
imports = [
../../../user/configs
../../../user/config
./system.nix
];
}

View file

@ -13,7 +13,6 @@ let
in
{ options.modules.system.bitcoin = { enable = mkEnableOption "Bitcoin Server"; };
imports = [ ./modules ];
config = mkIf cfg.enable {
nixpkgs.overlays = [
(final: prev: {

View file

@ -1,5 +0,0 @@
{
imports = [
./electrum
];
}

View file

@ -1,5 +1,32 @@
let
mkModules = dir: isRoot:
let
entries = builtins.readDir dir;
names = builtins.attrNames entries;
isModuleDir = path:
builtins.pathExists path &&
builtins.readFileType path == "directory" &&
builtins.baseNameOf path != "config";
isModule = file: file == "default.nix";
isNix = file: builtins.match ".*\\.nix" file != null && file != "default.nix";
in
builtins.concatMap (name:
let
path = "${dir}/${name}";
in
if isModuleDir path then
mkModules path false
else if isModule name && !isRoot then
[dir]
else if isNix name then
[path]
else
[]
) names;
in
{
imports = [
./bitcoin
];
imports = mkModules ./. true;
}