parent
b7df41a891
commit
c79de4b2df
|
@ -190,9 +190,8 @@ viewResultItemDetails channel item =
|
||||||
asLink value =
|
asLink value =
|
||||||
a [ href value ] [ text value ]
|
a [ href value ] [ text value ]
|
||||||
|
|
||||||
-- TODO: this should take channel into account as well
|
githubUrlPrefix branch =
|
||||||
githubUrlPrefix =
|
"https://github.com/NixOS/nixpkgs-channels/blob/" ++ branch ++ "/"
|
||||||
"https://github.com/NixOS/nixpkgs-channels/blob/nixos-unstable/"
|
|
||||||
|
|
||||||
cleanPosition value =
|
cleanPosition value =
|
||||||
if String.startsWith "source/" value then
|
if String.startsWith "source/" value then
|
||||||
|
@ -202,9 +201,14 @@ viewResultItemDetails channel item =
|
||||||
value
|
value
|
||||||
|
|
||||||
asGithubLink value =
|
asGithubLink value =
|
||||||
a
|
case Search.channelDetailsFromId channel of
|
||||||
[ href <| githubUrlPrefix ++ (value |> String.replace ":" "#L" |> cleanPosition) ]
|
Just channelDetails ->
|
||||||
[ text <| cleanPosition value ]
|
a
|
||||||
|
[ href <| githubUrlPrefix channelDetails.branch ++ (value |> String.replace ":" "#L" |> cleanPosition) ]
|
||||||
|
[ text <| cleanPosition value ]
|
||||||
|
|
||||||
|
Nothing ->
|
||||||
|
text <| cleanPosition value
|
||||||
|
|
||||||
withDefault wrapWith maybe =
|
withDefault wrapWith maybe =
|
||||||
case maybe of
|
case maybe of
|
||||||
|
@ -217,15 +221,6 @@ viewResultItemDetails channel item =
|
||||||
Just value ->
|
Just value ->
|
||||||
wrapWith value
|
wrapWith value
|
||||||
|
|
||||||
convertToGithubUrl value =
|
|
||||||
if String.startsWith "source/" value then
|
|
||||||
githubUrlPrefix ++ String.dropLeft 7 value
|
|
||||||
|
|
||||||
else
|
|
||||||
githubUrlPrefix ++ value
|
|
||||||
|
|
||||||
-- TODO: add links to hydra for hydra_platforms
|
|
||||||
-- example: https://hydra.nixos.org/job/nixos/release-20.03/nixpkgs.gnome3.accerciser.i686-linux
|
|
||||||
allowedPlatforms platform =
|
allowedPlatforms platform =
|
||||||
List.member platform
|
List.member platform
|
||||||
[ "x86_64-linux"
|
[ "x86_64-linux"
|
||||||
|
@ -287,8 +282,6 @@ viewResultItemDetails channel item =
|
||||||
[ dt [] [ text "Install command" ]
|
[ dt [] [ text "Install command" ]
|
||||||
, dd [] [ code [] [ text <| "nix-env -iA nixos." ++ item.source.attr_name ] ]
|
, dd [] [ code [] [ text <| "nix-env -iA nixos." ++ item.source.attr_name ] ]
|
||||||
, dt [] [ text <| "Nix expression" ]
|
, dt [] [ text <| "Nix expression" ]
|
||||||
|
|
||||||
-- TODO: point to correct branch/channel
|
|
||||||
, dd [] [ withDefault asGithubLink item.source.position ]
|
, dd [] [ withDefault asGithubLink item.source.position ]
|
||||||
, dt [] [ text "Platforms" ]
|
, dt [] [ text "Platforms" ]
|
||||||
, dd [] [ ul [ class "inline" ] <| showPlatforms item.source.platforms ]
|
, dd [] [ ul [ class "inline" ] <| showPlatforms item.source.platforms ]
|
||||||
|
|
|
@ -232,6 +232,7 @@ type alias ChannelDetails =
|
||||||
{ id : String
|
{ id : String
|
||||||
, title : String
|
, title : String
|
||||||
, jobset : String
|
, jobset : String
|
||||||
|
, branch : String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,13 +240,13 @@ channelDetails : Channel -> ChannelDetails
|
||||||
channelDetails channel =
|
channelDetails channel =
|
||||||
case channel of
|
case channel of
|
||||||
Unstable ->
|
Unstable ->
|
||||||
ChannelDetails "unstable" "unstable" "nixos/trunk-combined"
|
ChannelDetails "unstable" "unstable" "nixos/trunk-combined" "nixos-unstable"
|
||||||
|
|
||||||
Release_19_09 ->
|
Release_19_09 ->
|
||||||
ChannelDetails "19.09" "19.09" "nixos/release-19.09"
|
ChannelDetails "19.09" "19.09" "nixos/release-19.09" "nixos-19.09"
|
||||||
|
|
||||||
Release_20_03 ->
|
Release_20_03 ->
|
||||||
ChannelDetails "20.03" "20.03" "nixos/release-20.03"
|
ChannelDetails "20.03" "20.03" "nixos/release-20.03" "nixos-20.03"
|
||||||
|
|
||||||
|
|
||||||
channelFromId : String -> Maybe Channel
|
channelFromId : String -> Maybe Channel
|
||||||
|
|
Loading…
Reference in a new issue