mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
config: add some hosts image to packages
This commit is contained in:
parent
da5b904fd7
commit
afb86dd59a
38
flake.nix
38
flake.nix
@ -298,6 +298,20 @@
|
|||||||
manpages.enable = true;
|
manpages.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# A wrapper around the nixos-generators `nixosGenerate` function.
|
||||||
|
mkImage = { system ? null, pkgs ? null, extraModules ? [ ], extraArgs ? { }, format ? "iso" }:
|
||||||
|
inputs.nixos-generators.nixosGenerate {
|
||||||
|
inherit pkgs system format;
|
||||||
|
lib = lib';
|
||||||
|
specialArgs = extraArgs;
|
||||||
|
modules =
|
||||||
|
# Import all of the NixOS modules.
|
||||||
|
(lib'.modulesToList (lib'.filesToAttr ./modules/nixos))
|
||||||
|
|
||||||
|
# Our own modules.
|
||||||
|
++ extraModules;
|
||||||
|
};
|
||||||
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
|
||||||
@ -358,10 +372,28 @@
|
|||||||
|
|
||||||
# My custom packages, available in here as well. Though, I mainly support
|
# My custom packages, available in here as well. Though, I mainly support
|
||||||
# "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:
|
packages = forAllSystems (system: let
|
||||||
inputs.flake-utils.lib.flattenTree (import ./pkgs {
|
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
pkgs = import nixpkgs { inherit system overlays; };
|
||||||
}));
|
|
||||||
|
# An attrset of images with their metadata that is usually built.
|
||||||
|
images = {
|
||||||
|
bootstrap.format = "install-iso";
|
||||||
|
plover.format = "gce";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
inputs.flake-utils.lib.flattenTree (import ./pkgs { inherit pkgs; })
|
||||||
|
// lib'.mapAttrs'
|
||||||
|
(name: value:
|
||||||
|
lib'.nameValuePair "${name}-${value.format}" (mkImage {
|
||||||
|
inherit system pkgs extraArgs;
|
||||||
|
inherit (value) format;
|
||||||
|
extraModules = [
|
||||||
|
{ networking.hostName = name; }
|
||||||
|
hostSharedConfig
|
||||||
|
./hosts/${name}
|
||||||
|
];
|
||||||
|
}))
|
||||||
|
images);
|
||||||
|
|
||||||
# My several development shells for usual type of projects. This is much
|
# My several development shells for usual type of projects. This is much
|
||||||
# more preferable than installing all of the packages at the system
|
# more preferable than installing all of the packages at the system
|
||||||
|
Loading…
Reference in New Issue
Block a user