This commit is contained in:
mjallen18
2025-12-23 21:04:21 -06:00
parent 8f08f24761
commit d981fb20c2
68 changed files with 957 additions and 543 deletions

View File

@@ -217,8 +217,8 @@
nixos-raspberrypi.nixosModules.raspberry-pi-4.display-vc4 nixos-raspberrypi.nixosModules.raspberry-pi-4.display-vc4
nixos-raspberrypi.nixosModules.nixpkgs-rpi nixos-raspberrypi.nixosModules.nixpkgs-rpi
nixos-raspberrypi.nixosModules.trusted-nix-caches nixos-raspberrypi.nixosModules.trusted-nix-caches
nixos-raspberrypi.lib.inject-overlays # nixos-raspberrypi.lib.inject-overlays
nixos-raspberrypi.lib.inject-overlays-global # nixos-raspberrypi.lib.inject-overlays-global
]; ];
}; };
@@ -234,8 +234,8 @@
nixos-raspberrypi.nixosModules.raspberry-pi-5.page-size-16k nixos-raspberrypi.nixosModules.raspberry-pi-5.page-size-16k
nixos-raspberrypi.nixosModules.nixpkgs-rpi nixos-raspberrypi.nixosModules.nixpkgs-rpi
nixos-raspberrypi.nixosModules.trusted-nix-caches nixos-raspberrypi.nixosModules.trusted-nix-caches
nixos-raspberrypi.lib.inject-overlays # nixos-raspberrypi.lib.inject-overlays
nixos-raspberrypi.lib.inject-overlays-global # nixos-raspberrypi.lib.inject-overlays-global
]; ];
}; };

View File

@@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) enabled;
# Displays # Displays
display = { display = {
input = "eDP-1"; input = "eDP-1";

View File

@@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) disabled;
in in
{ {

View File

@@ -4,7 +4,7 @@
... ...
}: }:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) disabled;
in in
{ {
home.username = "root"; home.username = "root";

View File

@@ -4,7 +4,7 @@
... ...
}: }:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) disabled;
in in
{ {
home.username = "root"; home.username = "root";

View File

@@ -4,7 +4,7 @@
... ...
}: }:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) disabled;
in in
{ {
home.username = "root"; home.username = "root";

View File

@@ -1,6 +1,11 @@
{ lib, pkgs, namespace, ... }: {
lib,
pkgs,
namespace,
...
}:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) disabled;
in in
{ {
home.username = "admin"; home.username = "admin";
@@ -23,7 +28,10 @@ in
}; };
protonmail-bridge = { protonmail-bridge = {
enable = true; enable = true;
extraPackages = with pkgs; [ pass libsecret ]; extraPackages = with pkgs; [
pass
libsecret
];
}; };
}; };
} }

View File

@@ -1,6 +1,11 @@
{ lib, pkgs, namespace, ... }: {
lib,
pkgs,
namespace,
...
}:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) enabled;
in in
{ {
home.username = "deck"; home.username = "deck";

View File

@@ -4,7 +4,7 @@
... ...
}: }:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) disabled;
in in
{ {
home.username = "root"; home.username = "root";

View File

@@ -4,7 +4,7 @@
... ...
}: }:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) disabled;
in in
{ {
home.username = "root"; home.username = "root";

View File

@@ -4,7 +4,7 @@
... ...
}: }:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) disabled;
in in
{ {
home.username = "root"; home.username = "root";

View File

@@ -4,7 +4,7 @@
... ...
}: }:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) disabled;
in in
{ {
home.username = "root"; home.username = "root";

View File

@@ -30,7 +30,10 @@ mkModule {
age = { age = {
generateKey = true; generateKey = true;
keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt"; keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ] ++ config.${namespace}.sops.sshKeyPaths; sshKeyPaths = [
"${config.home.homeDirectory}/.ssh/id_ed25519"
]
++ config.${namespace}.sops.sshKeyPaths;
}; };
}; };
}; };

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }: {
config,
lib,
namespace,
...
}:
let let
inherit (lib.${namespace}.module) mkModule mkOpt mkBoolOpt; inherit (lib.${namespace}.module) mkModule mkOpt mkBoolOpt;
in in

View File

@@ -1,4 +1,8 @@
{ inputs, lib, namespace }: {
inputs,
lib,
namespace,
}:
let let
inherit (inputs.nixpkgs.lib) inherit (inputs.nixpkgs.lib)
mapAttrs mapAttrs
@@ -31,7 +35,7 @@ rec {
moduleConfig ? { }, moduleConfig ? { },
domain ? "services", domain ? "services",
config, config,
serviceName ? name serviceName ? name,
}: }:
let let
cfg = config.${namespace}.${domain}.${name}; cfg = config.${namespace}.${domain}.${name};
@@ -90,9 +94,10 @@ rec {
# # "d ${cfg.configDir}/server-files 0775 ${name} ${name} - -" # # "d ${cfg.configDir}/server-files 0775 ${name} ${name} - -"
# # "d ${cfg.configDir}/user-files 0775 ${name} ${name} - -" # # "d ${cfg.configDir}/user-files 0775 ${name} ${name} - -"
# ]; # ];
} // moduleConfig; }
// moduleConfig;
in in
{ config, lib, ... }: { lib, ... }:
{ {
options.${namespace}.${domain}.${name} = lib.mkOption { options.${namespace}.${domain}.${name} = lib.mkOption {
type = lib.types.submodule { type = lib.types.submodule {
@@ -127,9 +132,14 @@ rec {
port = mkOpt types.int 80 "Port for ${name} redis to be hosted on"; port = mkOpt types.int 80 "Port for ${name} redis to be hosted on";
}; };
hashedPassword = mkOpt (types.nullOr types.str) "$y$j9T$EkPXmsmIMFFZ.WRrBYCxS1$P0kwo6e4.WM5DsqUcEqWC3MrZp5KfCjxffraMFZWu06" "Hashed password for code-server authentication"; hashedPassword =
mkOpt (types.nullOr types.str)
"$y$j9T$EkPXmsmIMFFZ.WRrBYCxS1$P0kwo6e4.WM5DsqUcEqWC3MrZp5KfCjxffraMFZWu06"
"Hashed password for code-server authentication";
extraEnvironment = mkOpt (types.attrsOf types.str) { } "Extra environment variables for code-server"; extraEnvironment =
mkOpt (types.attrsOf types.str) { }
"Extra environment variables for code-server";
reverseProxy = mkReverseProxyOpt; reverseProxy = mkReverseProxyOpt;
} }
@@ -141,7 +151,6 @@ rec {
config = lib.mkIf cfg.enable defaultConfig; config = lib.mkIf cfg.enable defaultConfig;
}; };
# container # container
mkContainer = mkContainer =
{ {

View File

@@ -7,7 +7,7 @@
... ...
}: }:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) enabled;
in in
{ {
home = { home = {

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }: {
config,
lib,
namespace,
...
}:
with lib; with lib;
let let
cfg = config.${namespace}.programs.btop; cfg = config.${namespace}.programs.btop;

View File

@@ -1,4 +1,9 @@
{ lib, pkgs, namespace, ... }: {
lib,
pkgs,
namespace,
...
}:
with lib; with lib;
{ {
options.${namespace}.programs.hyprland = { options.${namespace}.programs.hyprland = {

View File

@@ -1,4 +1,9 @@
{ lib, config, namespace, ... }: {
lib,
config,
namespace,
...
}:
with lib; with lib;
let let
cfg = config.${namespace}.programs.kitty; cfg = config.${namespace}.programs.kitty;

View File

@@ -1,8 +1,5 @@
{ lib, namespace, ... }: { lib, namespace, ... }:
with lib; with lib;
let
inherit (lib.${namespace}) mkOpt;
in
{ {
options.${namespace}.programs.kitty = { options.${namespace}.programs.kitty = {
enable = mkEnableOption "enable kitty terminal"; enable = mkEnableOption "enable kitty terminal";

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }: {
config,
lib,
namespace,
...
}:
with lib; with lib;
let let
cfg = config.${namespace}.programs.mako; cfg = config.${namespace}.programs.mako;

View File

@@ -8,7 +8,6 @@
with lib; with lib;
let let
cfg = config.${namespace}.programs.nwg-dock; cfg = config.${namespace}.programs.nwg-dock;
palette = import cfg.theme.file;
in in
{ {
imports = [ ./options.nix ]; imports = [ ./options.nix ];

View File

@@ -8,7 +8,6 @@
with lib; with lib;
let let
cfg = config.${namespace}.programs.nwg-drawer; cfg = config.${namespace}.programs.nwg-drawer;
palette = import cfg.theme.file;
in in
{ {
imports = [ ./options.nix ]; imports = [ ./options.nix ];

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }: {
config,
lib,
namespace,
...
}:
with lib; with lib;
let let
cfg = config.${namespace}.programs.nwg-panel; cfg = config.${namespace}.programs.nwg-panel;

View File

@@ -1,4 +1,9 @@
{ lib, pkgs, namespace, ... }: {
lib,
pkgs,
namespace,
...
}:
with lib; with lib;
{ {
options.${namespace}.programs.nwg-panel = { options.${namespace}.programs.nwg-panel = {

View File

@@ -1,6 +1,5 @@
{ {
config, config,
lib,
namespace, namespace,
pkgs, pkgs,
... ...

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }: {
config,
lib,
namespace,
...
}:
with lib; with lib;
let let
cfg = config.${namespace}.programs.waybar; cfg = config.${namespace}.programs.waybar;

View File

@@ -1,8 +1,12 @@
{ config, lib, namespace, ... }: {
config,
lib,
namespace,
...
}:
with lib; with lib;
let let
cfg = config.${namespace}.programs.wlogout; cfg = config.${namespace}.programs.wlogout;
palette = import cfg.theme.file;
in in
{ {
imports = [ ./options.nix ]; imports = [ ./options.nix ];

View File

@@ -1,8 +1,12 @@
{ config, lib, namespace, ... }: {
config,
lib,
namespace,
...
}:
with lib; with lib;
let let
cfg = config.${namespace}.programs.wofi; cfg = config.${namespace}.programs.wofi;
palette = import cfg.theme.file;
in in
{ {
imports = [ ./options.nix ]; imports = [ ./options.nix ];

View File

@@ -1,8 +1,4 @@
{ {
config,
lib,
pkgs,
namespace,
... ...
}: }:
{ {

View File

@@ -1,4 +1,9 @@
{ config, pkgs, system, ... }: {
config,
pkgs,
system,
...
}:
let let
# # Pull from global theme options # # Pull from global theme options
# themeSize = "standard"; # "standard" | "compact" # themeSize = "standard"; # "standard" | "compact"

View File

@@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
pkgs,
namespace, namespace,
... ...
}: }:

View File

@@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
pkgs,
namespace, namespace,
... ...
}: }:
@@ -64,48 +63,57 @@
}; };
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: super: { (_self: super: {
"linux_rpi-bcm2711" = super."linux_rpi-bcm2711".override { stdenv = super.ccacheStdenv; }; "linux_rpi-bcm2711" = super."linux_rpi-bcm2711".override { stdenv = super.ccacheStdenv; };
}) })
(self: super: { (_self: super: {
"mesa" = super."mesa".override { buildPackages.stdenv = super.ccacheStdenv; }; "mesa" = super."mesa".override { buildPackages.stdenv = super.ccacheStdenv; };
}) })
(self: super: { (_self: super: {
"webkitgtk_4_1" = super.stable."webkitgtk_4_1".override { clangStdenv = super.ccacheStdenv; }; "webkitgtk_4_1" = super.stable."webkitgtk_4_1".override { clangStdenv = super.ccacheStdenv; };
}) })
(self: super: { (_self: super: {
"webkitgtk_6_0" = super."webkitgtk_6_0".override { clangStdenv = super.ccacheStdenv; }; "webkitgtk_6_0" = super."webkitgtk_6_0".override { clangStdenv = super.ccacheStdenv; };
}) })
(self: super: { (_self: super: {
"jellyfin-ffmpeg" = super."jellyfin-ffmpeg".override { ffmpeg_7-full = super.ffmpeg_7-full.override { stdenv = super.ccacheStdenv; }; }; "jellyfin-ffmpeg" = super."jellyfin-ffmpeg".override {
ffmpeg_7-full = super.ffmpeg_7-full.override { stdenv = super.ccacheStdenv; };
};
}) })
# (self: super: { # (self: super: {
# "ffmpeg-headless-rpi" = super."ffmpeg-headless-rpi".override { ffmpeg = super.ffmpeg_7.override { stdenv = super.ccacheStdenv; }; }; # "ffmpeg-headless-rpi" = super."ffmpeg-headless-rpi".override { ffmpeg = super.ffmpeg_7.override { stdenv = super.ccacheStdenv; }; };
# }) # })
# todo: make these work # todo: make these work
(self: super: { (_self: super: {
pcsx2 = super.pcsx2.override { pcsx2 = super.pcsx2.override {
llvmPackages = super.llvmPackages // { llvmPackages = super.llvmPackages // {
stdenv = super.ccacheStdenv; stdenv = super.ccacheStdenv;
}; };
}; };
}) })
(self: super: { (_self: super: {
driversi686Linux = super.driversi686Linux // { driversi686Linux = super.driversi686Linux // {
mesa = super.driversi686Linux.mesa.override { stdenv = super.ccacheStdenv; buildPackages.stdenv = super.ccacheStdenv; }; mesa = super.driversi686Linux.mesa.override {
stdenv = super.ccacheStdenv;
buildPackages.stdenv = super.ccacheStdenv;
};
}; };
}) })
(self: super: { (_self: super: {
kdePackages = super.kdePackages // { kdePackages = super.kdePackages // {
qt3d = super.kdePackages.qt3d.override { qtbase = super.kdePackages.qtbase.override { stdenv = super.ccacheStdenv; }; }; qt3d = super.kdePackages.qt3d.override {
qtbase = super.kdePackages.qtbase.override { stdenv = super.ccacheStdenv; };
};
# qtbase = super.kdePackages.qtbase.override { stdenv = super.ccacheStdenv; }; # qtbase = super.kdePackages.qtbase.override { stdenv = super.ccacheStdenv; };
qtwebengine = super.kdePackages.qtwebengine.override { stdenv = super.ccacheStdenv; }; qtwebengine = super.kdePackages.qtwebengine.override { stdenv = super.ccacheStdenv; };
}; };
}) })
(self: super: { (_self: super: {
linuxAndFirmware = super.linuxAndFirmware // { linuxAndFirmware = super.linuxAndFirmware // {
linuxPackages_rpi4 = super.linuxAndFirmware.linuxPackages_rpi4.override { stdenv = super.ccacheStdenv; }; linuxPackages_rpi4 = super.linuxAndFirmware.linuxPackages_rpi4.override {
stdenv = super.ccacheStdenv;
};
}; };
}) })
]; ];

View File

@@ -1,6 +1,15 @@
{ config, namespace, lib, pkgs, ... }: {
config,
namespace,
lib,
pkgs,
...
}:
let let
hasGui = config.${namespace}.desktop.hyprland.enable || config.${namespace}.desktop.gnome.enable || config.${namespace}.desktop.cosmic.enable; hasGui =
config.${namespace}.desktop.hyprland.enable
|| config.${namespace}.desktop.gnome.enable
|| config.${namespace}.desktop.cosmic.enable;
in in
{ {
security = { security = {
@@ -37,12 +46,15 @@ in
}; };
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages =
with pkgs;
[
age-plugin-yubikey age-plugin-yubikey
libsecret libsecret
yubikey-manager yubikey-manager
yubikey-personalization yubikey-personalization
] ++ (if hasGui then [ yubioath-flutter ] else [ ]); ]
++ (if hasGui then [ yubioath-flutter ] else [ ]);
services = { services = {
yubikey-agent.enable = true; yubikey-agent.enable = true;

View File

@@ -1,4 +1,9 @@
{ lib, pkgs, system, ... }: {
lib,
pkgs,
system,
...
}:
let let
isArm = "aarch64-linux" == system; isArm = "aarch64-linux" == system;
in in

View File

@@ -7,7 +7,6 @@
let let
name = "collabora"; name = "collabora";
cfg = config.${namespace}.services.${name}; cfg = config.${namespace}.services.${name};
jwtSecretFile = config.sops.secrets."jallen-nas/onlyoffice-key".path;
collaboraConfig = lib.${namespace}.mkModule { collaboraConfig = lib.${namespace}.mkModule {
inherit config name; inherit config name;

View File

@@ -0,0 +1,42 @@
{
lib,
config,
namespace,
...
}:
with lib;
let
name = "dispatcharr";
cfg = config.${namespace}.services.${name};
dispatcharrConfig = lib.${namespace}.mkModule {
inherit config name;
serviceName = "podman-${name}";
description = "dispatcharr podman container";
options = { };
moduleConfig = {
virtualisation.oci-containers.containers.${name} = {
autoStart = true;
image = "ghcr.io/dispatcharr/dispatcharr";
extraOptions = [ "--device=/dev/dri" ];
volumes = [
"${cfg.configDir}/dispatcharr:/data"
"${cfg.dataDir}/movies:/movies"
"${cfg.dataDir}/tv:/tv"
];
ports = [
"${toString cfg.port}:9191"
];
environment = {
DISPATCHARR_ENV = "aio";
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
};
};
};
};
in
{
imports = [ dispatcharrConfig ];
}

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }: {
config,
lib,
namespace,
...
}:
let let
name = "minecraft"; name = "minecraft";
cfg = config.${namespace}.services.${name}; cfg = config.${namespace}.services.${name};

View File

@@ -5,7 +5,6 @@
... ...
}: }:
let let
inherit (lib.${namespace}) mkOpt mkReverseProxyOpt;
name = "ntfy"; name = "ntfy";
cfg = config.${namespace}.services.${name}; cfg = config.${namespace}.services.${name};

View File

@@ -5,10 +5,8 @@
... ...
}: }:
let let
inherit (lib.${namespace}) mkOpt mkReverseProxyOpt; inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.services.onlyoffice; cfg = config.${namespace}.services.onlyoffice;
jwtSecretFile = config.sops.secrets."jallen-nas/onlyoffice-key".path;
in in
{ {
options.${namespace}.services.onlyoffice = with lib; { options.${namespace}.services.onlyoffice = with lib; {

View File

@@ -6,7 +6,6 @@
}: }:
with lib; with lib;
let let
inherit (lib.${namespace}) mkOpt mkReverseProxyOpt;
name = "unmanic"; name = "unmanic";
cfg = config.${namespace}.services.${name}; cfg = config.${namespace}.services.${name};

View File

@@ -1,13 +1,14 @@
{ inputs, self, ... }:
{ inputs, lib, self, ... }: final: _prev:
let
final: prev: let
cachyosPackages = final.callPackage ../../packages/linux-cachyos { cachyosPackages = final.callPackage ../../packages/linux-cachyos {
pkgs = final; pkgs = final;
nixpkgs = inputs.nixpkgs; nixpkgs = inputs.nixpkgs;
inherit self; inherit self;
}; };
in { in
{
# GCC Kernels # GCC Kernels
# Latest # Latest
linuxPackages_cachyos = cachyosPackages.cachyos-gcc; linuxPackages_cachyos = cachyosPackages.cachyos-gcc;

View File

@@ -1,4 +1,4 @@
{ lib, buildHomeAssistantComponent, fetchFromGitHub, ... }: { buildHomeAssistantComponent, fetchFromGitHub, ... }:
buildHomeAssistantComponent rec { buildHomeAssistantComponent rec {
owner = "jjjonesjr33"; owner = "jjjonesjr33";
domain = "petlibro"; domain = "petlibro";

View File

@@ -2,7 +2,7 @@
pkgs, pkgs,
self, self,
... ...
}@inputs: }:
let let
# Don't waste user's time. # Don't waste user's time.
markBroken = markBroken =

View File

@@ -130,7 +130,12 @@ let
# }); # });
kernel = callPackage ./kernel.nix { kernel = callPackage ./kernel.nix {
inherit cachyConfig pname stdenv kconfigToNix; inherit
cachyConfig
pname
stdenv
kconfigToNix
;
kernelPatches = [ ]; kernelPatches = [ ];
configfile = preparedConfigfile; configfile = preparedConfigfile;
config = linuxConfigTransfomed; config = linuxConfigTransfomed;
@@ -154,9 +159,7 @@ let
addOurs = finalAttrs: prevAttrs: { addOurs = finalAttrs: prevAttrs: {
kernel_configfile = prevAttrs.kernel.configfile; kernel_configfile = prevAttrs.kernel.configfile;
zfs_cachyos = zfs_cachyos =
(finalAttrs.callPackage "${nixpkgs}/pkgs/os-specific/linux/zfs/generic.nix" (finalAttrs.callPackage "${nixpkgs}/pkgs/os-specific/linux/zfs/generic.nix" zfsOverride {
zfsOverride
{
kernelModuleAttribute = "zfs_cachyos"; kernelModuleAttribute = "zfs_cachyos";
kernelMinSupportedMajorMinor = "1.0"; kernelMinSupportedMajorMinor = "1.0";
kernelMaxSupportedMajorMinor = "99.99"; kernelMaxSupportedMajorMinor = "99.99";
@@ -168,8 +171,7 @@ let
]; ];
hash = ""; hash = "";
extraPatches = [ ]; extraPatches = [ ];
} }).overrideAttrs
).overrideAttrs
(prevAttrs: { (prevAttrs: {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "cachyos"; owner = "cachyos";

View File

@@ -1,6 +1,6 @@
{ {
lib, lib,
python3Packages python3Packages,
}: }:
python3Packages.buildPythonPackage rec { python3Packages.buildPythonPackage rec {

View File

@@ -0,0 +1,99 @@
{
lib,
fetchFromGitHub,
ffmpeg,
ffmpegVariant ? "small",
withVoutEgl ? false,
libepoxy,
withV4l2Request ? true,
udev,
systemd,
withVoutDrm ? true,
stdenv ? null,
}:
let
extraVersion = "rpi";
# https://github.com/jc-kynesim/rpi-ffmpeg/tree/test/7.1.2/main
ffmpegVersion = "7.1.2";
rpiFfmpegSrc = fetchFromGitHub {
owner = "jc-kynesim";
repo = "rpi-ffmpeg";
# rev = "test/${ffmpegVersion}/main"; # this branch is being forced-push to
rev = "de943d66dab18e89fc10c74459bea1d787edc49d";
hash = "sha256-Qbgos7uzYXF5E557kR2EXhX9eJRmO0LVmSE2NOpEZY0=";
};
in
(ffmpeg.overrideAttrs (old: {
pname = old.pname + "-rpi";
doCheck = false; # disabled because `imgutils` test fails
# see also
# https://github.com/jc-kynesim/rpi-ffmpeg/blob/release/4.4/rpi_import_1/pi-util/conf_native.sh#L85
configureFlags =
old.configureFlags
++ [
"--extra-version=${extraVersion}"
"--enable-logging"
"--enable-asm"
]
++ [
"--disable-mmal"
"--enable-neon"
]
++ [
"--enable-sand"
]
++ lib.optionals withVoutEgl [
"--enable-epoxy"
"--enable-vout-egl" # rpi
]
++ lib.optionals withVoutDrm [
# when withV4l2
"--enable-vout-drm" # rpi
]
++ lib.optionals withV4l2Request [
"--enable-v4l2-request"
"--enable-libudev"
];
buildInputs =
old.buildInputs
++ lib.optionals withVoutEgl [
libepoxy.dev
]
++ lib.optionals withV4l2Request [
udev
systemd
];
})).override
{
version = ffmpegVersion;
source = rpiFfmpegSrc;
hash = rpiFfmpegSrc.hash;
# version = ffmpegVersion + "-rpi";
# source = rpiFfmpegSrc;
# hash = rpiFfmpegSrc.hash;
inherit ffmpegVariant;
withStripping = true;
withDocumentation = false;
withHtmlDoc = false;
withManPages = false;
# withV4l2 = true; # default on linux
# withDrm = true; # default on linux
withXlib = withVoutEgl; # for libepoxy
withVaapi = false;
# !!! keep this enabled, because some applications may need it
# for example, vlc 3.0.20: fails with 'undefined reference to
# `av_vdpau_get_surface_parameters'' otherwise
withVdpau = true;
}
# > configure flags: --disable-static --prefix=/nix/store/hksqdxfkpspl4bqhvzq88v46c5zlf1c9-ffmpeg-4.4-rpi --target_os=linux --arch=aarch64 --pkg-config=pkg-config --enable-gpl --enable-version3 --disable-nonfree --disable-static --enable-shared --enable-pic --disable-thumb --disable-small --enable-runtime-cpudetect --disable-gray --enable-swscale-alpha --enable-hardcoded-tables --enable-safe-bitstream-reader --enable-pthreads --disable-w32threads --disable-os2threads --enable-network --enable-pixelutils --datadir=/nix/store/k9hkfl02wlmms2czv8a56c3sfk0c1947-ffmpeg-4.4-rpi-data/share/ffmpeg --enable-ffmpeg --enable-ffplay --enable-ffprobe --bindir=/nix/store/xmgl25z6yh1166ykgf3srqhihdzx45ng-ffmpeg-4.4-rpi-bin/bin --enable-avcodec --enable-avdevice --enable-avfilter --enable-avformat --enable-avresample --enable-avutil --enable-postproc --enable-swresample --enable-swscale --libdir=/nix/store/sgxz7wifxfi3yk2706fjfn1ja418lz4l-ffmpeg-4.4-rpi-lib/lib --incdir=/nix/store/4i8zcixbngr553ajfsg7qxasy372j18s-ffmpeg-4.4-rpi-dev/include --disable-doc --disable-htmlpages --disable-manpages --enable-podpages --enable-txtpages --enable-alsa --disable-libaom --enable-libass --disable-libbluray --disable-libbs2b --enable-bzlib --disable-libcaca --disable-libcelt --disable-chromaprint --disable-cuda --disable-cuda-llvm --enable-libdav1d --disable-libdc1394 --enable-libdrm --disable-libfdk-aac --disable-libflite --enable-fontconfig --enable-libfontconfig --enable-libfreetype --disable-frei0r --disable-libfribidi --disable-libgme --enable-gnutls --disable-libgsm --enable-iconv --disable-libjack --disable-ladspa --enable-lzma --disable-libmfx --disable-libmodplug --enable-libmp3lame --disable-libmysofa --enable-cuvid --enable-nvdec --enable-nvenc --disable-openal --disable-opencl --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-opengl --disable-libopenh264 --disable-libopenjpeg --disable-libopenmpt --enable-libopus --enable-libpulse --disable-librav1e --disable-librtmp --disable-libsmbclient --enable-sdl2 --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --disable-librsvg --disable-libsvtav1 --disable-libtensorflow --enable-libtheora --enable-libv4l2 --enable-v4l2-m2m --disable-vaapi --disable-vdpau --disable-libvidstab --disable-libvmaf --disable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-vulkan --disable-libwebp --enable-libx264 --enable-libx265 --disable-libxavs --disable-libxcb --disable-libxcb-shape --disable-libxcb-shm --disable-libxcb-xfixes --enable-xlib --disable-libxml2 --enable-libxvid --enable-libzimg --enable-zlib --disable-libzmq --disable-debug --enable-optimizations --disable-extra-warnings --enable-stripping --extra-version=rpi --enable-logging --enable-asm --disable-mmal --enable-neon --disable-thumb --enable-sand --enable-epoxy --enable-vout-egl --enable-vout-drm --enable-v4l2-request --enable-libudev
# > ERROR: v4l2-request requires libudev

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
}:
stdenv.mkDerivation (_finalAttrs: {
pname = "libraspberrypi";
version = "unstable-2024-12-23";
src = fetchFromGitHub {
owner = "raspberrypi";
repo = "userland";
rev = "a54a0dbb2b8dcf9bafdddfc9a9374fb51d97e976";
hash = "sha256-Edca6nkykdXKFF5MGq6LeKirMLHTZBCbFWvHTNHMWJ4=";
};
nativeBuildInputs = [
cmake
pkg-config
];
cmakeFlags = [
# -DARM64=ON disables all targets that only build on 32-bit ARM; this allows
# the package to build on aarch64 and other architectures
"-DARM64=${if stdenv.hostPlatform.isAarch32 then "OFF" else "ON"}"
"-DVMCS_INSTALL_PREFIX=${placeholder "out"}"
(lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.10")
];
meta = with lib; {
description = "ARM side libraries for interfacing to Raspberry Pi GPU (deprecated as of 27.08.2025)";
homepage = "https://github.com/raspberrypi/userland";
license = licenses.bsd3;
platforms = [
"armv6l-linux"
"armv7l-linux"
"aarch64-linux"
"x86_64-linux"
];
maintainers = with maintainers; [
dezgeg
tkerber
];
};
})

View File

@@ -0,0 +1,39 @@
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/libraries/libraspberrypi/default.nix#L28
# because libraspberrypi is outdated and deprecated
{
lib,
stdenv,
fetchFromGitHub,
cmake,
dtc,
}:
stdenv.mkDerivation (_finalAttrs: {
pname = "raspberrypi-utils";
version = "unstable-2025-11-19";
src = fetchFromGitHub {
owner = "raspberrypi";
repo = "utils";
rev = "6e0779b1c552976e0da2374c0325a8c9c77b6010";
hash = "sha256-gzcQdchmYZ8NSGDnozUK3JgEQAO5b7GCOzQeRL0nDM8";
};
buildInputs = [
dtc # dtmerge depends on libfdt
];
nativeBuildInputs = [ cmake ];
meta = with lib; {
description = "A collection of scripts and simple applications for Raspberry Pi hardware";
homepage = "https://github.com/raspberrypi/utils";
license = licenses.bsd3;
platforms = [
"armv6l-linux"
"armv7l-linux"
"aarch64-linux"
];
maintainers = with maintainers; [ kazenyuk ];
};
})

View File

@@ -0,0 +1,88 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
bash,
gnugrep,
coreutils,
withCpuGovernorConfig ? false,
}:
stdenvNoCC.mkDerivation (_finalAttrs: {
pname = "raspberrypi-udev-rules";
version = "20251028";
# https://github.com/RPi-Distro/raspberrypi-sys-mods/tree/pios/trixie
src = fetchFromGitHub {
owner = "RPi-Distro";
repo = "raspberrypi-sys-mods";
rev = "147bccd7db1a32468fac69a89a05d6b93c6f1796";
hash = "sha256-+PWf3fy14Pb51ee8BueCnLR6OnUD3Htgd6r1321crhk=";
};
installPhase = ''
mkdir -p $out/lib/udev/rules.d
mkdir -p $out/lib/tmpfiles.d
# Note: Installing only explicitly listed rules
rules_usr_lib_src=usr/lib/udev/rules.d
declare -a rules_usr_lib=(
10-vc.rules
# disable until i know what to do with /usr/lib/raspberrypi-sys-mods/i2cprobe
# is it even still needed?
# 15-i2c-modprobe.rules
60-backlight.rules
60-dma-heap.rules
60-gpiochip4.rules
60-i2c-aliases.rules
${if withCpuGovernorConfig then "60-ondemand-governor.rules" else ""}
60-pico.rules
60-piolib.rules
61-drm.rules
70-microbit.rules
# doesn't seem to provide any value on nixos
# 80-noobs.rules
99-com.rules
)
tmpfiles_usr_lib_src=usr/lib/tmpfiles.d
declare -a tmpfiles_usr_lib=(
${if withCpuGovernorConfig then "raspberrypi-sys-mods-ondemand-governor.conf" else ""}
sys-kernel-debug.conf
)
for i in "''${rules_usr_lib[@]}"; do
install -vD "$rules_usr_lib_src/$i" $out/lib/udev/rules.d
done
for i in "''${tmpfiles_usr_lib[@]}"; do
install -vD "$tmpfiles_usr_lib_src/$i" $out/lib/tmpfiles.d
done
'';
fixupPhase = ''
for i in $out/{etc,lib}/udev/rules.d/*.rules; do
substituteInPlace $i \
--replace-quiet \"/bin/sh \"${bash}/bin/sh \
--replace-quiet \"/bin/grep \"${lib.getExe gnugrep} \
--replace-quiet \"/bin/chgrp \"${coreutils}/bin/chgrp \
--replace-quiet \"/bin/chmod \"${coreutils}/bin/chmod \
--replace-quiet /usr/bin/test ${coreutils}/bin/test
done
'';
meta = with lib; {
description = "A collection of Raspberry Pi-sourced system configuration files and associated scripts";
homepage = "https://github.com/RPi-Distro/raspberrypi-sys-mods/";
# https://github.com/RPi-Distro/raspberrypi-sys-mods/blob/master/debian/copyright
license = licenses.bsd3;
platforms = platforms.all;
# buildable by all, but will make sense only on these, obviously
# platforms = [ "aarch64-linux" "armv7l-linux" "armv6l-linux" ];
};
})

View File

@@ -1,5 +1,4 @@
{ {
config,
pkgs, pkgs,
... ...
}: }:
@@ -35,7 +34,8 @@
nix = { nix = {
linux-builder = { linux-builder = {
enable = true; enable = true;
config = ({ pkgs, ... }: config = (
{ ... }:
{ {
virtualisation.cores = 6; virtualisation.cores = 6;
environment.etc."ccache.conf".text = '' environment.etc."ccache.conf".text = ''
@@ -47,7 +47,8 @@
# "d /var/cache/ccache 0770 builder nixbld -" # "d /var/cache/ccache 0770 builder nixbld -"
"p+ /var/cache/ccache/ccache.conf - - - - /etc/ccache.conf" "p+ /var/cache/ccache/ccache.conf - - - - /etc/ccache.conf"
]; ];
}); }
);
}; };
}; };

View File

@@ -3,7 +3,6 @@
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). # https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ {
lib,
namespace, namespace,
... ...
}: }:

View File

@@ -1,4 +1,9 @@
{ config, lib, namespace, ... }: {
config,
lib,
namespace,
...
}:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) enabled disabled;
in in

View File

@@ -1,4 +1,4 @@
{ config, pkgs, ... }: { pkgs, ... }:
{ {
# Services configs # Services configs
services = { services = {

View File

@@ -16,7 +16,6 @@
# systems, # An attribute map of your defined hosts. # systems, # An attribute map of your defined hosts.
# All other arguments come from the system system. # All other arguments come from the system system.
config,
... ...
}: }:
{ {