restructured directories + modularized btrfs mount
This commit is contained in:
147
base.nix
Normal file
147
base.nix
Normal file
@@ -0,0 +1,147 @@
|
||||
{ config, lib, pkgs, ... }: {
|
||||
system = {
|
||||
copySystemConfiguration = true;
|
||||
stateVersion = "23.11";
|
||||
};
|
||||
time = {
|
||||
timeZone = "America/Mexico_City";
|
||||
hardwareClockInLocalTime = true;
|
||||
};
|
||||
i18n = {
|
||||
defaultLocale = "en_CA.UTF-8";
|
||||
extraLocaleSettings = { LC_MONETARY = "es_MX.UTF-8"; };
|
||||
};
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "us";
|
||||
# useXkbConfig = true; # use xkbOptions in tty.
|
||||
};
|
||||
security = {
|
||||
polkit.enable = true;
|
||||
sudo = {
|
||||
enable = true;
|
||||
wheelNeedsPassword = false;
|
||||
};
|
||||
pam.loginLimits = [{
|
||||
domain = "*";
|
||||
type = "soft";
|
||||
item = "nofile";
|
||||
value = "8192";
|
||||
}];
|
||||
};
|
||||
nix = {
|
||||
optimise.automatic = true;
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
};
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
substituters = [
|
||||
"https://nix-gaming.cachix.org"
|
||||
"https://nixpkgs-python.cachix.org"
|
||||
"https://devenv.cachix.org"
|
||||
"https://cuda-maintainers.cachix.org"
|
||||
"https://ai.cachix.org"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
||||
"nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU="
|
||||
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
|
||||
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
|
||||
"ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc="
|
||||
];
|
||||
};
|
||||
};
|
||||
users.groups.piracy.gid = 985;
|
||||
environment = {
|
||||
systemPackages = with pkgs; [ wget ];
|
||||
variables = rec {
|
||||
# PATH
|
||||
XDG_CACHE_HOME = "\${HOME}/.cache";
|
||||
XDG_CONFIG_HOME = "\${HOME}/.config";
|
||||
XDG_BIN_HOME = "\${HOME}/.local/bin";
|
||||
XDG_DATA_HOME = "\${HOME}/.local/share";
|
||||
XDG_STATE_HOME = "\${HOME}/.local/state";
|
||||
|
||||
# DEV PATH
|
||||
CABAL_DIR = "${XDG_CACHE_HOME}/cabal";
|
||||
CARGO_HOME = "${XDG_DATA_HOME}/cargo";
|
||||
GEM_HOME = "${XDG_DATA_HOME}/ruby/gems";
|
||||
GEM_PATH = "${XDG_DATA_HOME}/ruby/gems";
|
||||
GEM_SPEC_CACHE = "${XDG_DATA_HOME}/ruby/specs";
|
||||
GOPATH = "${XDG_DATA_HOME}/go";
|
||||
NPM_CONFIG_USERCONFIG = "${XDG_CONFIG_HOME}/npm/npmrc";
|
||||
PNPM_HOME = "${XDG_DATA_HOME}/pnpm";
|
||||
PSQL_HISTORY = "${XDG_DATA_HOME}/psql_history";
|
||||
REDISCLI_HISTFILE = "${XDG_DATA_HOME}/redis/rediscli_history";
|
||||
WINEPREFIX = "${XDG_DATA_HOME}/wine";
|
||||
PYTHONSTARTUP = "${XDG_CONFIG_HOME}/python/pythonrc";
|
||||
STACK_ROOT = "${XDG_DATA_HOME}/stack";
|
||||
|
||||
# OPTIONS
|
||||
HISTFILE = "${XDG_STATE_HOME}/bash/history";
|
||||
LESSHISTFILE = "-";
|
||||
GHCUP_USE_XDG_DIRS = "true";
|
||||
RIPGREP_CONFIG_PATH = "${XDG_CONFIG_HOME}/ripgrep/ripgreprc";
|
||||
ELECTRUMDIR = "${XDG_DATA_HOME}/electrum";
|
||||
VISUAL = "emacsclient -ca emacs";
|
||||
WGETRC = "${XDG_CONFIG_HOME}/wgetrc";
|
||||
XCOMPOSECACHE = "${XDG_CACHE_HOME}/X11/xcompose";
|
||||
"_JAVA_OPTIONS" = "-Djava.util.prefs.userRoot=${XDG_CONFIG_HOME}/java";
|
||||
DOCKER_CONFIG = "${XDG_CONFIG_HOME}/docker";
|
||||
|
||||
# NVIDIA
|
||||
CUDA_CACHE_PATH = "${XDG_CACHE_HOME}/nv";
|
||||
|
||||
# Themes
|
||||
# WEBKIT_DISABLE_COMPOSITING_MODE = "1";
|
||||
CALIBRE_USE_SYSTEM_THEME = "1";
|
||||
|
||||
PATH = [
|
||||
"\${HOME}/.local/bin"
|
||||
"${XDG_CONFIG_HOME}/emacs/bin"
|
||||
"${XDG_DATA_HOME}/npm/bin"
|
||||
"${XDG_DATA_HOME}/pnpm"
|
||||
];
|
||||
};
|
||||
};
|
||||
programs = {
|
||||
starship.enable = true;
|
||||
tmux.enable = true;
|
||||
fzf.fuzzyCompletion = true;
|
||||
neovim = {
|
||||
enable = true;
|
||||
vimAlias = true;
|
||||
};
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
};
|
||||
services = {
|
||||
smartd.enable = true;
|
||||
fstrim.enable = true;
|
||||
btrfs.autoScrub = {
|
||||
enable = true;
|
||||
fileSystems = [ "/" ];
|
||||
};
|
||||
avahi = {
|
||||
enable = true;
|
||||
nssmdns = true;
|
||||
};
|
||||
openssh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
startWhenNeeded = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
PermitRootLogin = "prohibit-password";
|
||||
KbdInteractiveAuthentication = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
fonts.fontconfig.enable = true;
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||
}
|
||||
Reference in New Issue
Block a user