summaryrefslogtreecommitdiffstats
path: root/makefu/2configs
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs')
-rw-r--r--makefu/2configs/backup.nix52
-rw-r--r--makefu/2configs/backup/server.nix11
-rw-r--r--makefu/2configs/backup/ssh/gum.pub1
-rw-r--r--makefu/2configs/backup/ssh/nextgum.pub1
-rw-r--r--makefu/2configs/backup/ssh/omo.pub1
-rw-r--r--makefu/2configs/backup/ssh/x.pub1
-rw-r--r--makefu/2configs/backup/state.nix25
-rw-r--r--makefu/2configs/bepasty-dual.nix5
-rw-r--r--makefu/2configs/bluetooth-mpd.nix2
-rw-r--r--makefu/2configs/dcpp/airdcpp.nix3
-rw-r--r--makefu/2configs/deployment/bureautomation/hass.nix159
-rw-r--r--makefu/2configs/deployment/bureautomation/home.nix67
-rw-r--r--makefu/2configs/deployment/bureautomation/mpd.nix9
-rw-r--r--makefu/2configs/deployment/graphs.nix5
-rw-r--r--makefu/2configs/deployment/homeautomation/default.nix177
-rw-r--r--makefu/2configs/git/cgit-retiolum.nix1
-rw-r--r--makefu/2configs/gui/base.nix4
-rw-r--r--makefu/2configs/gui/wbob-kiosk.nix32
-rw-r--r--makefu/2configs/home-manager/cli.nix8
-rw-r--r--makefu/2configs/home-manager/default.nix3
-rw-r--r--makefu/2configs/home-manager/desktop.nix52
-rw-r--r--makefu/2configs/home-manager/mail.nix3
-rw-r--r--makefu/2configs/hw/bluetooth.nix5
-rw-r--r--makefu/2configs/hw/network-manager.nix3
-rw-r--r--makefu/2configs/hw/switch.nix10
-rw-r--r--makefu/2configs/laptop-backup.nix12
-rw-r--r--makefu/2configs/nginx/euer.blog.nix1
-rw-r--r--makefu/2configs/nginx/euer.wiki.nix1
-rw-r--r--makefu/2configs/printer.nix10
-rw-r--r--makefu/2configs/rtorrent.nix19
-rw-r--r--makefu/2configs/shack/events-publisher/default.nix (renamed from makefu/2configs/deployment/events-publisher/default.nix)4
-rw-r--r--makefu/2configs/shack/gitlab-runner/default.nix31
-rw-r--r--makefu/2configs/stats/arafetch.nix2
-rw-r--r--makefu/2configs/taskd.nix11
-rw-r--r--makefu/2configs/tools/android-pentest.nix2
-rw-r--r--makefu/2configs/tools/desktop.nix2
-rw-r--r--makefu/2configs/tools/extra-gui.nix1
-rw-r--r--makefu/2configs/tools/media.nix4
-rw-r--r--makefu/2configs/tools/mobility.nix2
-rw-r--r--makefu/2configs/tools/secrets.nix2
-rw-r--r--makefu/2configs/torrent.nix20
-rw-r--r--makefu/2configs/virtualisation/virtualbox.nix21
42 files changed, 499 insertions, 286 deletions
diff --git a/makefu/2configs/backup.nix b/makefu/2configs/backup.nix
deleted file mode 100644
index a4d02af6b..000000000
--- a/makefu/2configs/backup.nix
+++ /dev/null
@@ -1,52 +0,0 @@
-{ config, lib, pkgs, ... }:
-with import <stockholm/lib>;
-let
- # preparation:
- # mkdir -p defaultBackupDir/host.name/src
- # as root on omo:
- # ssh-copy-id root@src
- startAt = "0,6,12,18:00";
- defaultBackupServer = config.krebs.hosts.omo;
- defaultBackupDir = "/home/backup";
- defaultPull = host: src: {
- method = "pull";
- src = {
- inherit host;
- path = src;
- };
- dst = {
- host = defaultBackupServer;
- path = "${defaultBackupDir}/${host.name}${src}";
- };
- startAt = "0,6,12,18:00";
- snapshots = {
- hourly = { format = "%Y-%m-%dT%H"; retain = 4; };
- daily = { format = "%Y-%m-%d"; retain = 7; };
- weekly = { format = "%YW%W"; retain = 4; };
- monthly = { format = "%Y-%m"; retain = 12; };
- yearly = { format = "%Y"; };
- };
- };
-in {
- krebs.backup.plans = {
- # wry-to-omo_root = defaultPull config.krebs.hosts.wry "/";
- gum-to-omo_root = defaultPull config.krebs.hosts.gum "/";
- gum-dl-to-omo_external = (defaultPull config.krebs.hosts.gum "/var/download" )//
- {
- dst.path = "/media/cryptX/backup/gum/var-download";
- dst.host = defaultBackupServer;
- startAt = "19:00";
- };
- gum-owncloud-to-omo_external = (defaultPull config.krebs.hosts.gum "/var/www/o.euer.krebsco.de" )//
- {
- dst.path = "/media/cryptX/backup/gum/var-www-o.euer.krebsco.de";
- dst.host = defaultBackupServer;
-
- startAt = "05:00";
- };
- # wolf-to-omo_root = defaultPull config.krebs.hosts.wolf "/";
- };
- environment.systemPackages = [
- pkgs.borgbackup
- ];
-}
diff --git a/makefu/2configs/backup/server.nix b/makefu/2configs/backup/server.nix
new file mode 100644
index 000000000..f157e715f
--- /dev/null
+++ b/makefu/2configs/backup/server.nix
@@ -0,0 +1,11 @@
+{lib, ... }:
+let
+ hosts = lib.mapAttrsToList (f: _: lib.removeSuffix ".pub" f) (builtins.readDir ./ssh );
+in {
+ # TODO: for all enabled machines
+ services.borgbackup.repos = lib.genAttrs hosts (host: {
+ authorizedKeys = [ (builtins.readFile (./ssh + "/${host}.pub") ) ];
+ path = "/var/lib/borgbackup/${host}";
+ user = "borg-${host}";
+ }) ;
+}
diff --git a/makefu/2configs/backup/ssh/gum.pub b/makefu/2configs/backup/ssh/gum.pub
new file mode 100644
index 000000000..ed203d544
--- /dev/null
+++ b/makefu/2configs/backup/ssh/gum.pub
@@ -0,0 +1 @@
+ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOSCJe7DQkKbL58pL78ImO+nVI/aaNFP8Zyqgo8EbNhW makefu@x
diff --git a/makefu/2configs/backup/ssh/nextgum.pub b/makefu/2configs/backup/ssh/nextgum.pub
new file mode 100644
index 000000000..52d56d956
--- /dev/null
+++ b/makefu/2configs/backup/ssh/nextgum.pub
@@ -0,0 +1 @@
+ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOUZcfi2SXxCo1if0oU3x9qPK8/O5FmiXy2HFZyTp/P1 makefu@x
diff --git a/makefu/2configs/backup/ssh/omo.pub b/makefu/2configs/backup/ssh/omo.pub
new file mode 100644
index 000000000..053b4da87
--- /dev/null
+++ b/makefu/2configs/backup/ssh/omo.pub
@@ -0,0 +1 @@
+ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAtA3XzpjByYQ9uSHQr0dkNUyi6nROjwv1S2IQtUu4pi makefu@x
diff --git a/makefu/2configs/backup/ssh/x.pub b/makefu/2configs/backup/ssh/x.pub
new file mode 100644
index 000000000..fe894df33
--- /dev/null
+++ b/makefu/2configs/backup/ssh/x.pub
@@ -0,0 +1 @@
+ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBRfhUv9twYbO7tUe2r2LOXEMNxW14GO3Q0RTkUWeMxw makefu@x
diff --git a/makefu/2configs/backup/state.nix b/makefu/2configs/backup/state.nix
new file mode 100644
index 000000000..1143708bf
--- /dev/null
+++ b/makefu/2configs/backup/state.nix
@@ -0,0 +1,25 @@
+{ config, ... }:
+# back up all state
+let
+ sec = toString <secrets>;
+ sshkey = sec + "/borg.priv";
+ phrase = sec + "/borg.pw";
+in
+{
+ services.borgbackup.jobs.state = {
+ repo = "borg-${config.krebs.build.host.name}@backup.makefu.r:.";
+ paths = config.state;
+ encryption = {
+ mode = "repokey";
+ passCommand = "cat ${phrase}";
+ };
+ environment.BORG_RSH = "ssh -i ${sshkey}";
+ prune.keep =
+ { daily = 7;
+ weekly = 4;
+ monthly = -1; # Keep at least one archive for each month
+ };
+ compression = "auto,lzma";
+ startAt = "daily";
+ };
+}
diff --git a/makefu/2configs/bepasty-dual.nix b/makefu/2configs/bepasty-dual.nix
index 890652285..f63dbefd8 100644
--- a/makefu/2configs/bepasty-dual.nix
+++ b/makefu/2configs/bepasty-dual.nix
@@ -32,6 +32,11 @@ in {
"paste.${config.krebs.build.host.name}"
"paste.r"
];
+ extraConfig = ''
+ if ( $server_addr = "${external-ip}" ) {
+ return 403;
+ }
+ '';
};
defaultPermissions = "admin,list,create,read,delete";
secretKeyFile = secKey;
diff --git a/makefu/2configs/bluetooth-mpd.nix b/makefu/2configs/bluetooth-mpd.nix
index b59d3ce10..e007b6072 100644
--- a/makefu/2configs/bluetooth-mpd.nix
+++ b/makefu/2configs/bluetooth-mpd.nix
@@ -57,6 +57,8 @@ in {
load-module module-filter-heuristics
load-module module-filter-apply
load-module module-switch-on-connect
+ load-module module-equalizer-sink
+ load-module module-dbus-protocol
#load-module module-bluez5-device
#load-module module-bluez5-discover
'';
diff --git a/makefu/2configs/dcpp/airdcpp.nix b/makefu/2configs/dcpp/airdcpp.nix
index fe05effd9..ad62babc3 100644
--- a/makefu/2configs/dcpp/airdcpp.nix
+++ b/makefu/2configs/dcpp/airdcpp.nix
@@ -44,5 +44,6 @@
'';
};
-
+ state = map (f: "${config.krebs.airdcpp.stateDir}/${f}")
+ [ "Favorites.xml" "DCPlusPlus.xml" "WebServer.xml" "Recents.xml" "IgnoredUsers.xml" ];
}
diff --git a/makefu/2configs/deployment/bureautomation/hass.nix b/makefu/2configs/deployment/bureautomation/hass.nix
index 4605e8933..443484a34 100644
--- a/makefu/2configs/deployment/bureautomation/hass.nix
+++ b/makefu/2configs/deployment/bureautomation/hass.nix
@@ -11,6 +11,11 @@ let
payload_available= "Online";
payload_not_available= "Offline";
};
+ tasmota_stecki = name: topic:
+ ( tasmota_plug name topic) //
+ { state_topic = "/bam/${topic}/stat/POWER";
+ command_topic = "/bam/${topic}/cmnd/POWER";
+ };
espeasy_dht22 = name: [
{ platform = "mqtt";
name = "${name} DHT22 Temperature";
@@ -38,9 +43,6 @@ let
};
in {
networking.firewall.allowedTCPPorts = [ 8123 ];
- nixpkgs.config.permittedInsecurePackages = [
- "homeassistant-0.65.5"
- ];
services.home-assistant = {
enable = true;
@@ -48,6 +50,9 @@ in {
homeassistant = {
name = "Bureautomation";
time_zone = "Europe/Berlin";
+ latitude = "48.8265";
+ longitude = "9.0676";
+ elevation = 303;
};
mqtt = {
@@ -72,7 +77,7 @@ in {
switch = [
(tasmota_plug "Bauarbeiterlampe" "plug")
(tasmota_plug "Blitzdings" "plug2")
- (tasmota_plug "Fernseher" "plug3")
+ (tasmota_stecki "Fernseher" "fernseher")
(tasmota_plug "Pluggy" "plug4")
];
binary_sensor = [
@@ -96,26 +101,140 @@ in {
sensorid = "5341";
monitored_conditions = [ "P1" "P2" ];
}
- { platform = "influxdb";
- queries = [
- { name = "mean value of feinstaub P1";
- where = '' "node" = 'esp8266-1355142' '';
- measurement = "feinstaub";
- database = "telegraf";
- field = "P1";
- }
- { name = "mean value of feinstaub P2";
- where = '' "node" = 'esp8266-1355142' '';
- measurement = "feinstaub";
- database = "telegraf";
- field = "P2";
- }
- ];
+
+ { platform = "darksky";
+ api_key = lib.removeSuffix "\n"
+ (builtins.readFile <secrets/hass/darksky.apikey>);
+ language = "de";
+ monitored_conditions = [ "summary" "icon"
+ "nearest_storm_distance" "precip_probability"
+ "precip_intensity"
+ "temperature" # "temperature_high" "temperature_low"
+ "apparent_temperature"
+ "hourly_summary" # next 24 hours text
+ "minutely_summary"
+ "humidity"
+ "pressure"
+ "uv_index" ];
+ units = "si" ;
+ update_interval = {
+ days = 0;
+ hours = 0;
+ minutes = 30;
+ seconds = 0;
+ };
+ }
+ #{ platform = "influxdb";
+ # queries = [
+ # { name = "mean value of feinstaub P1";
+ # where = '' "node" = 'esp8266-1355142' '';
+ # measurement = "feinstaub";
+ # database = "telegraf";
+ # field = "P1";
+ # }
+ # { name = "mean value of feinstaub P2";
+ # where = '' "node" = 'esp8266-1355142' '';
+ # measurement = "feinstaub";
+ # database = "telegraf";
+ # field = "P2";
+ # }
+ # ];
+ #}
+ ];
+ camera = [
+ { name = "Baumarkt";
+ platform = "generic";
+ still_image_url = http://t4915209254324-p80-c0-h6jv2afnujcoftrcstsafb45kdrqv4buy.webdirect.mdex.de/oneshotimage ;# baumarkt
+ }
+ { name = "Autobahn Heilbronn";
+ platform = "generic";
+ still_image_url = https://api.svz-bw.de/v2/verkehrskameras/kameras/K10 ;
+ }
+ { name = "Autobahn Singen";
+ platform = "generic";
+ still_image_url = https://api.svz-bw.de/v2/verkehrskameras/kameras/K11 ;
}
];
frontend = { };
http = { };
- feedreader.urls = [ "http://www.heise.de/security/rss/news-atom.xml" ];
+ conversation = {};
+ history = {};
+ logbook = {};
+ tts = [ { platform = "google";} ];
+ recorder = {};
+ group =
+ { default_view =
+ { view = "yes";
+ entities = [
+ "group.sensors"
+ "group.outside"
+ "group.switches"
+ "group.automation"
+ "group.camera"
+ ];
+ };
+ automation = [
+ "automation.turn_off_fernseher_10_minutes_after_last_movement"
+ ];
+ switches = [
+ "switch.bauarbeiterlampe"
+ "switch.blitzdings"
+ "switch.fernseher"
+ "switch.pluggy"
+ ];
+ camera = [
+ "camera.Baumarkt"
+ "camera.Autobahn_Heilbronn"
+ "camera.Autobahn_Singen"
+ ];
+ sensors = [
+ "binary_sensor.motion"
+ "sensor.easy2_dht22_humidity"
+ "sensor.easy2_dht22_temperature"
+ ];
+ outside = [
+ "sensor.ditzingen_pm10"
+ "sensor.ditzingen_pm25"
+ "sensor.dark_sky_temperature"
+ "sensor.dark_sky_humidity"
+ "sensor.dark_sky_pressure"
+ "sensor.dark_sky_hourly_summary"
+ "sensor.dark_sky_minutely_summary"
+ ];
+ };
+ # only for automation
+ # feedreader.urls = [ "http://www.heise.de/security/rss/news-atom.xml" ];
+ automation = [
+ { alias = "Turn on Fernseher on movement";
+ trigger = {
+ platform = "state";
+ entity_id = "binary_sensor.motion";
+ to = "on";
+ };
+ action = {
+ service= "homeassistant.turn_on";
+ entity_id= "switch.fernseher";
+ };
+ }
+ { alias = "Turn off Fernseher 10 minutes after last movement";
+ trigger = {
+ platform = "state";
+ entity_id = "binary_sensor.motion";
+ to = "off";
+ for.minutes = 10;
+ };
+ action = {
+ service= "homeassistant.turn_off";
+ entity_id= "switch.fernseher";
+ };
+ condition = [{
+ condition = "time";
+ before = "06:30:00"; #only turn off between 6:30 and 18:00
+ after = "18:00:00";
+ weekday = [ "mon" "tue" "wed" "thu" "fri" ];
+ }];
+ }
+ ];
};
};
}
diff --git a/makefu/2configs/deployment/bureautomation/home.nix b/makefu/2configs/deployment/bureautomation/home.nix
deleted file mode 100644
index 28edb6af2..000000000
--- a/makefu/2configs/deployment/bureautomation/home.nix
+++ /dev/null
@@ -1,67 +0,0 @@
-{ pkgs, lib, ... }:
-let
- firetv = "192.168.1.238";
-in {
- systemd.services.firetv = {
- wantedBy = [ "multi-user.target" ];
- serviceConfig = {
- User = "nobody";
- ExecStart = "${pkgs.python-firetv}/bin/firetv-server -d ${firetv}:5555";
- };
- };
- services.home-assistant = {
- #panel_iframe:
- #configurator:
- # title: Configurator
- # icon: mdi:wrench
- # url: http://hassio.local:3218
- # sensor:
- # - platform: random
- enable = true;
- config = {
- homeassistant = {
- name = "Bureautomation";
- time_zone = "Europe/Berlin";
- };
- panel_iframe = {
- euer_blog = {
- title = "Euer Blog";
- icon = "mdi:wrench";
- url = "https://euer.krebsco.de";
- };
- };
- media_player = [
- { platform = "kodi";
- host = firetv;
- }
- { platform = "firetv";
- # assumes python-firetv running
- }
- ];
- sensor = [
- {
- platform = "luftdaten";
- name = "Shack 1";
- sensorid = "50";
- monitored_conditions = [ "P1" "P2" ];
- }
- {
- platform = "luftdaten";
- name = "Shack 2";
- sensorid = "658";
- monitored_conditions = [ "P1" "P2" ];
- }
- {
- platform = "luftdaten";
- name = "Ditzingen";
- sensorid = "5341";
- monitored_conditions = [ "P1" "P2" ];
- }
- { platform = "random"; }
- ];
- frontend = { };
- http = { };
- feedreader.urls = [ "https://nixos.org/blogs.xml" ];
- };
- };
-}
diff --git a/makefu/2configs/deployment/bureautomation/mpd.nix b/makefu/2configs/deployment/bureautomation/mpd.nix
new file mode 100644
index 000000000..1f5acb357
--- /dev/null
+++ b/makefu/2configs/deployment/bureautomation/mpd.nix
@@ -0,0 +1,9 @@
+{lib,pkgs, ... }:
+
+{
+ systemd.services."ympd-wbob" = {
+ description = "mpd ";
+ wantedBy = [ "multi-user.target" ];
+ serviceConfig.ExecStart = "${pkgs.ympd}/bin/ympd --host localhost --port 6600 --webport 8866 --user nobody";
+ };
+}
diff --git a/makefu/2configs/deployment/graphs.nix b/makefu/2configs/deployment/graphs.nix
index bde9892cd..e7dc54dd0 100644
--- a/makefu/2configs/deployment/graphs.nix
+++ b/makefu/2configs/deployment/graphs.nix
@@ -6,11 +6,6 @@ let
internal-ip = config.krebs.build.host.nets.retiolum.ip4.addr;
hn = config.krebs.build.host.name;
in {
- krebs.bepasty.servers."paste.r".nginx.extraConfig = ''
- if ( $server_addr = "${external-ip}" ) {
- return 403;
- }
- '';
krebs.tinc_graphs = {
enable = true;
nginx = {
diff --git a/makefu/2configs/deployment/homeautomation/default.nix b/makefu/2configs/deployment/homeautomation/default.nix
index f2a3b36e2..94799b11d 100644
--- a/makefu/2configs/deployment/homeautomation/default.nix
+++ b/makefu/2configs/deployment/homeautomation/default.nix
@@ -1,9 +1,60 @@
-{ pkgs, config, ... }:
+{ pkgs, lib, config, ... }:
# Ideas:
## wake-on-lan server
##
let
+ tasmota_rgb = name: topic:
+# LED WS2812b
+# effect_state_topic: "stat/led/Scheme"
+# effect_command_topic: "cmnd/led/Scheme"
+# effect_value_template: "{{ value_json.Scheme }}"
+ { platform = "mqtt";
+ inherit name;
+ retain = false;
+ qos = 1;
+ optimistic = false;
+ # state
+ # TODO: currently broken, will not use the custom state topic
+ #state_topic = "/ham/${topic}/stat/POWER";
+ state_topic = "/ham/${topic}/stat/POWER";
+ command_topic = "/ham/${topic}/cmnd/POWER";
+ availability_topic = "/ham/${topic}/tele/LWT";
+ payload_on= "ON";
+ payload_off= "OFF";
+ payload_available= "Online";
+ payload_not_available= "Offline";
+ # brightness
+ brightness_state_topic = "/ham/${topic}/stat/Dimmer";
+ brightness_command_topic = "/ham/${topic}/cmnd/Dimmer";
+ brightness_value_template = "{{ value_json.Dimmer }}";
+ brightness_scale = 100;
+ # color
+ rgb_state_topic = "/ham/${topic}/stat/Color";
+ rgb_command_topic = "/ham/${topic}/cmnd/Color2";
+ rgb_command_mode = "hex";
+ rgb_command_template = "{{ '%02x%02x%02x' | format(red, green, blue)}}";
+ # effects
+ effect_state_topic = "/ham/${topic}/stat/Scheme";
+ effect_command_topic = "/ham/${topic}/cmnd/Scheme";
+ effect_value_template = "{{ value_json.Scheme }}";
+ effect_list = [ 0 1 2 3 4 5 6 7 8 9 10 11 12 ];
+};
+ # switchmode 1 - also toggle power
+ # switchtopic flurlicht
+ tasmota_motion = name: topic:
+ { platform = "mqtt";
+ device_class = "motion";
+ inherit name;
+ # TODO: currently broken, will not use the custom state topic
+ state_topic = "/ham/${topic}/stat/POWER";
+ payload_on = "ON";
+ payload_off = "OFF";
+ availability_topic = "/ham/${topic}/tele/LWT";
+ payload_available = "Online";
+ payload_not_available = "Offline";
+ };
+
firetv = "192.168.1.238";
tasmota_plug = name: topic:
{ platform = "mqtt";
@@ -36,20 +87,31 @@ let
unit_of_measurement = "hPa";
}
];
+ tasmota_am2301 = name: topic:
+ [ { platform = "mqtt";
+ name = "${name} Temperatur";
+ state_topic = "/ham/${topic}/tele/SENSOR";
+ value_template = "{{ value_json.AM2301.Temperature }}";
+ unit_of_measurement = "°C";
+ }
+ { platform = "mqtt";
+ name = "${name} Luftfeuchtigkeit";
+ state_topic = "/ham/${topic}/tele/SENSOR";
+ value_template = "{{ value_json.AM2301.Humidity }}";
+ unit_of_measurement = "%";
+ }
+ ];
in {
imports = [
./mqtt.nix
];
- systemd.services.firetv = {
- wantedBy = [ "multi-user.target" ];
- serviceConfig = {
- User = "nobody";
- ExecStart = "${pkgs.python-firetv}/bin/firetv-server -d ${firetv}:5555";
- };
- };
- nixpkgs.config.permittedInsecurePackages = [
- "homeassistant-0.65.5"
- ];
+ #systemd.services.firetv = {
+ # wantedBy = [ "multi-user.target" ];
+ # serviceConfig = {
+ # User = "nobody";
+ # ExecStart = "${pkgs.python-firetv}/bin/firetv-server -d ${firetv}:5555";
+ # };
+ #};
services.home-assistant = {
config = {
homeassistant = {
@@ -58,7 +120,7 @@ in {
longitude = "9.2478";
elevation = 247;
};
- discovery = {};
+ #discovery = {};
conversation = {};
history = {};
logbook = {};
@@ -71,16 +133,16 @@ in {
{ platform = "kodi";
host = firetv;
}
- { platform = "firetv";
- # assumes python-firetv running
- }
+ #{ platform = "firetv";
+ # # assumes python-firetv running
+ #}
];
mqtt = {
broker = "localhost";
port = 1883;
client_id = "home-assistant";
username = "hass";
- password = builtins.readFile <secrets/mqtt/hass>;
+ password = lib.removeSuffix "\n" (builtins.readFile <secrets/mqtt/hass>);
keepalive = 60;
protocol = 3.1;
birth_message = {
@@ -96,43 +158,100 @@ in {
retain = true;
};
};
+ binary_sensor = [
+ (tasmota_motion "Flur Bewegung" "flurlicht")
+ ];
sensor = [
- { platform = "speedtest";
- monitored_conditions = [ "ping" "download" "upload" ];
- }
+ # broken
+ #{ platform = "speedtest";
+ # monitored_conditions = [ "ping" "download" "upload" ];
+ #}
{ platform = "luftdaten";
- name = "Ditzingen";
+ name = "Wangen";
sensorid = "663";
monitored_conditions = [ "P1" "P2" ];
}
# https://www.home-assistant.io/cookbook/automation_for_rainy_days/
{ platform = "darksky";
- api_key = "c73619e6ea79e553a585be06aacf3679";
+ api_key = lib.removeSuffix "\n"
+ (builtins.readFile <secrets/hass/darksky.apikey>);
language = "de";
monitored_conditions = [ "summary" "icon"
"nearest_storm_distance" "precip_probability"
"precip_intensity"
- "temperature" # "temperature_high" "temperature_low"
+ "temperature"
+ "apparent_temperature"
"hourly_summary"
+ "humidity"
+ "pressure"
"uv_index" ];
units = "si" ;
update_interval = {
days = 0;
hours = 0;
- minutes = 10;
+ minutes = 30;
seconds = 0;
};
}
- ] ++ (tasmota_bme "Schlafzimmer" "schlafzimmer");
+ ]
+ ++ (tasmota_bme "Schlafzimmer" "schlafzimmer")
+ ++ (tasmota_am2301 "Arbeitszimmer" "arbeitszimmer");
frontend = { };
- #group = [
- # { default_view = { view = "yes"; entities = [
- # "sensor.luftdaten"
- # ]}
- #];
+ group =
+ { default_view =
+ { view = "yes";
+ entities = [
+ "group.flur"
+ "group.schlafzimmer"
+ "group.draussen"
+ "group.wohnzimmer"
+ "group.arbeitszimmer"
+ ];
+ };
+ flur = [
+ "light.flurlicht"
+ "binary_sensor.flur_bewegung"
+ ];
+ wohnzimmer = [
+ "media_player.kodi"
+ ];
+ draussen = [
+ "sensor.dark_sky_temperature"
+ "sensor.dark_sky_hourly_summary"
+ "sensor.wangen_pm10"
+ "sensor.wangen_pm25"
+ ];
+ schlafzimmer = [
+ "sensor.schlafzimmer_temperatur"
+ "sensor.schlafzimmer_luftdruck"
+ "sensor.schlafzimmer_luftfeuchtigkeit"
+ "switch.lichterkette_schlafzimmer"
+ ];
+ arbeitszimmer = [
+ "switch.strom_staubsauger"
+ "sensor.arbeitszimmer_temperatur"
+ "sensor.arbeitszimmer_luftfeuchtigkeit"
+ ];
+ };
http = { };
switch = [
(tasmota_plug "Lichterkette Schlafzimmer" "schlafzimmer")
+ (tasmota_plug "Strom Staubsauger" "arbeitszimmer")
+ ];
+ light = [ (tasmota_rgb "Flurlicht" "flurlicht" ) ];
+ automation = [
+ { alias = "Staubsauger Strom aus nach 6h";
+ trigger = {
+ platform = "state";
+ entity_id = "switch.strom_staubsauger";
+ to = "on";
+ for.hours = 6;
+ };
+ action = {
+ service= "homeassistant.turn_off";
+ entity_id= "switch.strom_staubsauger";
+ };
+ }
];
};
enable = true;
diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix
index 1a7f3d987..4890e4afe 100644
--- a/makefu/2configs/git/cgit-retiolum.nix
+++ b/makefu/2configs/git/cgit-retiolum.nix
@@ -41,6 +41,7 @@ let
autosync = { };
fenkins = { };
pass = { };
+ secrets = { };
};
connector-repos = mapAttrs make-priv-repo {
diff --git a/makefu/2configs/gui/base.nix b/makefu/2configs/gui/base.nix
index 861a9327e..6bcd09826 100644
--- a/makefu/2configs/gui/base.nix
+++ b/makefu/2configs/gui/base.nix
@@ -66,7 +66,7 @@ in
cat |derp <<EOF
XTerm*background: black
XTerm*foreground: white
- XTerm*FaceName : xft:xos4 Terminus:pixelsize=11
+ XTerm*FaceName : xft:Terminus:pixelsize=12
URxvt*termName: rxvt
URxvt*saveLines: 10000
@@ -78,7 +78,7 @@ in
URxvt.background: black
URxvt.urgentOnBell: true
URxvt.visualBell: false
- URxvt.font : xft:xos4 Terminus:size=11
+ URxvt.font : xft:Terminus:size=12
! blue
diff --git a/makefu/2configs/gui/wbob-kiosk.nix b/makefu/2configs/gui/wbob-kiosk.nix
index 7db749227..6da1a37e7 100644
--- a/makefu/2configs/gui/wbob-kiosk.nix
+++ b/makefu/2configs/gui/wbob-kiosk.nix
@@ -4,22 +4,38 @@
imports = [
./base.nix
];
- users.users.makefu.packages = [ pkgs.chromium ];
+ users.users.makefu = {
+ packages = [ pkgs.chromium ];
+ extraGroups = [ "audio" "pulse" ];
+ };
services.xserver = {
- layout = lib.mkForce "de";
- xkbVariant = lib.mkForce "";
windowManager = lib.mkForce {
awesome.enable = false;
default = "none";
};
- desktopManager.xfce.enable = true;
+ desktopManager.xfce = {
+ extraSessionCommands = ''
+ ${pkgs.xlibs.xset}/bin/xset -display :0 s off -dpms
+ ${pkgs.xlibs.xrandr}/bin/xrandr --output HDMI2 --right-of HDMI1
+ '';
+ enable = true;
+ };
# xrandrHeads = [ "HDMI1" "HDMI2" ];
# prevent screen from turning off, disable dpms
- displayManager.sessionCommands = ''
- xset -display :0 s off -dpms
- xrandr --output HDMI2 --right-of HDMI1
- '';
};
+
+ systemd.services.xset-off = {
+ after = [ "display-manager.service" ];
+ wantedBy = [ "multi-user.target" ];
+ serviceConfig = {
+ ExecStart = "${pkgs.xlibs.xset}/bin/xset -display :0 s off -dpms";
+ RemainAfterExit = "yes";
+ TimeoutSec = "5s";
+ RestartSec="5s";
+ Restart = "on-failure";
+ };
+ };
+
}
diff --git a/makefu/2configs/home-manager/cli.nix b/makefu/2configs/home-manager/cli.nix
index 1efc4d2bf..64aa03bd7 100644
--- a/makefu/2configs/home-manager/cli.nix
+++ b/makefu/2configs/home-manager/cli.nix
@@ -1,12 +1,18 @@
-{
+{pkgs, ... }: {
home-manager.users.makefu = {
services.gpg-agent = {
+ enable = true;
defaultCacheTtl = 900;
maxCacheTtl = 7200;
defaultCacheTtlSsh = 3600;
maxCacheTtlSsh = 86400;
enableSshSupport = true;
+ enableScDaemon = true;
};
programs.fzf.enable = true; # alt-c
};
+ services.udev.packages = [
+ pkgs.libu2f-host
+ pkgs.yubikey-personalization
+ ];
}
diff --git a/makefu/2configs/home-manager/default.nix b/makefu/2configs/home-manager/default.nix
index e75ee6262..2a4574cc8 100644
--- a/makefu/2configs/home-manager/default.nix
+++ b/makefu/2configs/home-manager/default.nix
@@ -4,4 +4,7 @@
];
home-manager.users.makefu = {
};
+ environment.variables = {
+ GTK_DATA_PREFIX = "/run/current-system/sw";
+ };
}
diff --git a/makefu/2configs/home-manager/desktop.nix b/makefu/2configs/home-manager/desktop.nix
index c2f854d47..ce98e651a 100644
--- a/makefu/2configs/home-manager/desktop.nix
+++ b/makefu/2configs/home-manager/desktop.nix
@@ -1,31 +1,43 @@
-{pkgs, ... }: {
+{ pkgs, lib, ... }:
+
+{
home-manager.users.makefu = {
programs.browserpass = { browsers = [ "firefox" ] ; enable = true; };
+ programs.firefox.enable = true;
services.network-manager-applet.enable = true;
+ systemd.user.services.network-manager-applet.Service.Environment = ''XDG_DATA_DIRS=/etc/profiles/per-user/makefu/share GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache'';
services.blueman-applet.enable = true;
services.pasystray.enable = true;
-
- systemd.user.services.network-manager-applet.Service.Environment = ''
- XDG_DATA_DIRS=/etc/profiles/per-user/makefu/share GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
- '';
- systemd.user.services.clipit = {
- Unit = {
- Description = "clipboard manager";
- After = [ "graphical-session-pre.target" ];
- PartOf = [ "graphical-session.target" ];
+ systemd.user.services.pasystray.Service.Environment = "PATH=" + (lib.makeBinPath (with pkgs;[ pavucontrol paprefs /* pavumeter */ /* paman */ ]) );
+ programs.chromium = {
+ enable = true;
+ extensions = [
+ "cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin
+ "dbepggeogbaibhgnhhndojpepiihcmeb" # vimium
+ # "liloimnbhkghhdhlamdjipkmadhpcjmn" # krebsgold
+ "fpnmgdkabkmnadcjpehmlllkndpkmiak" # wayback machine
+ "gcknhkkoolaabfmlnjonogaaifnjlfnp" # foxyproxy
+ "abkfbakhjpmblaafnpgjppbmioombali" # memex
+ "kjacjjdnoddnpbbcjilcajfhhbdhkpgk" # forest
+ ];
};
- Install = {
- WantedBy = [ "graphical-session.target" ];
- };
+ systemd.user.services.clipit = {
+ Unit = {
+ Description = "clipboard manager";
+ After = [ "graphical-session-pre.target" ];
+ PartOf = [ "graphical-session.target" ];
+ };
- Service = {
- Environment = ''
- XDG_DATA_DIRS=/etc/profiles/per-user/makefu/share GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
- '';
- ExecStart = "${pkgs.clipit}/bin/clipit";
- Restart = "on-abort";
+ Install = {
+ WantedBy = [ "graphical-session.target" ];
+ };
+
+ Service = {
+ Environment = ''XDG_DATA_DIRS=/etc/profiles/per-user/makefu/share GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache'';
+ ExecStart = "${pkgs.clipit}/bin/clipit";
+ Restart = "on-abort";
+ };
};
};
- };
}
diff --git a/makefu/2configs/home-manager/mail.nix b/makefu/2configs/home-manager/mail.nix
index ce7ae4f4d..467e0d7a0 100644
--- a/makefu/2configs/home-manager/mail.nix
+++ b/makefu/2configs/home-manager/mail.nix
@@ -1,5 +1,6 @@
{
home-manager.users.makefu = {
+ accounts.email.maildirBasePath = "/home/makefu/Mail";
accounts.email.accounts.syntaxfehler = {
address = "felix.richter@syntax-fehler.de";
userName = "Felix.Richter@syntax-fehler.de";
@@ -27,7 +28,7 @@
};
primary = true;
realName = "Felix Richter";
- passwordCommand = "gpg --use-agent --quiet --batch -d /home/makefu/.mail/syntax-fehler.gpg";
+ passwordCommand = "gpg --use-agent --quiet --batch -d /home/makefu/.gnupg/mail/syntax-fehler.gpg";
};
programs.offlineimap.enable = true;
programs.offlineimap.extraConfig = {
diff --git a/makefu/2configs/hw/bluetooth.nix b/makefu/2configs/hw/bluetooth.nix
index 313ca0147..e556b43c0 100644
--- a/makefu/2configs/hw/bluetooth.nix
+++ b/makefu/2configs/hw/bluetooth.nix
@@ -1,9 +1,7 @@
{ pkgs, ... }:
{ # bluetooth+pulse config
# for blueman-applet
- users.users.makefu.packages = [
- pkgs.blueman
- ];
+ users.users.makefu.packages = [ pkgs.blueman ];
hardware.pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
@@ -39,4 +37,5 @@
Enable=Source,Sink,Media,Socket
'';
};
+ services.dbus.packages = [ pkgs.blueman ];
}
diff --git a/makefu/2configs/hw/network-manager.nix b/makefu/2configs/hw/network-manager.nix
index ffc32e0cb..3b9d04549 100644
--- a/makefu/2configs/hw/network-manager.nix
+++ b/makefu/2configs/hw/network-manager.nix
@@ -27,4 +27,7 @@
powersave = true;
scanRandMacAddress = true;
};
+ state = [
+ "/etc/NetworkManager/system-connections" #NM stateful config files
+ ];
}
diff --git a/makefu/2configs/hw/switch.nix b/makefu/2configs/hw/switch.nix
new file mode 100644
index 000000000..d46e8cf3f
--- /dev/null
+++ b/makefu/2configs/hw/switch.nix
@@ -0,0 +1,10 @@
+{ config, lib, pkgs, ... }:
+
+{
+
+ users.extraUsers.${config.krebs.build.user.name}.extraGroups = [ "plugdev" ];
+
+ services.udev.extraRules = ''
+ SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0664", GROUP="plugdev"
+ '';
+}
diff --git a/makefu/2configs/laptop-backup.nix b/makefu/2configs/laptop-backup.nix
deleted file mode 100644
index 8df7043c8..000000000
--- a/makefu/2configs/laptop-backup.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{config, lib, pkgs, ... }:
-
-{
- systemd.user.services.duply-secrets = {
- description = "run daily secrets backup";
- startAt = "daily";
- serviceConfig = {
- Type = "oneshot";
- ExecStart = "{pkgs.duply}/bin/duply omo-secrets backup";
- };
- };
-}
diff --git a/makefu/2configs/nginx/euer.blog.nix b/makefu/2configs/nginx/euer.blog.nix
index 65d36d9b6..14d1285db 100644
--- a/makefu/2configs/nginx/euer.blog.nix
+++ b/makefu/2configs/nginx/euer.blog.nix
@@ -39,4 +39,5 @@ in {
};
};
};
+ state = [ base-dir ];
}
diff --git a/makefu/2configs/nginx/euer.wiki.nix b/makefu/2configs/nginx/euer.wiki.nix
index 99533b25c..280622259 100644
--- a/makefu/2configs/nginx/euer.wiki.nix
+++ b/makefu/2configs/nginx/euer.wiki.nix
@@ -21,6 +21,7 @@ let
tw-pass-file = "${sec}/tw-pass.ini";
in {
+ state = [ base-dir ];
services.phpfpm = {
# phpfpm does not have an enable option
poolConfigs = {
diff --git a/makefu/2configs/printer.nix b/makefu/2configs/printer.nix
index d5fa65ef9..fb1a67358 100644
--- a/makefu/2configs/printer.nix
+++ b/makefu/2configs/printer.nix
@@ -5,11 +5,11 @@ let
in {
services.printing = {
enable = true;
- drivers = [
- pkgs.samsungUnifiedLinuxDriver
- pkgs.cups-dymo # dymo labelwriter
- pkgs.foo2zjs # magicolor 1690mf
- pkgs.zj-58
+ drivers = with pkgs; [
+ samsungUnifiedLinuxDriver
+ cups-dymo # dymo labelwriter
+ foo2zjs # magicolor 1690mf
+ cups-zj-58
];
};
diff --git a/makefu/2configs/rtorrent.nix b/makefu/2configs/rtorrent.nix
deleted file mode 100644
index 9e2990cab..000000000
--- a/makefu/2configs/rtorrent.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-_:
-let
- listenPort = 60123;
- xml-port = 5000;
- authfile = <torrent-secrets/authfile>;
-in {
- makefu.rtorrent = {
- enable = true;
- web = {
- enable = true;
- enableAuth = true;
- inherit authfile;
- };
- rutorrent.enable = true;
- enableXMLRPC = true;
- logLevel = "debug";
- inherit listenPort;
- };
-}
diff --git a/makefu/2configs/deployment/events-publisher/default.nix b/makefu/2configs/shack/events-publisher/default.nix
index 37d74c282..531d2525e 100644
--- a/makefu/2configs/deployment/events-publisher/default.nix
+++ b/makefu/2configs/shack/events-publisher/default.nix
@@ -2,8 +2,8 @@
with import <stockholm/lib>;
let
shack-announce = pkgs.callPackage (builtins.fetchTarball {
- url = "https://github.com/makefu/events-publisher/archive/c5218195e6afdc646cb7682d8f355a7ec2b90716.tar.gz";
- sha256 = "0xk74q7gah3l5zy3bkvih3k9fr1hclvf71rm3ixcmslhicl7khav";
+ url = "https://github.com/makefu/events-publisher/archive/670f4d7182a41b6763296e301612499d2986f213.tar.gz";
+ sha256 = "1yf9cb08v4rc6x992yx5lcyn62sm3p8i2b48rsmr4m66xdi4bpnd";
}) {} ;
home = "/var/lib/shackannounce";
user = "shackannounce";
diff --git a/makefu/2configs/shack/gitlab-runner/default.nix b/makefu/2configs/shack/gitlab-runner/default.nix
new file mode 100644
index 000000000..55dc50fa8
--- /dev/null
+++ b/makefu/2configs/shack/gitlab-runner/default.nix
@@ -0,0 +1,31 @@
+
+{
+ systemd.services.gitlab-runner.path = [
+ "/run/wrappers" # /run/wrappers/bin/su
+ "/" # /bin/sh
+ ];
+ services.gitlab-runner = {
+ enable = true;
+ configOptions =
+ { concurrent = 1;
+ runners = [
+ { builds_dir = "";
+ #docker =
+ #{ cache_dir = "";
+ # disable_cache = true;
+ # host = ""; image = "nixos/nix:2.1.3";
+ # privileged = true;
+ #};
+ #executor = "docker";
+ # name = "docker-nix";
+ name = "gum-shell";
+ executor = "shell";
+ environment = [ "PATH=/bin:/run/wrappers/bin:/etc/per-user/gitlab-runner/bin:/etc/per-user-pkgs/gitlab-runner/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin" ];
+ # generate via `gitlab-runner register`
+ token = import <secrets/shackspace-gitlab-ci-token.nix>;
+ url = "https://git.shackspace.de/";
+ }
+ ];
+ };
+ };
+}
diff --git a/makefu/2configs/stats/arafetch.nix b/makefu/2configs/stats/arafetch.nix
index 422676b24..c16629cc5 100644
--- a/makefu/2configs/stats/arafetch.nix
+++ b/makefu/2configs/stats/arafetch.nix
@@ -27,12 +27,14 @@ in {
systemd.services.arafetch = {
startAt = "Mon,Wed,Fri 09:15:00";
wantedBy = [ "multi-user.target" ];
+ after = [ "network-online.target" ];
environment = {
OUTDIR = home;
};
path = [ pkg pkgs.git pkgs.wget ];
serviceConfig = {
User = "arafetch";
+ Restart = "always";
WorkingDirectory = home;
PrivateTmp = true;
ExecStart = pkgs.writeDash "start-weekrun" ''
diff --git a/makefu/2configs/taskd.nix b/makefu/2configs/taskd.nix
new file mode 100644
index 000000000..5ca3b9904
--- /dev/null
+++ b/makefu/2configs/taskd.nix
@@ -0,0 +1,11 @@
+{config, ... }:
+{
+ services.taskserver.enable = true;
+ services.taskserver.fqdn = config.krebs.build.host.name;
+ services.taskserver.listenHost = "::";
+ services.taskserver.organisations.home.users = [ "makefu" ];
+ networking.firewall.extraCommands = ''
+ iptables -A INPUT -i retiolum -p tcp --dport 53589 -j ACCEPT
+ ip6tables -A INPUT -i retiolum -p tcp --dport 53589 -j ACCEPT
+ '';
+}
diff --git a/makefu/2configs/tools/android-pentest.nix b/makefu/2configs/tools/android-pentest.nix
index da8a357ae..9dedafdd2 100644
--- a/makefu/2configs/tools/android-pentest.nix
+++ b/makefu/2configs/tools/android-pentest.nix
@@ -9,7 +9,7 @@
dex2jar
apktool
jd-gui
- android-studio
+ # android-studio
jdk
jre
openssl
diff --git a/makefu/2configs/tools/desktop.nix b/makefu/2configs/tools/desktop.nix
index bb14c3eb5..924668803 100644
--- a/makefu/2configs/tools/desktop.nix
+++ b/makefu/2configs/tools/desktop.nix
@@ -3,7 +3,7 @@
{
users.users.makefu.packages = with pkgs; [
taskwarrior
- pass
+ (pass.withExtensions (ext: [ ext.pass-otp ]))
gopass
mutt
weechat
diff --git a/makefu/2configs/tools/extra-gui.nix b/makefu/2configs/tools/extra-gui.nix
index 1c28eeffd..3d26cc574 100644
--- a/makefu/2configs/tools/extra-gui.nix
+++ b/makefu/2configs/tools/extra-gui.nix
@@ -6,7 +6,6 @@
gimp
inkscape
libreoffice
- quodlibet
# skype
synergy
tdesktop
diff --git a/makefu/2configs/tools/media.nix b/makefu/2configs/tools/media.nix
index a61b6c88e..88a7c6882 100644
--- a/makefu/2configs/tools/media.nix
+++ b/makefu/2configs/tools/media.nix
@@ -7,10 +7,12 @@
vlc
mumble
mplayer
- quodlibet
+ quodlibet # exfalso
plowshare
streamripper
youtube-dl
+
+ pulseeffects
];
}
diff --git a/makefu/2configs/tools/mobility.nix b/makefu/2configs/tools/mobility.nix
index 8a559dbbd..11151003d 100644
--- a/makefu/2configs/tools/mobility.nix
+++ b/makefu/2configs/tools/mobility.nix
@@ -7,6 +7,8 @@
rclone
exfat
(pkgs.callPackage ./secrets.nix {})
+
+ opensc pcsctools libu2f-host
];
# boot.extraModulePackages = [ config.boot.kernelPackages.exfat-nofuse ];
diff --git a/makefu/2configs/tools/secrets.nix b/makefu/2configs/tools/secrets.nix
index f88618cbc..7d10983c7 100644
--- a/makefu/2configs/tools/secrets.nix
+++ b/makefu/2configs/tools/secrets.nix
@@ -1,7 +1,7 @@
{ pass, write, writeDash, ... }:
write "secrets" {
- "/bin/secrets".link = writeDash "brain" ''
+ "/bin/secrets".link = writeDash "secrets" ''
PASSWORD_STORE_DIR=$HOME/.secrets-pass/ \
exec ${pass}/bin/pass $@
'';
diff --git a/makefu/2configs/torrent.nix b/makefu/2configs/torrent.nix
index 3df0ddbfe..ca368dbf0 100644
--- a/makefu/2configs/torrent.nix
+++ b/makefu/2configs/torrent.nix
@@ -3,12 +3,11 @@
with import <stockholm/lib>;
let
- daemon-user = "tor";
basicAuth = import <torrent-secrets/auth.nix>;
peer-port = 51412;
web-port = 8112;
daemon-port = 58846;
- base-dir = config.makefu.dl-dir;
+ base-dir = config.krebs.rtorrent.workDir;
in {
users.users = {
@@ -23,17 +22,6 @@ in {
};
};
- # todo: race condition, do this after download user has been created
- system.activationScripts."download-dir-chmod" = ''
- for i in finished watch; do
- if test ! -d $i;then
- mkdir -p "${base-dir}/$i"
- chown rtorrent:download "${base-dir}/$i"
- chmod 775 "${base-dir}/$i"
- fi
- done
- '';
-
users.extraGroups = {
download = {
gid = lib.mkDefault (genid "download");
@@ -57,15 +45,17 @@ in {
rutorrent.enable = true;
enableXMLRPC = true;
listenPort = peer-port;
- downloadDir = base-dir + "/finished";
- watchDir = base-dir + "/watch";
+ downloadDir = config.makefu.dl-dir;
# dump old torrents into watch folder to have them re-added
};
+ services.nginx.virtualHosts."torrent.${config.krebs.build.host.name}.r".locations."/" = { proxyPass = "http://localhost:${toString web-port}/"; };
+
networking.firewall.extraCommands = ''
iptables -A INPUT -i retiolum -p tcp --dport ${toString web-port} -j ACCEPT
'';
networking.firewall.allowedTCPPorts = [ peer-port ];
networking.firewall.allowedUDPPorts = [ peer-port ];
+ state = [ config.krebs.rtorrent.sessionDir ]; # state which torrents were loaded
}
diff --git a/makefu/2configs/virtualisation/virtualbox.nix b/makefu/2configs/virtualisation/virtualbox.nix
index 30de6e44a..e90cc1e8d 100644
--- a/makefu/2configs/virtualisation/virtualbox.nix
+++ b/makefu/2configs/virtualisation/virtualbox.nix
@@ -1,26 +1,9 @@
{ config, lib, pkgs, ... }:
-let
- mainUser = config.krebs.build.user;
- vboxguestpkg = lib.stdenv.mkDerivation rec {
- name = "Virtualbox-Extensions-${version}-${rev}";
- version = "5.0.20";
- rev = "106931";
- src = pkgs.fetchurl {
- url = "http://download.virtualbox.org/virtualbox/${version}/Oracle_VM_VirtualBox_Extension_Pack-${version}-${rev}.vbox-extpack";
- sha256 = "1dc70x2m7x266zzw5vw36mxqj7xykkbk357fc77f9zrv4lylzvaf";
- };
- };
-in {
+{
virtualisation.virtualbox.host.enable = true;
nixpkgs.config.virtualbox.enableExtensionPack = true;
virtualisation.virtualbox.host.enableHardening = false;
- users.extraGroups.vboxusers.members = [ "${mainUser.name}" ];
- nixpkgs.config.packageOverrides = super: {
- boot.kernelPackages.virtualbox = super.boot.kernelPackages.virtualbox.override {
- buildInputs = super.boot.kernelPackages.virtualBox.buildInputs
- ++ [ vboxguestpkg ];
- };
- };
+ users.extraGroups.vboxusers.members = [ config.krebs.build.user.name ];
}
[cgit] Unable to lock slot /tmp/cgit/13200000.lock: No such file or directory (2)