os/modules/nix/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

80 lines
1.8 KiB
Nix
Raw Normal View History

{
2022-11-22 11:30:54 +00:00
config,
pkgs,
lib,
flake,
2022-11-22 11:30:54 +00:00
...
}: {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"1password"
"1password-cli"
"brscan5"
"brscan5-etc-files"
"facetimehd-firmware"
"slack"
2024-06-20 16:26:22 +00:00
"uhk-agent"
"uhk-udev-rules"
"veracrypt"
"zoom"
];
system.activationScripts.diff-closures = {
text =''
if [[ -e /run/current-system ]]; then
${config.nix.package}/bin/nix store diff-closures \
/run/current-system "$systemConfig" \
--extra-experimental-features nix-command
fi
'';
supportsDryActivation = true;
};
nix = {
2024-05-27 08:58:26 +00:00
# Use lix (forked nix)
package = pkgs.lix;
gc.automatic = true;
optimise.automatic = true;
registry = {
nixpkgs.flake = flake.inputs.nixpkgs;
2024-08-08 20:33:57 +00:00
unstable.flake = flake.inputs.unstable;
system.flake = flake.self;
};
2022-11-22 11:30:54 +00:00
settings = {
# Improve nix store disk usage
auto-optimise-store = true;
# Prevents impurities in builds
sandbox = true;
# Give root and @wheel special privileges with nix
2022-11-22 11:30:54 +00:00
trusted-users = ["root" "@wheel"];
# Allow only group wheel to connect to the nix daemon
allowed-users = ["@wheel"];
substituters = [
"https://pub-solar.cachix.org/"
];
trusted-public-keys = [
"pub-solar.cachix.org-1:ZicXIxKgdxMtgSJECWR8iihZxHRvu8ObL4n2cuBmtos="
];
2022-11-22 11:30:54 +00:00
};
# Generally useful nix option defaults
extraOptions = lib.mkForce ''
experimental-features = flakes nix-command
min-free = 536870912
keep-outputs = true
keep-derivations = true
fallback = true
'';
nixPath = [
"nixpkgs=${flake.inputs.nixpkgs}"
"nixos-config=${../../lib/compat/nixos}"
"home-manager=${flake.inputs.home-manager}"
];
};
}