{ inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, flake-utils, fenix }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; overlays = [ fenix.overlays.default ]; }; GARBAGE_VERSION = if (self ? rev) then "nix-${self.rev}" else "dirty"; toolchain = pkgs.fenix.stable; flakePkgs = { garbage = pkgs.callPackage ./. { inherit toolchain GARBAGE_VERSION; }; }; in rec { packages = flake-utils.lib.flattenTree flakePkgs; defaultPackage = flakePkgs.garbage; devShell = pkgs.mkShell { inputsFrom = with packages; [ garbage ]; packages = (with pkgs; [ cargo-watch cargo-deny cargo-edit cargo-release ]) ++ (with toolchain; [ rustfmt ]); inherit GARBAGE_VERSION; }; }); }