summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
authorlassulus <lass@xerxes.r>2019-09-06 15:33:04 +0200
committerlassulus <lass@xerxes.r>2019-09-06 15:33:04 +0200
commitc2773285ebf8165fd725065047df7a58da01fb42 (patch)
treee1e067b768f334916d9d07b6cfa5c1a72b8067a4 /krebs
parentb06065549a31cf1713135e6547b04f69f351d7fb (diff)
parente388d02623b98bad5db52b29ea1ef1f494fddae8 (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs')
-rw-r--r--krebs/3modules/urlwatch.nix14
-rw-r--r--krebs/5pkgs/override/default.nix12
-rw-r--r--krebs/5pkgs/simple/nix-prefetch-github.nix25
3 files changed, 45 insertions, 6 deletions
diff --git a/krebs/3modules/urlwatch.nix b/krebs/3modules/urlwatch.nix
index 61ee72e7..43535b08 100644
--- a/krebs/3modules/urlwatch.nix
+++ b/krebs/3modules/urlwatch.nix
@@ -75,10 +75,7 @@ let
];
apply = map (x: getAttr (typeOf x) {
set = x;
- string = {
- url = x;
- filter = null;
- };
+ string.url = x;
});
};
verbose = mkOption {
@@ -96,7 +93,7 @@ let
hooksFile = cfg.hooksFile;
- configFile = pkgs.writeText "urlwatch.yaml" (toJSON {
+ configFile = pkgs.writeJSON "urlwatch.yaml" {
display = {
error = true;
new = true;
@@ -132,7 +129,7 @@ let
line_length = 75;
};
};
- });
+ };
imp = {
systemd.timers.urlwatch = {
@@ -210,8 +207,13 @@ let
type = types.str;
};
filter = mkOption {
+ default = null;
type = with types; nullOr str; # TODO nullOr subtypes.filter
};
+ ignore_cached = mkOption {
+ default = null;
+ type = with types; nullOr bool;
+ };
};
};
in out
diff --git a/krebs/5pkgs/override/default.nix b/krebs/5pkgs/override/default.nix
new file mode 100644
index 00000000..70483182
--- /dev/null
+++ b/krebs/5pkgs/override/default.nix
@@ -0,0 +1,12 @@
+with import <stockholm/lib>;
+self: super: {
+
+ exim = super.exim.overrideAttrs (old: rec {
+ name = warnOldVersion old.name "exim-4.92.2";
+ src = self.fetchurl {
+ url = "https://ftp.exim.org/pub/exim/exim4/${name}.tar.xz";
+ sha256 = "0m56jsh2fzvwj4rdpcc3pkd5vsi40cjrpzalis7l1zq33m4axmq1";
+ };
+ });
+
+}
diff --git a/krebs/5pkgs/simple/nix-prefetch-github.nix b/krebs/5pkgs/simple/nix-prefetch-github.nix
new file mode 100644
index 00000000..14096c33
--- /dev/null
+++ b/krebs/5pkgs/simple/nix-prefetch-github.nix
@@ -0,0 +1,25 @@
+{ curl, jq, nix, writeDashBin }:
+
+writeDashBin "nix-prefetch-github" ''
+ # usage: nix-prefetch-github OWNER REPO [REF]
+ set -efu
+
+ owner=$1
+ repo=$2
+ ref=''${3-master}
+
+ info_url=https://api.github.com/repos/$owner/$repo/commits/$ref
+ info=$(${curl}/bin/curl -fsS "$info_url")
+ rev=$(printf %s "$info" | ${jq}/bin/jq -r .sha)
+
+ name=$owner-$repo-$ref
+ url=https://github.com/$owner/$repo/tarball/$rev
+ sha256=$(${nix}/bin/nix-prefetch-url --name "$name" --unpack "$url")
+
+ export owner repo rev sha256
+ ${jq}/bin/jq -n '
+ env | {
+ owner, repo, rev, sha256
+ }
+ '
+''