flake-parts/setups: refactor systems into shared config options

This commit is contained in:
Gabriel Arazas 2024-07-22 21:23:52 +08:00
parent 64750a7438
commit 25fbee9f2f
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
5 changed files with 21 additions and 29 deletions

View File

@ -158,15 +158,12 @@ in
};
configs = lib.mkOption {
type = with lib.types; attrsOf (submoduleWith {
specialArgs = { inherit (config) systems; };
modules = [
type = with lib.types; attrsOf (submodule [
(import ./shared/nix-conf.nix { inherit inputs; })
(import ./shared/config-options.nix { inherit (config) systems; })
./shared/nixpkgs-options.nix
./shared/config-options.nix
configType
];
});
]);
default = { };
description = ''
An attribute set of metadata for the declarative home-manager setups.

View File

@ -391,17 +391,13 @@ in
};
configs = lib.mkOption {
type = with lib.types; attrsOf (submoduleWith {
specialArgs = { inherit (config) systems; };
shorthandOnlyDefinesConfig = true;
modules = [
type = with lib.types; attrsOf (submodule [
(import ./shared/nix-conf.nix { inherit inputs; })
./shared/config-options.nix
(import ./shared/config-options.nix { inherit (config) systems; })
./shared/home-manager-users.nix
./shared/nixpkgs-options.nix
configType
];
});
]);
default = { };
description = ''
An attribute set of metadata for the declarative NixOS setups. This

View File

@ -164,13 +164,10 @@ in
{
options.setups.nixvim = {
configs = lib.mkOption {
type = with lib.types; attrsOf (submoduleWith {
specialArgs = { inherit (config) systems; };
modules = [
./shared/config-options.nix
type = with lib.types; attrsOf (submodule [
(import ./shared/config-options.nix { inherit (config) systems; })
configType
];
});
]);
default = { };
description = ''
A set of NixVim configurations to be integrated into the declarative

View File

@ -1,4 +1,6 @@
{ lib, name, systems, ... }: {
{ systems }:
{ lib, name, ... }: {
options = {
systems = lib.mkOption {
type = with lib.types; listOf str;

View File

@ -102,7 +102,7 @@ in
configs = lib.mkOption {
type = with lib.types; attrsOf (submodule [
./shared/config-options.nix
(import ./shared/config-options.nix { inherit (config) systems; })
./shared/nixpkgs-options.nix
wrapperManagerConfigModule
]);