flake-parts/setups/disko: init

Even though this is pretty useless in practice but whatever.
This commit is contained in:
Gabriel Arazas 2024-02-27 20:58:22 +08:00
parent 04f3098508
commit 3367ca59a6
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 47 additions and 0 deletions

View File

@ -1,5 +1,6 @@
{
imports = [
./disko.nix
./nixos.nix
./nixvim.nix
./home-manager.nix

View File

@ -0,0 +1,46 @@
# A declarative setup for Disko scripts... Yeah, why not. Seriously though,
# this is only used to offer partitioning scripts for the rest of the system
# outside of NixOS even though we can easily write dedicated shell scripts for
# that. Take note we don't consider integrating this with declarative NixOS
# setups since their Disko scripts are already gettable in
# `config.system.build.diskoScript` along with its variants (e.g., `noDeps`).
{ config, lib, ... }:
let
cfg = config.setups.disko;
diskoConfigType = { name, config, ... }: {
options = {
configName = lib.mkOption {
type = lib.types.nonEmptyStr;
default = name;
example = "plover";
description = ''
The name of the configuration to be used. Useful for creating variants
of the same declarative environment.
'';
};
};
};
in
{
options.setups.disko = {
configs = lib.mkOption {
type = with lib.types; attrsOf (submodule diskoConfigType);
default = { };
example = {
archive = { };
};
description = ''
A set of declarative Disko configurations only used for integrating
with NixOS and itself by exporting into `diskoConfigurations` which is
recognized by `disko` program.
'';
};
};
config = {
flake.diskoConfigurations =
lib.mapAttrs (name: _: import ../../../configs/disko/${name}) cfg.configs;
};
}