{ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; flake-utils.url = "github:numtide/flake-utils"; crane.url = "github:ipetkov/crane"; advisory-db = { url = "github:rustsec/advisory-db"; flake = false; }; }; nixConfig = { extra-substituters = ["https://crane.cachix.org"]; extra-trusted-public-keys = ["crane.cachix.org-1:8Scfpmn9w+hGdXH/Q9tTLiYAE/2dnJYRJP7kl80GuRk="]; }; outputs = { self, nixpkgs, flake-utils, crane, advisory-db, }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; craneLib = crane.mkLib pkgs; orgtoical = rec { src = craneLib.path ./.; args = { inherit src; inherit cargoArtifacts; }; cargoArtifacts = craneLib.buildDepsOnly args; package = craneLib.buildPackage args; checks = { build = package; fmt = craneLib.cargoFmt {inherit src;}; audit = craneLib.cargoAudit {inherit src advisory-db;}; clippy = craneLib.cargoClippy args; docs = craneLib.cargoDoc args; }; }; in { packages.orgtoical = orgtoical.package; checks = orgtoical.checks; devShells.default = with pkgs; craneLib.devShell { packages = [ nil rust-analyzer cargo-audit ]; }; formatter = pkgs.alejandra; }); }