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": "", "homepage": "",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "22b6dc7dbd0fed58f41c117123494c6ed691fdb8", "rev": "580d1ea22a647908f159fb6b138083dfe5c8c7b0",
"sha256": "1p88904pshasnivgw44m3vv14gwrq6cf25301spx3vpw89f48d2a", "sha256": "1gsrpc7gg6844sncryx3rbaly0rfd2bkwrrzyvl03b7g29mwvdvb",
"type": "tarball", "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" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"nixus": { "nixus": {

View file

@ -31,8 +31,28 @@ let
if spec ? branch then "refs/heads/${spec.branch}" else if spec ? branch then "refs/heads/${spec.branch}" else
if spec ? tag then "refs/tags/${spec.tag}" else if spec ? tag then "refs/tags/${spec.tag}" else
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; 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
if nixSupportsSubmodules
then { inherit submodules; }
else emptyArgWithWarning;
in in
builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; builtins.fetchGit
({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg);
fetch_local = spec: spec.path; fetch_local = spec: spec.path;