Completed centralized update

This commit is contained in:
Filippo Berto 2021-06-14 07:01:37 +02:00
parent ef5b48d142
commit 83c9c72688
15 changed files with 328 additions and 138 deletions

View file

@ -8,7 +8,9 @@ let
cargo-watch
clippy
rust-analyzer
rustup
];
cppPlugins = with pkgs; [
clang-tools
];
pythonPlugins = with pkgs.python38Packages; [
pyls-black
@ -79,8 +81,6 @@ in
];
hooks = [
{ name = "BufCreate"; option = ".*"; commands = "editorconfig-load"; }
{ name = "InsertCompletionHide"; option = ".*"; commands = builtins.concatStringsSep "\n" [ "unmap window insert <tab> <c-n>" "unmap window insert <s-tab> <c-p>" ]; }
{ name = "InsertCompletionShow"; option = ".*"; commands = builtins.concatStringsSep "\n" [ "map window insert <tab> <c-n>" "map window insert <s-tab> <c-p>" ]; }
{ name = "ModuleLoaded"; option = "auto-pairs"; commands = "auto-pairs-enable"; }
{ name = "ModuleLoaded"; option = "powerline"; commands = builtins.concatStringsSep "\n" [ "powerline-enable" ]; }
{ name = "WinSetOption"; option = "filetype=(rust|python|c|cpp|latex|javascript|go|nix)"; commands = builtins.concatStringsSep "\n" [ "lsp-enable-window" ]; }
@ -113,7 +113,7 @@ in
with nixpkgs; [
kakounePlugins.connect-kak
]
) ++ rustPlugins ++ pythonPlugins ++ nixPlugins ++ spellingPlugins ++ dataFormats;
) ++ rustPlugins ++ cppPlugins ++ pythonPlugins ++ nixPlugins ++ spellingPlugins ++ dataFormats;
};
xdg.configFile."kak-lsp/kak-lsp.toml".source = ../configs/kak-lsp/kak-lsp.toml;

13
modules/keepassxc.nix Normal file
View file

@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
config.systemd.user.services.keepassxc = {
Unit = {
Description = "KeePassXC password manager";
After = [ "graphical-session-pre.target" ];
Partof = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = { ExecStart = "${pkgs.keepassxc}/bin/keepassxc"; };
};}

View file

@ -119,12 +119,15 @@ in
format = {
charging = colors.selected // {
padding = 1;
text = "<animation-charging> <label-charging>";
};
discharging = colors.active // {
padding = 1;
text = "<animation-discharging> <label-discharging>";
};
full = colors.normal // {
padding = 1;
text = " <label-full>";
};
};
@ -278,13 +281,17 @@ in
menu = [
[
({ text = "Reboot"; exec = "menu-open-1"; })
({ text = "Power off"; exec = "menu-open-2"; })
({ text = "Hibernate"; exec = "menu-open-2"; })
({ text = "Power off"; exec = "menu-open-3"; })
]
[
({ text = "Reboot"; exec = "reboot"; })
({ text = "Reboot"; exec = "systemctl reboot"; })
]
[
({ text = "Power off"; exec = "poweroff"; })
({ text = "Hibernate"; exec = "systemctl hibernate"; })
]
[
({ text = "Power off"; exec = "systemctl poweroff"; })
]
];
};

View file

@ -1,9 +1,10 @@
{ pkgs, config, ... }:
let
fehCmd = "${pkgs.feh}/bin/feh";
backgrounds_directory = ~/Immagini/Sfondi ;
update_time = 10;
in {
backgrounds_directory = ~/Immagini/Sfondi;
update_time = "10m";
in
{
home.file.".local/bin/update_background.sh" = {
text = ''
#!${pkgs.bash}/bin/bash
@ -16,8 +17,8 @@ in {
systemd.user.services."update-background" = {
Unit = {
Description = "Update the desktop background";
After = [ "graphical-session.target" ];
Description = "Set random desktop background using feh";
After = [ "graphical-session.pre.target" ];
PartOf = [ "graphical-session.target" ];
RequiresMountsFor = [ "/home/bertof/Immagini" ];
};
@ -25,21 +26,15 @@ in {
WantedBy = [ "graphical-session.target" ];
};
Service = {
Type = "oneshot";
IOSchedulingClass = "idle";
ExecStart = "${config.home.homeDirectory}/${config.home.file.".local/bin/update_background.sh".target}";
};
};
systemd.user.timers."update-background" = {
Unit = {
Description="Run update-background every ${toString update_time} minutes";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Timer = {
OnUnitActiveSec="${toString update_time}m";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Unit = { Description = "Set random desktop background using feh"; };
Timer = { OnUnitActiveSec = update_time; };
Install = { WantedBy = [ "timers.target" ]; };
};
}