Skip to content

Commit dcfee62

Browse files
committed
🔨 Add scripts/update.sh for NixOS users
1 parent 35f49e9 commit dcfee62

File tree

7 files changed

+25
-4
lines changed

7 files changed

+25
-4
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ repos:
4545
hooks:
4646
- id: check-mailmap
4747
- repo: https://github.com/rhysd/actionlint
48-
rev: v1.7.3
48+
rev: v1.7.4
4949
hooks:
5050
- id: actionlint
5151
- repo: https://github.com/adrienverge/yamllint
@@ -67,7 +67,7 @@ repos:
6767
- mdformat-config
6868
- mdformat-web
6969
- repo: https://github.com/DavidAnson/markdownlint-cli2
70-
rev: v0.14.0
70+
rev: v0.15.0
7171
hooks:
7272
- id: markdownlint-cli2
7373
additional_dependencies:

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333

3434
## Install
3535

36+
**NOTE**: upstream xml has been [broken](https://github.com/lubyk/xml/pull/20).
37+
use the [fork](assets/rockspecs/xml-1.1.3-1.rockspec) before installing.
38+
3639
### rocks.nvim
3740

3841
#### Command style
@@ -76,7 +79,7 @@ require"code-stats".setup({
7679
})
7780
```
7881

79-
For compatibility for
82+
For compatibility of
8083
[code-stats-zsh](https://gitlab.com/code-stats/code-stats-zsh) and
8184
[code-stats-bash](https://github.com/Freed-Wu/code-stats-bash), the following is
8285
also OK:
@@ -93,6 +96,12 @@ require"code-stats".setup({
9396
CODESTATS_API_KEY=XXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9497
```
9598

99+
## Tips
100+
101+
For Nix user, run
102+
`/the/path/of/luarocks/rocks-5.1/code-stats.nvim/VERSION/scripts/update.sh` when
103+
dynamic link libraries are broken after `nix-collect-garbage -d`.
104+
96105
## Related Projects
97106

98107
- [code-stats-vim](https://gitlab.com/code-stats/code-stats-vim)

code-stats.nvim-scm-1.rockspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ end
3333

3434
build = {
3535
type = 'builtin',
36-
copy_directories = { 'plugin' } ,
36+
copy_directories = { 'plugin', 'assets', 'scripts' } ,
3737
}

scripts/get-OPENSSL_INCDIR.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env -S nix eval --impure -f
2+
"${(import <nixpkgs> {}).openssl.dev}/include"

scripts/get-OPENSSL_LIBDIR.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env -S nix eval --impure -f
2+
"${(import <nixpkgs> {}).openssl.out}/lib"

scripts/get-STDCPP_LIBDIR.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env -S nix eval --impure -f
2+
"${(import <nixpkgs> {}).stdenv.cc.cc.lib}/lib"

scripts/update.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
cd "$(dirname "$(dirname "$(readlink -f "$0")")")"
4+
5+
eval "luarocks install --local --force assets/rockspecs/xml-1.1.3-1.rockspec STDCPP_LIBDIR=$(scripts/get-STDCPP_LIBDIR.nix)"
6+
eval "luarocks install --local --force lua-requests OPENSSL_INCDIR=$(scripts/get-OPENSSL_INCDIR.nix) OPENSSL_LIBDIR=$(scripts/get-OPENSSL_LIBDIR.nix)"

0 commit comments

Comments
 (0)