nixos/profiles/perlless: init

This commit is contained in:
nikstur 2023-10-17 16:40:26 +02:00
parent 7763ea212a
commit 8710a27bc6
3 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,31 @@
# WARNING: If you enable this profile, you will NOT be able to switch to a new
# configuration and thus you will not be able to rebuild your system with
# nixos-rebuild!
{ lib, ... }:
{
# Disable switching to a new configuration. This is not a necessary
# limitation of a perlless system but just a current one. In the future,
# perlless switching might be possible.
system.switch.enable = lib.mkDefault false;
# Remove perl from activation
boot.initrd.systemd.enable = lib.mkDefault true;
system.etc.overlay.enable = lib.mkDefault true;
systemd.sysusers.enable = lib.mkDefault true;
# Random perl remnants
system.disableInstallerTools = lib.mkDefault true;
programs.less.lessopen = lib.mkDefault null;
programs.command-not-found.enable = lib.mkDefault false;
boot.enableContainers = lib.mkDefault false;
environment.defaultPackages = lib.mkDefault [ ];
documentation.info.enable = lib.mkDefault false;
# Check that the system does not contain a Nix store path that contains the
# string "perl".
system.forbiddenDependenciesRegex = "perl";
}

View File

@ -0,0 +1,24 @@
{ lib, ... }:
{
name = "activation-perlless";
meta.maintainers = with lib.maintainers; [ nikstur ];
nodes.machine = { pkgs, modulesPath, ... }: {
imports = [ "${modulesPath}/profiles/perlless.nix" ];
boot.kernelPackages = pkgs.linuxPackages_latest;
virtualisation.mountHostNixStore = false;
virtualisation.useNixStoreImage = true;
};
testScript = ''
perl_store_paths = machine.succeed("ls /nix/store | grep perl || true")
print(perl_store_paths)
assert len(perl_store_paths) == 0
'';
}

View File

@ -287,6 +287,7 @@ in {
activation-nix-channel = runTest ./activation/nix-channel.nix;
activation-etc-overlay-mutable = runTest ./activation/etc-overlay-mutable.nix;
activation-etc-overlay-immutable = runTest ./activation/etc-overlay-immutable.nix;
activation-perlless = runTest ./activation/perlless.nix;
etcd = handleTestOn ["x86_64-linux"] ./etcd.nix {};
etcd-cluster = handleTestOn ["x86_64-linux"] ./etcd-cluster.nix {};
etebase-server = handleTest ./etebase-server.nix {};