xinlib: hmmm, need to rethink xinlib.prIsOpen.pkg

This commit is contained in:
Aaron Bieber 2023-06-02 13:53:27 -06:00
parent 6a18340a11
commit 801f50c3c0
No known key found for this signature in database
2 changed files with 32 additions and 29 deletions

View File

@ -25,7 +25,8 @@ let
path = [ promnesia hpi ]; path = [ promnesia hpi ];
}]; }];
tailscale-systray = xinlib.prIsOpen.pkg 219502 tailscale-systray = xinlib.prIsOpen.pkg 219502
(pkgs.callPackage ../pkgs/tailscale-systray.nix { }); (pkgs.callPackage ../pkgs/tailscale-systray.nix { })
pkgs."tailscale-systray";
in with lib; { in with lib; {
imports = [ ./gnome.nix ./kde.nix ./xfce.nix ./arcan.nix ]; imports = [ ./gnome.nix ./kde.nix ./xfce.nix ./arcan.nix ];
@ -63,24 +64,25 @@ in with lib; {
(callPackage ../pkgs/kurinto.nix { }) (callPackage ../pkgs/kurinto.nix { })
]; ];
sound.enable = true; sound.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs;
bc (xinlib.filterList [
black bc
brave black
drawterm brave
go-font drawterm
hpi go-font
pcsctools hpi
promnesia pcsctools
rage promnesia
rpr rage
vlc rpr
zeal vlc
zeal
(callPackage ../pkgs/govulncheck.nix { }) (callPackage ../pkgs/govulncheck.nix { })
(callPackage ../configs/helix.nix { }) (callPackage ../configs/helix.nix { })
tailscale-systray tailscale-systray
]; ]);
programs = { } // firefox.programs; programs = { } // firefox.programs;

View File

@ -1,21 +1,20 @@
{ lib, ... }: { lib, ... }:
# TODO: this could be cleaner :D
let let
inherit (builtins) toString readFile fromJSON filter;
getPrStatus = pr: getPrStatus = pr:
let let
prstr = builtins.toString pr; prstr = toString pr;
prStatus = prStatus = fromJSON (readFile ../pull_requests/${prstr}.json);
builtins.fromJSON (builtins.readFile ../pull_requests/${prstr}.json);
in prStatus; in prStatus;
prIsOpen = { prIsOpen = {
pkg = pr: pkg: pkg = pr: localPkg: upstreamPkg:
let prStatus = getPrStatus pr; let prStatus = getPrStatus pr;
in if prStatus.status == "open" then in if prStatus.status == "open" then
pkg localPkg
else else
lib.warn "PR: ${ lib.warn
builtins.toString pr "PR: ${toString pr} (${prStatus.title}) is complete, ignoring pkg..."
} (${prStatus.title}) is complete, ignoring pkg..." null; upstreamPkg;
overlay = pr: overlay: overlay = pr: overlay:
let prStatus = getPrStatus pr; let prStatus = getPrStatus pr;
@ -23,10 +22,12 @@ let
overlay overlay
else else
lib.warn "PR: ${ lib.warn "PR: ${
builtins.toString pr toString pr
} (${prStatus.title}) is complete, ignoring overlay..." (_: _: { }); } (${prStatus.title}) is complete, ignoring overlay..." (_: _: { });
}; };
filterList = pkgList: filter (x: x != null) pkgList;
mkCronScript = name: src: '' mkCronScript = name: src: ''
. /etc/profile; . /etc/profile;
set -x set -x
@ -84,7 +85,7 @@ let
xinlib = { xinlib = {
inherit buildVer mkCronScript jobToUserService jobToService buildShell inherit buildVer mkCronScript jobToUserService jobToService buildShell
prIsOpen; prIsOpen filterList;
}; };
in xinlib in xinlib