home/vscode: add timer for extension updates
This commit is contained in:
parent
dbea006c50
commit
dfc0a3728d
|
@ -39,7 +39,7 @@ in {
|
|||
./programs/qutebrowser.nix
|
||||
./programs/rofi.nix
|
||||
./programs/taskwarrior.nix
|
||||
./programs/vscode.nix
|
||||
./programs/vscode
|
||||
# ./programs/xmobar
|
||||
./programs/xmonad
|
||||
./programs/zathura.nix
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.programs.vscode;
|
||||
in
|
||||
{
|
||||
# TODO: add `dirname` to $PATH upstream
|
||||
systemd.user.services.update-vscode-extensions = {
|
||||
Unit = {
|
||||
Description = "Update vscode extensions";
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
ExecStart = "${lib.getExe cfg.package} --update-extensions";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers.update-vscode-extensions = {
|
||||
Unit = {
|
||||
Description = "Update vscode extensions";
|
||||
};
|
||||
|
||||
Timer = {
|
||||
Unit = "update-vscode-extensions.service";
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -14,6 +14,11 @@ let
|
|||
configFilePath = "${userDir}/settings.json";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./auto-update-extensions.nix
|
||||
# ./extensions
|
||||
];
|
||||
|
||||
home.file.${configFilePath} = {
|
||||
target = "${configFilePath}.ro";
|
||||
onChange = ''install -m660 $(realpath "${configFilePath}.ro") "${configFilePath}"'';
|
Loading…
Reference in New Issue