MyNixOS: Flake-centric website for Nix/NixOS configs (v. 0)

Hello! I’m posting to announce MyNixOS, a small Nix/NixOS dedicated website I started building last year. During quarantine I wanted to grok a new technology, and spent the time reading Nix manuals. I’ve really enjoyed using NixOS to manage my software environments, and wanted to build a way to create and share Nix configurations.

Today I’m posting version zero of the website, with a link to sign up for the alpha version when it becomes available. Currently the site can be used to discover indexed content. Most of the packages/options in the Nix registry are indexed (missing: agda/fenix/mach-nix/nixos-homepage/blender-bin). The plan is to follow a GitHub model, where core functionality stays free, and premium features are planned to fund further development.

Project website: https://www.mynixos.com/
Project chat: https://matrix.to/#/#mynixos:matrix.org

Fun feature: Press O/P to navigate to random options/packages after the index has been loaded (shown as a green icon at the bottom after performing a search).

PS: Note that the first search is slower as it fetches the search index. Following searches will be quicker.

12 Likes

The site looks great! Quick question, I’m new to Nix/NixOS and I’m struggling to figure out how this differs from the search at NixOS Search - Loading... ?

2 Likes

Hi @binarybana ! Cool to see other people new to Nix/NixOS. Regarding differences, this is my understanding:

In scope, NixOS Search is the stable and official way to search NixOS, while MyNixOS is an experiment to allow creating and sharing Nix/NixOS configurations. Currently, version zero of MyNixOS is available, which can only be used to discover content. This makes the sites seem pretty similar currently, but the differences will become more clear with the alpha version.

There’s also current practical differences, such as:

  • NixOS Search searches more fields than MyNixOS, such as the description field of options/packages.
  • NixOS Search offers more elaborate filtering of search results.
  • MyNixOS uses a local search index which gives faster searches.
  • MyNixOS indexes certain additional content, e.g. home-manager options.

I’ve been working on a round of changes which will be posted this week, including a changelog to keep track :slight_smile: If there’s any functionality you are looking for, please post here or use the sign-up form on the site.

1 Like

An updated version of the site is now live (v0.0.5), which includes executables from nix-index as part of the search index (best effort made to filter correctly for executables). Thanks to @x10an14 for the suggestion! :slight_smile:

Changelog: MyNixOS

1 Like

Hello!

I’m posting a small update as the first alpha version of MyNixOS is now live.

To try out the MyNixOS alpha, please visit: Sign-up to MyNixOS

The initial MyNixOS alpha is being released as a minimally-useful version in order to start user testing, and to make it possible to ship smaller features more often, instead of having a large separate alpha branch.

Available alpha features:

  • Creating and sharing a flake configuration
    • After logging in to MyNixOS, click the “create” button on the upper right of the screen to start a new flake.
    • Create - MyNixOS
  • Adding and removing a package from a given flake configuration
    • After starting a flake and selecting it as your current flake using the flake selector, navigate to a package and click “Add to config” (currently limited to nixpkgs packages).
    • A package such as “roboto” will be added to the “fonts.fonts” config of your current flake.
    • A package such as “sl” will be added to the “environment.systemPackages” config option of your current flake.
  • Setting configuration options for a given flake configuration
    • After starting a flake and selecting it as your current flake using the flake selector, navigate to an option to assign it a configuration value.
    • An option such as “systemd.user.targets..requisite” shows three features:
      1. Setting a configuration value requires selecting a key for the <name>.
      2. Setting a configuration allows the manipulation of list entries.
      3. Each string list entry must match a given regular expression.
    • An option such as “services.bitcoind..dbCache” shows two features:
      1. Configuration values can either be set to “null” or an integer value.
      2. Configuration values must be integers between 4 and 16384 as set by the option constraints.
    • An option such as “time.timeZone” has a custom option type enabling selection of a timezone value.
    • Further option support will be added to ensure that all option types can be manipulated, as well as enable adding arbitrary settings, and enable raw editing of all options settings.
  • Releasing a flake
    • Navigate to your flake by clicking the flake selector to the upper right after selecting a flake. From the flake configuration page you can select the “release” button in the “versions” tab, which will create a release. From the “versions” page you can then get the link to download your release as a tarball.

An easy way to get started with testing MyNixOS is to add the tarball as an input to a flake you are already using, e.g.:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs";
    myflake.url = "https://api.mynixos.com/[USERNAME]/[FLAKENAME]/archive/latest.tar.gz";
  };
  outputs = inputs@{ self, nixpkgs, myflake, ... }
  {
    nixosConfigurations.myMachine = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [ ./configuration.nix myflake.nixosModules.default ];
    };
  };
}

Remember to update your flake lockfile after each new release in the web interface:

nix flake lock --update-input myflake

The following constraints have been chosen for the initial MyNixOS alpha version:

  • Single flake editing in internal format.
    • Support for converting existing Nix files to an internal format is a possible future addition.
  • Single default NixOS module.
    • Support for multiple modules is currently supported by the API, and web client support is planned to be added soon.
  • No support for NixOS configuration, overrides, or overlays.
    • Support for NixOS configurations is planned to be added soon, while overrides and overlays are planned to be delayed until later.
  • No specific support for home-manager.
    • Support for correctly using home-manager options is planned to be added soon.
  • No support for resource files.
    • Support is planned to be added soon.
  • No support for linking flakes directly.
    • Support is planned to be added soon.
  • No support for multi-channel flakes.
    • Partial support is planned to be added soon.

There’s a long list of planned features, but I’m trying to arrange the development to make the project useful as soon as possible. The project is actively developed to create further features, which can be tracked at: Changelog - MyNixOS

Support is available in: https://matrix.to/#/#mynixos:matrix.org

Posting a project update for MyNixOS as the development continues :slight_smile:

The following is a summary of the new features by version:

v0.1.3: Added GitHub + Google login (in addition to username/email)
v0.1.6: Added development shells + support for multiple NixOS modules
v0.1.8: Added NixOS configuration support + ability to import modules within flakes
v0.1.9: Added attribute set type support for NixOS options (~90%+ of NixOS options currently have supported types, including UI controls)
v0.1.10: Added Markdown support to flakes
v0.1.11: Added locking UI to control flake input locking

Flake inputs interface:

Example showing two flake inputs and their corresponding locks, with functionality to update selected locks, roll back the lock change, or recreate the lock file.

Flake outputs interface:

Example showing the NixOS module nixos with 5 NixOS module imports and 1 NixOS option setting:

Some planned features:

  • Home-manager modules
  • UX for cross-flake module imports
  • User resource support for easily adding files to flake configurations
  • Multi-channel support

Is the source code public?

1 Like

The source code is currently closed. This may change partially or fully over time, based on the development of the project.

Short status update, as version v0.1.12 was released yesterday, which adds basic Home Manager support.

  • Home Manager configurations and Home Manager modules can now be added as flake outputs.
  • Home Manager configurations can import Home Manager modules, and Home Manager modules can import other Home Manager modules.
  • NixOS configurations and NixOS modules can both import Home Manager configurations.
  • Packages can now also be added to the home.packages option.

A demo can be found here: https://mynixos.com/pveierland/home-manager-test

I don’t understand the benefits to use MyNixOS compared to search.nixos.org , is it the support for people submitting their flakes?

(don’t get me wrong, it’s a great project :+1:t3: )

2 Likes

Thank you Solene!

After starting with NixOS I wanted to create a UX to help make configuring NixOS easier for beginners. The idea with the MyNixOS website is that you can create and share nix flakes from the web browser without knowing how to write Nix directly, as it generates the Nix code for you. I realize that the front page alone does not describe this right now - this will be better communicated in a later update.

As stated earlier in the thread, the difference is then that search.nixos.org is the authoritative reference for looking up Nix/NixOS content, while MyNixOS is an experiment to see whether a useful UX can be built for creating and sharing flake configurations.

Currently you can:

  • Create flakes (press the green button on top after logging in).
  • Add outputs to flakes - currently supporting: development shell, Home Manager configs + modules, NixOS configs + modules.
  • Browse options and set settings. Most options have type support (90%+), which means that e.g. a regex will get checked, a list type will allow you to add items etc. UI is basic - please be gentle.
  • Browse packages and add them to a development shell, a Home Manager config/module (home.packages), or a NixOS config/module (environment.systemPackages). A package such as roboto will be added to fonts.fonts.
  • Create internal imports in flakes (cross-flake imports coming soon). Home Manager configs can import Home Manager modules, NixOS configs can import Home Manager configs and NixOS modules, NixOS modules can import NixOS modules.
  • Control flake inputs, adding/removing inputs and updating their locks.
  • Release flakes, which will build a tarball with the created flake config.

Some simple demos:

2 Likes

Awesome project! IMO, much better approach than a NixOS Installer UI.

It would be nice if a generalized version could be released that I can modify for a little bit of an on-hold project a la https://github.com/divnix/hive — meant, in spite of the readme, for NixOS beginners.

(Would essentially require a generalization of the flake writer interface)

1 Like

Thank you! Feel free to reach out on Matrix for a talk about details :slight_smile:

1 Like
Hosted by Flying Circus.