From a649befbfafaff80d1d1a10896bfc4343021797b Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 11 Feb 2016 11:04:19 +0100 Subject: k 3 fetchWallpaper: scrap predicate, use unitConfig --- krebs/3modules/fetchWallpaper.nix | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'krebs') diff --git a/krebs/3modules/fetchWallpaper.nix b/krebs/3modules/fetchWallpaper.nix index f320c750..225f0080 100644 --- a/krebs/3modules/fetchWallpaper.nix +++ b/krebs/3modules/fetchWallpaper.nix @@ -12,10 +12,6 @@ let api = { enable = mkEnableOption "fetch wallpaper"; - predicate = mkOption { - type = with types; nullOr path; - default = null; - }; url = mkOption { type = types.str; }; @@ -33,16 +29,20 @@ let type = types.str; default = ":11"; }; + unitConfig = mkOption { + type = types.attrsOf types.str; + description = "Extra unit configuration for fetchWallpaper to define conditions and assertions for the unit"; + example = literalExample '' + # do not start when running on umts + { ConditionPathExists = "!/var/run/ppp0.pid"; } + ''; + default = {}; + }; }; fetchWallpaperScript = pkgs.writeScript "fetchWallpaper" '' #! ${pkgs.bash}/bin/bash - ${optionalString (cfg.predicate != null) '' - if ! ${cfg.predicate}; then - echo "predicate failed - will not fetch from remote" - exit 0 - fi - ''} + mkdir -p ${shell.escape cfg.stateDir} curl -s -o ${shell.escape cfg.stateDir}/wallpaper -z ${shell.escape cfg.stateDir}/wallpaper ${shell.escape cfg.url} feh --no-fehbg --bg-scale ${shell.escape cfg.stateDir}/wallpaper @@ -76,7 +76,6 @@ let URL = cfg.url; DISPLAY = cfg.display; }; - restartIfChanged = true; serviceConfig = { @@ -84,6 +83,8 @@ let ExecStart = fetchWallpaperScript; User = "fetchWallpaper"; }; + + unitConfig = cfg.unitConfig; }; }; in out -- cgit v1.2.3 From 8ecdb889dd3081ba29c6ea7eb35f60b30420d201 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 11 Feb 2016 21:23:04 +0100 Subject: k 5 repo-sync: init --- krebs/5pkgs/repo-sync/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 krebs/5pkgs/repo-sync/default.nix (limited to 'krebs') diff --git a/krebs/5pkgs/repo-sync/default.nix b/krebs/5pkgs/repo-sync/default.nix new file mode 100644 index 00000000..90f838de --- /dev/null +++ b/krebs/5pkgs/repo-sync/default.nix @@ -0,0 +1,19 @@ +{ lib, pkgs, python3Packages, fetchurl, ... }: +with python3Packages; buildPythonPackage rec { + name = "repo-sync-${version}"; + version = "0.1.1"; + disabled = isPy26 || isPy27; + propagatedBuildInputs = [ + docopt + GitPython + ]; + src = fetchurl { + url = "https://pypi.python.org/packages/source/r/repo-sync/repo-sync-${version}.tar.gz"; + sha256 = "01r30l2bbsld90ps13ip0zi2a41b53dv4q6fxrzvkfrprr64c0vv"; + }; + meta = { + homepage = http://github.com/makefu/repo-sync; + description = "Sync remotes to other remotes."; + license = lib.licenses.mit; + }; +} -- cgit v1.2.3 From 5e8b9fd3d7f06751efca31cf76c5c62a0630e89a Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 11 Feb 2016 23:23:50 +0100 Subject: k 3 tinc_graphs: use new tinc-hosts --- krebs/3modules/tinc_graphs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'krebs') diff --git a/krebs/3modules/tinc_graphs.nix b/krebs/3modules/tinc_graphs.nix index 1f32c2e5..dc0484a8 100644 --- a/krebs/3modules/tinc_graphs.nix +++ b/krebs/3modules/tinc_graphs.nix @@ -85,7 +85,7 @@ let EXTERNAL_FOLDER = external_dir; INTERNAL_FOLDER = internal_dir; GEODB = cfg.geodbPath; - TINC_HOSTPATH=config.krebs.retiolum.hosts; + TINC_HOSTPATH = config.krebs.retiolum.hostsPackage; }; restartIfChanged = true; -- cgit v1.2.3