1
1
mirror of https://github.com/nmattia/niv.git synced 2024-09-18 19:07:19 +03:00
Commit Graph

39 Commits

Author SHA1 Message Date
Sivizius
67b245a356
Remove Unnecessary Uses of rec (#390)
* Remove Unnecessary Uses of `rec`

* Bump sources version

---------

Co-authored-by: Nicolas Mattia <nicolas@nmattia.com>
2024-02-21 19:49:09 +01:00
Victor Engmark
f275964bb0
refactor: statix recommendations (#363)
* refactor: Inherit where possible

As recommended by `statix check`.

* refactor: Remove unnecessary parentheses

As recommended by `statix check`.

* refactor: Remove unnecessary comparison with `true`

As recommended by `statix check`.

* refactor: Avoid using deprecated `isNull`

As recommended by `statix check` and the documentation
<https://nixos.org/manual/nix/stable/language/builtins.html#builtins-isNull>.

* refactor: Simplify conditionals

As recommended by `statix check`.

* Update sources version

---------

Co-authored-by: Nicolas Mattia <nicolas@nmattia.com>
2023-03-12 12:41:42 +01:00
Nicolas Mattia
de5a4e7d01
Update devshell (#367)
* Update devshell

Update nixpkgs and simplify devshell

* Run ormolu

* Fixups

* Format nix files

* Update sources
2023-03-11 22:16:53 +01:00
Jacek Galowicz
945aa20cd0 Fetch submodules if supported, and warn if submodules are used but not supported 2022-04-27 22:27:24 +02:00
Nikola Knezevic
788289706e fix: formatting error in sources.nix
This change fixes the issue with sources.nix file that's been failing in
CI. The format was fixed by running `nixpkgs-fmt .` inside of the
nix-shell.
2022-03-21 12:59:38 +01:00
George Shammas
9cb7ef336b Add the ability to pass submodules to builtins.fetchGit 2022-02-07 18:58:44 +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
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
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
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
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
f73bf8d584 Add niv add local for local sources 2020-03-31 19:58:43 +02:00
Nicolas Mattia
372f96bff2 Prettify the derivation name in tarballs
The derivation name for package `foo` of type `tarball` is now `foo-src`
as opposed to `source`.
2020-03-27 12:03:14 +01:00
Nicolas Mattia
89e6f36b6f Retire builtin-tarball and builtin-url 2020-03-26 18:08:44 +01:00
Nicolas Mattia
13598ef956 Don't needlessly evaluate <nixpkgs>
This changes the logic to make sure the first `if` branch -- which pulls nixpkgs from sources.json -- is evaluated first. Moreover the `<nixpkgs>` check is changed to avoid actually evaluating `<nixpkgs>`.
2020-01-17 11:33:07 +01:00
Nicolas Mattia
0e460c49de Allow setting custom pkgs 2020-01-07 15:17:37 +01:00
zimbatm
2f2ee45a08
nixpkgs-fmt 2020-01-03 10:41:22 +01:00
Nicolas Mattia
0d10454ebb Cleanup sources.nix 2019-12-08 20:39:45 +01:00
Nicolas Mattia
3e1d44bbfa Allow specifying custom sources.json
This turns `sources.nix` into a functor that acceps an argument:

``` nix
{ sourcesJson = <path/to/sources.json> ; }
```

The `sourcesJson` will be used instead of `./sources.json`.
2019-12-08 20:29:15 +01:00
Nicolas Mattia
dfc838aba2 Parse ref and rev in git 2019-11-30 12:36:23 +01:00
Nicolas Mattia
45a6020028 Add experimental (working) implementation of git specs 2019-11-30 12:22:27 +01:00
Nicolas Mattia
3ecde0148f Fix error message in sources.nix 2019-11-30 12:15:09 +01:00
Nicolas Mattia
e4ea8de1c5 Fix wording in comment 2019-11-28 09:56:41 +01:00
Nicolas Mattia
2e2e9eae97 Fix typo in error message 2019-11-28 09:56:41 +01:00
Nicolas Mattia
5271115a45 Remove TODOs 2019-11-28 09:56:41 +01:00
Nicolas Mattia
d9e35d67d8 Refactor fetchers 2019-11-28 09:56:41 +01:00
Nicolas Mattia
bd1aeb0a9c sources.nix: with -> let 2019-11-28 09:56:41 +01:00
zimbatm
1cb695fe7e
format with nixpkgs-fmt
I also couldn't help myself to change the `with { ... }` blocks
 to `let ... in` blocks.
2019-11-16 16:08:44 +00:00
Nicolas Mattia
a014fb3630 Fix functionArgs issue on recent nixpkgs 2019-09-23 13:42:58 +02:00
Michael Peyton Jones
96afc24d7e Make builtin-tarball the default 2019-06-01 13:04:16 +02:00
Michael Peyton Jones
0c48736b06 Support more types, including builtins 2019-06-01 13:04:16 +02:00
Nicolas Mattia
b638632993 Improve error message when no nixpkgs 2019-04-10 23:10:46 +02:00
Nicolas Mattia
3cd02da1ce Fix sources.nix for empty and ./. <nixpkgs> 2019-04-07 19:56:40 +02:00
zimbatm
4c78b665f4 rename specs.json to sources.json
The goal is to group the two files that go together so they don't get
lost in the sea of all the other files in the nix/ folder.
2019-02-07 14:40:56 +01:00
Nicolas Mattia
5e9d9b0695 Restructure Nix dirs 2019-02-03 14:07:42 +01:00
Nicolas Mattia
2fc0566571 Test that README is up-to-date 2019-02-01 15:56:05 +01:00
Nicolas Mattia
491a449523 Proper sources.nix 2019-01-31 19:05:00 +01:00