Display deprecated channels (#489)
This commit is contained in:
parent
75e8457105
commit
74ed61a915
|
@ -12,7 +12,7 @@
|
||||||
outputs = { self
|
outputs = { self
|
||||||
, nixpkgs
|
, nixpkgs
|
||||||
, flake-utils
|
, flake-utils
|
||||||
, nixos-org-configurations
|
, nixos-org-configurations
|
||||||
}:
|
}:
|
||||||
flake-utils.lib.eachDefaultSystem
|
flake-utils.lib.eachDefaultSystem
|
||||||
(system:
|
(system:
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
filteredChannels =
|
filteredChannels =
|
||||||
lib.filterAttrs
|
lib.filterAttrs
|
||||||
(n: v:
|
(n: v:
|
||||||
builtins.elem v.status ["beta" "stable" "rolling"] &&
|
builtins.elem v.status ["rolling" "beta" "stable" "deprecated"] &&
|
||||||
lib.hasPrefix "nixos-" n &&
|
lib.hasPrefix "nixos-" n &&
|
||||||
v ? variant && v.variant == "primary"
|
v ? variant && v.variant == "primary"
|
||||||
)
|
)
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
echo '${builtins.toJSON (builtins.map (c: c.id) nixosChannels.channels)}' > $out
|
echo '${builtins.toJSON (builtins.map (c: c.id) nixosChannels.channels)}' > $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
mkDevShell = { inputsFrom ? [], extraPackages ? [], extraShellHook ? "" }:
|
mkDevShell = { inputsFrom ? [], extraPackages ? [], extraShellHook ? "" }:
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
inherit inputsFrom;
|
inherit inputsFrom;
|
||||||
packages = extraPackages;
|
packages = extraPackages;
|
||||||
|
|
|
@ -170,15 +170,27 @@ type alias NixOSChannel =
|
||||||
|
|
||||||
type NixOSChannelStatus
|
type NixOSChannelStatus
|
||||||
= Rolling
|
= Rolling
|
||||||
| Stable
|
|
||||||
| Beta
|
| Beta
|
||||||
|
| Stable
|
||||||
|
| Deprecated
|
||||||
|
|
||||||
|
|
||||||
channelTitle : NixOSChannel -> String
|
channelBadge : NixOSChannelStatus -> List (Html msg)
|
||||||
channelTitle channel =
|
channelBadge status =
|
||||||
if channel.status == Beta
|
case status of
|
||||||
then channel.id ++ " (Beta)"
|
Rolling ->
|
||||||
else channel.id
|
-- [ span [ class "label label-success" ] [ text "Rolling" ] ]
|
||||||
|
[]
|
||||||
|
|
||||||
|
Beta ->
|
||||||
|
[ span [ class "label label-info" ] [ text "Beta" ] ]
|
||||||
|
|
||||||
|
Stable ->
|
||||||
|
-- [ span [ class "label label-success" ] [ text "Stable" ] ]
|
||||||
|
[]
|
||||||
|
|
||||||
|
Deprecated ->
|
||||||
|
[ span [ class "label label-warning" ] [ text "Deprecated" ] ]
|
||||||
|
|
||||||
|
|
||||||
decodeNixOSChannels : Json.Decode.Decoder NixOSChannels
|
decodeNixOSChannels : Json.Decode.Decoder NixOSChannels
|
||||||
|
@ -188,7 +200,6 @@ decodeNixOSChannels =
|
||||||
(Json.Decode.field "channels" (Json.Decode.list decodeNixOSChannel))
|
(Json.Decode.field "channels" (Json.Decode.list decodeNixOSChannel))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
decodeNixOSChannel : Json.Decode.Decoder NixOSChannel
|
decodeNixOSChannel : Json.Decode.Decoder NixOSChannel
|
||||||
decodeNixOSChannel =
|
decodeNixOSChannel =
|
||||||
Json.Decode.map4 NixOSChannel
|
Json.Decode.map4 NixOSChannel
|
||||||
|
@ -201,11 +212,14 @@ decodeNixOSChannel =
|
||||||
"rolling" ->
|
"rolling" ->
|
||||||
Json.Decode.succeed Rolling
|
Json.Decode.succeed Rolling
|
||||||
|
|
||||||
|
"beta" ->
|
||||||
|
Json.Decode.succeed Beta
|
||||||
|
|
||||||
"stable" ->
|
"stable" ->
|
||||||
Json.Decode.succeed Stable
|
Json.Decode.succeed Stable
|
||||||
|
|
||||||
"beta" ->
|
"deprecated" ->
|
||||||
Json.Decode.succeed Beta
|
Json.Decode.succeed Deprecated
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
Json.Decode.fail ("Unknown status: " ++ status)
|
Json.Decode.fail ("Unknown status: " ++ status)
|
||||||
|
@ -983,7 +997,7 @@ viewChannels nixosChannels outMsg selectedChannel =
|
||||||
]
|
]
|
||||||
, onClick <| outMsg (ChannelChange channel.id)
|
, onClick <| outMsg (ChannelChange channel.id)
|
||||||
]
|
]
|
||||||
[ text <| channelTitle channel ]
|
(List.intersperse (text " ") ([ text channel.id ] ++ channelBadge channel.status))
|
||||||
)
|
)
|
||||||
nixosChannels
|
nixosChannels
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue