mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 12:19:07 +00:00
flake-parts/setups/disko: init
Even though this is pretty useless in practice but whatever.
This commit is contained in:
parent
04f3098508
commit
3367ca59a6
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./disko.nix
|
||||||
./nixos.nix
|
./nixos.nix
|
||||||
./nixvim.nix
|
./nixvim.nix
|
||||||
./home-manager.nix
|
./home-manager.nix
|
||||||
|
46
modules/flake-parts/setups/disko.nix
Normal file
46
modules/flake-parts/setups/disko.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user