Switch to autofs and upgrade Doom Emacs daily
This commit is contained in:
parent
60bda7ed7a
commit
38d5815291
|
@ -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"; };
|
||||
wantedBy = [ "default.target" ];
|
||||
}
|
||||
# SD card
|
||||
{
|
||||
where = "/sdcard";
|
||||
automountConfig = { TimeoutIdleSec = "5"; };
|
||||
wantedBy = [ "default.target" ];
|
||||
}
|
||||
];
|
||||
# Upgrade Doom Emacs daily
|
||||
systemd.user.services.doom-upgrade = {
|
||||
description = "Upgrade Doom Emacs";
|
||||
wantedBy = [ "default.target" ];
|
||||
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";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue