Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NixOs? #3290

Open
kfjahnke opened this issue Dec 28, 2023 · 2 comments
Open

NixOs? #3290

kfjahnke opened this issue Dec 28, 2023 · 2 comments

Comments

@kfjahnke
Copy link
Contributor

Two recent articles in c't Magazine made me aware of nix and NixOs. It's been around for a long time, but it took these c't articles to make me find it! Wish I'd seen it earlier. After browsing a fair amount of docu and playing around a bit, I got the impression that setting up a build environment with NixOs might be a viable alternative to using an old Ubuntu (20.04 as of this writing) or debian oldstable (proposed recently) as build environment. Setting up a build environment with NixOS should produce a completely reproducible space to create AppImages, so you could simply point users to whatever you deem appropriate at a given time and be dead certain what they use. It should also be ideal here to provide a stripped-down environment to test-run/verify AppImages proposed for the catalog - rather than using a docker container on github. What do you think?

@probonopd
Copy link
Member

Hi @kfjahnke, NixOS is certainly an interesting project but I never understood what they mean by "purely functional". It would be good if they'd explain the advantages in terms of features rather than in terms of mathematics ;-)

@kfjahnke
Copy link
Contributor Author

'functional' is one of the three common programming paradigms: procedural, object-oriented and functional. 'pure' in than context means that the functions which produce results do not have side effects. See this link.

nix uses the functional paradigm to set up environments which depend entirely on a set of given input values - since the functional processing has no side effects, the result must be the same if the inputs are the same. So you can form a cryptographic hash over the inputs and store the result, indexed by that hash. If the same pattern of inputs reoccurs (the hash is the same), you can retrieve the previously built 'derivation'. The patterns of inputs nix deals with are properties of environments: environment variables, versions of tools and libraries, contents of files etc. - so you avoid 'DLL hell', version conflicts, etc - if only one component differs, you get a new hash and a different result. This makes it possible to specify an environment down to the last bit, just what you want for a build environment which is intended to be used by a wider group of people cooperating on a large project. No more 'but it works on my machine'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants