This commit is contained in:
mjallen18
2026-01-02 20:30:05 -06:00
parent b7380317b9
commit 56154fe941
38 changed files with 1188 additions and 594 deletions

View File

@@ -128,7 +128,7 @@ in
};
services = {
nextcloud-client.enable = false;#lib.mkDefault hasDestopEnvironment;
nextcloud-client.enable = false; # lib.mkDefault hasDestopEnvironment;
pass-secret-service = lib.mkDefault enabled;
kdeconnect = {
enable = lib.mkDefault hasDestopEnvironment;

View File

@@ -64,4 +64,4 @@ with lib;
done'';
}
)
)

View File

@@ -1,4 +1,10 @@
{ config, lib, pkgs, namespace, ... }:
{
config,
lib,
pkgs,
namespace,
...
}:
let
cfg = config.${namespace}.hardware.raspberry-pi.audio;
variant = config.${namespace}.hardware.raspberry-pi.variant;
@@ -10,21 +16,26 @@ in
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays =
[ ] ++ (if (variant == "5") then
[
{
name = "pisound-pi5-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/pisound-pi5-overlay.dts";
}
]
else
[
{
name = "pisound-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/pisound-overlay.dts";
}
]);
overlays =
[ ]
++ (
if (variant == "5") then
[
{
name = "pisound-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/pisound-pi5-overlay.dts";
}
]
else
[
{
name = "pisound-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/pisound-overlay.dts";
}
]
);
};
};
}
}

View File

@@ -1,4 +1,10 @@
{ config, lib, pkgs, namespace, ... }:
{
config,
lib,
pkgs,
namespace,
...
}:
let
cfg = config.${namespace}.hardware.raspberry-pi.disable-bluetooth;
variant = config.${namespace}.hardware.raspberry-pi.variant;
@@ -10,21 +16,28 @@ in
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays =
[ ] ++ (if (variant == "5") then
[
{
name = "disable-bt-pi5-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/disable-bt-pi5-overlay.dts";
}
]
else
[
{
name = "disable-bt-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/disable-bt-overlay.dts";
}
]);
overlays =
[ ]
++ (
if (variant == "5") then
[
{
name = "disable-bt-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-bt-pi5-overlay.dts";
}
]
else
[
{
name = "disable-bt-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-bt-overlay.dts";
}
]
);
};
};
}
}

View File

@@ -4,161 +4,199 @@
# with modifications
# https://raw.githubusercontent.com/nvmd/raspberry-pi-nix/refs/heads/master/rpi/config.nix
{ lib, config, pkgs, namespace, ... }:
{
lib,
config,
namespace,
...
}:
let
cfg = config.${namespace}.hardware.raspberry-pi;
render-raspberrypi-config = let
render-raspberrypi-config =
let
render-kvs = kvs: let
render-kv = k: v:
if isNull v.value then k
else "${k}=${toString v.value}";
in lib.attrsets.mapAttrsToList render-kv
(lib.filterAttrs (k: v: v.enable) kvs);
render-kvs =
kvs:
let
render-kv = k: v: if isNull v.value then k else "${k}=${toString v.value}";
in
lib.attrsets.mapAttrsToList render-kv (lib.filterAttrs (_k: v: v.enable) kvs);
render-dt-param = x: "dtparam=" + x;
render-dt-params = params:
lib.strings.concatMapStringsSep "\n" render-dt-param (render-kvs params);
render-dt-param = x: "dtparam=" + x;
render-dt-params = params: lib.strings.concatMapStringsSep "\n" render-dt-param (render-kvs params);
render-dt-overlay = { overlay, params }:
lib.concatStringsSep "\n" (lib.filter (x: x != "") [
("dtoverlay=" + overlay)
(render-dt-params params)
"dtoverlay="
]);
render-dt-overlay =
{ overlay, params }:
lib.concatStringsSep "\n" (
lib.filter (x: x != "") [
("dtoverlay=" + overlay)
(render-dt-params params)
"dtoverlay="
]
);
render-options = opts:
lib.strings.concatStringsSep "\n" (render-kvs opts);
render-options = opts: lib.strings.concatStringsSep "\n" (render-kvs opts);
render-base-dt-params = render-dt-params;
render-base-dt-params = render-dt-params;
render-dt-overlays = overlays:
lib.strings.concatMapStringsSep "\n" render-dt-overlay
(lib.attrsets.mapAttrsToList
(overlay: params: {
render-dt-overlays =
overlays:
lib.strings.concatMapStringsSep "\n" render-dt-overlay (
lib.attrsets.mapAttrsToList (overlay: params: {
inherit overlay;
inherit (params) params;
})
(lib.filterAttrs (k: v: v.enable) overlays));
}) (lib.filterAttrs (_k: v: v.enable) overlays)
);
render-config-section = conditionalFilter:
{ options, base-dt-params, dt-overlays }:
let all-config = lib.concatStringsSep "\n" (lib.filter (x: x != "") [
(render-options options)
(render-base-dt-params base-dt-params)
(render-dt-overlays dt-overlays)
]);
in ''
[${conditionalFilter}]
${all-config}
'';
in conf: lib.strings.concatStringsSep "\n"
((lib.attrsets.mapAttrsToList render-config-section conf)
++ [ cfg.extra-config ]);
in {
render-config-section =
conditionalFilter:
{
options,
base-dt-params,
dt-overlays,
}:
let
all-config = lib.concatStringsSep "\n" (
lib.filter (x: x != "") [
(render-options options)
(render-base-dt-params base-dt-params)
(render-dt-overlays dt-overlays)
]
);
in
''
[${conditionalFilter}]
${all-config}
'';
in
conf:
lib.strings.concatStringsSep "\n" (
(lib.attrsets.mapAttrsToList render-config-section conf) ++ [ cfg.extra-config ]
);
in
{
options.${namespace}.hardware.raspberry-pi = {
config = let
rpi-config-param = {
options = {
enable = lib.mkEnableOption "attr";
value = lib.mkOption {
type = with lib.types; oneOf [ int str bool ];
};
};
};
dt-param = {
options = {
enable = lib.mkEnableOption "attr";
value = lib.mkOption {
type = with lib.types; nullOr (oneOf [ int str bool ]);
default = null;
};
};
};
dt-overlay = {
options = {
enable = lib.mkEnableOption "overlay";
params = lib.mkOption {
type = with lib.types; attrsOf (submodule dt-param);
default = {};
};
};
};
raspberry-pi-config-options = {
options = {
options = lib.mkOption {
type = with lib.types; attrsOf (submodule rpi-config-param);
default = { };
description = ''
Common hardware configuration options, translates to
`<option>=<value>` in the `config.txt`.
<https://www.raspberrypi.com/documentation/computers/config_txt.html#common-hardware-configuration-options>
'';
example = {
arm_boost = { # arm_boost=1
enable = true;
value = true;
};
config =
let
rpi-config-param = {
options = {
enable = lib.mkEnableOption "attr";
value = lib.mkOption {
type =
with lib.types;
oneOf [
int
str
bool
];
};
};
base-dt-params = lib.mkOption {
type = with lib.types; attrsOf (submodule dt-param);
default = { };
description = ''
Parameters to pass to the base DTB, translates to
`dtparam=<param>=<value>` in the `config.txt`.
<https://www.raspberrypi.com/documentation/computers/configuration.html#part3.2>
'';
example = {
i2c = { # dtparam=i2c=on
enable = true;
value = "on";
};
ant2 = { # dtparam=ant2
enable = true;
};
};
dt-param = {
options = {
enable = lib.mkEnableOption "attr";
value = lib.mkOption {
type =
with lib.types;
nullOr (oneOf [
int
str
bool
]);
default = null;
};
};
dt-overlays = lib.mkOption {
type = with lib.types; attrsOf (submodule dt-overlay);
default = { };
description = ''
DTB overlays to enable and configure with parameters, translates to
```
dtoverlay=<overlay>
dtparam=<param>=<value>
dtoverlay=
```, which is an equivalent to a more popular format of
`dtoverlay=<overlay>,<param>=<value>`.
<https://www.raspberrypi.com/documentation/computers/configuration.html#part3.1>
'';
example = {
vc4-kms-v3d = { # dtoverlay=vc4-kms-v3d,cma-256
enable = true;
params = {
cma-256 = {
enable = true;
# value = "";
};
};
dt-overlay = {
options = {
enable = lib.mkEnableOption "overlay";
params = lib.mkOption {
type = with lib.types; attrsOf (submodule dt-param);
default = { };
};
};
};
raspberry-pi-config-options = {
options = {
options = lib.mkOption {
type = with lib.types; attrsOf (submodule rpi-config-param);
default = { };
description = ''
Common hardware configuration options, translates to
`<option>=<value>` in the `config.txt`.
<https://www.raspberrypi.com/documentation/computers/config_txt.html#common-hardware-configuration-options>
'';
example = {
arm_boost = {
# arm_boost=1
enable = true;
value = true;
};
};
disable-bt = { # dtoverlay=disable-bt
enable = true;
};
base-dt-params = lib.mkOption {
type = with lib.types; attrsOf (submodule dt-param);
default = { };
description = ''
Parameters to pass to the base DTB, translates to
`dtparam=<param>=<value>` in the `config.txt`.
<https://www.raspberrypi.com/documentation/computers/configuration.html#part3.2>
'';
example = {
i2c = {
# dtparam=i2c=on
enable = true;
value = "on";
};
ant2 = {
# dtparam=ant2
enable = true;
};
};
};
dt-overlays = lib.mkOption {
type = with lib.types; attrsOf (submodule dt-overlay);
default = { };
description = ''
DTB overlays to enable and configure with parameters, translates to
```
dtoverlay=<overlay>
dtparam=<param>=<value>
dtoverlay=
```, which is an equivalent to a more popular format of
`dtoverlay=<overlay>,<param>=<value>`.
<https://www.raspberrypi.com/documentation/computers/configuration.html#part3.1>
'';
example = {
vc4-kms-v3d = {
# dtoverlay=vc4-kms-v3d,cma-256
enable = true;
params = {
cma-256 = {
enable = true;
# value = "";
};
};
};
disable-bt = {
# dtoverlay=disable-bt
enable = true;
};
};
};
};
};
in
lib.mkOption {
type = with lib.types; attrsOf (submodule raspberry-pi-config-options);
description = ''
Configures `config.txt` file for Raspberry Pi devices.
The file is located on a firmware partition, usually mounted at
`/boot/firmware`.
<https://www.raspberrypi.com/documentation/computers/config_txt.html>
'';
};
in lib.mkOption {
type = with lib.types; attrsOf (submodule raspberry-pi-config-options);
description = ''
Configures `config.txt` file for Raspberry Pi devices.
The file is located on a firmware partition, usually mounted at
`/boot/firmware`.
<https://www.raspberrypi.com/documentation/computers/config_txt.html>
'';
};
extra-config = lib.mkOption {
type = lib.types.lines;
@@ -181,4 +219,4 @@ in {
config = {
${namespace}.hardware.raspberry-pi.config-generated = render-raspberrypi-config cfg.config;
};
}
}

View File

@@ -12,24 +12,6 @@ let
applyOverlays = _final.callPackage ./apply-overlays-dtmerge.nix { };
};
};
ubootBinName = "u-boot.bin";
deviceTree = ({ pkgs
, firmware
}: pkgs.replaceVarsWith {
src = ./generational/install-device-tree.sh;
isExecutable = true;
replacements = {
inherit (pkgs) bash;
path = pkgs.lib.makeBinPath [
pkgs.coreutils
];
inherit firmware;
};
});
# installs raspberry's firmware independent of the nixos generations
# sometimes referred to as "boot code"
@@ -50,38 +32,128 @@ let
};
});
# Builders used to write during system activation
firmwareBuilder = import ./firmware-builder.nix {
inherit pkgs;
configTxt = pkgs.writeTextFile {
name = "config.txt";
text = ''
# Do not edit!
# This configuration file is generated from NixOS configuration
# options `hardware.raspberry-pi.config`.
# Any manual changes will be overwritten on the next configuration
# switch.
${config.${namespace}.hardware.raspberry-pi.config-generated}
'';
kernelbootGenBuilder = ({ pkgs
, deviceTreeInstaller
}: pkgs.replaceVarsWith {
src = ./generational/kernelboot-gen-builder.sh;
isExecutable = true;
replacements = {
inherit (pkgs) bash;
path = pkgs.lib.makeBinPath [
pkgs.coreutils
];
installDeviceTree = deviceTreeInstaller;
};
firmware = pkgs.${namespace}.raspberrypifw;
});
deviceTree = ({ pkgs
, firmware
}: pkgs.replaceVarsWith {
src = ./generational/install-device-tree.sh;
isExecutable = true;
replacements = {
inherit (pkgs) bash;
path = pkgs.lib.makeBinPath [
pkgs.coreutils
];
inherit firmware;
};
});
mkBootloader = pkgs: bootloader {
inherit pkgs;
inherit (cfg) nixosGenerationsDir;
firmwareInstaller = "${raspberryPiFirmware {
inherit pkgs;
firmware = pkgs.${namespace}.raspberrypifw;
configTxt = pkgs.writeTextFile {
name = "config.txt";
text = ''
# Do not edit!
# This configuration file is generated from NixOS configuration
# options `hardware.raspberry-pi.config`.
# Any manual changes will be overwritten on the next configuration
# switch.
${config.${namespace}.hardware.raspberry-pi.config-generated}
'';
};
}}";
nixosGenBuilder = "${kernelbootGenBuilder {
inherit pkgs;
deviceTreeInstaller = let
cmd = deviceTree {
inherit pkgs;
firmware = cfg.firmwarePackage;
};
args = lib.optionalString (!cfg.useGenerationDeviceTree) " -r";
in "${cmd} ${args}";
}}";
};
bootloader = ({ pkgs
, nixosGenerationsDir
, firmwareInstaller
, nixosGenBuilder
}: pkgs.replaceVarsWith {
src = ./generational/nixos-generations-builder.sh;
isExecutable = true;
replacements = {
inherit (pkgs) bash;
path = pkgs.lib.makeBinPath [
pkgs.coreutils
pkgs.gnused
];
# NixOS-generations -independent
installFirmwareBuilder = firmwareInstaller;
# NixOS-generations -dependent
inherit nixosGenerationsDir nixosGenBuilder;
};
});
# Builders used to write during system activation
ubootBuilder = import ./uboot-builder.nix {
inherit pkgs;
ubootPackage = (if (cfg.variant == "5") then pkgs.${namespace}.uboot-pi5 else pkgs.${namespace}.uboot-pi4);
ubootPackage = (
if (cfg.variant == "5") then pkgs.${namespace}.uboot-pi5 else pkgs.${namespace}.uboot-pi4
);
firmwareBuilder = firmwarePopulateCmd;
extlinuxConfBuilder = config.boot.loader.generic-extlinux-compatible.populateCmd;
};
uefiBuilder = import ./uefi-builder.nix{
populateUbootBuilder = import ./uboot-builder.nix {
pkgs = pkgs.buildPackages;
ubootPackage = (
if (cfg.variant == "5") then pkgs.${namespace}.uboot-pi5 else pkgs.${namespace}.uboot-pi4
);
firmwareBuilder = firmwarePopulateCmd;
extlinuxConfBuilder = config.boot.loader.generic-extlinux-compatible.populateCmd;
};
kernelbootBuilder = import ./kernelboot-builder.nix {
inherit pkgs;
uefiPackage = (if (cfg.variant == "5") then pkgs.${namespace}.uefi-rpi5 else pkgs.${namespace}.uefi-rpi4);
firmwareBuilder = firmwarePopulateCmd;
};
uefiBuilder = import ./uefi-builder.nix {
inherit pkgs;
uefiPackage = (
if (cfg.variant == "5") then pkgs.${namespace}.uefi-rpi5 else pkgs.${namespace}.uefi-rpi4
);
firmwareBuilder = firmwarePopulateCmd;
};
# Builders exposed via populateCmd, which run on the build architecture
populateFirmwareBuilder = import ./firmware-builder.nix {
populateFirmwareBuilder = import ./firmware-builder.nix {
pkgs = pkgs.buildPackages;
configTxt = pkgs.writeTextFile {
name = "config.txt";
@@ -97,12 +169,9 @@ let
firmware = pkgs.${namespace}.raspberrypifw;
};
populateUbootBuilder = import ./uboot-builder.nix {
inherit ubootBinName;
populateKernelbootBuilder = import ./kernelboot-builder.nix {
pkgs = pkgs.buildPackages;
ubootPackage = (if (cfg.variant == "5") then pkgs.${namespace}.uboot-pi5 else pkgs.${namespace}.uboot-pi4);
firmwareBuilder = firmwarePopulateCmd;
extlinuxConfBuilder = config.boot.loader.generic-extlinux-compatible.populateCmd;
};
firmwarePopulateCmd = "${populateFirmwareBuilder} ${firmwareBuilderArgs}";
@@ -114,8 +183,14 @@ let
# system.build.installBootLoader
uboot = "${ubootBuilder} -f /boot/firmware -b /boot -c";
uefi = "${uefiBuilder} -f /boot/firmware -b /boot -c";
kernel = builtins.concatStringsSep " " [
"${mkBootloader pkgs}"
"-g ${toString 10}"
"-f /boot/firmware"
"-c"
];
};
# firmware: caller must provide `-c <nixos configuration>` and `-f <firmware target path>`
# boot: caller must provide `-c <nixos configuration>` and `-b <boot-dir>`
populateCmds = {
@@ -123,6 +198,14 @@ let
firmware = "${populateUbootBuilder}";
boot = "${populateUbootBuilder}";
};
kernel = let cmd = builtins.concatStringsSep " " [
"${mkBootloader pkgs.buildPackages}"
"-g ${toString cfg.configurationLimit}"
];
in {
firmware = "${cmd}";
boot = "${cmd}";
};
};
in
{
@@ -141,10 +224,11 @@ in
type = lib.types.enum [
"uefi"
"uboot"
"kernel"
];
default = "uefi";
};
apply-overlays-dtmerge = {
enable = lib.mkEnableOption "" // {
description = ''
@@ -172,25 +256,33 @@ in
initrd.availableKernelModules = [
"usbhid"
"usb-storage"
] ++ (if (cfg.variant == "5") then [
"nvme"
] else
[
"vc4"
"pcie-brcmstb" # required for the pcie bus to work
"reset-raspberrypi" # required for vl805 firmware to load
]);
]
++ (
if (cfg.variant == "5") then
[
"nvme"
]
else
[
"vc4"
"pcie-brcmstb" # required for the pcie bus to work
"reset-raspberrypi" # required for vl805 firmware to load
]
);
loader = {
# kernelFile = pkgs.stdenv.hostPlatform.linux-kernel.target;
generic-extlinux-compatible = {
enable = lib.mkDefault (if cfg.bootType == "uefi" then false else true);
useGenerationDeviceTree = lib.mkOverride 60 (if cfg.bootType == "uefi" then false else true);
};
systemd-boot.enable = (if cfg.bootType == "uefi" then true else false);
systemd-boot.extraInstallCommands = let
bootloaderInstaller = (if cfg.bootType == "uefi" then (builder."uefi") else (builder."uboot")); # todo
in ''
${bootloaderInstaller} -f /boot/firmware -b /boot -c
'';
systemd-boot.extraInstallCommands =
let
bootloaderInstaller = (builder."${cfg.bootType}");
in
''
${bootloaderInstaller} -f /boot/firmware -b /boot -c
'';
grub.enable = lib.mkForce false;
};
};
@@ -224,56 +316,85 @@ in
];
};
${namespace}.hardware.raspberry-pi = {
config = {
all = {
options = {
os_prefix = lib.mkIf (cfg.bootType == "kernel") {
enable = true;
value = "${cfg.nixosGenerationsDir}/default/"; # "nixos/<generation-name>/"
};
kernel = lib.mkIf (cfg.bootType == "kernel" || cfg.bootType == "uboot") {
enable = true;
value = (if cfg.bootType == "uboot" then "u-boot.bin" else if cfg.bootType == "kernel" then "kernel.img" else "");
};
};
};
};
extra-config = let
# https://www.raspberrypi.com/documentation/computers/config_txt.html#initramfs
ramfsfile = "initrd";
ramfsaddr = "followkernel"; # same as 0 = "after the kernel image"
in ''
[all]
initramfs ${ramfsfile} ${ramfsaddr}
'';
};
# Common hardware settings
hardware = {
deviceTree = {
filter = lib.mkDefault (if (cfg.variant == "5") then "bcm2712-rpi-*.dtb" else "bcm2711-rpi-*.dtb");
overlays = (if (cfg.variant == "4") then [
{
name = "rpi4-cpu-revision";
dtsText = ''
/dts-v1/;
/plugin/;
overlays = (
if (cfg.variant == "4") then
[
{
name = "rpi4-cpu-revision";
dtsText = ''
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2711";
/ {
compatible = "brcm,bcm2711";
fragment@0 {
target-path = "/";
__overlay__ {
system {
linux,revision = <0x00d03114>;
fragment@0 {
target-path = "/";
__overlay__ {
system {
linux,revision = <0x00d03114>;
};
};
};
};
};
};
'';
}
# {
# name = "enable-xhci";
# dtsText = ''
# /dts-v1/;
# /plugin/;
'';
}
# {
# name = "enable-xhci";
# dtsText = ''
# /dts-v1/;
# /plugin/;
# / {
# compatible = "brcm,bcm2711";
# fragment@0 {
# //target-path = "/scb/xhci@7e9c0000";
# target = <&xhci>;
# __overlay__ {
# status = "okay";
# };
# };
# };
# '';
# }
] else
[
{
name = "bcm2712d0-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/bcm2712d0-overlay.dts";
}
]);
# / {
# compatible = "brcm,bcm2711";
# fragment@0 {
# //target-path = "/scb/xhci@7e9c0000";
# target = <&xhci>;
# __overlay__ {
# status = "okay";
# };
# };
# };
# '';
# }
]
else
[
# {
# name = "bcm2712d0-overlay";
# dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/bcm2712d0-overlay.dts";
# }
]
);
};
firmware = [ pkgs.${namespace}.raspberryPiWirelessFirmware ];
graphics.enable32Bit = lib.mkForce false;
@@ -281,7 +402,7 @@ in
};
system = {
#build.installBootLoader = lib.mkOverride 60 (if cfg.bootType == "uefi" then (builder."uefi") else (builder."uboot")); # todo
#build.installBootLoader = lib.mkOverride 60 (if cfg.bootType == "uefi" then (builder."uefi") else (builder."uboot")); # todo
#boot = {
# loader = {
# id = lib.mkOverride 60 (if cfg.bootType == "uefi" then "raspberrypi-uefi" else "raspberrypi-uboot"); # todo
@@ -303,12 +424,12 @@ in
users = {
users.root.shell = pkgs.zsh;
extraGroups = {
gpio = {};
i2c = {};
input = {};
plugdev = {};
spi = {};
video = {};
gpio = { };
i2c = { };
input = { };
plugdev = { };
spi = { };
video = { };
};
};
@@ -316,33 +437,44 @@ in
udev.packages = [
pkgs.${namespace}.udev-rules
];
xserver.extraConfig = let
identifier = "rp1";
driver = "rp1-vec|rp1-dsi|rp1-dpi";
in ''
Section "OutputClass"
Identifier "${identifier}"
MatchDriver "${driver}"
Driver "modesetting"
Option "PrimaryGPU" "true"
EndSection
'';
xserver.extraConfig =
let
identifier = "rp1";
driver = "rp1-vec|rp1-dsi|rp1-dpi";
in
''
Section "OutputClass"
Identifier "${identifier}"
MatchDriver "${driver}"
Driver "modesetting"
Option "PrimaryGPU" "true"
EndSection
'';
};
nixpkgs.overlays = [ ] ++ (if cfg.variant == "5" then [
(final: prev: {
# https://github.com/nvmd/nixos-raspberrypi/issues/64
# credit for the initial version of this snippet goes to @micahcc
jemalloc = prev.jemalloc.overrideAttrs (old: {
# --with-lg-page=(log2 page_size)
# RPi5 (bcm2712): since our page size is 16384 (2**14), we need 14
configureFlags = let
pageSizeFlag = "--with-lg-page";
in (prev.lib.filter (flag: prev.lib.hasPrefix pageSizeFlag flag == false) old.configureFlags)
++ [ "${pageSizeFlag}=14" ];
});
})
] else [ ])
++ (if cfg.apply-overlays-dtmerge.enable then [ dt_ao_overlay ] else [ ]);
nixpkgs.overlays =
[ ]
++ (
if cfg.variant == "5" then
[
(_final: prev: {
# https://github.com/nvmd/nixos-raspberrypi/issues/64
# credit for the initial version of this snippet goes to @micahcc
jemalloc = prev.jemalloc.overrideAttrs (old: {
# --with-lg-page=(log2 page_size)
# RPi5 (bcm2712): since our page size is 16384 (2**14), we need 14
configureFlags =
let
pageSizeFlag = "--with-lg-page";
in
(prev.lib.filter (flag: prev.lib.hasPrefix pageSizeFlag flag == false) old.configureFlags)
++ [ "${pageSizeFlag}=14" ];
});
})
]
else
[ ]
)
++ (if cfg.apply-overlays-dtmerge.enable then [ dt_ao_overlay ] else [ ]);
};
}

View File

@@ -1,6 +1,7 @@
{ pkgs
, configTxt
, firmware ? pkgs.raspberrypifw
{
pkgs,
configTxt,
firmware ? pkgs.raspberrypifw,
}:
pkgs.replaceVarsWith {
@@ -15,4 +16,4 @@ pkgs.replaceVarsWith {
inherit firmware configTxt;
};
}
}

View File

@@ -0,0 +1,68 @@
#! @bash@/bin/sh -e
# shellcheck disable=SC3037,SC3043,SC3044
shopt -s nullglob
export PATH=/empty:@path@
copyForced() {
local src="$1"
local dst="$2"
local dstTmp="$dst.tmp.$$"
cp "$src" "$dstTmp"
mv "$dstTmp" "$dst"
}
# Copy generation's kernel, initrd, cmdline to `genDir`.
addEntry() {
local generationPath="$1"
local generationName="$2"
local genDir="$3"
if ! { [ -e "$generationPath/kernel" ] && [ -e "$generationPath/initrd" ]; }; then
return
fi
echo -n "kernel..."
local kernel="$(readlink -f "$generationPath/kernel")"
local initrd="$(readlink -f "$generationPath/initrd")"
readlink -f "$generationPath" > "$genDir/system-link"
echo "$kernel" > "$genDir/kernel-link"
copyForced "$kernel" "$genDir/kernel.img"
copyForced "$initrd" "$genDir/initrd"
echo "$(cat "$generationPath/kernel-params") init=$generationPath/init" > "$genDir/cmdline.txt"
echo -n "device tree..."
@installDeviceTree@ -c "$generationPath" -d "$genDir"
echo
}
usage() {
echo "usage: $0 -c <path-to-configuration> -n <configuration-name> -d <installation-directory>" >&2
exit 1
}
generationPath= # Path to nixos configuration/generation
generationName= # Name of the generation
target=/boot/firmware # Target directory
echo "$0: $@"
while getopts "c:n:d:" opt; do
case "$opt" in
c) generationPath="$OPTARG" ;;
n) generationName="$OPTARG" ;;
d) target="$OPTARG" ;;
\?) usage ;;
esac
done
addEntry "$generationPath" "$generationName" "$target"
echo "kernel boot files installed for nixos generation '$generationName'"

View File

@@ -1,4 +1,10 @@
{ config, lib, pkgs, namespace, ... }:
{
config,
lib,
pkgs,
namespace,
...
}:
let
cfg = config.${namespace}.hardware.raspberry-pi.i2c;
variant = config.${namespace}.hardware.raspberry-pi.variant;
@@ -10,52 +16,62 @@ in
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays = (if (variant == "5") then
[
{
name = "i2c0-pi5-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c0-pi5-overlay.dts";
}
{
name = "i2c1-pi5-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c1-pi5-overlay.dts";
}
{
name = "i2c2-pi5-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c2-pi5-overlay.dts";
}
{
name = "i2c3-pi5-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c3-pi5-overlay.dts";
}
]
else
[
{
name = "i2c0-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c0-overlay.dts";
}
{
name = "i2c1-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c1-overlay.dts";
}
{
name = "i2c3-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c3-overlay.dts";
}
{
name = "i2c4-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c4-overlay.dts";
}
{
name = "i2c5-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c5-overlay.dts";
}
{
name = "i2c6-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c6-overlay.dts";
}
]);
overlays = (
if (variant == "5") then
[
{
name = "i2c0-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/i2c0-pi5-overlay.dts";
}
{
name = "i2c1-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/i2c1-pi5-overlay.dts";
}
{
name = "i2c2-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/i2c2-pi5-overlay.dts";
}
{
name = "i2c3-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/i2c3-pi5-overlay.dts";
}
]
else
[
{
name = "i2c0-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c0-overlay.dts";
}
{
name = "i2c1-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c1-overlay.dts";
}
{
name = "i2c3-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c3-overlay.dts";
}
{
name = "i2c4-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c4-overlay.dts";
}
{
name = "i2c5-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c5-overlay.dts";
}
{
name = "i2c6-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c6-overlay.dts";
}
]
);
};
};
}
}

View File

@@ -0,0 +1,19 @@
{ pkgs
, firmwareBuilder
}:
pkgs.replaceVarsWith {
src = ./kernelboot-builder.sh;
isExecutable = true;
replacements = {
inherit (pkgs) bash;
path = pkgs.lib.makeBinPath [
pkgs.coreutils
pkgs.gnused
];
inherit firmwareBuilder;
copyKernels = true;
};
}

View File

@@ -0,0 +1,147 @@
#! @bash@/bin/sh -e
shopt -s nullglob
export PATH=/empty:@path@
# used to track copied files to decide which are obsolete
# and need to be removed
declare -A filesCopied
# Convert a path to a file in the Nix store such as
# /nix/store/<hash>-<name>/file to <hash>-<name>-<file>.
cleanName() {
local path="$1"
echo "$path" | sed 's|^/nix/store/||' | sed 's|/|-|g'
}
# Copy a file from the Nix store to `kernelsDir`.
copyToKernelsDir() {
local src="$1"
local kernelsDir="$2"
local dst="$kernelsDir/$(cleanName $src)"
# Don't copy the file if $dst already exists. This means that we
# have to create $dst atomically to prevent partially copied
# kernels or initrd if this script is ever interrupted.
if ! test -e $dst; then
local dstTmp=$dst.tmp.$$
cp $src $dstTmp
mv $dstTmp $dst
fi
filesCopied[$dst]=1
result=$dst
}
copyForced() {
local src="$1"
local dst="$2"
cp $src $dst.tmp
mv $dst.tmp $dst
}
# Copy generation's kernel and initrd to `kernelsDir`.
# Default generation's are also copied to `outdir`
addEntry() {
local generationPath="$1"
local generationName="$2"
local outdir="$3"
local kernelsDir="$4"
if ! test -e $generationPath/kernel -a -e $generationPath/initrd; then
return
fi
local kernel=$(readlink -f $generationPath/kernel)
local initrd=$(readlink -f $generationPath/initrd)
if test "1" = "@copyKernels@"; then
copyToKernelsDir $kernel $kernelsDir; kernel=$result
copyToKernelsDir $initrd $kernelsDir; initrd=$result
fi
echo $(readlink -f $generationPath) > $kernelsDir/$generationName-system
echo $(readlink -f $generationPath/init) > $kernelsDir/$generationName-init
cp $generationPath/kernel-params $kernelsDir/$generationName-cmdline.txt
echo $initrd > $kernelsDir/$generationName-initrd
echo $kernel > $kernelsDir/$generationName-kernel
if test "$generationName" = "default"; then
copyForced $kernel $outdir/kernel.img
copyForced $initrd $outdir/initrd
cp "$(readlink -f "$generationPath/init")" $outdir/nixos-init
echo "`cat $generationPath/kernel-params` init=$generationPath/init" >$outdir/cmdline.txt
fi
}
removeObsolete() {
local path="$1"
# Remove obsolete files from $path and $path/old.
for fn in $path/*linux* $path/*initrd-initrd*; do
if ! test "${filesCopied[$fn]}" = 1; then
rm -vf -- "$fn"
fi
done
}
addAllEntries() {
local defaultGenerationPath="$1"
local outdir="$2"
local kernelsDir="$outdir/nixos-kernels"
mkdir -p $kernelsDir || true
# Add default generation
addEntry $defaultGenerationPath default $outdir $kernelsDir
# Add all generations of the system profile to the menu, in reverse
# (most recent to least recent) order.
for generation in $(
(cd /nix/var/nix/profiles && ls -d system-*-link) \
| sed 's/system-\([0-9]\+\)-link/\1/' \
| sort -n -r); do
link=/nix/var/nix/profiles/system-$generation-link
addEntry $link $generation $outdir $kernelsDir
done
removeObsolete $kernelsDir
}
usage() {
echo "usage: $0 -c <path-to-default-configuration> [-d <boot-dir>]" >&2
exit 1
}
default= # Default configuration
echo "kernelboot-builder: $@"
while getopts "c:b:f:" opt; do
case "$opt" in
c) default="$OPTARG" ;;
b) boottarget="$OPTARG" ;;
f) fwtarget="$OPTARG" ;;
\?) usage ;;
esac
done
if [ -z "$boottarget" ] && [ -z "$fwtarget" ]; then
echo "Error: at least one of \`-b <boot-dir>\` and \`-f <firmware-dir>\` must be set"
usage
fi
if [ -n "$fwtarget" ]; then
@firmwareBuilder@ -c $default -d $fwtarget
echo "updating the boot generations directory..."
addAllEntries $default $fwtarget
fi
if [ -n "$boottarget" ]; then
echo "'-b $boottarget' isn't used when loading the kernel directly with kernelboot: \
kernels are copied directly to <firmware-dir>"
fi
echo "kernelboot bootloader installed"

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }:
{
config,
lib,
namespace,
...
}:
let
cfg = config.${namespace}.hardware.raspberry-pi.leds;
@@ -129,4 +134,4 @@ in
};
})
];
}
}

View File

@@ -1,4 +1,10 @@
{ config, lib, pkgs, namespace, ... }:
{
config,
lib,
pkgs,
namespace,
...
}:
let
cfg = config.${namespace}.hardware.raspberry-pi.modesetting;
variant = config.${namespace}.hardware.raspberry-pi.variant;
@@ -10,26 +16,28 @@ in
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays =
[
{
name = "vc4-fkms-v3d-pi4-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/vc4-fkms-v3d-pi4-overlay.dts";
}
] ++ (if (variant == "5") then
[
{
name = "vc4-kms-v3d-pi5-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/vc4-kms-v3d-pi5-overlay.dts";
}
]
else
[
{
name = "vc4-kms-v3d-pi4-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/vc4-kms-v3d-pi4-overlay.dts";
}
]);
overlays =
[ ]
++ (
if (variant == "5") then
[
{
name = "vc4-kms-v3d-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/vc4-kms-v3d-pi5-overlay.dts";
}
]
else
[
{
name = "vc4-fkms-v3d-pi4-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/vc4-fkms-v3d-pi4-overlay.dts";
}
]
);
};
};
}
}

View File

@@ -1,4 +1,10 @@
{ config, lib, pkgs, namespace, ... }:
{
config,
lib,
pkgs,
namespace,
...
}:
let
cfg = config.${namespace}.hardware.raspberry-pi.pwm;
variant = config.${namespace}.hardware.raspberry-pi.variant;
@@ -15,12 +21,13 @@ in
name = "enable-pwm";
filter = (if (variant == "5") then "*pi5*" else "*rpi-4-b*");
dtsFile = (
if (variant == "5")
then "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/pwm-pio-overlay.dts"
else "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/pwm1-overlay.dts"
if (variant == "5") then
"${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/pwm-pio-overlay.dts"
else
"${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/pwm1-overlay.dts"
);
}
];
};
};
}
}

View File

@@ -1,8 +1,9 @@
{ pkgs
, ubootPackage
, ubootBinName ? "u-boot.bin"
, extlinuxConfBuilder
, firmwareBuilder
{
pkgs,
ubootPackage,
ubootBinName ? "u-boot.bin",
extlinuxConfBuilder,
firmwareBuilder,
}:
pkgs.replaceVarsWith {
@@ -20,4 +21,4 @@ pkgs.replaceVarsWith {
inherit extlinuxConfBuilder;
inherit firmwareBuilder;
};
}
}

View File

@@ -1,6 +1,7 @@
{ pkgs
, uefiPackage
, firmwareBuilder
{
pkgs,
uefiPackage,
firmwareBuilder,
}:
pkgs.replaceVarsWith {
@@ -16,4 +17,4 @@ pkgs.replaceVarsWith {
uefi = uefiPackage;
inherit firmwareBuilder;
};
}
}

View File

@@ -42,7 +42,7 @@ if [ -n "$fwtarget" ]; then
@firmwareBuilder@ -c $default -d $fwtarget
echo "copying uefi firmware..."
rm -rf $fwtarget/*
# rm -rf $fwtarget/*
copyForced @uefi@ $fwtarget/
fi

View File

@@ -1,4 +1,10 @@
{ config, lib, pkgs, namespace, ... }:
{
config,
lib,
pkgs,
namespace,
...
}:
let
cfg = config.${namespace}.hardware.raspberry-pi.disable-wifi;
variant = config.${namespace}.hardware.raspberry-pi.variant;
@@ -10,25 +16,32 @@ in
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays =
[ ] ++ (if (variant == "5") then
[
{
name = "disable-wifi-pi5-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/disable-wifi-pi5-overlay.dts";
}
]
else
[
{
name = "disable-wifi-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/disable-wifi-overlay.dts";
}
{
name = "wifimac-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/wifimac-overlay.dts";
}
]);
overlays =
[ ]
++ (
if (variant == "5") then
[
{
name = "disable-wifi-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-wifi-pi5-overlay.dts";
}
]
else
[
{
name = "disable-wifi-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-wifi-overlay.dts";
}
{
name = "wifimac-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/wifimac-overlay.dts";
}
]
);
};
};
}
}

View File

@@ -1,13 +1,9 @@
{
config,
lib,
pkgs,
namespace,
...
}:
let
gpuTargets = [ "gfx1102" ]; # todo update when support is added gfx1150
in
{
programs.ccache = {
enable = true;
@@ -59,42 +55,86 @@ in
nixpkgs.overlays = [
(_self: super: {
${namespace} =
${namespace} =
let
clangCcacheStdenv = super.overrideCC super.llvmPackages.stdenv (super.ccacheWrapper.override {
cc = super.llvmPackages.stdenv.cc;
extraConfig = ''
export CCACHE_SLOPPINESS=include_file_ctime,time_macros
export CCACHE_DIR=/var/cache/ccache
'';
});
clangCcacheStdenv = super.overrideCC super.llvmPackages.stdenv (
super.ccacheWrapper.override {
cc = super.llvmPackages.stdenv.cc;
extraConfig = ''
export CCACHE_SLOPPINESS=include_file_ctime,time_macros
export CCACHE_DIR=/var/cache/ccache
'';
}
);
in
super.${namespace} // {
linuxPackages_rpi5 = super.linuxPackagesFor (super.${namespace}.linux-rpi.override { stdenv = super.ccacheStdenv; });
linuxPackages_rpi4 = super.linuxPackagesFor (super.${namespace}.linux-rpi.override { stdenv = super.ccacheStdenv; rpiVersion = 4; });
super.${namespace}
// {
linuxPackages_rpi5 = super.linuxPackagesFor (
super.${namespace}.linux-rpi.override { stdenv = super.ccacheStdenv; }
);
linuxPackages_rpi4 = super.linuxPackagesFor (
super.${namespace}.linux-rpi.override {
stdenv = super.ccacheStdenv;
rpiVersion = 4;
}
);
libraspberrypi = super.${namespace}.libraspberrypi.override { stdenv = super.ccacheStdenv; };
raspberrypi-utils = super.${namespace}.raspberrypi-utils.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos = super.${namespace}.linuxPackages_cachyos.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-lto = super.${namespace}.linuxPackages_cachyos-lto.override { stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-lto-full = super.${namespace}.linuxPackages_cachyos-lto-full.override { stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-lts = super.${namespace}.linuxPackages_cachyos-lts.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-lts-lto = super.${namespace}.linuxPackages_cachyos-lts-lto.override { stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-lto-znver4 = super.${namespace}.linuxPackages_cachyos-lto-znver4.override { stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-server = super.${namespace}.linuxPackages_cachyos-server.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-server-lto = super.${namespace}.linuxPackages_cachyos-server-lto.override { stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-server-lto-znver4 = super.${namespace}.linuxPackages_cachyos-server-lto-znver4.override { stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-rc = super.${namespace}.linuxPackages_cachyos-rc.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-rc-lto = super.${namespace}.linuxPackages_cachyos-rc-lto.override { stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-rc-lto-znver4 = super.${namespace}.linuxPackages_cachyos-rc-lto-znver4.override { stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-hardened = super.${namespace}.linuxPackages_cachyos-hardened.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-hardened-lto = super.${namespace}.linuxPackages_cachyos-hardened-lto.override { stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-hardened-lto-znver4 = super.${namespace}.linuxPackages_cachyos-hardened-lto-znver4.override { stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-deckify = super.${namespace}.linuxPackages_cachyos-deckify.override { stdenv = super.ccacheStdenv; };
linuxPackages_cachyos-deckify-lto = super.${namespace}.linuxPackages_cachyos-deckify-lto.override { stdenv = clangCcacheStdenv; };
};
linuxPackages_cachyos = super.${namespace}.linuxPackages_cachyos.override {
stdenv = super.ccacheStdenv;
};
linuxPackages_cachyos-lto = super.${namespace}.linuxPackages_cachyos-lto.override {
stdenv = clangCcacheStdenv;
};
linuxPackages_cachyos-lto-full = super.${namespace}.linuxPackages_cachyos-lto-full.override {
stdenv = clangCcacheStdenv;
};
linuxPackages_cachyos-lts = super.${namespace}.linuxPackages_cachyos-lts.override {
stdenv = super.ccacheStdenv;
};
linuxPackages_cachyos-lts-lto = super.${namespace}.linuxPackages_cachyos-lts-lto.override {
stdenv = clangCcacheStdenv;
};
linuxPackages_cachyos-lto-znver4 = super.${namespace}.linuxPackages_cachyos-lto-znver4.override {
stdenv = clangCcacheStdenv;
};
linuxPackages_cachyos-server = super.${namespace}.linuxPackages_cachyos-server.override {
stdenv = super.ccacheStdenv;
};
linuxPackages_cachyos-server-lto = super.${namespace}.linuxPackages_cachyos-server-lto.override {
stdenv = clangCcacheStdenv;
};
linuxPackages_cachyos-server-lto-znver4 =
super.${namespace}.linuxPackages_cachyos-server-lto-znver4.override
{ stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-rc = super.${namespace}.linuxPackages_cachyos-rc.override {
stdenv = super.ccacheStdenv;
};
linuxPackages_cachyos-rc-lto = super.${namespace}.linuxPackages_cachyos-rc-lto.override {
stdenv = clangCcacheStdenv;
};
linuxPackages_cachyos-rc-lto-znver4 =
super.${namespace}.linuxPackages_cachyos-rc-lto-znver4.override
{ stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-hardened = super.${namespace}.linuxPackages_cachyos-hardened.override {
stdenv = super.ccacheStdenv;
};
linuxPackages_cachyos-hardened-lto =
super.${namespace}.linuxPackages_cachyos-hardened-lto.override
{ stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-hardened-lto-znver4 =
super.${namespace}.linuxPackages_cachyos-hardened-lto-znver4.override
{ stdenv = clangCcacheStdenv; };
linuxPackages_cachyos-deckify = super.${namespace}.linuxPackages_cachyos-deckify.override {
stdenv = super.ccacheStdenv;
};
linuxPackages_cachyos-deckify-lto = super.${namespace}.linuxPackages_cachyos-deckify-lto.override {
stdenv = clangCcacheStdenv;
};
};
})
(_self: super: {
"raspberrypi-utils" = super.${namespace}."raspberrypi-utils";
"raspberrypi-udev-rules" = super.${namespace}."udev-rules";
@@ -173,7 +213,7 @@ in
qt3d = super.kdePackages.qt3d.override {
qtbase = super.kdePackages.qtbase.override { stdenv = super.ccacheStdenv; };
};
qtwebengine = super.stable.kdePackages.qtwebengine; #.override { stdenv = super.ccacheStdenv; };
qtwebengine = super.stable.kdePackages.qtwebengine; # .override { stdenv = super.ccacheStdenv; };
};
})
# (_self: super: {

View File

@@ -9,10 +9,17 @@ with lib;
let
inherit (lib.${namespace}) mkOpt mkBoolOpt;
cfg = config.${namespace}.user // {
hashedPasswordFile = (if (config.${namespace}.user.hashedPassword == null &&
config.${namespace}.user.hashedPasswordFile == null &&
config.${namespace}.user.password == null) then
defaultPasswordFile else null
hashedPasswordFile = (
if
(
config.${namespace}.user.hashedPassword == null
&& config.${namespace}.user.hashedPasswordFile == null
&& config.${namespace}.user.password == null
)
then
defaultPasswordFile
else
config.${namespace}.user.hashedPasswordFile
);
};