Re: [Nix-dev] Remapping Console Key Bindings
FWIW I convert Caps Lock to Hyper key which I use as my XMonad mod-key. You can see my config here: https://github.com/listx/syscfg/blob/master/nixos/base.nix#L44 On Thu, Jan 5, 2017 at 10:52 AM stewart mackenzie wrote: > services.xserver.xkbOptions = "grp:alt_space_toggle, ctrl:swapcaps"; > ___ > nix-dev mailing list > nix-dev@lists.science.uu.nl > http://lists.science.uu.nl/mailman/listinfo/nix-dev > ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] X server & Emacs crashes in 16.09
On Thu, Nov 10, 2016 at 07:26:18PM +0100, Milan Zamazal wrote: > Since I upgraded to 16.09, I've been experiencing quite frequent > (several times per week) segmentation faults of X server or Emacs on my > computer. That has never happened before the upgrade and AFAICT no > other application suffers from that problem. > > Is this a known problem? Not that I am aware. FWIW I've been on 16.09 (have been on the 16.09 channel within a week of it going live) and have not seen any X or Emacs crashes. Still, you are probably on to something. > Any idea what can be wrong? Well, could you provide some details? Going by the template in the Nixpkgs issue tracker (if you click on "New issue"), here's what you can report: * System: (NixOS: `nixos-version`, Ubuntu/Fedora: `lsb_release -a`, ...) * Nix version: (run `nix-env --version`) * Nixpkgs version: (run `nix-instantiate --eval '' -A lib.nixpkgsVersion`) I think it's worth opening a new issue on Nixpkgs instead of continuing this on the list. Best, Linus > > Thanks for any help, > Milan > > ___ > nix-dev mailing list > nix-dev@lists.science.uu.nl > http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Fwd: Re: qutebrowser very unstable
On Thu, Nov 03, 2016 at 09:30:37PM +, Taeer Bar-Yam wrote: > Should we update the qutebrowser package to use the QtWebEngine backend (i.e. > enable the --backend webengine flag)? +1 I have noticed crashes before as well but was too lazy to say anything on the list. > I don't feel like I have the authority to make this decision; do other people > who use qutebrowser want to weigh in? What's the etiquite here? I think just opening a ticket (or pull request) on the Nixpkgs github repo is the standard way of doing things. E.g., here's an example of an open ticket related to qutebrowser: https://github.com/NixOS/nixpkgs/issues/2 Linus > Forwarding Florian Bruhin's message of November 3, 2016 5:18 pm: > ... > The new QtWebEngine backend is pretty usable already when you install > qutebrowser from git and launch with --backend webengine. There are > only some smaller features missing, support for the last big missing > feature (downloads) will land somewhen next week probably. > ... > Florian > ___ > nix-dev mailing list > nix-dev@lists.science.uu.nl > http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] How to use MySQL
Hello Tomasz, On Mon, Oct 03, 2016 at 09:33:24AM +0100, Tomasz Czyż wrote: > By looking at errors you pasted I assume you are not using proper > configuration or default configuration is used when you don't provide any. > And by default probably paths are set to /var/lib which is writeable only > by root or system services. > > To run mysql in userspace you need to adjust all those paths in your > configuration to point to directories accessible/writeable by user. > > I'm not sure if this actually worth the effort. After browsing the mysql.nix file [1] in depth, I've reached the same conclusion. There's a great deal of customization that happens in there and it was not clear how to modify it to get a minimum working example that plays nicely with `nix-env -iA nixos.mysql55`. I could fork that derivation and apply my own changes and create a modified package, but again that seemed like too much effort. Using GitHub code search I was able to find a sample configuration [2]. For posterity, this is what I added to my configuration.nix: services.mysql = { enable = true; dataDir = "/var/db/mysql"; package = pkgs.mysql; }; The dataDir = "/var/db/mysql"; line was to keep with tradition in other Linux distros that package MySQL. (Funnily enough, the link at [1] suggests the same, but only as a comment. [3]) Lastly the package = pkgs.mysql; line seems mandatory as the manual does not state a default value for it. With this configuration, I am able to run `mysql` and connect to the mysqld server instance (which is running as follows --- `ps aux' output): mysql30247 0.0 0.6 772632 99388 ?Ssl Oct04 0:02 /nix/store/piv5d6085k35h43n5smdv9g7cs1zrh4w-mariadb-10.1.17/bin/mysqld --defaults-extra-file=/nix/store/vlx9v98ll7gx00c2s79maf9axiql6ij7-my.cnf --user=mysql --datadir=/var/db/mysql --basedir=/nix/store/piv5d6085k35h43n5smdv9g7cs1zrh4w-mariadb-10.1.17 --pid-file=/run/mysqld/mysqld.pid > You could try to run mysql using nixos-container, so you run mysql as > "service" but in container and you can start/stop the container whenever > you want (and it's easier to start because you can use system level > "service" inside). I am not familiar with nixos-container --- but I'll keep it in mind for the future. Thanks again for your help! Linus [1]: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/databases/mysql.nix [2]: https://github.com/search?q=%22services.mysql%22+extension%3Anix&ref=searchresults&type=Code&utf8=%E2%9C%93 [3]: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/databases/mysql.nix#L76 > > 2016-10-03 9:30 GMT+01:00 Tomasz Czyż : > > > Linus, > > > > by installing it with nix-env you install only the binary and all > > application execution is in user hands. By using "service" in > > configuration.nix you actually start a daemon (like /etc/init.d/mysql in > > ubuntu for instance). > > > > If you want to start it in user space you have to follow exactly the same > > steps as in other distros when you are not using /etc/init.d/ or upstart or > > whatever system level daemon manager. > > > > If you want to try to reproduce what "service" is doing in your userspace, > > you can check config of service and try to execture those commands in > > userspace: > > > > https://github.com/NixOS/nixpkgs/blob/master/nixos/ > > modules/services/databases/mysql.nix > > > > So you can see, that configuration is generated first and then service is > > started with > > > > serviceConfig.ExecStart = "${mysql}/bin/mysqld > > --defaults-extra-file=${myCnf} ${mysqldOptions}"; > > > > > > 2016-10-03 9:21 GMT+01:00 Linus Arver : > > > >> Hello all, > >> > >> I want to install and use MySQL on NixOS, but am not sure how to > >> proceed. I've managed to do > >> > >> nix-env -iA nixos.mysql55 > >> > >> but trying to get it to run is difficult. Here is what I tried: > >> > >> [月 03 0:50:47] - l_k0 ~/prog/sqfmm/mysql > >> > mysql > >> ERROR 2002 (HY000): Can't connect to local MySQL server through > >> socket '/run/mysqld/mysqld.sock' (2) > >> [月 03 0:50:53] 1 - l_k0 ~/prog/sqfmm/mysql > >> > systemctl start mysqld > >> AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === > >> Authentication is required to start 'mysqld.service'. > >> Multiple identities can be used for authentication: > >> 1. System administrator (root) > >> 2. Linu
[Nix-dev] How to use MySQL
Hello all, I want to install and use MySQL on NixOS, but am not sure how to proceed. I've managed to do nix-env -iA nixos.mysql55 but trying to get it to run is difficult. Here is what I tried: [月 03 0:50:47] - l_k0 ~/prog/sqfmm/mysql > mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) [月 03 0:50:53] 1 - l_k0 ~/prog/sqfmm/mysql > systemctl start mysqld AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === Authentication is required to start 'mysqld.service'. Multiple identities can be used for authentication: 1. System administrator (root) 2. Linus Arver (l) Choose identity to authenticate as (1-2): 2 Password: AUTHENTICATION COMPLETE === Failed to start mysqld.service: Unit mysqld.service not found. [月 03 0:52:33] 5 - l_k0 ~/prog/sqfmm/mysql > systemctl start mysql AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === Authentication is required to start 'mysql.service'. Multiple identities can be used for authentication: 1. System administrator (root) 2. Linus Arver (l) Choose identity to authenticate as (1-2): 2 Password: AUTHENTICATION COMPLETE === Failed to start mysql.service: Unit mysql.service not found. [月 03 0:52:57] 5 - l_k0 ~/prog/sqfmm/mysql > mysqld 161003 0:53:16 [Note] mysqld (mysqld 5.5.50) starting as process 12363 ... 161003 0:53:16 [Warning] Can't create test file /var/lib/mysql/k0.lower-test 161003 0:53:16 [Warning] Can't create test file /var/lib/mysql/k0.lower-test mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2) 161003 0:53:16 [ERROR] Aborting 161003 0:53:16 [Note] mysqld: Shutdown complete [月 03 0:53:16] 1 - l_k0 ~/prog/sqfmm/mysql > mysqld_safe 161003 00:54:16 mysqld_safe Logging to '/var/lib/mysql/k0.err'. touch: cannot touch '/var/lib/mysql/k0.err': No such file or directory chmod: cannot access '/var/lib/mysql/k0.err': No such file or directory mkdir: cannot create directory ‘/run/mysqld’: Permission denied chown: invalid user: ‘mysql’ chmod: cannot access '/run/mysqld': No such file or directory 161003 00:54:16 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql /home/l/.nix-profile/bin/mysqld_safe: line 128: /var/lib/mysql/k0.err: No such file or directory /home/l/.nix-profile/bin/mysqld_safe: line 165: /var/lib/mysql/k0.err: No such file or directory touch: cannot touch '/var/lib/mysql/k0.err': No such file or directory chown: invalid user: ‘mysql’ chmod: cannot access '/var/lib/mysql/k0.err': No such file or directory 161003 00:54:16 mysqld_safe mysqld from pid file /var/lib/mysql/k0.pid ended /home/l/.nix-profile/bin/mysqld_safe: line 128: /var/lib/mysql/k0.err: No such file or directory The attempt to run *mysqld_safe* was taken from the official docs at http://dev.mysql.com/doc/refman/5.6/en/starting-server.html. I see that there are several configuration options for MySQL (services.mysql.*) defined in the NixOS manual (https://nixos.org/nixos/manual/options.html#opt-services.mysql.enable) but this seems to be for enabling it as a service that starts unconditionally on every boot (configuration.nix), which I want to avoid. How do I start MySQL without touching configuration.nix? If configuration.nix is the only sane/preferred way to use MySQL on NixOS, then is there a resource/wiki/blogpost that discusses a minimal example? I don't mind trial-and-error with editing my system configs but seeing a second-hand account of the entire process would be very helpful. Please forgive me if I have missed any obvious documentation. Best, Linus ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-commits] [NixOS/nixpkgs] 511bb2: baekmuk-ttf: switch to base32 encoded src.sha256
Branch: refs/heads/master Home: https://github.com/NixOS/nixpkgs Commit: 511bb286892e800827c4add915bb008bd2a82de3 https://github.com/NixOS/nixpkgs/commit/511bb286892e800827c4add915bb008bd2a82de3 Author: Linus Arver Date: 2016-09-01 (Thu, 01 Sep 2016) Changed paths: M pkgs/data/fonts/baekmuk-ttf/default.nix Log Message: --- baekmuk-ttf: switch to base32 encoded src.sha256 Closes https://github.com/NixOS/nixpkgs/pull/18166 ___ nix-commits mailing list nix-comm...@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-commits
Re: [Nix-dev] Latex package to handle unicode characters?
On Sun, May 29, 2016 at 04:56:12PM -0700, Jeffrey David Johnson wrote: > I get the following error when exporting some markdown to PDF with pandoc: > > An error occured: PDF creation failed: > ! Package inputenc Error: Unicode char \u8: not set up for use with > LaTeX. > > See the inputenc package documentation for explanation. > Type H for immediate help. > ... > > l.150 Evolutionary Analysis} > > Try running pandoc with --latex-engine=xelatex. > > I could hunt this one character down, but is there a package I could add to > my texlive environment that might help handle this type of problem in general? I used to use the texliveFull package, which included xelatex. FWIW, I no longer use texliveFull; instead I use a Docker container for all TeX-related things as it is much simpler to use along with negligible maintenence costs, if at all. > So far I just use the standard one: > > myTexLive = texlive.combine { > inherit (texlive) scheme-small; > }; > > Don't see any mention of xelatex in nixpkgs. That's probably because it still comes with texliveFull, which is what most people use I imagine. > Ideally I'd like to handle all of unicode, but just skipping any unrenderable > characters would be OK too, since I gather latex doesn't do that yet? AFAIK, Latex never dealt with Unicode natively. Xelatex has much simpler font support (fontspec) so I've always opted for Xelatex from the beginning. Best, Linus ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] NixOS won't boot anymore in certain generations, don't know why (Stage-1 error)
Hello Matthias, > When rebooting, I booted into my newest generation, which was 109 by > this time. But I got an error in stage 1, telling me that my root > partition couldn't be mounted as the device did not come up (LUKS > encrypted SSD, root on /dev/sda2). It asked me > > "dm_mod" loaded? FWIW, this is probably relevant: http://lists.science.uu.nl/pipermail/nix-dev/2015-May/017198.html . I was hit with that regression some weeks ago and had to cherry-pick the bugfix commit from Nixpkgs. ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Nix loves Haskell: the video
> Interesting. Shame the recording cut off at the questions. I didn't know > you could nix-env -qaP haskellPackages to display the ng package set: we > just had a person ask about that in #nixos yesterday! Likewise, but for me I had to prefix the argument with "nixpkgs." like this: $ nix-env -qaP -A nixpkgs.haskellPackages . Cheers, Linus ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] per-project nix-shell for Ruby (Gemfile) projects?
On Tue, May 12, 2015 at 11:03:58PM +0200, Rok Garbas wrote: > hi linus, > > you might find a "recent" thread on mailing list interesting. > http://article.gmane.org/gmane.linux.distributions.nixos/15702 Hello Rok! I did read that thread, but I can't really understand how to adapt it for installing a single gem and making it available in the current environment. The example in there is for building the sup mail reader; I followed the instructions and packaged the 'minitest' gem, but even though I install it with nix-env -i minitest and see it in my 'nix-env -q' like this: minitest-5.6.1 the Ruby script I wrote that uses it cannot find it. What I want to do is write a single Ruby file (which defines a Class or Module) that depends on a particular gem. I need, e.g., require 'foo' class Bar ... end to work. How do NixOS users go about this? On Arch Linux, I use Rbenv to download various Ruby versions, and then use 'bundle install' in a project's root folder containing the Gemfile to get all the gems installed for the currently active Ruby version. I realize that I can just do the same thing on Nix, but I get a feeling that the current tooling allows us to use the Nix mechanisms to achieve the same thing (and avoid, e.g., re-downloading Rails or activerecord every single time we start a new Rails project). Cheers, Linus ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] per-project nix-shell for Ruby (Gemfile) projects?
Hello, I am still very new to Nix and NixOS so please bear with me. I followed the instructions in the Nixpkgs manual[1] as well as the original announcement[2] to create a regular Nix package, which I could install by putting minitest = self.callPackage ./ruby/minitest {}; into my ~/.nixpkgs/config.nix. This allows me to install minitest into my current Nix profile. If I have a Ruby project/app that has a single Gemfile, is there a way to create a 'shell.nix' file for it, like the command cabal2nix --shell . > shell.nix for cabalized Haskell projects/apps? Cheers, Linus [1] https://nixos.org/nixpkgs/manual/#ssec-language-ruby [2] http://lists.science.uu.nl/pipermail/nix-dev/2015-January/015780.html ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] NixOS on a machine with only one user
On Fri, Apr 24, 2015 at 04:23:39PM +, Amy de Buitléir wrote: > NixOS noob here. I'm using NixOS on a machine with only one user (me). > What's the best strategy for installing packages? > > Installing into the global system environment > - or - > Installing into a normal user profile > > It seems that the second method would be a bit more convenient, especially > if I add and remove new software frequently. Which I do. Hi Amy, I also use NixOS on machines where I am the sole user. I try out packages in the normal user profile first with `nix-env -i` and then if I end up sticking with it, move it into the global system environment in `/etc/nixos/configuration.nix`. I try to keep my user profile minimal or empty. I am also very new to NixOS, but the above method seems to work well. I keep track of the system configuration with git, so that's a nice added bonus. -L ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] some basic questions from a new NixOS user
Hello Peter, On Thu, Dec 01, 2011 at 08:55:26AM +0100, Peter Simons wrote: > Hi Linus, > > > The "nix-env -qaP \*" command does work, but I am unable to make sense > > of the output. For example, there is this line: > > > > nixpkgs_sys.haskellPackages_ghc704_no_profiling.xmonad > haskell-xmonad-ghc7.0.4-0.10 > > > > I can see that the second column is the package name, but what is the > > first column? How do I use it so I can use the "nix-env -iA" syntax? > > That attribute path is what "nix-env -iA" expects, i.e.: > > nix-env -iA nixpkgs_sys.haskellPackages_ghc704_no_profiling.xmonad > Ah, how silly of me. I tried out the command above and indeed it works fine. > Note that "haskellPackages_ghc704_no_profiling" and "haskellPackages" > are synonymous at the moment. I see. So, for the record, you can do: $ nix-env -iA nixpkgs_sys.haskellPackages_ghc704_no_profiling.xmonad or $ nix-env -iA nixpkgs_sys.haskellPackages.xmonad to install xmonad as a regular user. Cool stuff! > > The nix-env manpage explicitly says "nix-env -qaA '*'" gives the > > attribute paths. Could this be a typo in the manpage? > > Yes, it is. :-) I'll commit a fix. Great. Thanks again, Peter! -Linus ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] some basic questions from a new NixOS user
On Thu, Dec 01, 2011 at 06:33:08AM +0100, Nicolas Pierron wrote: > Hi Linus, > > On Thu, Dec 1, 2011 at 03:37, Linus Arver wrote: > > On Sat, Nov 26, 2011 at 02:42:03PM -0800, Linus Arver wrote: > >> On Fri, Nov 25, 2011 at 12:35:01AM +0100, Nicolas Pierron wrote: > >> > Hi Linus, > >> > > >> > On Thu, Nov 24, 2011 at 22:44, Linus Arver wrote: > >> > > On Thu, Nov 24, 2011 at 07:00:29PM +0100, Nicolas Pierron wrote: > >> > chsh does not work if you reference your user inside NixOS > >> > configuration file, the reason is that each time you boot, NixOS > >> > activation script will update /etc/passwd file with the list of users > >> > and shells. But you can update your shell inside your > >> > configuration.nix file. Have a look at one module of my > >> > configurations: > >> > > >> > https://svn.nixos.org/repos/nix/configurations/trunk/misc/nicolas.b.pierron/common/user.nix > >> > >> Thanks for this. I adapted the > >> > >> users.extraUsers = [ > >> { name = "nicolas"; > >> uid = 1000; > >> group = "users"; > >> extraGroups = [ "wheel" "share" ]; > >> description = "Nicolas Pierron"; > >> home = "/home/nicolas"; > >> shell = pkgs.zsh + "/bin/zsh"; > >> } > >> ]; > >> > >> users.extraGroups = [ > >> { name = "share"; > >> gid = 1001; > >> } > >> ]; > >> > >> environment.systemPackages = [ > >> pkgs.zsh > >> ]; > > > > I just wanted to point out to future zsh users for NixOS that using the > > above setting will work if you are inside an X process, because the bash > > shell that runs the X stuff sources /etc/bashrc, /etc/profile for all > > the right global system PATHs (see > > /etc/nixos/nixos/modules/programs/bash/bash.nix). But if you log in from > > a virtual console tty (e.g., CTRL+ALT+F1), or if you SSH in, your zsh > > won't source the abovementioned files, resulting in an unusable shell. > > What I did on my server was to add the following lines in /etc/zshenv file. > > emulate bash > alias shopt=false > . /etc/profile > unalias shopt > emulate zsh Every day, I learn something new. Thanks. -Linus ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] some basic questions from a new NixOS user
On Sat, Nov 26, 2011 at 02:42:03PM -0800, Linus Arver wrote: > On Fri, Nov 25, 2011 at 12:35:01AM +0100, Nicolas Pierron wrote: > > Hi Linus, > > > > On Thu, Nov 24, 2011 at 22:44, Linus Arver wrote: > > > On Thu, Nov 24, 2011 at 07:00:29PM +0100, Nicolas Pierron wrote: > > chsh does not work if you reference your user inside NixOS > > configuration file, the reason is that each time you boot, NixOS > > activation script will update /etc/passwd file with the list of users > > and shells. But you can update your shell inside your > > configuration.nix file. Have a look at one module of my > > configurations: > > > > https://svn.nixos.org/repos/nix/configurations/trunk/misc/nicolas.b.pierron/common/user.nix > > Thanks for this. I adapted the > > users.extraUsers = [ > { name = "nicolas"; > uid = 1000; > group = "users"; > extraGroups = [ "wheel" "share" ]; > description = "Nicolas Pierron"; > home = "/home/nicolas"; > shell = pkgs.zsh + "/bin/zsh"; > } > ]; > > users.extraGroups = [ > { name = "share"; > gid = 1001; > } > ]; > > environment.systemPackages = [ > pkgs.zsh > ]; I just wanted to point out to future zsh users for NixOS that using the above setting will work if you are inside an X process, because the bash shell that runs the X stuff sources /etc/bashrc, /etc/profile for all the right global system PATHs (see /etc/nixos/nixos/modules/programs/bash/bash.nix). But if you log in from a virtual console tty (e.g., CTRL+ALT+F1), or if you SSH in, your zsh won't source the abovementioned files, resulting in an unusable shell. To get around this, you can instead just use "/bin/sh" as your shell, then create a "~/.profile" file to launch zsh as a login shell with the following line: exec /var/run/current-system/sw/bin/zsh -l inside. This way, bash will first properly read /etc/bashrc, etc. when you log in, since "/bin/sh" is symlinked to bash (bash sources /etc/bashrc by design) and the PATHs won't be broken for your zsh session. I'm not sure if my understanding is correct, but hey, at least it worked for me! -Linus ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] some basic questions from a new NixOS user
On Wed, Nov 30, 2011 at 05:45:37PM +0100, Peter Simons wrote: > Hi Linus, > > > I see that you're on NixOS as well. You might remember me from the > > Arch-Haskell list some time ago... > > ah, of course! Now that you've mentioned it, I recognize your name. :-) > After supporting Haskell on ArchLinux for a while, I found that most of > the tasks I had to do (i.e. figure out which packages need to be rebuilt > after an update, etc.) come for free with Nix, so I switched to NixOS a > while ago. I see... my reason for trying out NixOS is simple: it is the only OS that I know of which uses a functional package manager. It's like the epiphany I had when I started programming in Haskell... suddenly, all imperative paradigms looked really, really dangerous and ugly to me. Maybe one day, the concept of functional package managers will spread to other OSes. I mean, with nix-collect-garbage, I can't see any downsides to using NixOS. The way I see it, Nix is to packages as git/hg/svn is to source code because it introduces "commits" (generations) and "branches" (profiles) to package managers! It's the way of the future! > > $ nix-env -i haskell-ghc7.0.4 > > You probably want to install "ghc-7.0.4-wrapper" into your profile > instead of "ghc-7.0.4". The wrapper ensures that the real compiler is > called with all those extra paths on the command-line that are required > to make GHC see the library packages installed in the profile. > > NixOS has those wrappers for many packages (like gcc, python, and so on) > for precisely that purpose. It's a bit of inconvenience at first, but in > the long run the benefits outweigh the extra effort. Ah, that makes sense. Unfortunately (or fortunately?), there is no need for me to install xmonad with nix-env: I actually ended up just doing everything in configuration.nix, by adopting the configuration Shea Levy posted in this thread (thanks, Shea!!), which installed ghc/xmonad/xmonad-contrib correctly (all modules are recognized by ghci!). > > Strangely, I can't use this convenient syntax, because nix throws an > > error: > > > > $ nix-env -iA haskellPackages.{xmonad,ghc} > > error: attribute `haskellPackages' in selection path `haskellPackages' > not found > > > > I've already done a nixos-checkout, so, I don't understand why my > > freshly-installed NixOS is coughing up this error... > > The exact attribute path that you have to use depends on the way your > system is installed. "nix-env -qaP \*" should print the proper paths for > your system. The "nix-env -qaP \*" command does work, but I am unable to make sense of the output. For example, there is this line: nixpkgs_sys.haskellPackages_ghc704_no_profiling.xmonad haskell-xmonad-ghc7.0.4-0.10 I can see that the second column is the package name, but what is the first column? How do I use it so I can use the "nix-env -iA" syntax? > > $ nix-env -qaA '*' > > warning: you probably meant to specify the argument '*' to show all > packages > > error: attribute `*' in selection path `*' not found > > I guess that you meant to use the "P" option instead of "A"? No, because the nix-env manpage explicitly says "nix-env -qaA '*'" gives the attribute paths. Could this be a typo in the manpage? Anyway, thanks to everyone's help, I've got a running system with Xmonad + urxvt + zsh. So things are looking 99% identical to my 2+ year Arch Linux setups on my other machines... :) -Linus ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] some basic questions from a new NixOS user
Hello Shea, On Tue, Nov 29, 2011 at 12:46:16PM -0500, Shea Levy wrote: > Hi all, > > I'm coming to this thread late and haven't read it all, but in case it's > useful I have working nixos configurations that use xmonad available > online. I don't use nix-env to install anything on my nixos systems, > just nixos-rebuild for it all. > > See > https://github.com/shlevy/dotfiles/blob/master/nixos/common-configuration.nix > for the nixos configuration. If I remember correctly, the relevant parts > are the bottom half of environment.x11Packages and the services.xserver > stuff. > > See https://github.com/shlevy/dotfiles/tree/master/xmonad for the xmonad > configuration files I use. I symlink the relevant ones to my home directory. > > Cheers, > Shea Thank you for the links! I am in the process of incorporating your configuration style (using just nixos-rebuild for everything)... I will report back after the big rebuild finishes. -Linus ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] some basic questions from a new NixOS user
Hi Peter! I see that you're on NixOS as well. You might remember me from the Arch-Haskell list some time ago... On Tue, Nov 29, 2011 at 06:02:33PM +0100, Peter Simons wrote: > Hi Linus, > > > But I must ask, how did you install xmonad? I tried "nix-env -i > > xmonad" but it did not work [...] > > Haskell packages that contain library code generally depend on the > version of the compiler they've been built with. Almost all Haskell > packages have the appropriate compiler version baked into their package > name. Consequently, there are many different versions of XMonad: > > $ nix-env -qaP \* | grep xmonad-ghc > haskellPackages_ghc6104.xmonad > haskell-xmonad-ghc6.10.4-0.10 > haskellPackages_ghc6123.xmonad > haskell-xmonad-ghc6.12.3-0.10 > haskellPackages_ghc704_no_profiling.xmonad > haskell-xmonad-ghc7.0.4-0.10 > haskellPackages_ghc704_profiling.xmonad > haskell-xmonad-ghc7.0.4-0.10-profiling > haskellPackages_ghc721.xmonad > haskell-xmonad-ghc7.2.1-0.10 > haskellPackages_ghc722.xmonad > haskell-xmonad-ghc7.2.2-0.10 > > Which version is preferable to you depends on the compiler that you > prefer. At the moment, I would recommend to stick to GHC 7.0.4. Yes, I got this impression from seeing all the different xmonad/ghc packages with the different versions. I did $ nix-env -qa \* > pkgs and kept that file around as a sort of primitive reference for all the available packages, and that's how I learned about all the different versions. I did something like $ nix-env -i haskell-xmonad-ghc7.0.4 $ nix-env -i haskell-ghc7.0.4 to get my Haskell packages installd. > > Strangely, it appears that the haskell packages cannot see each other > > properly, because I cannot use any of the xmonad-contrib modules in > > my xmonad.hs, even though I've installed xmonad-contrib. I can fire > > up ghci, but I can't even load up the "XMonad" Haskell module, > > either. Strange... > > I cannot reproduce that problem: > > $ nix-env -iA haskellPackages.{xmonad,ghc} > installing `haskell-xmonad-ghc7.0.4-0.10' > installing `ghc-7.0.4-wrapper' > building path(s) > `/nix/store/6k520bqkbmcbqgl1s1371jr7zj2774b9-user-environment' > created 7452 symlinks in user environment > $ ghci > GHCi, version 7.0.4: http://www.haskell.org/ghc/ :? for help > Loading package ghc-prim ... linking ... done. > Loading package integer-gmp ... linking ... done. > Loading package base ... linking ... done. > Loading package ffi-1.0 ... linking ... done. > Prelude> :m XMonad > Prelude XMonad> :browse > (-->) :: (Monad m, Data.Monoid.Monoid a) => m Bool -> m a -> m a > class Num a => Data.Bits.Bits a where > [...] If I had known about the simple "haskellPackages.foo" syntax I would have used it with my nix-env invocations! Another thing to add to the wiki... Strangely, I can't use this convenient syntax, because nix throws an error: $ nix-env -iA haskellPackages.{xmonad,ghc} error: attribute `haskellPackages' in selection path `haskellPackages' not found I've already done a nixos-checkout, so, I don't understand why my freshly-installed NixOS is coughing up this error... > Generally speaking, GHC can see all Haskell packages that have been > installed into the same profile as the compiler itself. Evidently, my newbie, trial-and-error attempt to install xmonad/ghc with nix-env has already broken my Haskell-package setup... I just read the manual for nix-env to find out more about the -A flag, and found this sentence: "To find out the attribute paths of available packages, use nix-env -qaA '*'." Unfortunately, this does not work for me: $ nix-env -qaA '*' warning: you probably meant to specify the argument '*' to show all packages error: attribute `*' in selection path `*' not found It appears that something has gone horribly wrong... -Linus P.S. I apologize in advance for any typos in the error messages/console output --- the problematic NixOS install on my spare laptop is not in a workable state so I'm just copying everything by hand into another laptop to send these emails. ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] some basic questions from a new NixOS user
On Sat, Nov 26, 2011 at 09:20:34PM -0700, Kevin Quick wrote: > On Sat, 26 Nov 2011 15:42:03 -0700, Linus Arver > wrote: > > >this in my configuration.nix: > > services.xserver = { > >enable = true; > >layout = "us"; > > # Automatic login as regular user (no need to put up with entering > ># password) > >displayManager = { > >auto = { > >enable = true; > >user = "l"; # login as "l" > >}; > >}; > > # Enable XMonad > >windowManager = { > >xmonad.enable = true; > >}; > >}; > > I have: > > services.xserver = { > enable = true; > ... > windowManager.xmonad.enable = true; > windowManager.default = "xmonad"; > ... > }; > > This seems to work fine. Thanks! I added windowManager.default = "xmonad"; into my configuration and now xmonad finally starts up automatically on boot! > Although xmonad restarts itself out of > your .xmonad directory, the main version is available: > > $ which xmonad > /home/kquick/.nix-profile/bin/xmonad > $ ls -lh `which xmonad` > lrwxrwxrwx 1 root nixbld 67 Nov 2 12:59 > /home/kquick/.nix-profile/bin/xmonad -> > /nix/store/f6zlgcyhy76k2kal3v47vmj5bsvpm3px-xmonad-0.9.2/bin/xmonad > $ So, I stated in my previous email that I thought the xmonad-related things in configuration.nix were essentially broken. I've since installed xmonad with nix-env, and now xmonad is in my path. But I must ask, how did you install xmonad? I tried "nix-env -i xmonad" but it did not work, so I looked into all the available packages and found "haskell-xmonad-ghc7.0.4" which is what I ended up installing. Strangely, it appears that the haskell packages cannot see each other properly, because I cannot use any of the xmonad-contrib modules in my xmonad.hs, even though I've installed xmonad-contrib. I can fire up ghci, but I can't even load up the "XMonad" Haskell module, either. Strange... I guess this is the price you have to pay to run an exotic setup on an alpha-stage OS... > >I did a "nixos-rebuild switch", but xmonad does not get started. > > In my experience there are some elements that cannot "switch" and a > reboot is required; I don't recall if xmonad was one of these, but > it may be if X is not restarted by the switch. First, let me clarify my poor choice of words --- what I really meant was: "I did a 'nix-rebuild switch', but xmonad does not get started after I reboot into the new configuration." But yes, your point still stands --- X and xmonad do not get restarted immediately after "nixos-rebuild switch." I did read somewhere in the manual that not all processes get restarted (or that NixOS *tries* to restart all services if it can), so this quirk won't confuse newbies, I think. -Linus ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] some basic questions from a new NixOS user
On Fri, Nov 25, 2011 at 12:35:01AM +0100, Nicolas Pierron wrote: > Hi Linus, > > On Thu, Nov 24, 2011 at 22:44, Linus Arver wrote: > > On Thu, Nov 24, 2011 at 07:00:29PM +0100, Nicolas Pierron wrote: > >> Hi Linus, > >> > >> On Thu, Nov 24, 2011 at 07:24, Linus Arver wrote: > >> > I'm new to this list. > >> > >> Great. > >> > >> > 1a. I've added a new user account with "useradd," per the manual, and > >> > have done a couple installations of software with `nix-env -i'. This is > >> > great, but I'm curious --- what is the preferred way to install > >> > software? The wiki page at http://nixos.org/wiki/Install/remove_software > >> > says that there are two ways to install software --- system-wide (by > >> > editing environment.systemPackages), and per-user (by just doing nix-env > >> > -i [package]). My understanding is that in order to get the advertised > >> > advantages of NixOS's rollback functionality, you have to do system-wide > >> > installs because the whole "nixos-rebuild" command only looks at > >> > /etc/nixos/configuration.nix. I.e., there is no way to rollback the > >> > system on a per-user basis. So, do most people on here have a very long > >> > environment.systemPackages definition in their configuration.nix, > >> > defining all system-wide packages? > >> > >> Using either per-user install or system-wide install depends on what > >> you want to do. Personally I use both. > >> > >> NixOS is build on top of Nix and relies on the nix-env command to > >> update the system profile and also to do rollbacks (have a look at the > >> end of nix-env man page). One advantage of per-user profiles is that > >> the root account does not see (in its default PATH) the user installed > >> software and also the opposite. This difference is not a big security > >> protection but it helps to separate the administrative tools from the > >> commonly used tools. > >> > >> On my case, I am using user profiles to install software that I don't > >> want to see under the root user (inkscape, gimp, firefox, …) and I am > >> also using user-profiles (not the default ~/.nix-profile) to test > >> compilation with different tool-chains (x64-gcc45, x86-gcc46, …), in > >> which case I reset the environment and rebuild it from scratch with > >> only this user profile. > >> > > > > Thanks, this cleared up a lot of things. I just learned from reading the > > Nix manual that you can create new profiles by just doing > > > > nix-env --switch-profile /nix/var/nix/profiles/foo > > > > and it will create "foo" if it doesn't exist already. I'm having trouble > > understanding the hierarchy of folders/files in the profiles folder, > > though. For my system, there appear to be 3 distinct profiles > > > > 1. /nix/var/nix/profiles/default (3 generations) > > 2. /nix/var/nix/profiles/system (7 generations) > > 3. /nix/var/nix/profiles/per-user/l/profile (11 generations) > > 4. /nix/var/nix/profiles/per-user/root (no files) > > > > I can tell that #3 is what I'm currently using (if I do "nix-env > > --list-generations" I get 11 generatios). If I do a "su" to change into > > root and then do "nix-env --list-generations" I get 3 generations, so > > that would correspond to #1. So my question is --- why does #4 exist? Is > > it to house new, custom-created profiles for the root user? Perhaps > > these different profiles should be documented in the Nix manual... > > And easier way to find your current profile is to use > > $ ls -l ~/.nix-profile I eventually learned that I could do nix-env -p /nix/var/nix/profiles/xyz --list-generations to get the information I wanted (although the above command is just a wrapper for inspecting the /nix/var/nix/profiles directory, it's still nice to know!). The man page for nix-env should tell users to provide the full path to the profile for the "-p" flag (otherwise, it just silently fails without any message). > >> > 1b. If I wanted zsh, git, and rxvt-unicode to be available system-wide, > >> > can I do: > >> > > >> > environment.systemPackages = [ > >> > pkgs.zsh > >> > pkgs.git > >> > pkgs.rxvt-unicode > >> > ]; > >> > > >> > in my configuration.nix? There does not seem
Re: [Nix-dev] some basic questions from a new NixOS user
On Thu, Nov 24, 2011 at 07:00:29PM +0100, Nicolas Pierron wrote: > Hi Linus, > > On Thu, Nov 24, 2011 at 07:24, Linus Arver wrote: > > I'm new to this list. > > Great. > > > 1a. I've added a new user account with "useradd," per the manual, and > > have done a couple installations of software with `nix-env -i'. This is > > great, but I'm curious --- what is the preferred way to install > > software? The wiki page at http://nixos.org/wiki/Install/remove_software > > says that there are two ways to install software --- system-wide (by > > editing environment.systemPackages), and per-user (by just doing nix-env > > -i [package]). My understanding is that in order to get the advertised > > advantages of NixOS's rollback functionality, you have to do system-wide > > installs because the whole "nixos-rebuild" command only looks at > > /etc/nixos/configuration.nix. I.e., there is no way to rollback the > > system on a per-user basis. So, do most people on here have a very long > > environment.systemPackages definition in their configuration.nix, > > defining all system-wide packages? > > Using either per-user install or system-wide install depends on what > you want to do. Personally I use both. > > NixOS is build on top of Nix and relies on the nix-env command to > update the system profile and also to do rollbacks (have a look at the > end of nix-env man page). One advantage of per-user profiles is that > the root account does not see (in its default PATH) the user installed > software and also the opposite. This difference is not a big security > protection but it helps to separate the administrative tools from the > commonly used tools. > > On my case, I am using user profiles to install software that I don't > want to see under the root user (inkscape, gimp, firefox, …) and I am > also using user-profiles (not the default ~/.nix-profile) to test > compilation with different tool-chains (x64-gcc45, x86-gcc46, …), in > which case I reset the environment and rebuild it from scratch with > only this user profile. > Thanks, this cleared up a lot of things. I just learned from reading the Nix manual that you can create new profiles by just doing nix-env --switch-profile /nix/var/nix/profiles/foo and it will create "foo" if it doesn't exist already. I'm having trouble understanding the hierarchy of folders/files in the profiles folder, though. For my system, there appear to be 3 distinct profiles 1. /nix/var/nix/profiles/default (3 generations) 2. /nix/var/nix/profiles/system (7 generations) 3. /nix/var/nix/profiles/per-user/l/profile (11 generations) 4. /nix/var/nix/profiles/per-user/root (no files) I can tell that #3 is what I'm currently using (if I do "nix-env --list-generations" I get 11 generatios). If I do a "su" to change into root and then do "nix-env --list-generations" I get 3 generations, so that would correspond to #1. So my question is --- why does #4 exist? Is it to house new, custom-created profiles for the root user? Perhaps these different profiles should be documented in the Nix manual... > > 1b. If I wanted zsh, git, and rxvt-unicode to be available system-wide, > > can I do: > > > > environment.systemPackages = [ > > pkgs.zsh > > pkgs.git > > pkgs.rxvt-unicode > > ]; > > > > in my configuration.nix? There does not seem to be any documentation > > regarding the syntax for this. > > Sure, you can do it, except that the papckages names are extracted > from /etc/nixos/nixpkgs/pkgs/top-level/all-packages.nix . Thus you > should not use the package name, but the key listed in this file. So > you will need to replace > > >pkgs.rxvt-unicode > > bypkgs.rxvt_unicode > Thanks, that makes sense --- I was getting errors with the former form. Is the path "/etc/nixos/nixpkgs/pkgs/top-level/all-packages.nix" documented somewhere so I can learn more about it? > > 2. If I do "nix-env -i" as the root user, then the installation is only > > for the root user, correct? > > I am no longer sure since I haven't reinstalled NixOS since a while, > but I think you have a default profile which is used by all users > including root. So you may want to switch to another profile such as > $NIX_USER_PROFILE_DIR . I don't understand --- I thought switching profiles is done with the "nix-env --switch-profile" command? My original question was formulated when I did not have a good idea about profiles --- and maybe it doesn't make much sense in light of my discoveries above regarding /nix/var/nix/profiles. > Do
Re: [Nix-dev] some basic questions from a new NixOS user
On Thu, Nov 24, 2011 at 08:21:25AM +0100, Marc Weber wrote: > You're welcome. > > > 1a. I've added a new user account with "useradd," per the manual, and > > 3 ways: > 1) /var/run/current-system/sw/bin/ like installation by configuration.nix > 2) system wide root installation ? (not sure about it) > 3) user installation. > > All can be rolled back. nix-env --list-generations etc (see man or do > --help). Ah, I did not know about "nix-env --list-generations". This is great! I'll add a wiki entry about this. > > > environment.systemPackages = [ > > pkgs.zsh > > pkgs.git > > pkgs.rxvt-unicode > > ]; > Looks fine to me. > Thanks. -Linus ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] some basic questions from a new NixOS user
Hello all, I'm new to this list. I just installed NixOS on a spare laptop of mine (with the minimum CD) by following the manual at http://hydra.nixos.org/build/1568621/download/1/nixos/manual.html. The system boots into the slim login manager at startup, since I enabled the services.xserver portion in /etc/nixos/configuration.nix. Anyway, here are some questions. 1a. I've added a new user account with "useradd," per the manual, and have done a couple installations of software with `nix-env -i'. This is great, but I'm curious --- what is the preferred way to install software? The wiki page at http://nixos.org/wiki/Install/remove_software says that there are two ways to install software --- system-wide (by editing environment.systemPackages), and per-user (by just doing nix-env -i [package]). My understanding is that in order to get the advertised advantages of NixOS's rollback functionality, you have to do system-wide installs because the whole "nixos-rebuild" command only looks at /etc/nixos/configuration.nix. I.e., there is no way to rollback the system on a per-user basis. So, do most people on here have a very long environment.systemPackages definition in their configuration.nix, defining all system-wide packages? 1b. If I wanted zsh, git, and rxvt-unicode to be available system-wide, can I do: environment.systemPackages = [ pkgs.zsh pkgs.git pkgs.rxvt-unicode ]; in my configuration.nix? There does not seem to be any documentation regarding the syntax for this. 2. If I do "nix-env -i" as the root user, then the installation is only for the root user, correct? -Linus ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev