Files
nix-config/modules/nixos/nix/default.nix
mjallen18 31202f8b0e upd
2025-12-11 17:41:05 -06:00

80 lines
1.9 KiB
Nix

{
config,
lib,
namespace,
...
}:
{
programs.ccache = {
enable = true;
packageNames = [
# "ffmpeg"
# "ffmpeg-full"
# "ffmpeg-headless-rpi"
# "gjs"
# "gst-plugins-bad"
# "gtk4"
# "jemalloc"
# "libcamera-rpi"
# "libraspberrypi"
# "libsecret"
# "linux"
# "opencv"
# "pipewire"
# "qemu"
# # qemu.pname
# "raspberrypi-utils"
# "sdl"
# "sdl2"
# "torch"
# "uv"
# "webkitgtk"
# # "yubioath-flutter"
];
cacheDir = "/var/cache/ccache"; # default location
};
# nixpkgs.overlays = [
# (self: super: {
# "jellyfin-ffmpeg" = super."jellyfin-ffmpeg".override { stdenv = super.ccacheStdenv; };
# })
# ];
nix = {
settings = {
extra-sandbox-paths = [ config.programs.ccache.cacheDir ];
substituters = [
"https://cache.mjallen.dev/nas-cache"
"https://nixos-raspberrypi.cachix.org"
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nas-cache:Y7PR+XTLr1bLIL85PKb9Tk9/BnE5HndTKvZYWVP1/48="
"nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
warn-dirty = lib.mkForce false;
experimental-features = lib.mkForce [
"nix-command"
"flakes"
];
trusted-users = [ "@wheel" ];
};
# Garbage collect automatically every week
gc.automatic = lib.mkDefault true;
gc.options = lib.mkDefault "--delete-older-than 30d";
optimise.automatic = lib.mkDefault true;
};
nixpkgs = {
config = {
cudaSupport = lib.mkDefault config.${namespace}.hardware.nvidia.enable;
rocmSupport = lib.mkDefault config.${namespace}.hardware.amd.enable;
allowUnsupportedSystem = true;
};
};
}