diff --git a/gui/default.nix b/gui/default.nix index a07abb8..2834cec 100644 --- a/gui/default.nix +++ b/gui/default.nix @@ -25,7 +25,8 @@ let path = [ promnesia hpi ]; }]; tailscale-systray = xinlib.prIsOpen.pkg 219502 - (pkgs.callPackage ../pkgs/tailscale-systray.nix { }); + (pkgs.callPackage ../pkgs/tailscale-systray.nix { }) + pkgs."tailscale-systray"; in with lib; { imports = [ ./gnome.nix ./kde.nix ./xfce.nix ./arcan.nix ]; @@ -63,24 +64,25 @@ in with lib; { (callPackage ../pkgs/kurinto.nix { }) ]; sound.enable = true; - environment.systemPackages = with pkgs; [ - bc - black - brave - drawterm - go-font - hpi - pcsctools - promnesia - rage - rpr - vlc - zeal + environment.systemPackages = with pkgs; + (xinlib.filterList [ + bc + black + brave + drawterm + go-font + hpi + pcsctools + promnesia + rage + rpr + vlc + zeal - (callPackage ../pkgs/govulncheck.nix { }) - (callPackage ../configs/helix.nix { }) - tailscale-systray - ]; + (callPackage ../pkgs/govulncheck.nix { }) + (callPackage ../configs/helix.nix { }) + tailscale-systray + ]); programs = { } // firefox.programs; diff --git a/lib/default.nix b/lib/default.nix index a895273..a0fe66b 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,21 +1,20 @@ { lib, ... }: -# TODO: this could be cleaner :D let + inherit (builtins) toString readFile fromJSON filter; getPrStatus = pr: let - prstr = builtins.toString pr; - prStatus = - builtins.fromJSON (builtins.readFile ../pull_requests/${prstr}.json); + prstr = toString pr; + prStatus = fromJSON (readFile ../pull_requests/${prstr}.json); in prStatus; prIsOpen = { - pkg = pr: pkg: + pkg = pr: localPkg: upstreamPkg: let prStatus = getPrStatus pr; in if prStatus.status == "open" then - pkg + localPkg else - lib.warn "PR: ${ - builtins.toString pr - } (${prStatus.title}) is complete, ignoring pkg..." null; + lib.warn + "PR: ${toString pr} (${prStatus.title}) is complete, ignoring pkg..." + upstreamPkg; overlay = pr: overlay: let prStatus = getPrStatus pr; @@ -23,10 +22,12 @@ let overlay else lib.warn "PR: ${ - builtins.toString pr + toString pr } (${prStatus.title}) is complete, ignoring overlay..." (_: _: { }); }; + filterList = pkgList: filter (x: x != null) pkgList; + mkCronScript = name: src: '' . /etc/profile; set -x @@ -84,7 +85,7 @@ let xinlib = { inherit buildVer mkCronScript jobToUserService jobToService buildShell - prIsOpen; + prIsOpen filterList; }; in xinlib