flake-parts/setups/nixos: add Disko configs for each NixOS system

This commit is contained in:
Gabriel Arazas 2024-02-27 21:16:26 +08:00
parent b95aa94cae
commit acba42bd99
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -313,6 +313,16 @@ let
remoteBuild = true;
};
};
diskoConfigs = lib.mkOption {
type = with lib.types; listOf str;
default = [ ];
example = [ "external-hdd" ];
description = ''
A list of declarative Disko configurations to be included alongside
the NixOS configuration.
'';
};
};
config.modules = [
@ -426,6 +436,19 @@ let
}
))
# Then we include the Disko configuration (if there's any).
(lib.mkIf (config.diskoConfigs != [ ] (
let
diskoConfigs =
builtins.map (name: import ../../../configs/disko/${name}) config.diskoConfigs;
in
{
imports =
[ inputs.disko.nixosModules.disko ]
++ (lib.lists.flatten diskoConfigs);
})
))
# Setting up the typical configuration.
(
let