问题描述
在MacOS Catalina上找不到nix-env,nix-build,nix-shell等。
我安装了:
sh <(curl https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume
并能够在昨天运行它们。我重新启动计算机,再也找不到它们。 find / -name nix-env | grep nix-env
什么也没显示。
我尝试使用相同的命令(sh <(curl https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume
)重新安装,但是这次它立即以0状态代码存在。
我怀疑我需要做一些事情来挂载虚拟驱动器。
解决方法
您应遵循Notes on the recommended approach。
似乎未装入该卷(如文档中所述,用Option Explicit
Public Sub test()
BlackWhiteFontColor Range("A1:A10")
End Sub
Public Sub BlackWhiteFontColor(ByRef FormatRange As Range)
Dim Cell As Range
For Each Cell In FormatRange.Cells
Dim Color As Long
Color = Cell.Interior.Color
'covert color into hex color
Dim RGBHex As String
RGBHex = Right$("000000" & Hex(Color),6)
'extract rgb values
Dim Blue As Long,Green As Long,Red As Long
Blue = CLng("&H" & Mid$(RGBHex,1,2))
Green = CLng("&H" & Mid$(RGBHex,3,2))
Red = CLng("&H" & Mid$(RGBHex,5,2))
'calculate hsp according to http://alienryderflex.com/hsp.html
Dim hsp As Double
hsp = Sqr(0.299 * (Red ^ 2) + 0.587 * (Green ^ 2) + 0.114 * (Blue ^ 2))
If hsp > 127.5 Then
'background color is light
Cell.Font.Color = vbBlack
Else
'background color is dark
Cell.Font.Color = vbWhite
End If
Next Cell
End Sub
检查/etc/fstab
状态)。
使用Disk Utility UI删除nix卷(sudo rm -rf /nix
不起作用)。
然后再次运行脚本,这次用手指交叉:sh <(curl https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume