summaryrefslogtreecommitdiffstats
path: root/makefu/2configs
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs')
-rw-r--r--makefu/2configs/hw/tp-x2x0.nix5
-rw-r--r--makefu/2configs/mosh.nix3
-rw-r--r--makefu/2configs/stats/telegraf/airsensor.nix36
-rw-r--r--makefu/2configs/tools/dev.nix2
-rw-r--r--makefu/2configs/tools/mobility.nix1
-rw-r--r--makefu/2configs/torrent.nix13
6 files changed, 50 insertions, 10 deletions
diff --git a/makefu/2configs/hw/tp-x2x0.nix b/makefu/2configs/hw/tp-x2x0.nix
index 680545c99..f33c12a8f 100644
--- a/makefu/2configs/hw/tp-x2x0.nix
+++ b/makefu/2configs/hw/tp-x2x0.nix
@@ -5,6 +5,11 @@ with import <stockholm/lib>;
imports = [
./tpm.nix
];
+
+ boot.kernelModules = [
+ "kvm-intel"
+ ];
+
networking.wireless.enable = lib.mkDefault true;
hardware.enableAllFirmware = true;
diff --git a/makefu/2configs/mosh.nix b/makefu/2configs/mosh.nix
new file mode 100644
index 000000000..1c2e34e0b
--- /dev/null
+++ b/makefu/2configs/mosh.nix
@@ -0,0 +1,3 @@
+{
+ programs.mosh.enable = true;
+}
diff --git a/makefu/2configs/stats/telegraf/airsensor.nix b/makefu/2configs/stats/telegraf/airsensor.nix
index 09d23e7d4..9d481000f 100644
--- a/makefu/2configs/stats/telegraf/airsensor.nix
+++ b/makefu/2configs/stats/telegraf/airsensor.nix
@@ -1,11 +1,36 @@
{ pkgs, ...}:
-
-{
+let
+ genTopic = name: topic: tags: {
+ servers = [ "tcp://localhost:1883" ];
+ qos = 0;
+ connection_timeout = "30s";
+ topics = [ topic ];
+ tags = tags;
+ persistent_session = false;
+ name_override = name;
+ data_format = "value";
+ data_type = "float";
+ };
+ bamStat = stat: # Temperature or Humidity
+ host: # easy{1-4}
+ sensor: # dht11, dht22, ds18
+ (genTopic stat
+ "/bam/${host}/${sensor}/${stat}"
+ {"host" = host;
+ "scope" = "bam";
+ "sensor" = sensor;
+ } );
+ dht22 = host: [(bamStat "Temperature" host "dht22")
+ (bamStat "Humidity" host "dht22")];
+ dht11 = host: [(bamStat "Temperature" host "dht11")
+ (bamStat "Humidity" host "dht11")];
+ ds18 = host: [(bamStat "Temperature" host "ds18")];
+in {
services.udev.extraRules = ''
SUBSYSTEMS=="usb", ATTRS{product}=="iAQ Stick", GROUP="input"
'';
users.users.telegraf.extraGroups = [ "input" ];
- services.telegraf.extraConfig.inputs.exec = [
+ services.telegraf.extraConfig.inputs.exec = [
{
commands = [ "${pkgs.airsensor-py}/bin/airsensor-py"];
timeout = "10s";
@@ -16,4 +41,9 @@
tags.unit="VOC";
}
];
+ services.telegraf.extraConfig.inputs.mqtt_consumer =
+ (dht22 "easy1")
+ ++ (dht22 "easy2")
+ ++ (dht11 "easy3")
+ ++ (ds18 "easy3");
}
diff --git a/makefu/2configs/tools/dev.nix b/makefu/2configs/tools/dev.nix
index 0f8a76c29..04a65df26 100644
--- a/makefu/2configs/tools/dev.nix
+++ b/makefu/2configs/tools/dev.nix
@@ -21,5 +21,7 @@
gen-oath-safe
cdrtools
stockholm
+ # git-related
+ tig
];
}
diff --git a/makefu/2configs/tools/mobility.nix b/makefu/2configs/tools/mobility.nix
index 70d376608..1993a5212 100644
--- a/makefu/2configs/tools/mobility.nix
+++ b/makefu/2configs/tools/mobility.nix
@@ -2,6 +2,7 @@
{
users.users.makefu.packages = with pkgs;[
go-mtpfs
+ mosh
];
boot.extraModulePackages = [ config.boot.kernelPackages.exfat-nofuse ];
diff --git a/makefu/2configs/torrent.nix b/makefu/2configs/torrent.nix
index d063ad3e3..a076479c2 100644
--- a/makefu/2configs/torrent.nix
+++ b/makefu/2configs/torrent.nix
@@ -8,13 +8,13 @@ let
peer-port = 51412;
web-port = 8112;
daemon-port = 58846;
- dl-dir = config.makefu.dl-dir;
+ torrent-dir = config.makefu.dl-dir;
in {
users.users = {
download = {
name = "download";
- home = dl-dir;
+ home = torrent-dir;
uid = mkDefault (genid "download");
createHome = true;
useDefaultShell = true;
@@ -26,9 +26,9 @@ in {
# todo: race condition, do this after download user has been created
system.activationScripts."download-dir-chmod" = ''
for i in finished watch torrents; do
- mkdir -p "${dl-dir}/$i"
- chown download:download "${dl-dir}/$i"
- chmod 770 "${dl-dir}/$i"
+ mkdir -p "${torrent-dir}/$i"
+ chown download:download "${torrent-dir}/$i"
+ chmod 770 "${torrent-dir}/$i"
done
'';
@@ -54,9 +54,8 @@ in {
rutorrent.enable = true;
enableXMLRPC = true;
listenPort = peer-port;
- downloadDir = dl-dir + "/finished";
+ workDir = torrent-dir;
# dump old torrents into watch folder to have them re-added
- watchDir = dl-dir +"/watch";
};
networking.firewall.extraCommands = ''