summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-10-09 12:06:27 +0200
committermakefu <github@syntax-fehler.de>2015-10-09 12:06:27 +0200
commit42c2a52eaa7a111824f00582eb0479154b51211e (patch)
tree8c1b64fce6a8c70275a68f8b8753bff2fb633543 /krebs/3modules
parente507ab5ba770d57e846aa79f12ef055bd2fa70e4 (diff)
parent965eba6073f9de3726d9776ca18f6de9ad8ec867 (diff)
Merge branch 'master' of pnp:stockholm
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/default.nix1
-rw-r--r--krebs/3modules/lass/default.nix10
-rw-r--r--krebs/3modules/realwallpaper.nix100
3 files changed, 110 insertions, 1 deletions
diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix
index 430194405..edfbde9ba 100644
--- a/krebs/3modules/default.nix
+++ b/krebs/3modules/default.nix
@@ -14,6 +14,7 @@ let
./iptables.nix
./nginx.nix
./Reaktor.nix
+ ./realwallpaper.nix
./retiolum.nix
./urlwatch.nix
];
diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix
index aa071270c..9dbc597ed 100644
--- a/krebs/3modules/lass/default.nix
+++ b/krebs/3modules/lass/default.nix
@@ -34,9 +34,11 @@ with import ../../4lib { inherit lib; };
'';
};
};
+ ssh.privkey.path = <secrets/ssh.id_ed25519>;
+ ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL21QDOEFdODFh6WAfNp6odrXo15pEsDQuGJfMu/cKzK";
};
fastpoke = {
- dc = "lass"; #dc = "cac";
+ dc = "lass";
nets = rec {
internet = {
addrs4 = ["193.22.164.36"];
@@ -95,6 +97,8 @@ with import ../../4lib { inherit lib; };
'';
};
};
+ ssh.privkey.path = <secrets/ssh.id_ed25519>;
+ ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN7oYx7Lbkc0wPYNp92LQF93DCtxsGzOkVD91FJQzVZl";
};
uriel = {
cores = 1;
@@ -119,6 +123,8 @@ with import ../../4lib { inherit lib; };
'';
};
};
+ ssh.privkey.path = <secrets/ssh.id_ed25519>;
+ ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBryIo/Waw8SWvlQ0+5I+Bd/dJgcMd6iPXtELS6gQXoc";
secure = true;
};
mors = {
@@ -145,6 +151,8 @@ with import ../../4lib { inherit lib; };
};
};
secure = true;
+ ssh.privkey.path = <secrets/ssh.id_ed25519>;
+ ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINAMPlIG+6u75GJ3kvsPF6OoIZsU+u8ZQ+rdviv5fNMD";
};
};
diff --git a/krebs/3modules/realwallpaper.nix b/krebs/3modules/realwallpaper.nix
new file mode 100644
index 000000000..7e02538f5
--- /dev/null
+++ b/krebs/3modules/realwallpaper.nix
@@ -0,0 +1,100 @@
+arg@{ config, lib, pkgs, ... }:
+
+let
+ inherit (lib)
+ mkEnableOption
+ mkOption
+ types
+ mkIf
+ ;
+
+ cfg = config.krebs.realwallpaper;
+
+ out = {
+ options.krebs.realwallpaper = api;
+ config = mkIf cfg.enable imp;
+ };
+
+ api = {
+ enable = mkEnableOption "realwallpaper";
+
+ workingDir = mkOption {
+ type = types.str;
+ default = "/var/realwallpaper/";
+ };
+
+ nightmap = mkOption {
+ type = types.str;
+ default = "http://eoimages.gsfc.nasa.gov/images/imagerecords/55000/55167/earth_lights_lrg.jpg";
+ };
+
+ daymap = mkOption {
+ type = types.str;
+ default = "http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png";
+ };
+
+ cloudmap = mkOption {
+ type = types.str;
+ default = "http://xplanetclouds.com/free/local/clouds_2048.jpg";
+ };
+
+ outFile = mkOption {
+ type = types.str;
+ default = "/tmp/wallpaper.png";
+ };
+
+ timerConfig = mkOption {
+ type = types.unspecified;
+ default = {
+ OnCalendar = "*:0/15";
+ };
+ };
+
+ };
+
+ imp = {
+ systemd.timers.realwallpaper = {
+ description = "real wallpaper generator timer";
+ wantedBy = [ "timers.target" ];
+
+ timerConfig = cfg.timerConfig;
+ };
+
+ systemd.services.realwallpaper = {
+ description = "real wallpaper generator";
+ after = [ "network.target" ];
+
+ path = with pkgs; [
+ xplanet
+ imagemagick
+ curl
+ file
+ ];
+
+ environment = {
+ working_dir = cfg.workingDir;
+ nightmap_url = cfg.nightmap;
+ daymap_url = cfg.daymap;
+ cloudmap_url = cfg.cloudmap;
+ out_file = cfg.outFile;
+ };
+
+ restartIfChanged = true;
+
+ serviceConfig = {
+ Type = "simple";
+ ExecStart = "${pkgs.realwallpaper}/realwallpaper.sh";
+ User = "realwallpaper";
+ };
+ };
+
+ users.extraUsers.realwallpaper = {
+ uid = 2009435407; #genid realwallpaper
+ home = cfg.workingDir;
+ createHome = true;
+ };
+ };
+
+in
+out
+