Initial shared NixOS modules
This commit is contained in:
56
system/default/nix.nix
Normal file
56
system/default/nix.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
{ ... }:
|
||||
{
|
||||
# Nix package manager configuration
|
||||
nix = {
|
||||
settings = {
|
||||
# Enable experimental features for modern Nix functionality
|
||||
# - "nix-command": Enables the new unified 'nix' command interface
|
||||
# - "flakes": Enables Nix flakes for reproducible and composable configurations
|
||||
experimental-features = "nix-command flakes";
|
||||
|
||||
# Specify which users are allowed to run nix commands
|
||||
allowed-users = [ "tb" ];
|
||||
|
||||
# Users who can act as trusted users (can override settings)
|
||||
# Trusted users can use --option flags and import from derivations
|
||||
trusted-users = [ "root" "tb" ];
|
||||
|
||||
# Show more lines of build output on failure
|
||||
log-lines = 50;
|
||||
};
|
||||
|
||||
# Automatic garbage collection configuration
|
||||
# Helps manage disk space by cleaning up unused store paths
|
||||
gc = {
|
||||
# Enable automatic garbage collection
|
||||
automatic = true;
|
||||
|
||||
# Delete store paths older than 30 days during garbage collection
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
|
||||
# Automatic store optimization configuration
|
||||
# Reduces disk usage by hard-linking identical files in the Nix store
|
||||
optimise = {
|
||||
# Enable automatic store optimization
|
||||
# This deduplicates files to save disk space
|
||||
automatic = true;
|
||||
|
||||
# Run optimization weekly
|
||||
dates = [ "weekly" ];
|
||||
};
|
||||
};
|
||||
|
||||
# Nixpkgs package collection configuration
|
||||
nixpkgs = {
|
||||
config = {
|
||||
# Allow installation of packages with non-free licenses
|
||||
# This includes proprietary software like Discord, Slack, etc.
|
||||
# Without this, only free/open-source packages can be installed
|
||||
allowUnfree = true;
|
||||
|
||||
# Allow packages marked as broken (use with caution)
|
||||
#allowBroken = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user