dotfiles/lib/default.nix
eriedaberrie 68617e9045 Initial commit
Note: not the actual initial commit.

I swear I will stop repeatedly force pushing to this single commit eventually
ok.
2024-08-26 11:13:29 -07:00

34 lines
776 B
Nix

{ nixpkgs, self, ... } @ inputs:
let
inherit (nixpkgs) lib;
in rec {
mkSystems = builtins.mapAttrs (hostName: cfg: lib.nixosSystem {
inherit (cfg) system;
specialArgs = {inherit self inputs;};
modules = [
{
networking = {inherit hostName;};
nixpkgs.hostPlatform = cfg.system;
}
self.nixosModules.default
cfg.module
];
});
recReadDir = startDir: dir: lib.concatMapAttrs (file: type: let
fullFile = "${dir}/${file}";
in
if type == "directory" then recReadDir startDir fullFile
else {${fullFile} = "${startDir}/${fullFile}";}
) (builtins.readDir "${startDir}/${dir}");
filterNixReadDir = dir: lib.filterAttrs (name: _:
builtins.match ".*\\.nix" name == null
) (recReadDir dir ".");
}