mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-05 16:27:03 +00:00
Update nix.gc
module with same indenting/formatting as NixOS module
This commit is contained in:
parent
f75b461ae2
commit
c027fb5ee5
1 changed files with 40 additions and 26 deletions
|
@ -1,4 +1,6 @@
|
||||||
{ config, lib, pkgs, ... }:
|
# Based off: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/nix-gc.nix
|
||||||
|
# When making changes please try to keep it in sync.
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -7,36 +9,48 @@ let
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
nix.gc.automatic = mkOption {
|
|
||||||
type = types.bool;
|
nix.gc = {
|
||||||
default = false;
|
|
||||||
description = "Automatically run the garbage collector at a specific time.";
|
automatic = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Automatically run the garbage collector at a specific time.";
|
||||||
|
};
|
||||||
|
|
||||||
|
user = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = "User that runs the garbage collector.";
|
||||||
|
};
|
||||||
|
|
||||||
|
interval = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = { Hour = 3; Minute = 15; };
|
||||||
|
description = "The time interval at which the garbage collector will run.";
|
||||||
|
};
|
||||||
|
|
||||||
|
options = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
example = "--max-freed $((64 * 1024**3))";
|
||||||
|
description = ''
|
||||||
|
Options given to <filename>nix-collect-garbage</filename> when the
|
||||||
|
garbage collector is run automatically.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.gc.user = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
default = null;
|
|
||||||
description = "User that runs the garbage collector.";
|
|
||||||
};
|
|
||||||
|
|
||||||
nix.gc.interval = mkOption {
|
|
||||||
type = types.attrs;
|
|
||||||
default = { Hour = 3; Minute = 15; };
|
|
||||||
description = "The time interval at which the garbage collector will run.";
|
|
||||||
};
|
|
||||||
|
|
||||||
nix.gc.options = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "";
|
|
||||||
example = "--max-freed $((64 * 1024**3))";
|
|
||||||
description = ''
|
|
||||||
Options given to <filename>nix-collect-garbage</filename> when the
|
|
||||||
garbage collector is run automatically.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
config = mkIf cfg.automatic {
|
config = mkIf cfg.automatic {
|
||||||
|
|
||||||
launchd.daemons.nix-gc = {
|
launchd.daemons.nix-gc = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue