39 lines
1.2 KiB
Ruby
39 lines
1.2 KiB
Ruby
cask 'nix' do
|
|
version '2.0'
|
|
sha256 '6a1f0cabbab18acc8f864b8847e4a44fbb0fadabbbf8940149903af635652be8'
|
|
|
|
url "https://nixos.org/releases/nix/nix-#{version}/nix-#{version}-x86_64-darwin.tar.bz2"
|
|
appcast 'https://nixos.org/releases/nix/latest/',
|
|
checkpoint: 'ca578df629c3d542e94308e81329eb9fa767a4144474c3e8cf15f3748753f09e'
|
|
name 'nix'
|
|
homepage 'https://nixos.org/nix/'
|
|
|
|
depends_on macos: '>= :yosemite'
|
|
|
|
installer script: "nix-#{version}-x86_64-darwin/install"
|
|
|
|
uninstall_postflight do
|
|
['~/.bash_profile', '~/.bash_login', '~/.profile'].each do |profile_path|
|
|
profile_path = File.expand_path(profile_path)
|
|
|
|
next unless File.exist?(profile_path)
|
|
system_command '/usr/bin/sed',
|
|
args: [
|
|
'-E',
|
|
'-i', '.nix_uninstall_bak',
|
|
'-e', '/# added by Nix installer/d',
|
|
profile_path
|
|
]
|
|
end
|
|
end
|
|
|
|
uninstall delete: '/nix',
|
|
launchctl: 'org.nixos.nix-daemon'
|
|
|
|
zap trash: [
|
|
'~/.nix-channels',
|
|
'~/.nix-defexpr',
|
|
'~/.nix-profile',
|
|
]
|
|
end
|