top | item 42356510

(no title)

letier | 1 year ago

How do you do the initial setup? I'm concerned with anything that happens before activating the dev shell.

Right now I wrote a bash script to check for nix, direnv, git, gpg, etc. But it feels a bit clumsy, compared to the flake that contains the dev shell.

For my own system I set up home manager. But I don't want to make the use of home manager a requirement, as it can be quite opinionated. (e.g. setting up direnv will be done by generating a .zshrc, which can be limiting to some)

discuss

order

microtonal|1 year ago

For our particular project you only need to install Nix and then run nix develop, but I'd indeed recommend to use direnv. For me it's not an issue, since I run NixOS on development VMs, but a colleague who was not using Nix before (I think) also wrote a bash script to set up an AWS VM with the NixOS AMI and then rolls out a minimal NixOS configuration.

I think for people who don't want to dive into Nix much, doing an imperative install (nix profile install) of the necessary packages is also fine. You could even make your own small meta-package that depends on everything that is needed. Then they could do a nix profile install yourflake#yourmetapackage and have all the tools they need. But I agree direnv is a bit harder, since you'll have to put something in the shell rc/profile.

letier|1 year ago

The imperative install is as many lines of code as the flake itself. That’s what’s bothering me. But a meta package would be a step in the right direction.

Thank you!