Re: [Nix-dev] 5 somewhat related questions

2017-06-26 Thread Roger Qiu
Oh I wrote a blog post before on the usage of nix env and nix path and
using a custom nixpkgs clone for reproducible nix env and
configuration.nix. You may find it useful:
http://matrix.ai/2017/03/13/intro-to-nix-channels-and-reproducible-nixos-environment/

On 26 Jun 2017 5:59 PM, "Klaas van Schelven"  wrote:

> Linux & Matt: thanks for these further insights. This has all been very
> useful!
>
> On Sun, Jun 25, 2017 at 8:01 AM, Linus  wrote:
>
>> On 24 June 2017 20:07:27 BST, Matt McHenry 
>> wrote:
>> >The only major downside of this approach is that I have to always
>> >remember to give '-I nixpkgs=...' arguments to all the usual nix
>> >commands.  But that's become pretty second nature to me by now.  :)
>>
>> You could also set NIX_PATH in one of various locations to avoid having
>> to specify it on every invocation.
>> ___
>> nix-dev mailing list
>> nix-dev@lists.science.uu.nl
>> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>>
>
>
>
> --
> Klaas van Schelven
> +31 6 811 599 10
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] conflicting packages / priority values

2017-06-17 Thread Roger Qiu
Yes something like that but without too much fanfare. A standard nix
function encapsulating this aliasing logic and expose it to user space with
nix-env too.

On 17 Jun 2017 16:25, "James Cook" <james.c...@utoronto.ca> wrote:

> Roger, I'm not sure what you're suggesting. Do you mean that the user's
> configuration would explicitly say "include pkgs.someAlternateGitVersion in
> my profile, but rename /bin/git to /bin/gitB"?
>
> As a starting point, I guess you could do that manually by making a new
> expression with a build script like cp -r "$git" "$out"; mv "$out/bin/git"
> "$out/bin/gitB".
>
> On 17 June 2017 at 03:14, Roger Qiu <roger@matrix.ai> wrote:
>
>> I wonder in other programming languages, name clashes are usually
>> resolved through aliasing. Would it be possible for nix to install packages
>> while aliasing their outputs to a different name to avoid clashes like this?
>>
>> On 17 Jun 2017 09:07, "Roni Choudhury" <aicho...@gmail.com> wrote:
>>
>>> From time to time I see an error message like this:
>>>
>>> collision between 
>>> ‘/nix/store/qs8fq5ld2shc0i3fvbs6n0g0k8fypndm-git-2.13.0/bin/git’ and 
>>> ‘/nix/store/64fjdb4whkf2r5x8xyqf9kkljnk6w59b-git-2.13.0/bin/git’; use 
>>> ‘nix-env --set-flag priority NUMBER PKGNAME’ to change the priority of one 
>>> of the conflicting packages
>>>
>>> I understand what causes it (two packages competing to place the same,
>>> e.g., binaries in my profile), but I’ve never understood how to resolve it.
>>> Usually I just guess priority numbers until it works; more lately I’ve
>>> simply removed the offending package from my environment before repeating
>>> the failing install command. Obviously, neither approach is healthy or
>>> correct :)
>>>
>>> The man page for nix-env contains the following:
>>>
>>> If there are multiple derivations matching a name in args that have the
>>> same name (e.g., gcc-3.3.6 and gcc-4.1.1), then the derivation with the
>>> highest priority is used. A derivation can define a priority by declaring
>>> the meta.priority attribute. This attribute should be a number, with a
>>> higher value denoting a lower priority. The default priority is 0.
>>>
>>> But I’m still not sure what this means for my error situation. How do I
>>> know what the priorities are for the different packages? The default value
>>> is 0, which is the highest priority; what does that mean exactly, for the
>>> default priority to be the highest priority?
>>>
>>> Is there a more intuitive way to resolve this sort of conflict? For
>>> instance, is there a way to tell nix-env to force the issue by treating
>>> the requested package as higher priority than any existing ones?
>>>
>>> Thanks!
>>>
>>> roni
>>> ​
>>>
>>> ___
>>> nix-dev mailing list
>>> nix-dev@lists.science.uu.nl
>>> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>>>
>>>
>> ___
>> nix-dev mailing list
>> nix-dev@lists.science.uu.nl
>> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>>
>>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] conflicting packages / priority values

2017-06-16 Thread Roger Qiu
I wonder in other programming languages, name clashes are usually resolved
through aliasing. Would it be possible for nix to install packages while
aliasing their outputs to a different name to avoid clashes like this?

On 17 Jun 2017 09:07, "Roni Choudhury"  wrote:

> From time to time I see an error message like this:
>
> collision between 
> ‘/nix/store/qs8fq5ld2shc0i3fvbs6n0g0k8fypndm-git-2.13.0/bin/git’ and 
> ‘/nix/store/64fjdb4whkf2r5x8xyqf9kkljnk6w59b-git-2.13.0/bin/git’; use 
> ‘nix-env --set-flag priority NUMBER PKGNAME’ to change the priority of one of 
> the conflicting packages
>
> I understand what causes it (two packages competing to place the same,
> e.g., binaries in my profile), but I’ve never understood how to resolve it.
> Usually I just guess priority numbers until it works; more lately I’ve
> simply removed the offending package from my environment before repeating
> the failing install command. Obviously, neither approach is healthy or
> correct :)
>
> The man page for nix-env contains the following:
>
> If there are multiple derivations matching a name in args that have the
> same name (e.g., gcc-3.3.6 and gcc-4.1.1), then the derivation with the
> highest priority is used. A derivation can define a priority by declaring
> the meta.priority attribute. This attribute should be a number, with a
> higher value denoting a lower priority. The default priority is 0.
>
> But I’m still not sure what this means for my error situation. How do I
> know what the priorities are for the different packages? The default value
> is 0, which is the highest priority; what does that mean exactly, for the
> default priority to be the highest priority?
>
> Is there a more intuitive way to resolve this sort of conflict? For
> instance, is there a way to tell nix-env to force the issue by treating
> the requested package as higher priority than any existing ones?
>
> Thanks!
>
> roni
> ​
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-commits] [NixOS/nixpkgs] 1b6176: gnupg module: Added extra and browser sockets (#26...

2017-06-15 Thread Roger Qiu
  Branch: refs/heads/master
  Home:   https://github.com/NixOS/nixpkgs
  Commit: 1b6176e45b05cbb89cac49359ba15a15c9187f68
  
https://github.com/NixOS/nixpkgs/commit/1b6176e45b05cbb89cac49359ba15a15c9187f68
  Author: Roger Qiu <roger@polyhack.io>
  Date:   2017-06-15 (Thu, 15 Jun 2017)

  Changed paths:
M nixos/modules/programs/gnupg.nix

  Log Message:
  ---
  gnupg module: Added extra and browser sockets (#26295)

Also added dirmngr and made SSH support false by default
due to programs.ssh.startAgent defaulting to true.


___
nix-commits mailing list
nix-comm...@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-commits


Re: [Nix-dev] Polkit action files installed via nix-env don't appear to be recognised by Polkit/Pkexec/Pkaction

2017-05-31 Thread Roger Qiu

Hi Linus,

Good response! This would be a great info in a wiki somewhere.

I have a question:

> To allow nix-env as root to install polkit actions, you could probably
add /nix/var/nix/profiles/default to polkit's search path.

Disregarding it being a bad idea, how is this possible? Are you 
suggesting overriding the derivation during package build of polkit?


Thanks,
Roger

On 31/05/2017 5:35 PM, Linus Heckemann wrote:

On 31/05/17 07:47, Roger Qiu wrote:

Yea that seems right, allowing users to nix-env install things,
everything must be unprivileged, allowing the usage of such polkit files
in nix-env means the users can make use of pkexec to elevate to root
when executing anything.

However in non-package manager use cases, installing such a package with
`make install` would require super user privileges to install the action
policy file into /usr/share/polkit-1/actions. Therefore nix-env could
make use of such a fact, and instead suggest the user to install using
`sudo nix-env` if the package has a polkit policy file. This would
prevent such a security hole, since the user must be root to be able to
install such a package. Such suggestions could be encoded in the nix
expression file.

Which brings up the next question, would installing via `sudo nix-env`
setup the polkit policy files properly such that polkit will know about it?

No. nix-env modifies the default, not the system profile (when running
as root) because modifying the system profile requires activating it.

What you'd want in this case is usually to add the package in question
to environment.systemPackages and use nixos-rebuild switch to switch to
the new generation. This results in the policy files ending up in
/run/current-system/sw/share/polkit-1/actions, providing the
security.polkit.enable option is set to true. That way the configuration
is declarative which is more consistent with "The NixOS way".

To allow nix-env as root to install polkit actions, you could probably
add /nix/var/nix/profiles/default to polkit's search path. This is a bad
idea compared to using the systemwide declarative configuration for
several reasons though:

  - The changes won't be picked up automatically, you would have to
restart polkit.service yourself. When using the system configuration,
this is done by the activation script.

  - The packages won't be updated together with the rest of the system.
This could be a security issue depending on whether you remember to run
nix-env -u as root as frequently as nixos-rebuild.

  - The configuration isn't declarative and there's no single source of
truth for where rules come from! This is the norm on most other
distributions of course, but who really wants a less transparent system?

So overall I recommend adding any packages whose polkit actions you want
available to systemPackages rather than using nix-env to manage them.

Best regards,
Linus
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Polkit action files installed via nix-env don't appear to be recognised by Polkit/Pkexec/Pkaction

2017-05-31 Thread Roger Qiu
Yea that seems right, allowing users to nix-env install things, 
everything must be unprivileged, allowing the usage of such polkit files 
in nix-env means the users can make use of pkexec to elevate to root 
when executing anything.


However in non-package manager use cases, installing such a package with 
`make install` would require super user privileges to install the action 
policy file into /usr/share/polkit-1/actions. Therefore nix-env could 
make use of such a fact, and instead suggest the user to install using 
`sudo nix-env` if the package has a polkit policy file. This would 
prevent such a security hole, since the user must be root to be able to 
install such a package. Such suggestions could be encoded in the nix 
expression file.


Which brings up the next question, would installing via `sudo nix-env` 
setup the polkit policy files properly such that polkit will know about it?


Thanks,
Roger

On 31/05/2017 4:34 PM, Bjørn Forsman wrote:

On 31 May 2017 at 07:44, Roger Qiu <roger@matrix.ai> wrote:

Hi all,

Normally a polkit action file on a non-NixOS system would be installed in
/usr/share/polkit-1/actions. On NixOS this location is instead at
/run/current-system/sw/share/polkit-1/actions. The action files stored here
are recognised by polkit, which can be demonstrated by running `pkaction`,
this results in showing the titles of each action id.

However some packages may supply action files, and are installed via
nix-env. The action files in this case are instead stored in
~/.nix-profile/share/polkit-1/actions. My tests show that these action files
are not being recognised by polkit. Running pkaction does not show any
package the action files that are inside ~/.nix-profile/...

Is there a work around here?

Browsing the polkit docs doesn't mention anything about looking up
user-specific action files, they all just say action files are to be at
/usr/share/polkit-1/actions. If polkit only looks up 1 location, then should
nix-env be symlinking action files into
/run/current/system/sw/share/polkit-1/actions?

Wouldn't that mean unprivileged users are allowed to raise their own
permissions? (That doesn't sound like a good idea.)

Best regards,
Bjørn Forsman


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Polkit action files installed via nix-env don't appear to be recognised by Polkit/Pkexec/Pkaction

2017-05-30 Thread Roger Qiu

Hi all,

Normally a polkit action file on a non-NixOS system would be installed 
in /usr/share/polkit-1/actions. On NixOS this location is instead at 
/run/current-system/sw/share/polkit-1/actions. The action files stored 
here are recognised by polkit, which can be demonstrated by running 
`pkaction`, this results in showing the titles of each action id.


However some packages may supply action files, and are installed via 
nix-env. The action files in this case are instead stored in 
~/.nix-profile/share/polkit-1/actions. My tests show that these action 
files are not being recognised by polkit. Running pkaction does not show 
any package the action files that are inside ~/.nix-profile/...


Is there a work around here?

Browsing the polkit docs doesn't mention anything about looking up 
user-specific action files, they all just say action files are to be at 
/usr/share/polkit-1/actions. If polkit only looks up 1 location, then 
should nix-env be symlinking action files into 
/run/current/system/sw/share/polkit-1/actions?


Thanks,
Roger

--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] The .nixpkgs/config.nix file and user configuration

2017-05-03 Thread Roger Qiu

Here's some links for reference:

* https://github.com/NixOS/nixpkgs/issues/1750

* https://github.com/sheenobu/nix-home

* 
http://sandervanderburg.blogspot.com.au/2013/09/managing-user-environments-with-nix.html


* 
https://www.reddit.com/r/NixOS/comments/5hd8ok/how_to_handle_nixos_and_i3_config_files/


I like to think of a nix-shell as a messy stateful environment to 
install all sorts of things, and a user-profile as a slightly less messy 
stateful environment. It's like the IO monad of Nix. So right now you 
can use config.nix to install and rebuild packages, while using other 
ways to manage config files.


Note that there are many parts of the OS that is still not completely 
declarative and pure-functional even when using configuration.nix. But 
it's better than nothing.


On 3/05/2017 4:29 PM, John Ramsden wrote:
I've been looking for some information about how exactly the 
$HOME/.nixpkgs/config.nix file works. How exactly is it intended to be 
used? Up until now I've been managing my entire system from 
/etc/nixos, but it would be nice to have a place where I can add 
something that happens only to a single user. For example, setting up 
dotfiles, or use our services. Can the config.nix file be used for 
that? Is it effectively a /etc/nixos/configuration.nix that is 
intended to be used for a single user?


I have found little bits of information about it here and there, for 
example in the nix pills. but nothing that really explains what it is 
used for in detail. Could someone point me where I can find this 
information?




--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Xrandrheads PR

2017-04-23 Thread Roger Qiu

Hi all,

I've had this PR open for about 6 months: 
https://github.com/NixOS/nixpkgs/pull/15353 It allows once to specify 
per-monitor configuration using xrandrHeads. Like setting which monitor 
is primary, and changing the layout of monitors.


It should be ready for a merge, and I would prefer it doesn't get 
bitrotted any further.


Thank you,

Roger

--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Managing /home during system activation

2017-04-15 Thread Roger Qiu
Biggest problem is with how secrets are dealt with. Also that you're tieing
your home config with system config, which doesn't work well for a
multi-user system.
On 16/04/2017 3:37 AM, "Peter Jones"  wrote:

> I'd like to manage files in my home directory during system activation.
> Sort of like nix-home[1] but during activation so NixOps can also deploy
> things such as my shell configuration.  I have an idea, and I'm
> wondering how terrible it is.
>
> Based on the way etc activation works, I would build a directory in the
> nix store and fill it with symlinks to other parts of the store:
>
> /nix/store/xxx-home-pjones/.zshrc -> /nix/store/xxx-zshrc/zshrc
>
> Then, set up a UnionFS mount so that /nix/store/xxx-home-pjones gets
> overlaid on top of /home/pjones.  This means I don't have to search
> through /home looking for links to an old generation to deactivate it,
> and rolling back just mounts a previous generation on top of /home.
>
> So, how bad is this idea?
>
> Thanks!
>
>
> [1]: https://github.com/sheenobu/nix-home
>
> --
> Peter Jones, Founder, Devalot.com
> Defending the honor of good code
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] how to 'just run binaries' in nixos

2017-03-21 Thread Roger Qiu
https://nixos.org/patchelf.html
On 22/03/2017 9:42 AM, "Azul"  wrote:

> is there a simple way to just run binaries in nixos ?
>
> stuff like go binaries or other bits and bobs ?
>
>
> ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked,
> interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.26
>
> ./my-binary
> bash: ./my-binary: No such file or directory
>
>
> ___
> 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 'just run binaries' in nixos

2017-03-21 Thread Roger Qiu
Replace the interpreter path. But there might be dependencies (try ldd)
that it relies on that you also need to substitute.
On 22/03/2017 9:42 AM, "Azul"  wrote:

> is there a simple way to just run binaries in nixos ?
>
> stuff like go binaries or other bits and bobs ?
>
>
> ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked,
> interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.26
>
> ./my-binary
> bash: ./my-binary: No such file or directory
>
>
> ___
> 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] Why having releases if you break things in it often

2017-02-10 Thread Roger Qiu
Hey, I'd suggest for you to not use channels. I don't. Pin your nixpkgs to
a commit hash. And upgrade when you want to/need to. This should be the
recommended way IMHO.
On 11/02/2017 10:07 AM, "Stefan Huchler"  wrote:

> Hello,
>
> I start to get frustrated again, the documentation of nixos is not very
> good if you do more than just the most basic stuff.
>
> So you kind of are if you are not a full-time nixos developer dependend
> of help from the developers.
>
> So I wrote here about the bug, then I startet a bugreport:
>
> https://github.com/NixOS/nixpkgs/issues/22246
>
> Nothing happens at all. Well nobody else does anything about lets try to
> find a workaround.
>
> I dont even care anymore if it is a imperative solution or anything, its
> just absolutly inaccaptable that there not even any workaround.
>
> I may have a different bug now after maybe installing a different
> version (unstable) of flexget, now its with beautifulsoup.
>
> nix-env  -f
> https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz
> -i  python2.7-FlexGet-1.2.337
>
> I did that. Now I get the next error, how can that be such a big big bug
> in every channels and completly broken and no real solution there, if a
> change messes up such huge stuff cant you revert it?
>
> in other distros I would use just python-pip and it would work, now you
> took the challenge on you to manage that, but if that leads to MORE
> problems then pip already has, it really sucks.
>
> I still dont get how you can brake working things just cause of some minor
> security problems.
>
> And of course some bad things happen, but at least give either a fast
> fix or as alternative any workaround.
>
> There are 85 mio nix* commands/options and config files, I am not a
> full-time
> nixos developer, I dont understand all of that many different ways you
> can do stuff.
>
> So any help would be nice. I am a technicaly shurly keen guy, but I cant
> reboot daily my machine for months, cause nobody of you experts can
> invest 5-15 mins to fix that.
>
> Sorry for whining but I am not used to me throwing brain and time after
> something x times and nothing advances at all.
>
> I dont want to be a 100% full time nixos developer / sysadmin just to
> solve such stupid problem. Except somebody would pay me for that, then I
> would think about it.
>
> I guess its maybe a rare case that you have 2 versions that both dont
> work 100%, so I cant just use a older version and wait months till you
> fix that problem finaly. But even than it would suck cause I cant really
> test new configurations in taht case.
>
> I would try to learn nixos better, but the documentation is horrible. I
> had 0 problems using, ubuntu / fedora / debian / archlinux / gentoo, but
> the doku of nixos is horrible.
>
> Heck if I want to know a package name I have to search on github for
> package names and options.
>
> So
> 1. bug reports dont work...
> 2. RTFM cant be done because the doku is horrible
> 3. mailing list seem to not work either?
>
> Is that really what I have to expect?
>
> Sorry for ranting here, I stopp now, but maybe some of that feedback
> helps you to improve something, and maybe somebody could give me some
> config lines or nix-env commands that gets flexget running again.
>
> Graham Christensen  writes:
>
> > I'm very sorry you've had a bad experience with breakage on stable. :( I
> > use 16.09 myself.
> >
> >>> yes I think that html5lib thing would it be. So it was at least a
> >>> security fix, so you dont just update stuff to update it, which would
> >>> make releases pretty useless concept :)
> >
> > Roughly, this is why backports happen:
> >
> >  - Security patches which aren't major updates
> >  - If a security patch is a major upgrade, try and find patches to our
> >current version which accomplish the same goal. Apply the major
> >update to master, and the patches to stable.
> >  - Bug fixes to applications which, again, aren't major updates.
> >Generally be cautious about these.
> >  - Any updates when the current stable version is utterly broken. A key
> >example of this is Spotify, who regularly breaks their old versions.
> >  - Extremely security-sensitive software, in particular Chrome,
> >Chromium, Firefox, Thunderbird, and of course the kernel.
> >
> >>> Sorry I formulated that message a bit trollish, but just wanted to
> learn
> >>> why how releases are done in nixos.
> >
> > Please know that Freddy, Franz, Robin, Domen, myself, and the rest of
> > the people contributing to NixOS work very hard to keep the stable
> > version of NixOS working nicely. This is very important to us.
> >
> > It can be very stressful when preparing to backport changes, but it is
> > important to do them anyway. I try to think through impact and run tests
> > across a wide range of software to see what will break. We also try not
> > to backport any substantial changes, but instead smaller patches to
> > 

Re: [Nix-dev] nix-bundle: Bundle Nix derivations to run anywhere

2017-02-07 Thread Roger Qiu
When I exported a docker image to take look at what it is, it was also just
a compressed set of tar'ed file trees.
On 08/02/2017 7:46 AM, "Arnold Krille"  wrote:

> On Mon, 6 Feb 2017 18:33:19 -0600 Matthew Bauer 
> wrote:
> > GitHub page: https://github.com/matthewbauer/nix-bundle
> >
> > I just wanted to post about a little project I've been working on. I'm
> > calling it "nix-bundle".
> >
> > Basically, what it does is: take a Nix closure, compress it into a
> > tarball, and turn that tarball into an executable using "Arx". The
> > final result looks like a plain shell script, but actually has a
> > tarball closure appended to it. When you run that script, Arx will
> > execute "nix-user-chroot" (which is included in the closure) which
> > will setup a /nix/ directory, then execute a target executable. All of
> > this should work "out of the box" for any Nix derivation folder with a
> > valid executable.
> >
> > For example, to generate a "hello" bundle:
> >
> > ./nix-bundle.sh hello /bin/hello
> >
> > "hello" specifies pkgs.hello and /bin/hello specifies the file
> > ${pkgs.helloi}/bin/hello to be executed. The output file will just be
> > called "hello".
> >
> > The result is a "bundle" that can run without Nix being installed! No
> > external dependencies are needed because they are all contained within
> > the Nix closure.
>
> So instead of pushing docker images around to bring an app into
> non-nix-production, we can just push around a tar'ed nix tree? Nice.
>
> - Arnold
>
> ___
> 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] PCI Expresscard not working under NixOS

2017-02-06 Thread Roger Qiu
It might be a missing driver. Ultimately is the kernel, its drivers and
modules that deal with hardware and IO. You might need to google around and
ask specifically for the given pci expess hardware serial code and model.
On 07/02/2017 9:39 AM, "Christoph-Simon Senjak" <
christoph.sen...@googlemail.com> wrote:

> Hello.
>
> On 06.02.2017 06:36, Roger Qiu wrote:
>
>> When you plug something in, the kernel log should show something. If it
>> doesn't then the kernel doesn't know about it, nothing in the userspace
>> can help.
>>
>
> How can that be?
>
> Make sure you're running those commands before you plug the usb in.
>>
> >
>
>> Also I used to have faulty usb cables, but even then the kernel showed
>> something. Usually repeating messages because the usb cable kept
>> dropping out and coming back in.
>>
>> What happens if you plug those devices directly?
>>
>
> The kernel does not notice the expresscard itself when I plug it in. My
> usb hard disk works perfectly under the other ports.
>
> Ah, and fun fact: When plugging in the expresscard, I can reproducibly
> scramble my sound output for a second (the music repeats for a second after
> I plug it in). Still, the kernel says nothing. And no device nodes appear.
>
>
> On 06/02/2017 2:55 PM, "Christoph-Simon Senjak"
>> <christoph.sen...@googlemail.com
>> <mailto:christoph.sen...@googlemail.com>> wrote:
>>
>> Hi.
>>
>> On 06.02.2017 04:46, Peter Hoeg wrote:
>>
>> Hi,
>>
>> My USB 3.0 Expresscard does not work under NixOS, it used to
>> work
>> under other distros. I already tried to add
>>
>>
>> Can you be a little more specific about "does not work"?
>>
>>
>> Nothing happens. Like, really nothing. No new hub is shown in lsusb
>> (as it was under Ubuntu). Devices I plug in are not shown. Nothing.
>>
>> When you plug it in, what messages are you seeing while running
>> these 2
>> commands in separate terminals:
>>
>> journalctl -k -f
>>
>> and
>>
>> udevadm monitor
>>
>>
>> Nothing. No output.
>>
>> Regards, CSS
>> ___
>> nix-dev mailing list
>> nix-dev@lists.science.uu.nl <mailto:nix-dev@lists.science.uu.nl>
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>> <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] PCI Expresscard not working under NixOS

2017-02-05 Thread Roger Qiu
When you plug something in, the kernel log should show something. If it
doesn't then the kernel doesn't know about it, nothing in the userspace can
help.

Make sure you're running those commands before you plug the usb in.

Also I used to have faulty usb cables, but even then the kernel showed
something. Usually repeating messages because the usb cable kept dropping
out and coming back in.

What happens if you plug those devices directly?
On 06/02/2017 2:55 PM, "Christoph-Simon Senjak" <
christoph.sen...@googlemail.com> wrote:

> Hi.
>
> On 06.02.2017 04:46, Peter Hoeg wrote:
>
>> Hi,
>>
>> My USB 3.0 Expresscard does not work under NixOS, it used to work
>>> under other distros. I already tried to add
>>>
>>
>> Can you be a little more specific about "does not work"?
>>
>
> Nothing happens. Like, really nothing. No new hub is shown in lsusb (as it
> was under Ubuntu). Devices I plug in are not shown. Nothing.
>
> When you plug it in, what messages are you seeing while running these 2
>> commands in separate terminals:
>>
>> journalctl -k -f
>>
>> and
>>
>> udevadm monitor
>>
>
> Nothing. No output.
>
> Regards, CSS
> ___
> 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] nixpkgs > 100k commits

2017-02-04 Thread Roger Qiu
Awesome! Although if it ever becomes an issue, we could look into GVFS (git
virtual filesystem) released by Microsoft.
On 05/02/2017 1:20 AM, "Matthias Beyer"  wrote:

> On 04-02-2017 01:06:19, Oliver Charles wrote:
> > Bas van Dijk  writes:
> >
> > > Dear all,
> > >
> > > FYI the nixpkgs repository[1] just went over 100.000 commits!
> >
> > But Git doesn't scale to large repositories! :screaming face emoji:
> > repeated for emphasis. Oh wait, we seem to be doing just fine.
>
> :-)
>
> I love the progress we have, though having +1400 issues and +300 PRs
> open (some from 2014!!!) concerns me!
>
> --
> Mit freundlichen Grüßen,
> Kind regards,
> Matthias Beyer
>
> Consider switching to free software.
> It adds value to your life.
> https://www.gnu.org/
>
> ___
> 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: Grub problem: external pointer tables not supported

2017-01-24 Thread Roger Qiu
A while back when I was trying to do the whole encrypted ZFS root, the info
on Grub seemed to show that it didn't support loading ZFS as a booting
device. So it needed a separate boot partition (which I setup as a
soft-raided ext4). Later I moved to using gummiboot and uefi however that
apparently didn't support soft raid, so I just manually cloned the fat32
boot partition which contained the gummiboot uefi application, kernel and
initramfs. The initramfs had a zfs driver so it could load zfs root at
stage 2 boot phase.

So grub has improved, and has zfs root support? That's great! However you
still need a fat32 partition for uefi support. I'm guessing this is still
where your grub code since uefi can't mount zfs or deal with luks.
On 24/01/2017 3:09 PM, "Tomasz Czyż" <tomasz.c...@gmail.com> wrote:

> Roger,
>
>
> I got it from my grub.cfg config file. It looks like that's how you access
> "root" zfs volume.
>
> If I have
>
> /
> /volume1
> /volume2
>
> in grub I could access it
>
> $disk/@/
> $disk/volume1/
> $disk/volume2/
>
> Looks like just a convention but didn't dive into it.
>
> btw, just to clarify my setup, currently I have /boot and /nix/store on
> the same zfs volume and works, looks like only one directory is affected by
> hardlinks/too many files issue.
>
> Thanks,
> Tom
>
> 2017-01-24 3:43 GMT+00:00 Roger Qiu <roger@matrix.ai>:
>
>> Btw what is the `@` symbol mean in your `ls` examples? I've never seen
>> that. The grub rescue allows yo use `ls hd (0,1)/...` with no `@`.
>> On 24/01/2017 12:52 PM, "Tomasz Czyż" <tomasz.c...@gmail.com> wrote:
>>
>>> It looks like I hit some ZFS feature that it's not supported by grub
>>> module.
>>>
>>> How I found that?
>>> In grub, you can list files in zfs volumes by doing ``ls $drive/@/home``
>>> etc.
>>> I could list ``ls $drive/@/nix`` or ``ls $drive/@/nix/var`` but not ``ls
>>> $drive/@/nix/store`` where I kept the kernels.
>>>
>>> I found some explanations about lot's of files and lot's of hardlinks
>>> (nix store had at that time more than 130G and probably triggered the
>>> feature).
>>>
>>> nix-collect-garbage -d didn't help.
>>>
>>> I solved the problem by using boot.loader.grub.copyKernels = true;
>>>
>>> Kernels were copied to the same volume but to /boot where there is
>>> smaller number of files and worked perfectly.
>>>
>>>
>>> 2017-01-23 16:44 GMT+00:00 Tomasz Czyż <tomasz.c...@gmail.com>:
>>>
>>>>
>>>>
>>>> 2017-01-23 16:15 GMT+00:00 Roger Qiu <roger@matrix.ai>:
>>>>
>>>>> Hey,
>>>>>
>>>>> Changing nixos generations won't affect the grub boot partition, that
>>>>> only changes which nixos kernel and initramfs image gets booted.
>>>>>
>>>> Because all boot options are not working one of my guesses is that in
>>>> new nix version, wrong config was generated when I did system update which
>>>> broke all options.
>>>>
>>>>> This looks like an error in the Grub partition. Maybe you recently
>>>>> updated it or changed it, or the partition got corrupted.
>>>>>
>>>> It's possible, I tried to boot from USB, do ``nixos-install
>>>> --no-root-passwd`` to reinstall the system, but I'm not sure how to force
>>>> grub/uefi partition recreation/reinstalling, any idea? Should I just format
>>>> it and will be recreated?
>>>>
>>>>> This is why other operating systems tend to make their /boot
>>>>> read-only...
>>>>>
>>>>> If you can't get into the OS, then you can try booting off a USB, and
>>>>> then edit the boot partition. Or run the uefi terminal app (but this one
>>>>> never worked for me). If you had cloned/raided boot partitions you can try
>>>>> changing the uefi image to boot from in your uefi settings (access it like
>>>>> BIOS).
>>>>>
>>>> I tried that, but I'm not sure what to change. I tried to reinstall
>>>> grub on EFI partition but I'm not sure how to do that, is regular
>>>> grub-install stuff way to go (I thought I had some issues with that and I
>>>> tried nixos-install after that).
>>>>
>>>>> Currently I have 2 uefi boot partitions cloned, but one failed so I've
>>>>> been booting off the other one.
>>>>>
>>>> Nice one, I think I'll try to 

Re: [Nix-dev] Grub problem: external pointer tables not supported

2017-01-24 Thread Roger Qiu
Hey glad you solvee it.

So the problem was that you were using Grub to directly access ZFS root
drive to get the kernel, but Nixos uses lots of hardlinks and Grub has a
problem reading that. So the kernel is now copied to /boot. That's actually
how it's done in gummiboot and probably other bootloaders.

Thanks,
Roger
On 24/01/2017 12:52 PM, "Tomasz Czyż" <tomasz.c...@gmail.com> wrote:

> It looks like I hit some ZFS feature that it's not supported by grub
> module.
>
> How I found that?
> In grub, you can list files in zfs volumes by doing ``ls $drive/@/home``
> etc.
> I could list ``ls $drive/@/nix`` or ``ls $drive/@/nix/var`` but not ``ls
> $drive/@/nix/store`` where I kept the kernels.
>
> I found some explanations about lot's of files and lot's of hardlinks (nix
> store had at that time more than 130G and probably triggered the feature).
>
> nix-collect-garbage -d didn't help.
>
> I solved the problem by using boot.loader.grub.copyKernels = true;
>
> Kernels were copied to the same volume but to /boot where there is smaller
> number of files and worked perfectly.
>
>
> 2017-01-23 16:44 GMT+00:00 Tomasz Czyż <tomasz.c...@gmail.com>:
>
>>
>>
>> 2017-01-23 16:15 GMT+00:00 Roger Qiu <roger@matrix.ai>:
>>
>>> Hey,
>>>
>>> Changing nixos generations won't affect the grub boot partition, that
>>> only changes which nixos kernel and initramfs image gets booted.
>>>
>> Because all boot options are not working one of my guesses is that in new
>> nix version, wrong config was generated when I did system update which
>> broke all options.
>>
>>> This looks like an error in the Grub partition. Maybe you recently
>>> updated it or changed it, or the partition got corrupted.
>>>
>> It's possible, I tried to boot from USB, do ``nixos-install
>> --no-root-passwd`` to reinstall the system, but I'm not sure how to force
>> grub/uefi partition recreation/reinstalling, any idea? Should I just format
>> it and will be recreated?
>>
>>> This is why other operating systems tend to make their /boot read-only...
>>>
>>> If you can't get into the OS, then you can try booting off a USB, and
>>> then edit the boot partition. Or run the uefi terminal app (but this one
>>> never worked for me). If you had cloned/raided boot partitions you can try
>>> changing the uefi image to boot from in your uefi settings (access it like
>>> BIOS).
>>>
>> I tried that, but I'm not sure what to change. I tried to reinstall grub
>> on EFI partition but I'm not sure how to do that, is regular grub-install
>> stuff way to go (I thought I had some issues with that and I tried
>> nixos-install after that).
>>
>>> Currently I have 2 uefi boot partitions cloned, but one failed so I've
>>> been booting off the other one.
>>>
>> Nice one, I think I'll try to do something like that.
>>
>> Thanks Roger.
>>
>>> Thanks,
>>> Roger
>>> On 23/01/2017 10:48 PM, "Tomasz Czyż" 
>>>
>>
>>
>>> masz.c...@gmail.com <tomasz.c...@gmail.com>> wrote:
>>>
>>>> Hello,
>>>>
>>>> recently my grub said this to me after I restarted computer:
>>>>
>>>> Error: external pointer tables not supported
>>>> Error: you need to load the kernel first.
>>>>
>>>> Every option I select with nix (also past generations) shows me this
>>>> message.
>>>>
>>>> I updated the system to 17.03pre99792.c311871 on 2016-12-23 and
>>>> restarted it before multiple times (and worked). I don't remember if I did
>>>> other updates, but this is what's grub menu shows me.
>>>>
>>>> My disk layout is: EFI boot partition for grub, next partition is
>>>> encrypted luks volume and ZFS on top of it.
>>>>
>>>> This setup worked for me for 1.5 year now without any issue.
>>>>
>>>> Anybody is aware of any changes to grub/zfs recently or had same issue?
>>>> Any suggestions how I can recover from it or what can be wrong?
>>>>
>>>> Tom
>>>>
>>>>
>>>>
>>>> ___
>>>> nix-dev mailing list
>>>> nix-dev@lists.science.uu.nl
>>>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>>>
>>>>
>>
>>
>> --
>> Tomasz Czyż
>>
>
>
>
> --
> Tomasz Czyż
>
> ___
> 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] Grub problem: external pointer tables not supported

2017-01-23 Thread Roger Qiu
Hey,

Changing nixos generations won't affect the grub boot partition, that only
changes which nixos kernel and initramfs image gets booted.

This looks like an error in the Grub partition. Maybe you recently updated
it or changed it, or the partition got corrupted.

This is why other operating systems tend to make their /boot read-only...

If you can't get into the OS, then you can try booting off a USB, and then
edit the boot partition. Or run the uefi terminal app (but this one never
worked for me). If you had cloned/raided boot partitions you can try
changing the uefi image to boot from in your uefi settings (access it like
BIOS).

Currently I have 2 uefi boot partitions cloned, but one failed so I've been
booting off the other one.

Thanks,
Roger
On 23/01/2017 10:48 PM, "Tomasz Czyż"  wrote:

> Hello,
>
> recently my grub said this to me after I restarted computer:
>
> Error: external pointer tables not supported
> Error: you need to load the kernel first.
>
> Every option I select with nix (also past generations) shows me this
> message.
>
> I updated the system to 17.03pre99792.c311871 on 2016-12-23 and restarted
> it before multiple times (and worked). I don't remember if I did other
> updates, but this is what's grub menu shows me.
>
> My disk layout is: EFI boot partition for grub, next partition is
> encrypted luks volume and ZFS on top of it.
>
> This setup worked for me for 1.5 year now without any issue.
>
> Anybody is aware of any changes to grub/zfs recently or had same issue?
> Any suggestions how I can recover from it or what can be wrong?
>
> Tom
>
>
>
> ___
> 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] List of companies using NixOS

2016-12-08 Thread Roger Qiu
https://matrix.ai/ is using NixOS as a build system.
On 21/11/2016 5:56 AM, "zimbatm"  wrote:

> Hi all,
>
> I am collecting a list of companies that are using NixOS. The idea is to
> encourage adoption by validation.
>
> The list is over here:
> https://www.reddit.com/r/NixOS/comments/5dz8fp/list_of_
> companies_using_nixos/
>
> If you don't feel like posting on Reddit just post here and I'll add them
> over there.
>
> Cheers,
> z
>
> ___
> 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] Proposal: adding fetchapt support to nixpkgs

2016-11-12 Thread Roger Qiu
I think what we need is a bot that will autosubmit PRs to bump new versions
by tracking some commonly updated widely used applications like chromium.
This shouldn't be too difficult.
On 11/11/2016 11:34 PM, "Profpatsch"  wrote:

> On 16-10-25 04:42am, Chuan-kai Lin wrote:
> > Adding support for fetching binary packages in Debian format from an APT
> > repository would solve this problem.  I envision that a nixpkg would
> > specify:
> > - the APT repository base URL
> > - the release name (e.g., stable, testing, or unstable),
> > - the binary package name,
> > - repository signing key (for repositories that implement secure APT,
> > https://wiki.debian.org/SecureApt).
> >
> > And the fetchapt derivation would:
> > - Fetch Release and Release.gpg files from the repository
> > - Verify digital signature
> > - Fetch Packages file
> > - Check hash value of Packages file against the hash value listed in
> > Release file
> > - Extract binary package path that correspond to the given package name
> > from Packages file
> > - Fetch the binary package
> > - Check hash value of binary package against the hash value listed in
> > Packages file
>
> That doesn’t work, and it’s by design.
> In order for nix (the package manager) to be able to install something,
> it needs to know the input files *beforehand*, by hash. So nix **cannot**
> evaluate a derivation where the source hash changes.
>
> The one thing that could be done is completely automating the
> version-bumping process, that is write a program that follows debian
> releases, bumps the hashes, tests the functionality of the resulting
> executables (!!) and then commits the new version to nixpkgs.
>
> --
> Proudly written in Mutt with Vim on NixOS.
> Q: Why is this email five sentences or less?
> A: http://five.sentenc.es
> May take up to five days to read your message. If it’s urgent, call me.
> ___
> 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


[Nix-dev] What happens to Polkit action files when installing a package into a user-profile

2016-11-04 Thread Roger Qiu

Hi Nix Devs,

I came across a question when discussing Polkit with a colleague.

It's possible to create an action file for pkexec, that allows execution 
of another program with superuser privileges using the pkexec annotation:


```



yes

yes

yes



key="org.freedesktop.policykit.exec.path">/path/to/some/program


```

What if a user created a Nix package that had an action file like the 
above, and then proceeded to install that package into their 
user-profile. This wouldn't require superuser privileges. If the above 
action file then gets symlinked into the polkit action directory 
(apparently any package with `share/...` directory in the output 
directory gets symlinked), then doesn't that mean that the user can now 
execute the program specified in the path annotation with superuser 
privileges?


I imagine that if during a user-profile installation, the action file 
may not in fact be symlinked into the system share directory (like 
`/run/current-system/sw/share...`), therefore the action file wouldn't 
take effect, and then there is no security vulnerability.


Thanks,

Roger

--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Custom libc

2016-10-21 Thread Roger Qiu
Perhaps a custom stdenv then? Or is there an override function for stdenv?
On 13/10/2016 10:01 AM, "Dmitry Kalinkin"  wrote:

> packageOverrides don’t override anything within stdenv
>
> > On 12 Oct 2016, at 18:28, Tomasz Czyż  wrote:
> >
> > Nikita, how do you override the attributes?
> >
> > Did you try packageOverrides like in example below?
> >
> > {
> >  packageOverrides = pkgs: rec {
> ># Make "xbmc" use the "python26" package,
> >#   instead of NixPkgs default python version.
> >xbmc = pkgs.xbmc.override {
> >  python = pkgs.python26;
> >};
> >  };
> >}
> >
> > 2016-10-12 22:16 GMT+01:00 Nikita Karetnikov :
> > How can I override glibc in nix-shell and use eglibc, for instance? Are
> there any examples? Do I need to override stdenv for that? Overriding the
> attributes of glibc (version and sha) directly doesn't seem to work. Could
> anyone provide an example?
> > ___
> > nix-dev mailing list
> > nix-dev@lists.science.uu.nl
> > http://lists.science.uu.nl/mailman/listinfo/nix-dev
> >
> >
> >
> > --
> > Tomasz Czyż
> > ___
> > 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
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] NixOS 16.09 not cleaning /boot/EFI/nixos

2016-10-07 Thread Roger Qiu
To clarify, I mean a nixos rebuild that changes the efi in some way.
On 28/09/2016 8:32 PM, "Roger Qiu" <roger@matrix.ai> wrote:

> I discovered a while back that NixOS rebuild is only time boot efi gets
> cleaned. But here's a question. Does it delete then add the new efi, or
> does it add the new efi then delete? The former would mean that even if
> your efi is full, it will work, but raises the possibility that if a
> rebuild gets interrupted, then you will have no efi. The latter is what I
> think it currently does. So I think if your efi is full, you won't be able
> to do a nixos rebuild.
> On 28/09/2016 5:49 PM, "Damien Cassou" <dam...@cassou.me> wrote:
>
>> Shea Levy <s...@shealevy.com> writes:
>>
>> > After deleting the old profiles (which nix-collect-garbage -d does), did
>> > you run '/run/current-system/bin/switch-to-configuration boot'? I think
>> > that or doing a nixos-rebuild is the only way to trigger the /boot
>> > garbage collection.
>>
>> you saved me, thank you very much.
>>
>> --
>> Damien Cassou
>> http://damiencassou.seasidehosting.st
>>
>> "Success is the ability to go from one failure to another without
>> losing enthusiasm." --Winston Churchill
>> ___
>> 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] NixOS 16.09 not cleaning /boot/EFI/nixos

2016-09-28 Thread Roger Qiu
I discovered a while back that NixOS rebuild is only time boot efi gets
cleaned. But here's a question. Does it delete then add the new efi, or
does it add the new efi then delete? The former would mean that even if
your efi is full, it will work, but raises the possibility that if a
rebuild gets interrupted, then you will have no efi. The latter is what I
think it currently does. So I think if your efi is full, you won't be able
to do a nixos rebuild.
On 28/09/2016 5:49 PM, "Damien Cassou"  wrote:

> Shea Levy  writes:
>
> > After deleting the old profiles (which nix-collect-garbage -d does), did
> > you run '/run/current-system/bin/switch-to-configuration boot'? I think
> > that or doing a nixos-rebuild is the only way to trigger the /boot
> > garbage collection.
>
> you saved me, thank you very much.
>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Success is the ability to go from one failure to another without
> losing enthusiasm." --Winston Churchill
> ___
> 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


[Nix-dev] Packaging up a prebuilt software that needs fonts

2016-09-26 Thread Roger Qiu

Hi,

I'm trying to package up https://code-industry.net/masterpdfeditor/ for 
Linux. I've managed to use patchelf to set the interpreter and rpath.


The application is now launching, and everything seems to work except 
text insertion. When I try it, it complains about fonts not being able 
to be loaded.


Checking the settings shows that fonts are not being found at all, 
there's no list of fonts to choose from.


What's the proper solution to debug this? Strace?

Thanks,

Roger

--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Sudoers

2016-09-15 Thread Roger Qiu
I see that NixOS distributes vanilla sudo without any compile time 
shenanigans then.


Thanks,

Roger

On 15/09/2016 9:09 PM, obadz wrote:
On Thu, Sep 15, 2016 at 10:31 AM, Roger Qiu <roger@matrix.ai 
<mailto:roger@matrix.ai>> wrote:


I noticed that unlike many other distributions sudo propagates
many environment variables that would be cleared:


The list of variables comes from here: 
https://github.com/millert/sudo/blob/master/plugins/sudoers/env.c#L175-L201


Other variables are dropped unless you use sudo -E.


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Sudoers

2016-09-15 Thread Roger Qiu

Hi,

I was going through the sudoers configuration and checking how it works.

I noticed that unlike many other distributions sudo propagates many 
environment variables that would be cleared:


```

echo "$LD_LIBRARY_PATH" && sudo sh -c 'echo $LD_LIBRARY_PATH'

echo "$PATH" && sudo sh -c 'echo $PATH'

echo "$XAUTHORITY" && sudo sh -c 'echo $XAUTHORITY'

echo "$DISPLAY" && sudo sh -c 'echo $DISPLAY'

```

Only `HOME` is set to `/root` as it should be.

Looking at the sudoers file we see:

```

# Don't edit this file. Set the NixOS options 'security.sudo.configFile'
# or 'security.sudo.extraConfig' instead.

# Environment variables to keep for root and %wheel.
Defaults:root,%wheel env_keep+=TERMINFO_DIRS
Defaults:root,%wheel env_keep+=TERMINFO

# Keep SSH_AUTH_SOCK so that pam_ssh_agent_auth.so can do its magic.
Defaults env_keep+=SSH_AUTH_SOCK

# "root" is allowed to do anything.
rootALL=(ALL:ALL) SETENV: ALL

# Users in the "wheel" group can do anything.
%wheel  ALL=(ALL:ALL) SETENV: ALL

```

Which is the default sudoers file currently on master.

The sudoers documentation says that `env_reset` is enabled by default, 
which be dropping most environment variables. But it isn't specified 
inside the sudoers file.


What was the reasoning for _not_ resetting most environment variables, 
and what is the point of specifying `env_keep` if the `TERMINFO_DIRS` 
and `TERMINFO` wouldn't be reset anyway?


Thanks,

Roger

--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] NixOps usage survey.

2016-09-12 Thread Roger Qiu
Pinning a commit hash is definitely 1 step to reproducibility. But another
step is that all build inputs and upstream sources must also be content
addressed and available. One challenge with this security updates.
On 12/09/2016 7:05 PM, "Tobias Pflug"  wrote:

> If I may just jump in with a question: What I feel uneasy about is to just
> use some channel. Is that what everyone does? I usually pinpoint a specific
> commit so that i know that my deployments are actually deterministic about
> what nixpkgs set is being used.
>
> Am I just being paranoid/impractical? Maybe it is even an anti-pattern
> since I obviously have to manually update then.
>
> Thanks in advance for any input :)
>
> -Tobi
>
> Sent from my iPhone
>
> > On 06 Sep 2016, at 15:06, Игорь Пашев  wrote:
> >
> > I'm using NixOps in production, EC2, Hetzner, VBox with no issues.
> >
> > Of course, commit NixOps state (JSON) in git with git-crypt. And this
> > wrapper for NixOps:
> >
> > #!/usr/bin/env bash
> >
> > set -euo pipefail
> >
> > NIXPKGS=https://github.com/NixOS/nixpkgs-channels/
> archive/nixos-15.09.tar.gz
> > NIXOPS=${NIXOPS:-nixops}
> > export NIX_PATH=nixpkgs="$NIXPKGS":.
> >
> > usage () {
> > cat < > Usage: $0   [nixops options]
> > Examples:
> >  $0 deploy realms/vbox.nix
> >  $0 info realms/vbox.nix
> >  $0 deploy realms/dumpoo.nix --build-only
> >  $0 destroy realms/cats.nix --include slothcat
> > USAGE
> > }
> >
> > fatal () {
> >  echo '** ERROR:' "$@" >&2
> >  usage >&2
> >  exit 1
> > }
> >
> > if [ $# -lt 2 ]; then
> >  fatal "missing agruments."
> > fi
> >
> > CMD="$1"; shift
> > REALM_NIX="$1"; shift
> >
> > case "$REALM_NIX" in
> >  *realms/*.nix) REALM=$(basename "$REALM_NIX" .nix);;
> >  *) fatal "invalid realm spec: $REALM_NIX";;
> > esac
> >
> > cd "$(dirname "$0")"
> >
> > state="secrets/nixops-${REALM}.json"
> > db=$(mktemp -u "secrets/tmp.${REALM}.XX.nixops")
> >
> > trap 'save' EXIT
> >
> > save() {
> >  if [ -f "$db" ]; then
> >"$NIXOPS" export -s "${db}" > "${state}.tmp"
> >mv "${state}.tmp" "${state}"
> >rm -f "$db"*
> >  fi
> > }
> >
> > create() {
> >  "$NIXOPS" create -s "$db" -d "$REALM" ""
> > }
> >
> > case "$CMD" in
> >  create)
> >[ ! -f "$state" ] || fatal "\`$state' already exists."
> >create
> >;;
> >  *)
> >[ -f "$state" ] || fatal "\`$state' does not exists."
> >"$NIXOPS" import -s "${db}" < "$state"
> >"$NIXOPS" "$CMD" -s "$db" -d "$REALM" "$@"
> >;;
> > esac
> >
> >
> >
> > And makefile for development with vbox;
> >
> > REALM = cats
> > override STATE = secrets/nixops-vbox-$(REALM).json
> >
> > build: $(STATE)
> >./let deploy realms/vbox-$(REALM).nix --build-only
> >
> > destroy:
> >./let $@ realms/vbox-$(REALM).nix --confirm
> >
> > info deploy check send-keys start stop reboot: $(STATE)
> >./let $@ realms/vbox-$(REALM).nix
> >
> > $(STATE):
> >./let create realms/vbox-$(REALM).nix
> >
> > 2016-09-05 19:01 GMT+03:00 Aloïs Cochard :
> >> Hi all,
> >>
> >> We are experimenting with NixOps and we are having great success. We do
> plan
> >> to use it for our development infrastructure, and it seems to be very
> >> promising.
> >>
> >> In the light of applying the same technology on our production stack,
> I'm
> >> curious to know how NixOps is used "for real"? Do you use it in
> production?
> >>
> >> Do you have some success story to share?
> >>
> >> Would love to know more about how it is used, the size of clusters, ...
> >>
> >> Thanks in advance!
> >>
> >> --
> >> Λ\oïs
> >> http://twitter.com/aloiscochard
> >> http://github.com/aloiscochard
> >>
> >> ___
> >> 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
>
> ___
> 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] Build a default.nix for a project with node.js and python dependencies

2016-09-07 Thread Roger Qiu
Is there a list of projects that go from other package managers to nix?
On 06/09/2016 11:57 AM, "Rok Garbas"  wrote:

> to generate nix expressions from pip's requirements.txt file i created
> pypi2nix[1] which should get you very close.
>
> [1] https://github.com/garbas/pypi2nix
>
> On Mon, Sep 5, 2016 at 11:25 PM, Sander van der Burg
>  wrote:
> > A bit difficult to give a very concrete answer, since there are many
> ways to
> > create hybrid packages.
> >
> > Anyway, a possible strategy is to create a derivation/package that runs
> pip
> > and keeps the resulting output source tree. Then use node2nix to generate
> > Nix expressions from package.json file that is in the same project.
> >
> > Then override the node2nix generated expression (see the README.md of
> > node2nix how to do this) and point the src = parameter to the derivation
> > that runs pip (and keeps the corresponding source tree).
> >
> > Quite a bit of hacking, but if the steps that you describe are correct,
> then
> > I expect it to work.
> >
> >
> > On Mon, Sep 5, 2016 at 5:22 PM, Dmitry Malikov 
> > wrote:
> >>
> >> Hey guys,
> >>
> >> There is a project with node.js and python dependencies which is need to
> >> be run inside an isolated environment.
> >>
> >> Right now the whole flow consists of 3 steps:
> >>
> >> pip install -r requirements.txt --upgrade
> >> npm install
> >> npm run build
> >>
> >> What I'm looking for is a single default.nix file built basing on
> >> dependencies listed in 'requirements.txt' and 'package.json' files,
> allowing
> >> to do these steps via 'nix-shell' command.
> >>
> >> Could you please point me at the right direction?
> >>
> >> Thanks.
> >>
> >> ___
> >> 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
> >
>
>
>
> --
> Rok Garbas
> https://garbas.si
> ___
> 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] London NixOs User Group - NIXOS_LUSTRATE talk

2016-09-01 Thread Roger Qiu
I'm in Australia.
On 31/08/2016 1:36 PM, "Raahul Kumar"  wrote:

> Hardly any Aussie Nixos users either.
>
> On Wed, Aug 31, 2016 at 12:32 PM, Graham Christensen 
> wrote:
>
>> Will there be streaming?
>>
>> Signed,
>> Lonely USA NixOS User
>>
>> On Aug 30, 2016, at 5:34 PM, zimbatm  wrote:
>>
>> Hi all,
>>
>> Obadz is giving a talk the 12th September on NIXOS_LUSTRATE. If want to
>> find out all about what's this mysterious thing, or if you just want to
>> meet, come join us: https://skillsmatter.com/meetu
>> ps/8440-london-nixos-usergroup
>>
>> After the talk we'll have a hacking session where we help each-other and
>> try things out.
>>
>> And if you want to be kept in the loop for future meetups you can also
>> sign-up here: https://www.meetup.com/NixOS-London/
>>
>> Cheers,
>> z
>>
>> ___
>> 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
>>
>>
>
> ___
> 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] 6 month C4 adoption period

2016-08-30 Thread Roger Qiu

It would be useful if those revision hashes were paired with a date.


On 30/08/2016 7:34 PM, Shea Levy wrote:

Hi Stewart,

If you go to
http://hydra.nixos.org/job/nixos/release-16.03/nixpkgs.rustUnstable.rustc.x86_64-linux/latest/eval#tabs-inputs,
you can see the nixpkgs revision of the latest successful build of
rustUnstable. If you ensure that your nixpkgs is not later then that,
you should always get binaries. If you don't, please report back with
your nixpkgs.config.

~Shea

stewart mackenzie  writes:


I just want this issue resolved.

Every time I update / upgrade I recompile rustBeta then rustUnstable
and it results in 1/2 day lost. This has happened frequently, recently
as rustUnstable and rustBeta have been broken for a long time.
(ie days have been lost finding working revs then compiling rust)

If the lowprio removal doesn't solve this then how can I get it such
that when I issue a `nixos-rebuild --upgrade switch` and my
configuration.nix contains `rustUnstable.rustc`  downloads these
binaries 
http://hydra.nixos.org/job/nixos/release-16.03/nixpkgs.rustUnstable.rustc.x86_64-linux.

What exactly does lowprio do?


___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] How to install specific version of a package?

2016-08-16 Thread Roger Qiu

You can do thing like this in your configuration.nix:

```

let pkgs-16_03 = import (fetchTarball 
http://nixos.org/releases/nixos/16.03-beta-small/nixos-16.03.252.dc3073b/nixexprs.tar.xz) 
{}; in {


environment.systemPackages = [ pkgs-16_03.w3m ];

}

```

That basically brings in the nixpkgs expression at `dc3073b` content 
address, and then installs `w3m` from that package set.


In this case, we are content addressing `w3m` by proxy of content 
addressing nixpkgs. The nixpkgs in that content address would contain 
the `w3m` content address.


Beware that if you do it this way, the package may not be available in 
the binary cache, and it may result in a from source build.


At the same time, we still don't have a content-addressable upstream 
package sources, so I'm looking into fixing that with IPFS.



On 13/08/2016 6:06 AM, Nick Sabalausky wrote:

On 08/12/2016 02:58 AM, Roger Qiu wrote:

Nix is based on content addressing. To install a specific version of a
package, just pick a version, fix the content address, and install it!
[...]
or if a previous (or newer) revision of nixpkgs had the
package, then you load that package set and point to a package there to
install it.



Can you point me to documentation for that? I only know of installing 
via "environment.systemPackages", enabling a service, or "nix-env -i 
...".


I did just now try following this:

https://nixos.org/nixpkgs/manual/#sec-modify-via-packageOverrides

And created a ~/.nixpkgs/config.nix containing (just to try things 
out) this:


{
packageOverrides = pkgs: rec {
firefox = pkgs.firefox.override {
common.version = "33.0";
};
};
}

But then I just get:

$ nix-env -i firefox
error: attribute ‘override’ missing, at 
/home/nick/.nixpkgs/config.nix:3:13


___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Why nginx config isn't placed into /etc/nginx/nginx.conf?

2016-08-12 Thread Roger Qiu
Fascinating. Have you heard of CFEngine's "Convergent Fixedpoint" idea? 
https://en.wikipedia.org/wiki/CFEngine#Convergence



On 11/08/2016 7:21 PM, Christian Kauhaus wrote:

Am 10.08.2016 um 00:29 schrieb Arnold Krille:

On Tue, 9 Aug 2016 19:54:10 +0100 Luca Bruno 
wrote:

Except that the existing world and software is not reproducible and
revertable.

[...]
Thanks to Nixos I can set my server back to the system configuration
from four months back. Apart from the user data of course.



Systems management always decomposes into congruent, convergent and divergent
realms. The aim of Nix (as I understand it) is to grow the congruent realm. Of
course, the other realms won't go away.

For those interested, I've written a blog post some months ago which explains
these realms and how they relate to NixOS:

https://blog.flyingcircus.io/2016/05/06/thoughts-on-systems-management-methods/



HTH

Christian



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Building with default.nix

2016-08-12 Thread Roger Qiu
I'd recommend to fix the content address of your nixpkgs in order to make
your default.nix reproducible. Right now you're relying on an environment
variable that determines the revision of nixpkgs.
On 09/08/2016 8:53 PM, "Rodney Lorrimar"  wrote:

> Hello nix-dev,
>
> I was wondering, what is the best way to develop a project outside of
> nixpkgs? My current method is something like this:
>
> # default.nix
> { sampleproject ? { outPath = ./.; name = "sampleproject"; }
> , pkgs ? import  {}
> }:
> with pkgs.python35Packages;
> buildPythonPackage rec {
>   name = "sampleproject-${version}";
>   version = "1.2.0";
>   src = [ sampleproject ];
>   propagatedBuildInputs = [ peppercorn ];
> };
>
> (Full project example here: https://github.com/rvl/sampleproject)
>
> In many ways it works well, but I'm not entirely happy.
>
> The problem is that my entire work tree (and all the accumulated project
> cruft) gets copied into the nix store every time I run nix-build or
> nix-shell. This is slow and also prints the scary "may run out of
> memory" warning.
>
> Is there a function to load only the tracked files from a git work tree?
> Ideally this function would result in same store path if the files are
> the same, so nothing need be rebuilt if no sources changed.
>
>
> Cheers,
>
> Rodney
> ___
> 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] Two declarative ways to install a package?

2016-08-12 Thread Roger Qiu
For example: There are both nginx package and nginx service. The package
part is just the package management aspect of Nix, while the nginx service
is the service management (configuration management) aspect of Nix. However
if you use the service, then as a dependency, package is usually installed.
On 12/08/2016 5:11 AM, "Nick Sabalausky" 
wrote:

> I'm noticing that when installing packages declaratively via
> configuration.nix and nixos-rebuild, some packages are install one way, but
> others are installed another way. For example:
>
> # Some packages are installed via environment.systemPackages
> environment.systemPackages = with pkgs; [
>   wget firefox thunderbird git
> ];
>
> # Others are installed via *.enabled = true;
> services.openssh.enable = true;
> services.printing.enable = true;
> services.xserver.enable = true;
> services.xserver.displayManager.kdm.enable = true;
> services.xserver.desktopManager.kde4.enable = true;
> services.vmwareGuest.enable = true;
>
> What exactly is the difference? Is there any more nuance to it than
> "Services are installed one way, non-services are installed the other way"?
>
> How do I know which way to install a given package? Especially if I'm not
> sure offhand whether a given package involves a service component.
>
> Can all packages be installed wither way? Are all packages ONLY one way or
> the other?
>
> How can I find what packages are available via one method or the other?
> ___
> 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 install specific version of a package?

2016-08-12 Thread Roger Qiu
Nix is based on content addressing. To install a specific version of a
package, just pick a version, fix the content address, and install it!

However nixpkgs is a community effort in creating a standard default
package set. This means the community decides to write nix expressions for
the versions the community wants, and also prunes old versions because the
community doesn't want to manage them, or have them take up space in the
hydra CI system.

However you can always write your own nix expression to install whatever
version you want, or if a previous (or newer) revision of nixpkgs had the
package, then you load that package set and point to a package there to
install it. (You can have multiple nixpkgs revisions operating at the same
time within the same configuration.nix)

Thanks,
Roger
On 12/08/2016 5:12 AM, "Nick Sabalausky" 
wrote:

> In general, how do you install a specific version of a package? It seems
> that by default it will install the latest available version like other
> distros, but for the most part installing "packagename-1.2.3"/etc doesn't
> appear to work.
>
> One of the biggest killer features of NixOS for me is the ability to
> sanely handle and manage different versions of the same package in
> different environments. But that ability seems severely crippled if I can't
> actually *install* any versions other than "latest" and "already previously
> installed on this machine while it *was* the latest, and hasn't yet been
> garbage collected".
> ___
> 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] multiple versions of the same software? / collisions

2016-08-04 Thread Roger Qiu
That's a problem though, there shouldn't be much of a problem of having 
both versions of the package available in a single environment, as long 
as the second package is namespaced appropriately, in this case it's 
just a shell alias. This should be possible with Nix. There are 
situations where it makes sense to have multiple versions if say you're 
doing some CI work involving different versions of  a runtime.



On 4/08/2016 10:07 PM, Guillaume Maudoux (Layus) wrote:

Hi,

I think you are putting your efforts in the wrong direction.
Nix is not designed to install both python 3.4 and 3.5 in the same
environment.

What it can do however is cache both in the store, so you can get an
environment with python 3.4 with
nix-shell -p python34
and an environment with python 3.5 with
nix-shell -p python35

Nix can provide you with as many different environments at the same time.
You can have a shell with python 3.4 running besides a shell with python
3.5.
You should however not install both in your default environment (nix-env
-i) as it won't work.

May I refer you to https://nixos.org/wiki/Development_Environments ?

Regards,
-- Layus.


Le 03/08/16 à 16:43, Roland Koebler a écrit :

Hi,

I think I've now found out (at least partially), although this could
result in a package being installed multiple times.


It appears that the flag setting only works on already installed packages.

Yes, and if I use

 $ nix-env -i python3-3.5.2
 ...
 $ nix-env --set-flag priority 10 python3-3.5.2
 ...
 $ nix-env -i python3-3.4.5 python3-3.5.2
 replacing old ‘python3-3.5.2’
 installing ‘python3-3.4.5’
 installing ‘python3-3.5.2’

it does not work, since the last command first removes python3-3.5.2,
then probably the flag is lost, and then installs it again.


Also I'm not sure, but even if there are name collisions in the user
environment, it should still be possible to install both packages but only
use one of the names, and then create your name alias to the non-named
package. However I do not know how this can be done.

I think I've found out. The following works:

 $ nix-env -i python3-3.5.2
 $ nix-env --set-flag priority 10 python3-3.5.2
 $ nix-env -i -P python3-3.4.5

--preserve-installed / -P was the relevant switch.
However, this can have some strange side-effects, since -P can
cause a package to be installed "multiple times":

 $ nix-env -i -P python3-3.4.5
 ...
 $ nix-env -i -P python3-3.4.5
 ...
 $ nix-env -i -P python3-3.4.5
 ...
 $ nix-env -q
 ...
 python3-3.4.5
 python3-3.4.5
 python3-3.4.5
 python3-3.4.5
 ...

This could then be "resolved" by:

 $ nix-env -e python3-3.4.5
 uninstalling ‘python3-3.4.5’
 uninstalling ‘python3-3.4.5’
 uninstalling ‘python3-3.4.5’
 uninstalling ‘python3-3.4.5’
 $ nix-env -P -i python3-3.4.5
 installing ‘python3-3.4.5’

But it still looks strange.
Is this intentional?

Roland

___
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


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] installing a locally modified package / undefined variable in maintainers

2016-08-03 Thread Roger Qiu
Try removing `simons`.
On 03/08/2016 11:56 PM, "Roger Qiu" <roger@matrix.ai> wrote:

> It appears `simons` is no longer defined?
> On 03/08/2016 11:52 PM, "Roland Koebler" <rk-l...@simple-is-better.org>
> wrote:
>
>> Hi again,
>>
>> I'm using Nix on Debian 8 (and I really like Nix, thanks!).
>> For testing, I'm trying to install several different Python3-versions.
>>
>> In addition to Python 3.4 and 3.5 (as described in my other mail), I'm
>> trying
>> to build and install Python 3.2.3 (which is not in nixpkgs) for testing.
>> Building works, but installing fails with
>>
>> error: undefined variable ‘simons’ at
>> /home/user/.../pkgs/python3.2.3/default.nix:103:50
>>
>> The line in default.nix is:
>>
>> maintainers = with stdenv.lib.maintainers; [ simons chaoflow cstrahan
>> ];
>>
>> Details:
>>
>> - Since Python 3.2.3 is not in nixpkgs, I've copied the package-files from
>>   Python 3.2.6 [1] and modified version and sha256 in default.nix:
>>
>> version = "${majorVersion}.6";
>> ->
>> version = "${majorVersion}.3";
>>
>> sha256 = "1p3vvvh3qw8avq959hdl6bq5d6r7mbhrnigqzgx6mllzh40va4hx";
>> ->
>> sha256 =
>> "23c16f621f21e54987079765c060196cbe50235c7867147c6126d433054b1754";
>>
>> - Then, I've added a custom-packages.nix (according to [2]):
>>
>> { system ? builtins.currentSystem }:
>>
>> let
>> pkgs = import  { inherit system; };
>> callPackage = pkgs.lib.callPackageWith (pkgs // pkgs.xlibs);
>> in
>> rec {
>> python323 = callPackage ./pkgs/python3.2.3 {};
>> }
>>
>> - Now, I could build it with:
>>
>> $ nix-build custom-packages.nix -A python323
>>
>> - But installing fails
>>
>> $ nix-env -f custom-packages.nix -iA python323
>> installing ‘mypython3-3.2.3’
>> error: undefined variable ‘simons’ at
>> /home/user/.../pkgs/python3.2.3/default.nix:103:50
>>
>>
>> Could you tell me what I've done wrong?
>>
>>
>> [1]
>> /nix/store/...-nixpkgs/nixpkgs/pkgs/development/interpreters/python/3.2/
>> [2]
>> https://sandervanderburg.blogspot.de/2014/07/managing-private-nix-packages-outside.html
>>
>>
>> thanks,
>> Roland
>>
>> ___
>> 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] installing a locally modified package / undefined variable in maintainers

2016-08-03 Thread Roger Qiu
It appears `simons` is no longer defined?
On 03/08/2016 11:52 PM, "Roland Koebler" 
wrote:

> Hi again,
>
> I'm using Nix on Debian 8 (and I really like Nix, thanks!).
> For testing, I'm trying to install several different Python3-versions.
>
> In addition to Python 3.4 and 3.5 (as described in my other mail), I'm
> trying
> to build and install Python 3.2.3 (which is not in nixpkgs) for testing.
> Building works, but installing fails with
>
> error: undefined variable ‘simons’ at
> /home/user/.../pkgs/python3.2.3/default.nix:103:50
>
> The line in default.nix is:
>
> maintainers = with stdenv.lib.maintainers; [ simons chaoflow cstrahan
> ];
>
> Details:
>
> - Since Python 3.2.3 is not in nixpkgs, I've copied the package-files from
>   Python 3.2.6 [1] and modified version and sha256 in default.nix:
>
> version = "${majorVersion}.6";
> ->
> version = "${majorVersion}.3";
>
> sha256 = "1p3vvvh3qw8avq959hdl6bq5d6r7mbhrnigqzgx6mllzh40va4hx";
> ->
> sha256 =
> "23c16f621f21e54987079765c060196cbe50235c7867147c6126d433054b1754";
>
> - Then, I've added a custom-packages.nix (according to [2]):
>
> { system ? builtins.currentSystem }:
>
> let
> pkgs = import  { inherit system; };
> callPackage = pkgs.lib.callPackageWith (pkgs // pkgs.xlibs);
> in
> rec {
> python323 = callPackage ./pkgs/python3.2.3 {};
> }
>
> - Now, I could build it with:
>
> $ nix-build custom-packages.nix -A python323
>
> - But installing fails
>
> $ nix-env -f custom-packages.nix -iA python323
> installing ‘mypython3-3.2.3’
> error: undefined variable ‘simons’ at
> /home/user/.../pkgs/python3.2.3/default.nix:103:50
>
>
> Could you tell me what I've done wrong?
>
>
> [1]
> /nix/store/...-nixpkgs/nixpkgs/pkgs/development/interpreters/python/3.2/
> [2]
> https://sandervanderburg.blogspot.de/2014/07/managing-private-nix-packages-outside.html
>
>
> thanks,
> Roland
>
> ___
> 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] multiple versions of the same software? / collisions

2016-08-03 Thread Roger Qiu
It appears that the flag setting only works on already installed packages.

Also https://mobile.twitter.com/NixOsTips/status/488789048471719936

Also I'm not sure, but even if there are name collisions in the user
environment, it should still be possible to install both packages but only
use one of the names, and then create your name alias to the non-named
package. However I do not know how this can be done.

Another solution is to do package overrides.
On 03/08/2016 11:46 PM, "Roland Koebler" 
wrote:

> Hi,
>
> I'm using Nix on Debian 8, and tried to install both Python 3.4 and 3.5
> via Nix, which did not work, since one always replaced the other. So:
>
> How does Nix determine if one package should replace an other?
> And how could I prevent this?
>
> Example:
>   # Trying to install both Python 3.4 and 3.5
>   # (since I would like both versions for testing).
>
>   $ nix-env -i python3-3.4.5
>   installing ‘python3-3.4.5’
>   ...
>
>   $ nix-env -i python3-3.5.2
>   replacing old ‘python3-3.4.5’
>   installing ‘python3-3.5.2’
>
>   So, this did not work. When trying to install both at once, it also
> fails:
>
>   $ nix-env -i python3-3.4.5 python3-3.5.2
>   replacing old ‘python3-3.5.2’
>   installing ‘python3-3.4.5’
>   installing ‘python3-3.5.2’
>   building path(s)
> ‘/nix/store/r1ickgl36b4374zl8nlqfc25qnlr4lga-user-environment’
>   Wide character in die at /nix/store/
> 64jc9gd2rkbgdb4yjx3nrgc91bpjj5ky-buildenv.pl line 79.
>   collision between
> ‘/nix/store/zg1f3g03v8i1pnr1hvm5mj285jwzr1ri-python3-3.4.5/bin/2to3’ and
> ‘/nix/store/06af6d830iawf
>   builder for
> ‘/nix/store/sz3pbwznp8q59ggbqm15wilsa8n9jnph-user-environment.drv’ failed
> with exit code 255
>   error: build of
> ‘/nix/store/sz3pbwznp8q59ggbqm15wilsa8n9jnph-user-environment.drv’ failed
>
>   The given hint also doesn't work:
>
>   $ nix-env --set-flag priority 10 python3-3.5.2
>   setting flag on ‘python3-3.5.2’
>   ...
>   $ nix-env -i python3-3.4.5 python3-3.5.2
>   replacing old ‘python3-3.5.2’
>   installing ‘python3-3.4.5’
>   installing ‘python3-3.5.2’
>   ...
>   (same output as above)
>
>
> So, how could I install both?
> (It's clear that python3 could only point to one, but I'm happy with
> using them as python3.4 and python3.5.)
>
>
> One additional question: When I install an already installed package,
> no action should be necessary. But the following happens. Why?
>
>   $ nix-env -i python3-3.5.2
>   replacing old ‘python3-3.5.2’
>   installing ‘python3-3.5.2’
>
>
> thanks
> Roland
> ___
> 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] Too many open issues

2016-07-22 Thread Roger Qiu
What about things that aren't necessarily small fixable bugs. Some 
projects have long discussions about design or philosophy or some major 
architecting. Or a bug that is pending somebody coming up with a good 
solution (like for example ZFS's encryption issue which was open for 
years). Will people need to constantly comment with `+1` just to reopen? 
Also if an issue is closed it may increase the number of duplicate 
issues, instead of adding onto the closed issue.



On 22/07/2016 7:37 PM, Wout Mertens wrote:
That's the thing about auto-reopening, it makes sure that people 
interested in seeing the issue fixed are reminded of the issue so they 
can continue fixing it, as well as automatically weeding out the 
issues that are no longer important.


All the *real* issues will stay active, since people will reopen them. 
All the rest will be available in the history.


I think 14 days is enough time between reminders for an open source 
project. Shorter is annoying since we can't work on open source every 
day, and longer will just lead to more stale issues.


On Fri, Jul 22, 2016 at 11:17 AM Oliver Charles > wrote:


Agreed.

But if the problem is you think old issues are skewing the
results/making it hard to find the signal, then can't you just use
more intelligent search filters? E.g., things created in the past
3 months.

On Fri, Jul 22, 2016 at 10:15 AM Eelco Dolstra
>
wrote:

Hi,

On 07/22/2016 09:06 AM, Wout Mertens wrote:

> We have 1238 open issues and 286 open PRs.
>
> That is just too much to reason about.
>
> How about using something like
https://github.com/twbs/no-carrier which
> auto-closes after 14 days of inactivity, and reopens on a
new comment?

There is something to be said for auto-closing issues after a
long time (e.g.
Fedora auto-closes inactive issues from CURRENT-2 releases
ago), but 14 days is
wy to short. Bugs don't disappear after 14 days...

--
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/

___
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



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Specifying particular firmware

2016-07-19 Thread Roger Qiu
In what situations should we be using `enableAllFirmware`? Will 
something let us know (like something breaking)? Other distro 
installations appear to detect when non-free firmware is needed.



On 19/07/2016 6:40 AM, Vladimír Čunát wrote:

On 07/18/2016 07:35 PM, Matthew Robbetts wrote:

I can’t figure out where firmware versions are specified/determined by nixos

It's the option `config.hardware.enableAllFirmware` which pulls
`pkgs.firmwareLinuxNonfree`. Surely you can follow to the source, etc.

--Vladimir




___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Packaging free software that costs money

2016-07-06 Thread Roger Qiu
I'm interested. Free and proprietary software should be installed in the
same way in my opinion.
On 07/07/2016 12:27 AM, "Moritz Bartl" <mor...@unkonstruktiv.de> wrote:

> On 07/06/2016 03:32 PM, Profpatsch wrote:
> > On 16-07-06 10:16pm, Roger Qiu wrote:
> >> I've been thinking about the mechanics of FOSS app stores. If you don't
> want
> >> to handle the payments, you need to implement a kind of
> >> payment-authentication, where the principle is the same as dealing with
> >> private packages. Instead the key being used is a key that is derived
> from a
> >> successful payment.
> > A friend of mine might be onto something there, but it’s probably
> > still too early to tell.
>
> The short story is that we've been working on setting up a hybrid
> company that can "host" open source projects. Hybrid, in the sense that
> it will be able to both process donations (charitable, non-profit), as
> well as sales (commercial). The idea is to eventually scale to thousands
> of little projects, but at the beginning we're focusing on some bigger
> eggs. The idea is that you run your project, and we provide services to
> handle financial issues, with a web interface for teams. Donor and
> grants management, payroll, reimbursement, etc. Much like Software
> Freedom Conservancy but built for larger scale, and based in Europe.
>
> If this sounds interesting, we have some preliminary documentation
> online which I'm happy to share a link to off-list. Please do not
> publicly spread it just yet on mailing lists or Twitter or the like, but
> it's fine to pass along to other interested individuals.
>
> Moritz
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Packaging free software that costs money

2016-07-06 Thread Roger Qiu
I've been thinking about the mechanics of FOSS app stores. If you don't 
want to handle the payments, you need to implement a kind of 
payment-authentication, where the principle is the same as dealing with 
private packages. Instead the key being used is a key that is derived 
from a successful payment.



On 6/07/2016 8:57 PM, Bjørn Forsman wrote:

On 6 July 2016 at 12:50, Bjørn Forsman  wrote:

On 6 July 2016 at 12:27, Profpatsch  wrote:

Free software doesn’t mean it is free as in free beer.

There are a couple of (very good) applications, that are
sold, like for example Ardour or Radium.
They are normally distributed as binaries, but come with
the source code (as required by their license).

I think nixpkgs should include them as well (if only because
executing the pre-built binaries on nixos is impossible),
but I also think it is ethically questionable to skip the
buying process.

I’m at a loss.

One improvement we can do is making it easier to run pre-built
binaries. Right now you have to create a Nix file with
pkgs.buildFHSUserEnv and pass in a lot of data[1].

And what about those new distro-independent packaging formats?
appimage, flatpak, ...? It'd be really nice to be able to run those.

- Bjørn
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Intermittent Blank Screen upon Opening Laptop Lid

2016-07-06 Thread Roger Qiu
It does seem like a lot of people are experiencing this problem (on 
NixOS and beyond). I'll have to perform some experiments and play around 
with it to see how I can replicate it deterministically.



On 5/07/2016 1:15 PM, Ruben Astudillo wrote:

I got the same problem. I think I know the conditions that trigger the
bug, it has to do with both power sources on my laptop (BAT0 ADP1) being
online as per-said on /sys/class/power_supply at the same time. To avoid
this I just suspend (to mem) and open the netbook without the adapter
conected.



--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Intermittent Blank Screen upon Opening Laptop Lid

2016-07-03 Thread Roger Qiu

Hi Vladimir,

What's the display detect button? I tried switching to text terminals 
whenever this happens, and while something's happening with the disk 
(disk indicator light), the screen's still blank.


Thanks,

Roger

On 2/07/2016 5:54 AM, Vladimír Čunát wrote:

On 07/01/2016 03:10 PM, Roger Qiu wrote:

basically upon closing the lid and reopening it after 10 min, the screen
stays blank, and I can't do anything

Sometimes this happens to me (nvidia notebook), but in my case I can
switch to text-mode terminals, and pressing the display-detect button
recovers the X session.

--Vladimir




--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Intermittent Blank Screen upon Opening Laptop Lid

2016-07-01 Thread Roger Qiu

Also there's a few different power saving modes being activated here.

One's just the screen turning off. Which happens when I stop interacting 
with the computer for a bit. As soon as I move the mouse, everything 
comes back. This is fine. This does not have an intermittent persistent 
blank screen.


Second is the actual `systemctl suspend` command. I've used that, and it 
works. It actually turns off all the lights, and my fan stops. This also 
does not have the intermittent persistent blank screen.


Third is the problem I have, is where I close the lid, wait and reopen 
it. I don't actually know what's happening here. But the screen goes 
blank like situation 1, but of course this is one with the intermittent 
persistent blank screen.


Thanks,

Roger


On 1/07/2016 11:55 PM, Roger Qiu wrote:
I should be clear, that right after the logs that I posted is just 
`Power key pressed.` `Powering Off...` and `System is powering down.`.


So the logs posted below, were 1 minute before I hard pressed the 
power button and forced it to shutdown.


The laptop also doesn't suspend when I close the lid. This is because 
it's pretty much vanilla NixOS. I didn't create any scripts for lid 
actions.



On 1/07/2016 11:49 PM, Roger Qiu wrote:
I found something interesting on my previous boot logs, since I had 
to force shutdown.


The error is follows (from journalctl -b -1):

```

Jul 01 23:10:48 matrix-central kernel: nvidia-modeset: WARNING: 
GPU:0: Lost display notification; continuing.
Jul 01 23:12:32 matrix-central kernel: nvidia-modeset: ERROR: GPU:0: 
Idling EVO timed out: 0x957d:0:0:0x0040
Jul 01 23:12:55 matrix-central kernel: INFO: rcu_sched self-detected 
stall on CPU
Jul 01 23:12:55 matrix-central kernel: 7: (21000 ticks this 
GP) idle=be3/141/0 softirq=4499/4499 fqs=7000
Jul 01 23:12:55 matrix-central kernel:  (t=21000 jiffies 
g=12925 c=12924 q=135)

Jul 01 23:12:55 matrix-central kernel: Task dump for CPU 7:
Jul 01 23:12:55 matrix-central kernel: X   R running 
task0  2997   2969 0x00400088
Jul 01 23:12:55 matrix-central kernel:  8184e340 
88081edc3d68 8109892f 0007
Jul 01 23:12:55 matrix-central kernel:  8184e340 
88081edc3d88 8109be6d 88081edc3dc8
Jul 01 23:12:55 matrix-central kernel:  0008 
88081edc3db8 810c4180 88081edd6a40

Jul 01 23:12:55 matrix-central kernel: Call Trace:
Jul 01 23:12:55 matrix-central kernel:   [] 
sched_show_task+0xaf/0x120
Jul 01 23:12:55 matrix-central kernel: [] 
dump_cpu_task+0x3d/0x50
Jul 01 23:12:55 matrix-central kernel: [] 
rcu_dump_cpu_stacks+0x90/0xe0
Jul 01 23:12:55 matrix-central kernel: [] 
rcu_check_callbacks+0x53e/0x830
Jul 01 23:12:55 matrix-central kernel: [] ? 
native_smp_send_reschedule+0x4a/0x70
Jul 01 23:12:55 matrix-central kernel: [] 
update_process_times+0x39/0x60
Jul 01 23:12:55 matrix-central kernel: [] 
tick_sched_handle.isra.15+0x36/0x50
Jul 01 23:12:55 matrix-central kernel: [] 
tick_sched_timer+0x44/0x80
Jul 01 23:12:55 matrix-central kernel: [] 
__run_hrtimer+0x85/0x240
Jul 01 23:12:55 matrix-central kernel: [] ? 
tick_sched_handle.isra.15+0x50/0x50
Jul 01 23:12:55 matrix-central kernel: [] 
hrtimer_interrupt+0xf3/0x210
Jul 01 23:12:55 matrix-central kernel: [] 
local_apic_timer_interrupt+0x3c/0x70
Jul 01 23:12:55 matrix-central kernel: [] 
smp_apic_timer_interrupt+0x41/0x60
Jul 01 23:12:55 matrix-central kernel: [] 
apic_timer_interrupt+0x6e/0x80
Jul 01 23:12:55 matrix-central kernel:   [] ? 
read_tsc+0x9/0x10
Jul 01 23:12:55 matrix-central kernel: [] ? 
_nv001840kms+0xd0/0x120 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel: [] ? 
_nv001840kms+0xb2/0x120 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel: [] ? 
_nv001737kms+0xa3/0x110 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel: [] ? 
_nv001964kms+0x145e/0x2440 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel: [] ? 
_nv009724rm+0xd/0x40 [nvidia]
Jul 01 23:12:55 matrix-central kernel: [] ? 
nvkms_alloc+0x5d/0x70 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel: [] ? 
_nv000171kms+0x40/0x40 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel: [] ? 
_nv000327kms+0x2e/0x40 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel: [] ? 
nvKmsIoctl+0x161/0x1e0 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel: [] ? 
nvkms_ioctl_common+0x45/0x90 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel: [] ? 
nvkms_ioctl+0x62/0x90 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel: [] ? 
nvidia_frontend_compat_ioctl+0x40/0x50 [nvidia]
Jul 01 23:12:55 matrix-central kernel: [] ? 
nvidia_frontend_unlocked_ioctl+0xe/0x10 [nvidia]
Jul 01 23:12:55 matrix-central kernel: [] ? 
do_vfs_ioctl+0x2a6/0x4b0
Jul 01 23:12:55 matrix-central kernel: [] ? 
__sb_end_write+0x35/0x70
Jul 01 23:12:55 matrix-central kernel: [] ? 
__audit_syscall_entry+0xac/0x100
Jul 01 23:12:55 matrix-central kernel: [] ? 
do_audit_syscall_entry+0x55/0x80
Jul

Re: [Nix-dev] Intermittent Blank Screen upon Opening Laptop Lid

2016-07-01 Thread Roger Qiu
I should be clear, that right after the logs that I posted is just 
`Power key pressed.` `Powering Off...` and `System is powering down.`.


So the logs posted below, were 1 minute before I hard pressed the power 
button and forced it to shutdown.


The laptop also doesn't suspend when I close the lid. This is because 
it's pretty much vanilla NixOS. I didn't create any scripts for lid actions.



On 1/07/2016 11:49 PM, Roger Qiu wrote:
I found something interesting on my previous boot logs, since I had to 
force shutdown.


The error is follows (from journalctl -b -1):

```

Jul 01 23:10:48 matrix-central kernel: nvidia-modeset: WARNING: GPU:0: 
Lost display notification; continuing.
Jul 01 23:12:32 matrix-central kernel: nvidia-modeset: ERROR: GPU:0: 
Idling EVO timed out: 0x957d:0:0:0x0040
Jul 01 23:12:55 matrix-central kernel: INFO: rcu_sched self-detected 
stall on CPU
Jul 01 23:12:55 matrix-central kernel: 7: (21000 ticks this 
GP) idle=be3/141/0 softirq=4499/4499 fqs=7000
Jul 01 23:12:55 matrix-central kernel:  (t=21000 jiffies 
g=12925 c=12924 q=135)

Jul 01 23:12:55 matrix-central kernel: Task dump for CPU 7:
Jul 01 23:12:55 matrix-central kernel: X   R  running 
task0  2997   2969 0x00400088
Jul 01 23:12:55 matrix-central kernel:  8184e340 
88081edc3d68 8109892f 0007
Jul 01 23:12:55 matrix-central kernel:  8184e340 
88081edc3d88 8109be6d 88081edc3dc8
Jul 01 23:12:55 matrix-central kernel:  0008 
88081edc3db8 810c4180 88081edd6a40

Jul 01 23:12:55 matrix-central kernel: Call Trace:
Jul 01 23:12:55 matrix-central kernel:   [] 
sched_show_task+0xaf/0x120
Jul 01 23:12:55 matrix-central kernel:  [] 
dump_cpu_task+0x3d/0x50
Jul 01 23:12:55 matrix-central kernel:  [] 
rcu_dump_cpu_stacks+0x90/0xe0
Jul 01 23:12:55 matrix-central kernel:  [] 
rcu_check_callbacks+0x53e/0x830
Jul 01 23:12:55 matrix-central kernel:  [] ? 
native_smp_send_reschedule+0x4a/0x70
Jul 01 23:12:55 matrix-central kernel:  [] 
update_process_times+0x39/0x60
Jul 01 23:12:55 matrix-central kernel:  [] 
tick_sched_handle.isra.15+0x36/0x50
Jul 01 23:12:55 matrix-central kernel:  [] 
tick_sched_timer+0x44/0x80
Jul 01 23:12:55 matrix-central kernel:  [] 
__run_hrtimer+0x85/0x240
Jul 01 23:12:55 matrix-central kernel:  [] ? 
tick_sched_handle.isra.15+0x50/0x50
Jul 01 23:12:55 matrix-central kernel:  [] 
hrtimer_interrupt+0xf3/0x210
Jul 01 23:12:55 matrix-central kernel:  [] 
local_apic_timer_interrupt+0x3c/0x70
Jul 01 23:12:55 matrix-central kernel:  [] 
smp_apic_timer_interrupt+0x41/0x60
Jul 01 23:12:55 matrix-central kernel:  [] 
apic_timer_interrupt+0x6e/0x80
Jul 01 23:12:55 matrix-central kernel:   [] ? 
read_tsc+0x9/0x10
Jul 01 23:12:55 matrix-central kernel:  [] ? 
_nv001840kms+0xd0/0x120 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
_nv001840kms+0xb2/0x120 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
_nv001737kms+0xa3/0x110 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
_nv001964kms+0x145e/0x2440 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
_nv009724rm+0xd/0x40 [nvidia]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
nvkms_alloc+0x5d/0x70 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
_nv000171kms+0x40/0x40 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
_nv000327kms+0x2e/0x40 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
nvKmsIoctl+0x161/0x1e0 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
nvkms_ioctl_common+0x45/0x90 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
nvkms_ioctl+0x62/0x90 [nvidia_modeset]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
nvidia_frontend_compat_ioctl+0x40/0x50 [nvidia]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
nvidia_frontend_unlocked_ioctl+0xe/0x10 [nvidia]
Jul 01 23:12:55 matrix-central kernel:  [] ? 
do_vfs_ioctl+0x2a6/0x4b0
Jul 01 23:12:55 matrix-central kernel:  [] ? 
__sb_end_write+0x35/0x70
Jul 01 23:12:55 matrix-central kernel:  [] ? 
__audit_syscall_entry+0xac/0x100
Jul 01 23:12:55 matrix-central kernel:  [] ? 
do_audit_syscall_entry+0x55/0x80
Jul 01 23:12:55 matrix-central kernel:  [] ? 
SyS_ioctl+0x81/0xa0
Jul 01 23:12:55 matrix-central kernel:  [] ? 
syscall_trace_leave+0x9e/0x120
Jul 01 23:12:55 matrix-central kernel:  [] ? 
system_call_fastpath+0x12/0x71
Jul 01 23:13:58 matrix-central kernel: INFO: rcu_sched self-detected 
stall on CPU
Jul 01 23:13:58 matrix-central kernel: 7: (84004 ticks this 
GP) idle=be3/141/0 softirq=4499/4499 fqs=27997
Jul 01 23:13:58 matrix-central kernel:  (t=84004 jiffies 
g=12925 c=12924 q=594)

Jul 01 23:13:58 matrix-central kernel: Task dump for CPU 7:
Jul 01 23:13:58 matrix-central kernel: X   R  running 
task0  2997   2969 0x00400088
Jul 01 23:13:58 matrix-central kernel:  8184e340 
88081edc3d68 8109892f

Re: [Nix-dev] Intermittent Blank Screen upon Opening Laptop Lid

2016-07-01 Thread Roger Qiu
 matrix-central kernel:  [] 
rcu_dump_cpu_stacks+0x90/0xe0
Jul 01 23:13:58 matrix-central kernel:  [] 
rcu_check_callbacks+0x53e/0x830
Jul 01 23:13:58 matrix-central kernel:  [] 
update_process_times+0x39/0x60
Jul 01 23:13:58 matrix-central kernel:  [] 
tick_sched_handle.isra.15+0x36/0x50
Jul 01 23:13:58 matrix-central kernel:  [] 
tick_sched_timer+0x44/0x80
Jul 01 23:13:58 matrix-central kernel:  [] 
__run_hrtimer+0x85/0x240
Jul 01 23:13:58 matrix-central kernel:  [] ? 
tick_sched_handle.isra.15+0x50/0x50
Jul 01 23:13:58 matrix-central kernel:  [] 
hrtimer_interrupt+0xf3/0x210
Jul 01 23:13:58 matrix-central kernel:  [] 
local_apic_timer_interrupt+0x3c/0x70
Jul 01 23:13:58 matrix-central kernel:  [] 
smp_apic_timer_interrupt+0x41/0x60
Jul 01 23:13:58 matrix-central kernel:  [] 
apic_timer_interrupt+0x6e/0x80
Jul 01 23:13:58 matrix-central kernel:   [] ? 
read_tsc+0x9/0x10
Jul 01 23:13:58 matrix-central kernel:  [] ? 
_nv001840kms+0xd0/0x120 [nvidia_modeset]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
_nv001840kms+0xb2/0x120 [nvidia_modeset]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
_nv001737kms+0xa3/0x110 [nvidia_modeset]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
_nv001964kms+0x145e/0x2440 [nvidia_modeset]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
_nv009724rm+0xd/0x40 [nvidia]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
nvkms_alloc+0x5d/0x70 [nvidia_modeset]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
_nv000171kms+0x40/0x40 [nvidia_modeset]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
_nv000327kms+0x2e/0x40 [nvidia_modeset]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
nvKmsIoctl+0x161/0x1e0 [nvidia_modeset]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
nvkms_ioctl_common+0x45/0x90 [nvidia_modeset]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
nvkms_ioctl+0x62/0x90 [nvidia_modeset]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
nvidia_frontend_compat_ioctl+0x40/0x50 [nvidia]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
nvidia_frontend_unlocked_ioctl+0xe/0x10 [nvidia]
Jul 01 23:13:58 matrix-central kernel:  [] ? 
do_vfs_ioctl+0x2a6/0x4b0
Jul 01 23:13:58 matrix-central kernel:  [] ? 
__sb_end_write+0x35/0x70
Jul 01 23:13:58 matrix-central kernel:  [] ? 
__audit_syscall_entry+0xac/0x100
Jul 01 23:13:58 matrix-central kernel:  [] ? 
do_audit_syscall_entry+0x55/0x80
Jul 01 23:13:58 matrix-central kernel:  [] ? 
SyS_ioctl+0x81/0xa0
Jul 01 23:13:58 matrix-central kernel:  [] ? 
syscall_trace_leave+0x9e/0x120
Jul 01 23:13:58 matrix-central kernel:  [] ? 
system_call_fastpath+0x12/0x71


```

Looks like something to do with stalling and CPU 7 and NVIDIA?

Thanks,
Roger


On 1/07/2016 11:15 PM, Bjørn Forsman wrote:

On 1 July 2016 at 15:10, Roger Qiu <roger@matrix.ai> wrote:

Hi Nixers,

I discovered this problem a while ago, basically upon closing the lid and
reopening it after 10 min, the screen stays blank, and I can't do anything.
Even switching to tty1 doesn't work.

This doesn't always happen. And when I close the lid and reopen after a few
seconds, it usually works and displays something.

What are the steps that I can take to debug this issue.

It was happening back on NixOS 15.09. and is continuing on 16.03.

I'm running NVIDIA and using NVIDIA video card driver.

Did you check the system log?

- Bjørn


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Intermittent Blank Screen upon Opening Laptop Lid

2016-07-01 Thread Roger Qiu

Hi Nixers,

I discovered this problem a while ago, basically upon closing the lid 
and reopening it after 10 min, the screen stays blank, and I can't do 
anything. Even switching to tty1 doesn't work.


This doesn't always happen. And when I close the lid and reopen after a 
few seconds, it usually works and displays something.


What are the steps that I can take to debug this issue.

It was happening back on NixOS 15.09. and is continuing on 16.03.

I'm running NVIDIA and using NVIDIA video card driver.

Thanks,

Roger

--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Umask Setting in NixOS

2016-06-26 Thread Roger Qiu
Yep I know how I can override it. I'm just curious what's setting it to 
`022`. The only culprit I can see is the default activation script. 
However that shouldn't leak into the user shell context.



On 26/06/2016 2:23 AM, Игорь Пашев wrote:

I would set in one of the shell initialization scripts, like

   programs.bash.interactiveShellInit = ''
 umask ...
   '';

Or, for services, in systemd service options / scripts

2016-06-22 17:21 GMT+03:00 Roger Qiu <roger@matrix.ai>:

Hi,

In a new installation of NixOS, the umask command gives me back `022`. I was
wondering where is this being set? The `/etc/login.defs` say `UMASK 077` but
that doesn't match what the command is giving.


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Umask Setting in NixOS

2016-06-22 Thread Roger Qiu

Hi,

In a new installation of NixOS, the umask command gives me back `022`. I 
was wondering where is this being set? The `/etc/login.defs` say `UMASK 
077` but that doesn't match what the command is giving.


Thanks,
Roger

--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Using string as path to eg. builtins.readFile

2016-06-21 Thread Roger Qiu
Thanks, even if that doesn't go into the docs, I'm putting that into a 
github gist.



On 21/06/2016 5:44 PM, Bas van Dijk wrote:

Hi Erik,

Do note that I went through the same trouble as you figuring out how
to apply builtins.readFile to a dynamically constructed path. Maybe we
can document this "trick" in the documentation of builtins.readFile so
other people don't have to go through the same trouble.

To understand these things I would recommend using nix-repl:

   $ nix-repl
   Welcome to Nix version 1.11.2. Type :? for help.

   nix-repl> name = "bar"

   nix-repl> ./foo + "${name}"
   /home/bas.van.dijk/foobar

Note that the previous is equivalent to the simpler:

   nix-repl> ./foo + name
   /home/bas.van.dijk/foobar

The reason that you get "foobar" is that we didn't include a "/". So
lets try to do that:

   nix-repl> ./foo/ + name
   error: syntax error, unexpected '+', at (string):1:8

Apparently the Nix path parser doesn't like a slash at the end of a
path literal. So lets try adding the slash dynamically:

   nix-repl> ./foo + "/" + name
   /home/bas.van.dijk/foobar

What happened here? Well, + is left associative so it is interpreted as:

   (./foo + "/") + name

Lets try evaluating that left expression alone:

   nix-repl> ./foo + "/"
   /home/bas.van.dijk/foo

Apparently Nix performs normalization on paths since the final slash
is not included. So lets put the parenthesis differently:

   nix-repl> ./foo + ("/" + name)
   /home/bas.van.dijk/foo/bar

That's better! Now we can shorten this using some antiquotation:

   nix-repl> ./foo + "/${name}"
   /home/bas.van.dijk/foo/bar

I hope this helped.

Cheers,

Bas

On 21 June 2016 at 09:19, 4levels <4lev...@gmail.com> wrote:

Hi Bas,

Out of curiosity I've been experimenting with different approaches but only
yours works and I have no clue why..  Is there anything I can learn / read /
study to understand why?  Without having to study C++ (or python for that
matter as I can't even tell them apart ;-)
Is this basic lambda programming or very specific to Nix?

Works
builtins.readFile (./keys + "/${name}")

Doesn't work
builtins.readFile (./keys/ + "${name}") - unexpected +
builtins.readFile (./keys/ + name) - unexpected +
builtins.readFile (./keys + "/" + name") - no build errors, but doesn't
parse the / in the middle -> ./keysmancloud.amazon.iam.key_id -> not found

Kind regards and thanks again, my key deployment sections have become very
compact and maintainable now..

Erik

On Tue, Jun 21, 2016 at 1:56 AM 4levels <4lev...@gmail.com> wrote:

Hi Bas,

Thank you so much! Exactly what I was looking for.
It's these basic things that I keep not getting my head around.. You have
no idea how many fruitless Google and GitHub searches I tried on this one
;-)

Finally resolved and another lesson learned, amazing!

Kind regards,

Erik


On Tue, Jun 21, 2016, 01:39 Bas van Dijk  wrote:

On 19 June 2016 at 15:58, 4levels <4lev...@gmail.com> wrote:

builtins.readFile "./keys/${name}"

Hi Erik, try this:

   builtins.readFile (./keys + "/${name}")

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Where are the builtins function declarations?

2016-06-19 Thread Roger Qiu
A really easy way to understand the builtins is to use the nix-repl. The
tab completion is really nice.
On 20/06/2016 12:11 AM, "4levels" <4lev...@gmail.com> wrote:

> Lol, that shows you right away how much I understand of both python and
> C++!
>
> On Sun, Jun 19, 2016 at 4:08 PM Vladimír Čunát  wrote:
>
>> On 06/19/2016 03:48 PM, 4levels wrote:
>> > As I'm unfamiliar with python
>>
>> The builtins are written in C++, just as most of Nix.
>>
>> --Vladimir
>>
>>
>>
> ___
> 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] PR Reviewers

2016-05-19 Thread Roger Qiu
Thanks I saw.

On 19/05/2016 5:24 PM, Vladimír Čunát wrote:
> On 05/19/2016 08:55 AM, Roger Qiu wrote:
>> If someone submits a completely new package, what is the review
>> procedure and timeline?
> I don't think we really have any such processes, at least not written
> down anywhere. I participated on those two PRs now.
>
> --Vladimir
>
>

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] PR Reviewers

2016-05-19 Thread Roger Qiu
Hello,

If someone submits a completely new package, what is the review 
procedure and timeline?

I just submitted 2 packages, but because it's completely new, there's no 
notification to existing maintainers from the PR bot.

Thanks,
Roger

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Source URL breakage – please can we improve the determinism

2016-05-07 Thread Roger Qiu
Its definitely annoying.

There's discussion about it involving ipfs.

One stopgap solution is to rollback just for only that package. You can do
that with nix-env -f on a tar.gz archive of nixpkgs from a commit hash on
github.
On 08/05/2016 10:19 AM, "J. R. Haigh"  wrote:

> Dear Nix project leaders,
> I don't find NixOS to be very deterministic at all, and it's
> nearly always for the same reason: source files on random servers scattered
> across the Internet going walkabouts.
> Please can we have all source files hosted by the Nix project and
> all source URLs in nixpkgs and nixpkgs-channels replaced or accompanied by
> the Nix-hosted copies. Ideally there should be a way to specify multiple
> URLs for each source file, so both the original and the Nix-hosted
> locations can be specified, as well as any other mirrors if there are any.
> As for the duration of the hosting, I think that at least every
> release build that goes through Hydra to build live images and such should
> keep hosted files (source or binary alike) indefinitely. Anything that was
> not one of these Hydra builds I don't mind too much if they go missing
> because I nearly always stick to the release builds, but it would still be
> appreciated if all source files could be hosted indefinitely to aid with
> binary searches of regressions or other changes.
> Better still, if magnet URIs could be specified and Nix would
> support downloading from torrents then it would be very easy to avoid
> breakage due to missing source files.
> 
> In this specific instance, please could someone with commit access
> resolve this breakage a.s.a.p.?:
> https://github.com/NixOS/nixpkgs-channels/blob/nixos-15.09/pkgs/tools/misc/moreutils/default.nix
> Perhaps it could be done by updating it from 0.57 to 0.58 or by
> finding it on another mirror somewhere. The Debian source archive at
> http://ftp.de.debian.org/debian/pool/main/m/moreutils/ lists 0.47, 0.52,
> and 0.58, but not 0.57. Moreutils is depended on by Mercurial and Mercurial
> is a build dependency of many things, so that one source breakage has
> broken a lot of things from building in the head of the NixOS 15.09 release
> channel branch.
>
> Best regards,
> James R. Haigh.
> --
> Sent from Claws Mail on NixOS.
> ___
> 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] few questions before migrating from Debian…

2016-04-20 Thread Roger Qiu
UEFI requires a separate ESP partition anyway. Unless you plan on running
on FAT32.
On 16/04/2016 9:35 PM, "Saša Janiška" <g...@atmarama.com> wrote:

> Roger Qiu <roger@matrix.ai> writes:
>
> > Will you be using UEFI?
>
> Yes, on my single-disk netbook…any gotcha in regard?
>
>
> Sincerely,
> Gour
>
> --
> Just try to learn the truth by approaching a spiritual master.
> Inquire from him submissively and render service unto him.
> The self-realized souls can impart knowledge unto you because
> they have seen the truth.
>
> ___
> 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] Nix-like npm replacement (NodeJS)

2016-04-20 Thread Roger Qiu
Yep and it (along with nixpkgs and git) is one of the few package managers
that focus on content addressability.
On 20/04/2016 7:50 PM, "Wout Mertens"  wrote:

> I thought this would be interesting for some people on this list:
>
> http://gugel.io/ied/ :
>
> Under the hood, ied maintains an "object database", similar to git.
> Instead of storing packages by some arbitrary name, a SHA1-checksum is
> being generated to approximate their contents. The checksums can not only
> be used for guaranteeing a certain level of trust and consistency, but they
> also simplify the algorithm through which dependencies are being managed.
>
> The algorithm through which packages are being installed guarantees
> consistency through atomic installs. The installation of a package either
> fails or succeeds, but at no point in time can a dependency itself be
> required without having its own sub-dependencies installed (with the
> exception of shared circular dependencies).
>
> The checksum of a package is based on the contents of the package itself,
> not of its sub-dependencies. Therefore the validity of a package can be
> verified by hashing the package itself. Subsequent dependency updates have
> no effect of the generated checksum.
>
> Since node_modules is essentially a file-system based content addressable
> storage, multiple versions of the same package can co-exist in the same
> project.
> --
>
> Wout.
> (typed on mobile, excuse terseness)
>
> ___
> 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] PolicyKit timeout after upgrade to 16.03

2016-04-19 Thread Roger Qiu
You should try rolling back on the instance causing problems. By that I
mean rolling back on the system generation (at boot loader) not channel
generation. If it still has a problem, then something imperative occurred
and perhaps you can force rebuild the system (I forgot whether there's a
flag for this, or just deleting the some stuff would work)... also there's
some commands to check package integrity. You should always try to minimise
any imperative configuration (beyond disk and device setup as there's no
"nix-bootstrap") so things can be reproducible.
On 19/04/2016 12:19 AM, "4levels" <4lev...@gmail.com> wrote:

> Hi Roger,
>
> the weird thing is that my local vm, the machine that actually deploys the
> servers, doesn't have this issue.  This instance also runs nixos-16.03 and
> uses the same nixos-16.03-small channel.
>
> This issue started when trying to upgrade to 16.03  I was not really clear
> about how to do this so I ended up running nix-channel add ... nixos on all
> deployed servers, causing all the nixops deployed config to be lost,
> resulting in having to redeploy every server.  Currently I'm still unsure
> how to upgrade machines deployed with nixops :-(
>
> I don't mind redeploying every machine to solve this, as the issues are
> piling up now: I need to reboot a server because I can't do any systemctl
> call anymore that requires root privileges.  Even when first switching to
> the root account (I know the password), this issue persists.  I'm still
> completely unsure where this issue comes from.  Googling this error "Error
> getting authority: Error initializing authority: Error calling
> StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached
> (g-io-error-quark, 24)" gives me tons of pages with polkit, dbus and
> systemd things that go far beyond my understandings.
>
> When running the polkit service with strace, I can see loads of errors
> about files not being found and the trace ends with
>
> write(2, "Error switcing to user polkituse"..., 98Error switcing to user
> polkituser: Error changing to home directory /var/empty: Permission denied
> ) = 98
>
> Please find attached the full strace log.  I really hope someone can
> assist further in this nasty issue.  Maybe it is related to the use of
> nixos-16.03-small instead of nixos-16.03.  But since I'm using nixos for
> servers only, without the need for a desktop environment, I was expecting
> the small channel to be better..
>
> Kind regards!
>
> Erik
>
> On Wed, Apr 13, 2016 at 12:57 PM Roger Qiu <roger@matrix.ai> wrote:
>
>> Have you tried rolling back to 15.09, does it still happen?
>>
>>
>> On 13/04/2016 4:47 PM, 4levels wrote:
>>
>> Hi Nix'ers,
>>
>> No one? Im I the only one who's experiencing this?
>>
>> This timeout still occurs and makes every call to systemctl at least 30
>> seconds slower, pretty annoying actually..
>>
>> Hope someone with understanding can shed some light on what might be
>> going on here.
>>
>> Erik
>>
>> On Tue, Apr 12, 2016 at 3:00 AM 4levels < <4lev...@gmail.com>
>> 4lev...@gmail.com> wrote:
>>
>>> Hi Nix'ers,
>>>
>>> After upgrading to version 16.03 I'm facing timeouts whenever I try to
>>> restart a service via systemctl restart.
>>> I might be overlooking something obvious here, as I just ran
>>> nix-channel-add https://nixos.org/channels/nixos-16.03-small nixos
>>> nixos-rebuild boot --upgrade
>>>
>>> Any hints in what could be the issue?
>>> This is the full error message on the console:
>>>
>>> Error getting authority: Error initializing authority: Error calling
>>> StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached
>>> (g-io-error-quark, 24)
>>>
>>> I can run other commands through sudo though.
>>>
>>> Thanks!
>>>
>>> Erik
>>>
>>>
>>
>> ___
>> nix-dev mailing 
>> listnix-...@lists.science.uu.nlhttp://lists.science.uu.nl/mailman/listinfo/nix-dev
>>
>>
>> --
>> Founder of Matrix AIhttps://matrix.ai/+61420925975
>>
>> ___
>> 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] Difference between Pkgs, Super and Self in this Snippet

2016-04-15 Thread Roger Qiu
How do _you_ use overridePackages?

On 15/04/2016 6:10 PM, Profpatsch wrote:
> On 16-04-13 06:56pm, Nicolas Pierron wrote:
>> On Mon, Apr 11, 2016 at 7:34 AM, Roger Qiu <roger@matrix.ai> wrote:
>>> ```
>>> { pkgs }: { # pkgs is the fully configured packages, after overrides
>>> packageOverrides = super: let self = super.pkgs; in rec { # super is
>>> without overrides, self is with
>>>   # ... overrides go here ...
>>> };
>>> }
>>> ```
>>>
>>> While I understand that `super` is the package set that hasn't been
>>> overridden yet, what's the difference between `self` and `pkgs`? Do both
>>> of them have the overrides applied?
>> For the moment there is no difference between the two.
>>
>> This makes me think that we should get rid of the `packagesOverrides`
>> function, and let the content of config.nix be similar to what
>> all-packages.nix is.
>>
>> My wish by getting rid of `packagesOverrides` function is to make sure
>> that we can properly document this in NixOS modules.
> There is already a `overridePackages` function in the packageset, which
> is used by `packageOverrides` and is similar to what `haskellPackages`
> uses, though not identical. People should use it more. :)
>
> I dislike `packageOverrides` in that it creates an implicit global
> state which complicates the local understanding of nixpkgs expressions.
>
>
> Maybe related, I was trying to create a local (module-scoped) nixpkgs
> in order to overwrite some packages that are used by options enabled
> in that module, but there is no way to do that atm.
> Since we have a lot of packages with `xy.packages` (and the rest is not
> accessible) I think that would be a worthwhile improvement. Perhaps
> it is already possible?
>

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Trying to implement quicksort in nix...

2016-04-14 Thread Roger Qiu
Maybe this should be added to the standard library?
On 15/04/2016 12:36 PM, "Eric Sagnes"  wrote:

> Sorry, I just noticed that my example is wrong because it is missing
> recursion.
> The `in low ++ [x] ++ high;` should be `in qs low ++ [x] ++ qs high;`.
>
> For fun, I added it to rosetta code [1] :)
>
> [1] http://rosettacode.org/wiki/Sorting_algorithms/Quicksort#Nix
>
> On Wed, Apr 13, 2016 at 04:01:59PM +0200, Matthias Beyer wrote:
> > Ah, okay... there was my fault. Thank you!
> >
> > On 13-04-2016 22:08:08, Eric Sagnes wrote:
> > > The following seems to work:
> > >
> > > ```
> > > let
> > >   qs = l:
> > > if l == [] then []
> > > else
> > >   with builtins;
> > >   let x  = head l;
> > >   xs = tail l;
> > >   low  = filter (a: a < x)  xs;
> > >   high = filter (a: a >= x) xs;
> > >   in low ++ [x] ++ high;
> > > in
> > >   qs [3 4 1 2]
> > > ```
> > >
> > > I think you get infinite recursion because `xs` in the else branch is
> > > refering to the whole list and not the tail.
> > >
> > > On Wed, Apr 13, 2016 at 02:39:22PM +0200, Matthias Beyer wrote:
> > > > Hi,
> > > >
> > > > I struggle implementing quicksort in the nix expression language...
> maybe one of
> > > > you gurus can help me? Here's what I have so far:
> > > >
> > > > let
> > > > len= xs: builtins.length xs;
> > > > fst= xs: builtins.head xs;
> > > > lower  = x: xs: builtins.filter (a: a < x) xs;
> > > > higher = x: xs: builtins.filter (a: a >= x) xs;
> > > >
> > > > qs = xs:
> > > > if (0 == (len xs)) then []
> > > > else (qs (lower (fst xs) xs)) ++ (fst xs) ++ (qs (higher
> (fst xs) xs));
> > > > in
> > > > qs [3 4 1 2]
> > > >
> > > > Any ideas why I'm getting a stackoverflow due to infinite recursion?
> > > >
> > > > --
> > > > Mit freundlichen Grüßen,
> > > > Kind regards,
> > > > Matthias Beyer
> > > >
> > > > Proudly sent with mutt.
> > > > Happily signed with gnupg.
> > >
> > >
> > >
> > > > ___
> > > > nix-dev mailing list
> > > > nix-dev@lists.science.uu.nl
> > > > http://lists.science.uu.nl/mailman/listinfo/nix-dev
> > >
> > >
> > > --
> > > Eric Sagnes
> > > サニエ エリック
> >
> > --
> > Mit freundlichen Grüßen,
> > Kind regards,
> > Matthias Beyer
> >
> > Proudly sent with mutt.
> > Happily signed with gnupg.
>
>
>
> --
> Eric Sagnes
> サニエ エリック
> ___
> 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] few questions before migrating from Debian…

2016-04-14 Thread Roger Qiu
ZFS still requires separate /boot. Actually this depends on your boot
loader, not ZFS. So if you find a better boot loader that can run ZFS, then
you won't need a separate /boot. If you use UEFI, you'll need a separate
ESP partition anyway, which you can use as your /boot if you are only using
UEFI.
On 10/04/2016 5:15 AM, "Saša Janiška"  wrote:

> Hello,
>
> for some time I’m considering which Linux distro to use to have
> relatively fresh packages as well as not to waste too much time for
> admin work.
>
> Morever, it would be ideal to have same distro for the machine of my
> relative’s to make it easier during trouble.shooting session. So, in
> order to fulfill those two requirements I did consider to stay with
> Debian (Sid) on my desktop and netbook machines, but put Debian Stable
> on the machines of my relatives.
>
> However, after checking about NixOS which I tried many years ago, I’ve
> concluded it’s the best option at the moment since I learnt that
> nixos-stable might be good-enough for other’s machine requiring not much
> admin time, while I can use nixos-unstable if stable channel is not
> fresh–enough for my own needs.
>
> So, before jumping to install on real hardware - today I did install
> under vbox, I’ve few questions…
>
> My desktop is i7 2.8G/16G machine having 1xTB+1x2TB disks which are
> assembled in btrfs raid1 with / and /home as btrfs subvolumes (the
> remaining 1TB is used for daily backups.)
>
> I’m delighted that NixOS provides ZFS as filesytem option since it was
> one of the reasons why I was evaluating Free/PC-BSD option in the past.
>
> a) do you, in general, recommend using ZFS over Btrfs for NixOS desktop
> machine?
>
> b) is ZFS good option even for single-disk netbook machine with 4G of
> memory?
>
> c) can one use ZFS on root *without* usage of separate /boot partition?
> I use same disk layout on Debian, but with btrfs and do not have any
> experience with ZoL, although I’ve found that there is
> ’boot.loader.grub.zfsSupport’ option?
>
> Any doc/tutorial explaining how to do such install?
>
> I’ve found: https://gist.github.com/vizanto/7374277 but wonder if it is
> still relevant?
>
> There are of course few packages I do miss in NixOS, but everything else
> is so great, so that I’m very enthusiastic to put NixOS on all my
> relative’s  machines very soon.
>
> On all machines, I plan to use GNOME3, so wonder if there are some
> gotchas in regard - someone on #nixoes mentioned that GTK does not like
> custom paths as used by Nix and recommended i3 instead which is, atm,
> not option considering that other family members also use my machine and
> relatives are not savvy-enough for that tiling wm.
>
>
> Sincerely,
> Gour
>
> --
> Therefore, without being attached to the fruits of activities,
> one should act as a matter of duty, for by working without
> attachment one attains the Supreme.
>
> ___
> 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


[Nix-dev] Difference between Pkgs, Super and Self in this Snippet

2016-04-11 Thread Roger Qiu
Hi,

Here's a snippet of config.nix.

```
{ pkgs }: { # pkgs is the fully configured packages, after overrides
   packageOverrides = super: let self = super.pkgs; in rec { # super is 
without overrides, self is with
 # ... overrides go here ...
   };
}
```

While I understand that `super` is the package set that hasn't been 
overridden yet, what's the difference between `self` and `pkgs`? Do both 
of them have the overrides applied?

Thanks,
Roger

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Did we just get windows support for free?

2016-04-06 Thread Roger Qiu
What's this hidden switch?
On 31/03/2016 7:48 AM, "Teo Klestrup Röijezon"  wrote:

> Yes, but there's some hidden switch you need to flip in order to allow it.
>
> On 30 March 2016 at 22:46, stewart mackenzie  wrote:
>
>> Does windows support symlinks in non-administrator mode?
>>
>> ___
>> 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
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Displaying package parameters

2016-03-21 Thread Roger Qiu
The demo works great now.
On 22/03/2016 1:14 AM, "Fabian Schmitthenner" <fab...@schmitthenner.eu>
wrote:

> No, at least I haven't planned it. Also, IMHO we'd need to patch nixpkgs
> with [1] to be able to do this (then you can interactively view
> parameters of packages etc. interactively with nix-repl with a few nice
> functions). Part of this has been proposed here:
> https://github.com/NixOS/nixpkgs/pull/13890, I will wait until this is
> decided to maybe think about it.
>
> btw @Roger Qiu: did you manage to get the demo working in the meantime?
>
> [1]
>
> https://github.com/fkz/nixos-homepage/blob/master/nixpkgs/packages.json-generation/nixpkgs.patch
>
> On 03/21/2016 01:30 PM, Roger Qiu wrote:
> > Just wanted to ask, is this package search enhanced with showing package
> > parameters planned to be added to the standard command line Nix query
> > tools? Or if it's already available and I haven't found it.
> >
> > On 9/03/2016 2:46 AM, Fabian Schmitthenner wrote:
> >> I've added a few features:
> >>
> >> - Search in 15.09 as well as 16.03
> >> - Search in parameters
> >> - A few more packages with parameters are recognized, e. g. firefox now
> >> shows parameters
> >> - Better error handling: If a parameter fails while trying to determine
> >> what kind it is, it's simply not displayed, but anything else is
> >>
> >> As before, demo can be foud here:
> >> http://schmitthenner.eu/nixos-homepage/nixos/packages.html. (compare to
> >> official version: https://nixos.org/nixos/packages.html). You might
> need
> >> to clear your cache to see the new version.
> >>
> >> I've also added a pull request:
> >> https://github.com/NixOS/nixos-homepage/pull/78. Feel free to comment
> >> either on the list or on github.
> >>
> >> Have a great day!
> >>
> >> Fabian
> >>
> >> On 02/29/2016 03:59 AM, Fabian Schmitthenner wrote:
> >>> Hi!
> >>>
> >>> I just wanted to share that I tried displaying package parameters on
> the
> >>> nixos homepage and the current result can be seen here:
> >>> http://schmitthenner.eu/nixos-homepage/nixos/packages.html.
> >>>
> >>> When you click on a package, you hopefully see its parameter. This uses
> >>> a heruristic to try to figure out which parameters are packages (and
> >>> thus not displayed) and which are not (and thus displayed) that goes
> >>> roughly as follows:
> >>>
> >>> - If the parameter is instantiated - either implicitly or explicitly -
> >>> by callPackage, we look at the value and if it's a derivation, or a
> list
> >>> or attrset set of derivations, or a function it's not displayed
> >>> - Otherwise, it's displayed
> >>>
> >>> I think there was a discussion about this a short while ago, but I
> >>> couldn't find it.
> >>>
> >>> Please let me know what you think and if we might want a (more
> elaborate
> >>> version, e. g. also displaying the value of default arguments that
> >>> aren't changed by callPackage, which requires an other change to nix
> >>> because this info is currently not available, we only know if the
> >>> argument is optional or not afaik) of this on our official website.
> >>>
> >>> Source code can be found on
> >>> https://github.com/NixOS/nixos-homepage/compare/master...fkz:master
> >>> Technically, I patched nixpkgs customization, so we not only get the
> >>> override... functions, but also the original parameters and the
> original
> >>> function.
> >>> Furthermore, this uses a patched version of nix which allows catching
> >>> errors inside nix (added a primop __catch) that also seems useful more
> >>> generally (when polished) (see
> https://github.com/fkz/nix/tree/catch-throw).
> >>>
> >>> Fabian
> >>>
> >> ___
> >> 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] Displaying package parameters

2016-03-21 Thread Roger Qiu
Just wanted to ask, is this package search enhanced with showing package 
parameters planned to be added to the standard command line Nix query 
tools? Or if it's already available and I haven't found it.

On 9/03/2016 2:46 AM, Fabian Schmitthenner wrote:
> I've added a few features:
>
> - Search in 15.09 as well as 16.03
> - Search in parameters
> - A few more packages with parameters are recognized, e. g. firefox now
> shows parameters
> - Better error handling: If a parameter fails while trying to determine
> what kind it is, it's simply not displayed, but anything else is
>
> As before, demo can be foud here:
> http://schmitthenner.eu/nixos-homepage/nixos/packages.html. (compare to
> official version: https://nixos.org/nixos/packages.html). You might need
> to clear your cache to see the new version.
>
> I've also added a pull request:
> https://github.com/NixOS/nixos-homepage/pull/78. Feel free to comment
> either on the list or on github.
>
> Have a great day!
>
> Fabian
>
> On 02/29/2016 03:59 AM, Fabian Schmitthenner wrote:
>> Hi!
>>
>> I just wanted to share that I tried displaying package parameters on the
>> nixos homepage and the current result can be seen here:
>> http://schmitthenner.eu/nixos-homepage/nixos/packages.html.
>>
>> When you click on a package, you hopefully see its parameter. This uses
>> a heruristic to try to figure out which parameters are packages (and
>> thus not displayed) and which are not (and thus displayed) that goes
>> roughly as follows:
>>
>> - If the parameter is instantiated - either implicitly or explicitly -
>> by callPackage, we look at the value and if it's a derivation, or a list
>> or attrset set of derivations, or a function it's not displayed
>> - Otherwise, it's displayed
>>
>> I think there was a discussion about this a short while ago, but I
>> couldn't find it.
>>
>> Please let me know what you think and if we might want a (more elaborate
>> version, e. g. also displaying the value of default arguments that
>> aren't changed by callPackage, which requires an other change to nix
>> because this info is currently not available, we only know if the
>> argument is optional or not afaik) of this on our official website.
>>
>> Source code can be found on
>> https://github.com/NixOS/nixos-homepage/compare/master...fkz:master
>> Technically, I patched nixpkgs customization, so we not only get the
>> override... functions, but also the original parameters and the original
>> function.
>> Furthermore, this uses a patched version of nix which allows catching
>> errors inside nix (added a primop __catch) that also seems useful more
>> generally (when polished) (see https://github.com/fkz/nix/tree/catch-throw).
>>
>> Fabian
>>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Amazon EC2 rebuild switch causes kernel panic

2016-03-14 Thread Roger Qiu
What's happening is the transition from stage 1 booting to stage 2 booting
is failing. The error reported is that the init script that is be executed
once switch_root is executed is non existent. Which could mean your initrd
is corrupted or the build failed for some reason or some other config
problem at stage 1.

If you could inspect the initrd to check if the init script is there...
On 15/03/2016 2:31 AM, "Paul Cooley"  wrote:

> I brought up an AWS instance using nixos-15.09.git.87b377dM-x86_64-pv-ebs
> . After modifying /etc/nixos/configuration.nix to use the
> "amazon-init.nix" rather than "amazon-image.nix" and performing a
> 'nixos-rebuild switch' command, the instance reports the following error.
>
> [fsck.ext3 (1) -- /mnt-root/disk0] fsck.ext3 -a /dev/xvdb
> /dev/xvdb: recovering journal
> /dev/xvdb: clean, 116502/262144 files, 579900/1047168 blocks
> mounting /dev/xvdb on /disk0...
> switch_root: can't execute 
> '/nix/store/z9rp9hzs19pi1788fj8kdkw81mnxsgf1-nixos-15.09.1119.f6d1666/init': 
> No such file or directory
> [0.652277] Kernel panic - not syncing: Attempted to kill init! 
> exitcode=0x0100
> [0.652277]
> [0.652287] CPU: 0 PID: 1 Comm: switch_root Not tainted 3.18.26 #1-NixOS
> [0.652291]  880002c81880 8800e8e23e28 814bc251 
> 818541b8
> [0.652296]  81713d68 8800e8e23ea8 814bb43e 
> 0001
> [0.652300]  0010 8800e8e23eb8 8800e8e23e58 
> 8185dd80
> [0.652304] Call Trace:
> [0.652313]  [] dump_stack+0x46/0x58
> [0.652316]  [] panic+0xc1/0x1eb
> [0.652321]  [] do_exit+0xac5/0xad0
> [0.652327]  [] ? vfs_write+0x15c/0x1f0
> [0.652331]  [] do_group_exit+0x45/0xb0
> [0.652335]  [] SyS_exit_group+0x14/0x20
> [0.652338]  [] system_call_fastpath+0x12/0x17
> [0.652344] Kernel Offset: 0x0 from 0x8100 (relocation range: 
> 0x8000-0x9fff)
>
>
> Can someone explain to me what I'm doing wrong during the rebuild?
>
> _
>
> [image: Bazaarvoice]
>
> Paul Cooley
> Senior Dev Ops Engineer
> o:   m: 281-435-2328
> e: paul.coo...@bazaarvoice.com
> Site   |  Blog
>   |  Twitter
> 
>
>
>
>
>
> ___
> 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] When calling nix-store --verify-path - How to know the hash database is not corrupt?

2016-03-09 Thread Roger Qiu
The database you're referring to is the nixpkgs repository/channel right?
On 10/03/2016 1:59 AM, "Matthias Beyer"  wrote:

> Hi,
>
> I have a question. When calling `nix-store --verify-path
> /nix/store/something`,
> it verifies that the contents of the store path haven't been altered by an
> attacker or some other corruption like bitflips or something, am I right?
>
> It does so by comparing the hashsum of the directory contents with a hash
> sum
> stored in some database, am I right?
>
> How to know that the database isn't corrupt?
>
> Following scenario:
>
> An attacker altered the libc of my system. The attacker knows how nix
> works
> and alters the hash stored in the database as well.
> Calling `nix-store --verify-path /nix/store/somehash-libc-something`
> exits
> without error now, as the hashes still match.
>
> Or am I getting something wrong here?
>
> --
> Mit freundlichen Grüßen,
> Kind regards,
> Matthias Beyer
>
> Proudly sent with mutt.
> Happily signed with gnupg.
>
> ___
> 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] Open source team messaging: mattermost

2016-03-08 Thread Roger Qiu
As a workaround you can use sameroom.io. I connect to the IRC from Slack
there.
On 09/03/2016 1:20 AM, "Wout Mertens"  wrote:

> That one requires action on the part of the user, unlike the newfangled
> group chat tools, but ok.
>
> On Tue, Mar 8, 2016 at 3:16 PM Herwig Hochleitner 
> wrote:
>
>> 2016-03-08 15:11 GMT+01:00 Wout Mertens :
>>
>>> ok, then how about at the very least an IRC bot that sends you a recent
>>> history when you connect, and that lets you search the logs?
>>>
>>> I presume such a bot must exist?
>>>
>>
>> https://botbot.me/freenode/nixos/
>>
>> --
>
> Wout.
> (typed on mobile, excuse terseness)
>
> ___
> 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


[Nix-dev] Understanding the Binary Cache

2016-03-02 Thread Roger Qiu
Hello everybody,

There's a note on the wiki that says:

 > Note: When you ask Nix to install a package, it will first try to get 
it in pre-compiled form from a binary cache. By default, Nix will use 
the binary cache https://cache.nixos.org; it contains binaries for most 
packages in Nixpkgs. Only if no binary is available in the binary cache, 
Nix will build the package from source. So if nix-env -i subversion 
results in Nix building stuff from source, then either the package is 
not built for your platform by the Nixpkgs build servers, or your 
version of Nixpkgs is too old or too new. For instance, if you have a 
very recent checkout of Nixpkgs, then the Nixpkgs build servers may not 
have had a chance to build everything and upload the resulting binaries 
to https://cache.nixos.org. The Nixpkgs channel is only updated after 
all binaries have been uploaded to the cache, so if you stick to the 
Nixpkgs channel (rather than using a Git checkout of the Nixpkgs tree), 
you will get binaries for most packages.
 > http://nixos.org/nix/manual/

Now the last statement says:

 > The Nixpkgs channel is only updated after all binaries have been 
uploaded to the cache, so if you stick to the Nixpkgs channel (rather 
than using a Git checkout of the Nixpkgs tree), you will get binaries 
for most packages.

I am just trying to understand this. If this is true, then why is it 
that when I sometimes try to install packages, the installation process 
fails because the upstream URL is not responding. This has happened 
several times on 15.09 with different kinds of packages like Sage,  
packages from Freedesktop.org... etc.

I understand that there are certain packages that always need to be 
built from source like the nvidia binary blob. But those above packages 
shouldn't have problem right?

Anyway I'm looking for a way to find what binaries are actually 
available in the binary cache ahead of time, and compare them between 
the main channels and the small versions. I've looked around and I can't 
find anything that actually states the binaries available in small 
channels versus the main channels.

Can anybody clarify this?

Thanks,
Roger

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Small Channel Binaries

2016-02-28 Thread Roger Qiu
Hi all,

If the small channels contain less binaries in the binary cache. Is 
there a way to find out which binaries are available in the small 
channel compared to the normal channel, and compare between them?

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Fwd: Wiki is dead

2016-02-25 Thread Roger Qiu
Nobody has written the Nix/NixOS book yet.
On 24/02/2016 11:14 AM, "Anderson Torres" 
wrote:

> 2016-02-23 19:22 GMT-03:00 zimbatm :
> > I started writing some docbook. Maybe I will get used to it but writing
> > `foobar` is way more
> painful
> > that `* foobar` in markdown. Especially in writing I think it's
> important to
> > be able to move text around without too much overhead so that text can be
> > reworked until it feels right.
> >
> > Thanks god there is pandoc so I can keep submitting docbook while
> writing my
> > cozy markdown :)
> >
>
> I think the same. Docbook is extremely verbose and full of ugly XML
> tagging, I don't like it.
> Also, it is easier to use a lightweight markup as pandoc or Asciidoc.
> The learning curve is smoother than XML, and it can be easily
> converted to Docbook or anything we like.
>
> But, about documentation: what do you think on a "NixOS Handbook",
> like the FreeBSD Handbook? We can reach a wider audience if we use
> such a style of handbook.
>
> >
> > On Tue, 23 Feb 2016 at 21:29 Vladimír Čunát  wrote:
> >>
> >> On 02/23/2016 12:18 PM, Rok Garbas wrote:
> >> > docbook is just something that is not known by majority of our
> community
> >>
> >> My personal opinion is that this is mostly an excuse. It's a XML subset
> >> and everyone should know at least a bit of (X)HTML or similar stuff.
> >> Note that for almost all docs we use ~10 types of tags and the format is
> >> by itself human-understandable. (Typically it's enough to copy fragments
> >> from a few paragraphs around and edit to have the new content. We might
> >> also compose a list of tags with examples on what we typically use them
> >> for.)
> >>
> >> In any case, once the HQ content is produced, conversions are easy
> >> enough; regardless of doing them at build-time as the trend is now or at
> >> commit-time (if we decide later to unify to docbook, for example).
> >>
> >> --Vladimir
> >>
> >>
> >> ___
> >> 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
> >
> ___
> 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] network problems after upgrade

2016-02-15 Thread Roger Qiu

https://github.com/NixOS/nixpkgs/issues/12361 ?

On 16/02/2016 6:15 PM, Máté Kovács wrote:

Hi all,

The latest `nixos-rebuild switch --upgrade` broke network connectivity.

I don't use any networkmanager app, just /etc/wpa_supplicant.conf.

How do I figure out what's going wrong here?

Thanks,
Mate



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Using Nix as the preferred package manager for a new language

2016-02-14 Thread Roger Qiu

There's some work on Nix on Windows:

* https://nixos.org/wiki/Nix_on_Windows
* https://ternaris.com/lab/nix-on-windows.html

On 13/02/2016 12:01 AM, Philipp Hausmann wrote:

Interestingly enough, we have some of the same questions for the Agda
programming language. Currently, Agda doesn't really have any package
manager, so there are no backwards-compatibility problems with using Nix.

It would be really nice if we could use Nix as the one-and-only package
management solution for Agda. However, Nix doesn't support Windows,
which means we need a second fallback solution. This is rather
unpleasant, but not a show stopper.

For Agda, I'm currently leaning towards defining a simple package json
format and a very basic build tool and to build Nix support on top of
that. Kind of like the Haskell packages.

I'm certainly interested in how you're solving this problems and I will
keep an eye on it, maybe I can steal some of your work and use it for
Agda ;-)

Cheers, Philipp


Hi! I've tried to start this discussion a couple times on IRC, but it
hasn't really gotten attention, so:

I'm one of the developers of Monte, a new programming language. We don't
want to write a package manager, because package managers are hard. (Also
we've been watching npm happen for the past few years.) So we plan to use
Nix. However, we've got some requirements for our package layout, and we
haven't seen anybody else do all of the things we want at once. Here's
what we're thinking:

* Monte packages shouldn't live in nixpkgs. We use standalone Nix
expressions to build stuff like our runtime, and it makes development very
speedy since we do not have to round-trip our Nix changes through nixpkgs.
We also want to keep Nix expressions for packages close to the packages
themselves (see next point.) Perhaps when our ecosystem has developed
more, we can revisit this.

* Monte packages should bundle their own Nix expressions. Our reasoning is:

** Suppose that we have some "mtpkgs" tree, which is like nixpkgs but only
contains a Nix expression for building some or all of the Monte runtime
and packages. However, now we've decoupled the description of the packages
from the packages themselves, which makes maintaining the package harder,
since changes to the package require a corresponding change to mtpkgs. We
didn't gain anything over just using nixpkgs!

** Okay, so instead we make a JSON (or whatever) description of each
package, and ship that with the package. Then, we interpret that
description as a Nix expression, and do Nix things as usual. Except that
this doesn't work, because now the JSON description is a new package
manager format! We didn't want that.

** So it seems like packages should ship with a Nix expression.

* Packages should be easy to cargo-cult. This might sound weird, but my
experience in other ecosystems (especially Python and Perl) has taught me
that most package descriptions are cargo-culted from other similar
packages. We should have a very custom Nix derivation-producing function
which turns a minimal Nix expression into a full Monte package
description.

So with that in mind, here's where we currently are. We have a runtime and
some packages. There's a terrible terrible Nix function that generates
derivations (
https://github.com/monte-language/typhon/blob/master/default.nix#L11-L34
). An example usage is (
https://github.com/monte-language/mt-rational/blob/master/default.nix ).

As you can see, our derivations are not especially good. We don't have a
good way to locate a runtime so that we can call ``montePackage`` easily.
Once our packages start depending on other Monte packages, the problem
will only be worse. We also have this indirect dependency on nixpkgs for
library stuff, which is worse than a direct dependency or no dependency at
all.

We're seeking any advice on how to make this situation better. As far as
we can tell, nobody else has tried to make Nix their first-class preferred
package management solution for their language, so we are blazing trails
here.

Thanks!
~ C.



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [erlang-questions] Erlang Package Manager

2016-02-14 Thread Roger Qiu

Hey Gleb,

Thanks for the explanation. That makes sense, although I'm thinking of 
scalability, in terms of when other languages come around to Nix. Having 
all that in nixpkgs might make it quite bloated.


However the problem with cross channel dependencies is an interesting 
one, I suppose this problem needs to be fixed first.


Thanks,
Roger

On 15/02/2016 5:10 PM, Gleb Peregud wrote:


Hey Roger

Adding Eric, since he did a lot of work here too.

Few things. I'd like Erlang packages to be integrated into nixpkgs, so 
that they can have native dependencies. There's no package manager out 
there for Erlang which both has good coverage for Erlang packages and 
supports specifying native dependencies. Won't putting them into 
separate channel make it harder to do the latter? This is my first Nix 
project, so I'm not yet fully familiar with it.


For now it was not a problem to get things merged into nixpkgs, so I 
have nothing to complain here. There are indeed few Erlang users in 
Nix community, so I was getting some help. Existing infrastructure did 
help finding some falling builds, so it's also useful.


As you can see, currently all Erlang but one packages in nixpkgs are 
taken from hex.pm <http://hex.pm> as this seem to be the most mature 
centralized package repo for Erlang. It also provides APIs which are 
handy to use in hex2nix conversion tool.


Cheers,
Gleb

On Feb 15, 2016 6:58 AM, "Roger Qiu" <roger@matrix.ai 
<mailto:roger@matrix.ai>> wrote:


Hey Gleb,

Was curious about this, why put erlang packages into the main
nixpkgs repo, and in a separate channel?

The advantages could be that you don't have to wait on nixpkgs to
accept changes to erlang packages.

On the otherhand, maybe it's to take advantage of the CI and hydra
and a concentrated community?

Thanks,
Roger

On 15/02/2016 3:37 AM, Gleb Peregud wrote:


Ah, missed this email before. Just wanted to point out that large
chunk of this support was implemented by Eric B. Merritt, so at
least half of kudos goes to him.

Cheers
Gleb

On Feb 13, 2016 18:20, "stewart mackenzie" <setor...@gmail.com
<mailto:setor...@gmail.com>> wrote:

Tristan, Gleb Peregud has implemented first class support for
Erlang
in Nix, pleas read the docs:

http://hydra.nixos.org/build/31821726/download/1/nixpkgs/manual.html#users-guide-to-the-erlang-infrastructure

/sjm
___
nix-dev mailing list
nix-dev@lists.science.uu.nl <mailto: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 <mailto:nix-dev@lists.science.uu.nl>
http://lists.science.uu.nl/mailman/listinfo/nix-dev


-- 
Founder of Matrix AI

https://matrix.ai/
+61420925975 <tel:%2B61420925975>



--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Running `nixos-install` creates new generations inside `/mnt`

2016-01-30 Thread Roger Qiu
Hi,

Since I was debugging a number of issues with my configuration on the 
live ISO, I was running `nixos-install` multiple times. Every time I did 
this, and the configuration change caused a change in the initrd, this 
resulted in a new generation. Eventually I ran out of `/boot` space 
(this was on an ESP using gummiboot).

So what's the point of having `nixos-install` create new generations, 
there's no way to change generations or garbage collect generations 
inside `/mnt`? My suggestion would to be make it so that `nixos-install` 
never creates new generations, and always starts as if it only has 1 
generation. It would make it truly idempotent.

Thanks,
Roger

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Prepending files to initrd

2016-01-30 Thread Roger Qiu
Hi,

There's an option called: `boot.initrd.prepend`. I tried to prepend a 
gzipped cpio archive containing 1 single file with no path. But I upon 
rebooting, I received a `Initramfs unpacking failed: junk in compressed 
archive`.

Here was the steps I took:

```
pushd /boot
cpio -o <<< "luks-key.img" >luks-key.cpio
gzip luks-key.cpio
rm luks-key.img
popd
```

Then inside `configuration.nix`: `boot.initrd.prepend = [ 
"/boot/luks-key.cpio.gz" ];`.

I expect the file `luks-key.img` to be available in the initrd at stage 
1. I want to be able to reference this as `/luks-key.img`.

Is there anything I'm doing incorrect here?

Thanks,
Roger

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Prepending files to initrd

2016-01-30 Thread Roger Qiu
Is there a way to detect the current CPIO format being used? Will it 
always be `newc`?

On 30/01/2016 9:33 PM, Shea Levy wrote:
> This may not be the case any more, but in the past at least you had to 
> explicitly specify the newc cpio format (with -H newc) when calling cpio to 
> make initrds.
>
>> On Jan 30, 2016, at 5:26 AM, Roger Qiu <roger@matrix.ai> wrote:
>>
>> Hi,
>>
>> There's an option called: `boot.initrd.prepend`. I tried to prepend a
>> gzipped cpio archive containing 1 single file with no path. But I upon
>> rebooting, I received a `Initramfs unpacking failed: junk in compressed
>> archive`.
>>
>> Here was the steps I took:
>>
>> ```
>> pushd /boot
>> cpio -o <<< "luks-key.img" >luks-key.cpio
>> gzip luks-key.cpio
>> rm luks-key.img
>> popd
>> ```
>>
>> Then inside `configuration.nix`: `boot.initrd.prepend = [
>> "/boot/luks-key.cpio.gz" ];`.
>>
>> I expect the file `luks-key.img` to be available in the initrd at stage
>> 1. I want to be able to reference this as `/luks-key.img`.
>>
>> Is there anything I'm doing incorrect here?
>>
>> Thanks,
>> Roger
>>
>> -- 
>> Founder of Matrix AI
>> https://matrix.ai/
>> +61420925975
>>
>> ___
>> nix-dev mailing list
>> nix-dev@lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Redirect SDDM/LightDM (X.0.log & .xsession-errors) to JournalCTL

2016-01-28 Thread Roger Qiu
I'll look into it and submit a PR.

But any ideas on how to redirect X.0.log?

On 28/01/2016 4:40 PM, Vladimír Čunát wrote:
> On 01/28/2016 06:29 AM, Roger Qiu wrote:
>> I see, do I need to fork nixpkgs to override that bash fragment?
> Why not create an option to also log to journalctl, perhaps even on by
> default?
>
> --Vladimir
>
>

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Redirect SDDM/LightDM (X.0.log & .xsession-errors) to JournalCTL

2016-01-28 Thread Roger Qiu
GDM apparently does this: 
http://worldofgnome.org/in-gnome-3-12-systemd-will-track-xorg-logs/

But I'm not familiar with the source code.

On 29/01/2016 6:07 AM, Tuomas Tynkkynen wrote:
> 2016-01-28 20:47 GMT+02:00 Vladimír Čunát <vcu...@gmail.com>:
>> On 01/28/2016 12:21 PM, Roger Qiu wrote:
>>> But any ideas on how to redirect X.0.log?
>> X has -logfile option which seems like it only accepts paths. It should
>> be possible to hack around that via a named pipe, though that's not a
>> very nice solution. But maybe someone else was doing this already?
>>
> Maybe passing `-logfile /dev/stderr` could work (placing the output to
> display-manager.service's journal category)?

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Redirect SDDM/LightDM (X.0.log & .xsession-errors) to JournalCTL

2016-01-27 Thread Roger Qiu
Are you referring to the ~/.xsession-errors? This is a text file 
containing the error logs of X applications, where would you place your 
bash fragment?


On 28/01/2016 7:23 AM, zimbatm wrote:
I don't know about X.0.log but since .xsession is just a bash script 
you could use something like:


|#!/usr/bin/env bash |
|exec &> | logger & |
|# the usual stuff |


On Tue, 26 Jan 2016 at 05:01 Roger Qiu <roger@matrix.ai 
<mailto:roger@matrix.ai>> wrote:


Hi,

How does one redirect the logs (X.0.log) and (~/.xsession-errors) to
journalctl?

Apparently GDM
(http://worldofgnome.org/in-gnome-3-12-systemd-will-track-xorg-logs/)
now does this, but SDDM doesn't.

I would prefer to be able to centalise all logs into journalctl.

Thanks,
Roger

--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl <mailto:nix-dev@lists.science.uu.nl>
http://lists.science.uu.nl/mailman/listinfo/nix-dev



--
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Redirect SDDM/LightDM (X.0.log & .xsession-errors) to JournalCTL

2016-01-25 Thread Roger Qiu
Hi,

How does one redirect the logs (X.0.log) and (~/.xsession-errors) to 
journalctl?

Apparently GDM 
(http://worldofgnome.org/in-gnome-3-12-systemd-will-track-xorg-logs/) 
now does this, but SDDM doesn't.

I would prefer to be able to centalise all logs into journalctl.

Thanks,
Roger

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Flattening pkgs tree in nixpkgs/pkgs

2016-01-11 Thread Roger Qiu
+1 on the meta tags concept if we had a new nix tool that wrapped around
find or used a cached index that could show all packages related to a
particular tag. The cached index could be auto generated on each release or
each commit? Or just generated at installation when a user installs Nix.

Committing new tags can be constrained using pull-request bots that check
against an existing index of tags.

Browsing the nixpkgs directory is a user experience issue for me.
On 11/01/2016 6:32 AM, "Bjørn Forsman"  wrote:

> On 10 January 2016 at 20:20, Spencer Whitt  wrote:
> > -1 on the meta tags approach.
> >
> > 1) Resolving meta tags would require evaluating all of nixpkgs, which we
> > should definitely be moving away from
>
> If eval is too slow we "just" need to implement caching.
>
> (Disclaimer: I'm +1 on meta.tags)
>
> - Bjørn
> ___
> 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] Mount Overflow TMP

2015-12-15 Thread Roger Qiu
Good question, we can test this inside Virtualbox.

On 15/12/2015 3:21 AM, Eelco Dolstra wrote:
> Hi,
>
> On 14/12/15 14:51, Roger Qiu wrote:
>
>> Does NixOS do the mount overflow tmp feature that exists on other
>> distros (http://mancoosi.org/~abate/mountoverflowtmp). Apparently it can
>> be disabled with `echo 'MINTMPKB=0' > /etc/default/mountoverflowtmp`. If
>> so, why not have a NixOS option for this?
> Well, we should first establish whether a disk full prevents a NixOS system 
> from
> booting...
>

-- 
Founder of Matrix AI
http://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Suspend to RAM on LiveCD

2015-12-15 Thread Roger Qiu
Does suspend to ram work on the LiveCD? I tried it with `systemctl 
suspend`, and upon resume I just a blank screen and the USB light isn't 
lighting up.

-- 
Founder of Matrix AI
http://matrix.ai/
+61420925975

___
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 a previous build from hydra-server

2015-12-15 Thread Roger Qiu
If there are multiple channels (custom channels included) available, how
does Nix choose from which to install, and is there a way for us to pick a
preference?
On 08/12/2015 5:52 PM, "Teo Klestrup Röijezon"  wrote:

> You can import a package from a specific version of nixpkgs, independent
> of the rest of your build, though it's a bit of a manual process.
>
> First, check on Hydra which Git revision it is that you want to build (you
> can see this on the Inputs tab, 144d13cf2cc6de28f8abe9e9e8c98f28ccf8fc59 in
> this case). Then check what Nix's hash of that revision is, (either by
> running nix-prefetch-git or by looking at the store path in the Inputs tab,
> in this case phb6bdyhvnsx92mh78jysaavgviwqpbr). Then replace the reference
> to the package with a reference to the package in that version of nixpkgs.
> Now, with most NixOS modules you could do this by setting something like
>
> services.mesos.pkg = (import (lib.fetchGit {
>   url = https://github.com/NixOS/nixpkgs.git;
>   rev = "144d13cf2cc6de28f8abe9e9e8c98f28ccf8fc59";
>   sha256 = "phb6bdyhvnsx92mh78jysaavgviwqpbr";
> }) {}).pkgs.mesos;
>
> However, from what I can tell, the mesos module (
> https://github.com/NixOS/nixpkgs/blob/788800e437c4a0a25d95e217540bded68804b25e/nixos/modules/services/misc/mesos-slave.nix)
> is one of the few modules that don't support replacing the package used.
> So, uh, that's a problem that should probably be fixed, but won't really
> help you right now. :/
>
> On 8 December 2015 at 05:08, rohit yadav  wrote:
>
>> Hi Rok,
>>
>> Thanks for reply. How should I fetch it? I mean how to tell the system to
>> use that particular build? Currently, when I say nixos-rebuild {boot |
>> switch} it assumes that that  (which again I am not sure which one
>> it refers to when I have to two channels listed) would tell it the right
>> hash and it would fetch that from the server. I dunno know how to by-pass
>> that and directly fetch any particular build from hydra. Could you please
>> elaborate on this or refer to the documentation where it is described in
>> more detail.
>>
>> Thanks,
>> Rohit
>>
>> On Mon, Dec 7, 2015 at 9:45 PM, Rok Garbas  wrote:
>>
>>> you can fetch mesos directly from hydra
>>>
>>>
>>> http://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.mesos.x86_64-linux
>>>
>>> check latest successful build for instructions.
>>>
>>>
>>>
>>> Quoting rohit yadav (2015-12-08 03:54:05)
>>> > One more question. Is it possible to add two channels? Say one
>>> unstable and one
>>> > previous stable channel and choose module from one of them?
>>> >
>>> > Thanks.
>>> > Rohit
>>> >
>>> > On Mon, Dec 7, 2015 at 8:47 PM, rohit yadav 
>>> wrote:
>>> >
>>> > Hi,
>>> >
>>> > Currently Mesos package is broken on nixos-unstable channel,
>>> therefore, I
>>> > cannot install it on my server. Is there a way to install a
>>> previous
>>> > successful build?
>>> >
>>> > Thanks,
>>> > Rohit
>>> >
>>> >
>>>
>>>
>>> --
>>> Rok Garbas - http://www.garbas.si
>>>
>>
>>
>> ___
>> 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
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] hermetically sealed nixpkgs

2015-12-15 Thread Roger Qiu
Would you rather freeze the dependencies as part of whatever you're 
building, or have a persistent mirror (IPFS) of all packages that Nix 
ever makes available?


On 7/12/2015 3:44 PM, Chris Forno wrote:
How would you go about (pre)fetching every source in the nixpkgs tree? 
How large would you estimate the result to be (number of 
archives/space on disk)?


In the last couple days:

* GNU bash silently updated patch 42 
(https://github.com/NixOS/nixpkgs/issues/11475)
* OpenSSL moved the 1.0.2d release to the "old" directory (breaking 
the URL) 
(https://github.com/NixOS/nixpkgs/commit/51a5f49d700890a93c36dd50e5eca4bf6ee6966b)


These kind of breakages introduced by the external world erode the 
promise of Nix that attracted me as a developer: reproducible builds 
into the future. In this respect alone, Nix + a fixed nixpkgs checkout 
provides little/no advantage over building in a VM: both work 
indefinitely as long as you don't introduce new dependencies.


I intend to build/test a sort of hermetically sealed Nix where all 
dependencies are frozen in time (saved somewhere). I suspect I'm not 
alone in wanting this 
(http://permalink.gmane.org/gmane.linux.distributions.nixos/18611). 
I'd appreciate any tips/guidance/references to related work before I 
begin.



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
http://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] hermetically sealed nixpkgs

2015-12-15 Thread Roger Qiu
There's some work on integrating Nix and IPFS here: 
https://github.com/ipfs/notes/issues/51


On 7/12/2015 3:44 PM, Chris Forno wrote:
How would you go about (pre)fetching every source in the nixpkgs tree? 
How large would you estimate the result to be (number of 
archives/space on disk)?


In the last couple days:

* GNU bash silently updated patch 42 
(https://github.com/NixOS/nixpkgs/issues/11475)
* OpenSSL moved the 1.0.2d release to the "old" directory (breaking 
the URL) 
(https://github.com/NixOS/nixpkgs/commit/51a5f49d700890a93c36dd50e5eca4bf6ee6966b)


These kind of breakages introduced by the external world erode the 
promise of Nix that attracted me as a developer: reproducible builds 
into the future. In this respect alone, Nix + a fixed nixpkgs checkout 
provides little/no advantage over building in a VM: both work 
indefinitely as long as you don't introduce new dependencies.


I intend to build/test a sort of hermetically sealed Nix where all 
dependencies are frozen in time (saved somewhere). I suspect I'm not 
alone in wanting this 
(http://permalink.gmane.org/gmane.linux.distributions.nixos/18611). 
I'd appreciate any tips/guidance/references to related work before I 
begin.



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
http://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] hermetically sealed nixpkgs

2015-12-15 Thread Roger Qiu
Once you've downloaded all the sources, if you ever need to rebuild on a 
different machine, you can reference these already downloaded sources, 
amiright? In effect, you've created own local mirror.


On 15/12/2015 10:07 PM, Domen Kožar wrote:

see https://nixos.org/wiki/Download_all_sources

On Tue, Dec 15, 2015 at 11:59 AM, Roger Qiu <roger@polycademy.com 
<mailto:roger@polycademy.com>> wrote:


Would you rather freeze the dependencies as part of whatever
you're building, or have a persistent mirror (IPFS) of all
packages that Nix ever makes available?


On 7/12/2015 3:44 PM, Chris Forno wrote:

How would you go about (pre)fetching every source in the nixpkgs
tree? How large would you estimate the result to be (number of
archives/space on disk)?

In the last couple days:

* GNU bash silently updated patch 42
(https://github.com/NixOS/nixpkgs/issues/11475)
* OpenSSL moved the 1.0.2d release to the "old" directory
(breaking the URL)

(https://github.com/NixOS/nixpkgs/commit/51a5f49d700890a93c36dd50e5eca4bf6ee6966b)

These kind of breakages introduced by the external world erode
the promise of Nix that attracted me as a developer: reproducible
builds into the future. In this respect alone, Nix + a fixed
nixpkgs checkout provides little/no advantage over building in a
VM: both work indefinitely as long as you don't introduce new
dependencies.

I intend to build/test a sort of hermetically sealed Nix where
all dependencies are frozen in time (saved somewhere). I suspect
I'm not alone in wanting this
(http://permalink.gmane.org/gmane.linux.distributions.nixos/18611).
I'd appreciate any tips/guidance/references to related work
before I begin.


___
nix-dev mailing list
nix-dev@lists.science.uu.nl <mailto:nix-dev@lists.science.uu.nl>
http://lists.science.uu.nl/mailman/listinfo/nix-dev


-- 
Founder of Matrix AI

http://matrix.ai/
+61420925975 <tel:%2B61420925975>


___
nix-dev mailing list
nix-dev@lists.science.uu.nl <mailto:nix-dev@lists.science.uu.nl>
http://lists.science.uu.nl/mailman/listinfo/nix-dev




--
Founder of Matrix AI
http://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Mount Overflow TMP

2015-12-14 Thread Roger Qiu
Does NixOS do the mount overflow tmp feature that exists on other 
distros (http://mancoosi.org/~abate/mountoverflowtmp). Apparently it can 
be disabled with `echo 'MINTMPKB=0' > /etc/default/mountoverflowtmp`. If 
so, why not have a NixOS option for this?

-- 
Founder of Matrix AI
http://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] ZFS on TMP and dealing with missing mode mount option

2015-12-14 Thread Roger Qiu
Hi,

ZFS doesn't have a mode option during mounting. See: 
https://github.com/zfsonlinux/zfs/issues/4101

If I need a filesystem mounted with 1777 permissions and sticky bit on 
boot, how can do that with ZFS and the NixOS fileSystems settings?

The fileSystems settings has no option to run a post setup command like 
`chown 1777 /tmp`.

Thanks,
Roger

-- 
Founder of Matrix AI
http://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] What does this output in my VM test mean?

2015-11-24 Thread Roger Qiu
That's for WiFi radio spectrum regulations. When I get connected, it 
then calls a particular country domain.


On 24/11/2015 9:19 AM, Matthias Beyer wrote:

Hi,

in my VM test I get these lines over and over again after the VMs ran:

 client# [   10.808191] cfg80211: Calling CRDA to update world regulatory 
domain
 server# [   11.257265] cfg80211: Calling CRDA to update world regulatory 
domain

The tests are here[0]. Do I have to shutdown the VMs somehow? The tests are not
completed yet.

[0]: 
https://github.com/matthiasbeyer/nixpkgs/commit/d3ff65a90b8983e55d77dd2012007ea6e558d241



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
http://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Network Manager vs WPA_Supplicant on Live CD Boot

2015-11-05 Thread Roger Qiu

Definitely not the wrong key.

I expanded on this here: https://github.com/NixOS/nixpkgs/issues/10804

On 5/11/2015 9:42 PM, Domen Kožar wrote:

You're using wrong key:

wlp6s0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlp6s0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="TheFishburn" auth_failures=1 
duration=10 reason=WRONG_KEY

On Tue, Nov 3, 2015 at 10:40 AM, Roger Qiu <roger@polycademy.com 
<mailto:roger@polycademy.com>> wrote:


Hi everybody,

On my new laptop, I've been attempting to install NixOS.

My latest problem concerns the WiFi.

Simply put, I tried a bunch of different guides, and tried using
`wpa_supplicant` to connect to a WPA2 encrypted Wifi network.

It didn't work. Then I tried using `nm_cli` to do the same thing,
and it worked instantly!

So here's what succeeded in the end (I can access internet):

```
nmcli dev wifi connect "TheFishburn" password "#startupaus"
```

However this did not work:

```
wpa_supplicant -i wlp6s0 -c <(wpa_passphrase "TheFishburn"
"#startupaus")
```

What would be the reason for Network Manager to work, and yet
wpa_supplicant to not work? The Network Manager uses
wpa_supplicant in the backend, so it must be performing some magic
that I cannot divine.

For more information, here's my system information:

`lspci -k`:

```
06:00:0 Network controller: Intel Corporation Wireless 7265 (rev 59)
Subsystem: Intel Corporation Dual Band Wireless-AC 7265
Kernel driver in use: iwlwifi
```

At bootup I checked the systemctl:

`systemctl status wpa_supplicant.service`:

```

● wpa_supplicant.service - WPA supplicant
   Loaded: loaded

(/nix/store/kd9pgi9mx3r7cdvwi68xqn4csjkvm59h-wpa_supplicant-2.4/etc/systemd/system/wpa_supplicant.service)
  Drop-In:

/nix/store/h4mhqzcbqfj6az0wxgkqh9dpw1hxw2w1-system-units/wpa_supplicant.service.d
   └─overrides.conf
   Active: activating (start) since Tue 2015-11-03 08:20:05 UTC;
9min ago
 Main PID: 916 (wpa_supplicant)
   CGroup: /system.slice/wpa_supplicant.service
   └─916

/nix/store/kd9pgi9mx3r7cdvwi68xqn4csjkvm59h-wpa_supplicant-2.4/sbin//wpa_supplicant
-u

Nov 03 08:20:05 nixos wpa_supplicant[916]: Successfully
initialized wpa_supplicant
Nov 03 08:20:05 nixos wpa_supplicant[916]: Could not read
interface p2p-dev-wlp6s0 flags: No such device

```

Here is what `wpa_supplicant` shows when I run the command, the
first is non-debugging output, the second is where I have the `-d`
flag on. It seems to run forever, so I just cancel after a while
(I also noticed that wpa_cli says that it cannot connect to
wpa_supplicant).


```
Successfully initialized wpa_supplicant
Could not read interface p2p-dev-wlp6s0 flags: No such device
nl80211: Could not set interface 'p2p-dev-wlp6s0' UP
nl80211: deinit ifname=p2p-dev-wlp6s0 disabled_11b_rates=0
p2p-dev-wlp6s0: Failed to initialize driver interface
P2P: Failed to enable P2P Device interface
wlp6s0: CTRL-EVENT-SCAN-FAILED ret=-16 retry=1
wlp6s0: CTRL-EVENT-SCAN-FAILED ret=-16 retry=1
wlp6s0: CTRL-EVENT-SCAN-FAILED ret=-16 retry=1
wlp6s0: CTRL-EVENT-SCAN-FAILED ret=-16 retry=1
wlp6s0: SME: Trying to authenticate with 2c:e6:cc:1e:e2:9c
(SSID='TheFishburn' freq=5745 MHz)
wlp6s0: Trying to associate with 2c:e6:cc:1e:e2:9c
(SSID='TheFishburn' freq=5745 MHz)
wlp6s0: Associated with 2c:e6:cc:1e:e2:9c
wlp6s0: CTRL-EVENT-DISCONNECTED bssid=2c:e6:cc:1e:e2:9c reason=3
locally_generated=1
wlp6s0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlp6s0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="TheFishburn"
auth_failures=1 duration=10 reason=WRONG_KEY
wlp6s0: CTRL-EVENT-SSID-REENABLED id=0 ssid="TheFishburn"
wlp6s0: SME: Trying to authenticate with 2c:e6:cc:1e:e2:9c
(SSID='TheFishburn' freq=5745 MHz)
wlp6s0: Trying to associate with 2c:e6:cc:1e:e2:9c
(SSID='TheFishburn' freq=5745 MHz)
wlp6s0: Associated with 2c:e6:cc:1e:e2:9c
wlp6s0: CTRL-EVENT-DISCONNECTED bssid=2c:e6:cc:1e:e2:9c reason=3
locally_generated=1
wlp6s0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlp6s0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="TheFishburn"
auth_failures=2 duration=23 reason=WRONG_KEY
wlp6s0: Failed to initiate sched scan
wlp6s0: CTRL-EVENT-SSID-REENABLED id=0 ssid="TheFishburn"
wlp6s0: SME: Trying to authenticate with 2c:e6:cc:1e:e2:9c
(SSID='TheFishburn' freq=5745 MHz)
wlp6s0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="TheFishburn"
auth_failures=3 duration=46 reason=CONN_FAILED
nl80211: deinit ifname=wlp6s0 disabled_11b_rates=0
wlp6s0: CTRL-EVENT-TERMINATING
```


Re: [Nix-dev] Remote Installation

2015-11-05 Thread Roger Qiu
Try using Packer. You can take the liveCD ISO, and repack it as an image 
with SSH enabled on boot.


On 6/11/2015 3:14 PM, Alex Brandt wrote:

Hey,

I know this isn't something that one normally does but how can I ensure that
SSH is enabled and accessible from a live environment to perform a remote
installation without rolling my own livecd?  Are these instructions published
anywhere and I simply couldn't google well enough?

Thanks,



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


--
Founder of Matrix AI
http://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Directly configuring sysfs or /sys (not sysctl)

2015-05-23 Thread Roger Qiu
Just listing the current possible methods for configuring /sys (I 
haven't tried all of them):


* Configuring a custom systemd service to run on boot that just executes 
something like `bash -c 'echo ...  /sys...`

* Setting up a udev rule: http://serverfault.com/a/636759/147813
* Use systemd's tmpfiles.d and write a rule that writes a parameter to 
/sys: http://www.freedesktop.org/software/systemd/man/tmpfiles.d.html
* Use `/etc/sysfs.conf` or `/etc/sysfs.d/` and package up the systemd 
sysfsutils.service (this doesn't exist in Nix/NixOS currently).


Perhaps the primitive in Nix could use of them as a backing. The 
configuration primitive could be`boot.kernel.sys` or `boot.sys`.


On 24/05/2015 3:25 AM, Roger Qiu wrote:

Hi,

I was wondering if there was a particular Nix/NixOS configuration 
primitive that allowed direct  permanent editing of arbitrary sysfs 
`/sys` parameters?


Currently it seems that it's possible by creating custom systemd 
services (or maybe a udev rule) that run at boot which set the 
settings, or you could use `|/etc/sysfs.conf|.` or `/etc/sysfs.d/` 
(but I'm not sure if these are enabled in NixOS).


Unlike sysctl settings which are clearly explained in the 
documentation, it's not clear where the canonical place to set `/sys` 
settings should be such as CPU frequency.. etc.


Thanks,
Roger

--
Founder of Matrix AI
http://matrix.ai/
+61420925975

--
Founder of Matrix AI
http://matrix.ai/
+61420925975
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Directly configuring sysfs or /sys (not sysctl)

2015-05-23 Thread Roger Qiu

Hi,

I was wondering if there was a particular Nix/NixOS configuration 
primitive that allowed direct  permanent editing of arbitrary sysfs 
`/sys` parameters?


Currently it seems that it's possible by creating custom systemd 
services (or maybe a udev rule) that run at boot which set the settings, 
or you could use `|/etc/sysfs.conf|.` or `/etc/sysfs.d/` (but I'm not 
sure if these are enabled in NixOS).


Unlike sysctl settings which are clearly explained in the documentation, 
it's not clear where the canonical place to set `/sys` settings should 
be such as CPU frequency.. etc.


Thanks,
Roger

--
Founder of Matrix AI
http://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Directly configuring sysfs or /sys (not sysctl)

2015-05-23 Thread Roger Qiu
I think sysctl is not the same as sysfs in Linux. The sysfs is a vfs 
that is mounted on `/sys`, whereas sysctl only controls the settings 
that are available inside `/proc/sys`.

Not all the settings in `/sys` is related to the kernel. So it's 
probably better for it to be located in `boot.sys`.

For example /sys allows you to change CPU frequency.

See:

* http://www.noah.org/wiki/sysctl_and_sysfs
* 
http://people.ee.ethz.ch/~arkeller/linux/multi/kernel_user_space_howto-2.html

On BSD I think it's different, in that sysctl there might be able to do 
everything.

On 24/05/2015 4:08 AM, Bjørn Forsman wrote:
 On 23 May 2015 at 19:35, Roger Qiu roger@polycademy.com wrote:
 Just listing the current possible methods for configuring /sys (I haven't
 tried all of them):

 * Configuring a custom systemd service to run on boot that just executes
 something like `bash -c 'echo ...  /sys...`
 * Setting up a udev rule: http://serverfault.com/a/636759/147813
 * Use systemd's tmpfiles.d and write a rule that writes a parameter to /sys:
 http://www.freedesktop.org/software/systemd/man/tmpfiles.d.html
 * Use `/etc/sysfs.conf` or `/etc/sysfs.d/` and package up the systemd
 sysfsutils.service (this doesn't exist in Nix/NixOS currently).

 Perhaps the primitive in Nix could use of them as a backing. The
 configuration primitive could be`boot.kernel.sys` or `boot.sys`.
 There is already boot.kernel.sysctl:

 https://nixos.org/nixos/manual/ch-options.html#opt-boot.kernel.sysctl

 - Bjørn

-- 
Founder of Matrix AI
http://matrix.ai/
+61420925975

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


  1   2   >