From 72ae20dc3dd2a7d78a8cdc2e24cc4c3ac178f104 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sun, 16 Feb 2025 12:35:13 +0100 Subject: [PATCH] blink: fix missing inputs.self in HM and NixOS modules (#644) * home-manager: fix missing inputs.self some options in nvf module uses inputs.self but it's not exposed in the inputs we pass to home-manager module: example flake.nix: ``` { inputs = { /* ... */ }; outputs = {nixpkgs, ...}@inputs: { testing = { a = inputs.self # valid b = inputs.self.inputs # valid c = inputs.self.inputs.self # does not exist # prior to this change, inputs.self.inputs was passed to the hm # module, which lacks the self attr # # This change passes in the "top-level" inputs instead. }; }; } ``` * nixos: fix missing inputs.self see previous commit for details --- flake.nix | 4 ++-- flake/modules/home-manager.nix | 6 +++--- flake/modules/nixos.nix | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index acef6382..30b71f80 100644 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,7 @@ }; homeManagerModules = { - nvf = import ./flake/modules/home-manager.nix {inherit lib self;}; + nvf = import ./flake/modules/home-manager.nix {inherit lib inputs;}; default = self.homeManagerModules.nvf; neovim-flake = lib.warn '' @@ -44,7 +44,7 @@ }; nixosModules = { - nvf = import ./flake/modules/nixos.nix {inherit lib self;}; + nvf = import ./flake/modules/nixos.nix {inherit lib inputs;}; default = self.nixosModules.nvf; neovim-flake = lib.warn '' diff --git a/flake/modules/home-manager.nix b/flake/modules/home-manager.nix index 715f7537..3b75e49a 100644 --- a/flake/modules/home-manager.nix +++ b/flake/modules/home-manager.nix @@ -1,13 +1,13 @@ # Home Manager module { - self, + inputs, lib, }: { config, pkgs, ... }: let - inherit (self) packages inputs; + inherit (inputs.self) packages; inherit (lib) maintainers; inherit (lib.modules) mkIf mkAliasOptionModule; inherit (lib.lists) optional; @@ -19,7 +19,7 @@ nvfModule = submoduleWith { description = "Nvf module"; class = "nvf"; - specialArgs = { + specialArgs = lib.trace (builtins.attrNames inputs) { inherit pkgs lib inputs; }; modules = import ../../modules/modules.nix {inherit pkgs lib;}; diff --git a/flake/modules/nixos.nix b/flake/modules/nixos.nix index ecc173a1..8f95a12a 100644 --- a/flake/modules/nixos.nix +++ b/flake/modules/nixos.nix @@ -1,13 +1,13 @@ # NixOS module { - self, + inputs, lib, }: { config, pkgs, ... }: let - inherit (self) inputs packages; + inherit (inputs.self) packages; inherit (lib) maintainers; inherit (lib.modules) mkIf mkOverride mkAliasOptionModule; inherit (lib.lists) optional;