3 ms·
My experience with NixOS
- boothead 12y ago100% agreement from me! As I wrote a few days ago here https://news.ycombinator.com/item?id=7905511 https://news.ycombinator.com/item?id=7905511: All my projects now have a default.nix and a shell.nix and I have this little snippet in emacs: (setq haskell-process-type 'ghci haskell-process-path-ghci "/home/ben/.nix-profile/bin/nix-shell" haskell-process-args-ghci '("-I" "." "shell.nix" "--pure" "--command" "cabal configure; cabal repl")) This drops you into a nix shell with all the dependencies for the project you're working on present. You can also (especially easy if you're using projectile) run compile with the command nix-shell -I . shell.nix --command "cabal configure; cabal build" and that give you a nice list of type errors in your current project. Repeatable builds with no cabal hell. In the words of disney: "I'm never going back, the past is in the past!"
- cwp 12y agoI do this with node and python projects. I develop using nix on a Mac, then deploy to NixOS servers. One thing I've found handy is to create a .profile file in the root of my project directory with additional shell customization for that project (eg. bash functions for running my tests). Then I have a function in my login profile that invokes nix shell (essentially) like this: nix-shell --command "source .profile; return" default.nix That makes it really easy to drop into a customized development environment, with all my dependencies taken care of, and which exactly corresponds to the environment that will be present at deployment time. It's fantastic.
- nickbauman 12y agoWhat about people who want to program lisp instead of Haskell?
- ics 12y agoAside from perhaps the syntax of the Nix declarations (which isn't Haskell, though it is lazy etc.), is there anything holding you back from using Nix? As an alternative, are you familiar with Guix? https://www.gnu.org/software/guix/ https://www.gnu.org/software/guix/
- wereHamster 12y ago"what I dislike ... systemd" -- Without any sort of explanation.
- dscrd 12y agoWell, at least it's intellectually honest then.