Switch to autofs and upgrade Doom Emacs daily

This commit is contained in:
coolneng 2020-05-28 03:02:44 +02:00
parent 60bda7ed7a
commit 38d5815291
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 31 additions and 29 deletions

View File

@ -44,7 +44,6 @@
export SDL_VIDEODRIVER=wayland
export GTK_THEME=Adapta-Eta
'';
wrapperFeatures.gtk = true;
};
# Backlight
@ -172,34 +171,37 @@
};
# Automount external storage
systemd.mounts = [
# USB
{
what = "/dev/sdb1";
where = "/usb";
mountConfig = { TimeoutSec = "5"; };
}
# SD card
{
what = "/dev/mmcblk0p1";
where = "/sdcard";
mountConfig = { TimeoutSec = "5"; };
}
];
services.autofs = {
enable = true;
timeout = 5;
autoMaster = let
mapConf = pkgs.writeText "auto" ''
usb -fstype=auto :/dev/sdb1
sdcard -fstype=auto :/dev/mmcblk0p1
'';
in ''
/media file:${mapConf} --timeout=5
'';
};
systemd.automounts = [
# USB
{
where = "/usb";
automountConfig = { TimeoutIdleSec = "5"; };
# Upgrade Doom Emacs daily
systemd.user.services.doom-upgrade = {
description = "Upgrade Doom Emacs";
wantedBy = [ "default.target" ];
}
# SD card
{
where = "/sdcard";
automountConfig = { TimeoutIdleSec = "5"; };
path = [ pkgs.emacs pkgs.git ];
serviceConfig = {
Type = "oneshot";
ExecStart = "/bin/sh /home/coolneng/.emacs.d/bin/doom -y upgrade";
};
};
systemd.user.timers.doom-upgrade = {
description = "Daily upgrade of Doom Emacs";
wantedBy = [ "default.target" ];
}
];
timerConfig = {
OnCalendar = "20:00:00";
Unit = "doom-upgrade.service";
};
};
}