diff --git a/flake.nix b/flake.nix index ad3993691..e1ff3c4a8 100644 --- a/flake.nix +++ b/flake.nix @@ -36,7 +36,7 @@ extern = import ./extern { inherit inputs; }; - pkgs' = os.mkPkgs { inherit self; }; + pkgs' = os.mkPkgs; outputs = let @@ -57,7 +57,7 @@ overlay = import ./pkgs; overlays = lib.pathsToImportedAttrs (lib.pathsIn ./overlays); - lib = import ./lib { inherit nixos pkgs; }; + lib = import ./lib { inherit nixos pkgs self; }; templates.flk.path = ./.; templates.flk.description = "flk template"; @@ -79,16 +79,14 @@ let pkgs = pkgs'.${system}; in { packages = utils.lib.flattenTreeSystem system - (os.mkPackages { - inherit self pkgs; - }); + (os.mkPackages { inherit pkgs; }); devShell = import ./shell { inherit self system; }; legacyPackages.hmActivationPackages = - os.mkHomeActivation { inherit self; }; + os.mkHomeActivation; } ); in diff --git a/hosts/default.nix b/hosts/default.nix index 3ff999ccd..ef2f559ea 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -72,6 +72,10 @@ let ]; networking = { inherit hostName; }; + + _module.args = { + inherit self; + }; }; in dev.os.devosSystem { diff --git a/lib/default.nix b/lib/default.nix index cda082e3e..9a064d870 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,14 +1,14 @@ -args@{ nixos, pkgs, ... }: +args@{ nixos, pkgs, self, ... }: let inherit (nixos) lib; in -lib.makeExtensible (self: +lib.makeExtensible (selfLib: let callLibs = file: import file ({ inherit lib; - dev = self; + dev = selfLib; } // args); in - with self; + with selfLib; { inherit callLibs; diff --git a/lib/devos/mkHomeActivation.nix b/lib/devos/mkHomeActivation.nix index c88082400..6b7176a3a 100644 --- a/lib/devos/mkHomeActivation.nix +++ b/lib/devos/mkHomeActivation.nix @@ -1,6 +1,5 @@ -{ lib, ... }: +{ lib, self, ... }: -{ self }: let hmConfigs = lib.mapAttrs (_: config: config.config.home-manager.users) diff --git a/lib/devos/mkPackages.nix b/lib/devos/mkPackages.nix index 44209f006..a876ea0b7 100644 --- a/lib/devos/mkPackages.nix +++ b/lib/devos/mkPackages.nix @@ -1,6 +1,6 @@ -{ lib, dev, ... }: +{ lib, dev, self, ... }: -{ self, pkgs }: +{ pkgs }: let inherit (self) overlay overlays; packagesNames = lib.attrNames (overlay null null) diff --git a/lib/devos/mkPkgs.nix b/lib/devos/mkPkgs.nix index f9e53e71a..9b76e6df5 100644 --- a/lib/devos/mkPkgs.nix +++ b/lib/devos/mkPkgs.nix @@ -1,6 +1,5 @@ -{ lib, dev, nixos, ... }: +{ lib, dev, nixos, self, ... }: -{ self }: let inherit (self) inputs; in (inputs.utils.lib.eachDefaultSystem diff --git a/shell/default.nix b/shell/default.nix index d6b488339..0d1da5142 100644 --- a/shell/default.nix +++ b/shell/default.nix @@ -2,7 +2,7 @@ , system ? builtins.currentSystem }: let - pkgs = (self.lib.os.mkPkgs { inherit self; }).${system}; + pkgs = (self.lib.os.mkPkgs).${system}; inherit (pkgs) lib;