commented/tidied core.nix
This commit is contained in:
parent
19f5401986
commit
86640e26ce
1 changed files with 55 additions and 50 deletions
103
core/default.nix
103
core/default.nix
|
|
@ -19,10 +19,8 @@
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
## Make sure this is set !
|
|
||||||
system = { stateVersion = "24.11"; };
|
|
||||||
|
|
||||||
## Crikey !
|
## Crikey !
|
||||||
|
## Don't forget to set your& locale settings !
|
||||||
time.timeZone = "Australia/Brisbane";
|
time.timeZone = "Australia/Brisbane";
|
||||||
i18n = {
|
i18n = {
|
||||||
defaultLocale = "en_AU.UTF-8";
|
defaultLocale = "en_AU.UTF-8";
|
||||||
|
|
@ -38,76 +36,83 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
## Core security options
|
||||||
security = {
|
security = {
|
||||||
|
sudo.execWheelOnly = true; # sets sudo auth to @wheel only
|
||||||
## Sets sudo auth to @wheel only
|
#soteria.enable = true; # enables soteria polkit
|
||||||
sudo.execWheelOnly = true;
|
# - disabled forNow:tm: - https://github.com/NixOS/nixpkgs/issues/379104
|
||||||
|
polkit = { # enables system polkit ???
|
||||||
## Enables soteria polkit
|
|
||||||
## disabled forNow:tm: - https://github.com/NixOS/nixpkgs/issues/379104
|
|
||||||
#soteria.enable = true;
|
|
||||||
|
|
||||||
polkit = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
#extraConfig = '' '';
|
#extraConfig = '' '';
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
## Settings for the nix package manager and daemon
|
||||||
nix = {
|
nix = {
|
||||||
settings = {
|
settings = {
|
||||||
cores = 0;
|
cores = 0; # sets nix to use all available cores during rebuild
|
||||||
max-jobs = "auto";
|
max-jobs = "auto"; # automatically determines max job count
|
||||||
allow-dirty = false;
|
allow-dirty = false; # refuses to allow rebuilds when git tree is dirty
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true; # automatically optimised nix store on rebuild
|
||||||
download-buffer-size = [ "268435456" ];
|
download-buffer-size = [
|
||||||
allowed-users = [ "@wheel" ];
|
"268435456"
|
||||||
trusted-users = [ "root" "@wheel" "${primaryUser}" ];
|
]; # increased download buffer as it caused issues previously
|
||||||
## Enable flakes uwu,,, and some other junk idek
|
allowed-users = [ "@wheel" ]; # restricts `nix` command to @wheel
|
||||||
experimental-features =
|
trusted-users = [
|
||||||
[ "pipe-operators" "recursive-nix" "nix-command" "flakes" ];
|
"root"
|
||||||
|
"@wheel"
|
||||||
|
"${primaryUser}"
|
||||||
|
]; # adds root, @wheel, and ${primaryUser} to trusted users
|
||||||
|
experimental-features = [ # Enable flakes uwu,,, and some other junk idek
|
||||||
|
"pipe-operators" # who tf knows
|
||||||
|
"recursive-nix" # honestly I cannot rember
|
||||||
|
"nix-command" # useful nya
|
||||||
|
"flakes" # flakes are vv important nya
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
## Nix garbage collection
|
||||||
gc = {
|
gc = {
|
||||||
## Automatically run 'nix-collect-garbage'
|
automatic = true; # do garbage collection automagically
|
||||||
automatic = true;
|
dates = "daily"; # every day
|
||||||
## Ever day.
|
options = "--delete-older-than 7d"; # and clear junk older than x days
|
||||||
dates = "daily";
|
#persistent = true; # https://mynixos.com/nixpkgs/option/nix.gc.persistent
|
||||||
## and clear junk older than x days
|
};
|
||||||
options = "--delete-older-than 7d";
|
|
||||||
## https://mynixos.com/nixpkgs/option/nix.gc.persistent
|
|
||||||
#persistent = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
## Hardware settings
|
||||||
hardware = {
|
hardware = {
|
||||||
## Enable all firmware modules
|
enableAllFirmware = true; # enables all firmware modules
|
||||||
enableAllFirmware = true;
|
sensor.hddtemp = { # enables temperature readings for mechanical drives
|
||||||
sensor.hddtemp = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
drives = [ "/dev/disk/by-uuid/*" ];
|
drives =
|
||||||
|
[ "/dev/disk/by-uuid/*" ]; # tries to find drives with sensors by uuid
|
||||||
};
|
};
|
||||||
usbStorage.manageShutdown = true;
|
usbStorage.manageShutdown = true; # shrugge
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ man-pages ];
|
## Manual pages and caching
|
||||||
|
environment.systemPackages = with pkgs;
|
||||||
|
[ man-pages ]; # adds manual pages to system packages for ease of access
|
||||||
documentation = {
|
documentation = {
|
||||||
dev.enable = true;
|
dev.enable = true; # enables development documentation
|
||||||
man.generateCaches = true;
|
man.generateCaches =
|
||||||
|
true; # generates caches for manuals to save rebuild time
|
||||||
#nixos.includeAllModules = true;
|
#nixos.includeAllModules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
## Apparently prevents getting stuck at shutdown
|
## SystemD tweaks
|
||||||
systemd.extraConfig = "DefaultTimeoutStopSec=10s";
|
systemd = {
|
||||||
|
extraConfig =
|
||||||
## Disable these cuz they cause problems (thx sasha)
|
"DefaultTimeoutStopSec=10s"; # apparently prevents getting stuck at shutdown
|
||||||
## see: https://github.com/NixOS/nixpkgs/issues/180175
|
services = { # Disable these cuz they cause problems (thx sasha)
|
||||||
systemd.services = {
|
# see: https://github.com/NixOS/nixpkgs/issues/180175
|
||||||
networkManager-wait-online.enable = lib.mkForce false;
|
networkManager-wait-online.enable = lib.mkForce false;
|
||||||
systemd-networkd-wait-online.enable = lib.mkForce false;
|
systemd-networkd-wait-online.enable = lib.mkForce false;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
## Make sure this is set !
|
||||||
|
system = { stateVersion = "24.11"; };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue