From 80a174e3c0c8cfe958477804a7a4606924af8c14 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Tue, 23 May 2023 06:59:57 -0600 Subject: [PATCH] overlays: add underpinnings for a pr tracking mechanism --- lib/default.nix | 10 +++++++++- overlays/default.nix | 11 ++++++----- pr_status.json | 18 +++++++++++++++++- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index d865382..b69357a 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,5 +1,12 @@ { lib, ... }: let + prStatus = builtins.fromJSON (builtins.readFile ../pr_status.json); + prIsOpen = pr: overlay: + if prStatus."${builtins.toString pr}".status == "open" then + overlay + else + null; + mkCronScript = name: src: '' . /etc/profile; set -x @@ -31,6 +38,7 @@ let deadnix git git-bug + jo jq nil nix-diff @@ -54,7 +62,7 @@ let }; xinlib = { - inherit buildVer mkCronScript jobToUserService jobToService buildShell; + inherit buildVer mkCronScript jobToUserService jobToService buildShell prStatus prIsOpen; }; in xinlib diff --git a/overlays/default.nix b/overlays/default.nix index 6c07b5b..5ebad66 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,8 +1,9 @@ -{ isUnstable, lib, ... }: +{ isUnstable, lib, xinlib, ... }: let openssh = import ./openssh.nix; - tailscale = import ./tailscale.nix; - + tailscale = xinlib.prIsOpen 231281 (import ./tailscale.nix); + jetbrains = xinlib.prIsOpen 232308 (import ./jetbrains.nix); + tidal-hifi = xinlib.prIsOpen 228552 (import ./tidal-hifi.nix { inherit lib; }); in { nixpkgs.overlays = if isUnstable then [ (_: super: { @@ -12,8 +13,8 @@ in { }); }; }) - (import ./jetbrains.nix) - (import ./tidal-hifi.nix { inherit lib; }) + jetbrains + tidal-hifi openssh tailscale ] else [ diff --git a/pr_status.json b/pr_status.json index 22077cc..831d7ca 100644 --- a/pr_status.json +++ b/pr_status.json @@ -1 +1,17 @@ -{"232308":{"status":"open","link":"https://github.com/NixOS/nixpkgs/pull/232308"}} +{ + "232308": { + "status": "open", + "target": "unstable", + "link": "https://github.com/NixOS/nixpkgs/pull/232308" + }, + "228552": { + "status": "open", + "target": "unstable", + "link": "https://github.com/NixOS/nixpkgs/pull/228552" + }, + "231281": { + "status": "open", + "target": "stable", + "link": "https://github.com/NixOS/nixpkgs/pull/231281" + } +}