12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- { config, lib, inputs, ... }:
- with lib;
- {
- system.stateVersion = "24.05";
- nixpkgs.config.allowUnfree = mkDefault true;
- virtualisation.vmVariant.virtualisation = {
- cores = mkDefault 2;
- memorySize = mkDefault 4096;
- };
- environment = {
- sessionVariables.NIXPKGS_ALLOW_UNFREE = mkDefault "1";
- };
- nix = {
- # channel.enable = false;
- distributedBuilds = mkIf (config.nix.buildMachines != []) true;
- nixPath = [
- "nixpkgs=${inputs.nixpkgs}"
- ];
- registry = {
- # nix-config.flake = inputs.self;
- nixpkgs.flake = inputs.nixpkgs;
- home-manager.flake = inputs.home-manager;
- agenix.flake = inputs.agenix;
- };
- settings = {
- auto-optimise-store = true;
- builders-use-substitutes = true;
- experimental-features = [ "nix-command" "flakes" ];
- max-jobs = if config.nix.distributedBuilds then 0 else "auto";
- substituters = mkIf (!config.services.nix-serve.enable) (mkBefore [
- "https://nix.bad.net.ru/?priority=30"
- # "https://nix.notbad.dynv6.net/?priority=31"
- # "https://nix.badbayan.duckdns.org/?priority=31"
- ]);
- trusted-public-keys = mkBefore [
- "nix.bad.net.ru-1:jlTx0ty3f/d1Tb2D0Pj1O0l30/c7VpCmYLQ9Fc++xoM="
- "nix.notbad.dynv6.net-1:eN+lRGq8gGz5/PoGaAVYTnZStnEcIRHvhg+ZIn9I1TA="
- "nix.badbayan.duckdns.org-1:qI75l0GHxICLk1ftwwL1rPqcml+krIzOtZdrRs9Zrlk="
- ];
- trusted-users = [
- "root"
- "@wheel"
- ];
- warn-dirty = false;
- };
- gc = {
- automatic = true;
- dates = "weekly";
- options = "--delete-older-than 14d";
- };
- extraOptions = ''
- min-free = ${toString (1024 * 1024 * 1024)}
- max-free = ${toString (1024 * 1024 * 1024 * 4)}
- '';
- };
- }
|