mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-13 20:30:02 +00:00
uninstaller: add post check
This commit is contained in:
parent
fc3a096f67
commit
6f45339cfe
2 changed files with 25 additions and 1 deletions
|
@ -10,3 +10,4 @@ matrix:
|
|||
- nix-shell -A installer.check
|
||||
- /run/current-system/sw/bin/darwin-rebuild switch -I darwin=$HOME/.nix-defexpr/channels/darwin -I darwin-config=$HOME/.nixpkgs/darwin-configuration.nix
|
||||
- yes | nix-shell -A uninstaller
|
||||
- nix-shell -A uninstaller.check
|
||||
|
|
|
@ -38,7 +38,7 @@ stdenv.mkDerivation {
|
|||
echo >&2
|
||||
echo >&2 "Uninstalling nix-darwin, this will:"
|
||||
echo >&2
|
||||
echo >&2 " - remove ~/Applications link.
|
||||
echo >&2 " - remove ~/Applications link."
|
||||
echo >&2 " - cleanup static /etc files."
|
||||
echo >&2 " - disable and remove all launchd services managed by nix-darwin."
|
||||
echo >&2 " - restore daemon service from nix installer (only when this is a multi-user install)."
|
||||
|
@ -71,4 +71,27 @@ stdenv.mkDerivation {
|
|||
echo >&2
|
||||
exit
|
||||
'';
|
||||
|
||||
passthru.check = stdenv.mkDerivation {
|
||||
name = "run-darwin-test";
|
||||
shellHook = ''
|
||||
set -e
|
||||
echo >&2 "running uninstaller tests..."
|
||||
echo >&2
|
||||
|
||||
echo >&2 "checking darwin channel"
|
||||
! test -e ~/.nix-defexpr/channels/darwin
|
||||
echo >&2 "checking /etc"
|
||||
! test -e /etc/static
|
||||
echo >&2 "checking /run/current-system"
|
||||
! test -e /run/current-system
|
||||
echo >&2 "checking nix-daemon service (assuming a multi-user install)"
|
||||
sudo launchctl list | grep org.nixos.nix-daemon
|
||||
pgrep -l nix-daemon
|
||||
readlink /Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
||||
grep /nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt /Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
||||
echo >&2 ok
|
||||
exit
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue