mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 12:19:07 +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.
|
# Our own modules.
|
||||||
++ extraModules;
|
++ 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
|
in
|
||||||
{
|
{
|
||||||
# Exposes only my library with the custom functions to make it easier to
|
# Exposes only my library with the custom functions to make it easier to
|
||||||
@ -332,13 +342,10 @@
|
|||||||
# modules.
|
# modules.
|
||||||
networking.hostName = lib.mkOverride 2000 host';
|
networking.hostName = lib.mkOverride 2000 host';
|
||||||
})
|
})
|
||||||
|
(lib'.optionalAttrs (images ? host') inputs.nixos-generators.nixosModules.${images.${host'}.format})
|
||||||
hostSharedConfig
|
hostSharedConfig
|
||||||
path
|
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
|
in
|
||||||
mkHost { inherit extraModules; })
|
mkHost { inherit extraModules; })
|
||||||
(lib'.filesToAttr ./hosts);
|
(lib'.filesToAttr ./hosts);
|
||||||
@ -383,15 +390,6 @@
|
|||||||
# "x86_64-linux". I just want to try out supporting other systems.
|
# "x86_64-linux". I just want to try out supporting other systems.
|
||||||
packages = forAllSystems (system: let
|
packages = forAllSystems (system: let
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
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
|
in
|
||||||
inputs.flake-utils.lib.flattenTree (import ./pkgs { inherit pkgs; })
|
inputs.flake-utils.lib.flattenTree (import ./pkgs { inherit pkgs; })
|
||||||
// lib'.mapAttrs'
|
// lib'.mapAttrs'
|
||||||
|
Loading…
Reference in New Issue
Block a user