From 82064fec5af4d5eb652d1a2c9dc9988700dd948a Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 29 Dec 2024 05:40:30 -0500 Subject: [PATCH] refactor: cleanup fixmes --- lib/attrs/default.nix | 4 ++++ modules/base/common-nix/default.nix | 27 ++++++++++++--------------- overlays/build-failures/default.nix | 4 ++-- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/lib/attrs/default.nix b/lib/attrs/default.nix index c624d8ff..5b78eb9d 100644 --- a/lib/attrs/default.nix +++ b/lib/attrs/default.nix @@ -1,5 +1,9 @@ {...}: let + inherit (builtins) hasAttr isAttrs tryEval; inputsLib = import ../../inputs/lib.nix; in { inherit (inputsLib) recursiveUpdateList; + + throws = x: !(tryEval x).success; + hasVersion = x: isAttrs x && hasAttr "version" x; } diff --git a/modules/base/common-nix/default.nix b/modules/base/common-nix/default.nix index a3ddeacd..4f4db2c0 100644 --- a/modules/base/common-nix/default.nix +++ b/modules/base/common-nix/default.nix @@ -4,28 +4,25 @@ self: { pkgs, ... }: let - inherit (lib) attrValues filter findFirst hasAttr isAttrs mkIf optionalString; - inherit (self.inputs) nixd nixpkgs; + inherit (self.lib) hasVersion throws; + + inherit (lib) attrValues filter findFirst hasAttr mkIf optionalString; + inherit (config.sops.secrets) access-token; cfg = config.roles.base; + + nixdInput = + findFirst + (x: x.pname == "nix") {} + nixd.packages.x86_64-linux.nixd.buildInputs; + + nixVersions = filter (x: ! throws x && hasVersion x) (attrValues pkgs.nixVersions); in { config = mkIf cfg.enable { nix = { - # FIXME: infinite recursion if not set - package = let - nixdInput = - findFirst - (x: x.pname == "nix") {} - nixd.packages.x86_64-linux.nixd.buildInputs; - - throws = x: !(builtins.tryEval x).success; - hasVersion = x: isAttrs x && hasAttr "version" x; - - nixVersions = filter (x: ! throws x && hasVersion x) (attrValues pkgs.nixVersions); - in - findFirst (x: x.version == nixdInput.version) {} nixVersions; + package = findFirst (x: x.version == nixdInput.version) {} nixVersions; # Minimize dowloads of indirect nixpkgs flakes registry.nixpkgs.flake = nixpkgs; diff --git a/overlays/build-failures/default.nix b/overlays/build-failures/default.nix index 917e5af5..c87a5854 100644 --- a/overlays/build-failures/default.nix +++ b/overlays/build-failures/default.nix @@ -2,7 +2,7 @@ final: prev: { # FIXME: https://pr-tracker.nelim.org/?pr=357699 nodejs_latest = prev.nodejs_22; - # FIXME: figure out why hplip fails building + # FIXME: https://pr-tracker.nelim.org/?pr=368507 hplip = prev.hplip.overrideAttrs (o: { env.NIX_CFLAGS_COMPILE = prev.lib.concatStringsSep " " [ "-Wno-error=implicit-int" @@ -13,7 +13,7 @@ final: prev: { ]; }); - # FIXME: https://github.com/NixOS/nixpkgs/issues/363965 + # FIXME: https://pr-tracker.nelim.org/?pr=368790 triton-llvm = prev.triton-llvm.override { buildTests = false; };