fix(droid): set nix.package
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-12-10 23:06:29 -05:00
parent e32bb16144
commit c4a1822df0
2 changed files with 20 additions and 14 deletions

View file

@ -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}"];

View file

@ -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