mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
config: refactor with host image format set
This commit is contained in:
parent
997a0ee9aa
commit
fa2509b578
26
flake.nix
26
flake.nix
@ -313,6 +313,16 @@
|
||||
# Our own modules.
|
||||
++ extraModules;
|
||||
};
|
||||
|
||||
# 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 = {
|
||||
bootstrap.format = "install-iso";
|
||||
graphical-installer.format = "install-iso";
|
||||
plover.format = "gce";
|
||||
void.format = "vm";
|
||||
};
|
||||
in
|
||||
{
|
||||
# Exposes only my library with the custom functions to make it easier to
|
||||
@ -332,13 +342,10 @@
|
||||
# modules.
|
||||
networking.hostName = lib.mkOverride 2000 host';
|
||||
})
|
||||
(lib'.optionalAttrs (images ? host') inputs.nixos-generators.nixosModules.${images.${host'}.format})
|
||||
hostSharedConfig
|
||||
path
|
||||
]
|
||||
++ lib'.optional (host' == "bootstrap") inputs.nixos-generators.nixosModules.install-iso
|
||||
++ lib'.optional (host' == "graphical-installer") inputs.nixos-generators.nixosModules.install-iso
|
||||
++ lib'.optional (host' == "plover") inputs.nixos-generators.nixosModules.gce
|
||||
++ lib'.optional (host' == "void") inputs.nixos-generators.nixosModules.vm;
|
||||
];
|
||||
in
|
||||
mkHost { inherit extraModules; })
|
||||
(lib'.filesToAttr ./hosts);
|
||||
@ -383,15 +390,6 @@
|
||||
# "x86_64-linux". I just want to try out supporting other systems.
|
||||
packages = forAllSystems (system: let
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
|
||||
# A set of images with their metadata that is usually built for usual
|
||||
# purposes.
|
||||
images = {
|
||||
bootstrap.format = "install-iso";
|
||||
graphical-installer.format = "install-iso";
|
||||
plover.format = "gce";
|
||||
void.format = "vm";
|
||||
};
|
||||
in
|
||||
inputs.flake-utils.lib.flattenTree (import ./pkgs { inherit pkgs; })
|
||||
// lib'.mapAttrs'
|
||||
|
Loading…
Reference in New Issue
Block a user