setups: migrate TOML format to Nix

This allows us to do much more.
This commit is contained in:
Gabriel Arazas 2023-12-23 20:26:40 +08:00
parent e0bb3b2b59
commit e234807139
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
4 changed files with 54 additions and 55 deletions

View File

@ -81,10 +81,10 @@
# A set of images with their metadata that is usually built for usual
# purposes. The format used here is whatever formats nixos-generators
# support.
images = lib'.importTOML ./images.toml;
images = import ./setups/nixos.nix { lib = lib'; inherit inputs; };
# A set of users with their metadata to be deployed with home-manager.
users = lib'.importTOML ./users.toml;
users = import ./setups/home-manager.nix { lib = lib'; inherit inputs; };
# A set of image-related utilities for the flake outputs.
inherit (import ./lib/extras/images.nix { inherit inputs; lib = lib'; }) mkHost mkHome mkImage listImagesWithSystems;

View File

@ -1,46 +0,0 @@
# This is a custom data for this project where it lists the images found in
# this flake. This can range from NixOS configurations intended to be deployed
# for servers and desktops to installers.
#
# The data is then used for the image creation functions found in `flake.nix`.
# Each of the entry should correspond to one of the hosts in `./hosts/`
# directory.
#
# Take note, any images with the "iso" format is essentially made to be
# deployed somewhere (e.g., desktop, homelab server, VPS).
[ni]
systems = [ "x86_64-linux" ]
format = "iso"
[plover]
systems = [ "x86_64-linux" ]
format = "iso"
domain = "foodogsquared.one"
[plover.deploy]
hostname = "plover.foodogsquared.one"
auto-rollback = true
magic-rollback = true
[void]
systems = [ "x86_64-linux" ]
format = "vm"
[bootstrap]
systems = [
"aarch64-linux",
"x86_64-linux",
]
format = "install-iso"
nixpkgs-channel = "nixos-unstable-small"
[graphical-installer]
systems = [
"aarch64-linux",
"x86_64-linux",
]
format = "install-iso"
[winnowing]
systems = [ "x86_64-linux" ]
format = "iso"

View File

@ -1,11 +1,9 @@
# This is project data for deploying home-manager users with this flake. Each
# of the users defined here should correspond to one of the home-manager users
# at `./users/home-manager/`.
[foo-dogsquared]
systems = [
"aarch64-linux",
"x86_64-linux",
]
{ lib, inputs }:
[plover]
systems = [ "x86_64-linux" ]
{
foo-dogsquared.systems = [ "aarch64-linux" "x86_64-linux" ];
plover.systems = [ "x86_64-linux" ];
}

47
setups/nixos.nix Normal file
View File

@ -0,0 +1,47 @@
# This is a custom data for this project where it lists the images found in
# this flake. This can range from NixOS configurations intended to be deployed
# for servers and desktops to installers.
#
# The data is then used for the image creation functions found in `flake.nix`.
# Each of the entry should correspond to one of the hosts in `./hosts/`
# directory.
{ lib, inputs }:
{
ni = {
systems = [ "x86_64-linux" ];
format = "iso";
};
plover = {
systems = [ "x86_64-linux" ];
format = "iso";
domain = "foodogsquared.one";
deploy = {
hostname = "plover.foodogsquared.one";
auto-rollback = true;
magic-rollback = true;
};
};
void = {
systems = [ "x86_64-linux" ];
format = "vm";
};
bootstrap = {
systems = [ "aarch64-linux" "x86_64-linux" ];
format = "install-iso";
nixpkgs-channel = "nixos-unstable-small";
};
graphical-installer = {
systems = [ "aarch64-linux" "x86_64-linux" ];
format = "install-iso";
};
winnowing = {
systems = [ "x86_64-linux" ];
format = "iso";
};
}