2020-01-17 01:22:50 -08:00
|
|
|
# hosts/personal.nix --- settings common to my personal systems
|
2020-01-12 15:17:17 -08:00
|
|
|
|
2020-01-17 13:13:14 -08:00
|
|
|
{ config, lib, pkgs, ... }:
|
2020-01-12 15:17:17 -08:00
|
|
|
{
|
2020-03-28 22:48:43 -07:00
|
|
|
imports = [ ./common.nix ];
|
2020-01-12 15:17:17 -08:00
|
|
|
|
2020-01-17 02:48:17 -08:00
|
|
|
# Support for more filesystems
|
2020-01-12 15:17:17 -08:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
exfat
|
|
|
|
ntfs3g
|
|
|
|
hfsprogs
|
|
|
|
];
|
|
|
|
|
2020-01-17 01:22:50 -08:00
|
|
|
# Nothing in /tmp should survive a reboot
|
|
|
|
boot.tmpOnTmpfs = true;
|
|
|
|
# Use simple bootloader; I prefer the on-demand BIOs boot menu
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
2020-01-14 03:56:02 -08:00
|
|
|
|
|
|
|
### Universal defaults
|
|
|
|
networking.firewall.enable = true;
|
2020-01-17 01:22:50 -08:00
|
|
|
networking.hosts = {
|
|
|
|
"192.168.1.2" = [ "ao" ];
|
|
|
|
"192.168.1.3" = [ "aka" ];
|
|
|
|
"192.168.1.10" = [ "kuro" ];
|
|
|
|
"192.168.1.11" = [ "shiro" ];
|
|
|
|
"192.168.1.12" = [ "midori" ];
|
|
|
|
};
|
2020-01-17 13:13:14 -08:00
|
|
|
|
|
|
|
|
|
|
|
### A tidy $HOME is a tidy mind
|
|
|
|
# Obey XDG conventions;
|
|
|
|
my.home.xdg.enable = true;
|
|
|
|
environment.variables = {
|
|
|
|
# These are the defaults, but some applications are buggy when these lack
|
|
|
|
# explicit values.
|
|
|
|
XDG_CONFIG_HOME = "$HOME/.config";
|
|
|
|
XDG_CACHE_HOME = "$HOME/.cache";
|
|
|
|
XDG_DATA_HOME = "$HOME/.local/share";
|
|
|
|
XDG_BIN_HOME = "$HOME/.local/bin";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Conform more programs to XDG conventions. The rest are handled by their
|
|
|
|
# respective modules.
|
|
|
|
my.env = {
|
|
|
|
__GL_SHADER_DISK_CACHE_PATH = "$XDG_CACHE_HOME/nv";
|
|
|
|
CUDA_CACHE_PATH = "$XDG_CACHE_HOME/nv";
|
|
|
|
HISTFILE = "$XDG_DATA_HOME/bash/history";
|
|
|
|
INPUTRC = "$XDG_CACHE_HOME/readline/inputrc";
|
|
|
|
LESSHISTFILE = "$XDG_CACHE_HOME/lesshst";
|
|
|
|
WGETRC = "$XDG_CACHE_HOME/wgetrc";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Prevents ~/.esd_auth files by disabling the esound protocol module for
|
|
|
|
# pulseaudio, which I likely don't need. Is there a better way?
|
|
|
|
hardware.pulseaudio.configFile =
|
|
|
|
let paConfigFile =
|
|
|
|
with pkgs; runCommand "disablePulseaudioEsoundModule"
|
|
|
|
{ buildInputs = [ pulseaudio ]; } ''
|
|
|
|
mkdir "$out"
|
|
|
|
cp ${pulseaudio}/etc/pulse/default.pa "$out/default.pa"
|
|
|
|
sed -i -e 's|load-module module-esound-protocol-unix|# ...|' "$out/default.pa"
|
|
|
|
'';
|
|
|
|
in lib.mkIf config.hardware.pulseaudio.enable
|
|
|
|
"${paConfigFile}/default.pa";
|
|
|
|
|
|
|
|
# Clean up leftovers, as much as we can
|
2020-04-05 22:57:44 -07:00
|
|
|
system.userActivationScripts.cleanupHome = ''
|
2020-01-17 13:13:14 -08:00
|
|
|
pushd /home/${config.my.username}
|
|
|
|
rm -rf .compose-cache .nv .pki .dbus .fehbg
|
|
|
|
[ -s .xsession-errors ] || rm -f .xsession-errors*
|
|
|
|
popd
|
|
|
|
'';
|
2020-01-12 15:17:17 -08:00
|
|
|
}
|