This commit is contained in:
Shelvacu
2025-05-22 18:48:45 -07:00
committed by Shelvacu on fw
parent bbb937322c
commit ce7346e7ea
11 changed files with 133 additions and 93 deletions

View File

@@ -8,7 +8,7 @@
lib.mkMerge [
(lib.mkIf config.vacu.isGui {
# pkgs for systems with a desktop GUI
vacu.packages = with pkgs; [
vacu.packages = ''
acpi
anki
audacity
@@ -21,7 +21,7 @@ lib.mkMerge [
gimp
haruna
iio-sensor-proxy
"inkscape-all"
inkscape-all
jellyfin-media-player
josm
kdePackages.elisa
@@ -49,10 +49,10 @@ lib.mkMerge [
wev
wireshark
wl-clipboard
];
'';
})
(lib.mkIf config.vacu.isDev {
vacu.packages = with pkgs; [
vacu.packages = ''
cargo
gnumake
patchelf
@@ -61,17 +61,18 @@ lib.mkMerge [
rustc
rust-script
stdenv.cc
];
'';
})
(lib.mkIf (!config.vacu.isMinimal) {
# big pkgs for non-minimal systems
vacu.packages = with pkgs; [
vacu.packages = ''
aircrack-ng
android-tools
bitwarden-cli
dmidecode
fido2-manage
flac
hdparm
home-manager
imagemagickBig
kanidm_1_5
@@ -97,20 +98,24 @@ lib.mkMerge [
termscp
tshark
yt-dlp
];
'';
})
{
vacu.packages.borgbackup.enable = config.vacu.isDev && (pkgs.system != "aarch64-linux");
vacu.packages.ffmpeg-vacu-full.enable = config.vacu.isGui;
vacu.packages.ffmpeg-vacu-headless.enable = !config.vacu.isMinimal && !config.vacu.isGui;
}
{
vacu.packages = {
vacu.packages =
let
enableFfmpeg = !config.vacu.isMinimal;
enableFfmpegFull = enableFfmpeg && config.vacu.isGui;
enableFfmpegHeadless = enableFfmpeg && !config.vacu.isGui;
in
{
borgbackup.enable = config.vacu.isDev && (pkgs.system != "aarch64-linux"); #borgbackup build is borken on aarch64
ffmpeg-vacu-full = {
enable = enableFfmpegFull;
package = pkgs.ffmpeg-full;
overrides.libbluray = config.vacu.packages.libbluray-all.finalPackage;
};
ffmpeg-vacu-headless = {
enable = enableFfmpegHeadless;
package = pkgs.ffmpeg-headless;
overrides.libbluray = config.vacu.packages.libbluray-all.finalPackage;
};
@@ -136,7 +141,7 @@ lib.mkMerge [
}
{
# pkgs included everywhere
vacu.packages = with pkgs; [
vacu.packages = ''
ddrescue
dig
dnsutils
@@ -157,7 +162,7 @@ lib.mkMerge [
ncdu
netcat-openbsd
nixos-rebuild
"p7zip-unfree"
p7zip-unfree
pciutils
progress
psutils
@@ -177,16 +182,16 @@ lib.mkMerge [
# units => vacu-units
unzip
usbutils
"vacu-units"
vacu-units
vim
wget
zip
];
'';
}
# packages that are in [`requiredPackages`][1] in nixos, but maybe not included in nix-on-droid
# [1]: https://github.com/NixOS/nixpkgs/blob/26d499fc9f1d567283d5d56fcf367edd815dba1d/nixos/modules/config/system-path.nix#L11
(lib.optionalAttrs (vacuModuleType == "nix-on-droid") {
vacu.packages = with pkgs; [
vacu.packages = ''
acl
attr
bashInteractive
@@ -217,6 +222,6 @@ lib.mkMerge [
which
xz
zstd
];
'';
})
]

View File

@@ -12,10 +12,7 @@ in
config = lib.mkIf config.vacu.shell.containerAliases {
vacu.packages = [
(writeScriptBin "ncrun" ''
if (( "$#" < 2 )); then
echo "need at least two args [container] and [command]" >&2
exit 1
fi
min_args $# 2
if [[ $UID != 0 ]]; then
exec /run/wrappers/bin/sudo "$0" "$@"
fi
@@ -24,10 +21,7 @@ in
exec ${lib.getExe pkgs.nixos-container} run "$1" -- "$@"
'')
(writeScriptBin "ncrl" ''
if (( "$#" != 1 )); then
echo "need exactly one arg: [container]" >&2
exit 1
fi
exact_args $# 1
if [[ $UID != 0 ]]; then
exec /run/wrappers/bin/sudo "$0" "$@"
fi

View File

@@ -47,11 +47,11 @@
services.openssh.enable = true;
vacu.packages = with pkgs; [
vacu.packages = ''
jupiter-hw-support
steamdeck-firmware
steamdeck-bios-fwupd
];
'';
# boot.kernelPatches = [
# {

View File

@@ -1,5 +1,5 @@
# everything to interact with my apex flex, pcsc stuff, fido2 stuff, etc
{ pkgs, config, ... }:
{ pkgs, lib, config, ... }:
let
# to match package used in config.services.pcscd, unfortunately not exposed like usual
pcsclite-pkg = if config.security.polkit.enable then pkgs.pcscliteWithPolkit else pkgs.pcsclite;
@@ -9,14 +9,16 @@ in
# nixpkgs.overlays = [ ( final: prev: {
# libfido2 = prev.libfido2.override { withPcsclite = true; };
# } ) ];
vacu.packages =
(with pkgs; [
vacu.packages = lib.mkMerge [
''
libfido2
pcsc-tools
scmccid
opensc
])
++ [ pcsclite-pkg ];
pcsclite
''
{ pcsclite.package = pcsclite-pkg; }
];
services.pcscd.enable = true;
# conflicts with pcscd, see https://stackoverflow.com/questions/55144458/unable-to-claim-usb-interface-device-or-resource-busy-stuck

View File

@@ -32,12 +32,12 @@
programs.steam.extraCompatPackages = [ pkgs.proton-ge-bin ];
vacu.packages = with pkgs; [
vacu.packages = ''
framework-tool
fw-ectool
headsetcontrol
openterface-qt
];
'';
services.power-profiles-daemon.enable = true;

View File

@@ -1,10 +1,13 @@
{ pkgs, config, ... }:
{ lib, config, ... }:
{
services.hardware.bolt.enable = true;
vacu.packages = [
pkgs.thunderbolt
config.services.hardware.bolt.package
pkgs.kdePackages.plasma-thunderbolt
vacu.packages = lib.mkMerge [
''
thunderbolt
bolt
kdePackages.plasma-thunderbolt
''
{ bolt.package = config.services.hardware.bolt.package; }
];
}

View File

@@ -11,24 +11,24 @@
vacu.shell.color = "red";
vacu.systemKind = "minimal";
vacu.packages = [
"acpi"
"iio-sensor-proxy"
"aircrack-ng"
# "bitwarden-cli" 800MB closure size!
"borgbackup"
"dmidecode"
"home-manager"
"man"
"mercurial"
"nix-index"
"nix-inspect"
"nix-search-cli"
"nmap"
"nvme-cli"
"rclone"
"smartmontools"
"tcpdump"
"termscp"
];
vacu.packages = ''
acpi
iio-sensor-proxy
aircrack-ng
# bitwarden-cli # 800MB closure size!
borgbackup
dmidecode
home-manager
man
mercurial
nix-index
nix-inspect
nix-search-cli
nmap
nvme-cli
rclone
smartmontools
tcpdump
termscp
'';
}

View File

@@ -39,37 +39,76 @@ let
}
)
);
packageListToSet = (
enable = lib.mkOverride 900 true; # more important than mkDefault, less important than setting explicitly
nameToPackageSet =
name:
let pieces = lib.splitString "." name; in
{
name = lib.last pieces;
value = {
inherit enable;
package = lib.mkDefault (lib.attrByPath pieces (throw "Could not find package pkgs.${name}") pkgs);
};
}
;
listToPackageSet =
from:
let
enable = lib.mkOverride 900 true; # more important than mkDefault, less important than setting explicitly
keyvals = map (
lib.pipe from [
(map (
val:
if builtins.isString val then
{
name = val;
value = { inherit enable; };
}
nameToPackageSet val
else
assert lib.isDerivation val;
{
name = val.pname or val.name;
value = {
package = lib.mkDefault val;
inherit enable;
package = lib.mkDefault val;
};
}
) from;
in
builtins.listToAttrs keyvals
);
))
builtins.listToAttrs
]
;
removeComments =
s:
builtins.head (lib.splitString "#" s)
;
nonEmpty =
s:
(builtins.stringLength s) > 0
;
stringToPackageSet =
from:
lib.pipe from [
(lib.splitString "\n")
(map removeComments)
(map lib.trim)
(builtins.filter nonEmpty)
(map nameToPackageSet)
builtins.listToAttrs
]
;
listOrStringToPackageSet = from:
if builtins.isString from then
stringToPackageSet from
else if builtins.isList from then
listToPackageSet from
else
throw "this should never happen; should be a list or string"
;
listTy =
types.listOf (
types.either types.str types.package
)
;
in
{
options = {
vacu.packages = mkOption {
default = { };
type = types.coercedTo (types.listOf (
types.either types.str types.package
)) packageListToSet packagesSetType;
type = types.coercedTo (types.either listTy types.str) listOrStringToPackageSet packagesSetType;
};
vacu.finalPackageList = mkOption {
type = types.listOf types.package;

View File

@@ -9,15 +9,6 @@ let
btrfsOpts = "compress=zstd:2,datacow,datasum,discard=async,ssd_spread,noatime,fatal_errors=panic";
in
{
imports = [
{
vacu.packages.btrfs-progs = {
enable = true;
package = btrfs-progs;
};
}
];
fileSystems."/" = {
device = btrfsDevice;
fsType = "btrfs";
@@ -51,6 +42,7 @@ in
};
vacu.packages = [
btrfs-progs
(pkgs.writeScriptBin "delete_old_root" ''
set -euo pipefail
timestamp="$1"

View File

@@ -29,7 +29,10 @@ in
bypassWorkqueues = true;
};
boot.initrd.systemd.enable = true;
vacu.packages = [ pkgs.tpm2-tss pkgs.mdadm ];
vacu.packages = ''
tpm2-tss
mdadm
'';
fileSystems."/boot" = {
device = "${wdc_sn530}-part1";

View File

@@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
{
imports = [
./hardware-configuration.nix
@@ -41,13 +41,13 @@
services.xserver.enable = false;
vacu.packages =
(with pkgs; [
vacu.packages = lib.mkMerge [
''
zfs
openvpn
cryptsetup
])
++ [
''
[
config.services.postgresql.package
(pkgs.writeScriptBin "into-nix-cache" ''
#!${pkgs.bash}/bin/bash
@@ -63,7 +63,9 @@
)
"''${cmd[@]}"
'')
];
]
];
hardware.graphics.extraPackages = [
pkgs.intel-compute-runtime
pkgs.ocl-icd