From efdcaf5b6400567fc55c39d44933e04cff131edb Mon Sep 17 00:00:00 2001 From: Chan Wen Xu Date: Sat, 18 Dec 2021 18:21:54 +0800 Subject: [PATCH] feat: Add config for generating an installation media It can be built using the command: nix build .#nixosConfigurations.installationMedia.config.system.build.isoImage It contains the latest kernel ZFS supports (ZFS is included in the ISO) and a version of Nix with flakes enabled. --- config/installation_media.nix | 17 +++++++++++++++++ flake.nix | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 config/installation_media.nix diff --git a/config/installation_media.nix b/config/installation_media.nix new file mode 100644 index 0000000..82da2d9 --- /dev/null +++ b/config/installation_media.nix @@ -0,0 +1,17 @@ +{ nixpkgs, ... }: +{ config, pkgs, ... }: + +let + pkgPath = nixpkgs.outPath; +in +{ + imports = [ + "${pkgPath}/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix" + "${pkgPath}/nixos/modules/installer/cd-dvd/channel.nix" + ]; + + boot.kernelPackages = pkgs.zfs.latestCompatibleLinuxPackages; + + nix.package = pkgs.nixUnstable; + nix.extraOptions = "experimental-features = nix-command flakes"; +} diff --git a/flake.nix b/flake.nix index 9fe12da..6b4136a 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,13 @@ ./config/aspire_hardware.nix ]; }; + + installationMedia = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + (import ./config/installation_media.nix inputs) + ]; + }; }; customPkgs = import ./pkg;