Skip to content

Instantly share code, notes, and snippets.

@samueldr
Created December 23, 2018 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueldr/e757d8554903dc842c41459c1cf10c9d to your computer and use it in GitHub Desktop.
Save samueldr/e757d8554903dc842c41459c1cf10c9d to your computer and use it in GitHub Desktop.
{ nixpkgs ? <nixpkgs>, system ? "aarch64-linux" } :
# ^ (1) changed to aarch64-linux
let
myisoconfig = { pkgs, ...}: {
imports = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix"
];
boot = {
# ^ (2) fixed the options `boot.*` namespacing issue
kernelParams = [ "cma=32M" ];
supportedFilesystems = [ "f2fs" ];
};
environment.systemPackages = with pkgs; [ vim ];
users.extraUsers.root = {
packages = with pkgs; [ f2fs-tools lynx vim w3m ];
initialPassword = "nixos";
};
fileSystems = {
"/boot" = {
device = "/dev/disk/by-label/NIXOS_BOOT";
fsType = "vfat";
};
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "f2fs";
};
};
};
evalNixos = configuration: import "${nixpkgs}/nixos" {
inherit system configuration;
};
in { sd = (evalNixos myisoconfig).config.system.build.sdImage; }
# ^ (3) (uselessly) renamed to sd ^
# ^ (4) use sdImage here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment