Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions frontend/src/Page/Packages.elm
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,20 @@ viewResultItem nixosChannels channel showInstallDetails show item =
]
[ text "nix-shell" ]
]
, li
[ classList
[ ( "active", showInstallDetails == Search.ViaFlakeNix )
, ( "pull-right", True )
]
]
[ a
[ href "#"
, Search.onClickStop <|
SearchMsg <|
Search.ShowInstallDetails Search.ViaFlakeNix
]
[ text "flake.nix" ]
]
, li
[ classList
[ ( "active", showInstallDetails == Search.ViaNixOS )
Expand Down Expand Up @@ -715,6 +729,50 @@ viewResultItem nixosChannels channel showInstallDetails show item =
, strong [] [ text item.source.attr_name ]
]
]
, div
[ classList
[ ( "tab-pane", True )
, ( "active", showInstallDetails == Search.ViaFlakeNix )
]
]
[ p []
[ text "Add the following to your "
, strong [] [ text "flake.nix" ]
, text ":"
]
]
, div
[ classList
[ ( "active", showInstallDetails == Search.ViaFlakeNix )
]
, class "tab-pane"
, id "package-details-flake"
]
[ pre [ class "code-block" ]
[ text <| "{\n inputs.nixpkgs.url = \"github:NixOS/nixpkgs/nixos-" ++ channel ++ "\";\n outputs = { nixpkgs, ... }: {\n packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux."
, strong [] [ text item.source.attr_name ]
, text <| ";\n devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {\n packages = [ nixpkgs.legacyPackages.x86_64-linux."
, strong [] [ text item.source.attr_name ]
, text <| " ];\n };\n };\n}"
]
]
, div [] [ p [] [] ]
, div
[ classList
[ ( "active", showInstallDetails == Search.ViaFlakeNix )
]
, class "tab-pane"
]
[ p []
[ text "Then run "
, code [] [ text "nix build" ]
, text " to build the package, "
, code [] [ text "nix run" ]
, text " to run it directly, or "
, code [] [ text "nix develop" ]
, text " to enter a shell with the package available."
Comment on lines +767 to +773
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this text actually is correct. To my understanding you only provide a devShell with the package, so it cannot be built with nix build or directly run with nix run. Only nix develop will work.

]
]
, div
[ classList
[ ( "tab-pane", True )
Expand Down
1 change: 1 addition & 0 deletions frontend/src/Search.elm
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ type Msg a b

type Details
= ViaNixShell
| ViaFlakeNix
| ViaNixOS
| ViaNixEnv
| FromFlake
Expand Down