2023-04-13 22:08:30 +02:00
|
|
|
# This module optimizes for non-interactive deployments by remove some store paths
|
|
|
|
# which are primarily useful for interactive installations.
|
|
|
|
|
2024-07-21 16:20:42 +02:00
|
|
|
{ lib, pkgs, modulesPath, ... }:
|
2024-01-03 10:53:53 +01:00
|
|
|
{
|
2023-04-13 22:08:30 +02:00
|
|
|
disabledModules = [
|
|
|
|
# This module adds values to multiple lists (systemPackages, supportedFilesystems)
|
|
|
|
# which are impossible/unpractical to remove, so we disable the entire module.
|
|
|
|
"profiles/base.nix"
|
|
|
|
];
|
|
|
|
|
2024-01-03 10:53:53 +01:00
|
|
|
imports = [
|
2024-10-23 20:49:48 +02:00
|
|
|
# ./zfs-minimal.nix
|
2024-05-19 13:07:31 +02:00
|
|
|
./no-bootloaders.nix
|
2024-09-24 21:53:37 +02:00
|
|
|
./python-minimal.nix
|
2024-09-03 11:03:51 +02:00
|
|
|
./noveau-workaround.nix
|
2024-07-21 16:20:42 +02:00
|
|
|
# reduce closure size by removing perl
|
|
|
|
"${modulesPath}/profiles/perlless.nix"
|
|
|
|
# FIXME: we still are left with nixos-generate-config due to nixos-install-tools
|
|
|
|
{ system.forbiddenDependenciesRegexes = lib.mkForce []; }
|
2024-01-03 10:53:53 +01:00
|
|
|
];
|
|
|
|
|
2023-04-13 22:08:30 +02:00
|
|
|
# among others, this prevents carrying a stdenv with gcc in the image
|
2023-06-11 06:48:02 +02:00
|
|
|
system.extraDependencies = lib.mkForce [ ];
|
2023-04-13 22:08:30 +02:00
|
|
|
|
|
|
|
# prevents shipping nixpkgs, unnecessary if system is evaluated externally
|
2023-06-11 06:48:02 +02:00
|
|
|
nix.registry = lib.mkForce { };
|
2023-04-13 22:08:30 +02:00
|
|
|
|
|
|
|
# would pull in nano
|
2024-05-19 16:15:11 +02:00
|
|
|
programs.nano.enable = false;
|
2023-04-13 22:08:30 +02:00
|
|
|
|
2024-05-19 16:15:11 +02:00
|
|
|
# prevents strace
|
2024-09-16 14:03:05 +02:00
|
|
|
environment.defaultPackages = lib.mkForce [
|
|
|
|
pkgs.rsync
|
|
|
|
pkgs.parted
|
|
|
|
pkgs.gptfdisk
|
|
|
|
pkgs.e2fsprogs
|
|
|
|
];
|
2023-04-13 22:08:30 +02:00
|
|
|
|
2024-08-02 08:20:52 +02:00
|
|
|
# normal users are not allowed with sys-users
|
|
|
|
# see https://github.com/NixOS/nixpkgs/pull/328926
|
|
|
|
users.users.nixos = {
|
|
|
|
isSystemUser = true;
|
|
|
|
isNormalUser = lib.mkForce false;
|
2024-09-03 11:30:32 +02:00
|
|
|
shell = "/run/current-system/sw/bin/bash";
|
2024-08-02 08:20:52 +02:00
|
|
|
group = "nixos";
|
2024-08-02 08:20:52 +02:00
|
|
|
};
|
|
|
|
users.groups.nixos = {};
|
|
|
|
|
2024-09-03 11:30:32 +02:00
|
|
|
# we prefer root as this is also what we use in nixos-anywhere
|
|
|
|
services.getty.autologinUser = lib.mkForce "root";
|
|
|
|
|
2023-06-11 06:48:02 +02:00
|
|
|
# we are missing this from base.nix
|
|
|
|
boot.supportedFilesystems = [
|
2024-09-16 14:03:05 +02:00
|
|
|
"ext4"
|
2023-06-11 06:48:02 +02:00
|
|
|
"btrfs"
|
|
|
|
# probably not needed but does not seem to increase closure size
|
|
|
|
"cifs"
|
|
|
|
"f2fs"
|
|
|
|
## anyone still using this over ext4?
|
|
|
|
#"jfs"
|
|
|
|
"ntfs"
|
|
|
|
## no longer seems to be maintained, anyone still using it?
|
|
|
|
#"reiserfs"
|
|
|
|
"vfat"
|
|
|
|
"xfs"
|
|
|
|
];
|
2024-01-03 10:53:53 +01:00
|
|
|
boot.kernelModules = [
|
|
|
|
# we have to explicitly enable this, otherwise it is not loaded even when creating a raid:
|
|
|
|
# https://github.com/nix-community/nixos-anywhere/issues/249
|
|
|
|
"dm-raid"
|
|
|
|
];
|
2023-04-13 22:08:30 +02:00
|
|
|
}
|