mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 09:17:14 +08:00 
			
		
		
		
	purism/librem/5r4: make it usuable without an overlay
In larger installations nixpkgs.overlays adds significant overhead because it's harder to share nixpkgs between different NixOS machines i.e. using nixpkgs.pkgs
This commit is contained in:
		
				
					committed by
					
						
						mergify[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							d1659c9eb8
						
					
				
				
					commit
					6cb18a6649
				
			@@ -1,8 +1,15 @@
 | 
			
		||||
{ config, pkgs, lib, ... }:
 | 
			
		||||
let cfg = config.hardware.librem5;
 | 
			
		||||
let
 | 
			
		||||
  cfg = config.hardware.librem5;
 | 
			
		||||
  linuxPackages_librem5 = pkgs.linuxPackagesFor (pkgs.callPackage ./kernel.nix { });
 | 
			
		||||
  ubootLibrem5 = pkgs.callPackage ./u-boot { };
 | 
			
		||||
in {
 | 
			
		||||
  options = {
 | 
			
		||||
    hardware.librem5 = {
 | 
			
		||||
      package = lib.mkOption {
 | 
			
		||||
        type = lib.types.package;
 | 
			
		||||
        default = pkgs.callPackage ./librem5-base { };
 | 
			
		||||
      };
 | 
			
		||||
      wifiCard = lib.mkOption {
 | 
			
		||||
        type = lib.types.enum [ "redpine" "sparklan" "none" ];
 | 
			
		||||
        description = lib.mdDoc ''
 | 
			
		||||
@@ -42,15 +49,6 @@ in {
 | 
			
		||||
      lockdownFix = lib.mkDefault true;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    nixpkgs.overlays = [
 | 
			
		||||
      (import ./kernel)
 | 
			
		||||
      (final: prev: {
 | 
			
		||||
        ubootLibrem5 = final.callPackage ./u-boot { };
 | 
			
		||||
 | 
			
		||||
        librem5-base = final.callPackage ./librem5-base { };
 | 
			
		||||
      })
 | 
			
		||||
    ];
 | 
			
		||||
 | 
			
		||||
    boot = {
 | 
			
		||||
      kernelParams = [ "rootwait" ];
 | 
			
		||||
 | 
			
		||||
@@ -59,12 +57,11 @@ in {
 | 
			
		||||
        grub.enable = false;
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      kernelPackages = lib.mkDefault pkgs.linuxPackages_librem5;
 | 
			
		||||
      kernelPackages = lib.mkDefault linuxPackages_librem5;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    services.udev.packages = lib.mkIf cfg.installUdevPackages [ pkgs.librem5-base ];
 | 
			
		||||
 | 
			
		||||
    environment.systemPackages = with pkgs; [ ubootLibrem5 ];
 | 
			
		||||
    services.udev.packages = lib.mkIf cfg.installUdevPackages [ config.hardware.librem5.package ];
 | 
			
		||||
 | 
			
		||||
    environment.systemPackages = [ ubootLibrem5 ];
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user