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 { configs = lib.mkOption {
type = with lib.types; attrsOf (submoduleWith { type = with lib.types; attrsOf (submodule [
specialArgs = { inherit (config) systems; }; (import ./shared/nix-conf.nix { inherit inputs; })
modules = [ (import ./shared/config-options.nix { inherit (config) systems; })
(import ./shared/nix-conf.nix { inherit inputs; }) ./shared/nixpkgs-options.nix
./shared/nixpkgs-options.nix configType
./shared/config-options.nix ]);
configType
];
});
default = { }; default = { };
description = '' description = ''
An attribute set of metadata for the declarative home-manager setups. An attribute set of metadata for the declarative home-manager setups.

View File

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

View File

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

View File

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

View File

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