2017-01-05 19:43:10 +08:00
|
|
|
cask 'nix' do
|
2017-04-04 21:32:14 +08:00
|
|
|
version '1.11.8'
|
|
|
|
sha256 '65093cbd779afe943667097c3cc80dc83082f8d876744598fd40e7855603f7f8'
|
2017-01-05 19:43:10 +08:00
|
|
|
|
|
|
|
url "https://nixos.org/releases/nix/nix-#{version}/nix-#{version}-x86_64-darwin.tar.bz2"
|
2017-04-24 09:11:25 +08:00
|
|
|
appcast 'https://nixos.org/releases/nix/latest/',
|
|
|
|
checkpoint: '70362d7bedcf593d01fb229cc48ec96be6d2b5634d9efa2d819e4eb386d9ae87'
|
2017-01-05 19:43:10 +08:00
|
|
|
name 'nix'
|
|
|
|
homepage 'https://nixos.org/nix/'
|
|
|
|
|
|
|
|
depends_on macos: '>= :yosemite'
|
|
|
|
|
2017-03-14 12:24:06 +08:00
|
|
|
installer script: "nix-#{version}-x86_64-darwin/install"
|
2017-01-05 19:43:10 +08:00
|
|
|
|
|
|
|
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
|
2017-03-14 12:24:06 +08:00
|
|
|
]
|
2017-01-05 19:43:10 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
uninstall delete: '/nix'
|
|
|
|
|
|
|
|
zap delete: [
|
|
|
|
'~/.nix-channels',
|
|
|
|
'~/.nix-defexpr',
|
|
|
|
'~/.nix-profile',
|
|
|
|
]
|
|
|
|
end
|