flake-parts/setups: add specialArgs to each builder function

It's only there in its raw function but we probably don't want to expose
this especially that it will make integration for each to be a pain to
implement. For now, it will just sit and exist and being reconsidered
and reverted at some point if it isn't.
This commit is contained in:
Gabriel Arazas 2024-07-10 15:49:29 +08:00
parent bae6230728
commit 6c2974e2c8
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
3 changed files with 12 additions and 5 deletions

View File

@ -12,12 +12,13 @@ let
, nixpkgsBranch ? "nixpkgs"
, homeManagerBranch ? "home-manager"
, extraModules ? [ ]
, specialArgs ? { }
}:
let
pkgs = inputs.${nixpkgsBranch}.legacyPackages.${system};
in
inputs.${homeManagerBranch}.lib.homeManagerConfiguration {
extraSpecialArgs = {
extraSpecialArgs = specialArgs // {
foodogsquaredModulesPath = builtins.toString homeManagerModules;
};

View File

@ -13,7 +13,7 @@ let
partsConfig = config;
# A thin wrapper around the NixOS configuration function.
mkHost = { extraModules ? [ ], nixpkgsBranch ? "nixpkgs", system }:
mkHost = { system ,extraModules ? [ ], nixpkgsBranch ? "nixpkgs", specialArgs ? { } }:
let
nixpkgs = inputs.${nixpkgsBranch};
@ -25,7 +25,7 @@ let
nixosSystem = args: import "${nixpkgs}/nixos/lib/eval-config.nix" args;
in
(lib.makeOverridable nixosSystem) {
specialArgs = {
specialArgs = specialArgs // {
foodogsquaredUtils = import ../../../lib/utils/nixos.nix { inherit lib; };
foodogsquaredModulesPath = builtins.toString nixosModules;
};

View File

@ -9,13 +9,19 @@ let
cfg = config.setups.nixvim;
nixvimModules = ../../nixvim;
mkNixvimConfig = { system, pkgs, nixvimBranch ? "nixvim", modules ? [ ] }:
mkNixvimConfig = {
system,
pkgs,
nixvimBranch ? "nixvim",
modules ? [ ],
specialArgs ? { },
}:
inputs.${nixvimBranch}.legacyPackages.${system}.makeNixvimWithModule {
inherit pkgs;
module = {
imports = modules;
};
extraSpecialArgs = {
extraSpecialArgs = specialArgs // {
foodogsquaredModulesPath = builtins.toString nixvimModules;
};
};