Eventually this will turn into a blog post/guide/tutorial of intermediate "difficulty".
- Create most basic Elixir/Phoenix/Liveview app
- Set up Nix boilerplate on macOS (arm64)
- Use Nix (devenv/devbox?) to build container
- Change Erlang/Elixir versions based on current project
- Editor and language server setup
- Set up GitHub CI
- Deploy Nix to Fly
- Document troubleshooting, uninstalling, reinstalling
- Get Nix working on my machine...
- For goal #3, which install "method" should we use?
- Vanilla?
nix-env
(installs permanently)- People seem to recommend against this and to use
home-manager
.
- People seem to recommend against this and to use
nix-shell
(only installs in new shell)nix shell
(flakes-only variant?)- https://nixos.wiki/wiki/Nix_command
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix-command
(experimental?)- Flake profiles?
nix profile install
- https://nixos.wiki/wiki/Flakes#Install_packages_with_.60nix_profile.60
- Declarative with flakes?
nix flake init
- https://devenv.sh/guides/using-with-flakes/
- Declarative without flakes?
configuration.nix
withenvironment.systemPackages
set
- For goal #3, should I use the NixOS container image instead of Debian?
- For goal #6, is it worth considering using Hydra/NixOps?
- For goal #7, check out https://github.com/fly-apps/nix-base
The term "Nix" can mean few things depending on the context:
- The purely functional programming language, Nix
- The package manager, Nix
- "The package manager implements a concept called derivations. A derivation is essentially a data structure that says “We have a transformation that we want to apply to some data.” Usually, this transformation is something like running a compiler or running some other tool that does file transformations. And these derivations specify all of the inputs that they have, fully pinned, which means that we have full SHA hashes of everything that gets into the derivation, and then this information together can be used to create a hash." - Vincent Ambo
- Each package is essentially a Merkel tree / DAG of input hashes.
- The operating system, NixOS.
Commands: nix shell
“installs” requested packages into an ephemeral shell environment. nix develop
is sort of like nix build --interactive
or nix build --debug
; it creates a build environment for a particular Nix package and instead of automatically running build phases, it drops you into a shell in the build envionrment so that you can debug the build itself. nix develop
also allows you to set up other aspects of the build environment, such as variables. (source: Nix forum)
- Nix
- https://github.com/NixOS/nix
- https://zero-to-nix.com/start
- https://zero-to-nix.com/concepts
- https://nixos.org/manual/nix/stable/installation/installing-binary#macos-installation
- Note: Do not use this. Use:
- https://nixos.org/guides/how-nix-works
- https://nixos.org/guides/nix-pills/pr01
- https://github.com/nixos/nix.dev
- https://nix.dev/guides/best-practices
- https://github.com/nix-community/nix-direnv
- Home Manager
- Devenv
- Devbox
- Nixery
- Hydra
- Nix-Darwin
- Nuenv
- Fleek
- Flox
- Snowfall
- https://github.com/Misterio77/nix-starter-configs
- https://github.com/mitchellh/nixos-config
- https://github.com/hauleth/nix-elixir
- https://github.com/the-nix-way/dev-templates/blob/main/elixir/flake.nix
- https://github.com/search?q=language%3Anix+Elixir+stars%3A%3E1&type=repositories&s=updated&o=desc
- https://github.com/nix-community/awesome-nix
- https://nixos-and-flakes.thiscute.world/preface
- https://ianthehenry.com/posts/how-to-learn-nix/
- https://paperless.blog/nix-shell-template
- https://jvns.ca/categories/nix/
- https://animeshz.github.io/site/notes/20-29--DevEnvironment/21--Linux/21.02-Nix.html
- https://christine.website/talks/nixos-pain-2021-11-10/
- https://shopify.engineering/what-is-nix
- https://serokell.io/blog/nix
- https://ersei.net/en/blog/tag:nixos
- https://earthly.dev/blog/what-is-nix/
- https://ejpcmac.net/blog/tags/nix/
- https://checkoway.net/musings/nix/
- https://lucperkins.dev/blog/home-manager/
- https://dee.underscore.world/blog/home-manager-flakes/
- https://juliu.is/tidying-your-home-with-nix/
- https://wickedchicken.github.io/post/macos-nix-setup/
- https://www.channable.com/tech/nix-is-the-ultimate-devops-toolkit
- https://grahamc.com/blog/nix-and-layered-docker-images/
- https://thewagner.net/blog/2021/02/25/building-container-images-with-nix/
- https://tonyfinn.com/blog/nix-from-first-principles-flake-edition/
- https://www.slice.zone/blog/nix-in-practice
- https://xeiaso.net/blog/nix-flakes-1-2022-02-21/
- https://fasterthanli.me/series/building-a-rust-service-with-nix
- https://blog.wesleyac.com/posts/the-curse-of-nixos
- https://changelog.com/topic/nix
- https://pod.link/1602572955/episode/32b5c52e4bf53272fa0c5d27b1a30042
- "Vim and Nix with Jasper Woudenberg", Software Unscripted
- Replit (similar to GitHub Codespaces, but built on Nix instead of devcontainer)