Compare commits

...

3 commits

View file

@ -14,28 +14,33 @@
makeImage = conf:
(conf.extendModules {
modules = [{ config.nixpkgs.buildPlatform.system = system; }];
}).config.system.build.sdImage;
}).config.system.build;
in {
formatter = pkgs.nixfmt;
packages = lib.mapAttrs'
(name: value: lib.nameValuePair "${name}-sdimage" (makeImage value))
(name: value: lib.nameValuePair "${name}" (makeImage value))
self.nixosConfigurations;
})) // {
nixosModules.minify = { ... }: {
disabledModules = [ "profiles/base.nix" ];
nixosModules.minify = { config, ... }: {
disabledModules = [ "profiles/base.nix" "profiles/all-hardware.nix" ];
config = {
boot.bcache.enable = false;
boot.initrd.includeDefaultModules = false;
environment.defaultPackages = [ ];
fonts.fontconfig.enable = false;
networking.firewall.enable = false;
nix.enable = false;
programs.nano.enable = false;
services.lvm.enable = false;
# Disable nix daemon, but sdImage uses nix-env so it's in the closure anyway
# Link it in for convenience
nix.enable = false;
environment.systemPackages = [ config.nix.package.out ];
# Disable a few default packages, like rsync, but not core stuff, like coreutils
# We could theoretically disable system-path.nix so we don't have
# requiredPackages, but that seems like a lot of work.
# At that point I should just use buildroot...
environment.defaultPackages = [ ];
# Leave networking.useDHCP = true since we would reenable it anyway
@ -83,6 +88,9 @@
self.nixosModules.rpiSht3x
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix"
({ pkgs, ... }: {
boot.initrd.availableKernelModules = [ "mmc_block" ];
sdImage.compressImage = false;
nixpkgs.hostPlatform = lib.systems.examples.raspberryPi;
nixpkgs.overlays = [
(final: prev: {