configuration/hosts/main/home.nix
2022-06-22 10:29:27 -07:00

77 lines
2 KiB
Nix

{ config, lib, pkgs, ... }:
let
organize-downloads = pkgs.writeShellScriptBin "organize-downloads" (with pkgs; ''
set -Eeuo pipefail
shopt -s nullglob
mkdir -p '/home/ak/screenshots'
for source in /home/ak/Downloads/Screen{s,\ S}hot\ *.png; do
destination="/home/ak/screenshots/$(basename "$source")"
mv --no-clobber --verbose "$source" "$destination"
${oxipng}/bin/oxipng --quiet --opt '4' --strip 'safe' --interlace '0' "$destination"
done
'');
in
{
imports = [
../../common/home.nix
];
# Nix
home.stateVersion = "21.05"; # Permanent
# Authentication
xdg.configFile."Yubico/u2f_keys".source = ./local/andrew.u2f;
# Keyboard
# TODO: Clear `~/.cache/gtk-3.0/compose` on change
home.file.".XCompose".text =
(builtins.readFile ../../common/Compose) +
(builtins.readFile ./local/Compose);
# Services
systemd.user.paths.organize-downloads = {
Unit.Description = "Watch downloads";
Path.PathExistsGlob = "%h/Downloads/Screen{s,\\ S}hot\\ *.png";
Install.WantedBy = [ "default.target" ];
};
systemd.user.services.organize-downloads = {
Unit.Description = "Organize downloads";
Service.ExecStart = "${organize-downloads}/bin/organize-downloads";
Service.Nice = 10;
};
# Applications
home.packages = with pkgs; [
awscli2
calibre
chromium
digikam
gpsprune
hugin
jitsi-meet-electron
josm
libreoffice
minecraft
qownnotes
signal-desktop
thunderbird
tor-browser-bundle-bin
transmission-gtk
vagrant
youtube-dl
(pkgs.yarn2nix-moretea.mkYarnWorkspace {
src = /home/ak/akorg/project/current/andrew.kvalhe.im/andrew.kvalhe.im;
}).attachments
];
home.file.".mozilla/firefox/ahrdm58c.default/chrome/userChrome.css".source = ../../common/userChrome.css;
home.file.".mozilla/firefox/ahrdm58c.default/persdict.dat".source = ../../common/words.txt;
# Environment
home.sessionPath = [ "$HOME/.cargo/bin" ];
home.sessionVariables.ATTACHMENTS_ENV = "/home/ak/.attachments.env";
}