flake/modules/nixos/system/nix-settings.nix
2025-11-06 08:48:01 +03:00

71 lines
1.5 KiB
Nix

{
inputs,
lib,
config,
...
}:
{
config = lib.mkIf config.osbmModules.nixSettings.enable {
# Allow unfree packages
nixpkgs = {
config = {
allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"vscode"
"discord"
"obsidian"
"steam"
"steam-unwrapped"
"open-webui"
"vscode-extension-github-copilot"
"spotify"
"cursor"
# NVIDIA related
"libcurand"
"nvidia-x11"
"cuda_cudart"
"cuda_nvcc"
"cuda_cccl"
"libcublas"
"libcusparse"
"libnvjitlink"
"libcufft"
"cudnn"
"cuda_nvrtc"
"libnpp"
"nvidia-settings"
# blender with cuda is not foss?!?
"blender"
];
allowAliases = false
};
# Enable Nix flakes
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
trusted-users = [
"root"
config.osbmModules.defaultUser
];
};
optimise.automatic = true;
channel.enable = false;
registry = lib.mkIf (inputs ? self && inputs ? nixpkgs) {
self.flake = inputs.self;
nixpkgs.flake = inputs.nixpkgs;
osbm-nvim = lib.mkIf (inputs ? osbm-nvim) {
flake = inputs.osbm-nvim;
};
};
};
system.configurationRevision = inputs.self.rev or "dirty";
};
}