Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ebc320c

Browse files
Merge pull request #65 from nix-dot-dev/devenv
replace all the mess with devenv.sh 8)
2 parents d5bb13e + fe490fc commit ebc320c

File tree

11 files changed

+46
-264
lines changed

11 files changed

+46
-264
lines changed

‎.envrc‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
use nix
1+
watch_file devenv.nix
2+
watch_file devenv.yaml
3+
watch_file devenv.lock
4+
if [[ ! "$DIRENV_ACTIVE" =~ (^|:)"$PWD"(:|$) ]]; then
5+
devenv shell
6+
fi

‎.github/workflows/test.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
- uses: cachix/cachix-action@v12
1212
with:
1313
name: nix-getting-started-template
14-
# If you chose signing key for write access
15-
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
16-
# If you chose API tokens for write access OR if you have a private cache
14+
extraPullNames: devenv
1715
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
18-
- run: nix-build
19-
- run: nix-shell --run "echo OK"
16+
- run: nix profile install github:cachix/devenv/v0.2
17+
name: Install devenv.sh
18+
- run: devenv shell echo ok
19+
- run: devenv ci

‎.github/workflows/update-niv.yml‎

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

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
result
44
result-*
55
.pre-commit-config.yaml
6+
.devenv*

‎README.md‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
# Opinionated Nix repository template
22

3-
Based on [nix.dev](https://nix.dev) tutorials, repository template to get you started with [Nix](https://nixos.org/):
4-
5-
- [niv](https://github.com/nmattia/niv) for painless dependency management (aka pinning) with a daily cronjob to bump dependencies
6-
- [gitignore.nix](https://github.com/hercules-ci/gitignore.nix) for respecting `.gitignore` when using your project as a source
7-
- [pre-commit-hooks.nix](https://github.com/cachix/pre-commit-hooks.nix) for running linters (defaults to `shellcheck`, `nix-linter` and `nixpkgs-fmt`) when committing and on the CI
8-
- [direnv](https://direnv.net/) for automatically loading your developer environment
9-
- [GitHub Actions](https://github.com/features/actions) for CI with [dependabot](https://dependabot.com/) automatically bumping GitHub Actions versions
3+
Based on [devenv.sh](https://devenv.sh) and [Nix basics tutorial](https://nix.dev/tutorials/nix-language) (1-2 hour primer),
4+
this is a simple to get started.
105

116
## Getting started
127

8+
1. [Install Nix and ``devenv``](https://devenv.sh/getting-started/)
139
1. Follow tutorial for [creating a binary cache](https://nix.dev/tutorials/continuous-integration-github-actions.html)
1410
2. Replace ``nix-getting-started-template`` in ``.github/workflows/test.yml`` with the name of your binary cache
1511

1612
## Using the project
1713

18-
Follow [direnv setup](https://nix.dev/tutorials/declarative-and-reproducible-developer-environments.html#direnv-automatically-activating-the-environment-on-directory-change) and run `direnv allow`
14+
Follow [direnv setup](https://devenv.sh/automatic-shell-activation/) and run `direnv allow`.

‎default.nix‎

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

‎devenv.nix‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{ pkgs, ... }:
2+
3+
{
4+
# https://devenv.sh/basics/
5+
env.GREET = "devenv";
6+
7+
# https://devenv.sh/packages/
8+
packages = [ pkgs.git ];
9+
10+
enterShell = ''
11+
hello
12+
git --version
13+
'';
14+
15+
# https://devenv.sh/languages/
16+
languages.nix.enable = true;
17+
18+
# https://devenv.sh/scripts/
19+
scripts.hello.exec = "echo hello from $GREET";
20+
21+
# https://devenv.sh/pre-commit-hooks/
22+
pre-commit.hooks = {
23+
shellcheck.enable = true;
24+
nixpkgs-fmt.enable = true;
25+
nix-linter.enable = true;
26+
};
27+
28+
# https://devenv.sh/processes/
29+
# processes.ping.exec = "ping example.com";
30+
}

‎nix/default.nix‎

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

‎nix/sources.json‎

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

‎nix/sources.nix‎

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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /