Skip to content

Commit a1ee55d

Browse files
committed
devenv: use shared config
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent f7304ee commit a1ee55d

File tree

7 files changed

+56
-83
lines changed

7 files changed

+56
-83
lines changed

.envrc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
#!/usr/bin/env bash
2+
13
export DIRENV_WARN_TIMEOUT=20s
24

35
eval "$(devenv direnvrc)"
46

5-
# The use_devenv function supports passing flags to the devenv command
6-
# For example: use devenv --impure --option services.postgres.enable:bool true
7+
# `use devenv` supports the same options as the `devenv shell` command.
8+
#
9+
# To silence all output, use `--quiet`.
10+
#
11+
# Example usage: use devenv --quiet --impure --option services.postgres.enable:bool true
712
use devenv

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.qmlc
33
*.jsc
44
.idea
5+
.shared
56

67
# Devenv
78
.devenv*

devenv.lock

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"devenv": {
44
"locked": {
55
"dir": "src/modules",
6-
"lastModified": 1749054588,
6+
"lastModified": 1767111144,
77
"owner": "cachix",
88
"repo": "devenv",
9-
"rev": "b6be42d9e6f6053be1d180e4a4fb95e0aa9a8424",
9+
"rev": "4dece0eb98c5ad9e1bda60711228228a023e1652",
1010
"type": "github"
1111
},
1212
"original": {
@@ -19,10 +19,10 @@
1919
"flake-compat": {
2020
"flake": false,
2121
"locked": {
22-
"lastModified": 1747046372,
22+
"lastModified": 1767039857,
2323
"owner": "edolstra",
2424
"repo": "flake-compat",
25-
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
25+
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
2626
"type": "github"
2727
},
2828
"original": {
@@ -40,10 +40,10 @@
4040
]
4141
},
4242
"locked": {
43-
"lastModified": 1747372754,
43+
"lastModified": 1765911976,
4444
"owner": "cachix",
4545
"repo": "git-hooks.nix",
46-
"rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46",
46+
"rev": "b68b780b69702a090c8bb1b973bab13756cc7a27",
4747
"type": "github"
4848
},
4949
"original": {
@@ -60,10 +60,10 @@
6060
]
6161
},
6262
"locked": {
63-
"lastModified": 1709087332,
63+
"lastModified": 1762808025,
6464
"owner": "hercules-ci",
6565
"repo": "gitignore.nix",
66-
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
66+
"rev": "cb5e3fdca1de58ccbc3ef53de65bd372b48f567c",
6767
"type": "github"
6868
},
6969
"original": {
@@ -74,10 +74,10 @@
7474
},
7575
"nixpkgs": {
7676
"locked": {
77-
"lastModified": 1746807397,
77+
"lastModified": 1767052823,
7878
"owner": "cachix",
7979
"repo": "devenv-nixpkgs",
80-
"rev": "c5208b594838ea8e6cca5997fbf784b7cca1ca90",
80+
"rev": "538a5124359f0b3d466e1160378c87887e3b51a4",
8181
"type": "github"
8282
},
8383
"original": {
@@ -94,7 +94,23 @@
9494
"nixpkgs": "nixpkgs",
9595
"pre-commit-hooks": [
9696
"git-hooks"
97-
]
97+
],
98+
"shared": "shared"
99+
}
100+
},
101+
"shared": {
102+
"flake": false,
103+
"locked": {
104+
"lastModified": 1766581418,
105+
"owner": "pbek",
106+
"repo": "nix-shared",
107+
"rev": "c6815e7f9959b7f4a0801697875775db75ae3bf3",
108+
"type": "github"
109+
},
110+
"original": {
111+
"owner": "pbek",
112+
"repo": "nix-shared",
113+
"type": "github"
98114
}
99115
}
100116
},

devenv.nix

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,19 @@
44
}:
55

66
{
7-
# https://devenv.sh/packages/
8-
packages = with pkgs; [
9-
just
10-
php
11-
12-
# Packages for treefmt
13-
nodePackages.prettier
14-
shfmt
15-
nixfmt-rfc-style
16-
statix
17-
taplo
18-
kdePackages.qtdeclarative
19-
];
20-
217
# https://devenv.sh/git-hooks/
22-
git-hooks.hooks.treefmt.enable = true;
8+
git-hooks.hooks = {
9+
# Custom pre-commit hook to format justfile
10+
qmlformat = {
11+
enable = true;
12+
name = "qmlformat";
13+
entry = "${pkgs.qt6.qtdeclarative}/bin/qmlformat -i";
14+
language = "system";
15+
pass_filenames = true;
16+
stages = [ "pre-commit" ];
17+
files = "\\.qml$";
18+
};
19+
};
2320

2421
enterShell = ''
2522
echo "🛠️ QOwnNotes scripts dev shell"

devenv.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@ inputs:
33
nixpkgs:
44
url: github:cachix/devenv-nixpkgs/rolling
55
# url: github:NixOS/nixpkgs/nixos-unstable
6+
shared:
7+
url: github:pbek/nix-shared
8+
flake: false
9+
10+
imports:
11+
- shared/common
12+
- shared/php

justfile

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Use `just <recipe>` to run a recipe
22
# https://just.systems/man/en/
33

4+
import ".shared/common.just"
5+
46
# By default, run the `--list` command
57
default:
68
@just --list
@@ -9,10 +11,6 @@ default:
911

1012
transferDir := `if [ -d "$HOME/NextcloudPrivate/Transfer" ]; then echo "$HOME/NextcloudPrivate/Transfer"; else echo "$HOME/Nextcloud/Transfer"; fi`
1113

12-
# Aliases
13-
14-
alias fmt := format
15-
1614
# Apply the patch to the qownnotes-scripts repository
1715
[group('patch')]
1816
git-apply-patch:
@@ -29,15 +27,3 @@ git-apply-patch:
2927
[group('test')]
3028
@test:
3129
php ./.github/workflows/scripts/run-tests.php
32-
33-
# Add git commit hashes to the .git-blame-ignore-revs file
34-
[group('linter')]
35-
add-git-blame-ignore-revs:
36-
git log --pretty=format:"%H" --grep="^lint" >> .git-blame-ignore-revs
37-
sort .git-blame-ignore-revs | uniq > .git-blame-ignore-revs.tmp
38-
mv .git-blame-ignore-revs.tmp .git-blame-ignore-revs
39-
40-
# Format all files
41-
[group('linter')]
42-
format args='':
43-
treefmt {{ args }}

treefmt.toml

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)