Skip to content

Commit 430c197

Browse files
authored
fix: update devenv to latest (#20)
- Small changes to the rendering, ignoring `.common`. - Update to latest nixpkgs,devenv etc. - Improve activating python and python env (simplify).
1 parent f999038 commit 430c197

34 files changed

Lines changed: 771 additions & 131 deletions

src/generic/.common/justfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{%- raw -%}
2+
set positional-arguments
3+
set shell := ["bash", "-cue"]
4+
root_dir := `git rev-parse --show-toplevel`
5+
flake_dir := root_dir / "tools/nix"
6+
output_dir := root_dir / ".output"
7+
build_dir := output_dir / "build"
8+
9+
mod nix "./tools/just/nix.just"
10+
mod changelog "./tools/just/changelog.just"
11+
12+
# Default target if you do not specify a target.
13+
default:
14+
just --list --unsorted
15+
16+
# Enter the default Nix development shell and execute the command `"$@`.
17+
develop *args:
18+
just nix::develop "default" "$@"
19+
20+
# Format the project.
21+
format *args:
22+
"{{root_dir}}/tools/scripts/setup-config-files.sh"
23+
nix run --accept-flake-config {{flake_dir}}#treefmt -- "$@"
24+
25+
# Setup the project.
26+
setup *args:
27+
cd "{{root_dir}}" && ./tools/scripts/setup.sh
28+
29+
# Run commands over the ci development shell.
30+
ci *args:
31+
just nix::develop "ci" "$@"
32+
{%- endraw -%}

src/generic/.jinja/common

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/generic/copier.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
_answers_file: tools/configs/copier/answers/.generic.yaml
22
_exclude:
3-
- .jinja
3+
- .common
44
- copier.yaml
55

66
project_authors:

src/generic/justfile.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% include ".jinja/common/justfile" %}
1+
{% include ".common/justfile" %}
22
{%- raw %}
33
# Lint the project.
44
[group('general')]

src/generic/tools/nix/flake.lock

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/generic/tools/nix/flake.nix.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
};
7171
# This is the rolling nixpkgs with what devenv was tested.
7272
nixpkgs-devenv = {
73-
url = "github:cachix/devenv-nixpkgs?ref=d1c30452ebecfc55185ae6d1c983c09da0c274ff";
73+
url = "github:cachix/devenv-nixpkgs?ref=rolling";
7474
};
7575

7676
# To build a base image with Nix.

src/generic/tools/scripts/setup-config-files.sh.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
# shellcheck disable=SC1091
23

34
set -e
45
set -u

src/go/.common/justfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{%- raw -%}
2+
set positional-arguments
3+
set shell := ["bash", "-cue"]
4+
root_dir := `git rev-parse --show-toplevel`
5+
flake_dir := root_dir / "tools/nix"
6+
output_dir := root_dir / ".output"
7+
build_dir := output_dir / "build"
8+
9+
mod nix "./tools/just/nix.just"
10+
mod changelog "./tools/just/changelog.just"
11+
12+
# Default target if you do not specify a target.
13+
default:
14+
just --list --unsorted
15+
16+
# Enter the default Nix development shell and execute the command `"$@`.
17+
develop *args:
18+
just nix::develop "default" "$@"
19+
20+
# Format the project.
21+
format *args:
22+
"{{root_dir}}/tools/scripts/setup-config-files.sh"
23+
nix run --accept-flake-config {{flake_dir}}#treefmt -- "$@"
24+
25+
# Setup the project.
26+
setup *args:
27+
cd "{{root_dir}}" && ./tools/scripts/setup.sh
28+
29+
# Run commands over the ci development shell.
30+
ci *args:
31+
just nix::develop "ci" "$@"
32+
{%- endraw -%}

0 commit comments

Comments
 (0)