{ description = "immae-eu infrastructure"; inputs = { flake-parts.url = "github:hercules-ci/flake-parts"; # TODO: use nixos-unstable branch at some point and use the lock to keep the actual commit nixpkgs.url = "github:nixos/nixpkgs/062a0c5437b68f950b081bbfc8a699d57a4ee026"; }; outputs = inputs@{ self, flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { imports = [ (import ./lib/flake-parts-lib.nix { name = "lib"; type = "unspecified"; }) (import ./lib/flake-parts-lib.nix { name = "environments"; type = "package"; }) ]; systems = [ "x86_64-linux" ]; perSystem = { config, inputs', pkgs, ... }: let mypkgs = import ./pkgs/default.nix { forFlakes = true; inherit pkgs; inherit (self) mylibs sources environments; }; in { packages = builtins.removeAttrs mypkgs [ "myEnvironments" "composerEnv" "webapps" "status_engine" "python3PackagesPlus" ] // (pkgs.lib.mapAttrs' (n: pkgs.lib.nameValuePair ("status-engine-" + n)) mypkgs.status_engine) // (pkgs.lib.mapAttrs' (n: pkgs.lib.nameValuePair ("webapps-" + n)) (builtins.removeAttrs mypkgs.webapps [ "apache-theme" ])); environments = import ./environments/default.nix { inherit (pkgs) callPackage; }; lib = { inherit (mypkgs) composerEnv sources; inherit (mypkgs.webapps) apache-theme; }; }; flake = { mylibs = import ./lib/default.nix; sources = import ./sources/sources.nix; overlays = import ./overlays/default.nix { forFlakes = true; inherit (self) sources mylibs; } // { mypkgs = final: prev: self.packages."${final.system}"; }; }; }; }