Hi there. Just created my first shell.nix for developing GnuCash. Guide at GitHub - christopherlam/gnucash-on-nix and shell.nix created via trial&error works well.
Any feedback appreciated, especially shell.nix vs flake.nix
Hi there. Just created my first shell.nix for developing GnuCash. Guide at GitHub - christopherlam/gnucash-on-nix and shell.nix created via trial&error works well.
Any feedback appreciated, especially shell.nix vs flake.nix
There is an even simpler alternative, as gnucash is already packaged for NixOS.
git clone git@github.com:NixOS/nixpkgs.git
cd nixpkgs
nix-build -A gnucash
Have a look at the files under ./pkgs/applications/office/gnucash in the git checkout.
To expand on @ngiger’s answer: You can be dropped into a development shell for each package in nixpkgs via:
nix-shell "<nixpkgs>" -A gnucash
Alternatively via flakes:
nix develop nixpkgs#gnucash
Thanks for suggestions; it’s useful to know other forms.
Forgive my beginner questions.
Ad 1. Actually you’ll get quite some flexibility without having to write a new expression. E.g. use
nix-shell -E 'with import <nixpkgs> { }; gnucash.override { stdenv = clang10Stdenv; }'
Of course you’re still free to just put the expression into a shell.nix
such that you don’t need to type that much.
Ad 2. Not quite sure what you mean here. Have you compared nix-shell
to nix-shell --pure
?
Ad 3. There’s a couple benefits to using flakes. Easy pinning and updating. Nicer and more uniform UI with the nix
command. The downsides are that flakes are not yet officially considered stable and that a flake.nix
file forces a bit more fluff/verbosity on you.