The packages themselves can't mutate, the nix store is read-only (except during installation). But some packages needs a global, mutable state (think databases), which is fine. What isn't fine is that some packages expect that mutable space to be in certain paths, and things get messy. Gitlab comes to mind as a service that's been extremely painful to get working under nixos because it expects its install path to be mutable.
There are ways to get around the immutability, but they are very highly discouraged and I haven't seen anybody use them other than newcomers. Think of it like `unsafePerformIO :: IO a -> a` in Haskell.
Namely there is:
- Making the Nix store writable. Normally it's mounted read-only, and only the Nix daemon can write finished deterministic builds there. Often wanted by users who haven't learned how to handle Nix packages, as they just want to change some file in the store.
- Disabling the sandbox. Usually all builds are done in a sandbox which doesn't have network access, read access only to the Nix store and write access only to only the destination directory in the Nix store (with some exceptions), which gives strong reproducability guarantees.
I suspect the parent is referring to imperative package installs, i.e.
nix-env -i firefox
This does create an immutable copy of Firefox in the Nix store, but it's not reproducible in the sense that the profile state isn't captured in a Nix expression.
Re:NixOS 18.03 Released
by pseudonom- on Friday April 06, 2018 @12:44PM
(#16774683)
Though there are a couple more declarative ways to handle user package installs.
Re:NixOS 18.03 Released
by pseudonom- on Friday April 06, 2018 @04:36PM
(#16777165)
Are you saying that NixOS allows packages to cheat? That seems like a serious flaw.
If there's one thing worse than a non-purely-functional system, then it must be a system that claims to be purely-functional but turns out to be non-functional.