Skip to content

Commit

Permalink
Merge pull request #13 from tsandrini/update-devenv
Browse files Browse the repository at this point in the history
Update devenv
  • Loading branch information
tsandrini authored Mar 29, 2024
2 parents 01923c1 + b2e5ae7 commit 6eb9980
Show file tree
Hide file tree
Showing 51 changed files with 1,232 additions and 413 deletions.
9 changes: 5 additions & 4 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
fi


watch_file flake.nix
if ! use flake .#dev --impure --accept-flake-config
watch_file flake.lock

if ! use flake .#dev --accept-flake-config --override-input devenv-root "file+file://"<(printf %s "$PWD")
then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
fi
16 changes: 9 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ updates (if applicable). -->

<!-- Ensure you've gone through this checklist before submitting your PR. -->

- [ ] I have tested the relevant changes locally.
- [ ] I have checked that `nix flake check --impure` passes.
- [ ] I have ensured my commits follow the project's conventional commits guidelines.
- [ ] I have checked that the changes follow a linear history.
- [ ] (If applicable) I have commented any relevant parts of my code.
- [ ] (If applicable) I have added appropriate unit/feature tests.
- [ ] (If applicable) I have updated the documentation accordingly (in English).
- \[ \] I have tested the relevant changes locally.
- \[ \] I have checked that
`nix flake check --override-input devenv-root "file+file://"<(printf %s "$PWD")`
passes.
- \[ \] I have ensured my commits follow the project's conventional commits guidelines.
- \[ \] I have checked that the changes follow a linear history.
- \[ \] (If applicable) I have commented any relevant parts of my code.
- \[ \] (If applicable) I have added appropriate unit/feature tests.
- \[ \] (If applicable) I have updated the documentation accordingly (in English).

## Additional Notes

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/check-on-merge.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: "flake check"

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
check:
# if: false # NOTE: Uncomment this line to disable the workflow
Expand All @@ -12,8 +10,6 @@ jobs:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- run: nix flake check --impure --show-trace --accept-flake-config

- run: nix flake check --override-input devenv-root "file+file://"<(printf %s "$PWD") --show-trace --accept-flake-config
- name: Check Nix flake Nixpkgs inputs
uses: DeterminateSystems/flake-checker-action@main
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,27 @@ And you're good to go! 👍
[NixOS modules](https://nixos.wiki/wiki/NixOS_Modules),
[home-manager](https://github.com/nix-community/home-manager) userspace,
you can always use the same underlying structure
2. [devenv.sh](https://github.com/cachix/devenv) is awesome! 🔥
1. [devenv.sh](https://github.com/cachix/devenv) is awesome! 🔥
- includes a devenv shell already preconfigured to format and lint nix
3. [treefmt](https://github.com/numtide/treefmt) is the one and only formatter
1. [treefmt](https://github.com/numtide/treefmt) is the one and only formatter
to rule them all 🙏
4. Already preconfigured [github actions](https://docs.github.com/en/actions)
1. Already preconfigured [github actions](https://docs.github.com/en/actions)
and [gitlab CI](https://docs.gitlab.com/ee/ci/) 💪
- automatic `nix flake check` on pull/merge requests
- automatic nixpkgs flake inputs checker (github only)
- automatic cron based flake inputs updates (github only)
- (optional) push to [FlakeHub](https://flakehub.com/)
5. Prepared for custom `lib` overrides 🤓
1. Prepared for custom `lib` overrides 🤓
- depending on what you're currently aiming to write, you might need some
custom helpers or library functions, this template
already set ups all the necessary boilerplate to get it all going
6. And finally, examples included 🖌️
1. And finally, examples included 🖌️

## Usage

After a proper installation process you can enter the development environment

1. either using [direnv](https://github.com/direnv/direnv) `direnv allow`
2. or directly `nix develop .#dev --impure`
with `direnv allow` (or alternatively
`nix develop .#dev --override-input devenv-root "file+file://"<(printf %s "$PWD")`)

While not many, the code has some required references to the `practicalFlakes`
identifier. This can be renamed in the whole project using the script
Expand Down
Loading

0 comments on commit 6eb9980

Please sign in to comment.