[Nix-dev] Testing Nginx public entry points with NixOps/libvirtd

2016-12-21 Thread Daniel Hlynskyi
Hello all NixOps users. I'd like to build my production system with
libvirtd backend, but I'm stopped with a problem. SSL certificates can't be
obtained in virtualized environment.

{
   services.nginx.virtualHosts."example.domain" = {
 enableSSL = true;
 enableACME = true;
   };
}

As far as I understand, letsencrypt tries to verify "example.domain", but
it points to production system, not to virtualized.

What are my options to fix this issue? In the end I'd like to add virtual
server to VPN and test public entry points from developer machine.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] pypi2nix: generate full PYTHONPATH from requirements?

2016-11-05 Thread Daniel Hlynskyi
that did the trick, thanks!

systemd.services.kalithea = {
  after = [ "network.target" ];
  wantedBy = [ "multi-user.target" ];
  script =
let env = pythonPackages.python.buildEnv.override {
  extraLibs = [ python.packages.Paste python.packages.Kallithea
pythonPackages.pysqlite ];
  ignoreCollisions = true;
};
  in ''
${env}/bin/paster serve ${config};
  '';
};


2016-11-05 23:15 GMT+02:00 Freddy Rietdijk :

> Check e.g. the mopidy service
> https://github.com/NixOS/nixpkgs/blob/master/nixos/
> modules/services/audio/mopidy.nix
>
> Instead of `python.withPackages` `python.buildEnv.override{extralibs=...;}`
> is used. `withPackages` is just a wrapper around `buildEnv`.
>
> On Sat, Nov 5, 2016 at 10:09 PM, Daniel Hlynskyi 
> wrote:
>
>> pypi2nix supports `python.withPackages`. But how should I use the
>> created "environment" in NixOS service?
>>
>> path = [ python-env ];
>>
>> doesn't work
>>
>> 2016-11-05 22:59 GMT+02:00 Freddy Rietdijk :
>>
>>> I am not familiar with the details of pypi2nix, but try and use
>>> `python.withPackages` to create an environment where all packages can be
>>> found by the interpreter. PYTHONPATH is still used a lot, especially with
>>> modules, but we shouldn't be using it.
>>>
>>> http://nixos.org/nixpkgs/manual/#python
>>>
>>> On Sat, Nov 5, 2016 at 9:50 PM, Daniel Hlynskyi 
>>> wrote:
>>>
>>>> I'm trying to use pypi2nix-generated expression to create Kallithea
>>>> service.
>>>>
>>>>  systemd.services.kalithea = {
>>>>   after = [ "network.target" ];
>>>>   wantedBy = [ "multi-user.target" ];
>>>>   script =
>>>>   let ppath =
>>>> concatMapStringsSep ":" (x: 
>>>> "${x}/${python.interpreter.python.sitePackages}")
>>>> (let self = python.packages; in [
>>>>   # package
>>>>   self."Kallithea"
>>>>   # deps
>>>>   self."Babel"
>>>>   self."Beaker"
>>>>   self."FormEncode"
>>>>   self."Mako"
>>>>   self."Markdown"
>>>>   self."Pygments"
>>>>   self."Pylons"
>>>>   self."Routes"
>>>>   self."SQLAlchemy"
>>>>   self."URLObject"
>>>>   self."WebHelpers"
>>>>   self."WebOb"
>>>>   self."WebTest"
>>>>   self."Whoosh"
>>>>   self."celery"
>>>>   self."docutils"
>>>>   self."dulwich"
>>>>   self."mercurial"
>>>>   self."mock"
>>>>   self."py-bcrypt"
>>>>   self."python-dateutil"
>>>>   self."waitress"
>>>>   # second level deps
>>>>   self."MarkupSafe"
>>>>   self."funcsigs"
>>>>   self."pbr"
>>>>   self."six"
>>>>   # TODO: add all the others
>>>> ]);
>>>>   in ''
>>>> export PYTHONPATH=${ppath}
>>>> ${pythonPackages.pasteScript}/bin/paster serve
>>>> ${kallithea1}/etc/development.ini;
>>>>   '';
>>>> };
>>>>
>>>> So I need to feed PYTHONPATH into service, but I don't know a nice way
>>>> to recursively aggregate all the propagatedBuildInputs from Kallithea into
>>>> full PYTHONPATH
>>>> (and service wants all of them, as far as I understand)
>>>>
>>>> So, is there a way to do this? I'm pretty new to Python infrastructure
>>>> and perhaps miss some obvious thing.
>>>>
>>>> PS. Pinging my previous ask about PERL5LIB, which is an example of
>>>> exact this problem, but with Perl.
>>>>
>>>> https://www.mail-archive.com/nix-dev@lists.science.uu.nl/msg22577.html
>>>>
>>>> The solution I found breaks on Travis (I guess, it is of kind "import
>>>> from derivation", so it won't work generally)
>>>>
>>>> ___
>>>> 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] pypi2nix: generate full PYTHONPATH from requirements?

2016-11-05 Thread Daniel Hlynskyi
pypi2nix supports `python.withPackages`. But how should I use the created
"environment" in NixOS service?

path = [ python-env ];

doesn't work

2016-11-05 22:59 GMT+02:00 Freddy Rietdijk :

> I am not familiar with the details of pypi2nix, but try and use
> `python.withPackages` to create an environment where all packages can be
> found by the interpreter. PYTHONPATH is still used a lot, especially with
> modules, but we shouldn't be using it.
>
> http://nixos.org/nixpkgs/manual/#python
>
> On Sat, Nov 5, 2016 at 9:50 PM, Daniel Hlynskyi 
> wrote:
>
>> I'm trying to use pypi2nix-generated expression to create Kallithea
>> service.
>>
>>  systemd.services.kalithea = {
>>   after = [ "network.target" ];
>>   wantedBy = [ "multi-user.target" ];
>>   script =
>>   let ppath =
>> concatMapStringsSep ":" (x: 
>> "${x}/${python.interpreter.python.sitePackages}")
>> (let self = python.packages; in [
>>   # package
>>   self."Kallithea"
>>   # deps
>>   self."Babel"
>>   self."Beaker"
>>   self."FormEncode"
>>   self."Mako"
>>   self."Markdown"
>>   self."Pygments"
>>   self."Pylons"
>>   self."Routes"
>>   self."SQLAlchemy"
>>   self."URLObject"
>>   self."WebHelpers"
>>   self."WebOb"
>>   self."WebTest"
>>   self."Whoosh"
>>   self."celery"
>>   self."docutils"
>>   self."dulwich"
>>   self."mercurial"
>>   self."mock"
>>   self."py-bcrypt"
>>   self."python-dateutil"
>>   self."waitress"
>>   # second level deps
>>   self."MarkupSafe"
>>   self."funcsigs"
>>   self."pbr"
>>   self."six"
>>   # TODO: add all the others
>> ]);
>>   in ''
>> export PYTHONPATH=${ppath}
>> ${pythonPackages.pasteScript}/bin/paster serve
>> ${kallithea1}/etc/development.ini;
>>   '';
>> };
>>
>> So I need to feed PYTHONPATH into service, but I don't know a nice way to
>> recursively aggregate all the propagatedBuildInputs from Kallithea into
>> full PYTHONPATH
>> (and service wants all of them, as far as I understand)
>>
>> So, is there a way to do this? I'm pretty new to Python infrastructure
>> and perhaps miss some obvious thing.
>>
>> PS. Pinging my previous ask about PERL5LIB, which is an example of exact
>> this problem, but with Perl.
>>
>> https://www.mail-archive.com/nix-dev@lists.science.uu.nl/msg22577.html
>>
>> The solution I found breaks on Travis (I guess, it is of kind "import
>> from derivation", so it won't work generally)
>>
>> ___
>> 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] pypi2nix: generate full PYTHONPATH from requirements?

2016-11-05 Thread Daniel Hlynskyi
I'm trying to use pypi2nix-generated expression to create Kallithea
service.

 systemd.services.kalithea = {
  after = [ "network.target" ];
  wantedBy = [ "multi-user.target" ];
  script =
  let ppath =
concatMapStringsSep ":" (x:
"${x}/${python.interpreter.python.sitePackages}") (let self =
python.packages; in [
  # package
  self."Kallithea"
  # deps
  self."Babel"
  self."Beaker"
  self."FormEncode"
  self."Mako"
  self."Markdown"
  self."Pygments"
  self."Pylons"
  self."Routes"
  self."SQLAlchemy"
  self."URLObject"
  self."WebHelpers"
  self."WebOb"
  self."WebTest"
  self."Whoosh"
  self."celery"
  self."docutils"
  self."dulwich"
  self."mercurial"
  self."mock"
  self."py-bcrypt"
  self."python-dateutil"
  self."waitress"
  # second level deps
  self."MarkupSafe"
  self."funcsigs"
  self."pbr"
  self."six"
  # TODO: add all the others
]);
  in ''
export PYTHONPATH=${ppath}
${pythonPackages.pasteScript}/bin/paster serve
${kallithea1}/etc/development.ini;
  '';
};

So I need to feed PYTHONPATH into service, but I don't know a nice way to
recursively aggregate all the propagatedBuildInputs from Kallithea into
full PYTHONPATH
(and service wants all of them, as far as I understand)

So, is there a way to do this? I'm pretty new to Python infrastructure and
perhaps miss some obvious thing.

PS. Pinging my previous ask about PERL5LIB, which is an example of exact
this problem, but with Perl.

https://www.mail-archive.com/nix-dev@lists.science.uu.nl/msg22577.html

The solution I found breaks on Travis (I guess, it is of kind "import from
derivation", so it won't work generally)
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] So, i've bricked my remote server, but have access to hard drive

2016-10-29 Thread Daniel Hlynskyi
What are my options to unbrick it? On laptop I boot with previous
configuration, how to do that on remote?

Examples of bricks: wrong firewall rules, disabled sshd
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] QoS/AQM/shaping on NixOS

2016-10-27 Thread Daniel Hlynskyi
Hi Matthew

Such a module is welcome. I can share my configuration for debloating

https://gist.github.com/danbst/58150662994eda45443c3c9a9fbf4172

I've also experimented with original dtaht/deBloat script, but haven't got
much success with it.
The non-working result is at
https://gist.github.com/danbst/7095be258fd8475b8a966dde4dc02ee2

PS. I hadn't done tests if traffic shaping actually works

2016-10-27 19:19 GMT+03:00 Matthew Robbetts :

> Hi list,
>
> I am interested in configuring traffic shaping and AQM on my nixos
> machine; I can’t see any modules including anything like it anywhere
> (although I’m happy to be corrected, I’m just grepping through the packages
> repo for mentions of things like ‘qdisc’).
>
> 1) Have I missed something that already exists?
> 2) If not, does anyone have any pointers about the best place in the
> networking system to put it? I see there are modules in
> …/nixos/modules/services/networking/ such as firewall.nix and nat.nix.
> Would you add a new module to this directory or shoehorn it into an
> existing one (or even into modules/config/networking.nix directly)?
>
> I personally only need basic (home-oriented) routing configurations such
> as the one described at:
> https://wiki.gentoo.org/wiki/Traffic_shaping
>
> but would certainly be interested in making things as generic as possible.
> Being able to represent a qdisc tree and its configuration as a nix value
> somehow and have it Just Work would be excellent.
>
> Hints welcome!
>
> Thanks,
> Matt
>
>
>
> ___
> 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-shell and persistent environment

2016-10-02 Thread Daniel Hlynskyi
> You do this for keep things in order or because it buys you functionality?

The former. Single shell expression generates many roots:

.nix-gc-roots/dev-shell.drv ->
/nix/store/ivznvsqn40vb6vkccy092ph1ryhlq12w-nixpkgs-patched
.nix-gc-roots/dev-shell.drv-10 ->
/nix/store/4zq1535pa85wkaxlxdrp751jhznlw8ki-stdenv
.nix-gc-roots/dev-shell.drv-11 ->
/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh
.nix-gc-roots/dev-shell.drv-2 ->
/nix/store/9mcsmyj6b2f6k8527yxbbgpj7ahr3w2b-rlwrap-0.42
.nix-gc-roots/dev-shell.drv-2-doc ->
/nix/store/9z2rfwf2pl07l5qf3p2d7b4hqw9gs5h4-bash-4.3-p46-doc
.nix-gc-roots/dev-shell.drv-2-info ->
/nix/store/vd4pq9lxpihd2m86k6hckq30ky5gj2xb-bash-4.3-p46-info
.nix-gc-roots/dev-shell.drv-3 ->
/nix/store/nyj6xd7s1n1w8c0xdwk5ddhi7bjcyi9x-bash-4.3-p46
.nix-gc-roots/dev-shell.drv-3-doc ->
/nix/store/9z2rfwf2pl07l5qf3p2d7b4hqw9gs5h4-bash-4.3-p46-doc
.nix-gc-roots/dev-shell.drv-3-info ->
/nix/store/vd4pq9lxpihd2m86k6hckq30ky5gj2xb-bash-4.3-p46-info
.nix-gc-roots/dev-shell.drv-4 ->
/nix/store/p9sfacfhf35f41nqkw6pa1i8hamn5dha-sshpass-1.05
.nix-gc-roots/dev-shell.drv-5 ->
/nix/store/4kmvzlc587bmx6lbfqy171pim5za36az-sqlite-3.14.1
.nix-gc-roots/dev-shell.drv-5-bin ->
/nix/store/b38jh5lwv42985vymzx3ayj4irz638r0-sqlite-3.14.1-bin
.nix-gc-roots/dev-shell.drv-5-dev ->
/nix/store/kiixbwijnfgb3y46l3avc0rhwl9iqida-sqlite-3.14.1-dev
.nix-gc-roots/dev-shell.drv-6 ->
/nix/store/nzzdhli6j2m7bbyj1a1cq2g99mz2cwvs-jq-1.5
.nix-gc-roots/dev-shell.drv-6-bin ->
/nix/store/b38jh5lwv42985vymzx3ayj4irz638r0-sqlite-3.14.1-bin
.nix-gc-roots/dev-shell.drv-6-dev ->
/nix/store/kiixbwijnfgb3y46l3avc0rhwl9iqida-sqlite-3.14.1-dev
.nix-gc-roots/dev-shell.drv-7 ->
/nix/store/577a01ii2g1z9qflgc8w8d85ajyfvwvp-nixops-tarball-1.5pre0_abcdef
.nix-gc-roots/dev-shell.drv-8 ->
/nix/store/akbbv847pfxbi31knwypvwi7nfwcbp9m-nixops-1.5pre0_abcdef
.nix-gc-roots/dev-shell.drv-9 ->
/nix/store/w67jiazdf4xyrgs5s0rj5rdxrf92zxil-nss-cacert-3.26

btw, now I see there are duplicate entities, so I guess it is useful to
clean roots before nix-shell run.


> This is basically my experience. The method on the old wiki makes the
> environment survive `nix-channel --update` but not `nix-collect-garbage`
> which is weird because (as in the wiki) I explicitly asked for the .drv
> be a '--indirect --add-root' on $PWD.

I hope there is a way to pin src as GC root, but dumb `buildInputs = [
nixpkgsSrc ];` doesn't work.

2016-10-01 15:49 GMT+00:00 Ruben Astudillo :

> On 01/10/16 04:03, Daniel Hlynskyi wrote:
> > To complete previous answer.
> >
> > I create a separate directory .nix-gc-roots, because nix-shell produces
> > many roots.
>
> You do this for keep things in order or because it buys you functionality?
>
> > Also, I haven't found yet a way to get nix root for nixpkgs imported as
> > external derivation, so after garbage collect I still have to
> > redownload some sources
>
> This is basically my experience. The method on the old wiki makes the
> environment survive `nix-channel --update` but not `nix-collect-garbage`
> which is weird because (as in the wiki) I explicitly asked for the .drv
> be a '--indirect --add-root' on $PWD.
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] nix-shell and persistent environment

2016-10-01 Thread Daniel Hlynskyi
To complete previous answer.

I create a separate directory .nix-gc-roots, because nix-shell produces
many roots. Also, I haven't found yet a way to get nix root for nixpkgs
imported as external derivation, so after garbage collect I still have to
redownload some sources

30 вер. 2016 4:44 пп "Philipp Steinpaß"  пише:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> On Fri, Sep 30, 2016 at 10:30:27AM -0300, Ruben Astudillo wrote:
> > hi
> >
> > nix-shell is great, but when I update the nixpkgs or nix-collect-garbage
> > I lose the cache of those packages. I've thinking on do a special profile
> > that I could switch to per shell instance with nix-{shell,env}, but I
> > also found references to a deprecated buildEnv function for this. What is
> > the common alternative for this?
> >
> The old wiki has a guide for that.
> https://nixos.org/wiki/Development_Environments#
> Making_a_Persistent_nix-shell_Environment
>
> Philipp
> -BEGIN PGP SIGNATURE-
>
> iQGcBAEBCAAGBQJX7mwsAAoJENe9N53GUHbvaK4L/An67zN4X+rIdvSGGe014KcR
> ImGU4CNKE7QQectbpwXrXZaoWmD4vQHCDCTo/YchdANZmUvhvNUYAg2mjYsGlmyu
> pFont8PwT0QuObp1ngPjBb6/fFGEnqQV1gLvxvuv92THTe2pWYN2guC15c4DR/Oc
> EVvs9wr1BlMAUwTU3K0eD8/4ZGuMVZgI4TycGg3lnCp2JGziftXmrW7kluXglqKl
> e5CpiqLufPmUwd7VAPsYDEZsZ2+/1uWwZ8SsZHI9bfGxgWnUp0Yxp5cL6vm4Xu88
> cjYWhzVVPwImQfxq/scR5Xs4NR44tBiveG6Zt+H3qrzynisza6A/Kz2RyIs++OML
> pfMWSX58YvaICV/uOvzCQIjsHGLlEChdijrJUNbYMXQIIZyrJPFlHR8//Hsy//lG
> 9Z+MGpYdQtJvN3IXN2vVqITWY9OBOA02re1LQHlaA82o32tPO9vTJ99c/b7QVgPm
> m4l+6rfQEIL+1mG56Et5ftixpAY4XxlLQ2Queq41Wg==
> =sE0b
> -END PGP SIGNATURE-
> ___
> 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] 16.09 beta released

2016-09-28 Thread Daniel Hlynskyi
After switch from 16.03 to 16.09, rsync command was not available. My
deployment scripts were broken.

Also, inability to start VPN in container is a regression and show-stopper
for me.

6 вер. 2016 11:02 пп "Domen Kožar"  пише:

> Hi all,
>
> I'd like to announce NixOS 16.09 beta in the name of community.
>
> This release will bring two major changes:
>
> - multiple outputs, reducing runtime closure size (sometimes even by half)
> - security hardening flags
>
> Please upgrade channels as usual and test:
>
> $ nix-channel --add https://nixos.org/channels/nixos-16.09 nixos
> $ nixos-rebuild switch --upgrade
>
> I'd like to point out two serious bugs that you might hit:
>
> - dbus will fail to reload, see https://github.com/NixOS/
> nixpkgs/issues/18358
> - make sure /var/empty doesn't have write permissions set otherwise sshd
> won't start, see https://github.com/NixOS/nixpkgs/pull/18365
>
> If you'd like to help out, test and check the github bug tracker under
> 16.09 milestone.
>
> As usual, we're working on getting build failures down:
> https://github.com/NixOS/nixpkgs/issues/18209
>
> Final is set to be release on 29th September.
>
> I've also finally put together a PR that documents the release process,
> any feeback is welcome (it's still far from perfect):
> https://github.com/NixOS/nixpkgs/pull/18062
>
> PS: 16.09-small channel will be also created once container tests are fixed
>
> Domen
>
> ___
> 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] Setuid wrapper for bash script

2016-09-15 Thread Daniel Hlynskyi
Actually, I found a way to do what I need without setuid and sudoers, just
polkit rules

let
  restartScript = pkgs.writeScriptBin "defenders" ''
#!${pkgs.bash}/bin/bash
[[ -z "$1" ]] && echo Specify operation: start, stop, restart, status
&& exit 0
systemctl "$1" defenders.service
  '';

  allowService = service: group: ''
polkit.addRule(function(action, subject) {
  if (action.id == "org.freedesktop.systemd1.manage-units") {
if (action.lookup("unit") == "${service}.service"
  && subject.isInGroup("${group}")) {
var verb = action.lookup("verb");
if (verb == "start" || verb == "stop" || verb == "restart" ||
verb == "status") {
return polkit.Result.YES;
}
}
  }
});
  '';

in {
  users.groups.defenders_grp = { };

  environment.systemPackages = [
restartScript
  ];

  security.polkit.extraConfig = ''
${allowService "defenders" "defenders_grp"}
  '';
}


2016-09-15 11:46 GMT+00:00 Roger Qiu :

>
> IRC discussion shows that NixOS doesn't have the ability to specify custom
> action files atm. The only way is through a package. So for now you might
> be stuck until this functionality arrives. Only rule files can be specified.
> --
>
> 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


Re: [Nix-dev] GitHub Octoverse 2016: nixpkgs #6 in Repositories with the most users reviewing code

2016-09-15 Thread Daniel Hlynskyi
Who are those "reviewing users"? I didn't know about such github role.

15 вер. 2016 11:25 дп "Nathan Bijnens"  пише:

> https://octoverse.github.com/
>
> As a community we can be very prood. Congratulations to the whole
> community, especially to some of the most active members.
>
> Nathan
>
>
>
> ___
> 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] Setuid wrapper for bash script

2016-09-14 Thread Daniel Hlynskyi
> You probably need to use "bash -p", otherwise bash will drop its root
privileges
> on startup.

Thanks, that's it

> Shell scripts cannot be setuid:
> http://stackoverflow.com/questions/18698976/suid-not-
working-with-shell-script

Thanks! Actually, I really missed the case when user could alter PATH with
custom `systemctl` and execute arbitrary code.

  restartScript = pkgs.writeScriptBin "defenders" ''
#!${pkgs.bash}/bin/bash -p
[[ -z "$1" ]] && echo Specify operation: start, stop, restart, status
&& exit 1
${pkgs.systemd}/bin/systemctl "$1" defenders.service
  '';

Still, I'm not sure whether I've done it right, maybe better would be to su
as root and clear shell variables?

> Hi. You could also consider writing a polkit rule or using sudo.

Probably you're right, I don't know how to restrict script execution to
specific group with setuid/setgid...

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


[Nix-dev] Setuid wrapper for bash script

2016-09-14 Thread Daniel Hlynskyi
Hi. I want to allow some user to restart systemd service. I found that
setuid wrappers should be used for this task. Here is what I've written:

  environment.systemPackages = [
(pkgs.writeScriptBin "restart-defenders" ''
#!${pkgs.bash}/bin/bash
systemctl restart defenders.service
 '')
  ];

  security.setuidPrograms = [ "restart-defenders" ];

File was created

# ls -la /var/setuid-wrappers/restart-defenders
-r-s--x--x 1 root root 12856 Sep 14 17:17
/var/setuid-wrappers/restart-defenders

But when running as normal user I get

$ restart-defenders
 AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'defenders.service'.
Multiple identities can be used for authentication:
 1.  System administrator (root)
 2: ...

What am I doing wrong?
___
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-05 Thread Daniel Hlynskyi
I am switching manual deployment to NixOps, and I'm getting lots of quirks
in hetzner, virtualbox, libvirtd and container backends.

Also, because of impurities in my systems, I can't switch easy from
production to, for example, virtualbox deployment.

So no success story here, but I like this tool and hope to improve it.

5 вер. 2016 7:01 пп "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


Re: [Nix-dev] Unwanted, unannounced reboot

2016-08-30 Thread Daniel Hlynskyi
Can this be hw problem, like overheat?

30 серп. 2016 3:31 пп "Matthias Beyer"  пише:

> Hi,
>
> this is the third time I got a unwanted, unannounced reboot of my
> Thinkpad X220. The device just went off and rebooted.
>
> My logs:
>
> Aug 30 13:16:23 yuu audit[27536]: SECCOMP auid=1000 uid=1000 gid=100
> ses=1 pid=27536 comm="chromium" exe="/nix/store/
> 28b56yiqshs8kvnha23vvwp0m4rlyyis-chromium-52.0.2743.116/libexec/chromium/chromium"
> sig=0 arch=c03e syscal
> Aug 30 13:16:23 yuu audit[27537]: SECCOMP auid=1000 uid=1000 gid=100
> ses=1 pid=27537 comm="chromium" exe="/nix/store/
> 28b56yiqshs8kvnha23vvwp0m4rlyyis-chromium-52.0.2743.116/libexec/chromium/chromium"
> sig=0 arch=c03e syscal
> Aug 30 13:16:23 yuu audit[27539]: SECCOMP auid=1000 uid=1000 gid=100
> ses=1 pid=27539 comm="chromium" exe="/nix/store/
> 28b56yiqshs8kvnha23vvwp0m4rlyyis-chromium-52.0.2743.116/libexec/chromium/chromium"
> sig=0 arch=c03e syscal
> Aug 30 13:16:23 yuu audit[27538]: SECCOMP auid=1000 uid=1000 gid=100
> ses=1 pid=27538 comm="chromium" exe="/nix/store/
> 28b56yiqshs8kvnha23vvwp0m4rlyyis-chromium-52.0.2743.116/libexec/chromium/chromium"
> sig=0 arch=c03e syscal
> Aug 30 13:16:23 yuu kernel: audit: type=1326
> audit(1472555783.141:55627): auid=1000 uid=1000 gid=100 ses=1 pid=27539
> comm="chromium" exe="/nix/store/28b56yiqshs8kvnha23vvwp0m4rlyy
> is-chromium-52.0.2743.116/libexec/chromium/chro
> Aug 30 13:16:23 yuu kernel: audit: type=1326
> audit(1472555783.141:55628): auid=1000 uid=1000 gid=100 ses=1 pid=27538
> comm="chromium" exe="/nix/store/28b56yiqshs8kvnha23vvwp0m4rlyy
> is-chromium-52.0.2743.116/libexec/chromium/chro
> -- Reboot --
> Aug 30 14:17:20 yuu systemd-journald[570]: Runtime journal
> (/run/log/journal/) is 8.0M, max 398.4M, 390.4M free.
> Aug 30 14:17:21 yuu systemd-journald[570]: System journal
> (/var/log/journal/) is 1.9G, max 4.0G, 2.0G free.
> Aug 30 14:17:21 yuu systemd-journald[570]: Time spent on flushing to
> /var is 1.345ms for 2 entries.
> Aug 30 14:17:21 yuu kernel: Linux version 4.7.0 (nixbld@localhost)
> (gcc version 5.4.0 (GCC) ) #1-NixOS SMP Sun Jul 24 19:23:50 UTC 2016
>
> So, as you can see, there is no shutdown process (stopping processes,
> closing journal, etc).
>
> What is this? How does this happen?
>
> --
> 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] typed nix

2016-08-29 Thread Daniel Hlynskyi
Dynamic attributes make exact typing hard. Perhaps Nix will adopt the
gradually typed approach in a future.

https://en.wikipedia.org/wiki/Gradual_typing#Examples

But would that be worth of it?

2016-08-29 21:47 GMT+00:00 stewart mackenzie :

> per chance, is there work underway to make nix a typed language?
>
> kr/sjm
> ___
> 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] Including "beta" or "unstable" identifiers in package names?

2016-08-29 Thread Daniel Hlynskyi
Another solution is to abandon parsing of derivation name and include
"meta" to derivation. Then the name and version representations can be
included as meta.name and meta.version in whichever format is liked by
maintainer.

mkDerivation can do name = "${meta.name}-${meta.version}" itself.

Meta should be saved in DB or .drv files.

How much should be done in Nix to allow this?

2016-08-30 0:58 GMT+00:00 stewart mackenzie :

> Trying to understand your email:
>
> in development/compilers/rust
>
> beta.nix:
> current behaviour: the name "beta" is already part of the version ->
> see "shortVersion"
> "...
>   rustc = callPackage ./rustc.nix {
> shortVersion = "beta-2016-08-17";
> ..."
> https://github.com/NixOS/nixpkgs/blob/master/pkgs/
> development/compilers/rust/beta.nix#L5-L6
>
> in head.nix
> current behaviour: the name "master" is already part of the version ->
> see "shortVersion"
> "...
>   rustc = callPackage ./rustc.nix {
> shortVersion = "master-1.13.0";
> ..."
>
> https://github.com/NixOS/nixpkgs/blob/master/pkgs/
> development/compilers/rust/head.nix#L5-L6
>
> I don't understand: "IMO the 'beta' and 'master' is part of the
> version, not the package name, and so if it exists at all it should be
> part of the version string;" as it quite clearly is part of the
> "shortVersion"
> ___
> 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 stores

2016-08-26 Thread Daniel Hlynskyi
Why LVM is expensive? I'd like to know because I often mount /nix/store on
log. vvolum.

26 серп. 2016 3:51 пп "Freddy Rietdijk"  пише:

> Hi,
>
> I would like to use Nix for a certain data analysis where I will have
> several thousand files which are all together about two TB in size. At the
> moment NixOS is installed on a SSD which is a quarter that size. Would it
> be possible to install a second store elsewhere, in this case on a slower
> HDD?
>
> I couldn't find anything about this so I guess it isn't possible. Do you
> have in that case any other suggestions? I suppose the most obvious
> solution would be to install Nix on the slower HDD. Using LVM with multiple
> SSD's gets a bit too expensive.
>
> How does Nix perform on a HDD?
>
> Freddy
>
>
>
> ___
> 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] Override virtualbox

2016-08-24 Thread Daniel Hlynskyi
I know about nixpkgs.config.packageOverrides, but I cannot override
virtualbox with it. Given

nixpkgs.config.packageOverrides = sup_: {
  linuxPackages.virtualbox =
sup_.linuxPackages.virtualbox.override { headless = true; };
};
virtualisation.virtualbox.host.enable = true;

I get error in nixops deploy:

  error: attribute ‘kernel’ missing, at
/home/danbst/nixpkgs/nixos/modules/services/logging/klogd.nix:12:42
  (use ‘--show-trace’ to show detailed location information)

Without override it evaluates OK.

What am I doing wrong?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] changing the default source epoch to be zip-safe

2016-08-20 Thread Daniel Hlynskyi
still, why 1.1.1970? One of @edolstra's commits introduced algorithm, that
sets source epoch time to most recent source change date. Wouldn't that be
better date for /nix/store? Currently datetime in /nix/store carries zero
information.

Also, I'd like to notice that non-epoch-starttime files do exist in my
store, probably created in nix-shell or nix-build:

[danbst@LX:~]$ ls -ld /nix/store/* | grep -v "Jan  1  1970"
drwxr-xr-x  3 nixbld1 nixbld  4096 Aug  5 23:26
/nix/store/7iv1251a6g03m5jjqazd5rfmbqsz67nc-nixos-shell
drwxr-xr-x  6 rootroot4096 Aug  8 05:03
/nix/store/pb6papnlgg62wkim7qsg8c2jw4izffx8-glibc-2.21
-rw---  1 rootroot   0 Aug  4 22:29
/nix/store/30q3vgn6p6abfz4xbs47v11wcikf9dqr-plasma-desktop-5.7.2.lock
-rw---  1 rootroot   0 Aug  1 06:03
/nix/store/59cp809rmyh12p800sln490yr0f93nx7-four-color-theorem-proof.lock
-rw---  1 rootroot   0 Aug  5 23:26
/nix/store/7iv1251a6g03m5jjqazd5rfmbqsz67nc-nixos-shell.lock
-rw---  1 rootroot   0 Aug  4 00:15
/nix/store/jv2drjhj8h0blz4lza6xsnraalsvhaf9-munin-2.999.2.lock
-rw---  1 rootroot   0 Aug  4 22:29
/nix/store/jxkj59ppkpna1xlmpjzdbxqzw49gbgif-plasma-desktop-5.7.2-dev.lock
-rw---  1 rootroot   0 Aug  8 05:03
/nix/store/pb6papnlgg62wkim7qsg8c2jw4izffx8-glibc-2.21.lock
-rw---  1 rootroot   0 Jul 31 23:24
/nix/store/v07q9f5k730czvabfzilnsnahdbk19hx-four-color-theorem-src.lock
-rw---  1 rootroot   0 Aug  4 21:58
/nix/store/vfgv4b1rgm1hkamqczmyals8s66gvq8k-ati-drivers-15.12-4.4.16.lock
-rw---  1 rootroot   0 Aug  9 03:47
/nix/store/y9asyqxygq39lkmc98cmbqsja5yynwd0-ruby-2.3.1-p0.lock
-rw---  1 rootroot   0 Aug  1 00:20
/nix/store/zlpqh99xfxqvwcwzj0hly2d07x84whz9-coq-8.3pl4.lock


2016-08-20 12:11 GMT+00:00 Vladimír Čunát :

> On 08/14/2016 04:13 PM, Ronny Pfannschmidt wrote:
> > on nix it is a regular problem for me that zip file generating tools fail
> > due to the epoch time being set to a time that's not supported in the
> > zip format
> > (mostly python wheels)
> >
> > i would like to propose setting that epoch by default to something that
> > is supported by zip
>
> We discussed that zip problems aren't that bad to change timestamps of
> /nix/store paths directly (1.1. 1970).
>
> For python and similar we have a hook that touches source files after
> "unpacking" phase - the typical problem is after fetch* other than
> fetchurl. Typical usage:
>   buildInputs = [ (ensureNewerSourcesHook { year = "1980"; }) ]
>
> Note that our generic python builder already does use the hook
> automatically.
>
> --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] How to install specific version of a package?

2016-08-12 Thread Daniel Hlynskyi
Nix allows you to have multiple versions of one package, but each version
can require it's specific build recipe.

nixpkgs - is a place for latest versions of packages, and, pragmatically,
for most used non-latest versions. The place for all packages of all
versions is currently vacant.

Given this, I can think of several ways to get non-latest version of
package in Nix:

- already mentioned install from binary cache
- install from specific checkout of nixpkgs (
http://edwtjo.me/posts/2016-04-24-installing-older-pkgs-in-nixos/ and
https://www.reddit.com/r/NixOS/comments/4itnth/installing_older_pkgs_in_nixos/d328l1v
)
- install from overriden expression. This is the most unstable way, because
many packages do require changes to recipe. But for certain simple kinds of
packages it can be automated.

Given the following oldversion.nix:

{ pkg, version }:
let
  pkgs = import  {};
  inherit (builtins) trace;
  inherit (pkgs) lib;
  traceSeq = x: y: trace (builtins.deepSeq x x) y;
  oldversion = package: version:
let getVersion = name: lib.last (lib.splitString "-" name);
in package.overrideDerivation (super: {
  name = super.name + "-oldversion-" + version;
  inherit version;
  src =
let upstreamUrls = super.src.urls;
patchedUrls = map (x: builtins.replaceStrings [(getVersion
super.name)] [version] x) upstreamUrls;
in pkgs.fetchurl { urls = patchedUrls; sha256 = null; sha512 =
null; md5 = null; sha1 = null; };
});
in oldversion pkg version

you can install different versions of same package with the following
monstruous command:

danbst@iron ~/oldversion$
$ nix-env -f oldversion.nix --arg pkg "with import {}; siege"
--argstr version "3.0.3" --install
replacing old ‘siege-3.0.8-oldversion-3.0.3’
installing ‘siege-3.0.8-oldversion-3.0.3’

danbst@iron ~/oldversion$
$ nix-env -f oldversion.nix --arg pkg "with import {}; siege"
--argstr version "4.0.2" --install
replacing old ‘siege-3.0.8-oldversion-3.0.3’
installing ‘siege-3.0.8-oldversion-4.0.2’


2016-08-12 20:06 GMT+00:00 Nick Sabalausky :

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


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

2016-08-09 Thread Daniel Hlynskyi
Is this intentional? I'm writing a service and want to know whether to do
like nginx or use /etc for configs.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Nix GUI? / make Nix more beginner-friendly

2016-08-05 Thread Daniel Hlynskyi
Hey Roland, can you tell which package manager GUI do you like best?

I'm addicted to command line interface because
- want to do nix-instantiate, nixos-rebuild, nix-build and nix-shell.
Nix-env -i is the rarest of my tools
- it works even If X is unavailable (remote, broken X)
That's also a reason why I hardly will use GUI variant.

But I agree that some graphical Nix Explorer would be better than nix-store
--query and nix-env --query.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] infinite recursion on newer nixpkgs

2016-08-05 Thread Daniel Hlynskyi
Perhaps not a direct answer, but why do you use mkIf? If postgresql isn't
enabled, it won't run your script, whatever it is

4 серп. 2016 9:52 пп "Sergey Mironov"  пише:

> Hi.
> I've updated my nixpkgs up to 8983df7 and faced an infinite recursion
> on the following peace of config:
>
>   services = pkgs.lib.mkIf config.services.postgresql.enable {
> postgresql.initialScript = pkgs.writeText "postgreinit.sql" ''
>   create role grwlf superuser login createdb createrole replication;
>   '';
>   };
>
> It worked with previous versions, what would you recommend me to do?
>
> Regards,
> Sergey
> ___
> 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 Daniel Hlynskyi
I can be mistaken, but nix-env dash-splits name to get name without
version, and uses it to upgrade or sideinstall into environment. This works
bad for python, because python34 and python35 are separate expressions,
treated as one in nix-env.

You can override the name of package in .nixpkgs/config.nix for a
workaround, but i guess you want nix-shell in this case.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] duplicate packages?

2016-08-04 Thread Daniel Hlynskyi
Ah, you are not on NixOS, so collect garbage without sudo

4 серп. 2016 2:35 пп "Daniel Hlynskyi"  пише:

> Have you run sudo nix-collect-garbage -d ? Even If yes, you still have to
> check all gc roots to belong to system, and not to side nix-builds
>
> 4 серп. 2016 11:58 дп "Roland Koebler" 
> пише:
>
>> Hi,
>>
>> I have Nix running on Debian with the default channel [*], and I noticed,
>> that -- although I only have a few packages installed -- many dependencies
>> are installed several times. I would like to understand, why.
>>
>> [*] https://nixos.org/channels/nixpkgs-unstable nixpkgs
>>
>>
>> 1. Many packages are installed several times with the same version
>>number, e.g.:
>>
>>2pa9z1h2m0pyik4hr1ikfl6jvdg8j4pb-acl-2.2.52
>>8c5s33f5mzfn9z3yhjprxnxzl19dg7p2-acl-2.2.52
>>sk0b1r840b686zc2m8mzyw8yyq1aymqh-acl-2.2.52
>>
>>4vgjwvgf24jl3czzksai6mwsklvhgs4k-attr-2.4.47
>>8z667vv1agvpd3iknmk94j0ix6bv413i-attr-2.4.47
>>m8qi9jrz51lqn7x0mifa9kpwpsp3b7dq-attr-2.4.47
>>
>>fxkm8r0vpv88ld82jz0a00sjvh342wfl-avahi-0.6.31
>>p817p19niamk0f06r5wvqvdqnym96r7w-avahi-0.6.31
>>5wi7ja71s4wdjkzfghc4lkwrwc45fnf9-avahi-0.6.32
>>
>>d20f169ryps7ds2qak0r5n1f4hhxr80h-bash-4.3-p42
>>d44582rghk696yw704sh5nbvbpnm69iv-bash-4.3-p42
>>xag5ayq906w9zhlxs8wayv4kvpiyqphq-bash-4.3-p42
>>
>>0y480sh5b4hny3iq8fy3ppha0zllxxaw-boehm-gc-7.2f
>>bw1p8rairfwv2yif2g1cc0yg8hv25mnl-boehm-gc-7.2f
>>f24zx1r39kalz01q9kw7zcg1ngj7w2db-boehm-gc-7.2f
>>
>>98s2znxww6x7h2ch7cj1w5givahxmdna-glibc-2.23
>>phffgv3pwihmpdyk8xsz3wv8ydysch8w-glibc-2.23
>>
>>...
>>
>>I know that different build-inputs result in different hashes, but I
>>would have expected a more homogeneous structure in nixpkgs (e.g.
>>only one acl-2.2.52 in nixpkgs and not several ones), so that
>>I don't need e.g. 3 times acl-2.2.52 or bash-4.3-p42.
>>
>>Is this because I use nixpkgs-unstable, and everything is moving
>>there, and is this reduced in the NixOS-release-channels?
>>Or is there some other reason?
>>
>> 2. Is there a way to clean this up?
>>Either in the repository or locally?
>>Or is there a reason why this should not be cleaned up?
>>
>> 3. Is there a simple way to find the nix-expression (e.g.
>>default.nix-file) of an installed package / a path in
>>the nix-store?
>>And is there a way to know which directory in the nix-store
>>belongs to which .drv-file?
>>
>>
>> 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] duplicate packages?

2016-08-04 Thread Daniel Hlynskyi
Have you run sudo nix-collect-garbage -d ? Even If yes, you still have to
check all gc roots to belong to system, and not to side nix-builds

4 серп. 2016 11:58 дп "Roland Koebler"  пише:

> Hi,
>
> I have Nix running on Debian with the default channel [*], and I noticed,
> that -- although I only have a few packages installed -- many dependencies
> are installed several times. I would like to understand, why.
>
> [*] https://nixos.org/channels/nixpkgs-unstable nixpkgs
>
>
> 1. Many packages are installed several times with the same version
>number, e.g.:
>
>2pa9z1h2m0pyik4hr1ikfl6jvdg8j4pb-acl-2.2.52
>8c5s33f5mzfn9z3yhjprxnxzl19dg7p2-acl-2.2.52
>sk0b1r840b686zc2m8mzyw8yyq1aymqh-acl-2.2.52
>
>4vgjwvgf24jl3czzksai6mwsklvhgs4k-attr-2.4.47
>8z667vv1agvpd3iknmk94j0ix6bv413i-attr-2.4.47
>m8qi9jrz51lqn7x0mifa9kpwpsp3b7dq-attr-2.4.47
>
>fxkm8r0vpv88ld82jz0a00sjvh342wfl-avahi-0.6.31
>p817p19niamk0f06r5wvqvdqnym96r7w-avahi-0.6.31
>5wi7ja71s4wdjkzfghc4lkwrwc45fnf9-avahi-0.6.32
>
>d20f169ryps7ds2qak0r5n1f4hhxr80h-bash-4.3-p42
>d44582rghk696yw704sh5nbvbpnm69iv-bash-4.3-p42
>xag5ayq906w9zhlxs8wayv4kvpiyqphq-bash-4.3-p42
>
>0y480sh5b4hny3iq8fy3ppha0zllxxaw-boehm-gc-7.2f
>bw1p8rairfwv2yif2g1cc0yg8hv25mnl-boehm-gc-7.2f
>f24zx1r39kalz01q9kw7zcg1ngj7w2db-boehm-gc-7.2f
>
>98s2znxww6x7h2ch7cj1w5givahxmdna-glibc-2.23
>phffgv3pwihmpdyk8xsz3wv8ydysch8w-glibc-2.23
>
>...
>
>I know that different build-inputs result in different hashes, but I
>would have expected a more homogeneous structure in nixpkgs (e.g.
>only one acl-2.2.52 in nixpkgs and not several ones), so that
>I don't need e.g. 3 times acl-2.2.52 or bash-4.3-p42.
>
>Is this because I use nixpkgs-unstable, and everything is moving
>there, and is this reduced in the NixOS-release-channels?
>Or is there some other reason?
>
> 2. Is there a way to clean this up?
>Either in the repository or locally?
>Or is there a reason why this should not be cleaned up?
>
> 3. Is there a simple way to find the nix-expression (e.g.
>default.nix-file) of an installed package / a path in
>the nix-store?
>And is there a way to know which directory in the nix-store
>belongs to which .drv-file?
>
>
> 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] PERL5LIB and lib.makePerlPath

2016-08-03 Thread Daniel Hlynskyi
So, I found a hackish solution. Just create a new derivation with PERL5LIB
as it's output

# perl5lib.nix
packages:
  let pkgs = import  {};
in builtins.readFile (builtins.toString (pkgs.stdenv.mkDerivation {
  name = "PERL5LIB";
  buildInputs = [pkgs.perl] ++ packages;
  buildCommand = "echo $PERL5LIB > $out";
}))

$ nix-instantiate --read-write-mode --eval -E 'with import {};
(import ./perl5lib.nix) [perlPackages.DBDPg]'
"/nix/store/...-perl-5.22.1/lib/perl5/site_perl:/nix/store/...-perl-DBD-Pg-3.5.3/lib/perl5/site_perl:/nix/store/...-perl-DBI-1.634/lib/perl5/site_perl\n"

It looks to me I'm reinventing a wheel...


2016-08-02 13:39 GMT+03:00 Daniel Hlynskyi :

> Hi. There is a function lib.makePerlPath
>
> $ nix-instantiate --eval -E 'with import {}; lib.makePerlPath
> [perlPackages.DBDPg]'
> "/nix/store/...-perl-DBD-Pg-3.5.3/lib/perl5/site_perl"
>
> I want a similar function, which includes deps too (for wrapper)
>
> $ nix-instantiate --eval -E 'with import {}; lib.makeFullPerlPath
> [perlPackages.DBDPg]'
>
> "/nix/store/...-perl-DBD-Pg-3.5.3/lib/perl5/site_perl:/nix/store/...-perl-DBI-1.634/lib/perl5/site_perl"
>
> Has anybody done this already?
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] PERL5LIB and lib.makePerlPath

2016-08-02 Thread Daniel Hlynskyi
Hi. There is a function lib.makePerlPath

$ nix-instantiate --eval -E 'with import {}; lib.makePerlPath
[perlPackages.DBDPg]'
"/nix/store/...-perl-DBD-Pg-3.5.3/lib/perl5/site_perl"

I want a similar function, which includes deps too (for wrapper)

$ nix-instantiate --eval -E 'with import {}; lib.makeFullPerlPath
[perlPackages.DBDPg]'
"/nix/store/...-perl-DBD-Pg-3.5.3/lib/perl5/site_perl:/nix/store/...-perl-DBI-1.634/lib/perl5/site_perl"

Has anybody done this already?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] grsecurity on Nix

2016-08-01 Thread Daniel Hlynskyi
Actually, there was a nice addition recently

https://nixos.org/releases/nixos/unstable/nixos-16.09pre87733.dbd856d/manual/index.html#sec-grsecurity

Just do

security.grsecurity.enable = true;

if you follow unstable

2016-08-01 19:51 GMT+00:00 Matthew Robbetts :

> Hi Nixers,
>
> I’m interested in setting up grsecurity/PaX protections on my nix machine.
> My googling led me quickly to:
> https://nixos.org/wiki/Hardened_NixOS
>
> which makes perfect sense. I’m coming from Gentoo anyway, and the Hardened
> project there is familiar to me. The instructions there (basically add
> kernel options) have also worked just fine (at least, they have affected
> the outcome from running paxtest).
>
> However, I then noticed the existence of
> nixos/modules/security/grsecurity.nix, which appears to me to automate
> some of this, but is not mentioned at all on the wiki. Is this module the
> preferred way to enable grsecurity, and the wiki just needs updating?
>
>
> Ta,
> Matt
>
> ___
> 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] evalModules: how to use it?

2016-07-31 Thread Daniel Hlynskyi
The advice from Bjorn was correct, but there is a bug in containers code.
Many thanks to @layus for investigating into this problem!

PR with fix https://github.com/NixOS/nixpkgs/pull/17365



2016-07-07 7:47 GMT+00:00 Daniel Hlynskyi :

> Unfortunately, I don't understand how can apply mkMerge here. Is the
> following example correct?
>
>   containers.test-1.config =
>
> let cfg1 = {
>
>   networking.extraHosts = ''
>
> 10.10.10.10 bla1
>
>   '';
>
> };
>
> cfg2 = {
>
>   networking.extraHosts = ''
>
> 11.11.11.11 bla2
>
>   '';
>
> };
>
>   in lib.mkMerge [
>
> cfg1
>
> cfg2
>
>   ];
>
> It doesn't do what I want:
>
> $ sudo nixos-container run test-1 -- cat /etc/hosts
> 127.0.0.1 localhost
> ::1 localhost
>
> 11.11.11.11 bla2
>
> Maybe I should reference somehow to base modules?
>
> 6 лип. 2016 7:13 пп "Bjørn Forsman"  пише:
>
>>
>> Maybe what you want is lib.mkMerge?
>>
>> - Bjørn
>>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Hydra is down

2016-07-30 Thread Daniel Hlynskyi
https://hydra.nixos.org/ returns 500 Internal Server Error
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] A few beginner issues

2016-07-29 Thread Daniel Hlynskyi
Try setting services.xserver.resolutions. If that doesn't workflow, then it
is probably a bug
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] coerce a list of strings

2016-07-26 Thread Daniel Hlynskyi
lib.concatStringsSep "\n"

Google "Nixpkgs strings" for definition and documentation

27 лип. 2016 12:30 дп "Stefan Huchler"  пише:

> I wanted to shorten my configuration file a bit.
> I have a long configuration for flexget with entries like that:
>
>
>   yt_tech-talk-today:
> rss: http://feedpress.me/t3mob
> template: youtube
>
>
> I can replace that with such let statement:
>
>   ${let
>   makeFeed = { name, url}:
>   { x = "  yt_$name:\n   rss: $url\ntemplate: youtube";}.x;
> in makeFeed
>   { name = "tech-talk-today"; url = "http://feedpress.me/t3mob";; }
>   }
>
> but now I wanted to use the map function to map more than one entry like
> that:
>
>   ${let
>   makeFeed = { name, url}:
>   { x = "  yt_$name:\n   rss: $url\ntemplate: youtube";}.x;
> in map makeFeed
>   [ { name = "tech-talk-today"; url = "http://feedpress.me/t3mob";; }]
>   }
>
> which did not work cause it generates a list of strings what it cant
> "coerce" to a string:
>
> error: cannot coerce a list to a string
>
> Now I thought there is maybe some sort of concat function or merge
> function to build out of this list ONE stirng so it works.
>
> Either this api is very limited or not very well documented, some github
> nix packages seem to imply or list a concat function, but it seems to
> not work or I dont understand this language very well.
>
> wrapping that in a ${concat { let... } at least seems to not work, any
> suggestions?
>
>
> ___
> 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] Skillset labels

2016-07-23 Thread Daniel Hlynskyi
* containers
* virtualization
* nixos tests
* module system
* java

23 лип. 2016 12:50 пп "Wout Mertens"  пише:

> To better triage issues, it would be good to have labels that indicate the
> skillset needed to work the issue. Here's a preliminary list, what is
> missing?
>
>
>- shell
>- javascript
>- python
>- haskell
>- ruby
>- erlang
>- c/c++
>- vim
>- emacs
>- build toolchain
>- darwin toolchain
>- systemd config
>- nixos core
>- non-nixos install
>
> Yes I said non-nixos is not a skillset, but it turns out it is :) I wish
> the labels had extra descriptions.
>
> ___
> 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] Project environment setup

2016-07-18 Thread Daniel Hlynskyi
Looks like gradle25 package doesn't follow nixpkgs conventions here. It has
no `.override` attribute, which, as I remember, is added by `callPackage`
function.
I think this is a bug, but there is a workaround:

```
# shell.nix

{ pkgs ? import  {} }:
let
  mygradle = (pkgs.gradleGen.override {
jdk = pkgs.openjdk8;
  }).gradle25;
in pkgs.stdenv.mkDerivation {
name = "myproject";
buildInputs = [ mygradle ];
}
```

You didn't want `.overrideDerivation` here, I think, just `.override`.

2016-07-19 3:53 GMT+03:00 Ryan Eckbo :

> I've been reading the docs and blog posts but I'm still unsure on the
> proper
> way to configure a local shell.nix with my required modified packages.
> Specifically, I need gradle built with jdk 8, something like
>
>pkgs.gradle25.override { jdk = pkgs.openjdk8; }
>
> and I also have some local nix expressions. But I only want this for one
> project (so no
> setting of .nixpkgs/config.nix).  Can someone point me in the right
> direction?
>
> Thanks!
> Ryan
>
> ___
> 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-shell does not work???

2016-07-17 Thread Daniel Hlynskyi
Perhaps shell exits too soon. One way to do it explicitly, is adding

   [[ -n "$IN_NIX_SHELL" ]] && exit

to the top of your's ~/.bashrc, just like Bjorn said

2016-07-17 17:45 GMT+03:00 Matthias Beyer :

> I just verified this:
>
> echo $PATH | sha1sum
> a439474de411c2baec5dc5fad9d9c11180c7558b
>
> nix-shell -p beancount # a program I do not have installed... it
> # gets downloaded after I called this...
>
> echo $PATH | sha1sum
> a439474de411c2baec5dc5fad9d9c11180c7558b
>
> Of course, beancount is not in scope after calling nix-shell.
>
> This is on:
>
> * System: 16.09pre85931.125 (Flounder)
> * Nix version: nix-env (Nix) 1.11.2
> * Nixpkgs version: "16.09pre85931.125"
>
> Should I submit this to nix/nixpkgs?
>
> On 11-07-2016 12:58:47, Matthias Beyer wrote:
> > Nope, this is on nixos with nixos-unstable channel.
> >
> > On 11-07-2016 11:53:26, Bjørn Forsman wrote:
> > > On Jul 11, 2016 11:26, "Matthias Beyer"  wrote:
> > > >
> > > > Hi,
> > > >
> > > > I'm on nixos unstable channel. I just did
> > > >
> > > > nix-shell -p calcurse
> > > >
> > > > it gives me a shell (though it keeps my prompt and doesn't override
> it
> > > > as I would expect with nix-shell)
> > > >
> > > > and calcurse is not available in the shell.
> > > >
> > > > Did I just ran into a bug with nix-shell?
> > >
> > > Is this on non-NixOS? I think I saw something about that in the nix
> issue
> > > tracker. Some host bashrc file is sourced and breaks nix-shell.
> > >
> > > - Bjørn
> >
> > --
> > Mit freundlichen Grüßen,
> > Kind regards,
> > Matthias Beyer
> >
> > Proudly sent with mutt.
> > Happily signed with gnupg.
>
>
>
> --
> 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] evalModules: how to use it?

2016-07-07 Thread Daniel Hlynskyi
Unfortunately, I don't understand how can apply mkMerge here. Is the
following example correct?

  containers.test-1.config =

let cfg1 = {

  networking.extraHosts = ''

10.10.10.10 bla1

  '';

};

cfg2 = {

  networking.extraHosts = ''

11.11.11.11 bla2

  '';

};

  in lib.mkMerge [

cfg1

cfg2

  ];

It doesn't do what I want:

$ sudo nixos-container run test-1 -- cat /etc/hosts
127.0.0.1 localhost
::1 localhost

11.11.11.11 bla2

Maybe I should reference somehow to base modules?

6 лип. 2016 7:13 пп "Bjørn Forsman"  пише:

>
> Maybe what you want is lib.mkMerge?
>
> - Bjørn
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] evalModules: how to use it?

2016-07-06 Thread Daniel Hlynskyi
Hi. I have a container generator:

mkContainer =
{ config, lib
, additionalConfig ? {}
}:
let
  containerParams =
   { autoStart = true;
   };
in
containerParams //
{ config = { config, pkgs, lib, ... }:
  { imports = [
  
  
  
];

networking.firewall.enable = false;
  } // additionalConfig;
}

And I have a container

containers.test = mkContainer { inherit config lib;
  additionalConfig = {
networking.firewall.enable = lib.mkForce true;
  };
};

But this is wrong - I can't just // two configurations. AFAIU there is
lib.evalModules function. How can I use to implement custom overrides?
My mind is already blowned with it's implementation and dozens of different
ways to use it are tried with no success.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] On a sad state of declarative containers management

2016-07-06 Thread Daniel Hlynskyi
I've collected the list of issues with containers.

Go through this list before starting using them. Declarative containers are
good, but be prepared

=

Bidirectional container access -
https://github.com/NixOS/nixpkgs/issues/16754

Container interface is not removed when declarative container is removed -
https://github.com/NixOS/nixpkgs/issues/16330

nixos-container doesn't have restart subcommand -
https://github.com/NixOS/nixpkgs/issues/16753

Error message showed in `nixos-container run` -
https://github.com/NixOS/nixpkgs/issues/16639

`/etc/resolv.conf` generation broken in systemd containers -
https://github.com/NixOS/nixpkgs/issues/15164

nixos-container.pl has overly strict sanity checks -
https://github.com/NixOS/nixpkgs/issues/15089

Container does not start after switching to 16.03 -
https://github.com/NixOS/nixpkgs/issues/14381

ip-up.target won't be activated in nixos-containers -
https://github.com/NixOS/nixpkgs/issues/14314

containers with extraModules in host -
https://github.com/NixOS/nixpkgs/issues/13852

unable to upgrade declarative nixos container -
https://github.com/NixOS/nixpkgs/issues/12396

Missing man page for nixos-container -
https://github.com/NixOS/nixpkgs/issues/10347

Installing NixOS in a container with a non-NixOS host is painful -
https://github.com/NixOS/nixpkgs/issues/9884

nixos-container: wrong message for --show-trace -
https://github.com/NixOS/nixpkgs/issues/8970

A mechanism to run containers on different "channels" from their hosts -
https://github.com/NixOS/nixpkgs/issues/7467

Nixos-container cannot be used without root -
https://github.com/NixOS/nixpkgs/issues/6754

Indirect GC roots in containers don't work -
https://github.com/NixOS/nixpkgs/issues/2310
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Best way to install nix packages from github repo

2016-06-25 Thread Daniel Hlynskyi
All approaches listed here share common pitfall - you have to download not
only latest Nixpkgs tarball, but whole new stdenv and co to use that 1
package.

But often cherry-picking that new package and deps to local Nixpkgs is the
only thing required, without all of that updated stdenv.

I see replaceRuntimeDependencies and nbp's approache for quickfix packages
as a step toward nice solution to this problem. But haven't used them yet.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Separate repository for autogenerated lists of urls and hashes

2016-06-19 Thread Daniel Hlynskyi
Now, when I've done some package upgrades and downgrades, I really like the
idea of a separate srcs repo. I'd like to contribute 3 ideas.

1. Use some of monitor.nixos.org logic for srcs updating
2. Autoextract src information from nixpkgs to srcs
3. Add meta.updateSrcsScript or meta.listAllSrcs in cases where
monitor.nixos.org heuristics are not smart enough
24 квіт. 2016 8:34 пп, користувач "Freddy Rietdijk" 
написав:

> Autogenerating packages is one step further. But it would be nice if there
> was one source where you could get more of such data from. Maybe
> https://libraries.io/ some day?
>
> To come back to the main topic, autogenerated lists in Nixpkgs. I could
> imagine it would be nice if we would have also, next to `pkgs` and `lib`, a
> `srcs`. This you could use to select the source archive of a package for a
> certain version. For example, `src = fetchurl
> srcs.github.${name}.${version}` or `src = fetchurl
> srcs.pypi.${name}.${version} but also `meta = srcs.pypi.${name}.meta`.
>
> On Sun, Apr 24, 2016 at 7:11 PM, Kosyrev Serge <
> _deepf...@feelingofgreen.ru> wrote:
>
>> Marc Weber  writes:
>> > I personally think that "autogenerating" packages is the next huge step
>> > to be taken. This requires a database and dependency information for all
>> > information.
>> >
>> > Then all distros can benefit, not just nixos.org
>>
>> ..and share the maintenance burden..
>>
>> Which would raise more centralisation-related questions, but those would
>> be problems we'd be happy to have, I think.. : -)
>>
>> --
>> с уважениeм / respectfully,
>> Косырев Сергей
>> ___
>> 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] sudo nixos-rebuild test failes after new install

2016-06-18 Thread Daniel Hlynskyi
Messing with filesystems.* is really dangerous. Once I forgot to assign
label to root partirion and referenced disk by label in configuration.
Nixos-rebuuld switch and goodbye.

Yesterday I forgot to mkfs of a new LV before nixos-rebuild, got
local-fs.target failed and bricked instance. Sadly this time I lost all the
disk data, because rescue system failed somehow.
28 січ. 2016 1:39 пп, користувач "4levels" <4lev...@gmail.com> написав:

> Hi Nix-Devs,
>
> it seems that I'm the culprit of this messed up state of the Vultr
> machines.
> I tried adding a swap partition under the fileSystems directive.  After
> finding the correct way to define swap devices (I was assuming
> fileSystems."swap" would work), the damage was already done and deploying
> via NixOps started failing on all 5 servers.
>
> I just finished reinstalling one machine and now everything seems to work
> again (on that machine that is, the others are still failing).  I didn't
> realize messing with the fileSystems entry is this kind of dangerous ;-)
>
> Kind regards,
>
> Erik
>
> On Thu, Jan 28, 2016 at 8:53 AM 4levels <4lev...@gmail.com> wrote:
>
>> Hi Nix Dev's,
>>
>> yesterday I set up a new instance on Vultr (by adding the latest nixos
>> minimal install disk).
>>
>> After the initial install - which just works fine - I cannot rebuild
>> anymore.  I can update the machine through NixOps, but running
>> nixos-rebuild always failes.
>>
>> This is the output I'm getting:
>> building Nix...
>> building the system configuration...
>> error: value is a list while a set was expected, at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:214:62
>>
>> This seems unrelated to my own configuration options, or am I missing
>> something obvious here?
>>
>> I've tried updating the channels, my current channels are:
>> nixos https://nixos.org/channels/nixos-15.09
>> nixos-15.09 https://nixos.org/channels/nixos-15.09
>> (they both seem identical to me, except for the name)
>>
>> Kind regards,
>>
>> Erik
>>
>> Full trace:
>> building Nix...
>> building the system configuration...
>> error: while evaluating the attribute ‘buildCommand’ of the derivation
>> ‘nixos-15.09.947.6783594’ at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/nixos/modules/system/activation/top-level.nix:102:7:
>> while evaluating the attribute ‘sources’ of the derivation ‘etc’ at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/nixos/modules/system/etc/etc.nix:12:5:
>> while evaluating the attribute ‘environment.etc’ at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/attrsets.nix:134:44:
>> while evaluating anonymous function at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:74:45,
>> called from
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/attrsets.nix:134:52:
>> while evaluating the attribute ‘value’ at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:287:9:
>> while evaluating the option `environment.etc':
>> while evaluating the attribute ‘isDefined’ at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:319:5:
>> while evaluating ‘filterOverrides’ at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:391:21,
>> called from
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:303:18:
>> while evaluating ‘concatMap’ at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/lists.nix:62:18,
>> called from
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:397:8:
>> while evaluating ‘concatMap’ at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/lists.nix:62:18,
>> called from
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:298:17:
>> while evaluating anonymous function at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:298:28,
>> called from undefined position:
>> while evaluating ‘dischargeProperties’ at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:361:25,
>> called from
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:299:62:
>> while evaluating ‘dischargeProperties’ at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:361:25,
>> called from
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos-15.09.947.6783594/nixos/nixpkgs/lib/modules.nix:366:9:
>> while evaluating the attribute ‘content’ at
>> /nix/store/iwhkdzryfzapl5cya1y88y1rpajff8ca-nixos

Re: [Nix-dev] User-oriented nixpkgs documentation (was: ioquake3 on nixos)

2016-06-17 Thread Daniel Hlynskyi
Write a blog post. Though it is hard to maintain blog post content over
time, ask yourself "how long am I able to maintain this knowledge? Who
should be responsible for verifying this manual in with future changes?"

People expect manuals to be consistent with software. Every time I find
errors in docs, I am step away from using it. From this perspective
blogposts and wiki are better place to contribute unmaintained knowledge -
we don't expect them to be always correct.

Make tags, so google can find your article with "quake nix".

Just IMO, but critique accepted.
8 квіт. 2016 1:36 пп, користувач "Nikolay Amiantov"  написав:

> Hi,
>
> I want to add some documentation on how to use our ioquake3 derivation.
> This brings me to question on _where_ should I actually add it. Right
> now we have:
>
> 1. Nix manual: completely unrelated to my topic;
> 2. NixOS manual: primarily describes services and not packages and is
> NixOS-oriented, while my article can be of interest to Quake-playing Nix
> users in general;
> 3. nixpkgs manual: oriented at developers and packagers (as it itself
> points out).
>
> I would have added my article to the wiki, but AFAIK it's generally
> decided to get rid of it. So, where should I place articles like this? I
> would describe the general class of such documentation as "user-oriented
> nixpkgs manual".
>
> I have some other documentation articles in mind that I would like to
> write later (e.g. on steam-run), which go to the same category (I don't
> mean "games" ^_^).
>
> On 04/08/2016 12:28 PM, Nikolay Amiantov wrote:
> > I play ioquake3 successfully. It needs the following to work:
> >
> > 1. Extract pak0.pk3 file from the original Quake 3 Arena.
> > 2. Use Nix script like this:
> >
> > { nixpkgs ? import  { } }:
> >
> > let
> >   paks = nixpkgs.stdenv.mkDerivation {
> > name = "quake3-arena";
> > pak0 = ./baseq3/pak0.pk3; # Replace this with path to your file
> > buildCommand = ''
> >   install -D -m644 $pak0 $out/baseq3/pak0.pk3;
> > '';
> >   };
> > in nixpkgs.quake3wrapper {
> >   paks = [ paks nixpkgs.quake3pointrelease ];
> > }
> >
> > 3. Run `nix-build` on it: `nix-build script.nix`
> > 4. `result/bin/quake3` would run the game.
> >
> > This probably needs to be added to our manual and/or improved somehow.
>
> --
> Nikolay.
> ___
> 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] mix bundlerEnv and python3.buildEnv

2016-06-15 Thread Daniel Hlynskyi
Reason why patchShebangs doesn't work here is because `python` executable
is not accessible in the environment. Instead python is called `python3`.
So if your script used #!/usr/bin/env python3, your first example would had
worked as expected.

I think this is bug with nixpkgs python environment, python should be
accessible via `python` if it's unambiguous.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Running nix-build on Circle CI

2016-06-15 Thread Daniel Hlynskyi
Have you tried
nix-channel --add https://nixos.org/channels/nixos-unstab
le nixpkgs
?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Merge attribute sets recursively

2016-06-15 Thread Daniel Hlynskyi
Does lib.recursiveUpdate do the job?
15 черв. 2016 7:52 пп, користувач "4levels" <4lev...@gmail.com> написав:

> Hi Nix Devs,
>
> I'm still struggling to achieve the following:
>
> I have an attribute set which is 2 levels deep nested and has a variable
> number of subsets, like this:
>
> channels = {
>   myallocator = {
> "1" = {
>   username = "demo1";
> };
> "2" = {
>   username = "demo2";
> };
> ...
>   };
> };
>
> I want to add some more attributes to each final level so the resulting
> set would be something like (where uri and timeout are added to each
> subset)
>
> channels = {
>   myallocator = {
> "1" = {
>   username = "demo1";
>   uri = "https://api.myallocator.com";;
>   timeout = "60";
> };
> "2" = {
>   username = "demo2";
>   uri = "https://api.myallocator.com";;
>   timeout = "60";
> };
> ...
>   };
> };
>
> How can I achieve this?
>
> Thank you in advance!
>
> Kind regards,
>
>
> Erik
>
>
>
>
> ___
> 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] Custom directories

2016-05-27 Thread Daniel Hlynskyi
yes, but this looks non-declarative...

OTOH this could be normally done in some existing service (in `preStart`
section), but 16.03 doesn't support `preStart` for containers. Waiting for
16.09...

2016-05-25 22:24 GMT+03:00 Vladimír Čunát :

> On 05/25/2016 04:26 PM, Daniel Hlynskyi wrote:
> > I'd like for directory /media/logs/dwarfs to exist, but I don't know
> > where to put _the_ mkdir.
>
> You could create a "service" that does the mkdir, chmod, etc. on
> activation.
>
> --Vladimir
>
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Custom directories

2016-05-27 Thread Daniel Hlynskyi
> Here is how one of my containers has its data dir in a special partition
with special permissions:

Nice. But I don't want to mount /media/logs to my container, because it
will have access to other logs created by other containers.

> But maybe the bindMounts of containers need to be extended so they also create
the target directory with the permissions you want

This (permissions) would be nice feature for fileSystems too, IMO.

2016-05-25 23:14 GMT+03:00 Arnold Krille :

> On Wed, 25 May 2016 17:26:24 +0300 Daniel Hlynskyi
>  wrote:
> > Hi. What's canonical Nixos way to specify custom directories?
> >
> > I'm playing with containers. Here is excerpt of my config:
> >
> >   fileSystems."/media/logs" = { fsType = "ext4";  label = "logs"; };
> >   boot.initrd.postMountCommands = ''
> > chmod 777 /media/logs
> >   '';
> >
> >   containers.dwarfs =
> > { bindMounts."/media/logs/dwarfs".hostPath = "/media/logs/dwarfs";
> >   bindMounts."/media/logs/dwarfs".isReadOnly = false;
> >   config =
> >{ config, pkgs, ... }:
> >{
> >  boot.postBootCommands = ''
> > chmod 777 /media/logs/dwarfs
> >  '';
> >
> > I'd like for directory /media/logs/dwarfs to exist, but I don't know
> > where to put _the_ mkdir.
> >
> > boot.initrd.postMountCommands is not exactly what I want, because I
> > need to remount drive or reboot host for changes to apply, but plain
> > nixos-rebuild switch doesn't execute postMountCommands.
> >
> > Also I'd like to change directory mask in containers without container
> > restart (instead of boot.postBootCommands)
>
> Here is how one of my containers has its data dir in a special
> partition with special permissions:
>
> https://github.com/kampfschlaefer/nixconfig/blob/master/portal/containers/mpd.nix
> Note that the directory is created by systemd before mounting partition.
>
> But maybe the bindMounts of containers need to be extended so they also
> create the target directory with the permissions you want. But what
> happens when you want a userid for permissions that exists only inside
> the container? Current bindmount stuff is outside the container…
>
> - 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


[Nix-dev] Custom directories

2016-05-25 Thread Daniel Hlynskyi
Hi. What's canonical Nixos way to specify custom directories?

I'm playing with containers. Here is excerpt of my config:

  fileSystems."/media/logs" = { fsType = "ext4";  label = "logs"; };
  boot.initrd.postMountCommands = ''
chmod 777 /media/logs
  '';

  containers.dwarfs =
{ bindMounts."/media/logs/dwarfs".hostPath = "/media/logs/dwarfs";
  bindMounts."/media/logs/dwarfs".isReadOnly = false;
  config =
   { config, pkgs, ... }:
   {
 boot.postBootCommands = ''
chmod 777 /media/logs/dwarfs
 '';

I'd like for directory /media/logs/dwarfs to exist, but I don't know where
to put _the_ mkdir.

boot.initrd.postMountCommands is not exactly what I want, because I need to
remount drive or reboot host for changes to apply, but plain nixos-rebuild
switch doesn't execute postMountCommands.

Also I'd like to change directory mask in containers without container
restart (instead of boot.postBootCommands)
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Documentation for multiple-outputs in nixpkgs

2016-05-10 Thread Daniel Hlynskyi
@vcunat pointed me to
http://hydra.nixos.org/build/34390075/download/1/nixpkgs/manual.html#chap-multiple-output

2016-05-10 15:49 GMT+03:00 Benno Fünfstück :

> Hello list,
>
> in recent nixpkgs, the multiple outputs branch was merged. Is there any
> documentation on how this is supposed to work / what outputs there exist
> (i've found "out", "dev", "static" for zlib) / how to use it when writing
> packages?
>
> Regards,
> Benno
>
> ___
> 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] Revert `nixos-rebuild switch --profile-name test`

2016-02-08 Thread Daniel Hlynskyi
> They are just symlinks. You can simply delete or create them as any files.

These profiles are shown in my GRUB config. It is not obvious from man
whether they will survive `nixos-rebuild`

thanks

2016-02-08 12:05 GMT+02:00 Vladimír Čunát :

> On 02/08/2016 09:34 AM, Daniel Hlynskyi wrote:
> > 1. How can I remove named system profile?
>
> They are just symlinks. You can simply delete or create them as any files.
>
> > 2. How to find out used space for given GC root?
>
> Determining size of closure of some root(s) is relatively easy:
> nix-store -qR /path/to/the/roots | xargs du -sc
> Of course, that's only the upper bound on the amount of
> newly-unreachable space in case you delete the root(s).
>
> --Vladimir
>
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Revert `nixos-rebuild switch --profile-name test`

2016-02-08 Thread Daniel Hlynskyi
Hi. I have following GC roots:

/nix/var/nix/profiles/system-140-link ->
/nix/store/7krdihr333i4cl82n7c0afwgrv4k13gd-nixos-system-master-16.03pre75806.77f8f35
/nix/var/nix/profiles/system-profiles/another one try-1-link ->
/nix/store/0xx3nbzplrycjfd3fv1bnniydaanpc6j-nixos-14.10pre50818.b5fe0d3
/nix/var/nix/profiles/system-profiles/nomodeset-1-link ->
/nix/store/1mrd3v1jrhlpim6hadd5s8n8hcw34rgn-nixos-14.10pre50818.b5fe0d3
/nix/var/nix/profiles/system-profiles/test_reboot-1-link ->
/nix/store/wp0af6jfhrb60njxbc765a7pdvh4yg17-nixos-14.10pre50818.b5fe0d3
...

1. How can I remove named system profile?
2. How to find out used space for given GC root?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] NIX_PATH and tarballs

2015-11-21 Thread Daniel Hlynskyi
Hi. The manual says on tarballs in NIX_PATH this:

> If a path in the Nix search path starts with http:// or https://, it is
interpreted
> as the URL of a tarball that will be downloaded and unpacked to a
temporary
> location. The tarball must consist of a single top-level directory.

But when I run `nixos-rebuild` twice, I notice that tarball is not
downloaded second time.

root# NIX_PATH=nixos-config=/etc/nixos/configuration.nix:nixpkgs=
https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz \
root#   nixos-rebuild dry-build
building the system configuration...
# ->  tarball is not downloaded second time <---
these derivations will be built:
  /nix/store/h2sp5p9x3gzryiq57znqdzc3jrw3dlpa-nixos-help.drv
  /nix/store/9gzsm78klcassgs9yvpmnd38naczndc1-system-path.drv
  /nix/store/rflgcrmas917yzdihxd9kqbp8n27w2qj-dbus-conf.drv

What kind of caching is this and what happens when upstream tarball changes?

Question 2: In his talk Eelco mentioned the possible deprecation of
nix-channel in favor of tarball links. Is anybody aware of what the new
interface for channels will look like?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [***SPAM***] Thoughts on the Nix model

2015-09-20 Thread Daniel Hlynskyi
Nice way to establish "declarativeness" of Nix expressions is to integrate
OWL (or any other description logic based language) into Nix such that we
can do (lossy) translation nixpkgs -> .owl and query results with existing
OWL tooling.

The list of queries Nix itself does not support is a first thing to do in
this case

2015-09-14 14:40 GMT+03:00 Kosyrev Serge <_deepf...@feelingofgreen.ru>:

> Good day folks!
>
> The growth in popularity Nixpkgs enjoys, as exemplified by the continuing
> uptake in the unmerged pull requests, is the evidence that directs us away
> from the kind of issues I feel like raising in this message.
>
> Yet, after a year and a half of my personal experience of using and
> occasionally contributing to NixOS, it's becoming hard to dismiss them.
>
> First, let me start with an empathic agreement that the ideas underlying
> NixOS make it almost unique in the fundamental soundness of its system
> composition and configuration management.
>
> Nothing, however, comes for free, and the operational complexity of
> traditional Linux distributions shifts into an unparallelled descriptive
> complexity in the support infrastructure of NixOS [1].
>
>   -   -   -
>
> But, what is the evidence for this descriptive complexity?
>
> The simple fact that Turing-complete code is used to describe
> /everything/.
>
> One could say, of course, that the leaf 'default.nix' files are mostly
> declarative.
>
> The response is that, of course, this is an observation the
> meaningfulness of which can be judged by the awful state of the tools
> that are supposed to query the package database.
>
> With all due respect, in comparison with traditional distributions,
> they are either atrocious or non-existent.
>
> And I don't mean only user-facing tools here, but mostly tools to
> support the developer -- things like the 'dpkg-*' suite, for
> example.
>
> We all know about the hard limits to program analysis, and of course the
> retreat used by Nix to support these tools, is an introduction of
> regularity that is barely sufficient to sustain a pretense of automatic
> processing outside of the default mode of execution -- derivation.
>
> Let's not fool ourselves -- with the exception of the core path of the
> Nix deriver, which they were designed to support, the 'default.nix'
> files are perpetually hovering on being barely declarative enough for
> the meager assortment of other tooling to work.
>
>   -   -   -
>
> Another thing that could be said, is that there is no need for
> declarativity at all, since the code can be executed, and the
> returned derivations can be queried for the desired properties.
>
> Unfortunately, limiting analysis to execution (if one can be excused for
> uttering such blasphemy) has the following undesirable properties, among
> others:
>
>   - it makes validation nigh impossible, for example due to the returned
> data structures /themselves/ containing executable functions
>
>   - crucially, it leaves no choice but to use Nix for writing tools
> manipulating the what-ought-to-be-declarations
>
>   - deriving from the above, it also means the analysis is going to
> be /slow/, at least with the current implementation of Nix
>
>   - the attempts to hide this slowness already results in warts,
> like haskellPackages being a separate namespace
>
> The second point is, without question, the gravest, because while Nix
> might be an adequate language for expressing derivations, I think it's
> in unarguable that it's ill-suited for writing tooling.
>
> And yet, the meat of the information contained in the "package database"
> is either unavailable, or has restricted availability to anything outside
> Nix.
>
> In my perception, this situation can't be good in the long term.
>
>
> --
> 1. Don't get me wrong -- one could say that in comparison, the traditional
> distributions mostly don't even attempt to formalize their composition.
> NixOS is clearly without precedent here.
> --
> с уважениeм / respectfully,
> Косырев Серёга
> --
> “And those who were seen dancing were thought to be insane
> by those who could not hear the music.”
> – Friedrich Wilhelm Nietzsche
> ___
> 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] PyQt and packaging python-qscintilla

2015-07-22 Thread Daniel Hlynskyi
Ah, the problem was fixed with lndir. That is basically way 3), but does
not use extra space on disk

mkdir -p $out
lndir ${pkgs.pyqt4} $out

2015-07-19 17:36 GMT+00:00 Daniel Hlynskyi :

> For PyQt there is a library python-qscintilla, which is Python binding to
> qscintilla editor control. PyQt is already packaged here [1].
>
> The problem with packaging python-qscintilla is: it wants to be in PyQt
> directory. So we can do
>
>   import PyQt4
>   import PyQt4.Qsci
>
> Now [2] I have three choices how to resume packaging :
>
> 1) ask if someone knows hot to trick Python and sip where the Qsci.so is
> located (python-qscintilla creates .so file, not .py). I've tried to put
> Qsci.so into PYTHONPATH but Python doesn't load .so files (or I didn't
> figure out how it works)
>
> 2) modify PyQt, so it has optional argument qscintilla:
>
>pyqt4 = { pkgs, qscintilla ? null, ..} : ...
>
> and refer to python-qscintilla as
>
>[ pkgs.python27Packages.pyqt4 { pkgs = self.pkgs, qscintilla =
> pkgs.qscintilla } ]
>
> (alternative: implement it as override in nixpkgs)
>
> 3) create own build of PyQt in python-qscintilla. This will not change
> existing PyQt expression
>
> Which is better to continue and how to do it best?
>
> [1]
> https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/pyqt/
> [2] https://gist.github.com/danbst/e4199acb6b4dee9cdfbf
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] PyQt and packaging python-qscintilla

2015-07-19 Thread Daniel Hlynskyi
For PyQt there is a library python-qscintilla, which is Python binding to
qscintilla editor control. PyQt is already packaged here [1].

The problem with packaging python-qscintilla is: it wants to be in PyQt
directory. So we can do

  import PyQt4
  import PyQt4.Qsci

Now [2] I have three choices how to resume packaging :

1) ask if someone knows hot to trick Python and sip where the Qsci.so is
located (python-qscintilla creates .so file, not .py). I've tried to put
Qsci.so into PYTHONPATH but Python doesn't load .so files (or I didn't
figure out how it works)

2) modify PyQt, so it has optional argument qscintilla:

   pyqt4 = { pkgs, qscintilla ? null, ..} : ...

and refer to python-qscintilla as

   [ pkgs.python27Packages.pyqt4 { pkgs = self.pkgs, qscintilla =
pkgs.qscintilla } ]

(alternative: implement it as override in nixpkgs)

3) create own build of PyQt in python-qscintilla. This will not change
existing PyQt expression

Which is better to continue and how to do it best?

[1]
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/pyqt/
[2] https://gist.github.com/danbst/e4199acb6b4dee9cdfbf
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Automount for usb thumb drives / other external drives

2015-07-18 Thread Daniel Hlynskyi
What is the nixos way to add udiskie as user daemon? Currently I run in
~/.bashrc and xmonad.hs

ps aux | grep -q '[u]diskie' || udiskie &
disown %1

2015-07-16 14:27 GMT+00:00 Benno Fünfstück :

> There is an udisk auto mounter in nixpkgs though: udiskie
>
> Guillaume Maudoux (Layus)  schrieb am Do., 16. Juli
> 2015 15:04:
>
>> Hi,
>>
>> Le 16/07/15 13:58, Eelco Dolstra a écrit :
>> > Hi,
>> >
>> > On 15/07/15 23:22, Paul Koerbitz wrote:
>> >
>> >> I would like to automatically mount usb sticks that I plug into my
>> >> laptop. I haven't been able to figure out how to do this in NixOS,
>> >> what's the easiest option?
>> > The standard mechanism used for dealing with removable media is udisks,
>> used by
>> > desktop environments like KDE and Xfce to allow non-root users to mount
>> disks.
>> > It can also be used from the command-line, e.g.
>> >
>> >$ udisksctl mount -b /dev/sdb1
>> >Mounted /dev/sdb1 at /run/media/eelco/USBSTICK.
>> >
>> > Udisks doesn't mount disks automatically on insertion, but this could
>> be done by
>> > having a script that listens for the D-Bus messages sent by udisks and
>> then asks
>> > udisks to do the mount. In fact, there already is a package that does
>> this:
>> >
>> >https://github.com/fernandotcl/udisks-glue
>> >
>> > but it's not in Nixpkgs yet.
>> >
>> There is also the excellent udevil[1] tool that comes with devmon,
>> a monitoring and automonting daemon.
>> But udevil is not yet in nixpkgs either.
>>
>> [1] http://ignorantguru.github.io/udevil/
>> ___
>> 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] services.xserver.displayManager.auto does not work

2015-06-20 Thread Daniel Hlynskyi
thanks, that fixes issue!

2015-06-20 11:06 GMT+00:00 Arseniy Seroka :

>   I confirm this issue.
>
> I can solve it only by manually setting:
> ```
> displayManager.sessionCommands = with pkgs; ''
> ${haskellngPackages.xmonad}/bin/xmonad
> '';
> ```
>
> Sincerely,
> Arseniy Seroka
>
> On 20 June 2015 13:49:39 Daniel Hlynskyi  wrote:
>
>> Hi. I'm trying to run window manager without login prompt.
>> I'm using displayManager.auto, but it results into xterm without WM.
>>
>> It uses under the hood SLiM, so the following config does not work either
>>
>>  displayManager.slim =
>> { enable = true;
>>   defaultUser = "danbst";
>>   autoLogin = true;
>> };
>>
>> Logs say:
>>
>> Jun 20 10:42:31 master display-manager-start[7860]:
>> /nix/store/msj1a9rsch74cy3mwb8vbsamq7hsiay6-xauth-1.0.9/bin/xauth:  file
>> /var/run/slim.auth does not exist
>> Jun 20 10:42:34 master display-manager-start[7860]:
>> /nix/store/msj1a9rsch74cy3mwb8vbsamq7hsiay6-xauth-1.0.9/bin/xauth:  file
>> /home/danbst/.Xauthority does not
>>
>> How can this be fixed or overriden to run window manager with specific
>> user?
>>
>> nixos vresion: 15.06pre64030.e1af50c (Dingo)
>> ___
>> 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] services.xserver.displayManager.auto does not work

2015-06-20 Thread Daniel Hlynskyi
Hi. I'm trying to run window manager without login prompt.
I'm using displayManager.auto, but it results into xterm without WM.

It uses under the hood SLiM, so the following config does not work either

 displayManager.slim =
{ enable = true;
  defaultUser = "danbst";
  autoLogin = true;
};

Logs say:

Jun 20 10:42:31 master display-manager-start[7860]:
/nix/store/msj1a9rsch74cy3mwb8vbsamq7hsiay6-xauth-1.0.9/bin/xauth:  file
/var/run/slim.auth does not exist
Jun 20 10:42:34 master display-manager-start[7860]:
/nix/store/msj1a9rsch74cy3mwb8vbsamq7hsiay6-xauth-1.0.9/bin/xauth:  file
/home/danbst/.Xauthority does not

How can this be fixed or overriden to run window manager with specific user?

nixos vresion: 15.06pre64030.e1af50c (Dingo)
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Problem with builder #1 - nix-shell and nix-build behave differently

2015-05-16 Thread Daniel Hlynskyi
I propose

postUnpack = "cd $sourceRoot"

That won't break already-unpacked-source-environments
If one wants old behaviour, he can do "unpackPhase; cd .."

2015-05-16 19:39 GMT+00:00 Luca Bruno :

> Because you are only looking at your use case. Many use cases involve
> having already an src and using nix-shell for getting in the dev
> environment.
>
> On Sat, May 16, 2015 at 6:56 PM, Daniel Hlynskyi 
> wrote:
>
>> Why not? unpackPhase unpacks to current dir, why can't it switch to
>> $sourceRoot?
>> If I understand nix-shell right, it would be then possible to
>>
>> nix-shell --command "unpackPhase; configurePhase; buildPhase;"
>>
>> as kind of alias to nix-build. Currently you are required to cd as
>> mentioned in wiki [https://nixos.org/wiki/Debugging_a_Nix_Package]
>>
>>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Problem with builder #1 - nix-shell and nix-build behave differently

2015-05-16 Thread Daniel Hlynskyi
Why not? unpackPhase unpacks to current dir, why can't it switch to
$sourceRoot?
If I understand nix-shell right, it would be then possible to

nix-shell --command "unpackPhase; configurePhase; buildPhase;"

as kind of alias to nix-build. Currently you are required to cd as
mentioned in wiki [https://nixos.org/wiki/Debugging_a_Nix_Package]

As Tomasz Kontusz mentioned, the cd $sourceRoot is done between phases,
which is unexpectable to me.

2015-05-14 14:10 GMT+00:00 Luca Bruno :

> On 14/05/2015 15:58, Daniel Hlynskyi wrote:
> > Then how does nix-build handle this? Is there some special hook "cd
> > $sourceRoot" after unpackPhase? Why this hook is not added to nix-shell?
> >
> Because you may be in a different directory where nix-shell can cd
> $sourceRoot? Those unpack & cd just don't apply to nix-shell.
> ___
> 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] Problem with builder #1 - nix-shell and nix-build behave differently

2015-05-14 Thread Daniel Hlynskyi
Then how does nix-build handle this? Is there some special hook "cd
$sourceRoot" after unpackPhase? Why this hook is not added to nix-shell?

2015-05-14 11:15 GMT+03:00 Tomasz Kontusz :

> entering the source root is not a part of any phase, so you'll have to do
> it by hand in the nix-shell
>
> --
> Wysłane za pomocą K-9 Mail.
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Problem with builder #2 - $out variable is escaped in configureFlags

2015-05-13 Thread Daniel Hlynskyi
Problem: $out path is escaped in configureFlags and not expanded in
configure time
to /nix/store/i02i938nm28zjxx0hswxx4bc5pknqzaj-qscintilla-python
However, when I write custom configurePhase script via double-singleticks
and explicit EOL-escaping, it works. How can I achive this with
stock configureScript and configureFlags?

Input #1: default.nix

let
 pkgs = import  {};
in rec {

  qscintilla-python = pkgs.stdenv.mkDerivation rec {
name = "qscintilla-python";

src = pkgs.qscintilla.src;
buildInputs = [ pkgs.python ];
propagatedBuildInputs = [ pkgs.pyqt4 pkgs.qscintilla pkgs.qt4 ];

preConfigure = "cd Python";
configureScript = "${pkgs.python}/bin/python configure.py";
configureFlags = "
  --destdir $out/lib/${pkgs.python.libPrefix}/site-packages
  --no-sip-files
  --no-qsci-api
  --pyqt PyQt4
  --qsci-incdir ${pkgs.qscintilla}/include
  --qsci-libdir ${pkgs.qscintilla}/lib
";
dontAddPrefix = true;

  };
}

Input #2: default.nix with custom configure step

let
 pkgs = import  {};
in rec {

  qscintilla-python = pkgs.stdenv.mkDerivation rec {
name = "qscintilla-python";

src = pkgs.qscintilla.src;
buildInputs = [ pkgs.python ];
propagatedBuildInputs = [ pkgs.pyqt4 pkgs.qscintilla pkgs.qt4 ];

configurePhase = ''
  cd Python
  ${pkgs.python}/bin/python ./configure.py \
  --destdir $out/lib/${pkgs.python.libPrefix}/site-packages \
  --no-sip-files \
  --no-qsci-api \
  --pyqt PyQt4 \
  --qsci-incdir ${pkgs.qscintilla}/include \
  --qsci-libdir ${pkgs.qscintilla}/lib
'';

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


[Nix-dev] Problem with builder #1 - nix-shell and nix-build behave differently

2015-05-13 Thread Daniel Hlynskyi
Problem: nix-build and nix-shell treat differently source root directory
When using nix-build, shell is in $sourceRoot after unpackPhase, when using
nix-shell, it is left in current directory. How can I make nix script
behave same when nix-building it and nix-shelling?

Side problem: is there shortcut for `${pkgs.python}/bin/python`?

How to reproduce:
run `nix-build default.nix`
then run `nix-shell default.nix --command "rm -rf QSci*; unpackPhase;
configurePhase"`
notice, that second one failed preConfigure step

Input: default.nix

let
 pkgs = import  {};
in rec {

  qscintilla-python = pkgs.stdenv.mkDerivation rec {
name = "qscintilla-python";

src = pkgs.qscintilla.src;
buildInputs = [ pkgs.python ];
propagatedBuildInputs = [ pkgs.pyqt4 pkgs.qscintilla pkgs.qt4 ];

preConfigure = "cd Python";
#preConfigure = "cd $sourceRoot/Python";  <- correct for
nix-shell, but wrong for nix-build
configureScript = "${pkgs.python}/bin/python configure.py";
configureFlags = "
  --destdir $out/lib/${pkgs.python.libPrefix}/site-packages
  --no-sip-files
  --no-qsci-api
  --pyqt PyQt4
  --qsci-incdir ${pkgs.qscintilla}/include
  --qsci-libdir ${pkgs.qscintilla}/lib
";
dontAddPrefix = true;

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


Re: [Nix-dev] force nix-build without binary caches?

2014-12-01 Thread Daniel Hlynskyi
No, not everything is working. -K option didn't trigger. Here are last
lines of build log

building install_features
 install -m 644 -p
/tmp/nix-build-qscintilla-2.8.3.drv-0/QScintilla-gpl-2.8.3/Qt4Qt5/features/qscintilla2.prf
/nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3/share/qt/mkspecs/features//
glibPreFixupPhase
post-installation fixup
patching ELF executables and libraries in
/nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3
/nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3/libs/libqscintilla2.so.11.2.0
gzipping man pages in
/nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3
patching script interpreter paths in
/nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3
/nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3

But folder /tmp/nix-build-qscintilla-2.8.3.drv-0/ is deleted:

[danbst@master:/tmp/scibuild]$ ls -la /tmp/
total 8
drwxrwxrwt 12 root   root 260 Dec  1 11:45 .
drwxr-xr-x 20 root   root4096 Nov 20 09:19 ..
drwxr-xr-x  2 danbst nogroup   80 Nov 27 23:22 build
drwx--  2 danbst nogroup   60 Nov 27 20:45 .esd-1000
drwx--  2 root   root  40 Nov 27 20:45 kde-root
drwx--  2 root   root  40 Nov 27 20:45 ksocket-root
drwx--  2 danbst nogroup   80 Nov 27 20:45 .org.chromium.Chromium.hPGm8S
drwx--  2 danbst nogroup   80 Nov 27 20:55 .org.chromium.Chromium.owFjjQ
drwxr-xr-x  2 danbst nogroup   60 Dec  1 11:45 scibuild
drwx--  3 root   root  60 Nov 27 20:45
systemd-private-a17a7cbc51c64ee6bc6717082ade3db4-rtkit-daemon.service-vxwynA
drwx--  3 danbst nogroup   60 Nov 30 13:39 .wine-1000
-r--r--r--  1 root   root  11 Nov 27 20:45 .X0-lock
drwxrwxrwt  2 root   root  60 Nov 27 20:45 .X11-unix

2014-12-01 11:47 GMT+01:00 Daniel Hlynskyi :

> thanks, now it works. Am I right, if I have Qt-4.8.6 (build dependency of
> qscintilla) already installed, than I don't need to
> recompile it when --option binary-caches "" is used for qscintilla?
>
> 2014-12-01 11:34 GMT+01:00 Domen Kožar :
>
>> $ rm result
>> $ nix-store --delete /nix/store/kycs9akg1h70wjm0p4cg9cc384ccrf
>> y7-qscintilla-2.8.3
>> $ nix-build '' -K -A qscintilla --option build-use-substitutes
>> false
>>
>> On Mon, Dec 1, 2014 at 11:32 AM, Daniel Hlynskyi 
>> wrote:
>>
>>> Thanks guys, but that doesn't help
>>>
>>> [danbst@master:/tmp/scibuild]$ nix-build '' -K -A qscintilla
>>> --option build-use-substitutes false
>>> /nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3
>>>
>>> [danbst@master:/tmp/scibuild]$ nix-build '' -K -A qscintilla
>>> --option binary-caches ""
>>> /nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3
>>>
>>> [danbst@master:/tmp/scibuild]$
>>>
>>> I have 'gc-keep-outputs = true' option enabled. Can this be a problem?
>>>
>>> 2014-12-01 11:29 GMT+01:00 Rob Vermaas :
>>>
>>>> Or use (taken from 'man nix.conf'):
>>>>
>>>>build-use-substitutes
>>>>If set to true (default), Nix will use binary substitutes if
>>>> available. This option can be disabled to force
>>>>building from source.
>>>>
>>>> E.g. nix-build --option build-use-substitutes false
>>>>
>>>> Cheers,
>>>> Rob
>>>>
>>>>
>>>> On Mon, Dec 1, 2014 at 11:21 AM, Domen Kožar  wrote:
>>>>
>>>>> nix-build --option binary-caches ""
>>>>>
>>>>> On Mon, Dec 1, 2014 at 11:08 AM, Daniel Hlynskyi <
>>>>> abcz2.upr...@gmail.com> wrote:
>>>>>
>>>>>> hi, I'm trying to use -K option for nix-build, but it doesn't
>>>>>> generate unpacked directory in /tmp, it simply finds it somewhere in 
>>>>>> cache
>>>>>> (or binary cache.nixos.org or hydra.nixos.org). How to force it to
>>>>>> build without using cache and generated /tmp/nix-build-* directory?
>>>>>>
>>>>>> [danbst@master:/tmp/scibuild]$ nix-build '' -K -A qscintilla
>>>>>> /nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3
>>>>>> [danbst@master:/tmp/scibuild]$
>>>>>>
>>>>>> ___
>>>>>> 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
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Rob Vermaas
>>>>
>>>> [email] rob.verm...@gmail.com
>>>>
>>>
>>>
>>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] force nix-build without binary caches?

2014-12-01 Thread Daniel Hlynskyi
thanks, now it works. Am I right, if I have Qt-4.8.6 (build dependency of
qscintilla) already installed, than I don't need to
recompile it when --option binary-caches "" is used for qscintilla?

2014-12-01 11:34 GMT+01:00 Domen Kožar :

> $ rm result
> $ nix-store --delete /nix/store/kycs9akg1h70wjm0p4cg9cc384ccrf
> y7-qscintilla-2.8.3
> $ nix-build '' -K -A qscintilla --option build-use-substitutes
> false
>
> On Mon, Dec 1, 2014 at 11:32 AM, Daniel Hlynskyi 
> wrote:
>
>> Thanks guys, but that doesn't help
>>
>> [danbst@master:/tmp/scibuild]$ nix-build '' -K -A qscintilla
>> --option build-use-substitutes false
>> /nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3
>>
>> [danbst@master:/tmp/scibuild]$ nix-build '' -K -A qscintilla
>> --option binary-caches ""
>> /nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3
>>
>> [danbst@master:/tmp/scibuild]$
>>
>> I have 'gc-keep-outputs = true' option enabled. Can this be a problem?
>>
>> 2014-12-01 11:29 GMT+01:00 Rob Vermaas :
>>
>>> Or use (taken from 'man nix.conf'):
>>>
>>>build-use-substitutes
>>>If set to true (default), Nix will use binary substitutes if
>>> available. This option can be disabled to force
>>>building from source.
>>>
>>> E.g. nix-build --option build-use-substitutes false
>>>
>>> Cheers,
>>> Rob
>>>
>>>
>>> On Mon, Dec 1, 2014 at 11:21 AM, Domen Kožar  wrote:
>>>
>>>> nix-build --option binary-caches ""
>>>>
>>>> On Mon, Dec 1, 2014 at 11:08 AM, Daniel Hlynskyi <
>>>> abcz2.upr...@gmail.com> wrote:
>>>>
>>>>> hi, I'm trying to use -K option for nix-build, but it doesn't generate
>>>>> unpacked directory in /tmp, it simply finds it somewhere in cache (or
>>>>> binary cache.nixos.org or hydra.nixos.org). How to force it to build
>>>>> without using cache and generated /tmp/nix-build-* directory?
>>>>>
>>>>> [danbst@master:/tmp/scibuild]$ nix-build '' -K -A qscintilla
>>>>> /nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3
>>>>> [danbst@master:/tmp/scibuild]$
>>>>>
>>>>> ___
>>>>> 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
>>>>
>>>>
>>>
>>>
>>> --
>>> Rob Vermaas
>>>
>>> [email] rob.verm...@gmail.com
>>>
>>
>>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] force nix-build without binary caches?

2014-12-01 Thread Daniel Hlynskyi
Thanks guys, but that doesn't help

[danbst@master:/tmp/scibuild]$ nix-build '' -K -A qscintilla
--option build-use-substitutes false
/nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3

[danbst@master:/tmp/scibuild]$ nix-build '' -K -A qscintilla
--option binary-caches ""
/nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3

[danbst@master:/tmp/scibuild]$

I have 'gc-keep-outputs = true' option enabled. Can this be a problem?

2014-12-01 11:29 GMT+01:00 Rob Vermaas :

> Or use (taken from 'man nix.conf'):
>
>build-use-substitutes
>If set to true (default), Nix will use binary substitutes if
> available. This option can be disabled to force
>building from source.
>
> E.g. nix-build --option build-use-substitutes false
>
> Cheers,
> Rob
>
>
> On Mon, Dec 1, 2014 at 11:21 AM, Domen Kožar  wrote:
>
>> nix-build --option binary-caches ""
>>
>> On Mon, Dec 1, 2014 at 11:08 AM, Daniel Hlynskyi 
>> wrote:
>>
>>> hi, I'm trying to use -K option for nix-build, but it doesn't generate
>>> unpacked directory in /tmp, it simply finds it somewhere in cache (or
>>> binary cache.nixos.org or hydra.nixos.org). How to force it to build
>>> without using cache and generated /tmp/nix-build-* directory?
>>>
>>> [danbst@master:/tmp/scibuild]$ nix-build '' -K -A qscintilla
>>> /nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3
>>> [danbst@master:/tmp/scibuild]$
>>>
>>> ___
>>> 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
>>
>>
>
>
> --
> Rob Vermaas
>
> [email] rob.verm...@gmail.com
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] force nix-build without binary caches?

2014-12-01 Thread Daniel Hlynskyi
hi, I'm trying to use -K option for nix-build, but it doesn't generate
unpacked directory in /tmp, it simply finds it somewhere in cache (or
binary cache.nixos.org or hydra.nixos.org). How to force it to build
without using cache and generated /tmp/nix-build-* directory?

[danbst@master:/tmp/scibuild]$ nix-build '' -K -A qscintilla
/nix/store/kycs9akg1h70wjm0p4cg9cc384ccrfy7-qscintilla-2.8.3
[danbst@master:/tmp/scibuild]$
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] I'd like to package 'python-qscintilla2' from Debian. How should I do that?

2014-11-11 Thread Daniel Hlynskyi
> http://nixos.org/nixpkgs/manual/
Oh, that's new manual for me, thanks!

2014-11-11 19:37 GMT+01:00 Domen Kožar :

> Hi Daniel,
>
>
>> Wiki and manual information is helpfull, but not enlighting. I'll start
>> there, but maybe someone can point me to better docs/examples on package
>> process?
>>
>
> Just making sure, two manuals to read:
>
> - http://nixos.org/nix/manual/
> - http://nixos.org/nixpkgs/manual/
>
>
>> In particular:
>> - is there simple way to convert existing Debian (or Arch/AUR) package to
>> Nix?
>>
>
> No.
>
>
>> - testing package isolated to system
>>
>
> Make sure you enable chroot builds and you're done (on Linux, OSX is a bit
> tricky at the moment)
>
>
>> - nix derivation syntax and semantics (from scratch and for dummies)
>>
>
> http://nixos.org/nix/manual/#chap-writing-nix-expressions
>
>
>> - nix derivation workflow patterns for dummies
>> - nix naming and versioning patterns for dummies
>>
>
> http://nixos.org/nixpkgs/manual/#chap-conventions
>
>
>
>> - maintaining
>>
>
> We don't have much on that. Make sure you add yourself as maintainer and
> respond to build failures and bug reports.
>
> I admit that documentation about Nix language and quickstart for packaging
> is not the best - but planned to be improved.
>
> Domen
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] I'd like to package 'python-qscintilla2' from Debian. How should I do that?

2014-11-11 Thread Daniel Hlynskyi
Hi. I'm going to create a package from Debian one, 'python-qscintilla2' and
it's usage 'tortoisehg'. What manuals should I read first, what examples
should I take into account, what naming conventions should I consider and
what workflows are there to simplify package process?

Wiki and manual information is helpfull, but not enlighting. I'll start
there, but maybe someone can point me to better docs/examples on package
process?

In particular:
- is there simple way to convert existing Debian (or Arch/AUR) package to
Nix?
- testing package isolated to system
- nix derivation syntax and semantics (from scratch and for dummies)
- nix derivation workflow patterns for dummies
- nix naming and versioning patterns for dummies
- maintaining

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


Re: [Nix-dev] NixOS Live CD (Graphic) Boot Failure

2014-11-06 Thread Daniel Hlynskyi
> It does not switch to hi-res, so it made it a bit easier to read things
as they flash by
that is normally regulated by boot parameter "nomodeset" in GRUB (
https://wiki.archlinux.org/index.php/kernel_mode_setting)

> Could something this old still be usable with updates?
sure. That is the point of rolling-release distros (like NixOS). You can
update from any point in history (aww, there are exceptions ^))

The command to update system is

nix-channel --add http://nixos.org/channels/nixpkgs-unstable
nixos-rebuild switch --upgrade

I don't know whether it will update kernelPackages to new one. If that ata1
is kernel bug, than you have to figure out, which kernel it was introduced.

2014-11-06 17:25 GMT+01:00 J. Brian Kelley :

>  And you are correct -
> nixos-graphical-0.1pre4006_7435db-bc9efb6-x86_64-linux.iso does boot, but
> not without complaint.
>
> It does not switch to hi-res, so it made it a bit easier to read things as
> they flash by (scroll lock seems to be ignored if the message line starts
> with the character [  ).
>
> The error triplet occurs before the login request and is preceded by:
>
> ata1:hard resetting link
> ata1:SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> ata.00: configured for UDMA/133
> ata1:EH complete
> ata1:limiting SATA link speed to 1.5 Gbps
>
> The error triplet then occurs:
>
> ata1:exception Emask 0x10 SAct 0x0 SErr 0x4000 action 0xe frozen
> ata1:irq-stat 0x0040, connection status changed
> ata1:SError { DevExch }
>
> After that there is one more:
>
> ata1:hard resetting link
>
> Finally, the login request is presented. There is no eternal repetition of
> the error triplet as seen in the current live-cd.
>
> Logged in and the desktop came up.
>
> Could something this old still be usable with updates? Will the link speed
> remain at Sata 1 levels?
>
>
> On 2014-11-05 21:42, Daniel Hlynskyi wrote:
>
>
> > Where could I find one of these old versions? Furthest back I saw was
> only a year old.
> Old releases are at http://nixos.org/releases/nixos/unstable/ - I beleive
> 0.1pre versions are without systemd
>
>
>
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] NixOS Live CD (Graphic) Boot Failure

2014-11-05 Thread Daniel Hlynskyi
Why do you have problems with flash-boot and have to burn discs? Maybe
there is some problem with your flash-drive? You can try another one.

You can also try some truly old NixOS, pre-systemd one, for example or 2.x
kernel.

2014-11-05 19:30 GMT+01:00 J. Brian Kelley :

> If only I knew what I was doing 
>
> Linux Mint modprobe configs just gets a response that configs does not
> exist
>
> Linux Mint modprobe -c does generate a long list. The first and last
> entries are:
>
> alias symbol:tua9001_attach tua9001
> ...
> ...
> alias symbol:zl10353_attach zl10353
>
> If this is what is wanted, how do I send it (attachments allowed?) and
> if not, where should I look (or specific modprobe options and arguments)?
>
> It was also suggested that a full dmesg log would help, but that may be
> difficult as I am booting from the nixos live-cd. Perhaps not impossible
> if the output could be directed to my flash drive. I think I might be
> able to make text changes to the .iso (use Peazip to extract the
> contents and ImgBurn to regenerate the .iso), if some guidance as to
> what and where.
>
> I remain suspicious that this is a device identification problem (like
> deciding that since the drive is SATA III the controller must be as well
> (it's actually SATA II). Since I can look into the text portions of the
> .iso, where should I look? I'd like to see how it compares to the
> gparted live-cd .iso (it should be far less complex than the Linux Mint
> and certainly can run my drive).
>
>
> On 2014-11-04 14:25, Wout Mertens wrote:
> > Can you try the modprobe configs that was suggested?
>
> ___
> 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] Just a note about NixOS installation problem: nomodeset for AMD

2014-10-21 Thread Daniel Hlynskyi
I've got new computer with AMD APU A8-7600
And the story repeats - I cannot install NixOS without specifing nomodeset
as kernel parameter in Unetbootin

But Debian Live goes well. Why is that?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Correct way to solve `libgcc_s.so.1` problem

2013-10-15 Thread Daniel Hlynskyi
I'm using GHCi (inside load-env-haskell). It happend that I Ctrl-C'anceled
a threaded program and GHCi was killed with "libgcc_s.so.1 must be
installed for pthread_cancel to work"

So now I have to instruct GHCi to find this library. But what is the proper
way to do so in NixOS? I've found existing solutions
([1],[2],[3],[4],[5],[6],[7],[8]) but cannot figure what to choose and
where to write those magic lines.


[1] guile:

  # Explicitly link against libgcc_s, to work around the infamous
  # "libgcc_s.so.1 must be installed for pthread_cancel to work".
  # don't have "libgcc_s.so.1" on darwin
  LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";

[2] glibc

# When building glibc from bootstrap-tools, we need libgcc_s at RPATH
for
# any program we run, because the gcc will have been placed at a new
# store path than that determined when built (as a source for the
# bootstrap-tools tarball)
# Building from a proper gcc staying in the path where it was installed,
# libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found
without
# any special hack.
preInstall = ''
  if [ -f ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 ]; then
  mkdir -p $out/lib
  ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
  fi
'';

[3] guile-lib

  preCheck =
# Make `libgcc_s.so' visible for `pthread_cancel'.
'' export LD_LIBRARY_PATH="$(dirname $(echo
${stdenv.gcc.gcc}/lib*/libgcc_s.so)):$LD_LIBRARY_PATH"
'';

[4] androidenv/build-tools

# These binaries need to find libstdc++ and libgcc_s
for i in aidl libLLVM.so
do
patchelf --set-rpath ${stdenv_32bit.gcc.gcc}/lib $i
done

[5] castle-combat

  fixLoaderPath =
let dollar = "\$"; in
'' sed -i "$out/bin/castle-combat" \
   -e "/^exec/ iexport LD_LIBRARY_PATH=\"$(cat
${stdenv.gcc}/nix-support/orig-gcc)/lib\:"'${dollar}'"LD_LIBRARY_PATH\"\\
export LD_LIBRARY_PATH=\"$(cat
${stdenv.gcc}/nix-support/orig-gcc)/lib64\:"'${dollar}'"LD_LIBRARY_PATH\""
'';
  # ^
  # `--- The run-time says: "libgcc_s.so.1 must be installed for
  # pthread_cancel to work", which means it needs help to find it.

[6] uqm

 /* uses pthread_cancel(), which requires libgcc_s.so.1 to be
loadable at run-time. Adding the flag below ensures that the
library can be found. Obviously, though, this is a hack. */
  NIX_LDFLAGS="-lgcc_s";

[7] ufoai

  NIX_CFLAGS_LINK = "-lgcc_s"; # to avoid occasional runtime error in
finding libgcc_s.so.1

[8] pjsip

  # We need the libgcc_s.so.1 loadable (for pthread_cancel to work)
  dontPatchELF = true;
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Dashes in haskell-packages

2013-10-08 Thread Daniel Hlynskyi
That would be great!
Ok, I'll be using camelCase. Thanks all!

2013/10/8 Peter Simons 

> Oliver Charles writes:
>
>  > I would suggest carrying on with camelCase for Haskell packages for
>  > consistency. If we want to use dash naming and be equivalent to
>  > Hackage, then I think this should be done in a single commit.
>
> yes, exactly. When cabal2nix generates the 'buildDepends' field for a
> package, it assumes that the camelCase naming style is used, so it's
> important that all Haskell packages follow that convention for the time
> being. We can convert the entire haskell-packages.nix set to the new
> dashy style in one commit later (and I probably will in the foreseeable
> future).
>
> Take care,
> Peter
>
> ___
> 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] Dashes in haskell-packages

2013-10-08 Thread Daniel Hlynskyi
Hello. There is a convention to convert haskell packages names to camelCase
when they contain dashes. But Nix now can dashes.
So what convention should I use when submitting new haskell packages to
`nixpkgs`?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Clear all

2013-09-21 Thread Daniel Hlynskyi
I've heard (in Nix 1.6 release features list) that

* nix-env -i has a new flag --remove-all (-r) to remove all previous
packages from the profile.

Though, I don't know if it works with your


2013/9/21 Stewart Mackenzie 

> Hi all,
>
> I've only recently found out about nix-shell or what was nix-env
> --run-env. Though i've completely polluted my user space by installing
> everything with nix-env -i  . I'd like to clear it up and start from
> scratch properly.
>
> How do i do that? Delete the profiles directory?
>
> Secondly, what typically should be installed with nix-env? I would imagine
> its the programs one would want access to in the standard terminal
> environment. Things like firefox etc. Correct?
>
> Kind regards
> Stewart
> ___
> 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] Spam on the wiki - reminder

2013-08-06 Thread Daniel Hlynskyi
I'm assuming you've read this page
http://www.mediawiki.org/wiki/Anti-spam_features

What methods can be surely applied to NixOS wiki?

* I think of blocking spam IPs first.
(http://www.mediawiki.org/wiki/Extension:SpamBlacklist,
http://www.mediawiki.org/wiki/Anti-spam_features#Filtering_by_user_agent,
http://www.mediawiki.org/wiki/Anti-spam_features#IP_address_blacklists)
* Than rename some default actions (like sumbit -> submit2).
* Use extensions to block page creation on some criteria (for example,
it contains 'my site' keyword)
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Various NetworkManager (and KDE) problems

2013-08-06 Thread Daniel Hlynskyi
1. I am trying to switch from wpa_supplicant to NetworkManager. I have
this in configuration.nix/networking:

#wireless = {
#  enable = true;
#  driver = "wext";
#  interfaces = [ "wlp1s0" ];
#};
networkmanager.enable = true;

Though NetworkManager.service fails after rebuild:

# nixos-rebuild switch
building Nix...
building the system configuration...
updating GRUB 2 menu...
stopping the following units: local-fs.target, network-interfaces.target,
remote-fs.target, wpa_supplicant.service
activating the configuration...
setting up /etc...
updating groups...
updating users...
starting the following units: default.target, getty.target,
graphical.target, ip-up.target, local-fs.target, multi-user.target,
network-interfaces.target, network.target, paths.target, remote-fs.target,
sockets.target, sound.target, swap.target, timers.target
warning: the following units failed: NetworkManager.service

NetworkManager.service - Network Manager
   Loaded: loaded
(/nix/store/ms9kjcrsnjkc8l8hi1vnl01rsdwxmf7a-network-manager-0.9.8.0/etc/systemd/system/NetworkManager.service)
   Active: failed (Result: exit-code) since Tue 2013-08-06 16:46:44 CET;
164ms ago
  Process: 9731
ExecStart=/nix/store/ms9kjcrsnjkc8l8hi1vnl01rsdwxmf7a-network-manager-0.9.8.0/sbin/NetworkManager
--no-daemon (code=exited, status=1/FAILURE)

Aug 06 16:46:44 localhosted NetworkManager[9731]: 
[1375807604.607452] [nm-dbus-manager.c:332]
nm_dbus_manager_start_service(): Could not acquire the NetworkManager
service.
Aug 06 16:46:44 localhosted NetworkManager[9731]: 
[1375807604.608954] [main.c:599] main(): failed to start the dbus service.
Aug 06 16:46:44 localhosted systemd[1]: NetworkManager.service: main
process exited, code=exited, status=1/FAILURE
Aug 06 16:46:44 localhosted systemd[1]: Failed to start Network Manager.
Aug 06 16:46:44 localhosted systemd[1]: Unit NetworkManager.service entered
failed state.


Anyway, after that I can do
   systemctl start NetworkManager.service
and it starts without complaining. Arch-users say it is a known
problem with systemd/networkmanager. Is there a way to make it start
automatically on NixOS?

2. The KDE applet networkmanagement fails to start

# networkmanagement_configshell --connection dd-wrt create
QDBusConnection: session D-Bus connection created before
QCoreApplication. Application may misbehave.
networkmanagement_configshell(1910): KUniqueApplication: Cannot find
the D-Bus session server:  "Did not receive a reply. Possible causes
include: the remote application did not send a reply, the message bus
security policy blocked the reply, the reply timeout expired, or the
network connection was broken."

networkmanagement_configshell(1909): KUniqueApplication: Pipe closed
unexpectedly.

Though, there is a workaround (thanks to Arch users!):
# export $(dbus-launch)

I don't know why, but it solves problems with NetworkManagement applet
and ocular (yes, ocular cannot open documents without this hack). How
can I add this command at system startup or maybe it is a bug and will
be fixed soon?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Fwd: cache.nixos.org down?

2013-08-06 Thread Daniel Hlynskyi
You are right, I mean "is down" for "is unusable"

For example, when doing `nix-env -qas '*'`, I have this output spamming for
all packages:
...
download-from-binary-cache.pl: still waiting for ‘
http://cache.nixos.org/wl4q9wwlq73xh8ypm2f03bh0klhz0nmy.narinfo’ after 5
seconds...
download-from-binary-cache.pl: still waiting for ‘
http://cache.nixos.org/zd3yiz3faic33y9s1b7qgafnjxi0rspp.narinfo’ after 5
seconds...
download-from-binary-cache.pl: still waiting for ‘
http://cache.nixos.org/x2w98mila8bsr8mp7glbm53kfhknwvnk.narinfo’ after 5
seconds...
download-from-binary-cache.pl: still waiting for ‘
http://cache.nixos.org/w6md0d07k85nn8756w1d9vjxfg15874i.narinfo’ after 5
seconds...
download-from-binary-cache.pl: still waiting for ‘
http://cache.nixos.org/vgfd28j0jms49n7rr4ply3jgbm8kbf54.narinfo’ after 5
seconds...
download-from-binary-cache.pl: still waiting for ‘
http://cache.nixos.org/skc0j6xgvpmwd58rb16zjvwwwck87z5x.narinfo’ after 5
seconds...
...


2013/8/6 Rob Vermaas 

> Hi,
>
> cache.nixos.org is not down as far as we can see. It returns 403 on
> non-existing files. This is due to Amazon S3. Can you provide us with
> some more information?
>
> Cheers,
> Rob
>
> On Mon, Aug 5, 2013 at 11:59 PM, Daniel Hlynskyi 
> wrote:
> > cache.nixos.org says 403 Forbidden.
> >
> > Are there alternative binary caches available? I'm stuck with rebuilding
> > system from sources - notebook overheats and does power-off.
> >
> > ___
> > nix-dev mailing list
> > nix-dev@lists.science.uu.nl
> > http://lists.science.uu.nl/mailman/listinfo/nix-dev
> >
>
>
>
> --
> Rob Vermaas
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] cache.nixos.org down?

2013-08-05 Thread Daniel Hlynskyi
cache.nixos.org says 403 Forbidden.

Are there alternative binary caches available? I'm stuck with rebuilding
system from sources - notebook overheats and does power-off.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Fwd: Cannot upgrade old NixOS (Eelco Dolstra)

2013-08-04 Thread Daniel Hlynskyi
> Maybe you have a 32-bit system? In that case you should use
>  http://hydra.nixos.org/job/nix/trunk/build.i686-linux/latest

Thanks, you are awesome, Eelco!
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Fwd: Cannot upgrade old NixOS

2013-08-04 Thread Daniel Hlynskyi
> As Vladimir pointed out, your version of Nix is too old.

Yes, something like a year.

> The easiest solution is probably to install the latest version of Nix:
>  http://hydra.nixos.org/job/nix/trunk/build.x86_64-linux/latest
> E.g.
>  $ nix-install-package --non-interactive --url \
> http://hydra.nixos.org/build/5636025/nix/pkg/nix-1.6pre3181_8e74c0b-x86_64-linux.nixpkg
>
> Hopefully nixos-rebuild will then work.  Afterwards you can do "nix-env -e 
> nix".

Thanks, this command didn't fail and downloaded new packages. BUT new package
binaries are NOT RUNNABLE. Bash says that. So now I have runnable (but
old) nix-env
in one shell, and not runnable in all new shell tabs. The problem is
not only with
nix-env, perl is not runnable also.

old runnable nix-env hosts in `/run/current-system/sw/bin/nix-env`
new nix-env hosts in `/nix/var/nix/profiles/default/bin/nix-env`
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Cannot upgrade old NixOS

2013-08-04 Thread Daniel Hlynskyi
> The feature isn't used too much yet, so I suggest to comment out the
> offending lines in /pkgs/top-level/all-packages.nix (until you
> switch to upgraded version).

Thanks. That helped a bit. Now I have a problem:

error: `This version on Nixpkgs requires Nix >= 1.2, please upgrade`

Is it possible to recover from this point?
I tried `nix-env -u nix` - error stays.



2013/8/4 Daniel Hlynskyi 

> I have trouble to do upgrade NixOS. What is the easiest way to solve this
> problem? Do I need to reinstall NixOS from scratch?
>
> [root@localhosted:/var/log]# nixos-rebuild build --upgrade
> fetching list of Nix archives at `
> http://nixos.org/releases/nixos/nixos-13.07pre4909_b32ef4d-2238a23/MANIFEST.bz2'.
> ..
>   % Total% Received % Xferd  Average Speed   TimeTime Time
>  Current
>  Dload  Upload   Total   SpentLeft
>  Speed
> 100 2446k  100 2446k0 0   804k  0  0:00:03  0:00:03 --:--:--
>  829k
> caching /nix/store/d8xb9p7i8yda09j0f2w06ar2c674kd7w-MANIFEST.bz2...
> downloading Nix expressions from `
> http://nixos.org/releases/nixos/nixos-13.07pre4909_b32ef4d-2238a23/nixexprs.tar.bz2'.
> ..
>   % Total% Received % Xferd  Average Speed   TimeTime Time
>  Current
>  Dload  Upload   Total   SpentLeft
>  Speed
> 100 4153k  100 4153k0 0   939k  0  0:00:04  0:00:04 --:--:--
> 1007k
> unpacking channels...
> created 1 symlinks in user environment
> building Nix...
> error: syntax error, unexpected $undefined, expecting '.' or '=', at
> `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/top-level/all-packages.nix:207:6'
> (use `--show-trace' to show detailed location information)
> error: syntax error, unexpected $undefined, expecting '.' or '=', at
> `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/top-level/all-packages.nix:207:6'
> (use `--show-trace' to show detailed location information)
> error: syntax error, unexpected $undefined, expecting '.' or '=', at
> `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/top-level/all-packages.nix:207:6'
> (use `--show-trace' to show detailed location information)
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Cannot upgrade old NixOS

2013-08-04 Thread Daniel Hlynskyi
I have trouble to do upgrade NixOS. What is the easiest way to solve this
problem? Do I need to reinstall NixOS from scratch?

[root@localhosted:/var/log]# nixos-rebuild build --upgrade
fetching list of Nix archives at `
http://nixos.org/releases/nixos/nixos-13.07pre4909_b32ef4d-2238a23/MANIFEST.bz2'.
..
  % Total% Received % Xferd  Average Speed   TimeTime Time
 Current
 Dload  Upload   Total   SpentLeft
 Speed
100 2446k  100 2446k0 0   804k  0  0:00:03  0:00:03 --:--:--
 829k
caching /nix/store/d8xb9p7i8yda09j0f2w06ar2c674kd7w-MANIFEST.bz2...
downloading Nix expressions from `
http://nixos.org/releases/nixos/nixos-13.07pre4909_b32ef4d-2238a23/nixexprs.tar.bz2'.
..
  % Total% Received % Xferd  Average Speed   TimeTime Time
 Current
 Dload  Upload   Total   SpentLeft
 Speed
100 4153k  100 4153k0 0   939k  0  0:00:04  0:00:04 --:--:--
1007k
unpacking channels...
created 1 symlinks in user environment
building Nix...
error: syntax error, unexpected $undefined, expecting '.' or '=', at
`/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/top-level/all-packages.nix:207:6'
(use `--show-trace' to show detailed location information)
error: syntax error, unexpected $undefined, expecting '.' or '=', at
`/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/top-level/all-packages.nix:207:6'
(use `--show-trace' to show detailed location information)
error: syntax error, unexpected $undefined, expecting '.' or '=', at
`/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/top-level/all-packages.nix:207:6'
(use `--show-trace' to show detailed location information)
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Hackage] How to install Hackage package, not presented in nixpkgs, locally?

2012-08-15 Thread Daniel Hlynskyi
There were theese lines in the end of ghc-pkg output log:

 The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
pipes-core-0.1.0
pipes-core-0.1.0

And yes, I tried to load Control.Pipes in ghci. It worked not.

Now I solved this problem with manual `categories` install. I suppose, you
haven't noticed any problems, so the question is partly closed (I have to
do pull request to nixpkgs with appropriate patch)

2012/8/15 Andres Loeh 

> Thanks, haven't tried it yet, but ...
>
> > 7. nixpkgs$ ghc-pkg check
>
> ... the output of "ghc-pkg check" for the wrapped GHC is possibly a
> bit suspicious. Have you tried
>
> $ ghci -package pipes-core
>
> $ ghci -package categories
>
> Do these work or not?
>
> Cheers,
>   Andres
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Hackage] How to install Hackage package, not presented in nixpkgs, locally?

2012-08-15 Thread Daniel Hlynskyi
Steps:
1. ~$ git clone https://github.com/NixOS/nixpkgs.git
2. ~$ cd nixpkgs/pkgs/development/libraries/haskell/; mkdir categories;
mkdir pipes-core; cd ../../../../
3. nixpkgs$ cabal2nix cabal://categories-1.0.3 >
pkgs/development/libraries/haskell/categories/default.nix
nixpkgs$ cabal2nix cabal://pipes-core-0.1.0 >
pkgs/development/libraries/haskell/pipes-core/default.nix
4. edit pkgs/top-level/haskell-packages.nix
5. edit pkgs/top-level/haskell-default.nix to add FORCE_REBUILD = 1; (but
maybe this is redundant, because hash-warnings were not solved)
6. nixpkgs$ nix-env -f . -iA haskellPackages.pipesCore
7. nixpkgs$ ghc-pkg check

2012/8/15 Andres Loeh 

> > After rechecking found, that installing `pipes-core` package didn't
> install
> > `categories` package, .nix file for which I added also. When I installed
> > `categories`, it worked. Is it a bug? `Categories` package is mentioned
> in
> > dependencies in pipes-core/default.nix
>
> From your description, I don't fully understand what went wrong, but
> it sounds like something that shouldn't happen. Usually, if you
> install a Haskell package via nix-env, all its Haskell dependencies
> end up in the user environment, too. Do you have a sequence of
> commands that demonstrates the problem, so that I can try to reproduce
> it?
>
> Cheers,
>   Andres
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Hackage] How to install Hackage package, not presented in nixpkgs, locally?

2012-08-15 Thread Daniel Hlynskyi
Oh! Realy! Kind of magic.

After rechecking found, that installing `pipes-core` package didn't install
`categories` package, .nix file for which I added also. When I installed
`categories`, it worked. Is it a bug? `Categories` package is mentioned in
dependencies in pipes-core/default.nix

2012/8/15 Andres Loeh 

> > But dependency hell was not gone.
> >
> > pipes-core-0.1.0: dependency
> "base-4.5.0.0-f76ceb9607ba9bd4fcfb9c7b92d8cfe1"
> > doesn't exist (ignoring)
> > pipes-core-0.1.0: dependency
> > "categories-1.0.3-e9ab00168a7d0fdacafd64b31a5e1100" doesn't exist
> (ignoring)
> > pipes-core-0.1.0: dependency
> > "lifted-base-0.1.1-51e1520336adbfccd889e58e684c89a1" doesn't exist
> > (ignoring)
> > pipes-core-0.1.0: dependency
> > "monad-control-0.3.1.3-a94da65cc1c2dcd38097f790cd885593" doesn't exist
> > (ignoring)
> > pipes-core-0.1.0: dependency
> > "transformers-0.3.0.0-f2303dfef836518cc2f6901210442e10" doesn't exist
> > (ignoring)
> > pipes-core-0.1.0: dependency
> "void-0.5.6-2a27beac32f0c526d6cb6dc79bccfbd9"
> > doesn't exist (ignoring)
> >
> > What I don't understand, are the hashes. Where are they from and how to
> > solve theese dependency problems?
>
> All these are just warnings "hence the (ignoring)" and completely
> normal and harmless. You'll notice you get similar messages for other
> Haskell packages as well.
>
> Cheers,
>   Andres
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Hackage] How to install Hackage package, not presented locally?

2012-08-15 Thread Daniel Hlynskyi
>
>How to rebuild everything from source? Got to the definition of that ghc

> version, then add a dummy env var such as
>
>   FORCE_REBUILD=1;
>
> and retry. That FORCE_REBUILD should cause nix rebuilding everything
> from source. Report if this solved the issue. If it does we should
> document it on the wiki till somebody has time to find a real fix for
> it.
>
>
Do I understand correctly, change haskell-default.nix and reinstall it with

[~/nixpkgs]$ nix-env -f . -iA haskellPackages
?

I am failing to do this with another, not related problem:
...
installing `haskell-zlib-ghc7.4.1-0.5.2.0'
installing `haskell-zlib-ghc7.4.1-0.5.3.1'
error: user-thrown exception: cudatoolkit does not support platform
i686-linux
(use `--show-trace' to show detailed location information)

So I cannot finish haskellPackages install.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Hackage] How to install Hackage package, not presented in nixpkgs, locally?

2012-08-14 Thread Daniel Hlynskyi
2012/8/14 Daniel Hlynskyi 
>
> I have problem with this part. How to test packages if my nix-env doesn't
> know anything about git cloned repo? It says "error: attribute `nixpkgs' in
> selection path `nixpkgs' not found"
>

Oh that was easy. I had to do this:

[danbst@localhosted:~/nixpkgs]$ nix-env -f .  -iA haskellPackages.pipesCore
or build with
[danbst@localhosted:~/nixpkgs]$ nix-build -A haskellPackages.pipesCore

But dependency hell was not gone.


   1. pipes-core-0.1.0: dependency
   "base-4.5.0.0-f76ceb9607ba9bd4fcfb9c7b92d8cfe1" doesn't exist (ignoring)
   2. pipes-core-0.1.0: dependency
   "categories-1.0.3-e9ab00168a7d0fdacafd64b31a5e1100" doesn't exist (ignoring)
   3. pipes-core-0.1.0: dependency
   "lifted-base-0.1.1-51e1520336adbfccd889e58e684c89a1" doesn't exist
   (ignoring)
   4. pipes-core-0.1.0: dependency
   "monad-control-0.3.1.3-a94da65cc1c2dcd38097f790cd885593" doesn't exist
   (ignoring)
   5. pipes-core-0.1.0: dependency
   "transformers-0.3.0.0-f2303dfef836518cc2f6901210442e10" doesn't exist
   (ignoring)
   pipes-core-0.1.0: dependency
   "void-0.5.6-2a27beac32f0c526d6cb6dc79bccfbd9" doesn't exist (ignoring)
   6.

What I don't understand, are the hashes. Where are they from and how to
solve theese dependency problems?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Hackage] How to install Hackage package, not presented in nixpkgs, locally?

2012-08-14 Thread Daniel Hlynskyi
>
> 2012/8/14 Daniel Hlynskyi 
>
>> 2012/8/14 Patrick Wheeler 
>>
>>>
>>> Then I do a test install nix-env -iA
>>> nixpkgs.haskellPackages.. Run tests and enjoy, or commit code
>>> and preform a pull request.
>>>
>>
>> I have problem with this part. How to test packages if my nix-env doesn't
>> know anything about git cloned repo? It says "error: attribute `nixpkgs' in
>> selection path `nixpkgs' not found"
>>
>
Reposting to all
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] [Hackage] How to install Hackage package, not presented in nixpkgs, locally?

2012-08-14 Thread Daniel Hlynskyi
Hello. I'm trying to create an installable package for `pipes-core` Hackage
package.

But got in troubles.

1. I used cabal2nix, but failed on installing the .nix file. After googling
some time, I've done `nix-env -f all-packages.nix -iA
haskellPackages.pipesCore`, so I've got package locally. But it had not
registered the package, log with reasons http://pastebin.com/jp350qvX
Manual registration with `ghc-pkg register` helped not. I don't know what
to do now.

2. How can I contribute to nixpkgs with this package? The main question is
- how can I TEST my contribution, when I get it?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev