~/bend-docscommunity

lib/mac_types.bend checks

raw source on the hub · import 0x0bae9aeb11ebfcadb010bbe6e89fbbff/lib/mac_types.bend as Mac_types

1 import
import Base

Types

type VKind source · line 6 · raw

Data

One declared or observed setting of the Mac: its nix-darwin option, how to write its value, and the value. KNix values are whole Nix expressions (lists, attribute sets, paths), written as they are. Values are kept exactly as nix-darwin would write them, so declared and observed compare directly.

type Setting source · line 13 · raw

Data

type Change source · line 16 · raw

Data

type Brew source · line 107 · raw

Data

A Homebrew entry: kind is "tap", "brew", "cask", "mas" (name is the Nix attribute "App" = id) or "other" (a raw Brewfile line).

type Firewall source · line 206 · raw

Data

The macOS application firewall. Its options exist only while it is on: socketfilterfw turns the firewall on whenever one of them is set, so "off, with options" cannot be written.

Definitions

def cmp_eq source · line 19 · raw

@c:Cmp -> Bool

def snd_eq source · line 26 · raw

@r:Pair(Pair(String, String), Cmp) -> Bool

def str_eq source · line 31 · raw

@a:String -> @b:String -> Bool

def option_of source · line 34 · raw

@s:Setting -> String

def value_of source · line 39 · raw

@s:Setting -> String

def pick_value source · line 46 · raw

@hit:Bool -> @s:Setting -> @other:String -> String

def lookup source · line 54 · raw

@+option:String -> @now:List<&2, Setting> -> String

def change_if source · line 61 · raw

@same:Bool -> @option:String -> @now:String -> @want:String -> @rest:List<&2, Change> -> List<&2, Change>

def change_if_str source · line 70 · raw

@+observed:String -> @option:String -> @+value:String -> @rest:List<&2, Change> -> List<&2, Change>

def diff_one source · line 75 · raw

@s:Setting -> @+now:List<&2, Setting> -> @rest:List<&2, Change> -> List<&2, Change>

def diff source · line 80 · raw

@want:List<&2, Setting> -> @+now:List<&2, Setting> -> List<&2, Change>

def literal source · line 87 · raw

@k:VKind -> @v:String -> String

def line source · line 94 · raw

@s:Setting -> String

def lines source · line 99 · raw

@xs:List<&2, Setting> -> String

def brew_key source · line 110 · raw

@b:Brew -> String

def keys source · line 115 · raw

@xs:List<&2, Brew> -> List<&2, String>

def has source · line 122 · raw

@+s:String -> @xs:List<&2, String> -> Bool

def keep_if source · line 129 · raw

@missing:Bool -> @k:String -> @rest:List<&2, String> -> List<&2, String>

def minus source · line 137 · raw

@a:List<&2, String> -> @+b:List<&2, String> -> List<&2, String>

Entries of a that are not in b.

def kind_of source · line 145 · raw

@b:Brew -> String

Nix for the Homebrew section: one list per kind; entries nix-darwin has no option for are raw Brewfile lines.

def name_of source · line 150 · raw

@b:Brew -> String

def quoted_if source · line 155 · raw

@hit:Bool -> @n:String -> String

def names source · line 162 · raw

@+k:String -> @xs:List<&2, Brew> -> String

def raw_if source · line 169 · raw

@hit:Bool -> @n:String -> String

def raws source · line 176 · raw

@xs:List<&2, Brew> -> String

def mas_if source · line 183 · raw

@hit:Bool -> @n:String -> String

def mas source · line 190 · raw

@xs:List<&2, Brew> -> String

def brew_section source · line 197 · raw

@+xs:List<&2, Brew> -> String

def nix_bool source · line 210 · raw

@b:Bool -> String

def firewall_nix source · line 217 · raw

@f:Firewall -> String

def firewall_show source · line 228 · raw

@f:Firewall -> String

def firewall_change_if source · line 235 · raw

@same:Bool -> @now:String -> @want:String -> String

def firewall_change_str source · line 242 · raw

@+want:String -> @+now:String -> String

def firewall_change source · line 246 · raw

@want:Firewall -> @now:Firewall -> String

Dry run line for the firewall ("" when unchanged).

def none_prefixed source · line 250 · raw

@+p:String -> @xs:List<&2, Setting> -> Bool

True when no setting's option starts with p (areas V types, like the firewall, stay out of the flat list).