From c4a1822df02015b41f126b9eb1c1d3fc668793dc Mon Sep 17 00:00:00 2001 From: matt1432 Date: Tue, 10 Dec 2024 23:06:29 -0500 Subject: [PATCH] fix(droid): set nix.package --- nixosModules/base/common-nix/default.nix | 20 +++++++++++++++++++- nixosModules/base/default.nix | 14 +------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/nixosModules/base/common-nix/default.nix b/nixosModules/base/common-nix/default.nix index 4c7d17ad..63fb015b 100644 --- a/nixosModules/base/common-nix/default.nix +++ b/nixosModules/base/common-nix/default.nix @@ -1,9 +1,14 @@ +# FIXME: remove unneeded params and reformat self: { config, lib, + pkgs, ... }: let - inherit (lib) hasAttr mkIf optionalString; + inherit (lib) optionalString; + inherit (lib) attrValues filter findFirst isAttrs hasAttr mkDefault mkIf mkOption types; + inherit (self.inputs) home-manager nh nixd; + inherit (self.inputs) nixpkgs; inherit (config.sops.secrets) access-token; @@ -13,6 +18,19 @@ in { config = mkIf cfg.enable { # Minimize dowloads of indirect nixpkgs flakes nix = { + 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; + registry.nixpkgs.flake = nixpkgs; nixPath = ["nixpkgs=${nixpkgs}"]; diff --git a/nixosModules/base/default.nix b/nixosModules/base/default.nix index 1b5d2e31..c8bfd604 100644 --- a/nixosModules/base/default.nix +++ b/nixosModules/base/default.nix @@ -1,3 +1,4 @@ +# FIXME: remove unneeded params and format self: { config, lib, @@ -48,19 +49,6 @@ in { }; nix = { - package = let - nixdInput = - findFirst - (x: x.pname == "nix") {} - nixd.packages.${pkgs.system}.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; - # Edit nix.conf settings = { # Store