Modules for Elvish Shell

Compare changes

Choose any two refs to compare.

+22 -5
README.md
··· 3 Modules for [Elvish Shell](https://github.com/elves/elvish) 4 5 # Install 6 7 ```elvish 8 use epm 9 - epm:install &silent-if-installed=$true github.com/ejrichards/mellon 10 11 ``` 12 ··· 14 15 `flake.nix` supplies a NixOS module that lets you import in the same manner as `epm` 16 17 ```nix 18 { 19 ... ··· 28 # Usage 29 30 ```elvish 31 - use github.com/ejrichards/mellon/<module> 32 ``` 33 34 ## `atuin.elv` ··· 36 Add bindings for `Ctrl-r` and `Up` to use atuin for searching history. 37 ```elvish 38 if (has-external atuin) { 39 - use github.com/ejrichards/mellon/atuin 40 set edit:insert:binding[Ctrl-r] = { atuin:search } 41 set edit:insert:binding[Up] = { atuin:search-up } 42 } ··· 47 Add bindings for `Ctrl-r` and `Up` to use fzf for searching history. 48 ```elvish 49 if (has-external fzf) { 50 - use github.com/ejrichards/mellon/fzf 51 set edit:insert:binding[Ctrl-r] = { fzf:history } 52 set edit:insert:binding[Up] = { fzf:history } 53 } ··· 58 Add an alias `y` that will `cd` on quit. 59 ```elvish 60 if (has-external yazi) { 61 - use github.com/ejrichards/mellon/yazi 62 edit:add-var y~ $yazi:y~ 63 } 64 ```
··· 3 Modules for [Elvish Shell](https://github.com/elves/elvish) 4 5 # Install 6 + ## epm 7 + Required until git.sr.ht is added upstream: 8 + ```elvish 9 + use epm 10 + mkdir -p $epm:managed-dir/git.sr.ht/ 11 + echo "{ 12 + \"method\": \"git\", 13 + \"protocol\": \"https\", 14 + \"levels\": \"2\" 15 + }" > $epm:managed-dir/git.sr.ht/epm-domain.cfg 16 + ``` 17 18 + Install module 19 ```elvish 20 use epm 21 + epm:install &silent-if-installed=$true git.sr.ht/~ejri/mellon 22 23 ``` 24 ··· 26 27 `flake.nix` supplies a NixOS module that lets you import in the same manner as `epm` 28 29 + Input 30 + ```nix 31 + mellon.url = "git+https://git.sr.ht/~ejri/mellon"; 32 + ``` 33 + Use module 34 ```nix 35 { 36 ... ··· 45 # Usage 46 47 ```elvish 48 + use git.sr.ht/~ejri/mellon/<module> 49 ``` 50 51 ## `atuin.elv` ··· 53 Add bindings for `Ctrl-r` and `Up` to use atuin for searching history. 54 ```elvish 55 if (has-external atuin) { 56 + use git.sr.ht/~ejri/mellon/atuin 57 set edit:insert:binding[Ctrl-r] = { atuin:search } 58 set edit:insert:binding[Up] = { atuin:search-up } 59 } ··· 64 Add bindings for `Ctrl-r` and `Up` to use fzf for searching history. 65 ```elvish 66 if (has-external fzf) { 67 + use git.sr.ht/~ejri/mellon/fzf 68 set edit:insert:binding[Ctrl-r] = { fzf:history } 69 set edit:insert:binding[Up] = { fzf:history } 70 } ··· 75 Add an alias `y` that will `cd` on quit. 76 ```elvish 77 if (has-external yazi) { 78 + use git.sr.ht/~ejri/mellon/yazi 79 edit:add-var y~ $yazi:y~ 80 } 81 ```
+5 -2
atuin.elv
··· 34 unset-env ATUIN_HISTORY_ID 35 } 36 37 - # TODO: Add option to not background for use with `$notify-bg-job-success`? 38 - $history-end & 39 } 40 }] 41
··· 34 unset-env ATUIN_HISTORY_ID 35 } 36 37 + if $notify-bg-job-success { 38 + $history-end 39 + } else { 40 + $history-end & 41 + } 42 } 43 }] 44
+7 -26
flake.lock
··· 1 { 2 "nodes": { 3 - "flake-utils": { 4 - "inputs": { 5 - "systems": "systems" 6 - }, 7 - "locked": { 8 - "lastModified": 1731533236, 9 - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 10 - "owner": "numtide", 11 - "repo": "flake-utils", 12 - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 13 - "type": "github" 14 - }, 15 - "original": { 16 - "owner": "numtide", 17 - "repo": "flake-utils", 18 - "type": "github" 19 - } 20 - }, 21 "nixpkgs": { 22 "locked": { 23 - "lastModified": 1737885589, 24 - "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", 25 "owner": "NixOS", 26 "repo": "nixpkgs", 27 - "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", 28 "type": "github" 29 }, 30 "original": { ··· 36 }, 37 "root": { 38 "inputs": { 39 - "flake-utils": "flake-utils", 40 - "nixpkgs": "nixpkgs" 41 } 42 }, 43 "systems": { ··· 50 "type": "github" 51 }, 52 "original": { 53 - "owner": "nix-systems", 54 - "repo": "default", 55 - "type": "github" 56 } 57 } 58 },
··· 1 { 2 "nodes": { 3 "nixpkgs": { 4 "locked": { 5 + "lastModified": 1764517877, 6 + "narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=", 7 "owner": "NixOS", 8 "repo": "nixpkgs", 9 + "rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c", 10 "type": "github" 11 }, 12 "original": { ··· 18 }, 19 "root": { 20 "inputs": { 21 + "nixpkgs": "nixpkgs", 22 + "systems": "systems" 23 } 24 }, 25 "systems": { ··· 32 "type": "github" 33 }, 34 "original": { 35 + "id": "systems", 36 + "type": "indirect" 37 } 38 } 39 },
+24 -21
flake.nix
··· 1 { 2 inputs = { 3 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 4 - flake-utils.url = "github:numtide/flake-utils"; 5 }; 6 7 outputs = 8 { 9 self, 10 nixpkgs, 11 - flake-utils, 12 }: 13 - flake-utils.lib.eachDefaultSystem ( 14 - system: 15 - let 16 - pkgs = nixpkgs.legacyPackages.${system}; 17 - in 18 - { 19 - packages.default = pkgs.stdenv.mkDerivation { 20 - name = "mellon"; 21 - src = ./.; 22 - installPhase = '' 23 - mkdir -p $out/share/elvish/lib/github.com/ejrichards/mellon 24 - cp *.elv $out/share/elvish/lib/github.com/ejrichards/mellon 25 - ''; 26 - }; 27 - } 28 - ) 29 - // { 30 nixosModules.default = 31 { pkgs, ... }: 32 { 33 - environment.systemPackages = [ self.packages.${pkgs.system}.default ]; 34 - environment.pathsToLink = [ "/share/elvish/lib/github.com/ejrichards" ]; 35 }; 36 }; 37 }
··· 1 { 2 inputs = { 3 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 4 }; 5 6 outputs = 7 { 8 self, 9 + systems, 10 nixpkgs, 11 }: 12 + let 13 + eachSystem = nixpkgs.lib.genAttrs (import systems); 14 + in 15 + { 16 + packages = eachSystem ( 17 + system: 18 + let 19 + pkgs = nixpkgs.legacyPackages.${system}; 20 + in 21 + { 22 + default = pkgs.stdenv.mkDerivation { 23 + name = "mellon"; 24 + src = ./.; 25 + installPhase = '' 26 + mkdir -p $out/share/elvish/lib/git.sr.ht/~ejri/mellon 27 + cp *.elv $out/share/elvish/lib/git.sr.ht/~ejri/mellon 28 + ''; 29 + }; 30 + } 31 + ); 32 + 33 nixosModules.default = 34 { pkgs, ... }: 35 { 36 + environment.systemPackages = [ self.packages.${pkgs.stdenv.hostPlatform.system}.default ]; 37 + environment.pathsToLink = [ "/share/elvish/lib/git.sr.ht/~ejri" ]; 38 }; 39 }; 40 }