Comments (11)
Actually, it turns out it's pretty easy as of NixOS/nixpkgs#94660, just pass isoImage.squashfsCompression
:
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixos-generators, ... }: {
packages.x86_64-linux = {
iso = nixos-generators.nixosGenerate {
system = "x86_64-linux";
modules = [
# you can include your own nixos configuration here, i.e.
# ./configuration.nix
];
customFormats = {
install-iso-minimal = {
imports = [
"${toString nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
];
systemd.services.sshd.wantedBy = nixpkgs.lib.mkForce ["multi-user.target"];
isoImage.squashfsCompression = "zstd -Xcompression-level 3";
formatAttr = "isoImage";
filename = "*.iso";
};
};
format = "install-iso-minimal";
};
};
};
}
The iso part of that build is only 2m for me (and the final result is as expected a little bigger).
from nixos-generators.
Using --format-path
is a way to do this.
from nixos-generators.
Not sure I follow you. Could you post a config to reproduce the issue?
also, yes the diskSize is currently hardcoded, making it dynamic requires upstream work. I'm trying to work on a modification to make-disk-image.nix to create the diskSize based on the files copied to it, with an optional parameter of addtionalDiskSpace
from nixos-generators.
Any sufficiently large built image should reproduce this, below is a slightly silly example.
{ config, pkgs, ... }: {
environment.systemPackages = with pkgs; [
firefox thunderbird
awesome redshift xlockmore scrot
zsh
ripgrep
neomutt offlineimap elinks
git mercurial subversion
kitty
neovim
evince mupdf
chromium
pulseaudio
youtube-dl
opam
z3
mpv cmus
ffmpeg
wireguard wireguard-tools
gimp
pandoc
qemu
docker
wireshark-qt
qutebrowser
libreoffice
];
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome3.enable = true;
}
from nixos-generators.
I implemented a PR for nixpkgs which could solve some of the issues: NixOS/nixpkgs#89331
from nixos-generators.
@Lassulus Thanks! What do you think about improving squashfs speed by letting the user specify a faster compression method? -f iso
already supports large images, but takes very long to build the image.
from nixos-generators.
better late than never: It would be nice to have squashfs optionally, since compressing everything takes forever when debugging something. Sadly I don't know how to do this and I didn't find any easy exposed options in nixpkgs to allow for this
from nixos-generators.
Also run into this today because the build was timing out with 600 max-silent-time.
from nixos-generators.
well making squashfs optional is also something which needs to be done upstream. so not much I can do in nixos-generators I guess (but didn't really take a deep look)
from nixos-generators.
π to being able to lower the compression on the squashfs stepβ for quick iteration and one-off use-cases, it's often desirable to favor time over storage.
from nixos-generators.
Seems to be fixed then.
from nixos-generators.
Related Issues (20)
- Raw-efi images unbootable/require manual intervention on real hardware HOT 1
- Must specify 23.05 as a CLI param, otherwise, issues errors with new configs HOT 6
- Question: using vm-nogui format, can you emulate an aarch64 guest on an x86 host?
- cross-compile from aarch64-linux to x86_64-linux not working
- kexec currently broken HOT 3
- cloudstack currently broken
- Not using system.stateVersion to build HOT 2
- Building on raspberrypi4 failed: Module sun4i-drm not found HOT 1
- flake.nix's function is named `nixosGenerate`
- Private Git Repos negatively impacted HOT 4
- network access in build environment HOT 1
- Option to generate graphical installer HOT 2
- what happens if filesystems are defined HOT 1
- vmware: ERROR: cptofs failed. diskSize might be too small for closure HOT 4
- custom Formats in Flakes broken HOT 3
- `install-iso` collides in `networking` config HOT 1
- sd-aarch64 image appears to be raspberry Pi specific?
- Proxmox VMA image fails to import HOT 9
- qcow2 disk size not set to auto HOT 3
- error: hash mismatch importing path '/nix/store/k0qmcgfp5rw5sjygj1cj5jfrlsy6bb2h-binutils-wrapper-2.40-man'; HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nixos-generators.