2019-02-20 16:20:32 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
2019-02-20 16:39:44 +00:00
|
|
|
let
|
|
|
|
hello = pkgs.runCommand "hello-0.0.0" {} ''
|
|
|
|
mkdir -p $out/bin $out/lib
|
|
|
|
touch $out/bin/hello $out/lib/libhello.dylib
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
|
2019-02-20 16:20:32 +00:00
|
|
|
{
|
|
|
|
users.knownUsers = [ "foo" ];
|
|
|
|
users.users.foo.uid = 42000;
|
|
|
|
users.users.foo.gid = 42000;
|
|
|
|
users.users.foo.description = "Foo user";
|
|
|
|
users.users.foo.isHidden = false;
|
|
|
|
users.users.foo.home = "/Users/foo";
|
|
|
|
users.users.foo.shell = "/run/current-system/sw/bin/bash";
|
2019-02-20 16:39:44 +00:00
|
|
|
users.users.foo.packages = [ hello ];
|
2019-02-20 16:20:32 +00:00
|
|
|
|
|
|
|
test = ''
|
2019-02-20 16:39:44 +00:00
|
|
|
echo checking hello binary in /etc/profiles/per-user/foo/bin >&2
|
|
|
|
test -e ${config.out}/etc/profiles/per-user/foo/bin/hello
|
|
|
|
test "$(readlink -f ${config.out}/etc/profiles/per-user/foo/bin/hello)" = "${hello}/bin/hello"
|
|
|
|
|
|
|
|
echo checking for unexpected paths in /etc/profiles/per-user/foo/bin >&2
|
|
|
|
test -e ${config.out}/etc/profiles/per-user/foo/lib/libhello.dylib && return
|
2019-02-23 10:43:39 +00:00
|
|
|
|
|
|
|
echo "checking /etc/profiles/per-user/foo/bin in environment" >&2
|
|
|
|
grep 'export PATH=.*:/etc/profiles/per-user/$USER/bin' ${config.system.build.setEnvironment}
|
2019-02-20 16:20:32 +00:00
|
|
|
'';
|
|
|
|
}
|