Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ➜  nix_images cat custom-iso.nix
  2. { nixpkgs ? <nixpkgs>, system? "x86_64-linux" }:
  3.  
  4. let
  5.     myisoconfig = { pkgs, ...}: {
  6.         imports = [
  7.             "${nixpkgs}/nixos/modules/installer/cd-dvd/iso-image.nix"
  8.         ];
  9.  
  10.         networking.hostName = "mynixos";
  11.         environment.systemPackages = with pkgs; [ tmux vim];
  12.         users.extraUsers.root.password = "mynixos";
  13.    
  14.     boot.loader = {
  15.         grub = {
  16.             enable = pkgs.lib.mkForce true;
  17.             efiSupport = true;
  18.             efiInstallAsRemovable = true;
  19.             device = "nodev";
  20.         };
  21.         };
  22.       };
  23.  
  24.     evalNixos = configuration: import "${nixpkgs}/nixos" {
  25.         inherit system configuration;
  26.     };
  27.  
  28. in { iso = (evalNixos myisoconfig).config.system.build.isoImage; }
  29. ➜  nix_images
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement