Re: [Nix-dev] Permission error when installing mpd

2015-02-18 Thread Kirill Elagin
As is clear from the log, it is not mpd who creates the directory, it’s the


preStart = "mkdir -p ${cfg.dataDir} && chown -R mpd:mpd  ${cfg.dataDir}";


line it its unit file. The permission error likely happens because it
doesn’t have the search (x) permission. Remember that it is running as
`mpd` user. Are you sure you want to have the `dataDir` in your home?

On Thu Feb 19 2015 at 9:23:28 AM Nikita Karetnikov 
wrote:

> I've tried various options, but mpd always fails with a permission error.
> Here's one example:
>
>   services.mpd.enable = true;
>   services.mpd.dataDir = "/home/nikita/dotfiles/mpd/.mpd";
>   services.mpd.musicDirectory = "/home/nikita/music";
>
> Both directories exist.
>
> $ journalctl -u mpd.service
>
> Feb 19 09:11:22 mu systemd[1]: Starting Music Player Daemon...
> Feb 19 09:11:22 mu systemd[1]: mpd.service: control process exited,
> code=exited status=1
> Feb 19 09:11:22 mu systemd[1]: Failed to start Music Player Daemon.
> Feb 19 09:11:22 mu systemd[1]: Unit mpd.service entered failed state.
> Feb 19 09:11:22 mu systemd[1]: mpd.service failed.
> Feb 19 09:11:22 mu mpd-pre-start[15264]: mkdir: cannot create directory
> ‘/home/nikita’: Permission denied
>
> Why is it even trying to create "/home/nikita"?
> ___
> 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] Permission error when installing mpd

2015-02-18 Thread James Cook
On 18 February 2015 at 22:22, Nikita Karetnikov  wrote:
> I've tried various options, but mpd always fails with a permission error.
> Here's one example:
>
>   services.mpd.enable = true;
>   services.mpd.dataDir = "/home/nikita/dotfiles/mpd/.mpd";
>   services.mpd.musicDirectory = "/home/nikita/music";
>
> Both directories exist.
>
> $ journalctl -u mpd.service
>
> Feb 19 09:11:22 mu systemd[1]: Starting Music Player Daemon...
> Feb 19 09:11:22 mu systemd[1]: mpd.service: control process exited, 
> code=exited status=1
> Feb 19 09:11:22 mu systemd[1]: Failed to start Music Player Daemon.
> Feb 19 09:11:22 mu systemd[1]: Unit mpd.service entered failed state.
> Feb 19 09:11:22 mu systemd[1]: mpd.service failed.
> Feb 19 09:11:22 mu mpd-pre-start[15264]: mkdir: cannot create directory 
> ‘/home/nikita’: Permission denied
>
> Why is it even trying to create "/home/nikita"?

Hi Nikita,

Looking at the source (nixos/modules/services/audio/mpd.nix), it looks
like the mpd service is designed to run as the mpd user. If you are
willing to go with that design, I guess you should not set
services.mpd.dataDir, and make sure the mpd user has read access to
your music directory. (It tries to create /home/nikita because that's
where its dataDir is supposed to go.)

If you'd rather mpd be run as your own user, I don't think NixOS has
support for that, so the easiest solution is probably to add mpd to
environment.systemPackages and just start mpd yourself.

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


[Nix-dev] Permission error when installing mpd

2015-02-18 Thread Nikita Karetnikov
I've tried various options, but mpd always fails with a permission error.
Here's one example:

  services.mpd.enable = true;
  services.mpd.dataDir = "/home/nikita/dotfiles/mpd/.mpd";
  services.mpd.musicDirectory = "/home/nikita/music";

Both directories exist.

$ journalctl -u mpd.service

Feb 19 09:11:22 mu systemd[1]: Starting Music Player Daemon...
Feb 19 09:11:22 mu systemd[1]: mpd.service: control process exited, code=exited 
status=1
Feb 19 09:11:22 mu systemd[1]: Failed to start Music Player Daemon.
Feb 19 09:11:22 mu systemd[1]: Unit mpd.service entered failed state.
Feb 19 09:11:22 mu systemd[1]: mpd.service failed.
Feb 19 09:11:22 mu mpd-pre-start[15264]: mkdir: cannot create directory 
‘/home/nikita’: Permission denied

Why is it even trying to create "/home/nikita"?


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


Re: [Nix-dev] Override nix.maxJobs without editing hardware-configuration.nix?

2015-02-18 Thread James Cook
maxJobs = pkgs.lib.mkForce 4; worked. Thanks all! I have a lot to
learn about NixOS configuration.

On 18 February 2015 at 02:25, Eelco Dolstra  wrote:
> Hi,
>
> On 18/02/15 08:25, James Cook wrote:
>
>> I can't set nix.maxJobs in configuration.nix, because it is set in
>> hardware-configuration.nix:
>>
>> error: The unique option `nix.maxJobs' is defined multiple times, in
>> `/etc/nixos/hardware-configuration.nix' and
>> `/etc/nixos/configuration.nix'.
>>
>> Of course, I could work around this by editing
>> hardware-configuration.nix, but then the change would be lost the next
>> time I run nixos-generate-config. Is there a better way to do this?
>
> This should work:
>
>   nix.maxJobs = mkForce 4;
>
> I guess the option definition in hardware-configuration.nix should be given a
> lower priority to prevent this problem.
>
> --
> Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] NIx and portability

2015-02-18 Thread emery
I'm working on porting Nix to a non-UNIX operating system and I'd like some
advice.

I want to get Nix running on the Genode microkernel OS (http://genode.org/).
Genode is not UNIX-based and the differences are very fundamental but so
far I have managed to execute some simple builders using Bash and its UNIX
emulator.

Libnixexpr works without modification, but I've had to modify libnixutil
and libnixstore. For now I have no plans on managing profiles yet. The
issue I want to deal with now is how to make changes to libnixutil and
libnixstore with the least amount of future maintenance. So far I have been
taking source files and moving problem functions into a unix implementation
file, then making a copy of that and doing a rewrite. Would this separation
be useful to upstream? Is there a better method? Is there any sort of
reorganization or refactoring that I could do at the same time that would
be helpful?

The big changes to be made in libnixstore are:
- Builders are started in a completely different manner, there are no pipes
   or PIDs, the builder is monitored in a different way. I haven't implemented
   logging but it shouldn't be much of an issue.

- There is no chrooting when you don't have a root, but a stacked virtual
   file system is readily available in the emulator.

- Build hook support would need to be reimplemted.

The minor changes elsewhere are:
- No users or groups. Standard filesystems will be used, but the system has
   no concept of user, group or mode.

- No getenv or argv for Nix, but no issues with setting these for builders.
   The native configuration method has been sufficient for Nix.

- File locks: The file system interface does not yet support file locking.

Permissions and file-locking isn't a big deal, I can probably deal with
those using dummy libc functions. I ported SQLite first, so that is taken
care of, though without file locking I'm using a different journal mode for
the database.

I suppose what I'm doing could make a windows port easier for someone else,
not there would be a point in that.

What do you guys think?
Emery

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


Re: [Nix-dev] Missing documentation

2015-02-18 Thread Ertugrul Söylemez
> What I want to say is that it might be boring to maintain such a
> comprehensive help system, but it’s totally worth it, and it’s
> wonderful that someone volounteers to do that. BTW it would be nice to
> have a generic framework for writing docs and then doing things like
> generating man-pages and context-sensitive help automatically. Maybe
> such a framework already exists?

That's what I want to do, but I'm still not sure whether the community
is behind me.  I don't want to spend days to develop a nice solution
just to find that nobody actually wants it.

I did not count formally, but so far my proposal was met with mixed
feelings.  If there is a definite, "stop talking, please just do it",
then I will do it.  My changes would include minor documentation
improvements, but most notably a context-sensitive help system that is
easy to use especially for Nix developers.


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


Re: [Nix-dev] Why are there so many branches in the nixpkgs repo

2015-02-18 Thread Vladimír Čunát

On 02/18/2015 09:51 AM, Nathan Bijnens wrote:

My vote is to remove merged branches without historical significance
(version 0.5 is a keeper, like upstart), and then any branches that
got their last push before August 2014 are renamed to attic/...

>

First make a fork with all history. Afterwards I like Wout's suggestion.


Removing merged branches doesn't destroy history.
BTW, historically significant versions that aren't meant to be changed 
anymore might better be converted to tags.



Vladimir




smime.p7s
Description: S/MIME Cryptographic Signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Missing documentation

2015-02-18 Thread Kirill Elagin
On Mon Feb 16 2015 at 6:22:20 PM Eelco Dolstra 
wrote:
>
> Note that I removed --help on purpose because I didn't want to maintain
> two sets
> of option documentation. Invoking "man" is also what tools like Git do, so
> it's
> not entirely uncommon.
>
> --
> Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev


I remember a recent discussion here regarding nix-1.8’s use of `less` and
`man`, and I should say that I mostly agree with the ones who oppose this
behaviour.

Having short reminders instead of long and verbose man pages is _so much
better_. And having context-sensitive help is _absolutely marvelous_. I
don’t think that git does what you say.

There is a `git help` command that opens a man page indeed, but `git
 -h` prints a short summary of options. Other examples include
`iproute2` tools (e.g. `ip help` vs. `ip a help`), `openssl` (`openssl
help` vs. `openssl dh help` [help is not really a special command in this
case, just a thing the tools don’t know what to do with, so they output a
nice short summary]). All of those are just a little bit context sensitive,
i.e. the context is provided only by the first-level command.

NetworkManager is especially awesome as its help is truly conext-sensitive
(`nmcli help` vs. `nmcli c help` vs. `nmcli c up help`).

On the other hand, `systemctl` definitely has room for improvement as it is
not context-sensitive at all, but it still provides a summary instead of
just opening a man page.

What I want to say is that it might be boring to maintain such a
comprehensive help system, but it’s totally worth it, and it’s wonderful
that someone volounteers to do that. BTW it would be nice to have a generic
framework for writing docs and then doing things like generating man-pages
and context-sensitive help automatically. Maybe such a framework already
exists?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [haskell NG] Override package

2015-02-18 Thread Kirill Elagin
There are multiple ways to override a package in haskell-ng. Personally I
use the most general one, that is `haskellngPackages.override`.

`haskellngPackages` is itself a function with default arguments provided in
`top-level/all-packages.nix`, but you can call `haskellngPackages.override`
passing it an attrset with arguments to override, and in our case we want
to override the `overrides` argument (huh), which is internally appended to
the haskell packages set. The `overrides` argument should be a function,
taking two arguments, `self` (the resulting set of haskell packages) and
`super` (the original set of haskell packages); and it should return the
attrset of new or overriden packages.

Inside of that attrset you might want to use `overrideCabal` to alter the
derivation.

Here is an example. That’s how I override the `hoq` package to use my local
git checkout with fixes I need:

~~~
{
  <...>

  packageOverrides = pkgs_: let pkgs = pkgs_.pkgs; in with pkgs; {

<...>

haskellngPackages = pkgs_.haskellngPackages.override {
  overrides = self: super: {
hoq = haskell-ng.lib.overrideCabal super.hoq
  (drv: {
src = fetchgit {
  url = "/home/kirrun/proj/hoq";
  rev = "dc78b0f9600163670a3bdd6259dbdd69acc63087";
  sha256 =
"0v4mll94xkjfpw8dpdgdm71zmdmvbp64pn77yw8xzrczyn06q46l";
};
  });
  };
};
  };
}
~

Here is how it works:

1. Is override the whole `haskellngPackages` using `packageOverrides` as
one does with all other (not necessariliy haskell-related) packages.
2. I use `pkgs` for the new `pkgs` and `pkgs_` for the original ones. This
is needed because `haskellngPackages` is defined using `haskellngPackages`
which causes infinite recursion otherwise.
3. I use `haskell-ng.lib.overrideCabal` to override the derivation of
`hoq`, which takes a function from the original derivation to the attrset
of attributes to replace. I replace ontly the `src` attribute.

Note that the net result is that the only thing changed in the derivation
is its `src` attribute. In case you want to do more intrusive changes it
_might_ (or, more likely, might not!) be easier to put together a brand new
derivation and just `callPackage` it.


On Mon Feb 16 2015 at 11:42:12 AM YCH  wrote:

> Hello,
>
> I'm very happily learning Haskell with nix-shell and haskell-ng
> environment. In
> comparison to previous 'haskell', there is no problem at all.
>
> But I've found problem that hdevtools does not see related build-depends
> options in cabal file.
>
> https://github.com/bitc/hdevtools/issues/38
>
> So I would try patched hdevtools from fork.
>
> https://github.com/maximkulkin/hdevtools
>
> Cloned, checked out proper branch. What is next step?
>
> I've read quite many document. Wiki, nix pills, ... . But I'm confused
> about
> so many different ways doing similar things. And I'm worried about
> haskell-ng
> specific things. There is already 'haskellngPackages.hdevtools'. So I
> should
> override using ~/hdevtools. I'll attach my current setup information.
>
> Arch Linux
> nix-unstable
>
> Thanks.
>
> ~~~
> $ nix-env -q
> cabal-install-1.22.0.0
> cabal2nix-2.0
> nix-1.8
> nox-0.0.1
>
> $ ls -1
> cis194.cabal
> HW01.hs
> HW02.hs
> LICENSE
> Main.hs
> Setup.hs
> shell.nix
> Test.hs
> ... snip ...
>
> $ cat cis194.cabal
>
> -- Initial cis194.cabal generated by cabal init.  For further
> -- documentation, see http://haskell.org/cabal/users-guide/
>
> name:cis194
> version: 0.1.0.0
> -- synopsis:
> -- description:
> -- license:
> license-file:LICENSE
> author:  dontdieych
> maintainer:  dontdie...@gmail.com
> -- copyright:
> -- category:
> build-type:  Simple
> -- extra-source-files:
> cabal-version:   >=1.10
>
> library
>   default-language:Haskell2010
>   build-depends:
> base >=4.7 && <4.8
> , MissingH
>   exposed-modules:
> HW01
> , HW02
>
> executable cis194
>   default-language:Haskell2010
>   main-is: Main.hs
>   -- hs-source-dirs:
>   -- other-modules:
>   -- other-extensions:
>   build-depends:
> base >=4.7 && <4.8
>
> test-suite test
>   default-language: Haskell2010
>   type: exitcode-stdio-1.0
>   main-is: Test.hs
>   build-depends:
> base >=4.7 && <4.8
> , tasty
> , tasty-th
> , tasty-quickcheck
> , tasty-rerun
> -- , QuickCheck
>
> $ cat shell.nix   # cabal2nix . --shell > shell.nix
>
> with (import  {}).pkgs;
> let pkg = haskellngPackages.callPackage
> ({ mkDerivation, base, MissingH, QuickCheck, stdenv, tasty
>  , tasty-hunit, tasty-quickcheck, tasty-rerun, tasty-th
>  }:
>  mkDerivation {
>pname = "cis194";
>version = "0.1.0.0";
>src = ./.;
>isLibrary = false;
>isExecutable = true;
>buildDepends = [
>  base MissingH QuickCheck tasty t

Re: [Nix-dev] How to add an additional IP address besides the DHCP configured address?

2015-02-18 Thread Ertugrul Söylemez
> I would like to add the IP address 172.16.48.17/28 to my enp0s3
> interface but I would also like to keep the DHCP configured address.
> [...]
> Is this possible or should I use networking.localCommands?

The proper way to do this is to instruct the DHCP *server* to assign the
addresses.  Most servers can assign IP addresses based on MAC addresses.
All options below are hacks, because they circumvent the lease system of
DHCP, so they are unsafe.

The most proper unsafe way is to configure the DHCP *client* to assign
the additional address.  Unfortunately when you configure dhcpcd to
assign a static address, it does not ask the server to get a lease at
all.  Perhaps you can figure out a way to do both.  The relevant option
is `networking.dhcpcd.extraConfig` and the `static` option from
dhcpcd.conf(5).

A less proper way is to use a hook and assign the additional address
yourself.  The most general interface to that seems to be
`networking.dhcpcd.runHook`.  It's less proper, because then the client
does not manage that address.

See also the section "3rdparty link management" (sic) in dhcpcd(8).  It
seems to offer an addtional option, but I did not follow all the
references.

If all else fails you can disable the DHCP client *daemon* altogether
and do one-shot setups instead.  This is a horrible setup that cries for
network problems, because now even the regular dynamic address falls
outside of the lease system.


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


[Nix-dev] How to add an additional IP address besides the DHCP configured address?

2015-02-18 Thread Bas van Dijk
Hello,

I would like to add the IP address 172.16.48.17/28 to my enp0s3
interface but I would also like to keep the DHCP configured address. I
tried the following:

  networking = {
interfaces.enp0s3 = {
  useDHCP = true;
  ip4 = [
{ address = "172.16.48.17";
  prefixLength = 28;
}
  ];
};
  };

But after a "nixos-rebuild switch" ifconfig doesn't show the additional address:

$ ifconfig enp0s3
enp0s3: flags=4163  mtu 1500
inet 192.168.42.225  netmask 255.255.255.0  broadcast 192.168.42.255
inet6 fdf1:4004:db11:1:a00:27ff:fe34:fdef  prefixlen 64
scopeid 0x0
inet6 fe80::a00:27ff:fe34:fdef  prefixlen 64  scopeid 0x20
ether 08:00:27:34:fd:ef  txqueuelen 1000  (Ethernet)
RX packets 214736  bytes 67482409 (64.3 MiB)
RX errors 14  dropped 0  overruns 0  frame 0
TX packets 46641  bytes 7880848 (7.5 MiB)
TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
device interrupt 19  base 0xd020

Is this possible or should I use networking.localCommands?

Cheers,

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


[Nix-dev] NetworkManager Ad-Hoc problem

2015-02-18 Thread Sergey Mironov
Hi! I've got a trouble connecting to my mobile phone's Ad-Hoc network
with NetworkManager. The log contains the following [1]. Quick
googling [2] shows that it may be a WPA problem, or the driver
problem. Could you please advice how to fix it? Dow we use WPA or
WPA2?

I forked from 96d6344b131cad5af56ecef5cef7b4fd515e1982


Regards,
Sergey

[1]
фев 18 16:58:24 greyblade kernel: IPv6: ADDRCONF(NETDEV_UP): wlp1s0:
link is not ready
фев 18 16:58:23 greyblade kernel: iwlwifi :01:00.0: Radio type=0x2-0x1-0x0
фев 18 16:58:23 greyblade kernel: iwlwifi :01:00.0: L1 Enabled;
Disabling L0S
фев 18 16:58:23 greyblade NetworkManager[18901]:  Activation
(wlp1s0) failed for connection 'Nokia_N9'
фев 18 16:58:23 greyblade NetworkManager[18901]:  Activation
(wlp1s0/wireless): Ad-Hoc network creation took too long, failing
activation.
(Note, the log messages order is reversed)

[2] 
https://mail.gnome.org/archives/networkmanager-list/2014-October/msg00020.html
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] ZSH Completions for Nix, NixOS, NixOps

2015-02-18 Thread Christian Lask
Spencer Whitt  writes:
> I've written a fairly complete set of ZSH completions for Nix, NixOS, and
> NixOps. You can find them here:
> https://github.com/spwhitt/nix-zsh-completions

This is awesome! 

> These are still a work in progress so expect rough edges and please submit
> issues. They are already extremely useful though, so don't hesitate to give
> them a shot.

I did. Working fine so far. Great. :)

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


Re: [Nix-dev] spamassassin module

2015-02-18 Thread Eike

Luca Bruno writes:

> On 17/02/2015 23:59, Eike wrote:
>>
>> Would it make sense to symlink those files from the spamassassin module?
>> Or did I miss something and should go back and read spamassassins
>> manual(s) first?
> I think those configs are supposed to be changed by the administrator,
> hence I don't think it's a good idea to symlink.

Yes, that's right of course. Symlinking isn't a good idea then, but
maybe copying if they don't exist yet? So spamassassin starts out of the
box, but I guess there is not much of an advantage if the admin has to
maintain these files anyways…

And in this case I have to add those files to my nixos configuration. I
think I'll add something to system.activationScripts that copies the
custom rule files to /etc/spamassassin (and fallback to the package
provided ones if there are no custom ones).

Thanks and regards
Eike


--
gpg: AD7AC35E
finger print: 137F BB0B 1639 D25F DC5D  E59C B412 C5F5 AD7A C35E
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Override nix.maxJobs without editing hardware-configuration.nix?

2015-02-18 Thread Eelco Dolstra
Hi,

On 18/02/15 08:25, James Cook wrote:

> I can't set nix.maxJobs in configuration.nix, because it is set in
> hardware-configuration.nix:
> 
> error: The unique option `nix.maxJobs' is defined multiple times, in
> `/etc/nixos/hardware-configuration.nix' and
> `/etc/nixos/configuration.nix'.
> 
> Of course, I could work around this by editing
> hardware-configuration.nix, but then the change would be lost the next
> time I run nixos-generate-config. Is there a better way to do this?

This should work:

  nix.maxJobs = mkForce 4;

I guess the option definition in hardware-configuration.nix should be given a
lower priority to prevent this problem.

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Please test Nix store auto-optimise

2015-02-18 Thread Wout Mertens
Since it looks for sub-blocks, first run the nix-store --optimise and then
run duperemove -dhr /nix/store.

Read the FAQ though:
https://github.com/markfasheh/duperemove/blob/master/FAQ.md

BTW, since bedup does files incrementally, it's nice to run that too. So
I'd do nix-store --optimise, bedup and then duperemove.

Of course if you don't want hardlinks (but there's really no reason on a
read-only store like /nix/store), you can leave the nix-store --optimise
out and only run bedup and duperemove.
If you want speed, only running nix-store --optimise and bedup should do
the trick, I wonder how much extra duperemove would save.

Wout.

On Wed Feb 18 2015 at 9:42:59 AM Raahul Kumar 
wrote:

> Can I know the best way to do this for BTRFS? Install duperemove, then
> what?
>
> Aloha,
> RK.
>
> On Mon, Feb 16, 2015 at 8:32 AM, James Cook 
> wrote:
>
>> Oops, yes, that's a good point. Filesystems with fancy things like
>> reflinks probably have their own tools for deduplication.
>>
>> On 15 February 2015 at 01:48, Wout Mertens 
>> wrote:
>> > If you want to use reflinks, better to use the deduplication tools that
>> come
>> > with the filesystem, e.g.
>> > https://btrfs.wiki.kernel.org/index.php/Deduplication (duperemove is in
>> > nixpkgs).
>> >
>> > Also, it would be nice if we could patch GNU cp so that it always tries
>> to
>> > use reflinks (so that builds automatically have reflinks where
>> possible).
>> > There's an option "--reflinks=auto" that does that and I don't
>> understand
>> > why it's not the default (as discussed at
>> >
>> http://unix.stackexchange.com/questions/80351/why-is-cp-reflink-auto-not-the-default-behaviour
>> ).
>> > Maybe we should make it a nixos option.
>> >
>> > Hardlinks are slightly impure and they do cause build failures in rare
>> and
>> > easily-fixed cases, but they're cross-platform, robust and easy to
>> inspect.
>> > Indeed the .links directory won't be able to be pruned due to reflinks
>> being
>> > invisible.
>> >
>> > To implement reflinks properly you would have to keep a hash of each
>> file in
>> > the nix-store in a DB. This has advantages, like being able to hash
>> lazily
>> > (only when another file with the same size shows up), and being able to
>> do
>> > queries, but it also means that you're duplicating that other DB, the
>> file
>> > system.
>> >
>> >
>> > Wout.
>> >
>> > On Sun, Feb 15, 2015, 9:54 AM James Cook 
>> wrote:
>> >>
>> >> > Once I wondered if using reflinks instead of hardlinks might be
>> better
>> >> > from
>> >> > some point of view, but it probably won't be a big difference.
>> >>
>> >> I would really like to see reflinks being used instead of hard links
>> >> on filesystems that support it. Hard linking is an impurity which can
>> >> cause bugs, as Wout pointed out at the start of the thread (e.g.
>> >> https://github.com/NixOS/nixpkgs/issues/4266).
>> >>
>> >> Implementation question: how would nix know when it can delete a file
>> >> in /nix/store/.links? I assume than now it just checks the number of
>> >> links, but I don't know if you can do that with reflinks.
>> >>
>> >> James
>> >> ___
>> >> 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] spamassassin module

2015-02-18 Thread Luca Bruno
On 17/02/2015 23:59, Eike wrote:
> Hello,
>
> I'm trying to add spamassassin to my email setup. So I added this to my
> configuration.nix:
>
> services.spamassassin = {
>   enable = true;
>   debug = true;
> };
>
> I then tried with `systemctl start spamd' which failed, because of
> missing configs (I should admit now, that I'm very new to
> spamassassin). The error message suggests to run `sa-update', so I did
> with this result:
>
> Timeout::_run: check: no loaded plugin implements 'check_main': cannot 
> scan!
> Check the necessary '.pre' files are in the config directory.
>
> Some searches later, I found out that there are missing config files in
> /etc/spamassassin (the instructions in spamassassin/default.nix specify
> this as CONFDIR). I then copied all files from
> ${pkgs.spamassassin}/share/spamassassin/* to /etc/spamassassin to make
> the sa-update command work. After that spamd started.
>
> Would it make sense to symlink those files from the spamassassin module?
> Or did I miss something and should go back and read spamassassins
> manual(s) first?
I think those configs are supposed to be changed by the administrator,
hence I don't think it's a good idea to symlink.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Bash completion makes bash startup awefully slow

2015-02-18 Thread Sergey Mironov
+1 from here. I remember, in Gentoo one could select the groups of
completion scripts to include into file

Regards,
Sergey

2015-02-14 14:54 GMT+03:00 Wout Mertens :
> Err, can you quantify how slow bash starts up?
>
> Anyway, Marc Weber has been working on modular bash completion, see
> http://permalink.gmane.org/gmane.linux.distributions.nixos/15757
>
> Maybe that should be part of NixOS.
>
> Wout.
>
> On Sat Feb 14 2015 at 11:55:46 AM Matthias Beyer 
> wrote:
>>
>> Hi!
>>
>> On 13-02-2015 11:23:07, Wout Mertens wrote:
>> > I'd start by finding out what is slow. The bash completion reads a bunch
>> > of
>> > files iirc, so copy the package and insert time measurements.
>>
>> I know, it reads the whole completion stuff, right? Maybe we should
>> make this part more modular, so one can include what's required and
>> exclude what's not.
>>
>> >
>> > Also, you could upgrade to SSD for your root disk...
>> >
>>
>> I _have_ an SSD for my root disk! And an octocore processor and 16GB
>> Ram. It takes too long anyways!
>>
>> > Also, maybe zsh is faster?
>> >
>>
>> Sorry, but I won't switch shell as long as there is a way to improve
>> things!
>>
>> > On Tue Feb 10 2015 at 10:21:46 PM Matthias Beyer 
>> > wrote:
>> >
>> > > Hi,
>> > >
>> > > we already had this on this ML, but the question which was posted (not
>> > > by me, btw) got no answer.
>> > >
>> > > I can't live withou bash completion. But using it makes bash awefully
>> > > slow at startup. Is there a way to enhance this situation?
>> > >
>> > >
>> > > --
>> > > 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
>> > >
>>
>> --
>> 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] Why are there so many branches in the nixpkgs repo

2015-02-18 Thread Nathan Bijnens
First make a fork with all history. Afterwards I like Wout's suggestion.

---
nat...@nathan.gs | nathan.gs
 |
@nathan_gs  | linkedin.com/in/nbijnens

On Wed, Feb 18, 2015 at 9:36 AM, Wout Mertens 
wrote:

> My vote is to remove merged branches without historical significance
> (version 0.5 is a keeper, like upstart), and then any branches that got
> their last push before August 2014 are renamed to attic/...
>
> That should make the github interface easier to navigate.
>
> ___
> 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] Please test Nix store auto-optimise

2015-02-18 Thread Raahul Kumar
Can I know the best way to do this for BTRFS? Install duperemove, then what?

Aloha,
RK.

On Mon, Feb 16, 2015 at 8:32 AM, James Cook  wrote:

> Oops, yes, that's a good point. Filesystems with fancy things like
> reflinks probably have their own tools for deduplication.
>
> On 15 February 2015 at 01:48, Wout Mertens  wrote:
> > If you want to use reflinks, better to use the deduplication tools that
> come
> > with the filesystem, e.g.
> > https://btrfs.wiki.kernel.org/index.php/Deduplication (duperemove is in
> > nixpkgs).
> >
> > Also, it would be nice if we could patch GNU cp so that it always tries
> to
> > use reflinks (so that builds automatically have reflinks where possible).
> > There's an option "--reflinks=auto" that does that and I don't understand
> > why it's not the default (as discussed at
> >
> http://unix.stackexchange.com/questions/80351/why-is-cp-reflink-auto-not-the-default-behaviour
> ).
> > Maybe we should make it a nixos option.
> >
> > Hardlinks are slightly impure and they do cause build failures in rare
> and
> > easily-fixed cases, but they're cross-platform, robust and easy to
> inspect.
> > Indeed the .links directory won't be able to be pruned due to reflinks
> being
> > invisible.
> >
> > To implement reflinks properly you would have to keep a hash of each
> file in
> > the nix-store in a DB. This has advantages, like being able to hash
> lazily
> > (only when another file with the same size shows up), and being able to
> do
> > queries, but it also means that you're duplicating that other DB, the
> file
> > system.
> >
> >
> > Wout.
> >
> > On Sun, Feb 15, 2015, 9:54 AM James Cook  wrote:
> >>
> >> > Once I wondered if using reflinks instead of hardlinks might be better
> >> > from
> >> > some point of view, but it probably won't be a big difference.
> >>
> >> I would really like to see reflinks being used instead of hard links
> >> on filesystems that support it. Hard linking is an impurity which can
> >> cause bugs, as Wout pointed out at the start of the thread (e.g.
> >> https://github.com/NixOS/nixpkgs/issues/4266).
> >>
> >> Implementation question: how would nix know when it can delete a file
> >> in /nix/store/.links? I assume than now it just checks the number of
> >> links, but I don't know if you can do that with reflinks.
> >>
> >> James
> >> ___
> >> 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] Why are there so many branches in the nixpkgs repo

2015-02-18 Thread Wout Mertens
My vote is to remove merged branches without historical significance
(version 0.5 is a keeper, like upstart), and then any branches that got
their last push before August 2014 are renamed to attic/...

That should make the github interface easier to navigate.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Fwd: Re: Override nix.maxJobs without editing hardware-configuration.nix?

2015-02-18 Thread Tomasz Kontusz
Oops, wrong address


 Wiadomość oryginalna 
Od: Tomasz Kontusz 
Wysłane: Wed Feb 18 09:19:17 CET 2015
Do: James Cook 
Temat: Re: [Nix-dev] Override nix.maxJobs without editing   
hardware-configuration.nix?

You can use nix.maxJobs = mkForce 4 - see 
https://nixos.org/nixos/manual/sec-writing-modules.html#sec-option-definitions

James Cook  napisał:
>I can't set nix.maxJobs in configuration.nix, because it is set in
>hardware-configuration.nix:
>
>error: The unique option `nix.maxJobs' is defined multiple times, in
>`/etc/nixos/hardware-configuration.nix' and
>`/etc/nixos/configuration.nix'.
>
>Of course, I could work around this by editing
>hardware-configuration.nix, but then the change would be lost the next
>time I run nixos-generate-config. Is there a better way to do this?
>
>(Context: with hyperthreading, my laptop presents 8 cores, but doesn't
>really have an appropriate amount of RAM for 8 simultaneous builds.)
>
>Thanks,
>  James
>___
>nix-dev mailing list
>nix-dev@lists.science.uu.nl
>http://lists.science.uu.nl/mailman/listinfo/nix-dev

-- 
Wysłane za pomocą K-9 Mail.
-- 
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