feat(nix): use version from nixd
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-11-21 21:44:30 -05:00
parent de12e2302f
commit 6760ddade6
2 changed files with 16 additions and 4 deletions

View file

@ -3,10 +3,13 @@
home-manager,
lib,
nh,
nixd,
pkgs,
self,
...
}: {
}: let
inherit (lib) attrValues filter findFirst isAttrs hasAttr mkIf mkOption types;
in {
imports = [
./vars
@ -27,7 +30,18 @@
};
nix = {
package = pkgs.nixVersions.nix_2_24;
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 = {
@ -97,7 +111,6 @@
};
home-manager.users = let
inherit (lib) mkIf mkOption types;
inherit (config.vars) mainUser;
default = {

View file

@ -52,7 +52,6 @@ let
};
nvimInputs = {
# uses nixVersions.nix_2_24
nixd = mkDep {
owner = "nix-community";
repo = "nixd";