1
1
mirror of https://github.com/nmattia/niv.git synced 2024-11-29 00:42:04 +03:00
Commit Graph

407 Commits

Author SHA1 Message Date
Nicolas Mattia
527494090f Speed up initialization
This speeds up the `niv init` command by getting rid of
`nix-prefetch-url` calls (by default). In particular:
* `niv` itself is not added anymore
* `nixpkgs` is fetched from a "known" version
2021-06-07 18:03:50 +02:00
Nicolas Mattia
1819632b58 Update nixpkgs 2021-05-28 14:48:33 +02:00
Nicolas Mattia
94080ae828 Update to latest optparse-applicative 2021-05-11 14:36:18 +02:00
Nicolas Mattia
af958e8057 Update README template 2021-02-04 09:40:18 +01:00
kfollesdal
cd7bb81154 Fix README example 2021-02-04 09:39:01 +01:00
Ömer Sinan Ağacan
3cd7914b2c Slightly refactor renderTemplate to support newer GHCs
This refactoring makes the package build with both the currently
supported GHC (8.6.5) and newer ones (notably 8.10, I haven't tried with
8.8).
2021-01-14 10:19:19 +01:00
Nicolas Mattia
18b7314c13 Remove warnGitHubEnvVars 2021-01-11 20:10:03 +01:00
Nikola Knezevic
94dadba1a3 Start testing on Ubuntu 20.04
GitHub will soon change `ubuntu-latest` label to refer to Ubuntu 20.04:

https://github.blog/changelog/2020-10-29-github-actions-ubuntu-latest-workflows-will-use-ubuntu-20-04/

Thus, to ensure `niv` will work there as well, this adds a matrix run on
ubuntu-20.04.
2021-01-08 16:38:56 +01:00
Nikola Knezevic
071dbac5b3 Fix GitHub action to publish to cachix
GitHub has deprecated setting the environment variables and paths via
echoing to the stdout:

https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Thus, this PR brings the code up to data with the recommendations in the
linked post. In short, paths are exposed to subsequent steps by
appending to the file named in `$GITHUB_PATH`, while environment
variables are set by appending `name=value` to the file named in
`$GITHUB_ENV`.
2021-01-08 16:28:33 +01:00
Nicolas Mattia
62fcf7d085 Release 0.2.19 2021-01-05 11:55:20 +01:00
Nicolas Mattia
d91c8b8051 Add flag for --no-colors 2021-01-05 11:51:20 +01:00
Nicolas Mattia
ba57d5a29b Clarify Git error on missing branch
Whereas before niv would simply say that git didn't produce any output,
it now points out that the branch may not exist:

```
*Niv> :main add git git@github.com:nmattia/niv -b foobar
Adding package niv
  FATAL: Could not read the output of 'git'.
  command: git ls-remote git@github.com:nmattia/niv refs/heads/foobar
  Git didn't produce any output. Does the branch 'foobar' exist?
  FATAL: One or more packages failed to update:
  niv: ExitFailure 1
ERROR: ExitFailure 1
*** Exception: ExitFailure 1
```
2020-11-06 15:59:58 +01:00
Eric Wolf
20c899271f Fix README* 2020-11-02 14:42:14 +01:00
Eric Wolf
205240c278 Remove stray uncompleted sentence 2020-11-02 14:42:14 +01:00
Eric Wolf
45faf8f331 Update README.md 2020-11-02 14:42:14 +01:00
Eric Wolf
c3159e7c9e Update CHANGELOG.md 2020-11-02 14:42:14 +01:00
Eric Wolf
497807b317 Respect type attribute 2020-11-02 14:42:14 +01:00
Nicolas Mattia
9d35b9e483 Turn NIV_OVERRIDE values into paths
Otherwise they're not accessible from the sandbox.
2020-10-05 11:39:37 +02:00
Nicolas Mattia
29ddaaf4e0 Release 0.2.18 2020-09-17 13:32:07 +02:00
Nicolas Mattia
48dee993d2 Prepend environment variables with NIV_
Here we make sure that some environment variables are prepended
(GITHUB_PATH, GITHUB_INSECURE). For consistency's sake, other
environment variables (GITHUB_TOKEN, etc) _can_ also be prepended with
NIV_. This also issues a warning if `GITHUB_PATH` or `GITHUB_INSECURE`
is set.
2020-09-17 13:29:09 +02:00
Nicolas Mattia
dd13098d01 Release 0.2.17 2020-09-08 11:48:42 +02:00
Nicolas Mattia
5c2b920526 Update changelog 2020-09-08 11:45:00 +02:00
Nicolas Mattia
b50a010769 Show version with --version 2020-09-07 16:14:10 +02:00
Nicolas Mattia
6ae4c7700b Don't push drv files to cachix 2020-09-07 16:13:30 +02:00
Nicolas Mattia
fad2a6cbfb Update netlify deploy 2020-08-29 09:42:20 +02:00
Nicolas Mattia
89ae775e9d Add --rev and -r
This should hopefully clarify that `--version` shouldn't be used for
GitHub repositories; moreover setting a particular revision is used much
more often than changing the repo name.
2020-08-21 16:17:27 +02:00
zimbatm
de84001689 sources.nix: bootstrap with a custom system
When combining Nix Flakes with niv, `builtins.currentSystem` is
disabled. This allows to bootstrap nixpkgs by passing the system from
the flake evaluation.
2020-08-21 15:22:14 +02:00
Nicolas Mattia
d13bf5ff11 Add information about ref handling
This adds some warnings when users with existing `ref`-laden sources try
to `niv update`.
2020-08-20 16:54:40 +02:00
Nicolas Mattia
1294b321c8 Stop using ref in builtins.fetchGit fetcher
Instead, sources now record either `branch` or `tag`. The fetcher
specifies the correct ref (`/refs/heads/...` or `/refs/tags/...`) which
works in the newest version of Nix. The `ref` attribute can still be set
to override the logic.
2020-08-20 16:54:40 +02:00
Nicolas Mattia
f0be4cea7d Steal sanitizeDrvName 2020-08-20 11:31:41 +02:00
Nicolas Mattia
5c966856bc Sanitize source name
The `type` sources didn't get their name sanitized. This also fixes a
bug where builtins_fetchTarball would fail if because no name was given.
2020-08-20 11:31:41 +02:00
Nicolas Mattia
13c88bfcc3 Add source name sanitization test 2020-08-20 11:31:41 +02:00
Nicolas Mattia
7abb350a10 Refactor eval tests 2020-08-20 11:31:41 +02:00
Nicolas Mattia
e82eb322ea Release 0.2.16 2020-08-14 09:42:09 +02:00
Nicolas Mattia
84827485e2 Make sources.nix remote friendly
The file can now be imported even if there is no sources.json in the
same directory.
2020-08-13 21:06:40 +02:00
Nicolas Mattia
bee0b4ca51 Release 0.2.15 2020-08-13 16:41:08 +02:00
Nicolas Mattia
45c4ed5af1 Document NIV_OVERRIDE and add FAQ TOC 2020-08-13 16:26:28 +02:00
Nicolas Mattia
38a536e59e Add NIV_OVERRIDE_{...}
This updates the sources.nix to replace the `outPath` field of package
`foo` with the content of envionment variable `NIV_OVERRIDE_foo`. In the
environment variable name, all characters outside of `[a-zA-Z0-9_]` are
escaped to `_`.
2020-08-13 16:26:28 +02:00
Nicolas Mattia
24eabfbfaa Remove script/update 2020-08-13 15:26:41 +02:00
Nicolas Mattia
303f442c43 Cache Box results
Some results were fetched _way_ too many times. All IO operations run in
updates are now cached. This makes `niv` effectively twice as fast.

*before:*

```
~/niv$ time niv add git git@github.com:nmattia/niv
Adding package niv
  Writing new sources file
Done: Adding package niv

real    0m3.603s
user    0m0.079s
sys     0m0.031s
```

*after:*
```
~/niv$ time niv add git git@github.com:nmattia/niv
Adding package niv
  Writing new sources file
Done: Adding package niv

real    0m1.387s
user    0m0.049s
sys     0m0.007s
```
2020-08-03 16:03:49 +02:00
Nicolas Mattia
ab9cc41caf Add CI check for formatting 2020-07-24 13:28:11 +02:00
Nicolas Mattia
15c82fd184 Add NixOS module example 2020-07-24 12:43:51 +02:00
Nicolas Mattia
fcfd1111c6 Update README.tpl.md
Co-authored-by: Andreas Fuchs <asf@boinkor.net>
2020-07-24 12:43:51 +02:00
Nicolas Mattia
c0a61e6283 Add subpath handling to FAQ 2020-07-24 12:43:51 +02:00
Nicolas Mattia
0d30bfd7b0 Use a single GitHub workflow 2020-07-23 16:34:50 +02:00
Nicolas Mattia
e0bfb5d007 Run Ormolu 2020-07-23 16:34:50 +02:00
Nicolas Mattia
1edb6856ad Run Ormolu on all files instead of changed 2020-07-23 16:34:50 +02:00
Nicolas Mattia
fc2cd34b83 Use ormolu from nixpkgs 2020-07-23 16:34:50 +02:00
Nicolas Mattia
8e0e8017c5 Replace default.nix with-rec with let 2020-07-23 16:34:50 +02:00
Ben Sima
b0e3ca55a9 ci: run script/fmt in the nix environment 2020-07-23 16:34:50 +02:00