leanshot/flake.nix

34 lines
1.1 KiB
Nix
Raw Normal View History

2023-01-31 19:17:07 +00:00
{
inputs = { fenix.url = "github:nix-community/fenix"; };
outputs = { self, nixpkgs, flake-utils, fenix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ fenix.overlays.default ];
};
toolchain = pkgs.fenix.stable;
flakePkgs = { leanshot = pkgs.callPackage ./. { inherit toolchain; }; };
in rec {
packages = flake-utils.lib.flattenTree flakePkgs;
defaultPackage = packages.leanshot;
devShell = pkgs.mkShell {
inputsFrom = with packages; [ leanshot ];
packages = (with pkgs; [ cargo-watch cargo-deny cargo-edit ])
++ (with toolchain; [ cargo rustc rustfmt ]);
CARGO_UNSTABLE_SPARSE_REGISTRY = "true";
PKG_CONFIG_PATH = let
standardPkgs = pkgs.lib.makeSearchPathOutput "dev" "lib/pkgconfig"
(with pkgs; [ libGL xorg.libX11 ]);
otherPkgs = pkgs.lib.makeSearchPath "pkgconfig"
(with pkgs; [ "${xorg.xorgproto}/share" ]);
in "${standardPkgs}:${otherPkgs}";
};
});
}