mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
Wanted to use agenix to encrypt rclone config. But to diffcult. Ended with a custom-mountkdrive which verifies the existence of the remote before launching
This commit is contained in:
Generated
+1
-73
@@ -1,26 +1,5 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-parts": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs-lib": [
|
|
||||||
"nixvim",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1769996383,
|
|
||||||
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -58,61 +37,10 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1770380644,
|
|
||||||
"narHash": "sha256-P7dWMHRUWG5m4G+06jDyThXO7kwSk46C1kgjEWcybkE=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "ae67888ff7ef9dff69b3cf0cc0fbfbcd3a722abe",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixpkgs-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixvim": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-parts": "flake-parts",
|
|
||||||
"nixpkgs": "nixpkgs_2",
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1771135771,
|
|
||||||
"narHash": "sha256-wyvBIhDuyCRyjB3yPg77qoyxrlgQtBR1rVW3c9knV3E=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixvim",
|
|
||||||
"rev": "ed0424f0b08d303a7348f52f7850ad1b2704f9ba",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"id": "nixvim",
|
|
||||||
"type": "indirect"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs"
|
||||||
"nixvim": "nixvim"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,13 +8,13 @@
|
|||||||
url = "github:nix-community/home-manager/release-25.11";
|
url = "github:nix-community/home-manager/release-25.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
};
|
||||||
# never got nixvim to wokrs. ):
|
# never got nixvim to wokrs. ):
|
||||||
# nixvim = {
|
# nixvim = {
|
||||||
# url = "github:nix-community/nixvim/nixos-25.11";
|
# url = "github:nix-community/nixvim/nixos-25.11";
|
||||||
# };
|
# };
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, home-manager, nixvim, ... }@inputs:
|
outputs = { self, nixpkgs, home-manager, ... }@inputs:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
laptop = nixpkgs.lib.nixosSystem {
|
laptop = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs;};
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/laptop/configuration.nix
|
./hosts/laptop/configuration.nix
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
inputs.home-manager.nixosModules.default
|
inputs.home-manager.nixosModules.default
|
||||||
# inputs.nixvim.homeModules.default
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ imports = [
|
|||||||
../../modules/home-manager/rofi.nix # launcher and keybindings helper
|
../../modules/home-manager/rofi.nix # launcher and keybindings helper
|
||||||
../../modules/home-manager/swaync.nix # notification daemon
|
../../modules/home-manager/swaync.nix # notification daemon
|
||||||
../../modules/home-manager/neovim.nix # dont use nixvim. broken
|
../../modules/home-manager/neovim.nix # dont use nixvim. broken
|
||||||
|
../../modules/home-manager/rclone.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@@ -48,6 +49,7 @@ home.packages = [
|
|||||||
(pkgs.callPackage ../../modules/scripts/weather.nix {})
|
(pkgs.callPackage ../../modules/scripts/weather.nix {})
|
||||||
(pkgs.callPackage ../../modules/scripts/cowsay.nix {})
|
(pkgs.callPackage ../../modules/scripts/cowsay.nix {})
|
||||||
(pkgs.callPackage ../../modules/scripts/wallpaper.nix {})
|
(pkgs.callPackage ../../modules/scripts/wallpaper.nix {})
|
||||||
|
(pkgs.callPackage ../../modules/scripts/mountkdrive.nix {})
|
||||||
# # Adds the 'hello' command to your environment. It prints a friendly
|
# # Adds the 'hello' command to your environment. It prints a friendly
|
||||||
# # "Hello, world!" when run.
|
# # "Hello, world!" when run.
|
||||||
# pkgs.hello
|
# pkgs.hello
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ in
|
|||||||
"swww img ${wallpaper}"
|
"swww img ${wallpaper}"
|
||||||
"swww-daemon"
|
"swww-daemon"
|
||||||
"sleep 1 && custom-wallpaper"
|
"sleep 1 && custom-wallpaper"
|
||||||
|
"custom-mountkdrive"
|
||||||
];
|
];
|
||||||
# █░░ ▄▀█ █▄█ █▀█ █░█ ▀█▀ █▀
|
# █░░ ▄▀█ █▄█ █▀█ █░█ ▀█▀ █▀
|
||||||
# █▄▄ █▀█ ░█░ █▄█ █▄█ ░█░ ▄█
|
# █▄▄ █▀█ ░█░ █▄█ █▄█ ░█░ ▄█
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.zoxide = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{ config, pkgs, agenix, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.rclone = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{ writeShellApplication, rclone, libnotify, ... }:
|
||||||
|
|
||||||
|
writeShellApplication {
|
||||||
|
name = "custom-mountkdrive";
|
||||||
|
runtimeInputs = [
|
||||||
|
rclone
|
||||||
|
libnotify
|
||||||
|
];
|
||||||
|
text = ''
|
||||||
|
REMOTE_NAME="kdrive"
|
||||||
|
MOUNT_POINT="$HOME/kdrive"
|
||||||
|
|
||||||
|
if rclone listremotes | rg "^''${REMOTE_NAME}:"; then
|
||||||
|
echo "Mounting ''${REMOTE_NAME}..."
|
||||||
|
rclone mount "''${REMOTE_NAME}:" "$MOUNT_POINT" --vfs-cache-mode writes &
|
||||||
|
else
|
||||||
|
notify-send "rclone mount failed" \
|
||||||
|
"Remote ''${REMOTE_NAME} not found.\nConfigure rclone and create the dir ~/kdrive/ or comment out the exec line in hyprland.nix."
|
||||||
|
echo "Remote ''${REMOTE_NAME} not found. Configure rclone or comment out the exec line in hyprland.nix."
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user