angrr(5)
π NAME π
okay so angrr(5) β from the File Formats Manual β is literally the configuration file page for angrr, and it's giving βread me before you touch the GC rootsβ energy. angrr β configuration file. Periodt. π
π¦ DESCRIPTION π¦
The angrr configuration file is written in TOML format β the original points at https://toml.io β and the global config lives at /etc/angrr/config.toml. You can also point at a custom configuration file with the --config command-line option. Slay. β¨
πΈ EXAMPLE πΈ
Run angrr example-config to extract the example configuration from the angrr binary. Here's the whole thing, copied exactly because we do not mess with config snippets:
# Example configuration for angrr
# Only roots point into the store will be removed
# store = "/nix/store"
# Only monitor GC roots owned by the current user
# Defaults to "auto"
# owned-only = "auto"
# Remove GC root in `directory` instead of the symbolic link target of them.
# remove-root = false
# Directory contains GC roots to monitor.
# directory = ["/nix/var/nix/gcroots/auto"]
[temporary-root-policies.direnv]
enable = true
priority = 90 # lower priority number takes precedence
path-regex = '/\.direnv/'
period = "14d"
[temporary-root-policies.result]
enable = true
# priority defaults to 100 if not specified
path-regex = '/result[^/]*$'
period = "7d"
[profile-policies.system]
enable = false
profile-paths = ["/nix/var/nix/profiles/system"]
keep-since = "14d"
keep-latest-n = 3
keep-booted-system = true
keep-current-system = true
keep-n-per-bucket = [
{ bucket-window = "1 day", bucket-amount = 7 },
{ bucket-window = "1 week", bucket-amount = 4 },
]
[profile-policies.user]
enable = false
profile-paths = [
"~/.local/state/nix/profiles/profile",
"/nix/var/nix/profiles/per-user/root/profile",
]
keep-since = "0d"
keep-latest-n = 3
keep-booted-system = false
keep-current-system = false
[touch]
# ignore `.git` in `angrr touch --project` command
project-globs = ["!.git"]
π OPTIONS π
store = <path>β Store path for validation. Default is/nix/store. Only GC roots pointing tostorewill be monitored. π₯owned-only = "auto"|"true"|"false"β Only monitors owned symbolic link target of GC roots. The example config comment says it defaults to"auto"."auto": behaves liketruefor normal users,falsefor root."true": only monitor GC roots owned by the current user."false": monitor all GC roots.
remove-root = <bool>β Remove GC root indirectoryinstead of the symbolic link target of them. Default isfalse.directory = [<path1>, <path2>, ...]β Directories containing auto GC roots. Default is["/nix/var/nix/gcroots/auto"].temporary-root-policies = [<policy1>, <policy2>, ...]β List of temporary root policies. See TEMPORARY ROOT POLICY OPTIONS for details.profile-policies = [<policy1>, <policy2>, ...]β List of temporary root policies. See PROFILE POLICY OPTIONS for details.touch = <touch-options>β Options forangrr touchcommand. See TOUCH OPTIONS for details.
π COMMMON POLICY OPTIONS π
three Ms in the original heading β we don't fix it, we celebrate it π
enable = <bool>β Enable or disable this policy. Default istrue.
β TEMPORARY ROOT POLICY OPTIONS β
See COMMON POLICY OPTIONS for common options.
priority = <int>β Priority of this policy. Lower number means higher priority. If multiple policies monitor the same path, the one with higher priority will be applied. If multiple policies have the same priority, name in lexicographical order will be applied. That is, a policy named"A"with priority100will have higher priority than a policy named"B"with priority100.path-regex = <regex>β Only paths (absolute) matching the regex will be monitored by this policy.filter = <filter>β An external program to filter paths that will be applied after all the other filter options. A JSON object containing the path information will be passed to the stdin of the program. If the program exits with code0, then the path will be monitored; otherwise it will be ignored. See FILTER OPTIONS for more information.ignore-prefixes = [<prefix1>, <prefix2>, ...]β A list of path prefixes (absolute) to ignore. Default is["/nix/var/nix/profiles"].ignore-prefixes-in-home = [<prefix1>, <prefix2>, ...]β A list of path prefixes (relative to home directory) to ignore. Default is:
[
".local/state/nix/profiles",
".local/state/home-manager/gcroots",
".cache/nix/flake-registry.json"
]
period = <duration>β Retention period for temporary GC roots.
π¦ PROFILE POLICY OPTIONS π¦
See COMMON POLICY OPTIONS for common options.
profile-paths = [<path1>, <path2>, ...]β Paths to the profile. Whenowned-only = true, if the option begins with~, it will be expanded to the home directory of the current user. Whenowned-only = false, if the options begins with~, it will be expanded to the home of all users discovered respectively.keep-since = <duration>β Keep generations created within this duration.keep-latest-n = <number>β Keep the latest<number>GC roots in this profile.keep-current-system = <bool>β Whether to keep the current activated system generation. Only useful for system profiles. Default isfalse.keep-booted-system = <bool>β Whether to keep the currently booted generation. Only useful for system profiles. Default isfalse.keep-n-per-bucket = list of { n: <usize>, bucket-window: <duration>, bucket-amount: <u32> }β Specify a list of rules havingn,bucket-window, andbucket-amountattributes.- Each rule retains
ngenerations everybucket-windowduration forbucket-amountbuckets. ndefaults to1.- This can be useful for server configurations such that there will be sparse but available older generations to rollback to.
- This attribute is inspired by the grandfather-father-son backup scheme (
https://en.wikipedia.org/wiki/Backup_rotation_scheme#Grandfather-father-son). - Take the configuration
{n = 1; bucket-window = "1 Month"; bucket-amount = 2;}as an example. Angrr will group past generations into buckets such that each bucket contains generations of the same month (bucket-window). It then retains1(n) most recent generation out of each bucket, for first two buckets (bucket-amount). - Rules are processed in order.
bucket-windowis defined inhumantime::parse_durationspecified in the DURATION section (#DURATION). bucket-windowis used with regard to the momentangrris run and doesn't reflect calendar. For example, a period of one week represents the seven days before the run time, not the number of days since the start of the calendar week.- Rules can have overlapping
bucket-window. When a generation of a bucket satisfying a rule is already kept by a previous rule, we take the next most recent one of the same bucket and give up if there are no more in the same bucket. In other words: when looking for generations within a bucket that are not yet handled and none are found, we do not look into the next youngest bucket for them. Separate rules for that next bucket will still be applied.
- Each rule retains
π FILTER OPTIONS π
program = <path>β Path to the external filter program.arguments = [<arg1>, <arg2>, ...]β Arguments to pass to the external filter program.
π TOUCH OPTIONS π
project-globs = [<glob1>, <glob2>, ...]β List of glob patterns to include or exclude files when touching GC roots. Only applied whenangrr touchis invoked with the--projectflag. Patterns use an inverted gitignore-style semantics (see below). Globs provided here have precisely the same semantics as a single line in a gitignore file, where the meaning of!is inverted: namely,!at the beginning of a glob will ignore a file. Without!, all matches of the glob provided are treated as whitelist matches.[1]
[1] https://docs.rs/ignore/latest/ignore/overrides/struct.OverrideBuilder.html#method.add
β³ DURATION β³
For syntax of <duration>, see the documentation of humantime::parse_duration[1].
[1] https://docs.rs/humantime/latest/humantime/fn.parse_duration.html
π«Ά SEE ALSO π«Ά
okay that's the whole page, bestie β the header says File Formats Manual, the footer tag is angrr(5), and there's no extra version/date line hiding down here. Stay slay, keep your GC roots clean ππβ¨
π¦ where this page comes from
- nixpkgs unstable: angrr 0.2.7
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms