mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-10-10 08:55:18 +02:00
epfl switchDrive
This commit is contained in:
1 parent
9879131aca
commit
bd678ae32d
2 files changed
+26
-1
No files matched your search
@@ -1,7 +1,8 @@
|
||||
_: {
|
||||
{self, ...}: {
|
||||
flake.nixosModules.epfl = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
openconnect
|
||||
self.packages.${pkgs.system}.custom-mountEpflDrive
|
||||
];
|
||||
};
|
||||
|
||||
@@ -42,4 +43,27 @@ _: {
|
||||
};
|
||||
};
|
||||
};
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-mountEpflDrive = pkgs.writeShellApplication {
|
||||
name = "custom-mountEpflDrive";
|
||||
runtimeInputs = with pkgs; [
|
||||
rclone
|
||||
libnotify
|
||||
];
|
||||
text = ''
|
||||
REMOTE_NAME="epfl"
|
||||
MOUNT_POINT="$HOME/epfl/drive"
|
||||
|
||||
if rclone listremotes | rg "^''${REMOTE_NAME}:"; then
|
||||
echo "Mounting ''${REMOTE_NAME}..."
|
||||
rclone mount "''${REMOTE_NAME}:" "$MOUNT_POINT" --vfs-cache-mode writes --allow-non-empty &
|
||||
else
|
||||
notify-send "rclone mount failed" \
|
||||
"Remote ''${REMOTE_NAME} not found.\nConfigure rclone and create the dir ~/epfl/drive/ or comment out the exec line in hyprland.lua."
|
||||
echo "Remote ''${REMOTE_NAME} not found. Configure rclone or comment out the exec line in hyprland.lua."
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
@@ -940,6 +940,7 @@ hl.on("hyprland.start", function()
|
||||
hl.exec_cmd("awww img WALLPAPER/PATH/PLACEHOLDER")
|
||||
hl.exec_cmd("awww-daemon")
|
||||
hl.exec_cmd("custom-checkKdrive && custom-mountkdrive")
|
||||
hl.exec_cmd("custom-mountEpflDrive")
|
||||
hl.exec_cmd("custom-gitnotify")
|
||||
hl.exec_cmd("sleep 4 & caelestia-shell")
|
||||
hl.exec_cmd("sleep 20 && ngcp pull --automatic")
|
||||
|
||||
Reference in new issue
Block a user