Nix packages for third-party projects that don't ship their own flakes
0

Configure Feed

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

agentic / flake.nix
3.6 kB 112 lines
1{ 2 description = "Nix packages for third-party projects that don't ship their own flakes"; 3 4 inputs = { 5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 }; 7 8 outputs = 9 { self, nixpkgs }: 10 let 11 systems = [ 12 "x86_64-linux" 13 "aarch64-linux" 14 "x86_64-darwin" 15 "aarch64-darwin" 16 ]; 17 forAllSystems = nixpkgs.lib.genAttrs systems; 18 in 19 { 20 packages = forAllSystems ( 21 system: 22 let 23 pkgs = nixpkgs.legacyPackages.${system}; 24 # boxd is a binary-only redistributable CLI (unfreeRedistributable). 25 # Import a pkgs set that only allows that attr so `nix build .#boxd` 26 # works without a global allowUnfree. 27 pkgsUnfree = import nixpkgs { 28 inherit system; 29 config.allowUnfreePredicate = 30 pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "boxd" ]; 31 }; 32 in 33 { 34 vit = pkgs.callPackage ./packages/vit { }; 35 spinel = pkgs.callPackage ./packages/spinel { }; 36 rook = pkgs.callPackage ./packages/rook { }; 37 whetuu = pkgs.callPackage ./packages/whetuu { }; 38 pullrun = pkgs.callPackage ./packages/pullrun { }; 39 gleam-preview = pkgs.callPackage ./packages/gleam-preview { }; 40 default = self.packages.${system}.vit; 41 } 42 // pkgs.lib.optionalAttrs ( 43 builtins.elem system [ 44 "x86_64-linux" 45 "aarch64-linux" 46 "aarch64-darwin" 47 ] 48 ) { 49 # Official prebuilt CLI (static binary); no darwin-x86_64 upstream. 50 boxd = pkgsUnfree.callPackage ./packages/boxd { }; 51 } 52 // pkgs.lib.optionalAttrs (system == "x86_64-linux") { 53 # Official preview tarball is only fetched for x86_64-linux. 54 zed-preview = pkgs.callPackage ./packages/zed-preview { }; 55 } 56 ); 57 58 # Convenience: `nix run .#vit -- --help`, `nix run .#spinel -- --help` 59 apps = forAllSystems ( 60 system: 61 { 62 vit = { 63 type = "app"; 64 program = "${self.packages.${system}.vit}/bin/vit"; 65 }; 66 spinel = { 67 type = "app"; 68 program = "${self.packages.${system}.spinel}/bin/spinel"; 69 }; 70 spin = { 71 type = "app"; 72 program = "${self.packages.${system}.spinel}/bin/spin"; 73 }; 74 rook = { 75 type = "app"; 76 program = "${self.packages.${system}.rook}/bin/rook"; 77 }; 78 whetuu = { 79 type = "app"; 80 program = "${self.packages.${system}.whetuu}/bin/whetuu"; 81 }; 82 pullrun = { 83 type = "app"; 84 program = "${self.packages.${system}.pullrun}/bin/pullrun"; 85 }; 86 gleam-preview = { 87 type = "app"; 88 program = "${self.packages.${system}.gleam-preview}/bin/gleam-preview"; 89 }; 90 default = self.apps.${system}.vit; 91 } 92 // nixpkgs.lib.optionalAttrs ( 93 builtins.elem system [ 94 "x86_64-linux" 95 "aarch64-linux" 96 "aarch64-darwin" 97 ] 98 ) { 99 boxd = { 100 type = "app"; 101 program = "${self.packages.${system}.boxd}/bin/boxd"; 102 }; 103 } 104 // nixpkgs.lib.optionalAttrs (system == "x86_64-linux") { 105 zed-preview = { 106 type = "app"; 107 program = "${self.packages.${system}.zed-preview}/bin/zed-preview"; 108 }; 109 } 110 ); 111 }; 112}