This repository has been archived on 2024-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
nixos/nix.nix
Payas Relekar 0d0b6c7d2c Refactor some parts into separate files
Move some logically independent and consisitent parts into separate
modules (files):

        1. Nix config :
           Package, experimental options, automatic garbage-collection config
        2. Backups :
           Restic + rclone + systemd services for backup notifications

This has reduced main configuration.nix by 100+ lines. These parts are also
unlikely to be touched in tandem with other configuration and hence can be
separated out.
2022-02-14 16:15:27 +05:30

24 lines
581 B
Nix

{ config, lib, options, pkgs, ... }:
{
nix = {
# Enable Flakes systemwide, and set gc-roots for nix-direnv
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes ca-derivations
keep-outputs = true
keep-derivations = true
'';
# Automated gabrage collection
gc = {
automatic = true;
dates = "20:30";
options = "--delete-older-than 5d";
};
# Auto-optimize nix-store, create hard-links to save space on /nix/store
settings = {
auto-optimise-store = true;
};
};
}