dref/flake.nix

66 lines
1.6 KiB
Nix
Raw Normal View History

2022-12-11 14:08:07 +00:00
{
description = "Build a cargo project without extra checks";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
2022-12-11 18:09:02 +00:00
2022-12-11 18:14:50 +00:00
Xess.url = "github:Xe/Xess";
2022-12-11 14:08:07 +00:00
};
2022-12-11 18:14:50 +00:00
outputs = { self, nixpkgs, crane, flake-utils, Xess, ... }:
2022-12-11 14:08:07 +00:00
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
craneLib = crane.lib.${system};
my-crate = craneLib.buildPackage {
src = craneLib.cleanCargoSource ./.;
buildInputs = [
# Add additional build inputs here
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
# Additional darwin specific inputs can be set here
pkgs.libiconv
];
};
in
{
checks = {
inherit my-crate;
};
apps.default = flake-utils.lib.mkApp {
drv = my-crate;
};
2022-12-11 18:14:50 +00:00
packages = rec {
xess = Xess.packages.${system}.customized ./static/css/theme.css;
bin = my-crate;
default = pkgs.symlinkJoin {
name = "dref-${bin.version}";
paths = [ bin xess ];
};
2022-12-11 18:09:02 +00:00
};
2022-12-11 14:08:07 +00:00
devShells.default = pkgs.mkShell {
inputsFrom = builtins.attrValues self.checks;
# Extra inputs can be added here
nativeBuildInputs = with pkgs; [
cargo
rustc
rust-analyzer
];
};
});
}