[Nix-dev] USB disks with LVM on boot

2015-12-29 Thread Alex Brandt
Hey,

I'm trying to setup a three disk software RAID1 with LVM on USB drives.  I get 
everything working great and add the filesystems to my nix configuration.  
Upon reboot I get the following:

Dec 29 02:35:18 mycroft.alunduil.com systemd[1]: Job dev-disk-
by\x2duuid-8db66416\x2d4a8a\x2d4f89\x2db828\x2d55cb2b2ded50.device/start timed 
out.
Dec 29 02:35:18 mycroft.alunduil.com systemd[1]: Timed out waiting for device 
dev-disk-by\x2duuid-8db66416\x2d4a8a\x2d4f89\x2db828\x2d55cb2b2ded50.device.
Dec 29 02:35:18 mycroft.alunduil.com systemd[1]: Dependency failed for 
/var/db/postgresql.
Dec 29 02:35:18 mycroft.alunduil.com systemd[1]: Dependency failed for Local 
File Systems.
Dec 29 02:35:18 mycroft.alunduil.com systemd[1]: Triggering OnFailure= 
dependencies of local-fs.target.
Dec 29 02:35:18 mycroft.alunduil.com systemd[1]: Job dev-disk-
by\x2duuid-8ecf60d1\x2d8450\x2d46c7\x2db171\x2db7eb5c4b2ade.device/start timed 
out.
Dec 29 02:35:18 mycroft.alunduil.com systemd[1]: Timed out waiting for device 
dev-disk-by\x2duuid-8ecf60d1\x2d8450\x2d46c7\x2db171\x2db7eb5c4b2ade.device.
Dec 29 02:35:18 mycroft.alunduil.com systemd[1]: Dependency failed for 
/var/backups.
Dec 29 02:35:18 mycroft.alunduil.com systemd[1]: Dependency failed for 
/var/backups/laptops.
Dec 29 02:35:18 mycroft.alunduil.com systemd[1]: Job dev-disk-by\x2duuid-
add90682\x2dac74\x2d40cd\x2db541\x2d7d19bc579c77.device/start timed out.
Dec 29 02:35:18 mycroft.alunduil.com systemd[1]: Timed out waiting for device 
dev-disk-by\x2duuid-add90682\x2dac74\x2d40cd\x2db541\x2d7d19bc579c77.device.
Dec 29 02:35:18 mycroft.alunduil.com systemd[1]: Starting Create Volatile 
Files and Directories...

Which simply triggers a shutdown of systemd.  I'm guessing that it's either 
LVM not activating the volume group or that the disks don't come up when they 
need to.  Is there anyway to resolve these issues by upping a timeout or 
forcing LVM to enable the volumes?  If not my only strategy will be to go with 
physical partitions (not a big deal but am very curiuos about this use).

Regards,

-- 
Alex Brandt
Software Developer for Rackspace and Developer for Gentoo
http://blog.alunduil.com


signature.asc
Description: This is a digitally signed message part.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] isFloat

2015-12-29 Thread Harald van Dijk
On 29/12/2015 13:20, Игорь Пашев wrote:
 > Is anybody needs floats in options :-)
 >
 >isFloat = x: isInt x ||
 >( isString x &&
 >  3 > length (splitString "." x) &&
 >  all (s: 2 == length (splitString s " 0123456789. "))
 > (stringToCharacters x)
 >);

Nice. Here are some corner cases to consider though :)

   isFloat (sub 0 1) -> true
yet
   isFloat (toString (sub 0 1)) -> false

   isFloat "" -> true
   isFloat ".." -> true
   isFloat "1.2." -> true
   isFloat "1 2" -> true

How about this alternative using a regex?

   isFloat = x: with builtins;
 match "-?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)" (toString x) != null;

This assumes "1" is valid, "1.1" is valid, "1." is valid, ".1" is valid, 
but plain "." is invalid. It allows an optional leading minus sign 
regardless of whether the argument is an integer or a string. It doesn't 
allow any spaces, not even leading or trailing spaces.

If the precise syntax of allowable floating point numbers changes, for 
instance if "." must always be followed by a digit, if a leading "+" is 
also allowed, if exponential notation ("1E10") is supposed to be 
allowed, if some spaces should be allowed, etc., it can be tweaked 
fairly easily.

Cheers,
Harald van Dijk
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] isFloat

2015-12-29 Thread Игорь Пашев
OMG :-) Thank you. I didn't know about regexes. Now we are saved!
29 дек. 2015 г. 23:38 пользователь "Harald van Dijk" 
написал:

> On 29/12/2015 13:20, Игорь Пашев wrote:
> > Is anybody needs floats in options :-)
> >
> >isFloat = x: isInt x ||
> >( isString x &&
> >  3 > length (splitString "." x) &&
> >  all (s: 2 == length (splitString s " 0123456789. "))
> > (stringToCharacters x)
> >);
>
> Nice. Here are some corner cases to consider though :)
>
>   isFloat (sub 0 1) -> true
> yet
>   isFloat (toString (sub 0 1)) -> false
>
>   isFloat "" -> true
>   isFloat ".." -> true
>   isFloat "1.2." -> true
>   isFloat "1 2" -> true
>
> How about this alternative using a regex?
>
>   isFloat = x: with builtins;
> match "-?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)" (toString x) != null;
>
> This assumes "1" is valid, "1.1" is valid, "1." is valid, ".1" is valid,
> but plain "." is invalid. It allows an optional leading minus sign
> regardless of whether the argument is an integer or a string. It doesn't
> allow any spaces, not even leading or trailing spaces.
>
> If the precise syntax of allowable floating point numbers changes, for
> instance if "." must always be followed by a digit, if a leading "+" is
> also allowed, if exponential notation ("1E10") is supposed to be allowed,
> if some spaces should be allowed, etc., it can be tweaked fairly easily.
>
> Cheers,
> Harald van Dijk
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Escape ${ in multiline string

2015-12-29 Thread 4levels
Great, that did the trick!

To bad I couldn't find this info myself, thanks a lot for your swift
replies!

Kind regards,

Erik

On Tue, Dec 29, 2015 at 1:22 PM Bjørn Forsman 
wrote:

> On 29 December 2015 at 13:05, 4levels <4lev...@gmail.com> wrote:
> > Hi Nix Devs,
> >
> > I'm currently struggling to create a bash script within a nix multiline
> > string, terminted by double single quotes.
> >
> > In the bash script, I need to put ${} statements but this is throwing
> > compile errors (Undefined variable error).  I've tried escaping the $
> sign
> > with a backslash, but that doesn't help.  I also tried escaping with a
> > double backslash, same result.
> >
> > Any ideas? Should I rewrite the bash script to not use the ${ statements?
> >
> > Kind regards,
> >
> > code example
> >   s3Backup = name:
> >   ''
> > ...
> > DAILYLOGFILE="/var/log/duplicity/backup.log"
> > ...
> > # Clear the old daily log file
> > cat /dev/null > ${DAILYLOGFILE}  // -> compile error: undefined
> > variable DAILYLOGFILE
> > ...
> >   '';
>
> Try with two single quotes in front of ${DAILYLOGFILE}:
>
>   ''${DAILYLOGFILE}
>
> It is documented here, in the "simple values" section:
>
>   http://nixos.org/nix/manual/#ssec-values
>
> Best regards,
> Bjørn Forsman
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Disabling patchelf on ARM

2015-12-29 Thread Joachim Schiele
On 26.12.2015 12:55, Jookia wrote:
> Hey there,
> 
> I've been working for a few months on getting a Novena port of NixOS running.
> The overall Nix infrastructure works, though I still have a ton of issues to
> solve before publishing any patches required on a git repository (they 
> probably
> won't be merged in to nixpkgs anyway.)

if they are good patches we will merge them!

> A problem I've been dealing with is mysterious segmentation faults affecting 
> the
> system along with bugs that aren't present in Debian on the same system.
> patchelf has been the culprit for quite a few of them and upstream doesn't 
> seem
> to be working on fixing this.

patchelf is used to deploy the initial bootstrap-tools. later one there
is only minimal use, as you already said, for binary only applications.

please provide an exaple, where patchelf is doing something wrong with
some paste from the shell.

thank you

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


Re: [Nix-dev] Escape ${ in multiline string

2015-12-29 Thread jeaye
On Tue, Dec 29, 2015 at 12:05:23PM +, 4levels wrote:
>Hi Nix Devs,
>I'm currently struggling to create a bash script within a nix multiline
>string, terminted by double single quotes.
>In the bash script, I need to put ${} statements but this is throwing
>compile errors (Undefined variable error).  I've tried escaping the $ sign
>with a backslash, but that doesn't help.  I also tried escaping with a
>double backslash, same result.
>Any ideas? Should I rewrite the bash script to not use the ${ statements?
>Kind regards,
>code example
>      s3Backup = name:
>      ''
>        ...
>        DAILYLOGFILE="/var/log/duplicity/backup.log"
>        ...
>        # Clear the old daily log file
>        cat /dev/null > ${DAILYLOGFILE}  // -> compile error: undefined
>variable DAILYLOGFILE
>        ...
>      '';
>Erik aka 4levels

The trick is to put another double single quote pair before the ${FOO}.
So ${DAILYLOGFILE} should be ''${DAILYLOGFILE}.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Escape ${ in multiline string

2015-12-29 Thread Bjørn Forsman
On 29 December 2015 at 13:05, 4levels <4lev...@gmail.com> wrote:
> Hi Nix Devs,
>
> I'm currently struggling to create a bash script within a nix multiline
> string, terminted by double single quotes.
>
> In the bash script, I need to put ${} statements but this is throwing
> compile errors (Undefined variable error).  I've tried escaping the $ sign
> with a backslash, but that doesn't help.  I also tried escaping with a
> double backslash, same result.
>
> Any ideas? Should I rewrite the bash script to not use the ${ statements?
>
> Kind regards,
>
> code example
>   s3Backup = name:
>   ''
> ...
> DAILYLOGFILE="/var/log/duplicity/backup.log"
> ...
> # Clear the old daily log file
> cat /dev/null > ${DAILYLOGFILE}  // -> compile error: undefined
> variable DAILYLOGFILE
> ...
>   '';

Try with two single quotes in front of ${DAILYLOGFILE}:

  ''${DAILYLOGFILE}

It is documented here, in the "simple values" section:

  http://nixos.org/nix/manual/#ssec-values

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


Re: [Nix-dev] Disabling patchelf on ARM

2015-12-29 Thread Lluís Batlle i Rossell
For what I remember, Patchelf is used in most stdenv.mkDerivation just to
shorten the number of dependencies (shrink-rpath).

In armv5tel, I remember that my binaries were broken if I run patchelf
*ONCE*. If I run patchelf *TWICE*, they worked fine. That's clearly an
jnsolved bug worked around. I think it was never fixed in patchelf,
because there was this work-around and noone looked at the problem
anymore.

I think that for arv6 or armv7 the double-patchelf was not required
anymore; I can't tell. I have not checked how does it work now with those
archs.

Jokia, it'd be great if you would gather details beyond "it breaks 
binaries", and even better if you could propose a fix. :)

Regards,
Lluís.

On Tue, Dec 29, 2015 at 12:24:33PM +0100, Joachim Schiele wrote:
> On 26.12.2015 12:55, Jookia wrote:
> > Hey there,
> > 
> > I've been working for a few months on getting a Novena port of NixOS 
> > running.
> > The overall Nix infrastructure works, though I still have a ton of issues to
> > solve before publishing any patches required on a git repository (they 
> > probably
> > won't be merged in to nixpkgs anyway.)
> 
> if they are good patches we will merge them!
> 
> > A problem I've been dealing with is mysterious segmentation faults 
> > affecting the
> > system along with bugs that aren't present in Debian on the same system.
> > patchelf has been the culprit for quite a few of them and upstream doesn't 
> > seem
> > to be working on fixing this.
> 
> patchelf is used to deploy the initial bootstrap-tools. later one there
> is only minimal use, as you already said, for binary only applications.
> 
> please provide an exaple, where patchelf is doing something wrong with
> some paste from the shell.
> 
> thank you
> 
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev

-- 
(Escriu-me xifrat si saps PGP / Write ciphered if you know PGP)
PGP key D4831A8A - https://emailselfdefense.fsf.org/
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Escape ${ in multiline string

2015-12-29 Thread 4levels
Hi Nix Devs,

I'm currently struggling to create a bash script within a nix multiline
string, terminted by double single quotes.

In the bash script, I need to put ${} statements but this is throwing
compile errors (Undefined variable error).  I've tried escaping the $ sign
with a backslash, but that doesn't help.  I also tried escaping with a
double backslash, same result.

Any ideas? Should I rewrite the bash script to not use the ${ statements?

Kind regards,

code example
  s3Backup = name:
  ''
...
DAILYLOGFILE="/var/log/duplicity/backup.log"
...
# Clear the old daily log file
cat /dev/null > ${DAILYLOGFILE}  // -> compile error: undefined
variable DAILYLOGFILE
...
  '';


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


[Nix-dev] isFloat

2015-12-29 Thread Игорь Пашев
Is anybody needs floats in options :-)

  isFloat = x: isInt x ||
  ( isString x &&
3 > length (splitString "." x) &&
all (s: 2 == length (splitString s " 0123456789. "))
(stringToCharacters x)
  );

  float = mkOptionType {
name = "float";
check = isFloat;
  };
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Disabling patchelf on ARM

2015-12-29 Thread Jookia
On Tue, Dec 29, 2015 at 12:32:35PM +0100, Lluís Batlle i Rossell wrote:
> For what I remember, Patchelf is used in most stdenv.mkDerivation just to
> shorten the number of dependencies (shrink-rpath).

Yeah- shrink-rpath is doing the damage.

> In armv5tel, I remember that my binaries were broken if I run patchelf
> *ONCE*. If I run patchelf *TWICE*, they worked fine. That's clearly an
> jnsolved bug worked around. I think it was never fixed in patchelf,
> because there was this work-around and noone looked at the problem
> anymore.

> I think that for arv6 or armv7 the double-patchelf was not required
> anymore; I can't tell. I have not checked how does it work now with those
> archs.

I may have to test that- but it's still definitely something that breaks on my
machine.

> Jokia, it'd be great if you would gather details beyond "it breaks
> binaries", and even better if you could propose a fix. :)

On an ARM system, install vim_configurable (doesn't matter which configuration)-
it'll segfault after being stripped by patchelf. I can't remember off the top of
my head any other examples, but I know that one certainly breaks.

The most I can find is https://github.com/NixOS/patchelf/issues/8 which may or
may not be related as it affects Fedora. My solution is to disable patchelf
since it's breaking things without good reason.

> Regards,
> Lluís.

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


Re: [Nix-dev] Disabling patchelf on ARM

2015-12-29 Thread Jookia
On Tue, Dec 29, 2015 at 12:24:33PM +0100, Joachim Schiele wrote:
> if they are good patches we will merge them!

I appreciate the enthusiasm. :)

Unfortunately the mailing list doesn't seem to do many patch reviews which
conflicts with my want to do things slowly. The only way I can see merging
happening is if I showered a ton of patches for review, some related to ARM,
some not but still required for the Novena, and hope people review them and
cherry pick them. I suppose I could always privately contact the maintainers of
wherever I'm patching, but that feels a little too opaque for my tastes.

Maintaining my own fork public nixpkgs is impossible given how long compile
times are when it comes to Nix. Rebasing could take a few days on my stripped
down install since I don't (nor does anyone seem to) have an ARM build farm, I
shudder to think if any Novena users want to run more than i3, it'd probably
take a magnitude longer considering some builds only work single-threaded, and
as we focus more on reproducible builds I imagine we'll be reverting back for
things like Haskell. At that point it may actually be impossible to build and
run NixOS using just an ARM machine and no binary caches.

Pessimism aside, an ARM build farm is a solvable, unrelated problem to my
patches. As long as I can get some review upstreaming shouldn't be a problem.

> patchelf is used to deploy the initial bootstrap-tools. later one there
> is only minimal use, as you already said, for binary only applications.
>
> please provide an exaple, where patchelf is doing something wrong with
> some paste from the shell.
>
> thank you

Installing vim_configurable on ARM seems to do the trick. I can't reproduce it
right now, mysterious. Perhaps I have a patched version, I'll check later.

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