tree-based source processing language
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

add derivation to build tbsp

+55 -41
+55 -41
flake.nix
··· 1 1 { 2 2 inputs = { 3 - 4 3 nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 5 4 6 5 gitignore = { ··· 9 8 }; 10 9 11 10 rust-overlay = { 12 - url = "github:oxalica/rust-overlay"; 13 - inputs.nixpkgs.follows = "nixpkgs"; 11 + url = "github:oxalica/rust-overlay"; 12 + inputs.nixpkgs.follows = "nixpkgs"; 14 13 }; 15 - 16 14 }; 17 15 18 - outputs = 19 - { self 20 - , nixpkgs 21 - , gitignore 22 - , rust-overlay 23 - }: 24 - let 25 - inherit (gitignore.lib) gitignoreSource; 16 + outputs = { 17 + self, 18 + nixpkgs, 19 + gitignore, 20 + rust-overlay, 21 + }: let 22 + inherit (gitignore.lib) gitignoreSource; 26 23 27 - supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; 28 - forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 29 - nixpkgsFor = forAllSystems (system: 24 + supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; 25 + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 26 + nixpkgsFor = forAllSystems (system: 30 27 import nixpkgs { 31 - inherit system; 32 - overlays = [rust-overlay.overlays.default]; 28 + inherit system; 29 + overlays = [rust-overlay.overlays.default self.overlays.default]; 33 30 }); 34 - 35 - in 36 - { 31 + in { 32 + overlays.default = final: prev: { 33 + tbsp = with final; let 34 + pname = "tbsp"; 35 + packageMeta = (lib.importTOML ./Cargo.toml).package; 36 + rustPlatform = makeRustPlatform { 37 + inherit (final) cargo rustc; 38 + }; 39 + in 40 + rustPlatform.buildRustPackage { 41 + inherit pname; 42 + inherit (packageMeta) version; 37 43 38 - devShell = forAllSystems (system: 39 - let 40 - pkgs = nixpkgsFor."${system}"; 41 - in 42 - pkgs.mkShell { 43 - nativeBuildInputs = [ 44 - pkgs.cargo-watch 45 - pkgs.bacon 46 - pkgs.rustfmt 47 - pkgs.cargo 44 + src = self; 45 + cargoLock.lockFile = ./Cargo.lock; 48 46 49 - pkgs.rust-bin.nightly.latest.default 50 - pkgs.rust-bin.nightly.latest.rust-analyzer 51 - pkgs.lld 52 - pkgs.trunk 47 + meta = with lib; { 48 + description = "tree-based source processing language"; 49 + homepage = "https://git.peppe.rs/languages/tbsp/about"; 50 + license = licenses.mit; 51 + }; 52 + }; 53 + }; 53 54 55 + defaultPackage = forAllSystems (system: nixpkgsFor."${system}".tbsp); 56 + formatter = forAllSystems (system: nixpkgsFor."${system}".alejandra); 54 57 55 - pkgs.mermaid-cli 56 - ]; 57 - RUST_LOG = "info"; 58 - RUST_BACKTRACE = 1; 59 - }); 60 - }; 61 - } 58 + devShell = forAllSystems (system: let 59 + pkgs = nixpkgsFor."${system}"; 60 + in 61 + pkgs.mkShell { 62 + nativeBuildInputs = [ 63 + pkgs.cargo-watch 64 + pkgs.bacon 65 + pkgs.rustfmt 66 + pkgs.cargo 62 67 68 + pkgs.rust-bin.nightly.latest.default 69 + pkgs.rust-bin.nightly.latest.rust-analyzer 63 70 71 + pkgs.mermaid-cli 72 + ]; 73 + RUST_LOG = "info"; 74 + RUST_BACKTRACE = 1; 75 + }); 76 + }; 77 + }