+22
-5
README.md
+22
-5
README.md
···
3
3
Modules for [Elvish Shell](https://github.com/elves/elvish)
4
4
5
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
+
```
6
17
18
+
Install module
7
19
```elvish
8
20
use epm
9
-
epm:install &silent-if-installed=$true github.com/ejrichards/mellon
21
+
epm:install &silent-if-installed=$true git.sr.ht/~ejri/mellon
10
22
11
23
```
12
24
···
14
26
15
27
`flake.nix` supplies a NixOS module that lets you import in the same manner as `epm`
16
28
29
+
Input
30
+
```nix
31
+
mellon.url = "git+https://git.sr.ht/~ejri/mellon";
32
+
```
33
+
Use module
17
34
```nix
18
35
{
19
36
...
···
28
45
# Usage
29
46
30
47
```elvish
31
-
use github.com/ejrichards/mellon/<module>
48
+
use git.sr.ht/~ejri/mellon/<module>
32
49
```
33
50
34
51
## `atuin.elv`
···
36
53
Add bindings for `Ctrl-r` and `Up` to use atuin for searching history.
37
54
```elvish
38
55
if (has-external atuin) {
39
-
use github.com/ejrichards/mellon/atuin
56
+
use git.sr.ht/~ejri/mellon/atuin
40
57
set edit:insert:binding[Ctrl-r] = { atuin:search }
41
58
set edit:insert:binding[Up] = { atuin:search-up }
42
59
}
···
47
64
Add bindings for `Ctrl-r` and `Up` to use fzf for searching history.
48
65
```elvish
49
66
if (has-external fzf) {
50
-
use github.com/ejrichards/mellon/fzf
67
+
use git.sr.ht/~ejri/mellon/fzf
51
68
set edit:insert:binding[Ctrl-r] = { fzf:history }
52
69
set edit:insert:binding[Up] = { fzf:history }
53
70
}
···
58
75
Add an alias `y` that will `cd` on quit.
59
76
```elvish
60
77
if (has-external yazi) {
61
-
use github.com/ejrichards/mellon/yazi
78
+
use git.sr.ht/~ejri/mellon/yazi
62
79
edit:add-var y~ $yazi:y~
63
80
}
64
81
```
+5
-2
atuin.elv
+5
-2
atuin.elv
+7
-26
flake.lock
+7
-26
flake.lock
···
1
1
{
2
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
3
"nixpkgs": {
22
4
"locked": {
23
-
"lastModified": 1737885589,
24
-
"narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=",
5
+
"lastModified": 1764517877,
6
+
"narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=",
25
7
"owner": "NixOS",
26
8
"repo": "nixpkgs",
27
-
"rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8",
9
+
"rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c",
28
10
"type": "github"
29
11
},
30
12
"original": {
···
36
18
},
37
19
"root": {
38
20
"inputs": {
39
-
"flake-utils": "flake-utils",
40
-
"nixpkgs": "nixpkgs"
21
+
"nixpkgs": "nixpkgs",
22
+
"systems": "systems"
41
23
}
42
24
},
43
25
"systems": {
···
50
32
"type": "github"
51
33
},
52
34
"original": {
53
-
"owner": "nix-systems",
54
-
"repo": "default",
55
-
"type": "github"
35
+
"id": "systems",
36
+
"type": "indirect"
56
37
}
57
38
}
58
39
},
+24
-21
flake.nix
+24
-21
flake.nix
···
1
1
{
2
2
inputs = {
3
3
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4
-
flake-utils.url = "github:numtide/flake-utils";
5
4
};
6
5
7
6
outputs =
8
7
{
9
8
self,
9
+
systems,
10
10
nixpkgs,
11
-
flake-utils,
12
11
}:
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
-
// {
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
+
30
33
nixosModules.default =
31
34
{ pkgs, ... }:
32
35
{
33
-
environment.systemPackages = [ self.packages.${pkgs.system}.default ];
34
-
environment.pathsToLink = [ "/share/elvish/lib/github.com/ejrichards" ];
36
+
environment.systemPackages = [ self.packages.${pkgs.stdenv.hostPlatform.system}.default ];
37
+
environment.pathsToLink = [ "/share/elvish/lib/git.sr.ht/~ejri" ];
35
38
};
36
39
};
37
40
}