init
This commit is contained in:
commit
54bab918d7
7
.channelStable.json
Normal file
7
.channelStable.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"url": "https://github.com/NixOS/nixpkgs-channels.git",
|
||||
"rev": "0e0ee084d6dfc83b5b67b6cbcefe43664114808d",
|
||||
"date": "2019-10-07T15:48:50+02:00",
|
||||
"sha256": "1qk0ag4ihfjh9ay28hc9zf9vnrdw096driirv62picyn30j9y0l3",
|
||||
"fetchSubmodules": false
|
||||
}
|
7
.channelUnstable.json
Normal file
7
.channelUnstable.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"url": "https://github.com/NixOS/nixpkgs-channels.git",
|
||||
"rev": "2436c27541b2f52deea3a4c1691216a02152e729",
|
||||
"date": "2019-09-25T08:02:27+02:00",
|
||||
"sha256": "0p98dwy3rbvdp6np596sfqnwlra11pif3rbdh02pwdyjmdvkmbvd",
|
||||
"fetchSubmodules": false
|
||||
}
|
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
*.swp
|
||||
result
|
||||
result-*
|
||||
.history
|
||||
TAGS
|
||||
|
||||
*.tf.json
|
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
[submodule "assets/video-browser"]
|
||||
path = assets/video-browser
|
||||
url = ssh://gogs@git.ingolf-wagner.de:443/palo/video-browser.git
|
||||
[submodule "wetten"]
|
||||
path = wetten
|
||||
url = ssh://gogs@git.ingolf-wagner.de:443/palo/wetten.git
|
7
.krops.json
Normal file
7
.krops.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"url": "https://git.ingolf-wagner.de/krebs/krops.git",
|
||||
"rev": "2e93a93ac264a480b427acc2684993476732539d",
|
||||
"date": "2018-09-19T19:57:26+02:00",
|
||||
"sha256": "1s6b2cs60xa270ynhr32qj1rcy3prvf9pidap0qbbvgg008iafxk",
|
||||
"fetchSubmodules": false
|
||||
}
|
7
.nix-writers.json
Normal file
7
.nix-writers.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"url": "https://cgit.krebsco.de/nix-writers/",
|
||||
"rev": "fc8a3802a0777a5f43a9a2fe0f5848ecaeb555a1",
|
||||
"date": "2018-10-27T14:45:48+02:00",
|
||||
"sha256": "1iy207rcbz9nv9bf64025ypy38x8mwzl6snbmbrq347h6vvs0ksc",
|
||||
"fetchSubmodules": false
|
||||
}
|
7
.nixos-generators.json
Normal file
7
.nixos-generators.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"url": "https://github.com/nix-community/nixos-generators.git",
|
||||
"rev": "ef1e4480cf8af45cfdeac597b2f1b1af33923e93",
|
||||
"date": "2019-01-18T10:41:01+01:00",
|
||||
"sha256": "0ymzp4pmpkjjjg5h8d45gv8avy4wh1dj0v238i2cz3jp3j489ik9",
|
||||
"fetchSubmodules": false
|
||||
}
|
35
README.md
Normal file
35
README.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# My NixOS configuration
|
||||
|
||||
## Folder Structure
|
||||
|
||||
### configs
|
||||
|
||||
This should container system specific configurations
|
||||
|
||||
### system
|
||||
|
||||
Holds system type information like `server` and `desktop`.
|
||||
|
||||
### modules
|
||||
|
||||
This should container scripts that can be copied across different sources.
|
||||
|
||||
### pkgs
|
||||
|
||||
My overlay is in here.
|
||||
|
||||
### assets
|
||||
|
||||
assets, like scripts which I dont want to write in nix-lang.
|
||||
|
||||
### terranix
|
||||
|
||||
some terranix scripts
|
||||
|
||||
### library
|
||||
|
||||
some nix-lang functions and tools I use.
|
||||
|
||||
### images
|
||||
|
||||
some images I use and build via nixos-generators.
|
105
assets/jack.sh
Executable file
105
assets/jack.sh
Executable file
|
@ -0,0 +1,105 @@
|
|||
set -e
|
||||
|
||||
defaultDevice=PCH
|
||||
|
||||
start_jack(){
|
||||
|
||||
internal_device_number=-1
|
||||
komplete_device_number=$(aplay -l | grep Vestax | cut -d":" -f1 | cut -d" " -f2)
|
||||
babyface_device_number=$(aplay -l | grep Babyface | cut -d":" -f1 | cut -d" " -f2)
|
||||
cmedia_device_number=$(aplay -l | grep C-Media | cut -d":" -f1 | cut -d" " -f2)
|
||||
h2n_device_number=$(aplay -l | grep H2n | cut -d":" -f1 | cut -d" " -f2)
|
||||
|
||||
# this should be more readable some day
|
||||
if [[ $babyface_device_number == "" ]]; then
|
||||
if [[ $komplete_device_number == "" ]]; then
|
||||
if [[ $cmedia_device_number == "" ]]; then
|
||||
if [[ $h2n_device_number == "" ]]; then
|
||||
echo "use : default device"
|
||||
device_number=$internal_device_number
|
||||
else
|
||||
echo "use : h2n"
|
||||
device_number=$h2n_device_number
|
||||
fi
|
||||
else
|
||||
echo "use : c-media"
|
||||
device_number=$cmedia_device_number
|
||||
fi
|
||||
else
|
||||
echo "use : komplete"
|
||||
device_number=$komplete_device_number
|
||||
fi
|
||||
else
|
||||
echo "use : babyface"
|
||||
device_number=$babyface_device_number
|
||||
fi
|
||||
|
||||
# device parameter configuration
|
||||
# ==============================
|
||||
#
|
||||
# to find configuration options do
|
||||
# jack_control dp
|
||||
if [[ $device_number -eq -1 ]]
|
||||
then
|
||||
# we use alsa in reality, but pulse opens up all the pulse
|
||||
# sink and source stuff
|
||||
# jack_control ds pulse # not working for some reason
|
||||
jack_control ds alsa
|
||||
jack_control dps device hw:$defaultDevice
|
||||
else
|
||||
jack_control ds alsa
|
||||
jack_control dps device hw:$device_number # use usb card
|
||||
fi
|
||||
|
||||
jack_control dps duplex True # record and playback ports
|
||||
jack_control dps hwmon False # no hardware monitoring
|
||||
jack_control dps rate 48000 # use cd sample rate
|
||||
|
||||
|
||||
# nperiods are the splitup of the
|
||||
# sound-ring-buffer. 2 are ok for internal cards
|
||||
# but for usb you should use 3 because
|
||||
# you can have to write in junks to the card
|
||||
# so there is one backup slice in the middle
|
||||
if [[ $internal_device_number -ne -1 ]]
|
||||
then
|
||||
jack_control dps nperiods 3
|
||||
fi
|
||||
|
||||
# engine parameter configuration
|
||||
# ==============================
|
||||
#
|
||||
# to find configuration options do
|
||||
# jack_control ep
|
||||
jack_control eps sync True
|
||||
|
||||
# realtime kernel
|
||||
# set True for using a realtime kernel
|
||||
jack_control eps realtime False
|
||||
# set priority if realtime kernel is set True
|
||||
# jack_control eps realtime-priority 10
|
||||
|
||||
jack_control start
|
||||
}
|
||||
|
||||
stop_jack(){
|
||||
jack_control exit
|
||||
}
|
||||
|
||||
status_jack() {
|
||||
jack_control dp
|
||||
jack_control ep
|
||||
jack_control status
|
||||
}
|
||||
|
||||
|
||||
case $1 in
|
||||
start) start_jack
|
||||
;;
|
||||
stop) stop_jack
|
||||
;;
|
||||
restart) stop_jack ; start_jack
|
||||
;;
|
||||
*) status_jack
|
||||
;;
|
||||
esac
|
56
assets/shrink_exports
Executable file
56
assets/shrink_exports
Executable file
|
@ -0,0 +1,56 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
PROJECTS_FOLDER=~/music-projects/Rendered-Projects
|
||||
|
||||
# file separator (needed to handle files with spaces)
|
||||
IFS="
|
||||
"
|
||||
|
||||
function info_log(){
|
||||
echo -n ">>> [ "
|
||||
echo -n $@
|
||||
echo " ]"
|
||||
}
|
||||
|
||||
function run_ffmpeg(){
|
||||
local input=$1
|
||||
local output=$2
|
||||
|
||||
info_log "ffmpeg : ${output}"
|
||||
ffmpeg \
|
||||
-i "${input}" \
|
||||
-f mp3 \
|
||||
-codec:a libmp3lame \
|
||||
-qscale:a 5 \
|
||||
-ar 44100 \
|
||||
-loglevel error \
|
||||
-af loudnorm \
|
||||
"${output}"
|
||||
|
||||
|
||||
}
|
||||
|
||||
function delete(){
|
||||
local input=$1
|
||||
|
||||
if [[ -e "${input}" ]]
|
||||
then
|
||||
info_log "delete : ${input}"
|
||||
rm "${input}"
|
||||
fi
|
||||
}
|
||||
|
||||
for file in `ls ${PROJECTS_FOLDER} | grep wav$`
|
||||
do
|
||||
filename=`basename ${file} .wav`
|
||||
mp3="${filename}.mp3"
|
||||
|
||||
info_log ${filename}
|
||||
|
||||
delete "${PROJECTS_FOLDER}/${mp3}"
|
||||
run_ffmpeg "${PROJECTS_FOLDER}/${file}" "${PROJECTS_FOLDER}/${mp3}"
|
||||
delete "${PROJECTS_FOLDER}/${file}"
|
||||
|
||||
done
|
3
assets/sprueche-axel
Normal file
3
assets/sprueche-axel
Normal file
|
@ -0,0 +1,3 @@
|
|||
"Fernsehen ist für mich der Elektro-Jude" - Dr Axel Stoll
|
||||
"Der Zellkern ist gleich pures Licht" - Dr Axel Stoll
|
||||
"Die Sonne ist Kalt!" - Dr Axel Stoll
|
18
assets/sprueche-siw
Normal file
18
assets/sprueche-siw
Normal file
|
@ -0,0 +1,18 @@
|
|||
"Also Attracktiv oder net, ich seh hier immer noch am Besten aus" - Reiker
|
||||
"Hör mal auf dich selber zu bemitleiden, sonst baft das aber echt jetzt! Dummer Lutscher" - Käpten Pika
|
||||
"Komm Junge is besser du gibs dat jetzt zu, dann haste wenigsten noch ein paar Jahre wat von deinen Zähnen" - Käpten Pika
|
||||
"Ich sauf doch net mit euch Pennern, echt Ey" - Käpten Pika
|
||||
"Ja toll dann hab ich ja schon wieder verloren" - Deiter
|
||||
"Komisch! Mein Vater heißt auch Vater, aber sieht ganz anders aus!" - Reiker
|
||||
"Sag noch einmal Junge, Junge!" - Käpten Pika
|
||||
"Häää? Worte, was sind Worte?" - Reiker
|
||||
"Ich hau dir gleich die Zähne aus deiner fiesen Schnauze!" - Käpten Pika
|
||||
"Ihr glaubt wohl ich kann keine schlauen Sachen sagen, wa? Schlaue Sachen!!" - Reiker
|
||||
"Jetzt... also ich raff das jetzt echt net. Ist das so kompliziert?" - Reiker
|
||||
"Dat is hier die Molekularsymplexion über trivial-komplexive Plasmakonvergenzen, wie? Wat?" - Jordi
|
||||
"Äh, äh, Junge? Ey, Junge, echt jetz! Weißte?" - Käpten Pika
|
||||
"Deine Dummheit unterscheidet meinen Datentransfer" - Computer
|
||||
"Ähh, komisch mein Vadder sieht ganz anders aus, obwohl der auch Vadder heißt." - Reiker
|
||||
"Aaaaaah, ich kann nimmer" - Reiker
|
||||
"Also ich hab keine Gummipuppe. Nur Gummibärchen." - Reiker
|
||||
"Richtig heisser, kochend heisser Kaffee" - Käpten Pika
|
1
assets/ssh/card_rsa.pub
Normal file
1
assets/ssh/card_rsa.pub
Normal file
|
@ -0,0 +1 @@
|
|||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6uza62+Go9sBFs3XZE2OkugBv9PJ7Yv8ebCskE5WYPcahMZIKkQw+zkGI8EGzOPJhQEv2xk+XBf2VOzj0Fto4nh8X5+Llb1nM+YxQPk1SVlwbNAlhh24L1w2vKtBtMy277MF4EP+caGceYP6gki5+DzlPUSdFSAEFFWgN1WPkiyUii15Xi3QuCMR8F18dbwVUYbT11vwNhdiAXWphrQG+yPguALBGR+21JM6fffOln3BhoDUp2poVc5Qe2EBuUbRUV3/fOU4HwWVKZ7KCFvLZBSVFutXCj5HuNWJ5T3RuuxJSmY5lYuFZx9gD+n+DAEJt30iXWcaJlmUqQB5awcB1S2d9pJ141V4vjiCMKUJHIdspFrI23rFNYD9k2ZXDA8VOnQE33BzmgF9xOVh6qr4G0oEpsNqJoKybVTUeSyl4+ifzdQANouvySgLJV/pcqaxX1srSDIUlcM2vDMWAs3ryCa0aAlmAVZIHgRhh6wa+IXW8gIYt+5biPWUuihJ4zGBEwkyVXXf2xsecMWCAGPWPDL0/fBfY9krNfC5M2sqxey2ShFIq+R/wMdaI7yVjUCF2QIUNiIdFbJL6bDrDyHnEXJJN+rAo23jUoTZZRv7Jq3DB/A5H7a73VCcblZyUmwMSlpg3wos7pdw5Ctta3zQPoxoAKGS1uZ+yTeZbPMmdbw== cardno:000611343142
|
14
assets/tinc/pepe_host_file
Normal file
14
assets/tinc/pepe_host_file
Normal file
|
@ -0,0 +1,14 @@
|
|||
Ed25519PublicKey = LnE+w6ZfNCky4Kad3TBxpFKRJ2PJshkSpW6mC3pcsPI
|
||||
-----BEGIN RSA PUBLIC KEY-----
|
||||
MIICCgKCAgEAmAyz71GoQq2Mn4XeUVcN9yfgxeWT57li7i6Te9lq7OVAXQ+CBtD3
|
||||
puTMrW3/LXOIS678E2iMYPmdQzMZLmADi8+ZrXOqX98uceNv5bPrTJF0z/RA9Tif
|
||||
kfh78GcJCGHmZz+GGWu1ExtSa5ekBdamEtehW6vAGbrPM6Umu9B2UCn8zaSx+RGe
|
||||
Y7Z81wO21+ywUorMPTbHeuPYZW+Z8L+QKHO9NdYhzZ9zMPeVMi0x/mwIZqXJ57Wz
|
||||
57nx0rrPh+e+5cj3Jh+i4HC76mxPGCyCdvf+60d7W87UZxPqRiTLt2SwgltEKf56
|
||||
jBsVeOb5Fjzb6LcNGWfF8zNh0w6rAQsG4W7l93VlerTd46GtG2XW42JkGhuKb8JJ
|
||||
L1olPUmbcDbxlQGGUNaI7thAzubszAzinqyat3oU8NjgDJJIueHLmo752RW+yHUY
|
||||
giyRSBYtDRM9cE3s848WsToO5BtjXLkg/rC4WIWX2MNJFsAZXzfHWDmae+ajpoVy
|
||||
Gl6tGYbLhjd8KtSWB9kB0OWsV56f4KmWeRxHwTgylMO30l6v+XRdnoRUAp9wj8dV
|
||||
c6HJHnn5b2q4dk+qwWOYgwvpRFnSixbCCT4PoedEU9xVOzLmzxRtGmkzPsOXEOj5
|
||||
6r4Jvk0jw2LTkhEVX1CPblTrGpms9NO02SXNHkF/Akw7PGuJu+w3HZUCAwEAAQ==
|
||||
-----END RSA PUBLIC KEY-----
|
14
assets/tinc/porani_host_file
Normal file
14
assets/tinc/porani_host_file
Normal file
|
@ -0,0 +1,14 @@
|
|||
Ed25519PublicKey = 9JI8y56NWiKMRS6g/k2H3VgTEw0q+8UEDDJdiCjOl8O
|
||||
-----BEGIN RSA PUBLIC KEY-----
|
||||
MIICCgKCAgEA4Ff6XRvf83XSuWUkb70Yz+cWo1/dq4LBh5ZG7SJypdIXYnWQpQJc
|
||||
sLRfAS6nJZ6VixNADx7A03c8TdADVaAgl591rLd4CSzM22EgaOFstU2VO/MfMKHf
|
||||
v+WUQsrTE6CQ48SW+MDbSZZ7M7FRa/A6hwqZc5qygxdG/tgTei9pmTfqW+ZdQBWl
|
||||
IeCCINiNSA/fD+FjWXslZIFRZ5sQ7AYZJgL2nFAueY+cKtRZy3tcDL1v6mhDdIrE
|
||||
h8JjEUiayQDGnWmBlflLqE3ODqEsEKoL6W7epqK6PcwvZQxSNwrZe/wzH3oTC43m
|
||||
Yg7TQGr0v3SnSziXv3cJvcHfwr9+huo37wTbUJNmozGpI8nLszfUTEIfhbu2ODQv
|
||||
R2iM7FJcE4wV48y9aybEnESKA0vsjgI23RIQfxkN0oii7L6NAZVHgl/JJBOtCMXf
|
||||
V5uXAdOtkv9UvfofrrV0uahncvbz5efPTSPF8fS5EiwzWfDUW6KHrp/9+gDcnirn
|
||||
H8HvmmNVeOGWA1xlrKgi8kiBHv5BxCXfurD0aD6ZIlxdLjJCvGfnLnJZ6gr//GAf
|
||||
1BJJVei98uZzihNe4VbRF6Iaphns1KezsdygMsEV9gDIJw3IIqTukcUK7AcBXhb4
|
||||
IJ792j2iRwUOyiAcUYLeVYzAt3xFN6wPNcC/Opdo6TVbdMZu2uS1ZN8CAwEAAQ==
|
||||
-----END RSA PUBLIC KEY-----
|
14
assets/tinc/retiolum/host_file
Normal file
14
assets/tinc/retiolum/host_file
Normal file
|
@ -0,0 +1,14 @@
|
|||
Ed25519PublicKey = kc1SACqsoYjk5GimZfP+eszfJmUzZkMQhWeW42UKjfL
|
||||
-----BEGIN RSA PUBLIC KEY-----
|
||||
MIICCgKCAgEA2ACttoosnRZ99o+OyMrxBdUWPqsT5btzSIQ5dU1XWqGjO4nRchCE
|
||||
8tO0b/4jqVgJVTRZVIUJQESZRlSmclsCAjdM8tsGj74CJrm7tBvgbBn2IObSs5+4
|
||||
oJWe57VsQaeHPuI2JZuGqv8Z3Esw+B07bQS5VTaC1ISo7vnLG/q5XLCbKHB9JZc/
|
||||
ztYbk4bEQHwbulfoPjD9FY3heLnTzqPw9Xr3ixao5gbAXfWNJM+iCluMq+Q2g1BD
|
||||
ozSnyYvaGLQ6h4yksDp+xuK8YCqiRj174EkXySI8Jee1CBMuI8ciX/5Q7yzvzscQ
|
||||
ZQ/MLVdx3MRW+VeT0ctaRzoA9E09ILqPe+56DjpsKzt4Ne8qeMG5HdpzO9UdNzTu
|
||||
MuibsCL7CJy5Ytl38PK+LAXHQr3Os1Z4OHjeTZ38vTAZcOUJZEkl6w9nO1XjcyBL
|
||||
rIaG+20Nx0ZU79MlJZFiG7ovlUiDfIEKNygng8v/yoTMaqMYLxQZ/leQwLMNLujo
|
||||
sku8+oV4Jvx4SyUjuAS6jgG9CnejLCnHP/yyDGdaMQSzmlzYXacLMfnPZE3r7bj1
|
||||
EjA6yQbkPixm7xLCyMm5u2leWtqtbg1oRA6Mw3UyYkNy3hiTU+jTvztEI3SCliDH
|
||||
yjGlESH4/edryKjLNjmYP77VFbM9ZSQ+QGlbMGPvjcn6XCdJGdxm3PUCAwEAAQ==
|
||||
-----END RSA PUBLIC KEY-----
|
14
assets/tinc/sputnik_host_file
Normal file
14
assets/tinc/sputnik_host_file
Normal file
|
@ -0,0 +1,14 @@
|
|||
Ed25519PublicKey = ZK9iznseTpMqjaMgDJ7MdjYaq62QlEOFquLfVxlLpFK
|
||||
-----BEGIN RSA PUBLIC KEY-----
|
||||
MIICCgKCAgEAzBU8x9aB7F3sPJlcg9avJiSrsAoTHsMkfk6uRKFVjUjuNJgb3rjW
|
||||
gyQ7krftLAyxLkTYJzpD+4D+qWiudEgju7W+BU65/hudMIvBmbRYqXmcQlD9B9Pv
|
||||
0bVAazHJ80wN8GJD060Wq6XTtkrtAJhPmQSyMt0xU4WmWw/39QBX9rWtOTy75813
|
||||
qrfuv1I11YcVQ3jegPLUIzlZqz6LeouCXiP7IRIa+WUXIwAdAYtO/RJC+tty6zyI
|
||||
BXNd0Mkvpf0Qaw5joQJRXkdb1sWHOZYh75JW1QWqFMWCclkGG7/Dve4KzuO9N5XZ
|
||||
ZMs/MCtDkJQpweNDT3aaiqZa8Oj29OXs4HR4FFrvYkY+qqmKCUqS70FYLo45uNx1
|
||||
sRb7GKX8/dsPyOGHfXDuFTSXsKLh9gNLMlF/kuTQ2yJMfeMKdC5jDClL145Fm0ux
|
||||
akH/PWSS9DENxSu0GH1sTQnLyhc4mVzOehu1XfR9EALjYY0BNBUir7aAaiLTCbq9
|
||||
LKwMaF/D467W3j3Zp5xEAsf8xYC2CyMl1Df43zxcxLY+3K8/kUM2rkU7ocl2VT3o
|
||||
7yNC+JqQz41n4SDOXBZc6cfxUXj2MqqEw9Ywgs+aXZiSCaVOulhyXj0TSE1mX1NI
|
||||
woDHEzyx7q4AryQOWQsLq5JimI0v2/xN2yz+cNXoetDypjEWnws4e/ECAwEAAQ==
|
||||
-----END RSA PUBLIC KEY-----
|
14
assets/tinc/sterni_host_file
Normal file
14
assets/tinc/sterni_host_file
Normal file
|
@ -0,0 +1,14 @@
|
|||
Ed25519PublicKey = Hm+YwSe6XiRNQD4HfJPgTB8UFVMyVi0vy+3ofMnW6jD
|
||||
-----BEGIN RSA PUBLIC KEY-----
|
||||
MIICCgKCAgEAu7Ajx9+mEaDK/ASZ5hoVj3X3IkWl+8MAhmj7dwnhqc4YrPrvwKE4
|
||||
cOnVcEUp4K4pyIHUG8zhsesstfpu/0owLQaz8Cekr4CyQWsjDfi7K/QiAN+v2O2m
|
||||
DQOjrYzDvRyBa20A2MnO1kZU/aFHE9qcIHefZhQUZyv97j+QcsE/FDuIH/RAua6/
|
||||
p+br2tfecePGH6f0fMk8dp+YbxcjjVyhJkjyaYF2r+n+YflDl5y3ngxUFJ0UnNE0
|
||||
RfYJf2NE1wzt4rIdnYobFP3vifDIeYj6M0LGHnURPsT6zP+zStZ81MYZKrNlTJ37
|
||||
sbZhorVmO6x46xEWaDUd7UqcKJBpb7u8iSAE4S3tHLFRxBs60dPS+3UEraiTvTHr
|
||||
FvWTq1Q+t/FivTxXEkVt74N5auOKbT5AAkztak21Izx6enspdx6da2aLuJD5I0OU
|
||||
3F4kd8lW5PqEZubkYziDwcVoNsx88hQzHi5l2aRdzY57o82+ltWw4xXmAFR2o605
|
||||
SwVJ4AUmORHuIoDYSR+UgbtKHguxVaTLVggdfvHzlDQ1VERwEU58awMwPLU1k+jP
|
||||
3QW7ehPLKRN+StB6LBlnmRD1ltkaPY5iy+NMXj17hJx0trpz3qoCuv+5TRvsGvQ7
|
||||
Je/G7c6suIGd4HbA9TvCinW6/JLbJQlDiG7MD2oCOPS1pdayUuB9Jw0CAwEAAQ==
|
||||
-----END RSA PUBLIC KEY-----
|
14
assets/tinc/workhorse_host_file
Normal file
14
assets/tinc/workhorse_host_file
Normal file
|
@ -0,0 +1,14 @@
|
|||
Ed25519PublicKey = sPs48jzCdtTv0Viy2Of3HlXipfxH5Y8bA+KYVkOrSiK
|
||||
-----BEGIN RSA PUBLIC KEY-----
|
||||
MIICCgKCAgEA01HJ49zxmnixWC9YMP0c3UFxZc4Hl5UK9nJvhMRBOuxm75kpzZsz
|
||||
3v6mSy1YrVE9rrGXYjZ76wKrRhchMpvrMKKD8/DRjVqTkuFwtGgUEigzpSFoSLtC
|
||||
u2Wis7Z6GW3nLgAS79NU9IUUEoeevND1zzglDb0HdERuiImiZVg3I+VXLyA31X3L
|
||||
Z/B7T4QLmZGIRvFw0y1TawMjFMJZmDBtzMqfO7behkms2O1ORAciGhGxmZ9gd7yk
|
||||
n/NKCpSSzeC6sJ28i33LRrWF3hRUXAEJFgq8YRxm6mjRoPLsJVsw2S98DvTcxmjN
|
||||
eyVnqPVQi7JuKrOQsewQvwV2KiqI9ibEYH1zZNXwy+l05b3QSaAcyRtDpwRW7FCY
|
||||
H4B3S0vjte75D4bEuYTFgT3wCzlAjdB7fPZ4jyZXdrP8G3IfbMmgsdECz5uIMwam
|
||||
UaSZISlHkSJv+erA8TMJLBnqAO7ERKYI7PRIDdIun0VtX2QjRJpWIdVpxEcL4fZU
|
||||
w6gzX8lOQe5NnoH/MFUfU0LyBuUH1k6WX7xdwrynUVS087vwaQN+H/VTp0QSX6PQ
|
||||
oCLYPCGKS2B/St954uaPanzeG7QZQpWbvttaFVmUSkilx78xqqu3zDm9pSofFKCX
|
||||
08TGlluy8JAwUqAxekQVKey2PdLmKjlMCcoUeNYbJybGplc9gv2hYhsCAwEAAQ==
|
||||
-----END RSA PUBLIC KEY-----
|
14
assets/tinc/workout_host_file
Normal file
14
assets/tinc/workout_host_file
Normal file
|
@ -0,0 +1,14 @@
|
|||
Ed25519PublicKey = r6mRDc814z2YtyG9ev/XXV2SgquqWR8n53V13xNXb7O
|
||||
-----BEGIN RSA PUBLIC KEY-----
|
||||
MIICCgKCAgEA7/bur2JIXzNrsgjQ7kfoaLUVCC9S7HNNdDrlnSdum0sWvN9urdxS
|
||||
1OfzqG+kjDhQ0sS4fEeYyLMU8W3/aHkSbMjfKBiZS70bg5yHRepUEPZNqDqR3+rO
|
||||
LTAGWMi/IQQQmnfcN5SjaNY/ZyXoaPd1emlpV2UXBvXo/bQTl+pmOt7AIAh7Z7M6
|
||||
X5KAwU23kUwrfn/7zFCw98euNEPcCKpdF5oD4+G+S0PGfFvBmE6Xoi2blM1rcjJ4
|
||||
39IGVCsKAlW1Vg48yj7FypSSjaFvIW+kyRcNNTEZ4V5p50Vm7DfylfW96NqAOeuz
|
||||
2aSVaLhvmu8fU9z+g95MdGZOJYd57jFt76GbkwcLCF8KBCP9NhMfOQu0i1glk+AP
|
||||
CcJcDa/Oj7lLQVB2+holJhw5fkHH2Yi+L+UsjIF0iLiOSTjGJp4yRT9Al9pgMCj2
|
||||
O1JUMYxQ490mSFHBomNv1fq+f5VJnytEwAkJH6AgH+RIcAC5/r+sowfLv+Gy0ga8
|
||||
jKG6t9d/x6lRNv0x5sUhYkiUD9Naq0NncaZz1GtkBAyu+hUZx2+zg3r8He4XoiXx
|
||||
zWAQEgcW3X1/9VC7IBvaK9cdLG5pbeGCBaDv8S0Ue332mM0XNDlffjdC7Sg9f/TG
|
||||
YV8MHpR3RwwUqdi6WFPQqVz5Hv1pE02v/Uw6tby1UgAnzskrufPh+m8CAwEAAQ==
|
||||
-----END RSA PUBLIC KEY-----
|
10
collect-network-connections.sh
Normal file
10
collect-network-connections.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# collect all network configurations and save them in the store
|
||||
|
||||
sudo ls /etc/NetworkManager/system-connections \
|
||||
| while read file
|
||||
do
|
||||
sudo cat /etc/NetworkManager/system-connections/$file \
|
||||
| pass insert -m desktop/network-manager/system-connections/$file
|
||||
done
|
64
configs/pepe/configuration.nix
Normal file
64
configs/pepe/configuration.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
|
||||
|
||||
imports = [
|
||||
|
||||
<system/desktop>
|
||||
./hardware-configuration.nix
|
||||
|
||||
./encfs.nix
|
||||
#./samba.nix
|
||||
./syncthing.nix
|
||||
./tinc.nix
|
||||
#./wifi-access-point.nix
|
||||
|
||||
];
|
||||
|
||||
custom.samba-share.folders = {
|
||||
enable = false;
|
||||
public = "/home/palo/movies";
|
||||
};
|
||||
|
||||
system.custom.wifi.interfaces = ["wlp3s0"];
|
||||
|
||||
networking.hostName = "pepe";
|
||||
|
||||
security.wrappers = {
|
||||
pmount.source = "${pkgs.pmount}/bin/pmount";
|
||||
pumount.source = "${pkgs.pmount}/bin/pumount";
|
||||
};
|
||||
|
||||
# keybase
|
||||
services.keybase.enable = true;
|
||||
services.kbfs.enable = true;
|
||||
|
||||
programs.custom.steam.enable = false;
|
||||
programs.custom.video.enable = false;
|
||||
|
||||
services.printing.enable = true;
|
||||
|
||||
# fonts
|
||||
# -----
|
||||
programs.custom.urxvt.fontSize = 12;
|
||||
programs.custom.xterm.fontSize = 12;
|
||||
system.custom.fonts.dpi = 100;
|
||||
|
||||
virtualisation = {
|
||||
docker.enable = false;
|
||||
|
||||
virtualbox = {
|
||||
host.enable = false;
|
||||
guest.x11 = false;
|
||||
guest.enable = false;
|
||||
};
|
||||
};
|
||||
|
||||
configuration.desktop = {
|
||||
width = 1366;
|
||||
height = 768;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
8
configs/pepe/encfs.nix
Normal file
8
configs/pepe/encfs.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
module.backup.services.encfs = {
|
||||
"fotos".enable = true;
|
||||
"desktop".enable = true;
|
||||
"finance".enable = true;
|
||||
};
|
||||
}
|
86
configs/pepe/hardware-configuration.nix
Normal file
86
configs/pepe/hardware-configuration.nix
Normal file
|
@ -0,0 +1,86 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
version = 2;
|
||||
device = "/dev/sda";
|
||||
};
|
||||
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
numDevices = 2;
|
||||
swapDevices = 1;
|
||||
memoryPercent = 50;
|
||||
};
|
||||
|
||||
fileSystems."/share/" = {
|
||||
device = "/dev/ram1";
|
||||
fsType = "tmpfs";
|
||||
};
|
||||
|
||||
fileSystems."/browsers/" = {
|
||||
#device = "/dev/ram2";
|
||||
#fsType = "tmpfs";
|
||||
options = [ "noatime" "nodiratime" "discard" ];
|
||||
device = "/dev/secure_vg/browser";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
nix.maxJobs = lib.mkDefault 4;
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
|
||||
|
||||
|
||||
# lvm volume group
|
||||
# ----------------
|
||||
boot.initrd.luks.devices = [
|
||||
{
|
||||
name = "secure_vg";
|
||||
device = "/dev/sda2";
|
||||
preLVM = true;
|
||||
}
|
||||
];
|
||||
|
||||
# NTFS support
|
||||
# ------------
|
||||
environment.systemPackages = [
|
||||
pkgs.ntfs3g
|
||||
];
|
||||
|
||||
# root
|
||||
# ----
|
||||
fileSystems."/" = {
|
||||
options = [ "noatime" "nodiratime" "discard" ];
|
||||
device = "/dev/secure_vg/root";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# /home/palo/private/.fotos.ct
|
||||
# ----------------------------
|
||||
fileSystems."/home/palo/private/.fotos.ct" = {
|
||||
options = [ "noatime" "nodiratime" "discard" ];
|
||||
device = "/dev/secure_vg/fotos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# boot
|
||||
# ----
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/sda1";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
|
||||
}
|
5
configs/pepe/samba.nix
Normal file
5
configs/pepe/samba.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
|
||||
|
||||
}
|
32
configs/pepe/syncthing.nix
Normal file
32
configs/pepe/syncthing.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
|
||||
test.services.syncthing = {
|
||||
enable = true;
|
||||
openDefaultPorts = false;
|
||||
user = "palo";
|
||||
dataDir = "/home/palo/.syncthing";
|
||||
configDir = "/home/palo/.syncthing";
|
||||
declarative = {
|
||||
cert = toString <secrets/syncthing/cert.pem>;
|
||||
key = toString <secrets/syncthing/key.pem>;
|
||||
|
||||
overrideFolders = true;
|
||||
folders = {
|
||||
|
||||
book.path = "/home/palo/books";
|
||||
desktop-encrypted.path = "/home/palo/.desktop.ct";
|
||||
finance-encrypted.path = "/home/palo/.finance.ct";
|
||||
fotos-encrypted.path = "/home/palo/private/.fotos.ct";
|
||||
kruck-pepe.path = "/home/palo/pepe-kruck";
|
||||
music-library.path = "/home/palo/music-library";
|
||||
music-projects.path = "/home/palo/music-projects";
|
||||
porani-pepe.path = "/home/palo/pepe-porani";
|
||||
schasch-pepe.path = "/home/palo/pepe-schasch";
|
||||
smartphone-fotos.path = "/home/palo/smartphone-fotos";
|
||||
workout-pepe.path = "/home/palo/pepe-workout";
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
18
configs/pepe/tinc.nix
Normal file
18
configs/pepe/tinc.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
module.cluster.services.tinc = {
|
||||
"private" = {
|
||||
enable = true;
|
||||
openPort = true;
|
||||
connectTo = [ "sputnik" ];
|
||||
};
|
||||
"retiolum" = {
|
||||
enable = true;
|
||||
openPort = true;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
77
configs/pepe/wifi-access-point.nix
Normal file
77
configs/pepe/wifi-access-point.nix
Normal file
|
@ -0,0 +1,77 @@
|
|||
{lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
wifi = "wlp0s29u1u2";
|
||||
ipAddress = "10.123.145.1";
|
||||
prefixLength = 24;
|
||||
servedAddressRange = "10.123.145.2,10.123.145.150,12h";
|
||||
ssid="bumbumbum";
|
||||
wifiPassword=lib.fileContents <secrets/wifi-access-point>;
|
||||
in
|
||||
|
||||
{
|
||||
# todo only open needed ports
|
||||
networking.firewall.trustedInterfaces = [ wifi ];
|
||||
|
||||
networking.networkmanager.unmanaged = [ wifi ];
|
||||
networking.dhcpcd.denyInterfaces = [ wifi ];
|
||||
|
||||
networking.interfaces."${wifi}".ipv4.addresses = [ {
|
||||
address = ipAddress;
|
||||
prefixLength = prefixLength;
|
||||
}];
|
||||
|
||||
# forward traffic coming in trough the access point => provide internet and vpn network access
|
||||
# todo : forward to own servers
|
||||
boot.kernel.sysctl = {
|
||||
"net.ipv4.conf.${wifi}.forwarding" = true;
|
||||
"net.ipv6.conf.${wifi}.forwarding" = true;
|
||||
};
|
||||
|
||||
systemd.services.hostapd = {
|
||||
description = "hostapd wireless AP";
|
||||
path = [ pkgs.hostapd ];
|
||||
|
||||
# start manual
|
||||
# wantedBy = [ "network.target" ];
|
||||
|
||||
after = [ "${wifi}-cfg.service" "nat.service" "bind.service" "dhcpd.service" "sys-subsystem-net-devices-${wifi}.device" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.hostapd}/bin/hostapd ${pkgs.writeText "hostapd.conf" ''
|
||||
interface=${wifi}
|
||||
hw_mode=g
|
||||
channel=10
|
||||
ieee80211d=1
|
||||
country_code=DE
|
||||
ieee80211n=1
|
||||
wmm_enabled=1
|
||||
|
||||
ssid=${ssid}
|
||||
auth_algs=1
|
||||
wpa=2
|
||||
wpa_key_mgmt=WPA-PSK
|
||||
rsn_pairwise=CCMP
|
||||
wpa_passphrase=${wifiPassword}
|
||||
''}";
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
|
||||
services.dnsmasq = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
# Only listen to routers' LAN NIC. Doing so opens up tcp/udp port 53 to
|
||||
# localhost and udp port 67 to world:
|
||||
interface=${wifi}
|
||||
|
||||
# Explicitly specify the address to listen on
|
||||
listen-address=${ipAddress}
|
||||
|
||||
# Dynamic range of IPs to make available to LAN PC and the lease time.
|
||||
# Ideally set the lease time to 5m only at first to test everything works okay before you set long-lasting records.
|
||||
dhcp-range=${servedAddressRange}
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
58
configs/porani/configuration.nix
Normal file
58
configs/porani/configuration.nix
Normal file
|
@ -0,0 +1,58 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
|
||||
<system/server>
|
||||
./hardware-configuration.nix
|
||||
|
||||
./tinc.nix
|
||||
./syncthing.nix
|
||||
#./packages.nix
|
||||
#./home-assistant.nix
|
||||
#./wifi-access-point.nix
|
||||
#./kodi.nix
|
||||
#./mpd.nix
|
||||
|
||||
];
|
||||
|
||||
networking.hostName = "porani";
|
||||
|
||||
# enable initrd ssh
|
||||
configuration.init-ssh = {
|
||||
enable = "enabled";
|
||||
kernelModules = [ "e1000e" ];
|
||||
authorizedKeys = config.users.users.root.openssh.authorizedKeys.keyFiles;
|
||||
hostECDSAKey = <secrets/init-ssh/host_ecdsa_key>;
|
||||
};
|
||||
|
||||
# programs
|
||||
programs.custom.vim.enable = true;
|
||||
environment.systemPackages = [ pkgs.mosh ];
|
||||
|
||||
# wifi setup
|
||||
#system.custom.wifi = {
|
||||
# enable = true;
|
||||
# configurationFile = <secrets/wpa_supplicant>;
|
||||
# interfaces = [ "wlp3s0" ];
|
||||
#};
|
||||
# nix-shell -p speedtest_cli --run speedtest
|
||||
#configuration.fireqos = {
|
||||
# enable = true;
|
||||
# interface = "wlp3s0";
|
||||
# input = 2500;
|
||||
# output = 1200;
|
||||
# balance = false;
|
||||
#};
|
||||
|
||||
# nix-shell -p speedtest_cli --run speedtest
|
||||
configuration.fireqos = {
|
||||
enable = true;
|
||||
interface = "eth0";
|
||||
input = 2500;
|
||||
output = 1200;
|
||||
balance = false;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
77
configs/porani/hardware-configuration.nix
Normal file
77
configs/porani/hardware-configuration.nix
Normal file
|
@ -0,0 +1,77 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
imports =
|
||||
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# grub configuration
|
||||
# ------------------
|
||||
boot.loader.grub = {
|
||||
device = "/dev/sda";
|
||||
enable = true;
|
||||
version = 2;
|
||||
};
|
||||
|
||||
# lvm volume group
|
||||
# ----------------
|
||||
boot.initrd.luks.devices = [
|
||||
{
|
||||
name = "vg";
|
||||
device = "/dev/sda2";
|
||||
preLVM = true;
|
||||
}
|
||||
];
|
||||
|
||||
# NTFS support
|
||||
# ------------
|
||||
environment.systemPackages = [
|
||||
pkgs.ntfs3g
|
||||
];
|
||||
|
||||
# root
|
||||
# ----
|
||||
fileSystems."/" = {
|
||||
options = [ "noatime" "nodiratime" "discard" ];
|
||||
device = "/dev/vg/root";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# boot
|
||||
# ----
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/sda1";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# automount
|
||||
# ---------
|
||||
fileSystems."/media" = {
|
||||
device = "/dev/disk/by-uuid/162c2f9e-8baa-4433-99fd-bb7e7b69472f";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"nofail"
|
||||
"noauto"
|
||||
#"x-systemd.device-timeout=1ms"
|
||||
];
|
||||
};
|
||||
systemd.mounts = [
|
||||
{
|
||||
enable = true;
|
||||
options = "nofail,noauto";
|
||||
type = "ext4";
|
||||
wantedBy = ["multi-user.target"];
|
||||
what = "/dev/disk/by-uuid/162c2f9e-8baa-4433-99fd-bb7e7b69472f";
|
||||
where = "/media";
|
||||
}
|
||||
];
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nix.maxJobs = lib.mkDefault 4;
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
}
|
228
configs/porani/home-assistant.nix
Normal file
228
configs/porani/home-assistant.nix
Normal file
|
@ -0,0 +1,228 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
unstablePkgs = import <nixpkgs-unstable> {};
|
||||
in {
|
||||
|
||||
imports = [
|
||||
./home-assistant/chaospott.nix
|
||||
./home-assistant/holiday.nix
|
||||
./home-assistant/mpd.nix
|
||||
./home-assistant/sonoff.nix
|
||||
./home-assistant/mqtt.nix
|
||||
./home-assistant/dayOfWeek.nix
|
||||
./home-assistant/timer.nix
|
||||
./home-assistant/kodi.nix
|
||||
./home-assistant/zigbee2mqtt.nix
|
||||
];
|
||||
|
||||
|
||||
services.homeAssistantConfig = {
|
||||
|
||||
# turn on to edit GUI
|
||||
# lovelace = {};
|
||||
|
||||
homeassistant = {
|
||||
latitude = 51.444847;
|
||||
longitude = 6.967006;
|
||||
elevation = 116;
|
||||
|
||||
|
||||
auth_providers = [
|
||||
{
|
||||
type = "trusted_networks";
|
||||
trusted_networks = [
|
||||
config.module.cluster.services.tinc."private".networkSubnet
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
prometheus.namespace = "hass";
|
||||
|
||||
automation = [
|
||||
|
||||
# todo when ich weis ich bin zuhause
|
||||
#{
|
||||
# alias = "Licht and wenn Dunkel";
|
||||
# trigger = {
|
||||
# platform = "state";
|
||||
# entity_id = [ "binary_sensor.night" ];
|
||||
# from = "off";
|
||||
# to = "on";
|
||||
# };
|
||||
# action = [
|
||||
# {
|
||||
# service = "switch.turn_on";
|
||||
# entity_id = "group.kitchen";
|
||||
# }
|
||||
# {
|
||||
# service = "switch.turn_on";
|
||||
# entity_id = "group.living_room";
|
||||
# }
|
||||
# ];
|
||||
#}
|
||||
|
||||
#{
|
||||
# alias = "Küchen Sensor An";
|
||||
# trigger = {
|
||||
# platform = "state";
|
||||
# entity_id = [ "binary_sensor.motion_1" ];
|
||||
# to = "on";
|
||||
# };
|
||||
# action = {
|
||||
# service = "switch.turn_on";
|
||||
# entity_id = "group.kitchen";
|
||||
# };
|
||||
#}
|
||||
|
||||
#{
|
||||
# alias = "Küchen Sensor aus";
|
||||
# trigger = {
|
||||
# platform = "state";
|
||||
# entity_id = [ "binary_sensor.motion_1" ];
|
||||
# to = "off";
|
||||
# for = "00:00:25";
|
||||
# };
|
||||
# action = {
|
||||
# service = "switch.turn_off";
|
||||
# entity_id = "group.kitchen";
|
||||
# };
|
||||
#}
|
||||
];
|
||||
|
||||
group = {
|
||||
bed_room = {
|
||||
name = "Schlafzimmer";
|
||||
view = false;
|
||||
};
|
||||
tv = {
|
||||
name = "TV";
|
||||
view = false;
|
||||
};
|
||||
living_room = {
|
||||
name = "Wohnzimmer";
|
||||
view = false;
|
||||
};
|
||||
kitchen = {
|
||||
name = "Küche";
|
||||
view = false;
|
||||
};
|
||||
today = {
|
||||
control = "hidden";
|
||||
name = "Today";
|
||||
view = false;
|
||||
entities = [
|
||||
"sensor.weather_temperature"
|
||||
"sun.sun"
|
||||
];
|
||||
};
|
||||
all_lights = {
|
||||
name = "All Lights";
|
||||
view = false;
|
||||
};
|
||||
unknown = {
|
||||
control = "hidden";
|
||||
name = "Not Used";
|
||||
view = false;
|
||||
};
|
||||
|
||||
view_rooms = {
|
||||
name = "Räume";
|
||||
view = true;
|
||||
entities = [
|
||||
"group.all_lights"
|
||||
"group.bed_room"
|
||||
"group.living_room"
|
||||
"group.kitchen"
|
||||
"group.tv"
|
||||
];
|
||||
};
|
||||
|
||||
view_overview = {
|
||||
name = "Übersicht";
|
||||
view = true;
|
||||
entities = [ "group.today" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
sun = {};
|
||||
|
||||
script.turn_all_off.sequence = [ ];
|
||||
|
||||
script.turn_all_on.sequence = [ ];
|
||||
|
||||
sensor = [
|
||||
# Weather prediction
|
||||
{ platform = "zamg";
|
||||
name = "Weather";
|
||||
}
|
||||
];
|
||||
|
||||
# todo: add holidays package to home-assiatnt
|
||||
binary_sensor = [
|
||||
{
|
||||
name = "before_workday";
|
||||
platform = "workday";
|
||||
country = "DE";
|
||||
province = "NW";
|
||||
workdays = [ "mon" "tue" "wed" "thu" "fri" ];
|
||||
days_offset = 1;
|
||||
}
|
||||
{
|
||||
name = "workday";
|
||||
platform = "workday";
|
||||
country = "DE";
|
||||
province = "NW";
|
||||
workdays = [ "mon" "tue" "wed" "thu" "fri" ];
|
||||
}
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
|
||||
services.home-assistant = {
|
||||
enable = true;
|
||||
package = unstablePkgs.home-assistant.override{
|
||||
python3 = unstablePkgs.python36;
|
||||
extraPackages = python: [
|
||||
# todo : check which is still needed
|
||||
python.netdisco
|
||||
python.xmltodict
|
||||
python.mpd2
|
||||
|
||||
# for mqtt
|
||||
python.hbmqtt
|
||||
python.paho-mqtt
|
||||
|
||||
# needed for platform workday
|
||||
(python.buildPythonPackage rec{
|
||||
|
||||
pname = "holidays";
|
||||
version = "0.9.10";
|
||||
|
||||
src = python.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "9f06d143eb708e8732230260636938f2f57114e94defd8fa2082408e0d422d6f";
|
||||
};
|
||||
|
||||
doCheck = false;
|
||||
buildInputs = [ pkgs.dateutils ];
|
||||
propagatedBuildInputs = [
|
||||
python."python-dateutil"
|
||||
python."six"
|
||||
];
|
||||
meta = with pkgs.stdenv.lib; {
|
||||
homepage = "https://github.com/dr-prodigy/python-holidays";
|
||||
license = licenses.mit;
|
||||
description = "Generate and work with holidays in Python";
|
||||
maintainers = with maintainers; [ mrVanDalo ];
|
||||
};
|
||||
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
85
configs/porani/home-assistant/chaospott.nix
Normal file
85
configs/porani/home-assistant/chaospott.nix
Normal file
|
@ -0,0 +1,85 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
|
||||
name = "chaospott";
|
||||
folderPath = config.services.home-assistant.configDir;
|
||||
filePath = "${folderPath}/${name}.json";
|
||||
|
||||
in {
|
||||
services.homeAssistantConfig = {
|
||||
|
||||
sensor = [
|
||||
{
|
||||
platform = "file";
|
||||
name = "${name}_aerie";
|
||||
file_path = filePath;
|
||||
value_template = "{{ value_json.aerie }}";
|
||||
}
|
||||
{
|
||||
platform = "file";
|
||||
name = "${name}_cellar";
|
||||
file_path = filePath;
|
||||
value_template = "{{ value_json.cellar }}";
|
||||
}
|
||||
];
|
||||
|
||||
homeassistant = {
|
||||
whitelist_external_dirs = [ folderPath ];
|
||||
customize = {
|
||||
"sensor.${name}_aerie" = {
|
||||
icon = "mdi:store";
|
||||
entity_picture = "https://chaospott.de/images/logo.png";
|
||||
friendly_name = "ChaosPott Oben";
|
||||
};
|
||||
"sensor.${name}_cellar" = {
|
||||
icon = "mdi:store";
|
||||
entity_picture = "https://chaospott.de/images/logo.png";
|
||||
friendly_name = "ChaosPott Unten";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
group = {
|
||||
"${name}" = {
|
||||
name = "ChaosPott (Essen)";
|
||||
control = "hidden";
|
||||
entities = [
|
||||
"sensor.${name}_aerie"
|
||||
"sensor.${name}_cellar"
|
||||
];
|
||||
};
|
||||
view_overview.entities = [ "group.${name}" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
systemd.services."${name}" = {
|
||||
enable = true;
|
||||
before = [ "home-assistant.service" ];
|
||||
wantedBy = [ "home-assistant.service" ];
|
||||
serviceConfig = {
|
||||
User = "hass";
|
||||
Type = "oneshot";
|
||||
};
|
||||
description = "set ${name} for homeassistant";
|
||||
script = /* sh */ ''
|
||||
${pkgs.curl}/bin/curl -Ls https://status.chaospott.de/api \
|
||||
| ${pkgs.jq}/bin/jq --compact-output \
|
||||
'.sensors.door_locked |
|
||||
[.[] | { "\(.location)" : (if .value then "closed" else "open" end) }] |
|
||||
reduce .[] as $item ({}; . + $item) ' \
|
||||
>> ${filePath}
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.timers."${name}" = {
|
||||
enable = true;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "hourly";
|
||||
Persistent = "true";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
}
|
57
configs/porani/home-assistant/dayOfWeek.nix
Normal file
57
configs/porani/home-assistant/dayOfWeek.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
|
||||
folderPath = config.services.home-assistant.configDir;
|
||||
filePath = "${folderPath}/dayOfWeek.json";
|
||||
|
||||
in {
|
||||
services.homeAssistantConfig = {
|
||||
|
||||
sensor = [
|
||||
{ platform = "file";
|
||||
name = "day_of_week";
|
||||
file_path = filePath;
|
||||
value_template = "{{ value_json.dayOfWeek }}";
|
||||
}
|
||||
];
|
||||
|
||||
homeassistant = {
|
||||
whitelist_external_dirs = [ folderPath ];
|
||||
customize."sensor.day_of_week" = {
|
||||
icon = "mdi:calendar-today";
|
||||
friendly_name = "Wochen Tag";
|
||||
};
|
||||
};
|
||||
|
||||
group = {
|
||||
overview.entities = [
|
||||
"sensor.day_of_week"
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
systemd.services.dayOfWeek = {
|
||||
enable = true;
|
||||
before = [ "home-assistant.service" ];
|
||||
wantedBy = [ "home-assistant.service" ];
|
||||
serviceConfig = {
|
||||
User = "hass";
|
||||
Type = "oneshot";
|
||||
};
|
||||
description = "set day of wek for homeassistant";
|
||||
script = /* sh */ ''
|
||||
date +'{"dayOfWeek":"%A"}' >> ${filePath}
|
||||
'';
|
||||
};
|
||||
systemd.timers.dayOfWeek = {
|
||||
enable = true;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "00:01:00";
|
||||
Persistent = "true";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
}
|
93
configs/porani/home-assistant/holiday.nix
Normal file
93
configs/porani/home-assistant/holiday.nix
Normal file
|
@ -0,0 +1,93 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
|
||||
state = "NW"; # NRW
|
||||
# state = "BE"; # Berlin
|
||||
|
||||
name = "holiday";
|
||||
folderPath = config.services.home-assistant.configDir;
|
||||
filePath = "${folderPath}/${name}.json";
|
||||
|
||||
in {
|
||||
services.homeAssistantConfig = {
|
||||
|
||||
# todo : use the python tool
|
||||
sensor = [
|
||||
{ platform = "file";
|
||||
name = "${name}_date";
|
||||
file_path = filePath;
|
||||
value_template = "{{ value_json.date }}";
|
||||
}
|
||||
{ platform = "file";
|
||||
name = "${name}_name";
|
||||
file_path = filePath;
|
||||
value_template = "{{ value_json.name }}";
|
||||
}
|
||||
];
|
||||
|
||||
homeassistant = {
|
||||
whitelist_external_dirs = [ folderPath ];
|
||||
customize = {
|
||||
"sensor.${name}_date" = {
|
||||
icon = "mdi:calendar";
|
||||
friendly_name = "Nächster Feiertag";
|
||||
};
|
||||
"sensor.${name}_name" = {
|
||||
icon = "mdi:calendar";
|
||||
friendly_name = "Nächster Feiertag";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
group = {
|
||||
|
||||
holidays = {
|
||||
name = "Feiertage";
|
||||
view = false;
|
||||
control = "hidden";
|
||||
entities = [
|
||||
"sensor.${name}_date"
|
||||
"sensor.${name}_name"
|
||||
];
|
||||
};
|
||||
|
||||
view_overview.entities = [ "group.holidays" ];
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
systemd.services."${name}" = {
|
||||
enable = true;
|
||||
before = [ "home-assistant.service" ];
|
||||
wantedBy = [ "home-assistant.service" ];
|
||||
serviceConfig = {
|
||||
User = "hass";
|
||||
Type = "oneshot";
|
||||
};
|
||||
description = "set ${name} for homeassistant";
|
||||
script = /* sh */ ''
|
||||
${pkgs.curl}/bin/curl \
|
||||
-Ls "https://feiertage-api.de/api/?jahr=$( date +%Y )&nur_land=${state}" \
|
||||
| ${pkgs.jq}/bin/jq --compact-output '
|
||||
map_values( .datum ) |
|
||||
to_entries |
|
||||
map( { date: .value, name : .key } ) |
|
||||
sort_by( .date ) |
|
||||
map(select ( .date >= "'`date +%Y-%m-%d`'" )) |
|
||||
.[0]' \
|
||||
>> ${filePath}
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.timers."${name}" = {
|
||||
enable = true;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = "true";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
}
|
85
configs/porani/home-assistant/kodi.nix
Normal file
85
configs/porani/home-assistant/kodi.nix
Normal file
|
@ -0,0 +1,85 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
|
||||
services.homeAssistantConfig = {
|
||||
|
||||
group.view_overview.entities = [
|
||||
"media_player.kodi"
|
||||
];
|
||||
|
||||
media_player = [
|
||||
{
|
||||
platform = "kodi";
|
||||
host = "127.0.0.1";
|
||||
turn_on_action.service = "script.watch_tv";
|
||||
turn_off_action.service = "script.stop_watch_tv";
|
||||
}
|
||||
];
|
||||
|
||||
shell_command = {
|
||||
start_display = "sudo ${pkgs.systemd}/bin/systemctl start display-manager";
|
||||
stop_display = "sudo ${pkgs.systemd}/bin/systemctl stop display-manager";
|
||||
};
|
||||
|
||||
script = {
|
||||
|
||||
turn_all_off.sequence = [
|
||||
# todo : use the shell_command here
|
||||
{
|
||||
alias = "turn off tv";
|
||||
service = "switch.turn_off";
|
||||
data.entity_id = "group.tv";
|
||||
}
|
||||
{
|
||||
alias = "stop kodi";
|
||||
service = "shell_command.stop_display";
|
||||
}
|
||||
];
|
||||
|
||||
test_display.sequence = [
|
||||
{ service = "shell_command.start_display"; }
|
||||
{ delay.seconds = 20; }
|
||||
{ service = "shell_command.stop_display"; }
|
||||
];
|
||||
|
||||
watch_tv = {
|
||||
alias = "Watch TV";
|
||||
sequence = [
|
||||
{
|
||||
alias = "turn on tv";
|
||||
service = "switch.turn_on";
|
||||
data.entity_id = "group.tv";
|
||||
}
|
||||
{ delay.minutes = 1;}
|
||||
{
|
||||
alias = "start kodi";
|
||||
service = "shell_command.start_display";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
stop_watch_tv = {
|
||||
alias = "Stop TV";
|
||||
sequence = [
|
||||
{
|
||||