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:
parent
59d84f93e4
commit
af347fe1ec
1 changed files with 14 additions and 3 deletions
|
@ -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
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue