Commit graph

181 commits

Author SHA1 Message Date
Yannik Sander 87851618b6
Display attributes of flakes in a more expected way (#397) 2021-12-26 16:19:15 +01:00
Yannik Sander 3dfcf4fd45
Fix/explicit printing (#395)
* Extract pandoc function to own module

* Bump schema version

* Make string handling more explicit

* Update logging and pandoc crates

* Improve serializing error handling

* Serialize values as string (for elastic)

* Perform option doc parsing entirely in rust

* Show non pandoc'ed results as code elements

* Parse correct html string

* Change expected `option_type` type to String

* Allow treat string unparsable  as html like non-docbook strings

* Improve deserializing error reporting using serde_path_to_error

* Format code
2021-12-26 16:03:09 +01:00
Yannik Sander a4d8421312
Allow plain strings for nixpkgs maintainer fields (#393)
* Allow plain strings for nixpkgs maintainer fields

* apply fmt to changed files
2021-12-18 14:45:08 +01:00
Yannik Sander 29651d086b
Fix/devshell (#390)
* Fix flake-info attribute name in devShell definition

* Export rust stdlib path though shell hook

* Format flake.nix
2021-12-15 02:38:06 +01:00
Yannik Sander fa5fe2a61c
Remove noisy prints to stderr (#386)
* Make stderr less noisy

* Set and refer to pandoc filter path in derivation
2021-12-06 23:50:15 +01:00
erikarvstedt 875eedde46
Readme: Fix flake-info command (#380)
The flake attribute must directly name the app.

Previously, the command failed with:
error: cannot find flake attribute 'github:nixos/nixos-search#apps.flake'
2021-12-06 18:48:18 +01:00
erikarvstedt bd59a80130
flake: Remove app (#385)
As pointed out by Yannik Sander, defining the app is redundant because
the package of the same name is used automatically.
2021-12-06 18:47:08 +01:00
Yannik Sander d0f0b84eea
Print pandoc error rather than panic-ing (#382)
* Print pandoc error rather than panic-ing

* Maintain current failing behaviour

* Update export.rs
2021-12-06 18:23:10 +01:00
erikarvstedt 46d00f3b43
flake, overlay: Rename package to flake-info (#383)
The package now has the same name as the `app` and the
command (`bin/flake-info`).
2021-12-06 15:01:26 +01:00
tomberek 70b72a343f
release: 21.05 -> 21.11 (#376)
* release: 21.05 -> 21.11

* adding back 20.09 (for now)

Co-authored-by: Rok Garbas <rok@garbas.si>
2021-12-01 00:26:34 +01:00
Yannik Sander dbf8c2d3a4
Convert import::Kind enum to a clap compatible arg_enum (#365) 2021-11-23 13:58:55 +01:00
Yannik Sander a28c473b57
Add flake app and Documentation (#364)
* Add flake app

* Document adding and testing own flakes
2021-11-23 13:58:38 +01:00
dependabot[bot] e2216a6cd6
Dependabot(deps): Bump cachix/install-nix-action from 14 to 16 (#374)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 14 to 16.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v14...v16)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-22 13:27:31 +01:00
Yannik Sander f3571efdef
Translate example/default values from JSON to NIx (#357) 2021-11-11 20:29:44 +01:00
Joel 22f10dc4e6
fix: typo on no search results page (#370) 2021-11-08 13:08:33 -05:00
Naïm Favier b74147b671
Support literalExpression and literalDocBook (#368)
* Support literalExpression and literalDocBook

* Use consistent nixpkgs versions in get_nixpkgs_options
2021-10-15 10:20:18 +02:00
Yannik Sander 9e018c36da
Don't fail import of groups as long as some imports succeed (#358)
* Don't fail import of groups as long as some imports succeed
2021-09-30 14:24:35 -04:00
Finn Behrens 4176d61bfc
add kalker to the flakes index (#363)
Signed-off-by: Finn Behrens <me@kloenk.dev>
2021-09-24 08:53:48 +02:00
Yannik Sander 35be674147
Remove sops-nix flake (#361)
Sops nix fails to import
2021-09-22 08:39:46 +02:00
Yannik Sander 5cfde22eb7
Add pandoc support back to rust script (#349)
* Add pandoc support back to rust script

* Dont render invalid HTML

* Bump schema version

* Enable debug build workflow

* Dont wrap script

* Provide pandoc in check phase

* Update Elasticsearch hash

* Add _forked_ rust-pandoc

* Execute Lua filters

* Update nixpkgs containing lua filters

* Expose filter path in dev Shell

* Dont check pandoc think

(for now)

* Provide filter path at build time

* Enable debug builds

* Enable debug builds

* rename main.yaml to frontend.yaml

* Wrap flake-info with pandoc

* Add makeWrapper input

* Add pandoc filter path to wrapper

* Wrap descriptions in XML frame

* Render HTML

* Disable import on PR
2021-09-14 09:49:33 +02:00
Yannik Sander fff4e39add
Adding type argument för sops-nix flake (#355) 2021-09-09 12:20:50 +02:00
Pablo Ovelleiro Corral fe0bdd6989
Update manual.toml (#350)
Co-authored-by: Rok Garbas <rok@garbas.si>
2021-09-09 09:35:08 +02:00
Janne Heß 8ebef5632f
Add sops-nix to flakes (#352) 2021-09-09 09:21:22 +02:00
dependabot[bot] a3c30a607a
Dependabot(deps): Bump cachix/install-nix-action from 13 to 14 (#354)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 13 to 14.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v13...v14)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-09 08:27:28 +02:00
Yannik Sander 73d0dcaea8
Fix default group name (#353) 2021-08-28 11:42:36 +02:00
Matthias Beyer c402d7819a
Add Mailto link for mailing to all maintainers (#341)
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-08-26 13:46:13 +02:00
Waldir Pimenta 6bce11114d
Style links in package details consistently (#333)
Making the links the same color as the non-linked text
makes it hard to figure out which of the items are links and which are plain text.
This change lets the default link color apply to the links in package details.
2021-08-26 09:59:25 +02:00
Matthias Beyer e35436a9bc
Add mailto link to maintainer list (#340)
* Add mailto link to maintainer list

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>

* Fix: mailto links do not need //

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>

Co-authored-by: Rok Garbas <rok@garbas.si>
2021-08-26 09:55:58 +02:00
Rok Garbas 5ee8ca10c6
We should not import nixpkgs in PRs 2021-08-26 09:54:46 +02:00
Naïm Favier d4bc4e3a84
Strip leading slash from option sources (#348) 2021-08-26 09:43:23 +02:00
Yannik Sander e15fddc2b8
Remove python import script (#346) 2021-08-26 09:41:39 +02:00
Yannik Sander f866edd1cf
Fix extra arrow outside the flake context (#347) 2021-08-26 09:39:38 +02:00
Andreas Rammhold 3402e7d1d0
Don't list unfree packages (#343)
There was a discussion around this when search.nixos.org was redesigned
and the conclusion was that nixpkgs is a collection of free and open
source software. We shouldn't list the unfree stuff.
2021-08-26 01:06:56 +02:00
Yannik Sander af3b494217
Flake support/frontend (#324)
* Setup flake info extraction

Prepare data model fro derivations (#1)

Add flake info data (#1)

Implement fetching general flake info (#1)

Expose CLI (#1)

Keep cargo happy

Add some doc comments

Pin to local nixpkgs to excessive downloads

Extend visibility of some data objects

Add command to extract infomation about defivations (#1)

Add call new feature in main (#1)

Include more information in derivation (#1)

Add log access

Always debug log stderr from nix

Format nix script

Collect systems per package

Remove unnecessary imports

Create flake

Remove top level version field

Represent collected systems/version pairs in rust

Fix quotation marks in tests

Add correct cargo hash

Add iconv dependency

Return a list from nix script

Export as json

Undo version by platform distinction

Remove nixpkgs override

Apply cargo fmt

Flatten export structure

Allow for complex licenses

Prepare using a central nix file

Implement nix part o accessing apps

Include the correct filename

Add accessor for `all` key

Access all available information by default

Track more information about Apps

Run cargo fmt

Fix: allow local builds

Prepare next version of the flake info tool

Include examples and pull script

Expose flake info as library

Include thiserror for custom errors

Define a source data type

Collects source types and their metadata, collected in a json file

Add command line argument for input files

Mutually exclusive with --flake

Refactor functions to extract information given a flake identifier

Add kind specifier as CLI argument

Amend Argument parsing to require eiteher flake or targets to be defined

Run extraction for specified flake or list of flakes as specified in a json file

Resolves #5
References #7

Use internal tag to distnguich target types

Include target falg usage in examples

Set include provided source if available (resolves #9)

Resolve flake name

Update examples

Dont include empty license or description

Fix a misfomatting in cargot.toml

Add elastic dependencies

Implement a wrapper around the elasticsearch client

Implements pushing exports (#4)

Temporarily skip serializing an unimplemented field in elastic output

Extract reading source list files from binary

Add lazy_static as dependency

Implement createing and pushing to elastic index

Add elastic options

Provide default name and env falbac for elastic index

Modify app binary and type as optionals

App can be a derivation too

Update examples

Add more elastic commands

Supported:
- ensure
- clear
- push

Rename elastic search config struct

Add elastic push support to binary

Rename flag to enable elastic push

Imporve error messages and format binary source

Fix nix file incorrectly expecting meta fields

Changing flake descriotions to an optional field

deserialize git_ref as hash

Implement temporary stores and gc of these

prevents flakes from accessing store paths

Pass extra arguments to nix

Update cargo hash and skip integration tests

Move flake.nix to root folder and add apps for all components

Fix command invocation that fails test

Update README(s)

Add help for extra arguments

(cherry picked from commit be4bc3dd929178bef66114c2201aaa88e47e9add)

* Safely read legacyPackages

* Read nixosOptions from flake

* Update ES Mapping

* Show more detailed error and backtrace if available

* Try reading options only if key  is defined

* Format nix script

* Add error context when attempting deserialization

* Fix derivation representation to fit nix output

* Add push elasticsearch settings

* Add Flake channel

* Rename import module

* Remove Flakes Channel

* Prepare nixpkgs import

* Separate import/export types

* Break up nixpkgs package representation

* Use the same naming scheme for Nixpkgs entries and flake entries

* Document import module

* Remove serialization attributes

* Reversable type and SerDe implemetation

* Add *_reverse fields

* Unpublicating export fields

* Read from  NixOption struct

* serialize empty fields as null

* Tag export json variants

* Serialize a single option-declaration

* Format npkgs parse test

* Define NixOption

Sorry thats too late..

* Parse system key

* Make Package output compatible with the frontend

* Add Url-only licesnse variant

* Add StringOrStruct type

* Add accessor method for elements catched by OneOrMany

* New utility to flatten in homogenous lists recursively

* Add Maintainer type catching maintaiers used in nixpkgs

* Format Implementatio n

* Remove explicit representation of platforms

* Open nixpkgs parser to cover all packages

* Convert all imported fields to their export representation

* Define reverse fields in ES schema

* Format nixpkgs command runner

* Expose shorthand to pull a specific channel by command line

* Extract utility functions into their own module

* Implement AttributeQuery generation

* Integrate query in export

* Implement *_set attributes

* Document purpose of export module

* Use more descriptive github blob route

* Complete Option Export representation

Reuse the same option type for nixpkgs and flakes

* Enable nixpkgs option import

* Expose nixpkgs option import functions and integrate in binary

* Chunk ElasticSearch Bulk operations

* Address Example/Default field formatting

* Add abort strategy for existing indices

* New command line interface using subcommands

* Document new interface

* Bump version

* Add nixpkgs cron job

* More precise name for nixpkgs cron job

* Add Flakes cron job

* Read version from file and fix channel names

* Correct file names for flake group import

* Fix group command

* Run new cron jobs on PR

* Update Cargo sources

* Integrate new flakes route

* Add search type option

* Add flake types and messages

* Add flake types

* Extract Request body builders and expose more types

* Combine Package and Option Search

* Factor out html body

* Dispatch messages by search type to flake page

* Correct type naming

* Remove Debug instructions and unimplemented flake search type

* Do not reload Flake search page while the search subject is unchanged

* Implement switching subjects

* Fix init type signature

* Add url/git based flakes to mapping

* Parse flake info

* Link to flake repo and show flake maintainer

* Fix optional decoded values

* Add group and type as search buckts

* Show search selection in all cases

* Move flake decoding to search

* Show flake information for options

* Hardcode flakesearch to only search a specified flake index

* Improve experimental state notice

* Fix category select not present in some cases

* Change default flake index

* Show correct category title

* Add missing imports

* Serialize more optional fields as null

* elastic-test.rs file not needed anymore

* names of the workflows should be immediately obvious.

* better jobs names

* rename the flakes group

* need to provide --elastic-schema-version via the cli option

* typo

* Fix errors in workflow files

* Install flake enabled nix by default

* Fix variable substitution

* Use string group names

* Provide elastic schema verion only through cli

* Fix scheduled task name

* Improve error reporting

* Allow insecure packages here

* Add missing imports

* Tree-wide: cargo-fmt

* only import nixpkgs for now

* no importing of flakes

* also bump a version

* fixing cron-flakes.yml

* make it obvious that this is for frontend

* missed this when merging

* Extract hashes

- Split out revision info from flakes
- Retrieve current nixpkgs revision from github

* Write aliases, enabled by default

* Filter additional platforms

* Change alias structure

* expect channel like nixpkgs identifiers

* Don't cause error if push is aborted

* Specify correct channel identifier

* Allow options to evaluate unfree packages

* Retrieve and delete specific aliases

* Specify import path correclty

* Fix channel warmup

* Abort push if channel already indexed

* Remove debug pr hook for import action

* Fix indentation by tab

* Make flakes show again

* Fix import group naming in flake wrokflow

* Rename flake group to match imported index

* Run nixpkgs import on pr activity (Debugging behavior)

* Just show literal Examples, resolves #336

* Use actual nixpkgs branch names

* Trim derivation/option declaration path, resolves #335

Remove /nix/store/*-source prefix

* Fix sidebar width and close button position

* Placeholder texts in flake result area

* Show flake install info

* Don't show package/option selection before search

* Make sure install command for nixos is always shown

* Add toml source config support

* Rewrite current example flake group as toml

* Update flake cron job

* flake-info: use saner nix packaging method

When trying to first work in this I naive approached it with
`nix-shell`. That of course lead to the fixed output bollocks failing
with a hash mismatch. By making use of the `cargoLock` attribute on
`buildRustPackage` we can tame the FOD-beast and only have to provide
one hash manually for a single package (that we fetch from a GitHub
repository).

This also means that updating dependencies will be simpler as the native
Cargo.lock file can be used.

(cherry picked from commit c3a0e46d1eb56e128e6923e6c493eb836fc81e85)

* Update flake lock file

* Do not build python import script

* add flake names to the title as well

* Disable debug imports on prs

Co-authored-by: Rok Garbas <rok@garbas.si>
Co-authored-by: Andreas Rammhold <andreas@rammhold.de>
2021-08-26 00:40:42 +02:00
Yannik Sander 5ad71362e5
Rewrite import script in Rust (#320) 2021-08-17 10:55:08 +02:00
Naïm Favier 42b0e87393
import-scripts: fix IndexError for options with no declarations (#330) 2021-08-02 22:30:46 +02:00
Jan Tojnar 25b085fb41
Do not show legacy aliases (#309)
Legacy aliases are slated for removal and should not be used.

https://github.com/NixOS/nixos-search/issues/306
2021-06-08 17:16:36 +02:00
Rok Garbas 519f18e5a5
Add dependabot to automate updating of github actions (#316) 2021-06-08 14:03:18 +02:00
Rok Garbas ce08a87665
bump actions versions (#315) 2021-06-08 13:51:46 +02:00
Rok Garbas be5aea186b
forgot to update the github cron workflow to rebuild last 2 channels 2021-06-08 13:43:01 +02:00
Rok Garbas d1085b806f
21.05 release (#311)
* Bump unstable and add 21.05 release

* The usual typos

* The frontend stuff was missing

* preserve the order

* Update import-scripts/import_scripts/channel.py

Co-authored-by: Rok Garbas <rok@garbas.si>

Co-authored-by: Jonathan Ringer <jonringer117@gmail.com>
2021-06-01 21:49:42 -07:00
Rok Garbas ff8022fba5
emacs packages have new attr path (#299)
also bump version to make sure package set gets recreated
2021-03-30 23:58:24 +02:00
Rok Garbas 2c4a45134c
update flake inputs (#298) 2021-03-30 23:57:16 +02:00
Rok Garbas e5ba0562a7
unstable/21.03pre -> unstable/21.05pre (#297) 2021-03-30 23:32:43 +02:00
Rok Garbas 7c89b2349c
Filter on buckets only when there is some bucket selected (#289)
otherwise the query is malformed
2021-02-07 19:24:00 +01:00
Rok Garbas cfb5e540b9
Improving search query (#288)
* Reduce the numbers of bucket results on each ChangeBucket event
* Warmup after reindexing, fixes #250
* Using multiple sort keys, fixes #218
* Index also unfree packages, fixes #226, fixes #237
* Add wilcard query, fixes #279
2021-02-07 19:10:13 +01:00
Rok Garbas 72434f54a5
Search should be case sensitive (#287)
lowercase the query before using it in search queries
2021-02-06 13:38:13 +01:00
Rok Garbas 69efbb60de
version should not be shown if it is empty (#278) 2021-01-25 19:57:00 +01:00
Marek Fajkus b208c24872
Improve copy/paste UX in Options and Packages (#275)
* Improve copy/paste UX in Options and packages

- Change title from button to a to make it selectable
- Resurect `Name` meta for Options
- Make sure this won't break keyboard selection

* show description in details view in case of options

* make the area of search item in options easier to click on

* This should make sorting work again

* hide sorting menu

Co-authored-by: Rok Garbas <rok@garbas.si>
2021-01-25 19:09:23 +01:00
Andreas Rammhold e9bdeae3e2
Remove the defunct "burger menu" and always expand the navigation (#273)
I commonly run into a situation where the burger menu button is being
showed to me but it broke some time ago and doesn't expand the menu
anymore.

Since the snipped was probably mostly 1:1 translated from the old
nixos.org page (where we had more links than just the three we have now)
we can probably just remove it now. It is a net win as the feature was
broken and at least now you can use the website on mobile again.
2021-01-25 17:52:12 +01:00