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