Commit 8710a27b authored by nikstur's avatar nikstur
Browse files

nixos/profiles/perlless: init

parent 7763ea21
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
# 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";

}
+24 −0
Original line number Diff line number Diff line
{ 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
  '';

}
+1 −0
Original line number Diff line number Diff line
@@ -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 {};