This commit is contained in:
2023-10-23 15:47:57 +03:00
parent 76d5f10104
commit f101701806

View File

@@ -7,12 +7,11 @@
}; };
outputs = { self, nixpkgs, flake-compat, etherlab }@inputs: outputs = { self, nixpkgs, flake-compat, etherlab }@inputs:
let let
etherlab-pkgs = system: etherlab.packages.${system};
systems = nixpkgs.lib.platforms.linux; systems = nixpkgs.lib.platforms.linux;
lib = nixpkgs.lib; lib = nixpkgs.lib;
packagePaths = lib.mapAttrs (n: v: "${./packages}/${n}") (lib.filterAttrs (n: v: v == "directory" && (builtins.readDir "${./packages}/${n}") ? "default.nix") (builtins.readDir ./packages)); packagePaths = lib.mapAttrs (n: v: "${./packages}/${n}") (lib.filterAttrs (n: v: v == "directory" && (builtins.readDir "${./packages}/${n}") ? "default.nix") (builtins.readDir ./packages));
in rec { in rec {
packages = lib.genAttrs systems (system: lib.mapAttrs (n: v: lib.callPackageWith ((lib.recursiveUpdate packages.${system} nixpkgs.legacyPackages.${system}) // { inherit inputs; inherit system; etherlab = (etherlab-pkgs system); }) v {}) packagePaths); packages = lib.genAttrs systems (system: lib.mapAttrs (n: v: lib.callPackageWith ((lib.recursiveUpdate packages.${system} nixpkgs.legacyPackages.${system}) // { inherit inputs; inherit system; etherlab = etherlab.packages.${system}; }) v {}) packagePaths);
legacyPackages = packages; legacyPackages = packages;
overlay = final: prev: (lib.mapAttrs (n: v: prev.callPackage v { }) packagePaths); overlay = final: prev: (lib.mapAttrs (n: v: prev.callPackage v { }) packagePaths);
nixosModules = { linuxcnc = import ./modules/linuxcnc.nix; }; nixosModules = { linuxcnc = import ./modules/linuxcnc.nix; };