mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-25 02:08:29 +02:00
feat: simplify flake.nix
This commit is contained in:
41
modules/darwin/nix-core.nix
Normal file
41
modules/darwin/nix-core.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
###################################################################################
|
||||
#
|
||||
# Core configuration for nix-darwin
|
||||
#
|
||||
# All the configuration options are documented here:
|
||||
# https://daiderd.com/nix-darwin/manual/index.html#sec-options
|
||||
#
|
||||
###################################################################################
|
||||
|
||||
# enable flakes globally
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Auto upgrade nix package and the daemon service.
|
||||
services.nix-daemon.enable = true;
|
||||
# Use this instead of services.nix-daemon.enable if you
|
||||
# don't wan't the daemon service to be managed for you.
|
||||
# nix.useDaemon = true;
|
||||
|
||||
nix.package = pkgs.nix;
|
||||
|
||||
programs.nix-index.enable = true;
|
||||
|
||||
# boot.loader.grub.configurationLimit = 10;
|
||||
# do garbage collection weekly to keep disk usage low
|
||||
nix.gc = {
|
||||
automatic = lib.mkDefault true;
|
||||
options = lib.mkDefault "--delete-older-than 1w";
|
||||
};
|
||||
|
||||
# Manual optimise storage: nix-store --optimise
|
||||
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
|
||||
nix.settings.auto-optimise-store = true;
|
||||
}
|
||||
Reference in New Issue
Block a user