Files
linuxcnc-nix/flake.nix
2023-09-27 18:37:55 +03:00

21 lines
1.0 KiB
Nix

{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
etherlab.url = "git+https://git.dripco.eu/nic/etherlab-nix";
};
outputs = { self, nixpkgs, flake-compat, etherlab }@inputs:
let
etherlab-pkgs = system: etherlab.packages.${system};
systems = nixpkgs.lib.platforms.linux;
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));
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);
legacyPackages = packages;
overlay = final: prev: (lib.mapAttrs (n: v: prev.callPackage v { }) packagePaths);
nixosModules = { linuxcnc = import ./modules/linuxcnc.nix; };
};
}