include perlless profile in NixOS
conditionally include perlless module relax perlless constraint
This commit is contained in:
parent
f35cc93d09
commit
966d756930
1 changed files with 21 additions and 4 deletions
|
@ -1,4 +1,15 @@
|
|||
{ config, lib, pkgs, ... }: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
let
|
||||
# can be dropped after 23.11 is removed
|
||||
hasPerlless = builtins.pathExists "${modulesPath}/profiles/perlless.nix";
|
||||
in
|
||||
{
|
||||
# more descriptive hostname than just "nixos"
|
||||
networking.hostName = lib.mkDefault "nixos-installer";
|
||||
|
||||
|
@ -6,9 +17,9 @@
|
|||
system.stateVersion = config.system.nixos.version;
|
||||
|
||||
# use latest kernel we can support to get more hardware support
|
||||
boot.kernelPackages = lib.mkDefault (pkgs.zfs.override {
|
||||
removeLinuxDRM = pkgs.hostPlatform.isAarch64;
|
||||
}).latestCompatibleLinuxPackages;
|
||||
boot.kernelPackages =
|
||||
lib.mkDefault
|
||||
(pkgs.zfs.override { removeLinuxDRM = pkgs.hostPlatform.isAarch64; }).latestCompatibleLinuxPackages;
|
||||
boot.zfs.removeLinuxDRM = lib.mkDefault pkgs.hostPlatform.isAarch64;
|
||||
|
||||
documentation.enable = false;
|
||||
|
@ -22,6 +33,12 @@
|
|||
|
||||
imports = [
|
||||
./nix-settings.nix
|
||||
# reduce closure size by removing perl
|
||||
] ++ lib.optionals hasPerlless [
|
||||
"${modulesPath}/profiles/perlless.nix"
|
||||
# We relax the perl check in perlless.nix as not all images are actually perlless
|
||||
# and we also want to allow users to install perl if they need it.
|
||||
{ system.forbiddenDependenciesRegexes = lib.mkForce []; }
|
||||
];
|
||||
|
||||
# Don't add nixpkgs to the image to save space, for our intended use case we don't need it
|
||||
|
|
Loading…
Reference in a new issue