flake-info: render longDescription for flake packages (#607)
This commit is contained in:
parent
188d618859
commit
eb9fa64c33
|
@ -29,8 +29,9 @@ let
|
||||||
# paths = builtins.listToAttrs ( map (output: {name = output; value = drv.${output};}) drv.outputs );
|
# paths = builtins.listToAttrs ( map (output: {name = output; value = drv.${output};}) drv.outputs );
|
||||||
default_output = drv.outputName;
|
default_output = drv.outputName;
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (drv ? meta && drv.meta ? description) { inherit (drv.meta) description; }
|
// lib.optionalAttrs (drv ? meta.description) { inherit (drv.meta) description; }
|
||||||
// lib.optionalAttrs (drv ? meta && drv.meta ? license) { inherit (drv.meta) license; }
|
// lib.optionalAttrs (drv ? meta.longDescription) { inherit (drv.meta) longDescription; }
|
||||||
|
// lib.optionalAttrs (drv ? meta.license) { inherit (drv.meta) license; }
|
||||||
)
|
)
|
||||||
) (validPkgs drvs);
|
) (validPkgs drvs);
|
||||||
readApps = system: apps: lib.mapAttrsToList (
|
readApps = system: apps: lib.mapAttrsToList (
|
||||||
|
|
|
@ -115,6 +115,7 @@ impl TryFrom<(import::FlakeEntry, super::Flake)> for Derivation {
|
||||||
outputs,
|
outputs,
|
||||||
default_output,
|
default_output,
|
||||||
description,
|
description,
|
||||||
|
long_description,
|
||||||
license,
|
license,
|
||||||
} => {
|
} => {
|
||||||
let package_attr_set: Vec<_> = attribute_name.split(".").collect();
|
let package_attr_set: Vec<_> = attribute_name.split(".").collect();
|
||||||
|
@ -125,6 +126,8 @@ impl TryFrom<(import::FlakeEntry, super::Flake)> for Derivation {
|
||||||
})
|
})
|
||||||
.into();
|
.into();
|
||||||
|
|
||||||
|
let long_description = long_description.map(|s| s.render_markdown()).transpose()?;
|
||||||
|
|
||||||
let package_license: Vec<License> = license
|
let package_license: Vec<License> = license
|
||||||
.map(OneOrMany::into_list)
|
.map(OneOrMany::into_list)
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
|
@ -152,7 +155,7 @@ impl TryFrom<(import::FlakeEntry, super::Flake)> for Derivation {
|
||||||
package_description: description.clone(),
|
package_description: description.clone(),
|
||||||
package_maintainers: vec![maintainer.clone()],
|
package_maintainers: vec![maintainer.clone()],
|
||||||
package_maintainers_set: maintainer.name.map_or(vec![], |n| vec![n]),
|
package_maintainers_set: maintainer.name.map_or(vec![], |n| vec![n]),
|
||||||
package_longDescription: None,
|
package_longDescription: long_description,
|
||||||
package_hydra: (),
|
package_hydra: (),
|
||||||
package_system: String::new(),
|
package_system: String::new(),
|
||||||
package_homepage: Vec::new(),
|
package_homepage: Vec::new(),
|
||||||
|
@ -251,7 +254,7 @@ impl TryFrom<import::NixpkgsEntry> for Derivation {
|
||||||
package_maintainers,
|
package_maintainers,
|
||||||
package_maintainers_set,
|
package_maintainers_set,
|
||||||
package_description: package.meta.description.clone(),
|
package_description: package.meta.description.clone(),
|
||||||
package_longDescription: long_description.clone(),
|
package_longDescription: long_description,
|
||||||
package_hydra: (),
|
package_hydra: (),
|
||||||
package_system: package.system,
|
package_system: package.system,
|
||||||
package_homepage: package
|
package_homepage: package
|
||||||
|
|
|
@ -30,6 +30,8 @@ pub enum FlakeEntry {
|
||||||
outputs: Vec<String>,
|
outputs: Vec<String>,
|
||||||
default_output: String,
|
default_output: String,
|
||||||
description: Option<String>,
|
description: Option<String>,
|
||||||
|
#[serde(rename = "longDescription")]
|
||||||
|
long_description: Option<String>,
|
||||||
license: Option<OneOrMany<StringOrStruct<License>>>,
|
license: Option<OneOrMany<StringOrStruct<License>>>,
|
||||||
},
|
},
|
||||||
/// An "application" that can be called using nix run <..>
|
/// An "application" that can be called using nix run <..>
|
||||||
|
|
Loading…
Reference in a new issue