38 lines
1.1 KiB
Ruby
38 lines
1.1 KiB
Ruby
cask 'nix' do
|
|
version '1.11.16'
|
|
sha256 'b3e1a7316053fda14b4c69142c9f432aab2742e3a5febaed805a316450d6360d'
|
|
|
|
url "https://nixos.org/releases/nix/nix-#{version}/nix-#{version}-x86_64-darwin.tar.bz2"
|
|
appcast 'https://nixos.org/releases/nix/latest/',
|
|
checkpoint: '5a6183494c2fb2efc470d08017bb99e4cf402a63edb2f5d4b507f49b6c3deef2'
|
|
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'
|
|
|
|
zap trash: [
|
|
'~/.nix-channels',
|
|
'~/.nix-defexpr',
|
|
'~/.nix-profile',
|
|
]
|
|
end
|