{ description = "A latex project manager"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; crane = { url = "github:ipetkov/crane"; inputs = { nixpkgs.follows = "nixpkgs"; }; }; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.follows = "flake-utils"; }; }; # inputs for following systems = { url = "github:nix-systems/x86_64-linux"; # only evaluate for this system }; flake-compat = { url = "github:edolstra/flake-compat"; flake = false; }; flake-utils = { url = "github:numtide/flake-utils"; inputs = { systems.follows = "systems"; }; }; }; outputs = { nixpkgs, flake-utils, crane, rust-overlay, ... }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; overlays = [(import rust-overlay)]; }; nightly = false; rust_minimal = if nightly then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal) else pkgs.rust-bin.stable.latest.minimal; rust_default = if nightly then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default) else pkgs.rust-bin.stable.latest.default; craneLib = (crane.mkLib pkgs).overrideToolchain rust_minimal; craneBuild = craneLib.buildPackage { src = craneLib.cleanCargoSource ./.; doCheck = true; }; in { packages.default = craneBuild; checks = { inherit craneBuild; }; devShells.default = pkgs.mkShell { packages = with pkgs; [ cocogitto rust_default cargo-edit ]; }; }); } # vim: ts=2