about summary refs log tree commit diff
path: root/programs
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-10-03 22:06:43 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-10-03 22:06:43 +0200
commit342155ced8fc78b608f23454cb631decb0b7be9b (patch)
tree2cc4ffc422d645e17cf456cdcc780287df311b3f /programs
parent5d3c8e21d2d79a6ed3e324b833002a9bb0317b34 (diff)
downloaddots-342155ced8fc78b608f23454cb631decb0b7be9b.tar.gz
dots-342155ced8fc78b608f23454cb631decb0b7be9b.zip
Update config
Diffstat (limited to 'programs')
-rw-r--r--programs/aliases.nix2
-rw-r--r--programs/rclone.nix30
-rw-r--r--programs/zsh/precomp.zshrc2
3 files changed, 34 insertions, 0 deletions
diff --git a/programs/aliases.nix b/programs/aliases.nix
index d947226..9667790 100644
--- a/programs/aliases.nix
+++ b/programs/aliases.nix
@@ -1,4 +1,6 @@
 {
+  cfd = "cd ~/.config/nixpkgs";
+
   cp = "cp -iv";
   mv = "mv -iv";
   rm = "rm -iv";
diff --git a/programs/rclone.nix b/programs/rclone.nix
new file mode 100644
index 0000000..a8c4782
--- /dev/null
+++ b/programs/rclone.nix
@@ -0,0 +1,30 @@
+{ pkgs, config, ... }:
+
+let
+    mountdir = "${config.home.homeDirectory}/zhr/drive";
+in
+{
+  home.packages = with pkgs; [
+    rclone
+  ];
+
+    systemd.user = {
+        services.gdrive_mount = {
+            Unit = {
+                Description = "mount google-drive dirs";
+            };
+            Install.WantedBy = [ "multi-user.target" ];
+            Service = {
+                # ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${mountdir}";
+                ExecStart = ''
+                    ${pkgs.rclone}/bin/rclone mount zhr-drive: ${mountdir}
+                '';
+                # ExecStop = "${pkgs.coreutils}/bin/umount ${mountdir}";
+                Type = "notify";
+                Restart = "always";
+                RestartSec = "10s";
+                Environment = [ "PATH=${pkgs.fuse}/bin:$PATH" ];
+            };
+        };
+    };
+}
diff --git a/programs/zsh/precomp.zshrc b/programs/zsh/precomp.zshrc
index 6398877..c19a3c5 100644
--- a/programs/zsh/precomp.zshrc
+++ b/programs/zsh/precomp.zshrc
@@ -1,6 +1,8 @@
 [ -f ~/.nix-profile/etc/profile.d/nix.sh ] && . ~/.nix-profile/etc/profile.d/nix.sh
 export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
 
+source ~/.zprofile
+
 autoload -U colors && colors
 PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "