fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

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

nix: use flakes (#570)

This copies how we do it in the Sourcegraph repo, using the same lock
file to ensure we are using the same versions.

Test Plan: nix develop

+67 -29
+26
flake.lock
··· 1 + { 2 + "nodes": { 3 + "nixpkgs": { 4 + "locked": { 5 + "lastModified": 1676110339, 6 + "narHash": "sha256-kOS/L8OOL2odpCOM11IevfHxcUeE0vnZUQ74EOiwXcs=", 7 + "owner": "NixOS", 8 + "repo": "nixpkgs", 9 + "rev": "e5530aba13caff5a4f41713f1265b754dc2abfd8", 10 + "type": "github" 11 + }, 12 + "original": { 13 + "id": "nixpkgs", 14 + "ref": "nixos-unstable", 15 + "type": "indirect" 16 + } 17 + }, 18 + "root": { 19 + "inputs": { 20 + "nixpkgs": "nixpkgs" 21 + } 22 + } 23 + }, 24 + "root": "root", 25 + "version": 7 26 + }
+35
flake.nix
··· 1 + { 2 + description = "The Zoekt developer environment Nix Flake"; 3 + 4 + inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; }; 5 + 6 + outputs = { self, nixpkgs }: { 7 + devShells = nixpkgs.lib.genAttrs [ 8 + "x86_64-linux" 9 + "aarch64-linux" 10 + "aarch64-darwin" 11 + "x86_64-darwin" 12 + ] (system: 13 + let 14 + pkgs = import nixpkgs { 15 + inherit system; 16 + overlays = [ self.overlays.ctags ]; 17 + }; 18 + in { default = import ./shell.nix { inherit pkgs; }; }); 19 + # Pin a specific version of universal-ctags to the same version as in cmd/symbols/ctags-install-alpine.sh. 20 + overlays.ctags = self: super: rec { 21 + universal-ctags = super.universal-ctags.overrideAttrs (old: { 22 + version = "5.9.20220403.0"; 23 + src = super.fetchFromGitHub { 24 + owner = "universal-ctags"; 25 + repo = "ctags"; 26 + rev = "f95bb3497f53748c2b6afc7f298cff218103ab90"; 27 + sha256 = "sha256-pd89KERQj6K11Nue3YFNO+NLOJGqcMnHkeqtWvMFk38="; 28 + }; 29 + # disable checks, else we get `make[1]: *** No rule to make target 'optlib/cmake.c'. Stop.` 30 + doCheck = false; 31 + checkFlags = [ ]; 32 + }); 33 + }; 34 + }; 35 + }
+6 -29
shell.nix
··· 1 + { pkgs }: 1 2 let 2 - # Pin a specific version of universal-ctags to the same version as in cmd/symbols/ctags-install-alpine.sh. 3 - ctags-overlay = (self: super: { 4 - universal-ctags = super.universal-ctags.overrideAttrs (old: { 5 - version = "5.9.20220403.0"; 6 - src = super.fetchFromGitHub { 7 - owner = "universal-ctags"; 8 - repo = "ctags"; 9 - rev = "f95bb3497f53748c2b6afc7f298cff218103ab90"; 10 - sha256 = "sha256-pd89KERQj6K11Nue3YFNO+NLOJGqcMnHkeqtWvMFk38="; 11 - }; 12 - # disable checks, else we get `make[1]: *** No rule to make target 'optlib/cmake.c'. Stop.` 13 - doCheck = false; 14 - checkFlags = [ ]; 15 - }); 16 - }); 17 - # Pin a specific version of nixpkgs to ensure we get the same packages. 18 - pkgs = import 19 - (fetchTarball { 20 - url = 21 - "https://github.com/NixOS/nixpkgs/archive/6f38b43c8c84c800f93465b2241156419fd4fd52.tar.gz"; 22 - sha256 = "0xw3y3jx1bcnwsc0imacbp5m8f51b66s9h8kk8qnfbckwv67dhgd"; 23 - }) 24 - { overlays = [ ctags-overlay ]; }; 25 3 # pkgs.universal-ctags installs the binary as "ctags", not "universal-ctags" 26 4 # like zoekt expects. 27 - ctagsWrapper = pkgs.writeScriptBin "universal-ctags" '' 5 + universal-ctags = pkgs.writeScriptBin "universal-ctags" '' 28 6 #!${pkgs.stdenv.shell} 29 7 exec ${pkgs.universal-ctags}/bin/ctags "$@" 30 8 ''; 31 - 32 - in pkgs.mkShell { 9 + in 10 + pkgs.mkShell { 33 11 name = "zoekt"; 34 12 35 13 nativeBuildInputs = [ 36 - pkgs.go_1_19 14 + pkgs.go_1_20 37 15 38 16 # zoekt-git-index 39 17 pkgs.git 40 18 41 19 # Used to index symbols 42 - ctagsWrapper 43 - pkgs.universal-ctags 20 + universal-ctags 44 21 ]; 45 22 }