packages/flake.nix

104 lines
3.4 KiB
Nix

{
description = "artemist's NixOS packages and shells for development";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs =
{ self, nixpkgs }:
let
inherit (nixpkgs) lib;
makePkgs =
system:
import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
forAllSystems =
f:
lib.listToAttrs (
map (system: {
name = system;
value = f (makePkgs system);
}) lib.systems.flakeExposed
);
makeDummy =
pkg:
if lib.isDerivation pkg then
pkg
else
pkg
// {
type = "derivation";
name = "dummy-attrset";
};
in
{
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
devShells = forAllSystems (pkgs: {
armTrustedFirmware = pkgs.callPackage ./shells/armTrustedFirmware { };
plotter = pkgs.callPackage ./shells/plotter { };
rust = pkgs.callPackage ./shells/rust { };
rust9x = pkgs.callPackage ./shells/rust9x { };
rust-libclang = pkgs.callPackage ./shells/rust-libclang { };
ryujinx = pkgs.callPackage ./shells/ryujinx { };
uboot = pkgs.callPackage ./shells/uboot { };
zephyr = pkgs.callPackage ./shells/zephyr { };
});
packages = forAllSystems (
pkgs:
builtins.listToAttrs (
let
names = builtins.attrNames (self.overlays.default pkgs pkgs);
in
lib.concatMap (
name:
lib.optional (builtins.typeOf pkgs.${name} == "set") {
inherit name;
value = makeDummy pkgs.${name};
}
) names
)
);
overlays.default = final: prev: {
apotris = final.callPackage ./packages/apotris { };
attic = final.callPackage ./packages/attic { };
attic-client = final.attic.override { clientOnly = true; };
cups-dymo-patched = final.callPackage ./packages/cups-dymo { };
cynthion = final.callPackage ./packages/cynthion { };
gbeplus = final.callPackage ./packages/gbeplus { };
hactoolnet = final.callPackage ./packages/hactoolnet { };
ipsw = final.callPackage ./packages/ipsw { };
jlink = final.callPackage ./packages/jlink { };
packetry = final.callPackage ./packages/packetry { };
stlink-tool = final.callPackage ./packages/stlink-tool { };
xwin = final.callPackage ./packages/xwin { };
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; })
)
];
};
};
}