xplr/flake.nix

64 lines
1.5 KiB
Nix
Raw Normal View History

2022-11-12 00:05:02 +03:00
{
description = "xplr - A hackable, minimal, fast TUI file explorer";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
2022-11-12 18:28:59 +03:00
nix.url = "github:domenkozar/nix/relaxed-flakes";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
2022-11-12 00:05:02 +03:00
};
2022-11-12 18:28:59 +03:00
outputs = { self, nixpkgs, nix, ... }:
let
2022-11-12 23:09:24 +03:00
systems = [
"x86_64-linux"
"i686-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
2022-11-12 18:28:59 +03:00
forAllSystems = f: builtins.listToAttrs (map (name: { inherit name; value = f name; }) systems);
in
{
packages = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
xplr = pkgs.rustPlatform.buildRustPackage rec {
name = "xplr";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
2022-11-12 18:11:42 +03:00
};
2022-11-12 00:05:02 +03:00
};
2022-11-12 23:09:24 +03:00
}
);
2022-11-12 18:28:59 +03:00
defaultPackage = forAllSystems (system: self.packages.${system}.xplr);
2022-11-12 23:09:24 +03:00
devShells = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
devRequirements = with pkgs; [
gcc
gnumake
clippy
rustc
cargo
rustfmt
rust-analyzer
];
in
{
default = pkgs.mkShell {
RUST_BACKTRACE = 1;
buildInputs = devRequirements;
packages = devRequirements;
};
}
);
2022-11-12 18:28:59 +03:00
};
2022-11-12 00:05:02 +03:00
}