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

Learn and refactor some Nix expressions #155

Closed
b123400 opened this Issue Oct 27, 2016 · 10 comments

Comments

Projects
None yet
6 participants
@b123400
Copy link

b123400 commented Oct 27, 2016

Nix is a pure functional package manager, I am trying to learn the language configure my NixOS server with it

@ches

This comment has been minimized.

Copy link
Member

ches commented Oct 27, 2016

I believe @jean has some experience with Nix and @aljones15 with NixOS, if you didn't find them already they can probably help 😃

@ches ches added the devops label Oct 27, 2016

@ches ches added this to the 2016-10-27 Hack Night milestone Oct 27, 2016

@b123400

This comment has been minimized.

Copy link

b123400 commented Oct 27, 2016

Wow cool! Not sure where can I them... I am sitting at table orange! (No permission to move card)

@b123400 b123400 added the orange label Oct 27, 2016

@aljones15

This comment has been minimized.

Copy link

aljones15 commented Oct 28, 2016

hey I have not done a full build script like you have, but I have done plenty of dev enviroments and what you seemed to have been asking for a dev env. To be honest I don't think I'm anywhere near your level, but is there a tutorial or any documentation you used to construct that nix build script? the dev enviroment stuff is here: https://nixos.org/wiki/Development_Environments

I have one for python2, python3, lein / clojure, scala, node and a few others. I just use a default.nix file and then do nix-shell inside the dir. anyways if you have any resources I could use to learn the nix build scripts the way you do that would be awesome. I would love to be able to make build scripts and contribute to nix's packages.

@b123400

This comment has been minimized.

Copy link

b123400 commented Oct 28, 2016

I mainly followed the Nix manual to learn the syntax / language and how to build a simple package, but that is too simple for any deployment. The most useful "tutorial" I have is actually searching on Github and see how others did it, this github repo taught me how to setup a ghost blog with npm dependencies properly setup, and here's my configuration if you are interested :)

For writing build script, there are some utility functions in nixpkgs that handle common scenario pretty well, and code sample can be easily found on Github with search query like this~ https://github.com/search?q=buildStackProject+language%3Anix&type=Code

I also find this blog post useful for understanding how configuration on NixOS works.


I am not sure if I am looking for development environment. In nix-shell, you can read/write files to wherever you want, for example stack build can download and cache codes somewhere, the files will be available next time. However in a build environment, the derivation is not allowed to read/write files to a path outside the build or output folder. I am not sure how is it enforced, but I once tried to write a file to /root/foo for debug purpose, it stops me with an error like `impure path detected". Without caching means really slow deployment, development is fine though.

@aljones15

This comment has been minimized.

Copy link

aljones15 commented Oct 28, 2016

thanks for the help and good luck. yeah I haven't had any issues with writing. I will look into the links provided! Thanks. Andrew

@scherrey

This comment has been minimized.

Copy link

scherrey commented Oct 28, 2016

Is there a Nix based distro that does not use systemd? If so I would very much like to give it a shot. I know you can put Nix anywhere but I'd really like to find a distro where it is core and not bolted on but also does not use systemd.

thanx,

-- Ben

@aljones15

This comment has been minimized.

Copy link

aljones15 commented Oct 28, 2016

scherry try asking in nix chat. you want it to use openrc then?

https://nixos.org/nixos/support.html

@scherrey

This comment has been minimized.

Copy link

scherrey commented Oct 28, 2016

Yeah I just asked in irc. I don't care what the alternative init system is so long as it is not systemd. Right now I run funtoo because it has a configuration that completely eliminates systemd. I don't recommend it for the faint of heart however. Keeping the system stable through source upgrades is quite painful. Nix would certainly help address that.

@jean

This comment has been minimized.

Copy link

jean commented Oct 28, 2016

I think Asko Soukka's posts on Nix are very interesting:
http://datakurre.pandala.org/search/label/nix
See e.g. http://datakurre.pandala.org/2015/07 announcing
https://github.com/datakurre/collective.recipe.nix for deriving Nix
packages from Python egg definitions.

jean . .. .... //\oo///\

@jean

This comment has been minimized.

Copy link

jean commented Oct 28, 2016

Guix uses "GNU Shepherd"

It isn't based on Nix, it's a parallel implementation of the same concepts,
using Guile.

On Fri, Oct 28, 2016 at 3:32 PM, Ben Scherrey notifications@github.com
wrote:

Is there a Nix based distro that does not use systemd? If so I would very
much like to give it a shot. I know you can put Nix anywhere but I'd really
like to find a distro where it is core and not bolted on but also does not
use systemd.

thanx,

-- Ben


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#155 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFLQN3I_0Z4dVBp1MmT7IChyJt-36ngks5q4bMlgaJpZM4KiU9e
.

jean . .. .... //\oo///\

@djay djay closed this Nov 24, 2016

@djay djay removed the orange label Nov 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment