| [HN Gopher] Show HN: MyNixOS - Create and share Nix and NixOS co...
___________________________________________________________________
Show HN: MyNixOS - Create and share Nix and NixOS configurations
Hello HN! I want to show you MyNixOS.com - a website I've been
working on this year to make it easy to create and share Nix and
NixOS configurations. Nix is a powerful tool to deploy software in
a reproducible way, and with NixOS you can control your whole
operating system through a declarative configuration. Starting out
with Nix was exciting, but it definitely had a challenging learning
curve. This made me start building a website focused on making it
easier to create and share Nix flakes, which are the core unit of
software deployment in Nix. Using the website, you can create
flakes without knowing the Nix configuration language, as the
necessary Nix files are generated for you. A few examples of what
you can do right now: 1: Create and build a Docker image with
Redis and OpenSSH running NixOS: https://mynixos.com/mynixos/demo-
docker / https://www.youtube.com/watch?v=3fuCGXHw7qM 2: Create a
Nix development shell with Neovim and Zig and run it on Windows 11:
https://mynixos.com/mynixos/demo-windows-devshell /
https://www.youtube.com/watch?v=F4q72mGjYXA 3: Create a
reproducible macOS environment using nix-darwin and Home Manager:
https://mynixos.com/mynixos/demo-macos /
https://www.youtube.com/watch?v=r0Y7s1sRSUY 4: Create a Linode
server image using NixOS running Nginx with Let's Encrypt:
https://mynixos.com/mynixos/demo-linode-nginx /
https://www.youtube.com/watch?v=Cy4X0fjD0-Y 5: Create a Raspberry
Pi NixOS image running Transmission and OpenSSH:
https://mynixos.com/mynixos/demo-raspberry-transmission /
https://www.youtube.com/watch?v=6L0H92-JdHA The site works
directly with the Nix command line tool, and generates pure Nix
flakes without any custom formats. The website is currently in
alpha and is developed as a closed source project. Some interesting
upcoming features include support for language environments such as
Python, and the ability to install arbitrary versions of packages.
By posting on HN, I'm especially looking to get in contact with
early commercial users of Nix to learn more about the most
important use-cases to solve. Hoping that you will find the site
useful, and I'll happily try to answer any questions you might
have!
Author : pveierland
Score : 153 points
Date : 2022-11-27 13:15 UTC (9 hours ago)
|
|
| dack wrote:
| This looks really cool, but at first glance it seems like you
| really need to already know how to create nix flakes and what all
| the settings mean to use the site. I didn't sign up, but I
| watched your redis video
| (https://www.youtube.com/watch?v=3fuCGXHw7qM) and it seems like
| you just knew all the configuration settings you wanted and
| searched for them.
|
| Maybe that's fine for your target user, but I would think you
| could get non-nix folks on board if there was more of a "wizard"
| type flow that tells you the options and explains them as you go
| through it.
| MuffinFlavored wrote:
| I've read about Nix 10 times on HN and can't figure out why I'd
| use it over Docker. I already know Docker + Compose and the
| syntax for Nix looks gross/confusing.
|
| I am guessing Nix flake is like Dockerfile. You build it, and
| then what? How/where do you run it? k8s? Docker? Is it OCI?
| pveierland wrote:
| Good point! Additional wizard-style UIs will make sense for
| certain use-cases, such as e.g. "adding a new user", or
| "creating a Python environment". Another strategy is to keep
| making re-use and composition easier, as this is a great way of
| learning. By seeing what is necessary to set up a Docker image,
| simply copying the necessary settings and then tweaking the
| config to add your services should allow learning through trial
| and error.
|
| Composition is already possible, where you can import modules
| between flakes, such that you can keep e.g. the Docker base
| config in one flake, then re-use this in other flakes. Soon,
| indexing of modules will also be added to the site, which will
| make it easy to import e.g. a base computer configuration from
| `nixos-hardware`: https://mynixos.com/nixos-hardware
|
| Some other features which will be added is cloning of flakes,
| and easily copying + moving sets of settings between modules
| and flakes. This should also make it easier to borrow settings
| from other configurations to build your own.
| dack wrote:
| Sounds great! I currently run a NixOS desktop but I still
| struggle quite a bit with the documentation and
| discoverability of configuration/language. That's one of the
| biggest pain points in my eyes, so a UI like you have could
| really make that simpler. Letting users introspect what
| settings are available and how they work seems like one way
| of making things more discoverable (but not necessarily
| making a specific wizard for a specific build, since that
| doesn't seem scalable or generalizable).
|
| That said, I also agree with you that having reusable modules
| that are documented would help, and being able to clone and
| copy/paste settings + seeing examples would too. Good luck!
| eterps wrote:
| Does a nix language server improve discoverability?
| mynameisvlad wrote:
| 1000% this. I spun up a nixos VM to play around and love
| the concept, especially things like declarative home
| directories.
|
| But it's impossible to discover all the various things you
| can do.
| bitmapper wrote:
| I find the options search to be generally suitable for that
| case https://search.nixos.org/options
| dack wrote:
| Yeah that's super helpful for NixOS configuration
| options. What trips me up more is configuring particular
| packages. Usually it's where I want to configure a
| particular version or github commit of a package for some
| reason (usually I want a bug fix).
|
| However, a bunch of packages are defined in some bespoke
| way with various custom config inputs that generate other
| bits of config and generally are hard to understand.
| Thinking it through, I'm not sure it's possible for the
| OP's tool to solve this particular problem.
| SkyMarshal wrote:
| Looks great. Submit it to https://www.reddit.com/r/NixOS/ too, if
| you haven't already.
| pveierland wrote:
| Thank you! There's been a couple of posts:
|
| -
| https://www.reddit.com/r/NixOS/comments/wzqv2v/mynixos_alpha...
|
| -
| https://www.reddit.com/r/NixOS/comments/ys0tad/mynixos_alpha...
|
| Trying to not spam in order to keep the signal ratio decent,
| however this new set of tutorials might make sense to post :)
| anthropodie wrote:
| I think r/selfhosted would love this too
| pveierland wrote:
| Thank you - I didn't know about that one! Created a post
| there now:
|
| https://www.reddit.com/r/selfhosted/comments/z66yo9/mynixos
| _...
| larusso wrote:
| Awesome. After my arch configs blew up after the last major
| upgrade between September and March I thought to give nix another
| try. I ran it on macOS, first with nix-Darwin later only with
| home-manager and on Linux. I won't try to manage macOS anymore.
| I'll give this a try. Lucky for me I already spend a lot of time
| with nix and my hope is that this time around I get a better
| result.
| pveierland wrote:
| Great to get some experienced people testing it out. Please
| feel free to reach out on Matrix if you get stuck anywhere or
| wish to provide feedback:
| https://matrix.to/#/#mynixos:matrix.org
| _huayra_ wrote:
| Thanks for doing this! Nix has been one of those tools that looks
| so cool, yet the instruction manuals are akin to the "...draw the
| rest of the fuckin' owl" meme whenever I look into it. This gives
| me hope to give it another go!
| pveierland wrote:
| That's really cool to hear! Please feel free to reach out on
| the Matrix chat if you get stuck anywhere:
| https://matrix.to/#/#mynixos:matrix.org
| rgoulter wrote:
| > A few examples of what you can do right now
|
| These examples look neat. I'm reminded of https://nix.dev/
| (which, sadly, is pre-flake).
|
| > make it easy to create and share Nix and NixOS configurations
|
| I could see a lot of value in the sharing/reading aspect of this.
| -- I think it'd be helpful to be able to look at different NixOS
| configurations without having to dig into the code directly.
|
| > The site works directly with the Nix command line tool
|
| I find this part confusing.
|
| One of the neat things about nix flakes, is that it's "like
| docker without containers". You can just run `nix run
| github:/`, and nix will be able to run the code from
| that flake. -- So I guess I'd expect the "copy-paste to run this"
| command to be similar to "nix run
| https://mynixos.com/".
|
| But, the "Download" section in the Meta tab of the demonstrations
| are about using some tool that isn't nix.
| pveierland wrote:
| Thanks for the feedback! When released, the flakes are just
| tarballs which can be used with the Nix command line tool, for
| example nix develop
| https://api.mynixos.com/mynixos/demo-windows-
| devshell/archive/latest.tar.gz
|
| Will bring you into the development shell declared by the demo-
| windows-devshell flake. You can either copy the link for
| specific versions, or use the "Latest" reference link. These
| links can either be used with the Nix command line tool or as
| direct flake input URLs to flakes that you write outside of
| MyNixOS.
|
| Note that the commands shown in the "Meta" section are just
| shell scripts to help you install Nix, direnv, and a flake
| loader, which is just a convenience wrapper that you can keep
| in your source control if you wish.
| flurie wrote:
| How does this differ from flox[1]? It looks like you're trying to
| cover much of the same ground.
|
| [1] https://floxdev.com/
| pveierland wrote:
| Flox's website was only opened up a few weeks ago, so it hasn't
| really factored into the development of MyNixOS. I haven't had
| the chance to test it yet, but I'd guess a few differences
| would be that Flox is targeting enterprise use with proprietary
| tooling + formats, with a larger focus on the command line
| interface, in order to guarantee the user experience to a
| larger degree. MyNixOS targets pure Nix flakes and the Nix
| command line tool, and focuses more on the website UX to lower
| the barrier for creating and sharing Nix flakes for beginners.
|
| As the potential for the core Nix technology is so great, many
| different approaches and tools will be necessary to help
| discover and cover the different use-cases. Flox made a good
| impression at NixCon in Paris, and they seem to be doing a lot
| of good things to make the community solid.
___________________________________________________________________
(page generated 2022-11-27 23:00 UTC) |