I’m currently testing NixOS over a Cloud Provider that works with OpenStack cluster, and I’d like to customize a bit the generated qcow2
image.
For now, I’m building it with passing a parameter to nix-build
specifying the path to a copy of a nix-channel I’m using while using this file as a base :
{ config, lib, pkgs, ... }:
with lib;
{
imports =
[
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
<nixpkgs/nixos/modules/virtualisation/openstack-config.nix>
];
system.build.openstackImage = import <nixpkgs/nixos/lib/make-disk-image.nix> {
inherit lib config;
pkgs = import <nixpkgs> { inherit (pkgs) system; };
diskSize = 8192;
format = "qcow2";
configFile = pkgs.writeText "configuration.nix" (builtins.readFile ./configuration.nix);
};
}
My goal is to select a version of nixpkgs
directly from this file so I can execute the building of the qcow2
from a standalone CI. I found this solution from the NixOS Wiki but I could not understand where to do the import
so my <nixpkgs>
is poiting the pinned version. How could I achieve this ?
Bonus question : Is it a preferable for a headless (ssh-only) system to use the small
version of the channel ?