5 ms·
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 sit
by dack 4y ago
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 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.
- pveierland 4y agoGood 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 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 4y agoSounds 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 4y agoDoes a nix language server improve discoverability?
- mynameisvlad 4y ago1000% 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 4y agoI find the options search to be generally suitable for that case https://search.nixos.org/options https://search.nixos.org/options
- dack 4y agoYeah 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.
- MuffinFlavored 4y agoI’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?
- ratorx 4y agoNix is badly named, because it is many things. Nix is a lazy, functional programming language that was designed to write reproducible packages (in the traditional Linux distro sense). A Nix package is just a function. It takes in some inputs (the dependencies), and produces an output. But instead of saying “take libssl”, you actually say “take libssl at this exact version” (or more precisely at this exact combination of input files with this exact content). However, because it is a programming language, you can make the package inputs generic over the version. This may seem esoteric and pointless but actually gives rise to a lot of nice properties (reproducibility, caching, recompilation tracking among others). Nix Packages, are a collection of packages that are written using this language. It’s pretty comprehensive and many packages can be used on both Linux and Mac (like Homebrew), so it’s a cross-platform package manager. Unfortunately, the package manager for this set of packages is also called Nix. NixOS is an operating system built on top of the language, using the packaging ecosystem (Nix Packages) and also providing some abstractions for writing services, declaring users, crons etc. (kind of like Ansible). A Nix Flake is a relatively new thing. It is a framework on top of the Nix language for writing these {packages/OS config} that can much more cleanly specify the dependencies and pin them. Kind of like NPM, but for everything (package versions, OS module versions, any Git repo etc.). You could do this before, but it was less nice. Now, you can update all the dependencies of your entire project with one command, including things like shell plugins, Vim plugins, the version do Bash used to run your build scripts, developer tools, LSPs for your editor, your text editor itself (though I usually don’t go this far) etc. There are many other uses. You can use it to build OCI images (they are just a specific way of combining some dependencies, and this can be expressed pretty easily in Nix). These have better properties than typical Docker images (built via Dockerfile) and can be cached better and tend to be smaller without needing to use something like musl. You can use it manage user dotfiles (similar to OS management, see Home Manager), developer environments (kind of like Python virtualenv, but for everything), project dependencies and whatever else you can build on top of the language really. Basically anything that could benefit from having packages nicely integrated with config could be built with/on top of Nix. Why would you use it? Well for me: * I like being able to manage package versions and config together painlessly, which was always a pain with Ansible. * It’s fully declarative (if you remove the config for a service it stops running; not true for e.g. Ansible) * Nix language is not the greatest, but it is sooo much better than YAML. Unfortunately the set of language features needed is quite niche, so it couldn’t just be a library for an existing popular language (except maybe Haskell or a Lisp) * I like being able to update everything (with free rollbacks if something breaks) with 1 command. * It’s pretty interesting. It’s theoretically quite well built and find ways to make good use of some nice programming constructs (e.g. fixed points, laziness), that appeals to me. What the language lacks is documentation and tooling. * Reproducibility is nice, but not the selling point for me. I dipped in my toes with using Nix Shell to have reproducible developer environments and then slowly moved everything over.