Re: [Nix-dev] Problem compiling GHC 8.0.1 on Debian

2016-09-20 Thread Jeff Johnson
You're right, thanks! I'll try master before asking next time.
Jeff

On Tue, Sep 20, 2016 at 4:45 PM, Peter Simons  wrote:

> Hi Jeff,
>
>  > I'm stuck compiling GHC 8.0.1... the current nixpkgs-unstable version
>  > gives a hash mismatch.
>
> that issue was fixed in d1b34967fea22f535c1a009f3af290c347455e8a, which
> is in master but probably not in the unstable channel yet.
>
> Best regards,
> 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


Re: [Nix-dev] Problem compiling GHC 8.0.1 on Debian

2016-09-20 Thread Jeff Johnson
Ah that makes sense. I'm so used to Nix I just assume URLs with long
hash-looking things in them will always have the same contents. So would
the best solution be to update the rest of the package to match, and if
that doesn't work find the old patch instead?
Jeff

On Tue, Sep 20, 2016 at 4:14 PM, Vladimír Čunát <vcu...@gmail.com> wrote:

> On 09/20/2016 09:52 PM, Jeff Johnson wrote:
> > Is GHC broken for anyone else? And if not, what makes my setup special?
> > Am I being redirected to the wrong patch url somehow?
>
> That feels like upstream updating the release tarball by applying some
> patch(es).
>
> --Vladimir
>
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Problem compiling GHC 8.0.1 on Debian

2016-09-20 Thread Jeff Johnson
I have NixOS, but am trying to install my existing packages in the home
folder of a Debian machine too for work. I'm stuck compiling GHC 8.0.1...
the current nixpkgs-unstable version gives a hash mismatch, which I "fixed"
like so:

diff --git a/pkgs/development/compilers/ghc/8.0.1.nix
b/pkgs/development/compilers/ghc/8.0.1.nix
index e607ef7..2fb6afe 100644
--- a/pkgs/development/compilers/ghc/8.0.1.nix
+++ b/pkgs/development/compilers/ghc/8.0.1.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 ./relocation.patch

 # Fix https://ghc.haskell.org/trac/ghc/ticket/12130
-(fetchFilteredPatch { url =
https://git.haskell.org/ghc.git/patch/4d71cc89b4e9648f3fbb29c8fcd25d725616e265;
sha256 = "0syaxb4y4s2dc440qmrggb4vagvqqhb55m6mx12rip4i9qhxl8k0"; })
+(fetchFilteredPatch { url =
https://git.haskell.org/ghc.git/patch/4d71cc89b4e9648f3fbb29c8fcd25d725616e265;
sha256 = "1z30999wgv1qnsd5kypj4lw33nj0yn0k0bax0yciqxnl1py0s87s"; })
 (fetchFilteredPatch { url =
https://git.haskell.org/ghc.git/patch/2f8cd14fe909a377b3e084a4f2ded83a0e6d44dd;
sha256 = "06zvlgcf50ab58bw6yw3krn45dsmhg4cmlz4nqff8k4z1f1bj01v"; })
   ] ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch;

But I think that might have been a mistake, because now patch fails to
apply:

building path(s)
‘/home/user/nix/store/7alsswffmxxv86cjjw1v13jl3a7q4dfy-ghc-8.0.1’,
‘/home/user/nix/store/y45l8rlzkahbv8rgx15vv8axbaisvfid-ghc-8.0.1-doc’
unpacking sources
unpacking source archive
/home/user/nix/store/8ppp85yckr3ksksg1jxlj8r9rkfm5pzx-ghc-8.0.1-src.tar.xz
source root is ghc-8.0.1
setting SOURCE_DATE_EPOCH to timestamp 1463503024 of file
ghc-8.0.1/utils/genprimopcode/Parser.hs
patching sources
applying patch
/home/user/nix/store/d14agb1vzr6m0hqzkrcjf3mdbxhclwg9-ghc-8.x-dont-pass-linker-flags-via-response-files.patch
patching file compiler/main/SysTools.hs
Hunk #1 succeeded at 422 (offset 8 lines).
Hunk #2 succeeded at 944 (offset 8 lines).
applying patch
/home/user/nix/store/a7m73963gnbxzxjpr46sn9mrjlb9mjp2-relocation.patch
patching file rts/Linker.c
Hunk #1 succeeded at 5855 (offset 174 lines).
applying patch
/home/user/nix/store/0ic419xjc11055bg7cgad4ki9zmfsmz2-4d71cc89b4e9648f3fbb29c8fcd25d725616e265
patching file compiler/rename/RnPat.hs
Hunk #1 succeeded at 636 (offset 1 line).
Hunk #2 succeeded at 648 (offset 1 line).
patching file testsuite/tests/th/T12130.hs
patching file testsuite/tests/th/T12130a.hs
can't find file to patch at input line 97
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--
|diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
|index 75364dc..bd59c4e 100644
|--- a/testsuite/tests/th/all.T
|+++ b/testsuite/tests/th/all.T
--
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
builder for
‘/home/user/nix/store/aqmsxln2avyla8p7m5504ilqnxibq3wh-ghc-8.0.1.drv’
failed with exit code 1

Is GHC broken for anyone else? And if not, what makes my setup special? Am
I being redirected to the wrong patch url somehow?
Jeff
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Current path to installing on Raspberry Pi?

2015-01-23 Thread Jeff Johnson
Oh that makes sense. Might not be too hard to fix either. I'll try
when I get home tonight. Thanks!

On 1/23/15, Wout Mertens wout.mert...@gmail.com wrote:
 those errors seem to come from a shell trying to interpret perl source...

 On Mon Jan 12 2015 at 9:04:34 PM Jeff Johnson jef...@gmail.com wrote:

 Hi all! I just tried to install NixOS on my Raspberry Pi following the
 wiki page (https://nixos.org/wiki/Raspberry_Pi). I think I got pretty
 close, but not quite all the way. I wrote the image to an sd card, booted
 it up, logged in as root, changed the nix-channel from unstable to 13.10,
 and tried to upgrade with:

 nixos-rebuild switch --upgrade

 It gave an error about needing at least nix 1.7 to parse the current nix
 expressions. I found the latest build and installed it following the
 directions on the wiki (
 https://nixos.org/wiki/How_to_update_when_nix_is_too_old_to_evaluate_nixpkgs
 ):

 nix-install-package --non-interactive --url
 http://hydra.nixos.org/build/18524521/nix/pkg/nix-1.8-armv6l-linux.nixpkg

 That appeared to work, but now when I rerun the upgrade command I get an
 error from the perl interpreter:

 [root@nixos:~]# nixos-rebuild switch --upgrade
 /root/.nix-profile/bin/nix-channel: line 3: use: command not found
 /root/.nix-profile/bin/nix-channel: line 4: use: command not found
 /root/.nix-profile/bin/nix-channel: line 5: use: command not found
 /root/.nix-profile/bin/nix-channel: line 6: syntax error near unexpected
 token '('
 /root/.nix-profile/bin/nix-channel: line 6: `use File::Path qw(mkpath);'

 I tried moving /root/.nix-profile but the version in /nix/var/... that it
 falls back on gives the same error. Do I need to manually find and
 install
 some dependencies?
 Thanks
 Jeff
 ___
 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 create dirs needed by a module before it runs?

2015-01-23 Thread Jeff Johnson
Oh weird, maybe I need to go back and see if I did something wrong
with the hostname, because now that I think about it you're
right--they should all be evaluated at once. I think the
system.activationScripts are an exception though. They seem to run
after everything's evaluated (they print their installing messages
right after nix does setting up /etc... but before it starts systemd
units). Which is the sensible way to do it, you wouldn't want them to
run before nix knows the expressions are valid. I was mostly wondering
if there's a separate pre-nix-eval hook somewhere. I could see it
being useful for other things too, like checking that the nixpkgs repo
exists if you have your own or aborting if there's no network
connection.
Jeff

On 1/23/15, Wout Mertens wout.mert...@gmail.com wrote:
 What do you mean with only get installed at the end?

 Also, networking.hostName should work, the whole config gets evaluated at
 once. There's no running in Nix, only side-effects of evaluation.

 Wout.

 On Fri Jan 23 2015 at 7:45:38 PM Jeff Johnson jef...@gmail.com wrote:

 Hi all! I'm trying to set up tarsnap on nixos. This is my tarsnap.nix so
 far:

 config:

 let
   keySrc   = ../rawpriv/tarsnap;
   cacheDir = /var/cache/tarsnap;

   rcSrc = builtins.toFile tarsnaprc ''
 aggressive-networking # TODO is this a good idea?
 humanize-numbers
   '';

   script = homeDir:
 let
   keyDst = ${homeDir}/tarsnap.key;
   rcDst  = ${homeDir}/.tarsnaprc;
 in ''
   echo installing ${keyDst}  ; install -m400
 ${keySrc}/`hostname`.key ${keyDst}
   echo installing ${rcDst}   ; ln -fs ${rcSrc} ${rcDst}
   echo installing ${cacheDir}; mkdir -p ${cacheDir}
 '';

 in {
   system.activationScripts = { tarsnap = script /root; };
   services.tarsnap = {
 inherit config;
 enable   = true;
 keyfile  = keyDst;
 cachedir = cacheDir;
   };
 }

 It works except that the keyfile and cachedir only get installed at
 the end, so nix complains that they don't exist unless I create them
 manually first. Is there a way to make the script run earlier? And
 another possibly-related question: is there a way to find out the
 hostname? I can't just do `networking.hostName` because that's set in
 the top-level config after this module runs. Do I just pass it as an
 argument? Thanks
 Jeff
 ___
 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 create dirs needed by a module before it runs?

2015-01-23 Thread Jeff Johnson
In case there isn't a hook I just thought of the obvious solution:
wrap `nixos-rebuild` in a shell script.

On 1/23/15, Jeff Johnson jef...@gmail.com wrote:
 Oh weird, maybe I need to go back and see if I did something wrong
 with the hostname, because now that I think about it you're
 right--they should all be evaluated at once. I think the
 system.activationScripts are an exception though. They seem to run
 after everything's evaluated (they print their installing messages
 right after nix does setting up /etc... but before it starts systemd
 units). Which is the sensible way to do it, you wouldn't want them to
 run before nix knows the expressions are valid. I was mostly wondering
 if there's a separate pre-nix-eval hook somewhere. I could see it
 being useful for other things too, like checking that the nixpkgs repo
 exists if you have your own or aborting if there's no network
 connection.
 Jeff

 On 1/23/15, Wout Mertens wout.mert...@gmail.com wrote:
 What do you mean with only get installed at the end?

 Also, networking.hostName should work, the whole config gets evaluated
 at
 once. There's no running in Nix, only side-effects of evaluation.

 Wout.

 On Fri Jan 23 2015 at 7:45:38 PM Jeff Johnson jef...@gmail.com wrote:

 Hi all! I'm trying to set up tarsnap on nixos. This is my tarsnap.nix so
 far:

 config:

 let
   keySrc   = ../rawpriv/tarsnap;
   cacheDir = /var/cache/tarsnap;

   rcSrc = builtins.toFile tarsnaprc ''
 aggressive-networking # TODO is this a good idea?
 humanize-numbers
   '';

   script = homeDir:
 let
   keyDst = ${homeDir}/tarsnap.key;
   rcDst  = ${homeDir}/.tarsnaprc;
 in ''
   echo installing ${keyDst}  ; install -m400
 ${keySrc}/`hostname`.key ${keyDst}
   echo installing ${rcDst}   ; ln -fs ${rcSrc} ${rcDst}
   echo installing ${cacheDir}; mkdir -p ${cacheDir}
 '';

 in {
   system.activationScripts = { tarsnap = script /root; };
   services.tarsnap = {
 inherit config;
 enable   = true;
 keyfile  = keyDst;
 cachedir = cacheDir;
   };
 }

 It works except that the keyfile and cachedir only get installed at
 the end, so nix complains that they don't exist unless I create them
 manually first. Is there a way to make the script run earlier? And
 another possibly-related question: is there a way to find out the
 hostname? I can't just do `networking.hostName` because that's set in
 the top-level config after this module runs. Do I just pass it as an
 argument? Thanks
 Jeff
 ___
 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] How to create dirs needed by a module before it runs?

2015-01-23 Thread Jeff Johnson
Hi all! I'm trying to set up tarsnap on nixos. This is my tarsnap.nix so far:

config:

let
  keySrc   = ../rawpriv/tarsnap;
  cacheDir = /var/cache/tarsnap;

  rcSrc = builtins.toFile tarsnaprc ''
aggressive-networking # TODO is this a good idea?
humanize-numbers
  '';

  script = homeDir:
let
  keyDst = ${homeDir}/tarsnap.key;
  rcDst  = ${homeDir}/.tarsnaprc;
in ''
  echo installing ${keyDst}  ; install -m400
${keySrc}/`hostname`.key ${keyDst}
  echo installing ${rcDst}   ; ln -fs ${rcSrc} ${rcDst}
  echo installing ${cacheDir}; mkdir -p ${cacheDir}
'';

in {
  system.activationScripts = { tarsnap = script /root; };
  services.tarsnap = {
inherit config;
enable   = true;
keyfile  = keyDst;
cachedir = cacheDir;
  };
}

It works except that the keyfile and cachedir only get installed at
the end, so nix complains that they don't exist unless I create them
manually first. Is there a way to make the script run earlier? And
another possibly-related question: is there a way to find out the
hostname? I can't just do `networking.hostName` because that's set in
the top-level config after this module runs. Do I just pass it as an
argument? Thanks
Jeff
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] How to create dirs needed by a module before it runs?

2015-01-23 Thread Jeff Johnson
That would work except the mkdir commands are evaluated using ${nixVars} so
the dirs aren't literally in there. I think I'm more comfortable adding
duplicated variables one by one in the shell script than trying to do any
magic.
Jeff

On Fri, Jan 23, 2015 at 11:49 AM, Marc Weber marco-owe...@gmx.de wrote:

 Why not cd into the modules directory and grep for mkdir?

 Marc Weber
 ___
 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] Current path to installing on Raspberry Pi?

2015-01-23 Thread Jeff Johnson
OK I'm a little lost. The shell is doing something weird, but I'm not sure
what. When I `_NIXOS_REBUILD_REEXEC=1 nixos-rebuild switch`, it says:

/run/current-system/sw/bin/nixos-rebuild: like 141:
/root/.nix-profile/bin/nix-instantiate: cannot execute binary file
building the system configuration...
/root/.nix-profile/bin/nix-build: line 3: user: command not found
... that repeats for each line up to 18 ...

If I try to run nix-instantiate directly it has the same cannot execute
binary file error, which means it's mistakenly being interpreted by bash
too right? I tried `perl $(which nixos-rebuild) switch`, but same error.

The other thing I tried is looking for older builds. Somebody reported
being able to upgrade to 13.10 in September, so if I take a build of nix
from then maybe it'll still work. But I can't find the armv6l ones listed
anywhere on the hydra site. Is it possible to find them without knowing the
hash URL already?
Jeff

On Fri, Jan 23, 2015 at 11:18 AM, Jeff Johnson jef...@gmail.com wrote:

 Oh that makes sense. Might not be too hard to fix either. I'll try
 when I get home tonight. Thanks!

 On 1/23/15, Wout Mertens wout.mert...@gmail.com wrote:
  those errors seem to come from a shell trying to interpret perl source...
 
  On Mon Jan 12 2015 at 9:04:34 PM Jeff Johnson jef...@gmail.com wrote:
 
  Hi all! I just tried to install NixOS on my Raspberry Pi following the
  wiki page (https://nixos.org/wiki/Raspberry_Pi). I think I got pretty
  close, but not quite all the way. I wrote the image to an sd card,
 booted
  it up, logged in as root, changed the nix-channel from unstable to
 13.10,
  and tried to upgrade with:
 
  nixos-rebuild switch --upgrade
 
  It gave an error about needing at least nix 1.7 to parse the current nix
  expressions. I found the latest build and installed it following the
  directions on the wiki (
 
 https://nixos.org/wiki/How_to_update_when_nix_is_too_old_to_evaluate_nixpkgs
  ):
 
  nix-install-package --non-interactive --url
 
 http://hydra.nixos.org/build/18524521/nix/pkg/nix-1.8-armv6l-linux.nixpkg
 
  That appeared to work, but now when I rerun the upgrade command I get an
  error from the perl interpreter:
 
  [root@nixos:~]# nixos-rebuild switch --upgrade
  /root/.nix-profile/bin/nix-channel: line 3: use: command not found
  /root/.nix-profile/bin/nix-channel: line 4: use: command not found
  /root/.nix-profile/bin/nix-channel: line 5: use: command not found
  /root/.nix-profile/bin/nix-channel: line 6: syntax error near unexpected
  token '('
  /root/.nix-profile/bin/nix-channel: line 6: `use File::Path qw(mkpath);'
 
  I tried moving /root/.nix-profile but the version in /nix/var/... that
 it
  falls back on gives the same error. Do I need to manually find and
  install
  some dependencies?
  Thanks
  Jeff
  ___
  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] Encrypted root: LUKS over LVM

2015-01-14 Thread Jeff Johnson
I just installed NixOS on a couple machines this week, and set them both up
this way. I remember seeing that error, but not exactly how I fixed
it--sorry, should have taken note! One thing I remember changing is the
preLVM. The wiki says to have it there but that didn't work for me. I
removed it and then it did work.

EDIT: Just saw that you fixed that. ^ Nevermind.

About the weird booting, I'm not sure. But one thing I did differently is I
named the underlying LUKS partition luks and the LVM lvm--maybe the two
mains collide somehow? And the other is I used /dev/disk/by-uuid/... paths
for all the partitions instead of /dev/sdX ones.
Jeff

On Wed, Jan 14, 2015 at 9:26 PM, James Cook james.c...@utoronto.ca wrote:

 Sorry, still no idea. I'm using LUKS but not with LVM, and I don't
 have this problem. Is anyone else using LVM over LUKS? Is there
 something strange about Nikit's configuration?

 Maybe there is some way to record all the commands that are run on
 boot and figure out which nixos expressions are responsible for them,
 to get to the root of the problem.

 James


 On 11 January 2015 at 01:54, Nikita Karetnikov nik...@karetnikov.org
 wrote:
 
 ___
 nix-dev mailing list
 nix-dev@lists.science.uu.nl
 http://lists.science.uu.nl/mailman/listinfo/nix-dev

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


Re: [Nix-dev] NixOS after install no login

2015-01-13 Thread Jeff Johnson
For me the installer ended with a prompt for setting the root password, and
then after that I rebooted into the new system. Did you not have that?

One other possiblity: did you set `users.mutableUsers = false;`? I did and
it locked me out of the system because I hadn't included a hashed password.
Jeff

On Tue, Jan 13, 2015 at 5:42 AM, MCris mc...@accessmedia.ro wrote:

 Good afternoon. After succesfully installing NixOS from DVD ISO, the
 login with 'root' and blank password does not work anymore (I didn't
 create any other user prior install).
 How to log in to use the system?
 ___
 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] Current path to installing on Raspberry Pi?

2015-01-12 Thread Jeff Johnson
Hi all! I just tried to install NixOS on my Raspberry Pi following the wiki
page (https://nixos.org/wiki/Raspberry_Pi). I think I got pretty close, but
not quite all the way. I wrote the image to an sd card, booted it up,
logged in as root, changed the nix-channel from unstable to 13.10, and
tried to upgrade with:

nixos-rebuild switch --upgrade

It gave an error about needing at least nix 1.7 to parse the current nix
expressions. I found the latest build and installed it following the
directions on the wiki (
https://nixos.org/wiki/How_to_update_when_nix_is_too_old_to_evaluate_nixpkgs
):

nix-install-package --non-interactive --url
http://hydra.nixos.org/build/18524521/nix/pkg/nix-1.8-armv6l-linux.nixpkg

That appeared to work, but now when I rerun the upgrade command I get an
error from the perl interpreter:

[root@nixos:~]# nixos-rebuild switch --upgrade
/root/.nix-profile/bin/nix-channel: line 3: use: command not found
/root/.nix-profile/bin/nix-channel: line 4: use: command not found
/root/.nix-profile/bin/nix-channel: line 5: use: command not found
/root/.nix-profile/bin/nix-channel: line 6: syntax error near unexpected
token '('
/root/.nix-profile/bin/nix-channel: line 6: `use File::Path qw(mkpath);'

I tried moving /root/.nix-profile but the version in /nix/var/... that it
falls back on gives the same error. Do I need to manually find and install
some dependencies?
Thanks
Jeff
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev