Nix flake for developing in NixOS
This commit is contained in:
parent
4dfd9151ee
commit
ec58819a68
4 changed files with 185 additions and 0 deletions
51
flake.nix
Normal file
51
flake.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
};
|
||||
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
|
||||
flake-utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let
|
||||
overlays = [ (import rust-overlay) ];
|
||||
pkgs = import nixpkgs {
|
||||
inherit system overlays;
|
||||
};
|
||||
in
|
||||
with pkgs;
|
||||
{
|
||||
formatter = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
|
||||
devShells.default = mkShell {
|
||||
buildInputs = [
|
||||
rust-bin.stable.latest.default
|
||||
fontconfig
|
||||
freetype
|
||||
libglvnd
|
||||
libinput
|
||||
libxkbcommon
|
||||
vulkan-loader
|
||||
wayland
|
||||
xorg.libX11
|
||||
];
|
||||
|
||||
RUSTFLAGS = map (a: "-C link-arg=${a}") [
|
||||
"-Wl,--push-state,--no-as-needed"
|
||||
"-lEGL"
|
||||
"-lwayland-client"
|
||||
"-Wl,--pop-state"
|
||||
];
|
||||
|
||||
LD_LIBRARY_PATH = lib.makeLibraryPath [
|
||||
libxkbcommon
|
||||
mesa.drivers
|
||||
vulkan-loader
|
||||
xorg.libX11
|
||||
xorg.libXcursor
|
||||
xorg.libXi
|
||||
xorg.libXrandr
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue