2023-11-11 00:04:57 +00:00
|
|
|
{
|
|
|
|
self,
|
|
|
|
lib,
|
|
|
|
inputs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
mkNixosModule = name: [{ ${name} = import ./${name}; }];
|
|
|
|
mkBaseImport = name: [ self.nixosModules.${name} ];
|
|
|
|
|
|
|
|
# create a list of directory names from given folder
|
|
|
|
filterModules = dir: builtins.attrNames (lib.attrsets.filterAttrs (n: v: v == "directory") (builtins.readDir dir));
|
|
|
|
|
|
|
|
# create nixosModules imports from list
|
|
|
|
flakeNixosModulesList = modules: lib.attrsets.mergeAttrsList (builtins.concatMap mkNixosModule modules);
|
|
|
|
flakeNixosBaseImports = modules: lib.lists.flatten (builtins.concatMap mkBaseImport modules);
|
|
|
|
in
|
|
|
|
{
|
|
|
|
# Configuration common to all Linux systems
|
|
|
|
flake = {
|
|
|
|
nixosModules = rec {} //
|
|
|
|
(flakeNixosModulesList (filterModules ./.)) //
|
|
|
|
{
|
|
|
|
base.imports = [
|
|
|
|
self.nixosModules.home-manager
|
2023-12-18 21:38:48 +00:00
|
|
|
self.nixosModules.overlays
|
2023-11-11 00:04:57 +00:00
|
|
|
inputs.agenix.nixosModules.default
|
|
|
|
inputs.musnix.nixosModules.musnix
|
2023-11-11 20:17:58 +00:00
|
|
|
inputs.nixmodules-hensoko.nixosModules.all
|
2023-11-11 00:04:57 +00:00
|
|
|
|
|
|
|
({
|
|
|
|
flake,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
unstable,
|
|
|
|
master,
|
|
|
|
...
|
|
|
|
}: {
|
2023-12-18 21:38:48 +00:00
|
|
|
nixpkgs.overlays = [
|
2023-11-11 00:04:57 +00:00
|
|
|
(prev: next: {
|
|
|
|
nixd = inputs.unstable.legacyPackages.${prev.system}.nixd;
|
|
|
|
|
2023-11-11 20:17:58 +00:00
|
|
|
# needed by sway module
|
2023-11-11 00:04:57 +00:00
|
|
|
waybar = inputs.master.legacyPackages.${prev.system}.waybar;
|
2023-11-11 20:17:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
# unstable
|
|
|
|
appflowy = inputs.unstable.legacyPackages.${prev.system}.appflowy;
|
|
|
|
docker_24 = inputs.unstable.legacyPackages.${prev.system}.docker_24;
|
|
|
|
home-assistant = inputs.unstable.legacyPackages.${prev.system}.home-assistant;
|
|
|
|
|
|
|
|
scan2paperless = inputs.scan2paperless.legacyPackages.${prev.system}.scan2paperless;
|
2023-12-18 21:38:48 +00:00
|
|
|
paperless-ngx = inputs.unstable.legacyPackages.${prev.system}.paperless-ngx;
|
2023-11-11 00:04:57 +00:00
|
|
|
|
|
|
|
adlist = inputs.adblock-unbound.packages.${prev.system};
|
|
|
|
})
|
2023-11-11 20:17:58 +00:00
|
|
|
|
|
|
|
(prev: next: {
|
|
|
|
vimPlugins = next.vimPlugins // {
|
|
|
|
inherit (inputs.master.legacyPackages.${prev.system}.vimPlugins) nvim-lspconfig;
|
|
|
|
};
|
|
|
|
})
|
2023-11-11 00:04:57 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nix.nixPath = [
|
|
|
|
"nixpkgs=${inputs.nixpkgs}"
|
|
|
|
"nixos-config=${../lib/compat/nixos}"
|
|
|
|
"home-manager=${inputs.home-manager}"
|
|
|
|
];
|
|
|
|
})
|
|
|
|
] ++ (flakeNixosBaseImports (filterModules ./.));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|