terminal user interface to jujutsu. Focused on speed and clarity
10
fork

Configure Feed

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

nix experiments

+226 -201
+4 -1
.envrc
··· 1 - use flake 1 + # shellcheck shell=bash 2 + # For use with direnv. 3 + # Installing nix-direnv will ensure a smoother experience. 4 + use flake
+2 -2
dune-project
··· 20 20 (synopsis "A short synopsis") 21 21 (description "A longer description") 22 22 (depends 23 - ocaml dune stdio nottui lwd base eio_main angstrom ppx_expect ppx_jane 23 + ocaml dune stdio lwd base eio_main angstrom ppx_expect ppx_jane 24 24 lwd 25 25 eio-process 26 - notty 26 + 27 27 28 28 ) 29 29 (tags
-58
flake-old.nix
··· 1 - { 2 - inputs = { 3 - opam-nix.url = "github:tweag/opam-nix"; 4 - flake-utils.url = "github:numtide/flake-utils"; 5 - nixpkgs.follows = "opam-nix/nixpkgs"; 6 - }; 7 - outputs = { self, flake-utils, opam-nix, nixpkgs }@inputs: 8 - flake-utils.lib.eachDefaultSystem (system: 9 - let 10 - pkgs = nixpkgs.legacyPackages.${system}; 11 - on = opam-nix.lib.${system}; 12 - localPackagesQuery = builtins.mapAttrs (_: pkgs.lib.last) 13 - (on.listRepo (on.makeOpamRepo ./.)); 14 - devPackagesQuery = { 15 - # You can add "development" packages here. They will get added to the devShell automatically. 16 - ocaml-lsp-server = "*"; 17 - ocamlformat = "*"; 18 - }; 19 - query = devPackagesQuery // { 20 - ## You can force versions of certain packages here, e.g: 21 - ## - force the ocaml compiler to be taken from opam-repository: 22 - # ocaml-base-compiler = "5.1.0"; 23 - ## - or force the compiler to be taken from nixpkgs and be a certain version: 24 - # ocaml-system = "5.1.0"; 25 - ## - or force ocamlfind to be a certain version: 26 - # ocamlfind = "1.9.2"; 27 - }; 28 - scope = on.buildOpamProject' { 29 - 30 - pkgs=pkgs.pkgsStatic; 31 - } ./. query; 32 - overlay = final: prev: 33 - { 34 - # You can add overrides here 35 - }; 36 - scope' = scope.overrideScope' overlay; 37 - # Packages from devPackagesQuery 38 - devPackages = builtins.attrValues 39 - (pkgs.lib.getAttrs (builtins.attrNames devPackagesQuery) scope'); 40 - # Packages in this workspace 41 - packages = 42 - pkgs.lib.getAttrs (builtins.attrNames localPackagesQuery) scope'; 43 - in { 44 - legacyPackages = scope'; 45 - 46 - # inherit packages; 47 - 48 - ## If you want to have a "default" package which will be built with just `nix build`, do this instead of `inherit packages;`: 49 - packages = packages // { default = packages.jj_tui; }; 50 - 51 - devShells.default = pkgs.mkShell { 52 - inputsFrom = builtins.attrValues packages; 53 - buildInputs = devPackages ++ [ 54 - # You can add packages from nixpkgs here 55 - ]; 56 - }; 57 - }); 58 - }
+156 -19
flake.lock
··· 1 1 { 2 2 "nodes": { 3 - "flake-parts": { 3 + "flake-compat": { 4 + "flake": false, 5 + "locked": { 6 + "lastModified": 1627913399, 7 + "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", 8 + "owner": "edolstra", 9 + "repo": "flake-compat", 10 + "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", 11 + "type": "github" 12 + }, 13 + "original": { 14 + "owner": "edolstra", 15 + "repo": "flake-compat", 16 + "type": "github" 17 + } 18 + }, 19 + "flake-utils": { 4 20 "inputs": { 5 - "nixpkgs-lib": "nixpkgs-lib" 21 + "systems": "systems" 6 22 }, 7 23 "locked": { 8 - "lastModified": 1714641030, 9 - "narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=", 10 - "owner": "hercules-ci", 11 - "repo": "flake-parts", 12 - "rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e", 24 + "lastModified": 1710146030, 25 + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", 26 + "owner": "numtide", 27 + "repo": "flake-utils", 28 + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", 13 29 "type": "github" 14 30 }, 15 31 "original": { 16 - "id": "flake-parts", 17 - "type": "indirect" 32 + "owner": "numtide", 33 + "repo": "flake-utils", 34 + "type": "github" 18 35 } 19 36 }, 20 - "nixpkgs": { 37 + "flake-utils_2": { 38 + "locked": { 39 + "lastModified": 1638122382, 40 + "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", 41 + "owner": "numtide", 42 + "repo": "flake-utils", 43 + "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", 44 + "type": "github" 45 + }, 46 + "original": { 47 + "owner": "numtide", 48 + "repo": "flake-utils", 49 + "type": "github" 50 + } 51 + }, 52 + "mirage-opam-overlays": { 53 + "flake": false, 54 + "locked": { 55 + "lastModified": 1661959605, 56 + "narHash": "sha256-CPTuhYML3F4J58flfp3ZbMNhkRkVFKmBEYBZY5tnQwA=", 57 + "owner": "dune-universe", 58 + "repo": "mirage-opam-overlays", 59 + "rev": "05f1c1823d891ce4d8adab91f5db3ac51d86dc0b", 60 + "type": "github" 61 + }, 62 + "original": { 63 + "owner": "dune-universe", 64 + "repo": "mirage-opam-overlays", 65 + "type": "github" 66 + } 67 + }, 68 + "nixpkgs-unstable": { 21 69 "locked": { 22 70 "lastModified": 1713537308, 23 71 "narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=", ··· 30 78 "type": "indirect" 31 79 } 32 80 }, 33 - "nixpkgs-lib": { 81 + "opam-nix": { 82 + "inputs": { 83 + "flake-compat": "flake-compat", 84 + "flake-utils": "flake-utils_2", 85 + "mirage-opam-overlays": "mirage-opam-overlays", 86 + "nixpkgs": [ 87 + "nixpkgs-unstable" 88 + ], 89 + "opam-overlays": "opam-overlays", 90 + "opam-repository": [ 91 + "opam-repository" 92 + ], 93 + "opam2json": "opam2json" 94 + }, 95 + "locked": { 96 + "lastModified": 1716292162, 97 + "narHash": "sha256-UOJNCbqvxABD56JZtZkv3C9ufdqrs7/Ep4AKkCHgPuo=", 98 + "owner": "tweag", 99 + "repo": "opam-nix", 100 + "rev": "1d3cbd6d3f247db77cb581c88c9a1d72e4acad60", 101 + "type": "github" 102 + }, 103 + "original": { 104 + "owner": "tweag", 105 + "repo": "opam-nix", 106 + "type": "github" 107 + } 108 + }, 109 + "opam-overlays": { 110 + "flake": false, 111 + "locked": { 112 + "lastModified": 1654162756, 113 + "narHash": "sha256-RV68fUK+O3zTx61iiHIoS0LvIk0E4voMp+0SwRg6G6c=", 114 + "owner": "dune-universe", 115 + "repo": "opam-overlays", 116 + "rev": "c8f6ef0fc5272f254df4a971a47de7848cc1c8a4", 117 + "type": "github" 118 + }, 119 + "original": { 120 + "owner": "dune-universe", 121 + "repo": "opam-overlays", 122 + "type": "github" 123 + } 124 + }, 125 + "opam-repository": { 126 + "flake": false, 127 + "locked": { 128 + "lastModified": 1716303402, 129 + "narHash": "sha256-lLuOUEjUVtf9LDlLcedE5NiR6XK4rKvMAIk45PkYF9Y=", 130 + "owner": "ocaml", 131 + "repo": "opam-repository", 132 + "rev": "76de458690e2f14b2a63704d25fa660f17333b62", 133 + "type": "github" 134 + }, 135 + "original": { 136 + "owner": "ocaml", 137 + "repo": "opam-repository", 138 + "type": "github" 139 + } 140 + }, 141 + "opam2json": { 142 + "inputs": { 143 + "nixpkgs": [ 144 + "opam-nix", 145 + "nixpkgs" 146 + ] 147 + }, 34 148 "locked": { 35 - "lastModified": 1714640452, 36 - "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", 37 - "type": "tarball", 38 - "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" 149 + "lastModified": 1671540003, 150 + "narHash": "sha256-5pXfbUfpVABtKbii6aaI2EdAZTjHJ2QntEf0QD2O5AM=", 151 + "owner": "tweag", 152 + "repo": "opam2json", 153 + "rev": "819d291ea95e271b0e6027679de6abb4d4f7f680", 154 + "type": "github" 39 155 }, 40 156 "original": { 41 - "type": "tarball", 42 - "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" 157 + "owner": "tweag", 158 + "repo": "opam2json", 159 + "type": "github" 43 160 } 44 161 }, 45 162 "root": { 46 163 "inputs": { 47 - "flake-parts": "flake-parts", 48 - "nixpkgs": "nixpkgs" 164 + "flake-utils": "flake-utils", 165 + "nixpkgs": [ 166 + "nixpkgs-unstable" 167 + ], 168 + "nixpkgs-unstable": "nixpkgs-unstable", 169 + "opam-nix": "opam-nix", 170 + "opam-repository": "opam-repository" 171 + } 172 + }, 173 + "systems": { 174 + "locked": { 175 + "lastModified": 1681028828, 176 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 177 + "owner": "nix-systems", 178 + "repo": "default", 179 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 180 + "type": "github" 181 + }, 182 + "original": { 183 + "owner": "nix-systems", 184 + "repo": "default", 185 + "type": "github" 49 186 } 50 187 } 51 188 },
+60 -113
flake.nix
··· 1 1 { 2 - description = "Example JavaScript development environment for Zero to Nix"; 3 - 4 - # Flake inputs 5 2 inputs = { 6 - 7 - nixpkgs.url = "nixpkgs-unstable"; # also valid: "nixpkgs" 3 + opam-repository = { 4 + url = "github:ocaml/opam-repository"; 5 + flake = false; 6 + }; 7 + nixpkgs-unstable.url = "nixpkgs-unstable"; 8 + opam-nix = { 9 + url = "github:tweag/opam-nix"; 10 + inputs.nixpkgs.follows = "nixpkgs-unstable"; 11 + inputs.opam-repository.follows = "opam-repository"; 8 12 13 + }; 14 + flake-utils.url = "github:numtide/flake-utils"; 15 + nixpkgs.follows = "nixpkgs-unstable"; 9 16 }; 10 - # Flake outputs 11 - outputs = { self, nixpkgs, flake-parts, ... }@inputs: 12 - flake-parts.lib.mkFlake { inherit inputs; } { 13 - systems = 14 - [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; 15 - perSystem = { config, self', inputs', pkgs, system, ... }: 16 - let 17 - jj_tui = pkgs: ocamlPackages: profile: 17 + outputs = 18 + { self, flake-utils, opam-nix, nixpkgs, opam-repository, ... }@inputs: 19 + # Don't forget to put the package name instead of `throw': 20 + let package = "jj_tui"; 21 + in flake-utils.lib.eachDefaultSystem (system: 22 + let 23 + pkgs = nixpkgs.legacyPackages.${system}; 24 + on = opam-nix.lib.${system}; 25 + devPackagesQuery = { 26 + # You can add "development" packages here. They will get added to the devShell automatically. 27 + # ocaml-lsp-server = "*"; 28 + # ocamlformat = "*"; 29 + }; 30 + query = devPackagesQuery // { 31 + ## You can force versions of certain packages here, e.g: 32 + ## - force the ocaml compiler to be taken from opam-repository: 33 + # ocaml-base-compiler = "5.1.1"; 34 + ## - or force the compiler to be taken from nixpkgs and be a certain version: 35 + ocaml-system = "5.1.1"; 36 + ## - or force ocamlfind to be a certain version: 37 + # ocamlfind = "1.9.2"; 38 + }; 39 + scope = on.buildDuneProject { 40 + pkgs = pkgs.pkgsStatic; 41 + } package ./. query; 18 42 19 - let 20 - eio-process = ocamlPackages.buildDunePackage { 21 - pname = "eio-process"; 22 - version = "0.1.0"; 23 - duneVersion = "3"; 24 - src = pkgs.fetchFromGitHub { 43 + overlay = final: prev: { 44 + # You can add overrides here 45 + ${package} = prev.${package}.overrideAttrs (_: { 46 + env = { DUNE_PROFILE = "static"; }; 25 47 26 - owner = "mbarbin"; 27 - repo = "eio-process"; 28 - rev = "482ba341884dc8711f93ec9cc6d7c941099e0faa"; 29 - sha256 = 30 - "sha256-/Y2U+1y+nDMBrRfDAYif0WJp0vPWmvbSMt39wAB/rS8="; 31 - }; 48 + # Prevent the ocaml dependencies from leaking into dependent environments 49 + doNixSupport = false; 50 + }); 51 + }; 52 + scope' = scope.overrideScope' overlay; 53 + # The main package containing the executable 54 + main = scope'.${package}; 55 + # Packages from devPackagesQuery 56 + devPackages = builtins.attrValues 57 + (pkgs.lib.getAttrs (builtins.attrNames devPackagesQuery) scope'); 58 + in { 59 + legacyPackages = scope'; 32 60 33 - buildInputs = with ocamlPackages; [ 34 - base 35 - eio 36 - parsexp 37 - ppx_compare 38 - ppx_enumerate 39 - ppx_hash 40 - ppx_here 41 - ppx_let 42 - ppx_sexp_conv 43 - ppx_sexp_value 44 - ]; 61 + packages.default = main; 45 62 46 - strictDeps = true; 47 - }; 48 - jj_tui_build_pkgs = 49 - 50 - [ 51 - eio-process 52 - ocamlPackages.parsexp 53 - ocamlPackages.eio_main 54 - ocamlPackages.stdio 55 - ocamlPackages.base 56 - ocamlPackages.angstrom 57 - ocamlPackages.ppx_expect 58 - ocamlPackages.uutf 59 - # ocamlPackages.parsexp 60 - 61 - # Ocaml package dependencies needed to build go here. 62 - ]; 63 - jj_tui = let pname = "jj_tui"; 64 - in ocamlPackages.buildDunePackage { 65 - pname = pname; 66 - version = "0.1.0"; 67 - duneVersion = "3"; 68 - src = ./.; 69 - 70 - buildInputs = jj_tui_build_pkgs; 71 - 72 - 73 - buildPhase = '' 74 - runHook preBuild 75 - dune build -p ${pname} --profile ${profile} ''${enableParallelBuilding:+-j $NIX_BUILD_CORES} 76 - runHook postBuild 77 - ''; 78 - checkPhase = '' 79 - runHook preCheck 80 - dune runtest -p ${pname}--profile ${profile} ''${enableParallelBuilding:+-j $NIX_BUILD_CORES} 81 - runHook postCheck 82 - ''; 83 - installPhase = '' 84 - runHook preInstall 85 - dune install --profile ${profile} --prefix $out --libdir $OCAMLFIND_DESTDIR ${pname} 86 - runHook postInstall 87 - ''; 88 - 89 - }; 90 - in { 91 - jj_tui = jj_tui; 92 - jj_tui_build_pkgs = jj_tui_build_pkgs; 93 - }; 94 - # OCaml packages available on nixpkgs 95 - inherit (pkgs) ocamlPackages mkShell lib; 96 - inherit (ocamlPackages) buildDunePackage; 97 - 98 - in { 99 - packages = { 100 - default = (jj_tui pkgs 101 - ocamlPackages "release").jj_tui; # Development environment output 102 - static = (jj_tui pkgs.pkgsStatic 103 - pkgs.pkgsStatic.ocamlPackages "static").jj_tui; # Development environment output 104 - }; 105 - devShells = { 106 - default = mkShell.override { stdenv = pkgs.gccStdenv; } { 107 - buildInputs = with ocamlPackages; [ 108 - dune_3 109 - ocaml 110 - utop 111 - ocamlformat 112 - ]; 113 - inputsFrom = [ self'.packages.default ]; 114 - packages = builtins.attrValues { 115 - inherit (pkgs) gcc pkg-config; 116 - inherit (ocamlPackages) ocaml-lsp ocamlformat-rpc-lib; 117 - }; 118 - }; 119 - }; 120 - 63 + devShells.default = pkgs.mkShell { 64 + inputsFrom = [ main ]; 65 + buildInputs = devPackages ++ [ 66 + # You can add packages from nixpkgs here 67 + ]; 121 68 }; 122 - }; 69 + }); 123 70 }
+1 -1
jj_tui.opam
··· 44 44 x-opam-monorepo-opam-provided: ["lwd"] 45 45 #This is needed because eio-process doesn't exict 46 46 pin-depends:[ 47 - ["eio-process.dev" "git+https://github.com/mbarbin/eio-process"] 47 + ["eio-process.dev" "git+https://github.com/mbarbin/eio-process#ac1e965eb33f19fcedc7ce203111bca0c3fc8278"] 48 48 ] 49 49
+1 -1
jj_tui.opam.template
··· 2 2 x-opam-monorepo-opam-provided: ["lwd"] 3 3 #This is needed because eio-process doesn't exict 4 4 pin-depends:[ 5 - ["eio-process.dev" "git+https://github.com/mbarbin/eio-process"] 5 + ["eio-process.dev" "git+https://github.com/mbarbin/eio-process#ac1e965eb33f19fcedc7ce203111bca0c3fc8278"] 6 6 ] 7 7
+1 -6
jj_tui/bin/jj_ui.ml
··· 2 2 open Nottui 3 3 open Lwd_infix 4 4 open Global_funcs 5 + open Jj_tui.Util 5 6 module W = Nottui_widgets 6 7 7 8 module Ui = struct ··· 37 38 let _quitButton = 38 39 W.button (Printf.sprintf "quit ") (fun () -> Vars.quit $= true) |> Lwd.pure 39 40 ;; 40 - 41 - let ( <-$ ) f v = Lwd.map ~f (Lwd.get v) 42 - let ( $-> ) v f = Lwd.map ~f (Lwd.get v) 43 - let ( |>$ ) v f = Lwd.map ~f v 44 - let ( >> ) f g x = g (f x) 45 - let ( << ) f g x = f (g x) 46 41 47 42 (* let ( let<- ) v f = Lwd.map ~f (Lwd.get v) *) 48 43
+1
jj_tui/lib/util.ml
··· 29 29 ;; 30 30 let ( <-$ ) f v = Lwd.map ~f (Lwd.get v) 31 31 let ( $-> ) v f = Lwd.map ~f (Lwd.get v) 32 + let ( let$$ ) v f = Lwd.map ~f (Lwd.get v) 32 33 let ( |>$ ) v f = Lwd.map ~f v 33 34 let ( >> ) f g x = g (f x) 34 35 let ( << ) f g x = f (g x)