Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instead of warning newcomers about pitfalls with nix-env, what if we just not mention it all #696

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fetching one JSON file which contained all packages (or options). This approach
is good for its simple setup, but started to show its problems when packages
number was getting bigger and bigger. I'm sure we could optimize it further,
but ideas what all could we do if there would be some database in the back were
to tempting not to try.
too tempting not to try.

For backend we are using Elasticsearch instance which is kindly sponsored by
[bonsai.io](https://bonsai.io). On the frontend we are using
Expand All @@ -20,7 +20,7 @@ For backend we are using Elasticsearch instance which is kindly sponsored by

## How search works?

The use case we want to solve is that a visitor want to see if a package
The use case we want to solve is that a visitor wants to see if a package
exists or to look up certain package's details.

A user wants to converge to a single result if possible. The more characters
Expand All @@ -31,8 +31,8 @@ Very important is also ranking of search results. This will bring more relevant
search results to the top, since a lot of times it is hard to produce search
query that will output only one result item.

A less important, but providing better user experience. are suggestions for
writing better search query. Suggesting feature should guide user to write
A less important, but providing better user experience, are suggestions for
writing better search query. Suggesting feature should guide the user to write
better queries which in turn will produce better results.


Expand All @@ -45,7 +45,7 @@ env --chdir=frontend nix develop -c yarn dev
```

You can point your browser to `http://localhost:3000` and start developing.
Any changes to source files (`./frontend/src`) will trigger a hot reload of an
Any changes to source files (`./frontend/src`) will trigger a hot reload of the
application.


Expand All @@ -65,7 +65,7 @@ To add your own flakes to the search index edit [./flakes/manual.toml](./flakes/

Possible types are `github`, `gitlab`, `sourcehut`, and `git` (which is the fallback for any kind of git repository but requires to set a revision key manually as of now).

To test whether your flake is compatible with nix flake-info you can try running `flake-info` against it
To test whether your flake is compatible with nix flake-info you can try running `flake-info` against it:

```
$ nix run github:nixos/nixos-search#flake-info -- flake <your flake handle>
Expand Down
5 changes: 4 additions & 1 deletion frontend/config/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ const dev = {
res.json({result: "You reached the dev server"});
});

},
proxy: {
'/backend': {target:'http://search.nixos.org/', changeOrigin:true},
}
},
}
};

module.exports = env => {
Expand Down
79 changes: 0 additions & 79 deletions frontend/src/Page/Packages.elm
Original file line number Diff line number Diff line change
Expand Up @@ -552,20 +552,6 @@ viewResultItem nixosChannels channel showInstallDetails show item =
]
[ text "NixOS Configuration" ]
]
, li
[ classList
[ ( "active", showInstallDetails == Search.ViaNixEnv )
, ( "pull-right", True )
]
]
[ a
[ href "#"
, Search.onClickStop <|
SearchMsg <|
Search.ShowInstallDetails Search.ViaNixEnv
]
[ text "nix-env" ]
]
]
<|
Maybe.map
Expand All @@ -592,71 +578,6 @@ viewResultItem nixosChannels channel showInstallDetails show item =
<|
Maybe.withDefault
[ div
[ classList
[ ( "tab-pane", True )
, ( "active", showInstallDetails == Search.ViaNixEnv )
]
]
[ p []
[ strong [] [ text "Warning:" ]
, text " Using "
, code [] [ text "nix-env" ]
, text """
permanently modifies a local profile of installed packages.
This must be updated and maintained by the user in the same
way as with a traditional package manager, foregoing many
of the benefits that make Nix uniquely powerful. Using
"""
, code [] [ text "nix-shell" ]
, text """
or a NixOS configuration is recommended instead.
"""
]
]
, div
[ classList
[ ( "active", showInstallDetails == Search.ViaNixEnv )
]
, class "tab-pane"
]
[ p []
[ strong [] [ text "On NixOS:" ] ]
]
, div
[ classList
[ ( "active", showInstallDetails == Search.ViaNixEnv )
]
, class "tab-pane"
, id "package-details-nixpkgs"
]
[ pre [ class "code-block shell-command" ]
[ text "nix-env -iA nixos."
, strong [] [ text item.source.attr_name ]
]
]
, div [] [ p [] [] ]
, div
[ classList
[ ( "active", showInstallDetails == Search.ViaNixEnv )
]
, class "tab-pane"
]
[ p []
[ strong [] [ text "On Non NixOS:" ] ]
]
, div
[ classList
[ ( "active", showInstallDetails == Search.ViaNixEnv )
]
, class "tab-pane"
, id "package-details-nixpkgs"
]
[ pre [ class "code-block shell-command" ]
[ text "nix-env -iA nixpkgs."
, strong [] [ text item.source.attr_name ]
]
]
, div
[ classList
[ ( "tab-pane", True )
, ( "active", showInstallDetails == Search.ViaNixOS )
Expand Down