apply macbook
This commit is contained in:
parent
7aeb3be86d
commit
6c84dfa678
8 changed files with 96 additions and 29 deletions
33
bundles/macbook/files/macbook-update
Normal file
33
bundles/macbook/files/macbook-update
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash -l
|
||||
|
||||
xcode-select --install
|
||||
|
||||
git -C ~/.zsh/oh-my-zsh pull
|
||||
|
||||
brew upgrade
|
||||
brew upgrade --cask --greedy
|
||||
|
||||
sudo softwareupdate -ia --verbose
|
||||
|
||||
mwi /U/m/Pr/c git:(master) defaults write com.apple.dock autohide-time-modifier -float 0.2
|
||||
mwi /U/m/Pr/c git:(master) killall Dock
|
||||
mwi /U/m/Pr/c git:(master) defaults write com.apple.dock autohide-time-modifier -float 0.16
|
||||
|
||||
if test "$(defaults read com.apple.dock autohide-time-modifier)" -ne 0.16
|
||||
then
|
||||
defaults write com.apple.dock autohide-time-modifier -float 0.16
|
||||
RESTART_DOCK=TRUE
|
||||
fi
|
||||
|
||||
if test "$(defaults read com.apple.dock autohide-delay)" -ne 0
|
||||
then
|
||||
defaults write com.apple.dock autohide-delay -float 0
|
||||
RESTART_DOCK=TRUE
|
||||
fi
|
||||
|
||||
if test "$RESTART_DOCK" = TRUE
|
||||
then
|
||||
killall Dock
|
||||
fi
|
||||
|
||||
sudo systemsetup -setremotelogin on
|
12
bundles/macbook/items.py
Normal file
12
bundles/macbook/items.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
directories['/Users/mwiegand/.config/bundlewrap/lock'] = {}
|
||||
|
||||
files['/Users/mwiegand/.bin/macbook-update'] = {
|
||||
'mode': '755',
|
||||
}
|
||||
|
||||
for element in [*files.values(), *directories.values()]:
|
||||
element.update({
|
||||
'owner': 'mwiegand',
|
||||
'group': 'staff',
|
||||
**element,
|
||||
})
|
|
@ -16,7 +16,7 @@ def user(metadata):
|
|||
'authorized_users': {
|
||||
f'root@{node.name}'
|
||||
for node in repo.nodes
|
||||
if node.dummy == False
|
||||
if node.dummy == False and node.has_bundle('ssh')
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,22 +1 @@
|
|||
{
|
||||
'bundles': [
|
||||
'system',
|
||||
'users',
|
||||
],
|
||||
'metadata': {
|
||||
'dns': {},
|
||||
'nameservers': {
|
||||
'10.0.11.3',
|
||||
},
|
||||
'users': {
|
||||
'root': {
|
||||
'authorized_keys': {
|
||||
'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILMVroYmswD4tLk6iH+2tvQiyaMe42yfONDsPDIdFv6I ckn',
|
||||
},
|
||||
},
|
||||
},
|
||||
'letsencrypt': {
|
||||
'acme_node': 'netcup.mails',
|
||||
},
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
|
|
@ -10,27 +10,41 @@
|
|||
'network',
|
||||
'ssh',
|
||||
'sudo',
|
||||
'system',
|
||||
'systemd',
|
||||
'systemd-journald',
|
||||
'systemd-networkd',
|
||||
'systemd-mount',
|
||||
'systemd-timers',
|
||||
'users',
|
||||
'zsh',
|
||||
],
|
||||
'metadata': {
|
||||
'systemd-timers': {
|
||||
'trim': {
|
||||
'command': '/sbin/fstrim -v /',
|
||||
'when': 'daily',
|
||||
},
|
||||
},
|
||||
'dns': {},
|
||||
'hosts': {
|
||||
'10.0.11.3': [
|
||||
'resolver.name',
|
||||
'secondary.resolver.name',
|
||||
],
|
||||
},
|
||||
'letsencrypt': {
|
||||
'acme_node': 'netcup.mails',
|
||||
},
|
||||
'nameservers': {
|
||||
'10.0.11.3',
|
||||
},
|
||||
'systemd-timers': {
|
||||
'trim': {
|
||||
'command': '/sbin/fstrim -v /',
|
||||
'when': 'daily',
|
||||
},
|
||||
},
|
||||
'users': {
|
||||
'root': {
|
||||
'authorized_keys': {
|
||||
'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILMVroYmswD4tLk6iH+2tvQiyaMe42yfONDsPDIdFv6I ckn',
|
||||
},
|
||||
},
|
||||
'ckn': {
|
||||
'shell': '/usr/bin/zsh',
|
||||
'authorized_keys': {
|
||||
|
|
6
hooks/skip_local_nodes.py
Normal file
6
hooks/skip_local_nodes.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
from bundlewrap.exceptions import SkipNode
|
||||
|
||||
def node_apply_start(repo, node, interactive, **kwargs):
|
||||
if node.hostname == 'localhost':
|
||||
if node.metadata.get('id') != repo.libs.local.id():
|
||||
raise SkipNode('bw is not currently running on this node')
|
8
libs/local.py
Normal file
8
libs/local.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
from os.path import expanduser, exists
|
||||
from functools import cache
|
||||
|
||||
@cache
|
||||
def id():
|
||||
if exists(expanduser('~/.config/bundlewrap/local_id')):
|
||||
with open(expanduser('~/.config/bundlewrap/local_id'), 'r') as file:
|
||||
return file.read().strip()
|
15
nodes/macbook.py
Normal file
15
nodes/macbook.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
'hostname': 'localhost',
|
||||
'groups': [
|
||||
'all'
|
||||
],
|
||||
'bundles': [
|
||||
'macbook'
|
||||
],
|
||||
'metadata': {
|
||||
'id': '597eee25-8908-4569-a6d6-3f823050faa1',
|
||||
},
|
||||
'os': 'macos',
|
||||
'cmd_wrapper_outer': 'sh -c {}',
|
||||
'lock_dir': '/Users/mwiegand/.config/bundlewrap/lock',
|
||||
}
|
Loading…
Reference in a new issue