Skip to content

Instantly share code, notes, and snippets.

@bbjubjub2494
Created April 27, 2021 12:07
Show Gist options
  • Save bbjubjub2494/e0a3df6e742d8e105c27ccbc187cf86b to your computer and use it in GitHub Desktop.
Save bbjubjub2494/e0a3df6e742d8e105c27ccbc187cf86b to your computer and use it in GitHub Desktop.
# commands:
# n build .#nixosConfigurations.legacy390_64.config.system.build.toplevel
# n build .#nixosConfigurations.legacy390_32.config.system.build.toplevel
{
description = "test building nvidia legacy 390 drivers with Linux 5.10";
outputs = { self, nixpkgs }: {
nixosConfigurations =
let generic = system: nixpkgs.lib.nixosSystem {
inherit system;
modules = [
({ config, pkgs, ... }: {
# setup
nixpkgs.config.allowUnfree = true;
boot.loader.grub.devices = [ "/dev/nodev" ];
fileSystems."/" = { device = "/dev/nodev"; };
# pick kernel
boot.kernelPackages = pkgs.linuxPackages_5_10;
# pick nvidia packages
services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.enable = true;
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_390;
hardware.nvidia.nvidiaPersistenced = true;
})
];
};
in
{
legacy390_64 = generic "x86_64-linux";
legacy390_32 = generic "i686-linux";
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment