packages/flake.nix

73 lines
2.4 KiB
Nix

{
description = "artemist's NixOS packages and shells for development";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
inherit (pkgs) lib;
names = builtins.attrNames (self.overlays.default pkgs pkgs);
in {
devShells = {
plotter = pkgs.callPackage ./shells/plotter { };
zephyr = pkgs.callPackage ./shells/zephyr { };
};
formatter = pkgs.nixfmt;
packages = builtins.listToAttrs (lib.concatMap (name:
let pkg = pkgs.${name};
in lib.optional (builtins.typeOf pkg == "set") {
inherit name;
value = if lib.isDerivation pkg then
pkg
else
pkg // {
type = "derivation";
name = "dummy-attrset";
};
}) names);
}) // {
overlays.default = final: prev: {
attic = final.callPackage ./packages/attic { };
attic-client = final.attic.override { clientOnly = true; };
ipsw = final.callPackage ./packages/ipsw { };
jlink = final.callPackage ./packages/jlink { };
zephyrPackages = final.callPackage ./packages/zephyr { };
inherit (final.python3.pkgs) axicli vpype;
inkscape-extensions = prev.inkscape-extensions // {
axidraw = final.callPackage ./packages/axidraw/inkscape.nix { };
};
kernelPatches = prev.kernelPatches
// final.callPackage ./packages/kernelPatches { };
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(pythonFinal: pythonPrev:
{
pnoise = final.callPackage ./packages/pnoise {
python3 = pythonFinal;
};
vpype =
final.callPackage ./packages/vpype { python3 = pythonFinal; };
vpype-gcode = final.callPackage ./packages/vpype-gcode {
python3 = pythonFinal;
};
} // (final.callPackage ./packages/axidraw/modules.nix {
python3 = pythonFinal;
}))
];
};
};
}