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.

init: flake packaging vit

author
dev
date (Jul 18, 2026, 5:56 PM -0700) commit 909a24b0
+103
+27
flake.lock
··· 1 + { 2 + "nodes": { 3 + "nixpkgs": { 4 + "locked": { 5 + "lastModified": 1784356753, 6 + "narHash": "sha256-12KrbMiWLcf8m7pCvAtZh1ZrgF85ZXDXvfR/fWTKy84=", 7 + "owner": "NixOS", 8 + "repo": "nixpkgs", 9 + "rev": "61b7c44c4073f0b827768aff0049561b5110ea5a", 10 + "type": "github" 11 + }, 12 + "original": { 13 + "owner": "NixOS", 14 + "ref": "nixos-unstable", 15 + "repo": "nixpkgs", 16 + "type": "github" 17 + } 18 + }, 19 + "root": { 20 + "inputs": { 21 + "nixpkgs": "nixpkgs" 22 + } 23 + } 24 + }, 25 + "root": "root", 26 + "version": 7 27 + }
+40
flake.nix
··· 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 + in 25 + { 26 + vit = pkgs.callPackage ./packages/vit { }; 27 + default = self.packages.${system}.vit; 28 + } 29 + ); 30 + 31 + # Convenience: `nix run .#vit -- --help` 32 + apps = forAllSystems (system: { 33 + vit = { 34 + type = "app"; 35 + program = "${self.packages.${system}.vit}/bin/vit"; 36 + }; 37 + default = self.apps.${system}.vit; 38 + }); 39 + }; 40 + }
+36
packages/vit/default.nix
··· 1 + { 2 + lib, 3 + buildNpmPackage, 4 + fetchFromGitHub, 5 + }: 6 + 7 + buildNpmPackage (finalAttrs: { 8 + pname = "vit"; 9 + version = "0.6.1"; 10 + 11 + src = fetchFromGitHub { 12 + owner = "solpbc"; 13 + repo = "vit"; 14 + rev = "v${finalAttrs.version}"; 15 + hash = "sha256-iICVLod9SnBxm/4nQuD/cecOobP7QHRgG4LZmZEUYRg="; 16 + }; 17 + 18 + # Prefetched offline npm dependency cache (from package-lock.json). 19 + # To update after a version bump: set to lib.fakeHash, build once, paste the hash nix prints. 20 + npmDepsHash = "sha256-nH6gXa7r8n3yxF96B8Ep6kATFrPbANg43V3EatqiITQ="; 21 + 22 + # Pure JS CLI — package.json has no "build" script. 23 + dontNpmBuild = true; 24 + 25 + # Upstream postinstall copies agent skills into $HOME; skip in the build sandbox. 26 + npmFlags = [ "--ignore-scripts" ]; 27 + 28 + meta = { 29 + description = "Social toolkit for personalized software (AT Protocol capability CLI)"; 30 + homepage = "https://v-it.org"; 31 + changelog = "https://github.com/solpbc/vit/releases/tag/v${finalAttrs.version}"; 32 + license = lib.licenses.mit; 33 + mainProgram = "vit"; 34 + platforms = lib.platforms.all; 35 + }; 36 + })