fix perms

This commit is contained in:
Emelie Graven 2022-08-23 20:42:25 +02:00
parent 071126e9c3
commit 4ee143230e
No known key found for this signature in database
GPG key ID: 1098DC5C94CB1C87
3 changed files with 24 additions and 4 deletions

View file

@ -29,10 +29,10 @@
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "22b6dc7dbd0fed58f41c117123494c6ed691fdb8",
"sha256": "1p88904pshasnivgw44m3vv14gwrq6cf25301spx3vpw89f48d2a",
"rev": "580d1ea22a647908f159fb6b138083dfe5c8c7b0",
"sha256": "1gsrpc7gg6844sncryx3rbaly0rfd2bkwrrzyvl03b7g29mwvdvb",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/22b6dc7dbd0fed58f41c117123494c6ed691fdb8.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/580d1ea22a647908f159fb6b138083dfe5c8c7b0.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixus": {

View file

@ -31,8 +31,28 @@ let
if spec ? branch then "refs/heads/${spec.branch}" else
if spec ? tag then "refs/tags/${spec.tag}" else
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
submodules = if spec ? submodules then spec.submodules else false;
submoduleArg =
let
nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0;
emptyArgWithWarning =
if submodules == true
then
builtins.trace
(
"The niv input \"${name}\" uses submodules "
+ "but your nix's (${builtins.nixVersion}) builtins.fetchGit "
+ "does not support them"
)
{}
else {};
in
builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; };
if nixSupportsSubmodules
then { inherit submodules; }
else emptyArgWithWarning;
in
builtins.fetchGit
({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg);
fetch_local = spec: spec.path;