39 lines
1.3 KiB
Nix
39 lines
1.3 KiB
Nix
{
|
|
description = "cutie flake ~";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
gitignore = { url = "github:hercules-ci/gitignore.nix"; flake = false; };
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
rustup.url = "github:oxalica/rust-overlay";
|
|
};
|
|
|
|
outputs = inputs@{ self, nixpkgs, flake-utils, rustup, ... }:
|
|
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system: let
|
|
overlays = [ (import rustup) ];
|
|
pkgs = import nixpkgs { inherit system overlays; };
|
|
libPath = with pkgs; lib.makeLibraryPath [
|
|
libGL libxkbcommon
|
|
wayland wayland-utils
|
|
musl musl-fts musl-obstack
|
|
makeWrapper pkg-config gcc
|
|
libiconv libtool autoconf automake
|
|
];
|
|
gitignoreSrc = pkgs.callPackage inputs.gitignore { };
|
|
in rec {
|
|
packages.hello = pkgs.callPackage ./default.nix { inherit gitignoreSrc; };
|
|
legacyPackages = packages;
|
|
defaultPackage = packages.hello;
|
|
devShell = pkgs.mkShell {
|
|
CARGO_INSTALL_ROOT = "${toString ./.}/.cargo";
|
|
|
|
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
|
|
LD_LIBRARY_PATH = libPath;
|
|
|
|
buildInputs = with pkgs; [ (rust-bin.selectLatestNightlyWith (toolchain: toolchain.complete.override {
|
|
targets = [ "x86_64-unknown-linux-musl" "wasm32-unknown-unknown" ];
|
|
})) ];
|
|
};
|
|
});
|
|
}
|