2021-02-28 11:26:22 -08:00
|
|
|
{ pkgs, config, lib, ... }:
|
2020-01-17 01:22:50 -08:00
|
|
|
{
|
2020-10-26 02:48:12 -07:00
|
|
|
imports = [
|
2021-02-21 07:25:58 -08:00
|
|
|
../home.nix
|
2020-10-26 02:48:12 -07:00
|
|
|
./hardware-configuration.nix
|
|
|
|
];
|
2020-01-17 01:22:50 -08:00
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
## Modules
|
2020-03-28 22:48:43 -07:00
|
|
|
modules = {
|
|
|
|
desktop = {
|
|
|
|
bspwm.enable = true;
|
2020-10-01 15:46:04 -07:00
|
|
|
apps = {
|
|
|
|
discord.enable = true;
|
|
|
|
rofi.enable = true;
|
|
|
|
# godot.enable = true;
|
2021-02-20 14:53:32 -08:00
|
|
|
signal.enable = true;
|
2020-10-01 15:46:04 -07:00
|
|
|
};
|
|
|
|
browsers = {
|
2021-01-20 00:18:33 -08:00
|
|
|
default = "brave";
|
|
|
|
brave.enable = true;
|
2020-10-01 15:46:04 -07:00
|
|
|
firefox.enable = true;
|
2021-02-01 21:24:47 -08:00
|
|
|
qutebrowser.enable = true;
|
2020-10-01 15:46:04 -07:00
|
|
|
};
|
|
|
|
gaming = {
|
|
|
|
steam.enable = true;
|
|
|
|
# emulators.enable = true;
|
|
|
|
# emulators.psx.enable = true;
|
|
|
|
};
|
|
|
|
media = {
|
|
|
|
daw.enable = true;
|
|
|
|
documents.enable = true;
|
|
|
|
graphics.enable = true;
|
|
|
|
mpv.enable = true;
|
|
|
|
recording.enable = true;
|
|
|
|
spotify.enable = true;
|
|
|
|
};
|
|
|
|
term = {
|
|
|
|
default = "xst";
|
|
|
|
st.enable = true;
|
|
|
|
};
|
|
|
|
vm = {
|
|
|
|
qemu.enable = true;
|
|
|
|
};
|
2020-03-28 22:48:43 -07:00
|
|
|
};
|
2021-08-05 22:32:21 -07:00
|
|
|
dev = {
|
|
|
|
node.enable = true;
|
|
|
|
rust.enable = true;
|
|
|
|
python.enable = true;
|
|
|
|
};
|
2020-03-28 22:48:43 -07:00
|
|
|
editors = {
|
2020-10-23 17:55:15 -07:00
|
|
|
default = "nvim";
|
2020-03-28 22:48:43 -07:00
|
|
|
emacs.enable = true;
|
|
|
|
vim.enable = true;
|
|
|
|
};
|
|
|
|
shell = {
|
2021-02-09 19:00:17 -08:00
|
|
|
adl.enable = true;
|
2021-08-09 08:18:25 -07:00
|
|
|
vaultwarden.enable = true;
|
2020-03-28 22:48:43 -07:00
|
|
|
direnv.enable = true;
|
2020-10-01 15:46:04 -07:00
|
|
|
git.enable = true;
|
|
|
|
gnupg.enable = true;
|
|
|
|
tmux.enable = true;
|
|
|
|
zsh.enable = true;
|
2020-03-28 22:48:43 -07:00
|
|
|
};
|
|
|
|
services = {
|
2020-10-01 15:46:04 -07:00
|
|
|
ssh.enable = true;
|
2021-04-13 17:25:38 -07:00
|
|
|
docker.enable = true;
|
2020-10-21 12:49:45 -07:00
|
|
|
# Needed occasionally to help the parental units with PC problems
|
|
|
|
# teamviewer.enable = true;
|
2020-03-28 22:48:43 -07:00
|
|
|
};
|
2020-10-23 17:54:25 -07:00
|
|
|
theme.active = "alucard";
|
2020-03-28 22:48:43 -07:00
|
|
|
};
|
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
|
|
|
|
## Local config
|
2020-04-27 16:20:50 -07:00
|
|
|
programs.ssh.startAgent = true;
|
2020-10-14 10:48:38 -07:00
|
|
|
services.openssh.startWhenNeeded = true;
|
2020-10-01 15:46:04 -07:00
|
|
|
|
2020-01-17 01:22:50 -08:00
|
|
|
networking.networkmanager.enable = true;
|
2020-10-01 15:46:04 -07:00
|
|
|
# The global useDHCP flag is deprecated, therefore explicitly set to false
|
|
|
|
# here. Per-interface useDHCP will be mandatory in the future, so this
|
|
|
|
# generated config replicates the default behaviour.
|
|
|
|
networking.useDHCP = false;
|
2021-02-27 21:23:08 -08:00
|
|
|
|
|
|
|
|
2021-02-28 11:26:22 -08:00
|
|
|
## Personal backups
|
2021-02-28 09:59:03 -08:00
|
|
|
# Syncthing is a bit heavy handed for my needs, so rsync to my NAS instead.
|
2021-02-27 21:23:08 -08:00
|
|
|
systemd = {
|
|
|
|
services.backups = {
|
2021-02-28 11:26:22 -08:00
|
|
|
description = "Backup /usr/store to NAS";
|
2021-02-27 21:23:08 -08:00
|
|
|
wants = [ "usr-drive.mount" ];
|
|
|
|
path = [ pkgs.rsync ];
|
|
|
|
environment = {
|
|
|
|
SRC_DIR = "/usr/store";
|
|
|
|
DEST_DIR = "/usr/drive";
|
|
|
|
};
|
|
|
|
script = ''
|
|
|
|
rcp() {
|
|
|
|
if [[ -d "$1" && -d "$2" ]]; then
|
|
|
|
echo "---- BACKUPING UP $1 TO $2 ----"
|
2021-02-28 11:26:22 -08:00
|
|
|
rsync -rlptPJ --chmod=go= --delete --delete-after \
|
|
|
|
--exclude=lost+found/ \
|
|
|
|
--exclude=@eaDir/ \
|
2021-02-27 21:23:08 -08:00
|
|
|
--include=.git/ \
|
|
|
|
--filter=':- .gitignore' \
|
|
|
|
--filter=':- $XDG_CONFIG_HOME/git/ignore' \
|
|
|
|
"$1" "$2"
|
|
|
|
fi
|
|
|
|
}
|
2021-02-28 11:26:22 -08:00
|
|
|
rcp "$HOME/projects/" "$DEST_DIR/projects"
|
|
|
|
rcp "$SRC_DIR/" "$DEST_DIR"
|
2021-02-27 21:23:08 -08:00
|
|
|
'';
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
Nice = 19;
|
|
|
|
IOSchedulingClass = "idle";
|
|
|
|
User = config.user.name;
|
2021-02-28 11:26:22 -08:00
|
|
|
Group = config.user.group;
|
2021-02-27 21:23:08 -08:00
|
|
|
};
|
|
|
|
};
|
2021-02-28 11:26:22 -08:00
|
|
|
timers.backups = {
|
2021-02-27 21:23:08 -08:00
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
partOf = [ "backups.service" ];
|
2021-02-28 11:26:22 -08:00
|
|
|
timerConfig.OnCalendar = "*-*-* 00,12:00:00";
|
|
|
|
timerConfig.Persistent = true;
|
2021-02-27 21:23:08 -08:00
|
|
|
};
|
|
|
|
};
|
2020-01-17 01:22:50 -08:00
|
|
|
}
|