feat(nix): use version from nixd
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
de12e2302f
commit
6760ddade6
2 changed files with 16 additions and 4 deletions
|
@ -3,10 +3,13 @@
|
||||||
home-manager,
|
home-manager,
|
||||||
lib,
|
lib,
|
||||||
nh,
|
nh,
|
||||||
|
nixd,
|
||||||
pkgs,
|
pkgs,
|
||||||
self,
|
self,
|
||||||
...
|
...
|
||||||
}: {
|
}: let
|
||||||
|
inherit (lib) attrValues filter findFirst isAttrs hasAttr mkIf mkOption types;
|
||||||
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./vars
|
./vars
|
||||||
|
|
||||||
|
@ -27,7 +30,18 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
nix = {
|
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
|
# Edit nix.conf
|
||||||
settings = {
|
settings = {
|
||||||
|
@ -97,7 +111,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users = let
|
home-manager.users = let
|
||||||
inherit (lib) mkIf mkOption types;
|
|
||||||
inherit (config.vars) mainUser;
|
inherit (config.vars) mainUser;
|
||||||
|
|
||||||
default = {
|
default = {
|
||||||
|
|
|
@ -52,7 +52,6 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
nvimInputs = {
|
nvimInputs = {
|
||||||
# uses nixVersions.nix_2_24
|
|
||||||
nixd = mkDep {
|
nixd = mkDep {
|
||||||
owner = "nix-community";
|
owner = "nix-community";
|
||||||
repo = "nixd";
|
repo = "nixd";
|
||||||
|
|
Loading…
Reference in a new issue