[Nix-dev] Configure WiFi networks for NetworkManager in configuration.nix?

Eelco Dolstra eelco.dolstra at logicblox.com
Wed Jan 6 18:36:21 CET 2016


Hi,

On 06/01/16 00:52, Mateusz Czaplinski wrote:

> Is it possible to easily create files like with writeText, but such that they're
> "chmod 400" *before* the contents is written?
> 
> From what I've read, NetworkManager expects to have network definitions as chmod
> 400 files in /etc/NetworkManager/system-connections/ IIRC. I'm trying to create
> them via appending to "environment.etc" property, but don't know how to make
> them root-only readable.

You can specify a mode, e.g.

  environment.etc."NetworkManager/bla" =
    { mode = "0400";
      source = writeText ...;
    };

However, this won't help much because "source" (and the derivation that produced
it) are still world-readable.

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


More information about the nix-dev mailing list