feat(meta): use manifest to define system configurations
This commit is contained in:
parent
96321d4026
commit
084caa727b
18 changed files with 125 additions and 131 deletions
|
@ -1,7 +1,3 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
cfg = config.flake;
|
||||
in
|
||||
{
|
||||
allowedUnfreePackages = [
|
||||
"nvidia-x11"
|
||||
|
@ -11,11 +7,11 @@ in
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
hostName,
|
||||
hostConfig,
|
||||
...
|
||||
}:
|
||||
let
|
||||
gpu = cfg.manifest.hosts.nixos.${hostName}.machine.gpu or "";
|
||||
inherit (hostConfig.machine) gpu;
|
||||
in
|
||||
if gpu == "nvidia" then
|
||||
{
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
flake.modules.nixos.default =
|
||||
{ hostName, ... }:
|
||||
{ hostConfig, ... }:
|
||||
let
|
||||
inherit (config.flake.manifest.hosts.nixos.${hostName}.machine) platform;
|
||||
inherit (hostConfig.machine) platform;
|
||||
arch = if platform == "amd" || platform == "intel" then "x86_64" else "aarch64";
|
||||
in
|
||||
{
|
||||
|
@ -13,9 +12,9 @@
|
|||
};
|
||||
|
||||
flake.modules.darwin.default =
|
||||
{ hostName, ... }:
|
||||
{ hostConfig, ... }:
|
||||
let
|
||||
inherit (config.flake.manifest.hosts.darwin.${hostName}.machine) platform;
|
||||
inherit (hostConfig.machine) platform;
|
||||
arch = if platform == "intel" then "x86_64" else "aarch64";
|
||||
in
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue