icebreaker/flake.nix

72 lines
1.9 KiB
Nix
Raw Permalink Normal View History

2024-04-21 10:35:00 +00:00
{
description = "icebreaker";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
crate2nix.url = "github:nix-community/crate2nix";
};
outputs = { self, nixpkgs, flake-utils, crate2nix, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
crateName = "icebreaker";
inherit (import "${crate2nix}/tools.nix" { inherit pkgs; })
generatedCargoNix;
project = import (generatedCargoNix {
name = crateName;
src = ./.;
}) {
inherit pkgs;
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
alsa-sys = attrs: {
nativeBuildInputs = [
pkgs.pkg-config
];
buildInputs = [
pkgs.alsa-lib.dev
];
};
libudev-sys = attrs: {
nativeBuildInputs = [
pkgs.pkg-config
];
buildInputs = [
pkgs.systemd.dev
];
};
};
};
in
rec {
packages.${crateName} = project.rootCrate.build;
defaultPackage = packages.${crateName};
devShell = pkgs.mkShell {
2024-04-21 16:56:37 +00:00
shellHook = ''export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath (with pkgs; [
vulkan-loader
libxkbcommon
])}"'';
2024-04-21 10:35:00 +00:00
inputsFrom = builtins.attrValues self.packages.${system};
buildInputs = with pkgs; [
cargo
rust-analyzer
clippy
pkg-config
alsa-lib.dev
systemd.dev
2024-04-21 16:56:37 +00:00
# X11 libs
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
2024-04-21 10:35:00 +00:00
];
};
});
}