this post was submitted on 11 Feb 2024
12 points (100.0% liked)

Nix / NixOS

1783 readers
1 users here now

Main links

Videos

founded 1 year ago
MODERATORS
12
submitted 9 months ago* (last edited 9 months ago) by [email protected] to c/nix
 

Hi,

how would one create a development environment for #xmonad contained within my nixos system configuration?

My flake for my system sets up xmonad with a custom config.hs and I'd like to get a suitable dev environment when editing the config.hs. Usually when developing for haskell, I'll use a flake and setup a devShell which then gets loaded by direnv.

  • is there best practice?
  • my config.hs is in a subdirectory

My first attempt would be to just provide a shell.nix next to my config.hs - but that wouldn't load the exact same xmonad as the system one, since it's separate from the flake.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 9 months ago

Hi, I didn't get a notification and then totally forgot to manually check :(

Thanks for your links, I'll check them out! My setup is quite similar to yours.

Another idea could be to extract the home/programs/xmonad thingy into its own flake somehow.

Currently I'm trying to figure out if direnv is able to load a particular devShell somehow (and then limim it to a particular host), but didn't make progress yet. My idea is to have a devShells entry that pulls in xmonad etc. but only gets activated if I enter the xmonad subdirectory... Mh maybe a simple shell.nix with manually managed pinning for nixpkgs could be a way forward.

I'm currently also doing the nixos-rebuild step to check the config.