Compare commits

4 Commits

Author SHA1 Message Date
mjallen18
ff469102ea manual_inherit 2026-04-05 19:10:23 -05:00
mjallen18
a363622659 useless_parens 2026-04-05 15:10:13 -05:00
mjallen18
07b1fc3618 empty_pattern 2026-04-05 14:49:16 -05:00
mjallen18
159ad4cb83 useless_has_attr 2026-04-05 14:29:24 -05:00
116 changed files with 349 additions and 493 deletions

View File

@@ -28,12 +28,13 @@ pre-commit-hooks-nix.lib.${pkgs.stdenv.hostPlatform.system}.run {
enable = true; enable = true;
package = pkgs.nixfmt; package = pkgs.nixfmt;
}; };
statix = { # statix disabled - too many false positives (manual_inherit warnings)
enable = true; # statix = {
args = [ # enable = true;
"--config" # args = [
(lib.snowfall.fs.get-file "statix.toml") # "--config"
]; # (lib.snowfall.fs.get-file "statix.toml")
}; # ];
# };
}; };
} }

View File

@@ -135,7 +135,7 @@ in
sops = { sops = {
secrets = { secrets = {
"protonmail-password" = { "protonmail-password" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/mac-secrets.yaml"); sopsFile = lib.snowfall.fs.get-file "secrets/mac-secrets.yaml";
}; };
}; };
}; };

View File

@@ -3,8 +3,9 @@
mjallen-lib = { mjallen-lib = {
module = import ./module { inherit inputs; }; module = import ./module { inherit inputs; };
file = import ./file { inherit inputs; }; file = import ./file { inherit inputs; };
inherit (inputs.nixpkgs) lib;
versioning = import ./versioning { versioning = import ./versioning {
lib = inputs.nixpkgs.lib; inherit (inputs.nixpkgs) lib;
inherit inputs; inherit inputs;
}; };
}; };

View File

@@ -1,7 +1,7 @@
{ inputs, ... }@args: { inputs, ... }@args:
let let
# Get self from args or default to ../.. (the flake root) # Get self from args or default to ../.. (the flake root)
self = if args ? self then args.self else ../..; self = args.self or ../..;
inherit (inputs.nixpkgs.lib) inherit (inputs.nixpkgs.lib)
genAttrs genAttrs

View File

@@ -91,8 +91,7 @@ rec {
]; ];
}; };
redis.servers.${name} = lib.mkIf cfg.redis.enable { redis.servers.${name} = lib.mkIf cfg.redis.enable {
enable = true; inherit (cfg.redis) enable port;
port = cfg.redis.port;
}; };
}; };
}; };
@@ -149,8 +148,9 @@ rec {
reverseProxy = mkReverseProxyOpt name; reverseProxy = mkReverseProxyOpt name;
hostedService = { hostedService = {
enable = mkOpt types.bool (cfg.reverseProxy.enable enable =
) "Expose this service in Glance dashboard (auto-enabled when reverseProxy is on)"; mkOpt types.bool cfg.reverseProxy.enable
"Expose this service in Glance dashboard (auto-enabled when reverseProxy is on)";
title = mkOpt types.str name "Display title in Glance"; title = mkOpt types.str name "Display title in Glance";
icon = mkOpt types.str "si:glance" "Icon identifier for Glance (e.g. si:actualbudget)"; icon = mkOpt types.str "si:glance" "Icon identifier for Glance (e.g. si:actualbudget)";
group = mkOpt types.str "Services" "Glance group/category for this service"; group = mkOpt types.str "Services" "Glance group/category for this service";
@@ -254,7 +254,7 @@ rec {
owner ? "nix-apps", owner ? "nix-apps",
group ? "jallen-nas", group ? "jallen-nas",
mode ? "660", mode ? "660",
sopsFile ? (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml"), sopsFile ? lib.snowfall.fs.get-file "secrets/nas-secrets.yaml",
}: }:
{ {
sops.secrets = mapAttrs (_key: extra: { inherit sopsFile; } // extra) secrets; sops.secrets = mapAttrs (_key: extra: { inherit sopsFile; } // extra) secrets;

View File

@@ -18,7 +18,6 @@
# #
# All attributes intentionally use plain strings / ints so they can be # All attributes intentionally use plain strings / ints so they can be
# interpolated with `toString` or used directly in any context. # interpolated with `toString` or used directly in any context.
{ ... }:
{ {
network = { network = {
# ----------------------------------------------------------------------- # -----------------------------------------------------------------------

View File

@@ -9,12 +9,9 @@ let
hasAttr hasAttr
getAttr getAttr
attrNames attrNames
toString
replaceStrings replaceStrings
; ;
inherit (lib) mapAttrs recursiveUpdate;
mapAttrs = lib.mapAttrs;
recursiveUpdate = lib.recursiveUpdate;
# Deep-merge attrsets (right-biased). # Deep-merge attrsets (right-biased).
deepMerge = a: b: recursiveUpdate a b; deepMerge = a: b: recursiveUpdate a b;
@@ -31,8 +28,8 @@ let
applyVariantOnce = applyVariantOnce =
selected: variant: selected: variant:
let let
vVars = if variant ? variables then variant.variables else { }; vVars = variant.variables or { };
vSrcs = if variant ? sources then variant.sources else { }; vSrcs = variant.sources or { };
in in
{ {
variables = selected.variables // vVars; variables = selected.variables // vVars;
@@ -47,8 +44,8 @@ let
else else
let let
p = variant.platforms.${system}; p = variant.platforms.${system};
pVars = if p ? variables then p.variables else { }; pVars = p.variables or { };
pSrcs = if p ? sources then p.sources else { }; pSrcs = p.sources or { };
in in
{ {
variables = selected.variables // pVars; variables = selected.variables // pVars;
@@ -93,49 +90,44 @@ let
mkSrcFromRendered' = mkSrcFromRendered' =
pkgs': comp: pkgs': comp:
let let
fetcher = if comp ? fetcher then comp.fetcher else "none"; fetcher = comp.fetcher or "none";
in in
if fetcher == "github" then if fetcher == "github" then
pkgs'.fetchFromGitHub ( pkgs'.fetchFromGitHub (
{ {
owner = comp.owner; inherit (comp) owner repo hash;
repo = comp.repo;
# Allow tag as rev (ignore null/empty tag) # Allow tag as rev (ignore null/empty tag)
rev = if comp ? tag && comp.tag != null && comp.tag != "" then comp.tag else comp.rev; rev = if comp ? tag && comp.tag != null && comp.tag != "" then comp.tag else comp.rev;
fetchSubmodules = if comp ? submodules then comp.submodules else false; fetchSubmodules = comp.submodules or false;
hash = comp.hash;
} }
// lib.optionalAttrs (comp ? name) { name = comp.name; } // lib.optionalAttrs (comp ? name) { inherit (comp) name; }
) )
else if fetcher == "git" then else if fetcher == "git" then
pkgs'.fetchgit { pkgs'.fetchgit {
url = comp.url; inherit (comp) url rev hash;
rev = comp.rev; fetchSubmodules = comp.submodules or false;
fetchSubmodules = if comp ? submodules then comp.submodules else false;
hash = comp.hash;
} }
else if fetcher == "url" then else if fetcher == "url" then
let let
url = if comp ? url then comp.url else comp.urlTemplate; url = comp.url or comp.urlTemplate;
in in
if useFetchZip comp then if useFetchZip comp then
pkgs'.fetchzip ( pkgs'.fetchzip (
{ {
inherit (comp) hash;
inherit url; inherit url;
hash = comp.hash;
} }
// lib.optionalAttrs (comp ? extra && comp.extra ? stripRoot) { stripRoot = comp.extra.stripRoot; } // lib.optionalAttrs (comp ? extra && comp.extra ? stripRoot) { inherit (comp.extra) stripRoot; }
) )
else else
pkgs'.fetchurl { pkgs'.fetchurl {
inherit (comp) hash;
inherit url; inherit url;
hash = comp.hash;
} }
else if fetcher == "pypi" then else if fetcher == "pypi" then
pkgs'.python3Packages.fetchPypi { pkgs'.python3Packages.fetchPypi {
inherit (comp) version hash;
pname = comp.name; pname = comp.name;
version = comp.version;
hash = comp.hash;
} }
else else
# fetcher == "none": pass-through (e.g., linux version/hash consumed by custom logic) # fetcher == "none": pass-through (e.g., linux version/hash consumed by custom logic)
@@ -155,14 +147,10 @@ rec {
selectVariant = selectVariant =
spec: variantName: system: spec: variantName: system:
let let
chosen = chosen = if variantName != null then variantName else (spec.defaultVariant or null);
if variantName != null then
variantName
else
(if spec ? defaultVariant then spec.defaultVariant else null);
baseSelected = { baseSelected = {
variables = if spec ? variables then spec.variables else { }; variables = spec.variables or { };
sources = if spec ? sources then spec.sources else { }; sources = spec.sources or { };
}; };
in in
resolveVariant spec baseSelected chosen system; resolveVariant spec baseSelected chosen system;

View File

@@ -4,13 +4,15 @@
... ...
}: }:
let let
nixSettings = lib.${namespace}.nixSettings; inherit (lib.${namespace}) nixSettings;
in in
{ {
nix = { nix = {
settings = nixSettings.commonSettings // { settings = nixSettings.commonSettings // {
substituters = nixSettings.commonSubstituters; inherit (nixSettings)
trusted-public-keys = nixSettings.commonTrustedPublicKeys; commonSubstituters
commonTrustedPublicKeys
;
}; };
gc = nixSettings.commonGc; gc = nixSettings.commonGc;

View File

@@ -57,7 +57,7 @@ in
wget wget
] ]
++ ( ++ (
if (hasDestopEnvironment) then if hasDestopEnvironment then
[ [
boxbuddy boxbuddy
cider-2 cider-2

View File

@@ -1,4 +1,3 @@
{ ... }:
let let
gitAliases = { gitAliases = {
co = "checkout"; co = "checkout";

View File

@@ -313,6 +313,7 @@ in
secondMonitor = if builtins.length names > 1 then builtins.elemAt names 1 else firstMonitor; secondMonitor = if builtins.length names > 1 then builtins.elemAt names 1 else firstMonitor;
in in
{ {
inherit (cfg) workspace;
"$mod" = cfg.modKey; "$mod" = cfg.modKey;
# Mouse # Mouse
@@ -513,8 +514,6 @@ in
preserve_split = "yes"; preserve_split = "yes";
}; };
workspace = cfg.workspace;
windowrule = [ windowrule = [
"match:title file_progress, float 1" "match:title file_progress, float 1"
"match:title .*[Cc]onfirm.*, float 1" "match:title .*[Cc]onfirm.*, float 1"

View File

@@ -1,4 +1,3 @@
{ ... }:
{ {
programs.librewolf = { programs.librewolf = {
enable = false; enable = false;

View File

@@ -1,4 +1,3 @@
{ ... }:
{ {
# The default value of `programs.password-store.settings` has changed from `{ PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; }` to `{ }`. # The default value of `programs.password-store.settings` has changed from `{ PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; }` to `{ }`.
# You are currently using the legacy default (`{ PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; }`) because `home.stateVersion` is less than "25.11". # You are currently using the legacy default (`{ PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; }`) because `home.stateVersion` is less than "25.11".

View File

@@ -294,10 +294,10 @@ in
systemd.enable = true; systemd.enable = true;
settings = { settings = {
mainBar = ( mainBar =
(mkMerge [ (mkMerge [
{ {
layer = cfg.layer; inherit (cfg) layer;
position = "top"; position = "top";
mod = "dock"; mod = "dock";
exclusive = true; exclusive = true;
@@ -342,7 +342,7 @@ in
}; };
network = { network = {
interface = cfg.network.interface; inherit (cfg.network) interface;
on-click = "nm-connection-editor"; on-click = "nm-connection-editor";
format = "{icon}"; format = "{icon}";
tooltip-format = "{ifname} via {gwaddr} 󰊗"; tooltip-format = "{ifname} via {gwaddr} 󰊗";
@@ -589,8 +589,7 @@ in
}; };
}) })
]) ])
// cfg.extra.settings // cfg.extra.settings;
);
} }
// cfg.extraModules; # keep legacy top-level extra modules for compatibility // cfg.extraModules; # keep legacy top-level extra modules for compatibility

View File

@@ -1,4 +1,3 @@
{ ... }:
let let
defaultShellAliases = { defaultShellAliases = {
l = "ls -alh"; l = "ls -alh";

View File

@@ -1,6 +1,3 @@
{
...
}:
{ {
#services.gnome-keyring.enable = false; #services.gnome-keyring.enable = false;
#home.packages = [ pkgs.gcr ]; #home.packages = [ pkgs.gcr ];

View File

@@ -35,17 +35,17 @@ in
description = "The full name of the user."; description = "The full name of the user.";
}; };
home = mkOption { home = mkOption {
type = (types.nullOr types.str); type = types.nullOr types.str;
default = home-directory; default = home-directory;
description = "The user's home directory."; description = "The user's home directory.";
}; };
icon = mkOption { icon = mkOption {
type = (types.nullOr types.package); type = types.nullOr types.package;
default = null; default = null;
description = "The profile picture to use for the user. Set to a package whose output is the icon file (e.g. a derivation producing a PNG)."; description = "The profile picture to use for the user. Set to a package whose output is the icon file (e.g. a derivation producing a PNG).";
}; };
name = mkOption { name = mkOption {
type = (types.nullOr types.str); type = types.nullOr types.str;
default = "matt"; default = "matt";
description = "The user account."; description = "The user account.";
}; };

View File

@@ -62,7 +62,7 @@ in
bcachefs.package = lib.mkOverride 90 pkgs.${namespace}.bcachefs; bcachefs.package = lib.mkOverride 90 pkgs.${namespace}.bcachefs;
consoleLogLevel = lib.mkDefault 0; consoleLogLevel = lib.mkDefault 0;
bootspec.enable = (!isArm); bootspec.enable = !isArm;
initrd = { initrd = {
verbose = lib.mkDefault false; verbose = lib.mkDefault false;

View File

@@ -32,7 +32,7 @@ in
}; };
}; };
lanzaboote = { lanzaboote = {
enable = cfg.enable; enable = true;
pkiBundle = "/etc/secureboot"; pkiBundle = "/etc/secureboot";
settings = { settings = {
console-mode = "max"; console-mode = "max";

View File

@@ -15,11 +15,11 @@ in
# and provide the hyprctl hot-reload command so hyprpaper picks up the new image. # and provide the hyprctl hot-reload command so hyprpaper picks up the new image.
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
${namespace}.wallpaper = { ${namespace}.wallpaper = {
inherit (cfg) defaultWallpaper;
enable = true; enable = true;
source = cfg.wallpaperSource; source = cfg.wallpaperSource;
path = cfg.wallpaper; path = cfg.wallpaper;
dir = cfg.wallpaperDir; dir = cfg.wallpaperDir;
defaultWallpaper = cfg.defaultWallpaper;
reloadCommand = "${lib.getExe' pkgs.hyprland "hyprctl"} hyprpaper wallpaper ,${cfg.wallpaper},"; reloadCommand = "${lib.getExe' pkgs.hyprland "hyprctl"} hyprpaper wallpaper ,${cfg.wallpaper},";
}; };
}; };

View File

@@ -46,7 +46,7 @@ in
}; };
programs.corectrl = { programs.corectrl = {
enable = cfg.corectrl.enable; inherit (cfg.corectrl) enable;
package = pkgs.corectrl; package = pkgs.corectrl;
}; };

View File

@@ -53,7 +53,7 @@ in
# Enable the Nvidia settings menu, # Enable the Nvidia settings menu,
# accessible via `nvidia-settings`. # accessible via `nvidia-settings`.
nvidiaSettings = cfg.nvidiaSettings; inherit (cfg) nvidiaSettings;
}; };
}; };

View File

@@ -16,7 +16,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
hardware.deviceTree = { hardware.deviceTree = {
overlays = ( overlays =
with pkgs.${namespace}; with pkgs.${namespace};
( (
if (variant == "5") then if (variant == "5") then
@@ -33,8 +33,7 @@ in
dtsFile = "${raspberrypi-overlays}/dtbs/raspberrypi-overlays/pisound-overlay.dts"; dtsFile = "${raspberrypi-overlays}/dtbs/raspberrypi-overlays/pisound-overlay.dts";
} }
] ]
) );
);
}; };
}; };
} }

View File

@@ -7,7 +7,7 @@
}: }:
let let
cfg = config.${namespace}.hardware.raspberry-pi.disable-bluetooth; cfg = config.${namespace}.hardware.raspberry-pi.disable-bluetooth;
variant = config.${namespace}.hardware.raspberry-pi.variant; inherit (config.${namespace}.hardware.raspberry-pi) variant;
in in
{ {
options.${namespace}.hardware.raspberry-pi.disable-bluetooth = { options.${namespace}.hardware.raspberry-pi.disable-bluetooth = {
@@ -16,7 +16,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
hardware.deviceTree = { hardware.deviceTree = {
overlays = ( overlays =
if (variant == "5") then if (variant == "5") then
[ [
{ {
@@ -34,8 +34,7 @@ in
pkgs.${namespace}.raspberrypi-overlays pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-bt-overlay.dts"; }/dtbs/raspberrypi-overlays/disable-bt-overlay.dts";
} }
] ];
);
}; };
}; };
} }

View File

@@ -15,7 +15,7 @@ let
# installs raspberry's firmware independent of the nixos generations # installs raspberry's firmware independent of the nixos generations
# sometimes referred to as "boot code" # sometimes referred to as "boot code"
raspberryPiFirmware = ( raspberryPiFirmware =
{ {
pkgs, pkgs,
firmware, firmware,
@@ -33,10 +33,9 @@ let
inherit firmware configTxt; inherit firmware configTxt;
}; };
} };
);
kernelbootGenBuilder = ( kernelbootGenBuilder =
{ {
pkgs, pkgs,
deviceTreeInstaller, deviceTreeInstaller,
@@ -53,10 +52,9 @@ let
installDeviceTree = deviceTreeInstaller; installDeviceTree = deviceTreeInstaller;
}; };
} };
);
deviceTree = ( deviceTree =
{ {
pkgs, pkgs,
firmware, firmware,
@@ -73,8 +71,7 @@ let
inherit firmware; inherit firmware;
}; };
} };
);
mkBootloader = mkBootloader =
pkgs: pkgs:
@@ -113,7 +110,7 @@ let
}; };
bootloader = ( bootloader =
{ {
pkgs, pkgs,
nixosGenerationsDir, nixosGenerationsDir,
@@ -136,28 +133,25 @@ let
# NixOS-generations -dependent # NixOS-generations -dependent
inherit nixosGenerationsDir nixosGenBuilder; inherit nixosGenerationsDir nixosGenBuilder;
}; };
} };
);
# Builders used to write during system activation # Builders used to write during system activation
ubootBuilder = import ./uboot-builder.nix { ubootBuilder = import ./uboot-builder.nix {
inherit pkgs; inherit pkgs;
ubootPackage = ( ubootPackage =
if (cfg.variant == "5") then pkgs.${namespace}.uboot-pi5 else pkgs.${namespace}.uboot-pi4 if (cfg.variant == "5") then pkgs.${namespace}.uboot-pi5 else pkgs.${namespace}.uboot-pi4;
);
firmwareBuilder = firmwarePopulateCmd; firmwareBuilder = firmwarePopulateCmd;
extlinuxConfBuilder = config.boot.loader.generic-extlinux-compatible.populateCmd; extlinuxConfBuilder = config.boot.loader.generic-extlinux-compatible.populateCmd;
}; };
uefiBuilder = import ./uefi-builder.nix { uefiBuilder = import ./uefi-builder.nix {
inherit pkgs; inherit pkgs;
uefiPackage = ( uefiPackage =
if (cfg.variant == "5") then if (cfg.variant == "5") then
pkgs.${namespace}.uefi-rpi5 pkgs.${namespace}.uefi-rpi5
else else
pkgs.${namespace}.edk2.override { MODEL = "4"; } pkgs.${namespace}.edk2.override { MODEL = "4"; };
);
firmwareBuilder = firmwarePopulateCmd; firmwareBuilder = firmwarePopulateCmd;
}; };
@@ -297,14 +291,16 @@ in
enable = lib.mkDefault (if cfg.bootType == "uefi" then false else true); enable = lib.mkDefault (if cfg.bootType == "uefi" then false else true);
useGenerationDeviceTree = lib.mkOverride 60 (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 = {
systemd-boot.extraInstallCommands = enable = if cfg.bootType == "uefi" then true else false;
let extraInstallCommands =
bootloaderInstaller = (builder."${cfg.bootType}"); let
in bootloaderInstaller = builder."${cfg.bootType}";
'' in
${bootloaderInstaller} -f /boot/firmware -b /boot -c ''
''; ${bootloaderInstaller} -f /boot/firmware -b /boot -c
'';
};
grub.enable = lib.mkForce false; grub.enable = lib.mkForce false;
}; };
}; };
@@ -350,14 +346,13 @@ in
}; };
kernel = lib.mkIf (cfg.bootType == "kernel" || cfg.bootType == "uboot") { kernel = lib.mkIf (cfg.bootType == "kernel" || cfg.bootType == "uboot") {
enable = true; enable = true;
value = ( value =
if cfg.bootType == "uboot" then if cfg.bootType == "uboot" then
"u-boot.bin" "u-boot.bin"
else if cfg.bootType == "kernel" then else if cfg.bootType == "kernel" then
"kernel.img" "kernel.img"
else else
"" "";
);
}; };
}; };
}; };

View File

@@ -7,7 +7,7 @@
}: }:
let let
cfg = config.${namespace}.hardware.raspberry-pi.i2c; cfg = config.${namespace}.hardware.raspberry-pi.i2c;
variant = config.${namespace}.hardware.raspberry-pi.variant; inherit (config.${namespace}.hardware.raspberry-pi) variant;
in in
{ {
options.${namespace}.hardware.raspberry-pi.i2c = { options.${namespace}.hardware.raspberry-pi.i2c = {
@@ -16,7 +16,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
hardware.deviceTree = { hardware.deviceTree = {
overlays = ( overlays =
if (variant == "5") then if (variant == "5") then
[ [
{ {
@@ -70,8 +70,7 @@ in
name = "i2c6-overlay"; name = "i2c6-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c6-overlay.dts"; dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/i2c6-overlay.dts";
} }
] ];
);
}; };
}; };
} }

View File

@@ -16,7 +16,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
hardware.deviceTree = { hardware.deviceTree = {
overlays = ( overlays =
if (variant == "5") then if (variant == "5") then
[ [
{ {
@@ -34,8 +34,7 @@ in
pkgs.${namespace}.raspberrypi-overlays pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/vc4-fkms-v3d-pi4-overlay.dts"; }/dtbs/raspberrypi-overlays/vc4-fkms-v3d-pi4-overlay.dts";
} }
] ];
);
}; };
}; };
} }

View File

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

View File

@@ -16,7 +16,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
hardware.deviceTree = { hardware.deviceTree = {
overlays = ( overlays =
if (variant == "5") then if (variant == "5") then
[ [
{ {
@@ -38,8 +38,7 @@ in
name = "wifimac-overlay"; name = "wifimac-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/wifimac-overlay.dts"; dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/wifimac-overlay.dts";
} }
] ];
);
}; };
}; };
} }

View File

@@ -13,13 +13,13 @@ in
sops = { sops = {
secrets = { secrets = {
"jallen-nas/govee2mqtt/govee-email" = { "jallen-nas/govee2mqtt/govee-email" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml"); sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
}; };
"jallen-nas/govee2mqtt/govee-password" = { "jallen-nas/govee2mqtt/govee-password" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml"); sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
}; };
"jallen-nas/govee2mqtt/govee-api" = { "jallen-nas/govee2mqtt/govee-api" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml"); sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
}; };
}; };
templates = { templates = {

View File

@@ -32,15 +32,13 @@ in
sops = { sops = {
secrets = { secrets = {
"home-assistant/auth-client-id" = { "home-assistant/auth-client-id" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nuc-secrets.yaml"); sopsFile = lib.snowfall.fs.get-file "secrets/nuc-secrets.yaml";
owner = config.users.users.hass.name; inherit (config.users.users.hass) name group;
group = config.users.users.hass.group;
restartUnits = [ "home-assistant.service" ]; restartUnits = [ "home-assistant.service" ];
}; };
"home-assistant/auth-client-secret" = { "home-assistant/auth-client-secret" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nuc-secrets.yaml"); sopsFile = lib.snowfall.fs.get-file "secrets/nuc-secrets.yaml";
owner = config.users.users.hass.name; inherit (config.users.users.hass) name group;
group = config.users.users.hass.group;
restartUnits = [ "home-assistant.service" ]; restartUnits = [ "home-assistant.service" ];
}; };
}; };

View File

@@ -27,11 +27,11 @@ let
backboneInterface = "enp2s0"; backboneInterface = "enp2s0";
package = otbrPackage; package = otbrPackage;
rest = { rest = {
listenAddress = cfg.listenAddress; inherit (cfg) listenAddress;
listenPort = cfg.restPort; listenPort = cfg.restPort;
}; };
web = { web = {
listenAddress = cfg.listenAddress; inherit (cfg) listenAddress;
listenPort = cfg.port; listenPort = cfg.port;
}; };
radio = { radio = {

View File

@@ -15,24 +15,20 @@ let
name: profile: name: profile:
nameValuePair "${name}" { nameValuePair "${name}" {
connection = { connection = {
inherit (profile) type autoconnect autoconnect-retries;
id = name; id = name;
type = profile.type;
autoconnect = profile.autoconnect;
autoconnect-retries = profile.autoconnect-retries;
autoconnect-priority = profile.priority; autoconnect-priority = profile.priority;
interface-name = profile.interface or cfg.ipv4.interface; interface-name = profile.interface or cfg.ipv4.interface;
}; };
ipv4 = { ipv4 = {
method = cfg.ipv4.method; inherit (cfg.ipv4) method;
} }
// ( // (
if (cfg.ipv4.method == "auto") then if (cfg.ipv4.method == "auto") then
{ } { }
else else
{ {
address = cfg.ipv4.address; inherit (cfg.ipv4) address gateway dns;
gateway = cfg.ipv4.gateway;
dns = cfg.ipv4.dns;
} }
); );
ipv6 = { ipv6 = {
@@ -40,13 +36,13 @@ let
method = "auto"; method = "auto";
}; };
wifi = mkIf (profile.type == "wifi") { wifi = mkIf (profile.type == "wifi") {
inherit (profile) ssid;
mode = "infrastructure"; mode = "infrastructure";
ssid = profile.ssid;
roaming = "allowed"; roaming = "allowed";
}; };
wifi-security = mkIf (profile.type == "wifi") { wifi-security = mkIf (profile.type == "wifi") {
inherit (profile) psk;
key-mgmt = profile.keyMgmt; key-mgmt = profile.keyMgmt;
psk = profile.psk;
}; };
}; };
@@ -65,10 +61,8 @@ let
interface-name = cfg.ipv4.interface; interface-name = cfg.ipv4.interface;
}; };
ipv4 = { ipv4 = {
inherit (cfg.ipv4) address gateway dns;
method = "manual"; method = "manual";
address = cfg.ipv4.address;
gateway = cfg.ipv4.gateway;
dns = cfg.ipv4.dns;
}; };
ipv6 = { ipv6 = {
addr-gen-mode = "stable-privacy"; addr-gen-mode = "stable-privacy";
@@ -149,31 +143,29 @@ in
# Configure NAT if enabled # Configure NAT if enabled
nat = lib.mkIf cfg.nat.enable { nat = lib.mkIf cfg.nat.enable {
inherit (cfg.nat) internalInterfaces externalInterface enableIPv6;
enable = true; enable = true;
internalInterfaces = cfg.nat.internalInterfaces;
externalInterface = cfg.nat.externalInterface;
enableIPv6 = cfg.nat.enableIPv6;
}; };
# Configure firewall # Configure firewall
firewall = { firewall = {
enable = cfg.firewall.enable; inherit (cfg.firewall)
allowPing = cfg.firewall.allowPing; enable
allowedTCPPorts = cfg.firewall.allowedTCPPorts; allowPing
allowedUDPPorts = cfg.firewall.allowedUDPPorts; allowedTCPPorts
trustedInterfaces = cfg.firewall.trustedInterfaces; allowedUDPPorts
trustedInterfaces
;
# Default port ranges for KDE Connect # Default port ranges for KDE Connect
allowedTCPPortRanges = lib.mkIf cfg.firewall.kdeConnect.enable [ allowedTCPPortRanges = lib.mkIf cfg.firewall.kdeConnect.enable [
{ {
from = cfg.firewall.kdeConnect.tcpRange.from; inherit (cfg.firewall.kdeConnect.tcpRange) from to;
to = cfg.firewall.kdeConnect.tcpRange.to;
} }
]; ];
allowedUDPPortRanges = lib.mkIf cfg.firewall.kdeConnect.enable [ allowedUDPPortRanges = lib.mkIf cfg.firewall.kdeConnect.enable [
{ {
from = cfg.firewall.kdeConnect.udpRange.from; inherit (cfg.firewall.kdeConnect.udpRange) from to;
to = cfg.firewall.kdeConnect.udpRange.to;
} }
]; ];
@@ -185,14 +177,16 @@ in
# When iwd is enabled alongside NetworkManager, iwd acts as the WiFi # When iwd is enabled alongside NetworkManager, iwd acts as the WiFi
# backend for NM (iwd handles scanning/association; NM handles # backend for NM (iwd handles scanning/association; NM handles
# connection management). They are not mutually exclusive. # connection management). They are not mutually exclusive.
wireless.iwd = lib.mkIf cfg.iwd.enable { wireless.iwd = {
enable = true; inherit (cfg.iwd)
settings = cfg.iwd.settings; enable
settings
;
}; };
# Configure NetworkManager when enabled # Configure NetworkManager when enabled
networkmanager = mkIf cfg.networkmanager.enable { networkmanager = {
enable = true; inherit (cfg.networkmanager) enable;
# Use iwd as the WiFi backend when iwd is also enabled # Use iwd as the WiFi backend when iwd is also enabled
wifi.backend = mkIf cfg.iwd.enable "iwd"; wifi.backend = mkIf cfg.iwd.enable "iwd";
wifi.powersave = cfg.networkmanager.powersave; wifi.powersave = cfg.networkmanager.powersave;
@@ -211,7 +205,7 @@ in
# Configure profiles if any are defined # Configure profiles if any are defined
ensureProfiles = mkIf (profiles != { }) { ensureProfiles = mkIf (profiles != { }) {
environmentFiles = lib.optional (config.sops.secrets ? wifi) config.sops.secrets.wifi.path; environmentFiles = lib.optional (config.sops.secrets ? wifi) config.sops.secrets.wifi.path;
profiles = profiles; inherit profiles;
}; };
}; };
}; };

View File

@@ -5,7 +5,7 @@
... ...
}: }:
let let
nixSettings = lib.${namespace}.nixSettings; inherit (lib.${namespace}) nixSettings;
in in
{ {
nix = { nix = {

View File

@@ -16,11 +16,11 @@ let
options = { }; options = { };
moduleConfig = { moduleConfig = {
services.actual = { services.actual = {
inherit (cfg) openFirewall;
enable = true; enable = true;
openFirewall = cfg.openFirewall;
settings = { settings = {
inherit (cfg) port;
trustedProxies = [ config.${namespace}.network.ipv4.address ]; trustedProxies = [ config.${namespace}.network.ipv4.address ];
port = cfg.port;
serverFiles = "${cfg.configDir}/${name}/server-files"; serverFiles = "${cfg.configDir}/${name}/server-files";
userFiles = "${cfg.configDir}/${name}/user-files"; userFiles = "${cfg.configDir}/${name}/user-files";
dataDir = "${cfg.configDir}/${name}"; dataDir = "${cfg.configDir}/${name}";

View File

@@ -39,23 +39,23 @@ let
moduleConfig = { moduleConfig = {
services = { services = {
ollama = { ollama = {
inherit (cfg) openFirewall;
enable = true; enable = true;
package = pkgs.ollama-rocm; package = pkgs.ollama-rocm;
port = 11434; port = 11434;
host = "0.0.0.0"; host = "0.0.0.0";
user = "nix-apps"; user = "nix-apps";
group = "jallen-nas"; group = "jallen-nas";
openFirewall = cfg.openFirewall;
rocmOverrideGfx = "11.0.2"; rocmOverrideGfx = "11.0.2";
loadModels = [ ]; loadModels = [ ];
home = "${cfg.configDir}/ollama"; home = "${cfg.configDir}/ollama";
}; };
llama-cpp = { llama-cpp = {
inherit (cfg) openFirewall;
enable = true; enable = true;
port = 8127; port = 8127;
host = "0.0.0.0"; host = "0.0.0.0";
openFirewall = cfg.openFirewall;
model = "${cfg.configDir}/llama-cpp/models/${cfg.llama-cpp.model}.gguf"; model = "${cfg.configDir}/llama-cpp/models/${cfg.llama-cpp.model}.gguf";
package = inputs.llama-cpp.packages.${system}.rocm; package = inputs.llama-cpp.packages.${system}.rocm;
extraFlags = [ extraFlags = [
@@ -87,11 +87,11 @@ let
}; };
open-webui = { open-webui = {
inherit (cfg) openFirewall;
enable = true; enable = true;
package = pkgs.open-webui; package = pkgs.open-webui;
host = "0.0.0.0"; host = "0.0.0.0";
port = 8888; port = 8888;
openFirewall = cfg.openFirewall;
environmentFile = config.sops.secrets."jallen-nas/open-webui".path; environmentFile = config.sops.secrets."jallen-nas/open-webui".path;
environment = { environment = {
OPENID_PROVIDER_URL = "https://authentik.mjallen.dev/application/o/chat/.well-known/openid-configuration"; OPENID_PROVIDER_URL = "https://authentik.mjallen.dev/application/o/chat/.well-known/openid-configuration";

View File

@@ -18,19 +18,19 @@ let
sops = { sops = {
secrets = { secrets = {
"jallen-nas/sabnzbd/password" = { "jallen-nas/sabnzbd/password" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml"); sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
}; };
"jallen-nas/sabnzbd/api-key" = { "jallen-nas/sabnzbd/api-key" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml"); sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
}; };
"jallen-nas/sabnzbd/nzb-key" = { "jallen-nas/sabnzbd/nzb-key" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml"); sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
}; };
"jallen-nas/sabnzbd/server/username" = { "jallen-nas/sabnzbd/server/username" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml"); sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
}; };
"jallen-nas/sabnzbd/server/password" = { "jallen-nas/sabnzbd/server/password" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml"); sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
}; };
}; };
templates = { templates = {
@@ -56,8 +56,8 @@ let
# Enable radarr service # Enable radarr service
services = { services = {
radarr = { radarr = {
inherit (cfg) openFirewall;
enable = true; enable = true;
openFirewall = cfg.openFirewall;
user = "nix-apps"; user = "nix-apps";
group = "jallen-nas"; group = "jallen-nas";
dataDir = "${cfg.configDir}/radarr"; dataDir = "${cfg.configDir}/radarr";
@@ -65,8 +65,8 @@ let
# Enable Sonarr service # Enable Sonarr service
sonarr = { sonarr = {
inherit (cfg) openFirewall;
enable = true; enable = true;
openFirewall = cfg.openFirewall;
user = "nix-apps"; user = "nix-apps";
group = "jallen-nas"; group = "jallen-nas";
dataDir = "${cfg.configDir}/sonarr"; dataDir = "${cfg.configDir}/sonarr";
@@ -74,8 +74,8 @@ let
}; };
lidarr = { lidarr = {
inherit (cfg) openFirewall;
enable = true; enable = true;
openFirewall = cfg.openFirewall;
user = "nix-apps"; user = "nix-apps";
group = "jallen-nas"; group = "jallen-nas";
dataDir = "${cfg.configDir}/lidarr"; dataDir = "${cfg.configDir}/lidarr";
@@ -172,23 +172,22 @@ let
}; };
deluge = { deluge = {
inherit (cfg) openFirewall dataDir;
enable = false; enable = false;
user = "nix-apps"; user = "nix-apps";
group = "jallen-nas"; group = "jallen-nas";
openFirewall = cfg.openFirewall;
dataDir = cfg.dataDir;
web = { web = {
inherit (cfg) openFirewall;
enable = true; enable = true;
port = 8112; port = 8112;
openFirewall = cfg.openFirewall;
}; };
}; };
jackett = { jackett = {
inherit (cfg) openFirewall;
enable = false; enable = false;
user = "nix-apps"; user = "nix-apps";
group = "jallen-nas"; group = "jallen-nas";
openFirewall = cfg.openFirewall;
}; };
}; };
}; };

View File

@@ -27,8 +27,8 @@ let
options = { }; options = { };
moduleConfig = { moduleConfig = {
services.atticd = { services.atticd = {
inherit (cfg) environmentFile;
enable = true; enable = true;
environmentFile = cfg.environmentFile;
settings = { settings = {
listen = "${cfg.listenAddress}:${toString cfg.port}"; listen = "${cfg.listenAddress}:${toString cfg.port}";
storage = { storage = {

View File

@@ -18,9 +18,11 @@ let
options = { }; options = { };
moduleConfig = { moduleConfig = {
services.authentik = { services.authentik = {
inherit (cfg) environmentFile;
enable = true; enable = true;
environmentFile = cfg.environmentFile; settings = {
settings.port = cfg.port; inherit (cfg) port;
};
}; };
}; };
}; };

View File

@@ -4,58 +4,26 @@
namespace, namespace,
... ...
}: }:
with lib;
let let
cfg = config.${namespace}.services.caddy; cfg = config.${namespace}.services.caddy;
caddySecret = {
inherit (config.users.users.caddy) name group;
sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
restartUnits = [ "caddy.service" ];
};
in in
{ {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
sops = { sops = {
secrets = { secrets = {
"jallen-nas/traefik/crowdsec/lapi-key" = { "jallen-nas/traefik/crowdsec/lapi-key" = caddySecret;
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml"); "jallen-nas/traefik/crowdsec/capi-machine-id" = caddySecret;
owner = config.users.users.caddy.name; "jallen-nas/traefik/crowdsec/capi-password" = caddySecret;
group = config.users.users.caddy.group; "jallen-nas/traefik/cloudflare-dns-api-token" = caddySecret;
restartUnits = [ "caddy.service" ]; "jallen-nas/traefik/cloudflare-zone-api-token" = caddySecret;
}; "jallen-nas/traefik/cloudflare-api-key" = caddySecret;
"jallen-nas/traefik/cloudflare-email" = caddySecret;
"jallen-nas/traefik/crowdsec/capi-machine-id" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
owner = config.users.users.caddy.name;
group = config.users.users.caddy.group;
restartUnits = [ "caddy.service" ];
};
"jallen-nas/traefik/crowdsec/capi-password" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
owner = config.users.users.caddy.name;
group = config.users.users.caddy.group;
restartUnits = [ "caddy.service" ];
};
"jallen-nas/traefik/cloudflare-dns-api-token" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
owner = config.users.users.caddy.name;
group = config.users.users.caddy.group;
restartUnits = [ "caddy.service" ];
};
"jallen-nas/traefik/cloudflare-zone-api-token" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
owner = config.users.users.caddy.name;
group = config.users.users.caddy.group;
restartUnits = [ "caddy.service" ];
};
"jallen-nas/traefik/cloudflare-api-key" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
owner = config.users.users.caddy.name;
group = config.users.users.caddy.group;
restartUnits = [ "caddy.service" ];
};
"jallen-nas/traefik/cloudflare-email" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
owner = config.users.users.caddy.name;
group = config.users.users.caddy.group;
restartUnits = [ "caddy.service" ];
};
}; };
templates = { templates = {
"caddy.env" = { "caddy.env" = {
@@ -65,8 +33,7 @@ in
CLOUDFLARE_API_KEY=${config.sops.placeholder."jallen-nas/traefik/cloudflare-api-key"} CLOUDFLARE_API_KEY=${config.sops.placeholder."jallen-nas/traefik/cloudflare-api-key"}
CLOUDFLARE_EMAIL=${config.sops.placeholder."jallen-nas/traefik/cloudflare-email"} CLOUDFLARE_EMAIL=${config.sops.placeholder."jallen-nas/traefik/cloudflare-email"}
''; '';
owner = config.users.users.caddy.name; inherit (config.users.users.caddy) name group;
group = config.users.users.caddy.group;
restartUnits = [ "caddy.service" ]; restartUnits = [ "caddy.service" ];
}; };
}; };

View File

@@ -17,9 +17,9 @@ let
options = { }; options = { };
moduleConfig = { moduleConfig = {
services.calibre-server = { services.calibre-server = {
inherit (cfg) port;
enable = false; enable = false;
openFirewall = true; openFirewall = true;
port = cfg.port;
libraries = [ "${cfg.dataDir}/books" ]; libraries = [ "${cfg.dataDir}/books" ];
}; };
}; };
@@ -37,8 +37,8 @@ let
package = pkgs.stable.calibre-web; package = pkgs.stable.calibre-web;
dataDir = "${cfgWeb.configDir}/calibre-web"; dataDir = "${cfgWeb.configDir}/calibre-web";
listen = { listen = {
inherit (cfgWeb) port;
ip = "0.0.0.0"; ip = "0.0.0.0";
port = cfgWeb.port;
}; };
options = { options = {
enableBookUploading = true; enableBookUploading = true;

View File

@@ -15,9 +15,8 @@ let
description = "Cockpit web-based server management UI"; description = "Cockpit web-based server management UI";
moduleConfig = { moduleConfig = {
services.cockpit = { services.cockpit = {
inherit (cfg) port openFirewall;
enable = true; enable = true;
port = cfg.port;
openFirewall = cfg.openFirewall;
allowed-origins = [ allowed-origins = [
"https://${net.hosts.nas.lan}:${toString cfg.port}" "https://${net.hosts.nas.lan}:${toString cfg.port}"
"https://${net.hosts.nas.hostname}:${toString cfg.port}" "https://${net.hosts.nas.hostname}:${toString cfg.port}"

View File

@@ -16,22 +16,21 @@ let
moduleConfig = { moduleConfig = {
# Configure the standard NixOS code-server service # Configure the standard NixOS code-server service
services.code-server = { services.code-server = {
inherit (cfg) port extraEnvironment;
enable = true; enable = true;
port = cfg.port;
user = "admin"; user = "admin";
group = "jallen-nas"; group = "jallen-nas";
host = cfg.listenAddress; host = cfg.listenAddress;
auth = "none"; # "password" auth = "none"; # "password"
disableTelemetry = true; disableTelemetry = true;
disableUpdateCheck = true; disableUpdateCheck = true;
extraEnvironment = cfg.extraEnvironment;
extraGroups = [ extraGroups = [
"admin" "admin"
"wheel" "wheel"
]; ];
} }
// optionalAttrs (cfg.hashedPassword != null) { // optionalAttrs (cfg.hashedPassword != null) {
hashedPassword = cfg.hashedPassword; inherit (cfg) hashedPassword;
}; };
}; };
}; };

View File

@@ -17,7 +17,7 @@ let
moduleConfig = { moduleConfig = {
services.collabora-online = { services.collabora-online = {
enable = true; enable = true;
port = cfg.port; inherit (cfg) port;
settings = { settings = {
# Rely on reverse proxy for SSL # Rely on reverse proxy for SSL
ssl = { ssl = {

View File

@@ -39,7 +39,7 @@ let
services = { services = {
crowdsec = { crowdsec = {
enable = true; enable = true;
openFirewall = cfg.openFirewall; inherit (cfg) openFirewall;
hub = { hub = {
appSecConfigs = [ appSecConfigs = [
"crowdsecurity/appsec-default" "crowdsecurity/appsec-default"

View File

@@ -22,8 +22,8 @@ let
stateDir = "${cfg.configDir}/gitea"; stateDir = "${cfg.configDir}/gitea";
user = "nix-apps"; user = "nix-apps";
group = "jallen-nas"; group = "jallen-nas";
mailerPasswordFile = mailerPasswordFile; inherit mailerPasswordFile;
metricsTokenFile = metricsTokenFile; inherit metricsTokenFile;
settings = { settings = {
server = { server = {
DOMAIN = "jallen-nas"; DOMAIN = "jallen-nas";

View File

@@ -12,9 +12,9 @@ let
hostedServiceSites = hostedServiceSites =
let let
servicesCfg = config.${namespace}.services; servicesCfg = config.${namespace}.services;
serviceNames = builtins.attrNames servicesCfg; serviceNames = attrNames servicesCfg;
in in
builtins.concatMap ( concatMap (
serviceName: serviceName:
let let
serviceCfg = servicesCfg.${serviceName}; serviceCfg = servicesCfg.${serviceName};
@@ -24,9 +24,7 @@ let
[ [
( (
{ {
title = hosted.title; inherit (hosted) title url icon;
url = hosted.url;
icon = hosted.icon;
} }
// optionalAttrs hosted.basicAuth { // optionalAttrs hosted.basicAuth {
basic-auth = { basic-auth = {
@@ -40,9 +38,9 @@ let
[ ] [ ]
) serviceNames; ) serviceNames;
hostedServicesByGroup = builtins.groupBy (svc: svc.hostedService.group) ( hostedServicesByGroup = groupBy (svc: svc.hostedService.group) (
builtins.filter (svc: svc.hostedService != null && svc.hostedService.enable) ( filter (svc: svc.hostedService != null && svc.hostedService.enable) (
builtins.map ( map (
serviceName: serviceName:
let let
serviceCfg = config.${namespace}.services.${serviceName}; serviceCfg = config.${namespace}.services.${serviceName};
@@ -50,7 +48,7 @@ let
{ {
hostedService = serviceCfg.hostedService or null; hostedService = serviceCfg.hostedService or null;
} }
) (builtins.attrNames config.${namespace}.services) ) (attrNames config.${namespace}.services)
) )
); );
@@ -332,7 +330,7 @@ let
settings = { settings = {
server = { server = {
host = "0.0.0.0"; host = "0.0.0.0";
port = cfg.port; inherit (cfg) port;
}; };
pages = [ pages = [
{ {
@@ -371,31 +369,27 @@ let
} }
] ]
++ lib.optionals cfg.hostedServiceGroups ( ++ lib.optionals cfg.hostedServiceGroups (
builtins.map ( map (
groupName: groupName:
makeMonitorWidget groupName ( makeMonitorWidget groupName (
builtins.map (svc: { map (svc: {
title = svc.hostedService.title; inherit (svc.hostedService) title url icon;
url = svc.hostedService.url;
icon = svc.hostedService.icon;
}) (hostedServicesByGroup.${groupName} or [ ]) }) (hostedServicesByGroup.${groupName} or [ ])
) )
) (builtins.attrNames hostedServicesByGroup) ) (attrNames hostedServicesByGroup)
) )
++ lib.optionals (!cfg.hostedServiceGroups && cfg.enableHostedServices) [ ++ lib.optionals (!cfg.hostedServiceGroups && cfg.enableHostedServices) [
(makeMonitorWidget "Services" hostedServiceSites) (makeMonitorWidget "Services" hostedServiceSites)
] ]
++ lib.optionals (cfg.extraSites != [ ]) ( ++ lib.optionals (cfg.extraSites != [ ]) (
builtins.map (site: { map (site: {
type = "monitor"; type = "monitor";
cache = "1m"; cache = "1m";
title = site.title; inherit (site) title;
sites = [ sites = [
( (
{ {
title = site.title; inherit (site) title url icon;
url = site.url;
icon = site.icon;
} }
// optionalAttrs site.allow-insecure { allow-insecure = true; } // optionalAttrs site.allow-insecure { allow-insecure = true; }
) )
@@ -407,7 +401,7 @@ let
groups = cfg.bookmarks; groups = cfg.bookmarks;
} }
++ lib.optionals (cfg.reddit != [ ]) ( ++ lib.optionals (cfg.reddit != [ ]) (
builtins.map (subreddit: { map (subreddit: {
type = "reddit"; type = "reddit";
inherit subreddit; inherit subreddit;
}) cfg.reddit }) cfg.reddit

View File

@@ -17,7 +17,7 @@ let
services.headscale = { services.headscale = {
enable = true; enable = true;
address = cfg.listenAddress; address = cfg.listenAddress;
port = cfg.port; inherit (cfg) port;
settings = { settings = {
server_url = "https://headscale.mjallen.dev:443"; server_url = "https://headscale.mjallen.dev:443";
database.sqlite.path = "${cfg.configDir}/headscale/db.sqlite"; database.sqlite.path = "${cfg.configDir}/headscale/db.sqlite";

View File

@@ -19,9 +19,8 @@ let
moduleConfig = { moduleConfig = {
# Enable immich service # Enable immich service
services.immich = { services.immich = {
inherit (cfg) port openFirewall;
enable = true; enable = true;
port = cfg.port;
openFirewall = true;
secretsFile = dbPassword; secretsFile = dbPassword;
mediaLocation = "${cfg.dataDir}/photos"; mediaLocation = "${cfg.dataDir}/photos";

View File

@@ -16,7 +16,7 @@ let
moduleConfig = { moduleConfig = {
services.jellyfin = { services.jellyfin = {
enable = true; enable = true;
openFirewall = cfg.openFirewall; inherit (cfg) openFirewall;
user = "nix-apps"; user = "nix-apps";
group = "jallen-nas"; group = "jallen-nas";
dataDir = "${cfg.configDir}/jellyfin"; dataDir = "${cfg.configDir}/jellyfin";

View File

@@ -16,9 +16,8 @@ let
moduleConfig = { moduleConfig = {
# Enable seerr service # Enable seerr service
services.seerr = { services.seerr = {
inherit (cfg) port openFirewall;
enable = true; enable = true;
port = cfg.port;
openFirewall = cfg.openFirewall;
configDir = "${cfg.configDir}/jellyseerr"; configDir = "${cfg.configDir}/jellyseerr";
}; };

View File

@@ -4,7 +4,6 @@
namespace, namespace,
... ...
}: }:
with lib;
let let
name = "kavita"; name = "kavita";
cfg = config.${namespace}.services.${name}; cfg = config.${namespace}.services.${name};
@@ -17,9 +16,9 @@ let
sops = { sops = {
secrets = { secrets = {
"jallen-nas/kavita/token" = { "jallen-nas/kavita/token" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml"); sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
owner = config.users.users.kavita.name; owner = config.users.users.kavita.name;
group = config.users.users.kavita.group; inherit (config.users.users.kavita) group;
restartUnits = [ "kavita.service" ]; restartUnits = [ "kavita.service" ];
}; };
}; };
@@ -29,7 +28,7 @@ let
dataDir = "${cfg.configDir}/kavita"; dataDir = "${cfg.configDir}/kavita";
tokenKeyFile = config.sops.secrets."jallen-nas/kavita/token".path; tokenKeyFile = config.sops.secrets."jallen-nas/kavita/token".path;
settings = { settings = {
Port = cfg.port; inherit (cfg) port;
}; };
}; };
}; };

View File

@@ -14,10 +14,10 @@ let
options = { }; options = { };
moduleConfig = { moduleConfig = {
services.minecraft-server = { services.minecraft-server = {
inherit (cfg) openFirewall;
enable = true; enable = true;
eula = true; eula = true;
declarative = true; declarative = true;
openFirewall = cfg.openFirewall;
dataDir = "${cfg.configDir}/minecraft"; # todo dataDir = "${cfg.configDir}/minecraft"; # todo
serverProperties = { serverProperties = {
enforce-whitelist = true; enforce-whitelist = true;

View File

@@ -115,20 +115,21 @@ let
''; '';
services.nebula.networks.${cfg.networkName} = { services.nebula.networks.${cfg.networkName} = {
inherit (cfg)
isLighthouse
isRelay
lighthouses
staticHostMap
;
enable = true; enable = true;
enableReload = true; enableReload = true;
isLighthouse = cfg.isLighthouse;
isRelay = cfg.isRelay;
inherit ca cert key; inherit ca cert key;
lighthouses = cfg.lighthouses;
staticHostMap = cfg.staticHostMap;
tun.device = if cfg.tunDevice != null then cfg.tunDevice else "nebula0"; tun.device = if cfg.tunDevice != null then cfg.tunDevice else "nebula0";
listen = { listen = {
host = cfg.listenAddress; host = cfg.listenAddress;
port = cfg.port; inherit (cfg) port;
}; };
settings.firewall = { settings.firewall = {

View File

@@ -115,8 +115,8 @@ let
virtualHosts.${config.services.nextcloud.hostName} = { virtualHosts.${config.services.nextcloud.hostName} = {
listen = [ listen = [
{ {
inherit (cfg) port;
addr = "0.0.0.0"; addr = "0.0.0.0";
port = cfg.port;
ssl = false; ssl = false;
} }
]; ];

View File

@@ -17,7 +17,7 @@ let
moduleConfig = { moduleConfig = {
services.onlyoffice = { services.onlyoffice = {
enable = true; enable = true;
port = cfg.port; inherit (cfg) port;
wopi = true; wopi = true;
hostname = "office.mjallen.dev"; hostname = "office.mjallen.dev";
jwtSecretFile = jwtSecretFile; jwtSecretFile = jwtSecretFile;

View File

@@ -21,7 +21,7 @@ let
enable = true; enable = true;
url = "https://cloud.mjallen.dev"; url = "https://cloud.mjallen.dev";
address = cfg.listenAddress; address = cfg.listenAddress;
port = cfg.port; inherit (cfg) port;
stateDir = "${cfg.configDir}/opencloud"; stateDir = "${cfg.configDir}/opencloud";
environment = { environment = {
PROXY_TLS = "false"; # disable https when behind reverse-proxy PROXY_TLS = "false"; # disable https when behind reverse-proxy

View File

@@ -61,8 +61,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = { virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart; inherit (cfg) autoStart image;
image = cfg.image;
ports = [ "${cfg.httpPort}:9200" ]; ports = [ "${cfg.httpPort}:9200" ];
volumes = [ volumes = [
"${cfg.configPath}:/etc/ocis" "${cfg.configPath}:/etc/ocis"

View File

@@ -18,9 +18,9 @@ let
moduleConfig = { moduleConfig = {
# Enable paperless service # Enable paperless service
services.paperless = { services.paperless = {
inherit (cfg) port;
enable = true; enable = true;
package = pkgs.paperless-ngx; package = pkgs.paperless-ngx;
port = cfg.port;
# user = "nix-apps"; # user = "nix-apps";
address = cfg.listenAddress; address = cfg.listenAddress;
dataDir = "${cfg.configDir}/paperless"; dataDir = "${cfg.configDir}/paperless";

View File

@@ -202,14 +202,16 @@ in
services.restic.backups = mapAttrs ( services.restic.backups = mapAttrs (
_name: jobCfg: _name: jobCfg:
{ {
initialize = jobCfg.initialize; inherit (jobCfg)
createWrapper = jobCfg.createWrapper; initialize
inhibitsSleep = jobCfg.inhibitsSleep; createWrapper
paths = jobCfg.paths; inhibitsSleep
paths
timerConfig
pruneOpts
extraBackupArgs
;
exclude = jobCfg.exclude ++ cfg.defaultExcludes; exclude = jobCfg.exclude ++ cfg.defaultExcludes;
timerConfig = jobCfg.timerConfig;
pruneOpts = jobCfg.pruneOpts;
extraBackupArgs = jobCfg.extraBackupArgs;
} }
// optionalAttrs (jobCfg.passwordFile != null) { inherit (jobCfg) passwordFile; } // optionalAttrs (jobCfg.passwordFile != null) { inherit (jobCfg) passwordFile; }
// optionalAttrs (jobCfg.repository != null) { inherit (jobCfg) repository; } // optionalAttrs (jobCfg.repository != null) { inherit (jobCfg) repository; }

View File

@@ -17,7 +17,7 @@ let
moduleConfig = { moduleConfig = {
services.sunshine = { services.sunshine = {
enable = true; enable = true;
openFirewall = cfg.openFirewall; inherit (cfg) openFirewall;
autoStart = true; autoStart = true;
capSysAdmin = true; capSysAdmin = true;
applications.apps = with pkgs; [ applications.apps = with pkgs; [

View File

@@ -88,7 +88,7 @@ in
config = { config = {
users = { users = {
mutableUsers = cfg.mutableUsers; inherit (cfg) mutableUsers;
groups.${cfg.group}.gid = lib.mkForce (if cfg.group != "wheel" then cfg.gid else 1); groups.${cfg.group}.gid = lib.mkForce (if cfg.group != "wheel" then cfg.gid else 1);
users = { users = {
root = { root = {
@@ -99,6 +99,7 @@ in
${cfg.name} = { ${cfg.name} = {
inherit (cfg) inherit (cfg)
name name
group
uid uid
linger linger
packages packages
@@ -133,7 +134,6 @@ in
] ]
++ cfg.extraGroups; ++ cfg.extraGroups;
group = cfg.group;
home = "/home/${cfg.name}"; home = "/home/${cfg.name}";
isNormalUser = true; isNormalUser = true;
shell = lib.mkForce pkgs.zsh; shell = lib.mkForce pkgs.zsh;

View File

@@ -4,7 +4,7 @@
}: }:
final: prev: final: prev:
let let
linux-rpi5 = final.linuxPackagesFor (final.${namespace}.linux-rpi); linux-rpi5 = final.linuxPackagesFor final.${namespace}.linux-rpi;
linux-rpi5-latest = final.linuxPackagesFor ( linux-rpi5-latest = final.linuxPackagesFor (
final.${namespace}.linux-rpi.override { final.${namespace}.linux-rpi.override {
kernelVersion = "unstable"; kernelVersion = "unstable";

View File

@@ -1,12 +0,0 @@
{ ... }:
final: prev: {
python3 = prev.python3.override {
packageOverrides = _pyFinal: pyPrev: {
radios = pyPrev.radios.overridePythonAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pyPrev.pythonRelaxDepsHook ];
pythonRelaxDeps = [ "pycountry" ];
});
};
};
python3Packages = final.python3.pkgs;
}

View File

@@ -1,7 +1,7 @@
{ inputs, ... }: { inputs, ... }:
final: _prev: { final: _prev: {
stable = import inputs.nixpkgs-stable { stable = import inputs.nixpkgs-stable {
system = final.stdenv.hostPlatform.system; inherit (final.stdenv.hostPlatform) system;
config.allowUnfree = true; config.allowUnfree = true;
}; };
} }

View File

@@ -18,7 +18,7 @@ let
in in
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "arm-trusted-firmware"; pname = "arm-trusted-firmware";
version = if fw ? tag then fw.tag else fw.rev; version = fw.tag or fw.rev;
src = sources.fw; src = sources.fw;

View File

@@ -42,7 +42,7 @@ stdenv.mkDerivation (finalAttrs: {
cargoDeps = rustPlatform.fetchCargoVendor { cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src; inherit (finalAttrs) src;
hash = sources.cargoDeps.hash; inherit (sources.cargoDeps) hash;
}; };
postPatch = '' postPatch = ''

View File

@@ -102,10 +102,9 @@ let
in in
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "cockpit-benchmark"; pname = "cockpit-benchmark";
inherit (sources) src;
inherit version; inherit version;
src = sources.src;
npmDeps = fetchNpmDeps { npmDeps = fetchNpmDeps {
src = "${finalAttrs.src}/benchmark"; src = "${finalAttrs.src}/benchmark";
packageLock = patchedPackageLock; packageLock = patchedPackageLock;

View File

@@ -16,10 +16,9 @@ let
in in
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "cockpit-machines"; pname = "cockpit-machines";
inherit (sources) src;
inherit version; inherit version;
src = sources.src;
# Pre-vendored node_modules from cockpit-project/node-cache, pinned via the # Pre-vendored node_modules from cockpit-project/node-cache, pinned via the
# node_modules submodule reference in the source tree. # node_modules submodule reference in the source tree.
inherit (sources) nodeModules; inherit (sources) nodeModules;

View File

@@ -8,6 +8,7 @@
let let
inherit (lib.trivial) importJSON; inherit (lib.trivial) importJSON;
inherit (lib.${namespace}) mkAllSources selectVariant; inherit (lib.${namespace}) mkAllSources selectVariant;
inherit lib;
versionSpec = importJSON ./version.json; versionSpec = importJSON ./version.json;
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
@@ -18,11 +19,7 @@ stdenv.mkDerivation {
pname = "cockpit-podman"; pname = "cockpit-podman";
inherit version; inherit version;
src = sources.src; inherit (sources) src nodeModules;
# Pre-vendored node_modules from cockpit-project/node-cache, pinned via the
# node_modules submodule reference in the source tree.
inherit (sources) nodeModules;
# pkg/lib checked out from the main cockpit repo at the commit pinned in # pkg/lib checked out from the main cockpit repo at the commit pinned in
# the Makefile (COCKPIT_REPO_COMMIT). # the Makefile (COCKPIT_REPO_COMMIT).

View File

@@ -12,14 +12,14 @@ let
pname = "edk2-basetools"; pname = "edk2-basetools";
src = srcOverride; src = srcOverride;
in in
stdenv.mkDerivation rec { stdenv.mkDerivation {
inherit src pname version; inherit src pname version;
env = { env = {
NIX_CFLAGS_COMPILE = NIX_CFLAGS_COMPILE =
"-Wno-return-type" "-Wno-return-type"
+ lib.optionalString (stdenv.cc.isGNU) " -Wno-error=stringop-truncation" + lib.optionalString stdenv.cc.isGNU " -Wno-error=stringop-truncation"
+ lib.optionalString (stdenv.hostPlatform.isDarwin) " -Wno-error=macro-redefined"; + lib.optionalString stdenv.hostPlatform.isDarwin " -Wno-error=macro-redefined";
PYTHON_COMMAND = lib.getExe pythonEnv; PYTHON_COMMAND = lib.getExe pythonEnv;
# trick taken from https://src.fedoraproject.org/rpms/edk2/blob/08f2354cd280b4ce5a7888aa85cf520e042955c3/f/edk2.spec#_319 # trick taken from https://src.fedoraproject.org/rpms/edk2/blob/08f2354cd280b4ce5a7888aa85cf520e042955c3/f/edk2.spec#_319
${"GCC5_AARCH64_PREFIX"} = stdenv.cc.targetPrefix; ${"GCC5_AARCH64_PREFIX"} = stdenv.cc.targetPrefix;

View File

@@ -61,8 +61,8 @@ stdenv.mkDerivation rec {
env = { env = {
NIX_CFLAGS_COMPILE = NIX_CFLAGS_COMPILE =
"-Wno-return-type -Wno-error" "-Wno-return-type -Wno-error"
+ lib.optionalString (stdenv.cc.isGNU) " -Wno-error=stringop-truncation" + lib.optionalString stdenv.cc.isGNU " -Wno-error=stringop-truncation"
+ lib.optionalString (stdenv.hostPlatform.isDarwin) " -Wno-error=macro-redefined"; + lib.optionalString stdenv.hostPlatform.isDarwin " -Wno-error=macro-redefined";
PYTHON_COMMAND = lib.getExe pythonEnv; PYTHON_COMMAND = lib.getExe pythonEnv;
# trick taken from https://src.fedoraproject.org/rpms/edk2/blob/08f2354cd280b4ce5a7888aa85cf520e042955c3/f/edk2.spec#_319 # trick taken from https://src.fedoraproject.org/rpms/edk2/blob/08f2354cd280b4ce5a7888aa85cf520e042955c3/f/edk2.spec#_319
${"GCC5_AARCH64_PREFIX"} = stdenv.cc.targetPrefix; ${"GCC5_AARCH64_PREFIX"} = stdenv.cc.targetPrefix;

View File

@@ -66,7 +66,7 @@ let
version = "0.9.36"; version = "0.9.36";
# XRT userspace runtime — built from packages/xrt in this flake. # XRT userspace runtime — built from packages/xrt in this flake.
xrt = pkgs.${namespace}.xrt; inherit (pkgs.${namespace}) xrt;
# ── tokenizers-cpp submodule ────────────────────────────────────────────── # ── tokenizers-cpp submodule ──────────────────────────────────────────────
# Pinned to the commit referenced in FastFlowLM v0.9.36 .gitmodules. # Pinned to the commit referenced in FastFlowLM v0.9.36 .gitmodules.

View File

@@ -13,12 +13,12 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.anycubic; src-meta = selected.sources.anycubic;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "anycubic_wifi";
inherit version; inherit version;
domain = "anycubic_wifi";
src = sources.anycubic; src = sources.anycubic;

View File

@@ -14,12 +14,12 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.bambu_lab; src-meta = selected.sources.bambu_lab;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "bambu_lab";
inherit version; inherit version;
domain = "bambu_lab";
src = sources.bambu_lab; src = sources.bambu_lab;

View File

@@ -14,10 +14,10 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.bedjet; src-meta = selected.sources.bedjet;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "bedjet"; domain = "bedjet";
inherit version; inherit version;

View File

@@ -14,10 +14,10 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.ge_home; src-meta = selected.sources.ge_home;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "ge_home"; domain = "ge_home";
inherit version; inherit version;

View File

@@ -14,12 +14,12 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.govee; src-meta = selected.sources.govee;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "govee";
inherit version; inherit version;
domain = "govee";
src = sources.govee; src = sources.govee;

View File

@@ -14,10 +14,10 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.icloud3; src-meta = selected.sources.icloud3;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "icloud3"; domain = "icloud3";
inherit version; inherit version;

View File

@@ -14,12 +14,12 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.llama_conversation; src-meta = selected.sources.llama_conversation;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "llama_conversation";
inherit version; inherit version;
domain = "llama_conversation";
src = sources.llama_conversation; src = sources.llama_conversation;

View File

@@ -14,12 +14,12 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.mail_and_packages; src-meta = selected.sources.mail_and_packages;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "mail_and_packages";
inherit version; inherit version;
domain = "mail_and_packages";
src = sources.mail_and_packages; src = sources.mail_and_packages;

View File

@@ -14,7 +14,7 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.nanokvm; src-meta = selected.sources.nanokvm;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
# python-nanokvm must be built against HA's Python interpreter. # python-nanokvm must be built against HA's Python interpreter.
# Re-use the source from its own version.json to avoid duplication. # Re-use the source from its own version.json to avoid duplication.
@@ -26,10 +26,7 @@ let
python-nanokvm = python3Packages.buildPythonPackage { python-nanokvm = python3Packages.buildPythonPackage {
pname = "nanokvm"; pname = "nanokvm";
version = version =
if nanokvm-selected.sources."python-nanokvm" ? tag then nanokvm-selected.sources."python-nanokvm".tag or nanokvm-selected.sources."python-nanokvm".rev;
nanokvm-selected.sources."python-nanokvm".tag
else
nanokvm-selected.sources."python-nanokvm".rev;
format = "pyproject"; format = "pyproject";
src = nanokvm-sources."python-nanokvm"; src = nanokvm-sources."python-nanokvm";
@@ -81,7 +78,7 @@ let
}; };
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "nanokvm"; domain = "nanokvm";
inherit version; inherit version;

View File

@@ -14,10 +14,10 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.openhasp; src-meta = selected.sources.openhasp;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "openhasp"; domain = "openhasp";
inherit version; inherit version;

View File

@@ -13,12 +13,12 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.overseerr; src-meta = selected.sources.overseerr;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "overseerr";
inherit version; inherit version;
domain = "overseerr";
src = sources.overseerr; src = sources.overseerr;

View File

@@ -13,12 +13,12 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.petlibro; src-meta = selected.sources.petlibro;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "petlibro";
inherit version; inherit version;
domain = "petlibro";
src = sources.petlibro; src = sources.petlibro;

View File

@@ -13,10 +13,10 @@ let
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.wyzeapi; src-meta = selected.sources.wyzeapi;
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
in in
buildHomeAssistantComponent { buildHomeAssistantComponent {
owner = src-meta.owner; inherit (src-meta) owner;
domain = "wyzeapi"; domain = "wyzeapi";
inherit version; inherit version;

View File

@@ -21,14 +21,13 @@
let let
inherit (lib.trivial) importJSON; inherit (lib.trivial) importJSON;
inherit (lib.${namespace}) selectVariant mkAllSources; inherit (lib.${namespace}) selectVariant mkAllSources;
inherit lib;
versionSpec = importJSON ./version.json; versionSpec = importJSON ./version.json;
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
# cargoHash is stored alongside the source in version.json so the TUI can update it inherit (stdenv.hostPlatform) system;
cargoHash = selected.sources.librepods.cargoHash; cargoHash = selected.sources.librepods.cargoHash;
system = stdenv.hostPlatform.system;
in in
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "librepods"; pname = "librepods";

View File

@@ -12,11 +12,11 @@ let
versionSpec = importJSON ./version.json; versionSpec = importJSON ./version.json;
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
moondeck-buddy = selected.sources.moondeck-buddy; inherit (selected.sources) moondeck-buddy;
in in
appimageTools.wrapType2 { appimageTools.wrapType2 {
pname = "moondeck-buddy"; pname = "moondeck-buddy";
version = if moondeck-buddy ? tag then moondeck-buddy.tag else moondeck-buddy.rev; version = moondeck-buddy.tag or moondeck-buddy.rev;
src = sources.moondeck-buddy; src = sources.moondeck-buddy;

View File

@@ -23,19 +23,16 @@ let
versionSpec = importJSON ./version.json; versionSpec = importJSON ./version.json;
selected = selectVariant versionSpec variant null; selected = selectVariant versionSpec variant null;
vars = selected.variables or { }; vars = selected.variables or { };
base = vars.base;
release = vars.release;
toolTitle = "proton-${variant}-latest"; toolTitle = "proton-${variant}-latest";
# Derived values for the current variant releaseVersion = "${releasePrefix}${vars.base}-${vars.release}${releaseSuffix}";
releaseVersion = "${releasePrefix}${base}-${release}${releaseSuffix}"; homepage = "https://${owner}/${repo}";
homepage = "https://github.com/${owner}/${repo}";
url = "${homepage}/releases/download/${releaseVersion}/${tarballPrefix}${releaseVersion}${tarballSuffix}"; url = "${homepage}/releases/download/${releaseVersion}/${tarballPrefix}${releaseVersion}${tarballSuffix}";
# Choose fetcher based on file type # Choose fetcher based on file type
intake = intake =
if lib.strings.hasSuffix ".zip" url then if lib.hasSuffix ".zip" url then
{ {
fetcher = fetchzip; fetcher = fetchzip;
input = "$src/*.tar.xz"; input = "$src/*.tar.xz";
@@ -48,7 +45,7 @@ let
in in
stdenvNoCC.mkDerivation { stdenvNoCC.mkDerivation {
name = repo; name = repo;
version = "${base}.${release}"; version = "${vars.base}.${vars.release}";
src = intake.fetcher { src = intake.fetcher {
inherit url; inherit url;
@@ -60,7 +57,7 @@ stdenvNoCC.mkDerivation {
tar -C $out/bin --strip=1 -x -f ${intake.input} tar -C $out/bin --strip=1 -x -f ${intake.input}
'' ''
# Allow to keep the same name between updates # Allow to keep the same name between updates
+ lib.strings.optionalString (toolTitle != null) '' + lib.optionalString (toolTitle != null) ''
sed -i -r 's|"${toolPattern}"|"${toolTitle}"|' $out/bin/compatibilitytool.vdf sed -i -r 's|"${toolPattern}"|"${toolTitle}"|' $out/bin/compatibilitytool.vdf
''; '';

View File

@@ -16,7 +16,7 @@ let
in in
python3Packages.buildPythonPackage { python3Packages.buildPythonPackage {
pname = "comfy-aimdo"; pname = "comfy-aimdo";
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
format = "pyproject"; format = "pyproject";
src = sources."comfy-aimdo"; src = sources."comfy-aimdo";

View File

@@ -12,7 +12,7 @@ let
versionSpec = importJSON ./version.json; versionSpec = importJSON ./version.json;
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
version = selected.variables.version; inherit (selected.variables) version;
in in
python3Packages.buildPythonPackage { python3Packages.buildPythonPackage {
pname = "comfy-kitchen"; pname = "comfy-kitchen";

View File

@@ -12,7 +12,7 @@ let
versionSpec = importJSON ./version.json; versionSpec = importJSON ./version.json;
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
version = selected.variables.version; inherit (selected.variables) version;
in in
home-assistant.python.pkgs.buildPythonPackage { home-assistant.python.pkgs.buildPythonPackage {
pname = "gehomesdk"; pname = "gehomesdk";

View File

@@ -16,7 +16,7 @@ let
in in
home-assistant.python.pkgs.buildPythonPackage { home-assistant.python.pkgs.buildPythonPackage {
pname = "magicattr"; pname = "magicattr";
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
format = "setuptools"; format = "setuptools";
src = sources.magicattr; src = sources.magicattr;

View File

@@ -16,7 +16,7 @@ let
in in
python3Packages.buildPythonPackage { python3Packages.buildPythonPackage {
pname = "pipewire-python"; pname = "pipewire-python";
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
format = "pyproject"; format = "pyproject";
src = sources."pipewire-python"; src = sources."pipewire-python";

View File

@@ -16,7 +16,7 @@ let
in in
home-assistant.python.pkgs.buildPythonPackage { home-assistant.python.pkgs.buildPythonPackage {
pname = "pyoverseerr"; pname = "pyoverseerr";
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
format = "setuptools"; format = "setuptools";
src = sources.pyoverseerr; src = sources.pyoverseerr;

View File

@@ -16,7 +16,7 @@ let
in in
python3Packages.buildPythonPackage { python3Packages.buildPythonPackage {
pname = "nanokvm"; pname = "nanokvm";
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
format = "pyproject"; format = "pyproject";
src = sources."python-nanokvm"; src = sources."python-nanokvm";

View File

@@ -12,7 +12,7 @@ let
versionSpec = importJSON ./version.json; versionSpec = importJSON ./version.json;
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
version = selected.variables.version; inherit (selected.variables) version;
in in
python3Packages.buildPythonPackage { python3Packages.buildPythonPackage {
pname = "steam"; pname = "steam";

View File

@@ -12,8 +12,8 @@ let
versionSpec = importJSON ./version.json; versionSpec = importJSON ./version.json;
selected = selectVariant versionSpec null null; selected = selectVariant versionSpec null null;
sources = mkAllSources pkgs selected; sources = mkAllSources pkgs selected;
src-meta = selected.sources.pyvesync; inherit (selected.sources) pyvesync;
version = selected.variables.version; inherit (selected.variables) version;
in in
python3Packages.buildPythonPackage { python3Packages.buildPythonPackage {
pname = "pyvesync"; pname = "pyvesync";
@@ -37,7 +37,7 @@ python3Packages.buildPythonPackage {
meta = with lib; { meta = with lib; {
description = "Python library to manage Etekcity Devices and Levoit Air Purifier"; description = "Python library to manage Etekcity Devices and Levoit Air Purifier";
homepage = "https://github.com/webdjoe/pyvesync"; homepage = "https://github.com/webdjoe/pyvesync";
changelog = "https://github.com/webdjoe/pyvesync/releases/tag/${src-meta.tag}"; changelog = "https://github.com/webdjoe/pyvesync/releases/tag/${pyvesync.tag}";
license = with licenses; [ mit ]; license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ]; maintainers = with maintainers; [ fab ];
}; };

View File

@@ -16,7 +16,7 @@ let
in in
home-assistant.python.pkgs.buildPythonPackage { home-assistant.python.pkgs.buildPythonPackage {
pname = "wyzeapy"; pname = "wyzeapy";
version = if src-meta ? tag then src-meta.tag else src-meta.rev; version = src-meta.tag or src-meta.rev;
format = "pyproject"; format = "pyproject";
src = sources.wyzeapy; src = sources.wyzeapy;

View File

@@ -71,9 +71,9 @@ in
]; ];
})).override })).override
{ {
inherit (rpiFfmpegSrc) hash;
version = ffmpegVersion; version = ffmpegVersion;
source = rpiFfmpegSrc; source = rpiFfmpegSrc;
hash = rpiFfmpegSrc.hash;
# version = ffmpegVersion + "-rpi"; # version = ffmpegVersion + "-rpi";
# source = rpiFfmpegSrc; # source = rpiFfmpegSrc;

Some files were not shown because too many files have changed in this diff Show More