Skip to content

System

Source directory: modules/system/

default.nix

modules/system/default.nix

No option declarations; see source for implementation.

fstrim-optimization.nix

modules/system/fstrim-optimization.nix

FSTRIM Boot Optimization Module Prevents fstrim from blocking boot by ensuring timer-only operation

  • Enable option: FSTRIM boot optimization to prevent boot blocking

Options: enable, preventBootBlocking

Options declaration (Nix)
  options.services.fstrim-optimization = {
    enable = mkEnableOption "FSTRIM boot optimization to prevent boot blocking";

    preventBootBlocking = mkOption {
      type = types.bool;
      default = true;
      description = ''
        Prevent fstrim from running during boot and blocking the boot process.
        This ensures fstrim only runs via timer.
      '';
    };
  }

logging.nix

modules/system/logging.nix

Logging configuration for reduced noise

  • Enable option: Enable log filtering for noise reduction

Options: enableFiltering, filterRules

Options declaration (Nix)
  options.system.logging = {
    enableFiltering = mkEnableOption "Enable log filtering for noise reduction";

    filterRules = mkOption {
      type = types.listOf types.str;
      default = [ ];
      description = "List of log filtering rules";
    };
  }

performance.nix

modules/system/performance.nix

  • Enable option: system performance optimizations

Options: enable, extraCaches, extraTrustedKeys, frequency, deleteOlderThan, maxJobs, cores

Options declaration (Nix)
  options.modules.system.performance = {
    enable = mkEnableOption "system performance optimizations";

    binaryCache = {
      enable = mkOption {
        type = types.bool;
        default = true;
        description = "Enable binary cache optimization";
      };

      extraCaches = mkOption {
        type = types.listOf types.str;
        default = [ ];
        description = "Additional binary caches to use";
        example = [ "https://devenv.cachix.org" ];
      };

      extraTrustedKeys = mkOption {
        type = types.listOf types.str;
        default = [ ];
        description = "Additional trusted public keys";
        example = [ "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" ];
      };
    };

    garbageCollection = {
      enable = mkOption {
        type = types.bool;
        default = true;
        description = "Enable automatic garbage collection";
      };

      frequency = mkOption {
        type = types.str;
        default = "weekly";
        description = "How often to run garbage collection";
        example = "daily";
      };

      deleteOlderThan = mkOption {
        type = types.str;
        default = "30d";
        description = "Delete store paths older than this";
        example = "7d";
      };
    };

    buildOptimization = {
      maxJobs = mkOption {
        type = types.either types.int (types.enum [ "auto" ]);
        default = "auto";
        description = "Maximum number of build jobs";
      };

      cores = mkOption {
        type = types.int;
        default = 0;
        description = "Number of CPU cores to use (0 = all available)";
      };
    };
  }