mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
lib/extras/images: add custom modulesPath
for each environment
This commit is contained in:
parent
4f286dbc28
commit
5173add1f6
@ -5,6 +5,11 @@
|
|||||||
let
|
let
|
||||||
# A function that generates a lambda suitable for `lib.extend`.
|
# A function that generates a lambda suitable for `lib.extend`.
|
||||||
extendLib = import ./extend-lib.nix;
|
extendLib = import ./extend-lib.nix;
|
||||||
|
|
||||||
|
# For NixOS systems.
|
||||||
|
specialArgs = {
|
||||||
|
foodogsquaredModulesPath = builtins.toString ../../modules/nixos;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# A thin wrapper around the NixOS configuration function.
|
# A thin wrapper around the NixOS configuration function.
|
||||||
@ -22,6 +27,7 @@ in
|
|||||||
nixosSystem = args: import "${nixpkgs}/nixos/lib/eval-config.nix" args;
|
nixosSystem = args: import "${nixpkgs}/nixos/lib/eval-config.nix" args;
|
||||||
in
|
in
|
||||||
(lib'.makeOverridable nixosSystem) {
|
(lib'.makeOverridable nixosSystem) {
|
||||||
|
inherit specialArgs;
|
||||||
lib = lib';
|
lib = lib';
|
||||||
modules = extraModules;
|
modules = extraModules;
|
||||||
|
|
||||||
@ -33,6 +39,10 @@ in
|
|||||||
# A thin wrapper around the home-manager configuration function.
|
# A thin wrapper around the home-manager configuration function.
|
||||||
mkHome = { pkgs, extraModules ? [ ], home-manager-channel ? "home-manager" }:
|
mkHome = { pkgs, extraModules ? [ ], home-manager-channel ? "home-manager" }:
|
||||||
inputs.${home-manager-channel}.lib.homeManagerConfiguration {
|
inputs.${home-manager-channel}.lib.homeManagerConfiguration {
|
||||||
|
specialArgs = {
|
||||||
|
foodogsquaredModulesPath = builtins.toString ../../modules/home-manager;
|
||||||
|
};
|
||||||
|
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
lib = pkgs.lib.extend extendLib;
|
lib = pkgs.lib.extend extendLib;
|
||||||
modules = extraModules;
|
modules = extraModules;
|
||||||
@ -48,6 +58,7 @@ in
|
|||||||
nixosSystem = args: import "${nixpkgs}/nixos/lib/eval-config.nix" args;
|
nixosSystem = args: import "${nixpkgs}/nixos/lib/eval-config.nix" args;
|
||||||
|
|
||||||
image = nixosSystem {
|
image = nixosSystem {
|
||||||
|
inherit specialArgs;
|
||||||
lib = nixpkgs.lib.extend extendLib;
|
lib = nixpkgs.lib.extend extendLib;
|
||||||
modules = extraModules ++ [ inputs.nixos-generators.nixosModules.${format} ];
|
modules = extraModules ++ [ inputs.nixos-generators.nixosModules.${format} ];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user