feat(meta): use manifest to define system configurations

This commit is contained in:
Mohammad Rafiq 2025-07-15 21:54:00 +08:00
parent 96321d4026
commit 084caa727b
No known key found for this signature in database
18 changed files with 125 additions and 131 deletions

View file

@ -1,17 +1,12 @@
{
config,
lib,
inputs,
...
}:
{ lib, inputs, ... }:
let
inherit (lib.modules) mkMerge mkIf mkAfter;
in
{
flake.modules.nixos.default =
{ hostName, ... }:
{ hostConfig, ... }:
let
inherit (config.flake.manifest.hosts.nixos.${hostName}.machine) root;
inherit (hostConfig.machine) root;
in
{
imports = [ inputs.disko.nixosModules.disko ];
@ -85,7 +80,7 @@ in
};
}
# Ephemeral by default - assumes btrfs
(mkIf (config.flake.manifest.hosts.nixos.${hostName}.machine.root.ephemeral or true) {
(mkIf root.ephemeral {
boot.initrd.postDeviceCommands = mkAfter ''
mkdir /btrfs_tmp
mount /dev/root_vg/root /btrfs_tmp