diff options
| author | kdam0 <me@kumardamani.net> | 2023-03-14 22:11:02 +0000 |
|---|---|---|
| committer | kdam0 <me@kumardamani.net> | 2023-03-14 22:11:02 +0000 |
| commit | 8503f7aeb172ea4b2ccb897faa9c65f3299791e5 (patch) | |
| tree | a0026681d506792086a9a063e42b142bd8d2f4df | |
| parent | ffb6bab31f75abe6bfe4f8a89fdba332f242e388 (diff) | |
nextcloud stuff
| -rw-r--r-- | nixpkgs/.config/nixpkgs/home.nix | 53 |
1 files changed, 40 insertions, 13 deletions
diff --git a/nixpkgs/.config/nixpkgs/home.nix b/nixpkgs/.config/nixpkgs/home.nix index b216ec1..7fea2c4 100644 --- a/nixpkgs/.config/nixpkgs/home.nix +++ b/nixpkgs/.config/nixpkgs/home.nix @@ -8,9 +8,10 @@ enable = true; defaultKeymap = "viins"; initExtra = '' - source ~/.p10k.zsh + source ${config.home.homeDirectory}/.p10k.zsh ''; shellAliases = { + l = "ls -l"; ll = "ls -al"; ".." = "cd .."; up = "sudo nixos-rebuild switch"; @@ -18,6 +19,7 @@ chm = "nvim ~/.config/nixpkgs/home.nix"; cnix = "nvim ~/.config/nixpkgs/configuration.nix"; gst = "git status"; + v = "nvim $@"; }; zplug = { enable = true; @@ -32,6 +34,9 @@ home.packages = [ # Window environment (pkgs.dwl.override { + # trying to supply config.home.homeDirectory here leads to "impure" usage. + # so disabling it for now + # conf = (builtins.readFile "${config.home.homeDirectory}/.config/dwl/config.h"); conf = ./dwl/config.h; }) pkgs.somebar @@ -78,16 +83,38 @@ defaultCacheTtl = 1800; enableSshSupport = true; }; - #systemd.user.timers = { - # my-timer = { - # Unit = { - # Description = "Example description"; - # Documentation = [ "man:example(1)" "man:example(5)" ]; - # }; - # - # Timer = { - # nCalender = "weekly"; - # }; - # }; - #}; + + systemd.user.services = { + nextcloud-sync = { + Unit = { + Description = "Auto sync Nextcloud"; + After = "network-online.target"; + }; + Service = { + Type = "simple"; + EnvironmentFile = "${config.home.homeDirectory}/.nextcloud.env"; + ExecStart = '' + ${pkgs.nextcloud-client}/bin/nextcloudcmd \ + -h --non-interactive \ + --user "''${NEXTCLOUD_USER}" \ + --password "''${NEXTCLOUD_PASSWORD}" \ + ''${NEXTCLOUD_DIR} \ + ''${NEXTCLOUD_URL} + ''; + TimeoutStopSec = "180"; + KillMode = "process"; + KillSignal = "SIGINT"; + }; + Install.WantedBy = ["multi-user.target"]; + }; + }; + + systemd.user.timers = { + nextcloud-sync = { + Unit.Description = "Automatic sync files with Nextcloud when booted up after 5 minutes then rerun every 10 minutes"; + Timer.OnUnitActiveSec = "10min"; + Install.WantedBy = ["multi-user.target" "timers.target"]; + }; + }; + systemd.user.startServices = true; } |
