useless_has_attr
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{ inputs, ... }@args:
|
||||
let
|
||||
# Get self from args or default to ../.. (the flake root)
|
||||
self = if args ? self then args.self else ../..;
|
||||
self = args.self or ../..;
|
||||
|
||||
inherit (inputs.nixpkgs.lib)
|
||||
genAttrs
|
||||
|
||||
@@ -31,8 +31,8 @@ let
|
||||
applyVariantOnce =
|
||||
selected: variant:
|
||||
let
|
||||
vVars = if variant ? variables then variant.variables else { };
|
||||
vSrcs = if variant ? sources then variant.sources else { };
|
||||
vVars = variant.variables or { };
|
||||
vSrcs = variant.sources or { };
|
||||
in
|
||||
{
|
||||
variables = selected.variables // vVars;
|
||||
@@ -47,8 +47,8 @@ let
|
||||
else
|
||||
let
|
||||
p = variant.platforms.${system};
|
||||
pVars = if p ? variables then p.variables else { };
|
||||
pSrcs = if p ? sources then p.sources else { };
|
||||
pVars = p.variables or { };
|
||||
pSrcs = p.sources or { };
|
||||
in
|
||||
{
|
||||
variables = selected.variables // pVars;
|
||||
@@ -93,7 +93,7 @@ let
|
||||
mkSrcFromRendered' =
|
||||
pkgs': comp:
|
||||
let
|
||||
fetcher = if comp ? fetcher then comp.fetcher else "none";
|
||||
fetcher = comp.fetcher or "none";
|
||||
in
|
||||
if fetcher == "github" then
|
||||
pkgs'.fetchFromGitHub (
|
||||
@@ -102,7 +102,7 @@ let
|
||||
repo = comp.repo;
|
||||
# Allow tag as rev (ignore null/empty tag)
|
||||
rev = if comp ? tag && comp.tag != null && comp.tag != "" then comp.tag else comp.rev;
|
||||
fetchSubmodules = if comp ? submodules then comp.submodules else false;
|
||||
fetchSubmodules = comp.submodules or false;
|
||||
hash = comp.hash;
|
||||
}
|
||||
// lib.optionalAttrs (comp ? name) { name = comp.name; }
|
||||
@@ -111,12 +111,12 @@ let
|
||||
pkgs'.fetchgit {
|
||||
url = comp.url;
|
||||
rev = comp.rev;
|
||||
fetchSubmodules = if comp ? submodules then comp.submodules else false;
|
||||
fetchSubmodules = comp.submodules or false;
|
||||
hash = comp.hash;
|
||||
}
|
||||
else if fetcher == "url" then
|
||||
let
|
||||
url = if comp ? url then comp.url else comp.urlTemplate;
|
||||
url = comp.url or comp.urlTemplate;
|
||||
in
|
||||
if useFetchZip comp then
|
||||
pkgs'.fetchzip (
|
||||
@@ -155,14 +155,10 @@ rec {
|
||||
selectVariant =
|
||||
spec: variantName: system:
|
||||
let
|
||||
chosen =
|
||||
if variantName != null then
|
||||
variantName
|
||||
else
|
||||
(if spec ? defaultVariant then spec.defaultVariant else null);
|
||||
chosen = if variantName != null then variantName else (spec.defaultVariant or null);
|
||||
baseSelected = {
|
||||
variables = if spec ? variables then spec.variables else { };
|
||||
sources = if spec ? sources then spec.sources else { };
|
||||
variables = spec.variables or { };
|
||||
sources = spec.sources or { };
|
||||
};
|
||||
in
|
||||
resolveVariant spec baseSelected chosen system;
|
||||
|
||||
Reference in New Issue
Block a user