1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

copy systemPackages test to userPackages

This commit is contained in:
Wael M. Nasreddine 2019-02-20 08:39:44 -08:00
parent 59d84f93e4
commit af347fe1ec
No known key found for this signature in database
GPG key ID: FD437548E0BF0F5F

View file

@ -1,5 +1,12 @@
{ config, pkgs, ... }:
let
hello = pkgs.runCommand "hello-0.0.0" {} ''
mkdir -p $out/bin $out/lib
touch $out/bin/hello $out/lib/libhello.dylib
'';
in
{
users.knownUsers = [ "foo" ];
users.users.foo.uid = 42000;
@ -8,10 +15,14 @@
users.users.foo.isHidden = false;
users.users.foo.home = "/Users/foo";
users.users.foo.shell = "/run/current-system/sw/bin/bash";
users.users.foo.packages = [ pkgs.hello ];
users.users.foo.packages = [ hello ];
test = ''
echo "checking for hello in /etc/profiles/per-user/foo" >&2
test -x /etc/profiles/per-user/foo/bin/hello
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
'';
}