mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
Merge pull request #14 from tomasriveral/laptop
This commit is contained in:
Generated
+47
-37
@@ -11,11 +11,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1779508871,
|
"lastModified": 1779768519,
|
||||||
"narHash": "sha256-SFl2je8b423f/tIy0RTgCrWQUJiyFsAZp1Y0cccXqio=",
|
"narHash": "sha256-2n/447oNfAZrl1yncafLPgXMx5tuTF6T2B+zI/zFYkI=",
|
||||||
"owner": "caelestia-dots",
|
"owner": "caelestia-dots",
|
||||||
"repo": "cli",
|
"repo": "cli",
|
||||||
"rev": "7f300626704b7a86fe838ab58df654fa99779613",
|
"rev": "64a5507e74f6c7d0c29f9131964412f8f8c4dd89",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -33,11 +33,11 @@
|
|||||||
"quickshell": "quickshell"
|
"quickshell": "quickshell"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1779591587,
|
"lastModified": 1780196414,
|
||||||
"narHash": "sha256-Ud83/zsmDSHcqQ64MRiQ7SnGkUVIpRzqwqBBU65DGXY=",
|
"narHash": "sha256-iXmyWULTZuRd68xRL79e9GyYL9FZ6gfh6zl1PPlWX2A=",
|
||||||
"owner": "caelestia-dots",
|
"owner": "caelestia-dots",
|
||||||
"repo": "shell",
|
"repo": "shell",
|
||||||
"rev": "2f7ab5e4140d9188185f6c3164e428c1eeda1fe6",
|
"rev": "63bb82762bb29ac9b7fcd5b97839abae721ce860",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -89,11 +89,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1779726825,
|
"lastModified": 1780361225,
|
||||||
"narHash": "sha256-RUkMrREjKDQrA+dA9+xZviGAxM5W1aVdyOr/bSYpHrE=",
|
"narHash": "sha256-wnV9ttf4fPWNonBIQmvlrSlNpQYgx5HgWWd007mwIFA=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "b179bde238977f7d4454fc770b1a727eaf55111c",
|
"rev": "e28654b71096e08c019d4861ca26acb646f583d8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -183,13 +183,36 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-notifier": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": [
|
||||||
|
"flake-utils"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-unstable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1780489272,
|
||||||
|
"narHash": "sha256-hMWKTal0SqG2OdtT/wB6wj9jLaES40yJlUQAjtbjTpA=",
|
||||||
|
"owner": "tomasriveral",
|
||||||
|
"repo": "nixpkgs-notifier",
|
||||||
|
"rev": "276b61aecaf9c2700e7c3cb7310bac5c6a9e5b5a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "tomasriveral",
|
||||||
|
"repo": "nixpkgs-notifier",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1779877693,
|
"lastModified": 1780336545,
|
||||||
"narHash": "sha256-NOF9NAREhxr50bbBfVcVOq+ArCMSoe8dP79Pk2uyARk=",
|
"narHash": "sha256-vhVhuXzFrIOfcssC/9hDHx7MHzDKjF3keHuREOQqQiQ=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "4100e830e085863741bc69b156ec4ccd53ab5be0",
|
"rev": "4df1b885d76a54e1aa1a318f8d16fd6005b6401f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -201,11 +224,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1779971959,
|
"lastModified": 1780203844,
|
||||||
"narHash": "sha256-R5nauXyqyfRUFiZycFFZdkF7wl6eaUpPLst35+2nJQY=",
|
"narHash": "sha256-K5sT4jTpGs15ADhviMKNBH38REpPf5Q6mM1+N6cArVE=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "ec942ba042dad5ef097e2ef3a3effc034241f011",
|
"rev": "b51242d7d43689db2f3be91bd05d5b24fbb469c4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -217,18 +240,19 @@
|
|||||||
},
|
},
|
||||||
"notewrapper": {
|
"notewrapper": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": [
|
||||||
|
"flake-utils"
|
||||||
|
],
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs-unstable"
|
"nixpkgs-unstable"
|
||||||
],
|
]
|
||||||
"notewrapper": "notewrapper_2"
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1779896579,
|
"lastModified": 1780404062,
|
||||||
"narHash": "sha256-ngPHJ7W36atwMLVQTzP4i5VlS1Lqj9nSt7mKDD6xGiw=",
|
"narHash": "sha256-XZziB7gcLwkhNyMoH8xDpwFktxBtzHx7zULyE4dHQfo=",
|
||||||
"owner": "tomasriveral",
|
"owner": "tomasriveral",
|
||||||
"repo": "notewrapper",
|
"repo": "notewrapper",
|
||||||
"rev": "7af79c76b1cdbbf3f516aa76a5ffe7ca169b1cfd",
|
"rev": "0f9ec32bfcfc4c111eaefe9e44d416afc79940ee",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -237,22 +261,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notewrapper_2": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1779896337,
|
|
||||||
"narHash": "sha256-Xw5vkiN4ei2dkzIRXP0DLSYG8QRjQ0MLvFx2akt96kk=",
|
|
||||||
"owner": "tomasriveral",
|
|
||||||
"repo": "NoteWrapper",
|
|
||||||
"rev": "4d228fb9118f22264863716ac2d74c4ad67edbf8",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "tomasriveral",
|
|
||||||
"repo": "NoteWrapper",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"quickshell": {
|
"quickshell": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -278,11 +286,13 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"caelestia-shell": "caelestia-shell",
|
"caelestia-shell": "caelestia-shell",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"import-tree": "import-tree",
|
"import-tree": "import-tree",
|
||||||
"microPlugins-vivify": "microPlugins-vivify",
|
"microPlugins-vivify": "microPlugins-vivify",
|
||||||
"nixos-grub-themes": "nixos-grub-themes",
|
"nixos-grub-themes": "nixos-grub-themes",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
"nixpkgs-notifier": "nixpkgs-notifier",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"notewrapper": "notewrapper"
|
"notewrapper": "notewrapper"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,9 +9,18 @@
|
|||||||
url = "github:nix-community/home-manager/release-26.05";
|
url = "github:nix-community/home-manager/release-26.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
flake-utils = {
|
||||||
|
url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
notewrapper = {
|
notewrapper = {
|
||||||
url = "github:tomasriveral/notewrapper";
|
url = "github:tomasriveral/notewrapper";
|
||||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||||
|
inputs.flake-utils.follows = "flake-utils";
|
||||||
|
};
|
||||||
|
nixpkgs-notifier = {
|
||||||
|
url = "github:tomasriveral/nixpkgs-notifier";
|
||||||
|
inputs.flake-utils.follows = "flake-utils";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||||
};
|
};
|
||||||
caelestia-shell = {
|
caelestia-shell = {
|
||||||
# based on quickshell. See https://github.com/caelestia-dots/shell
|
# based on quickshell. See https://github.com/caelestia-dots/shell
|
||||||
|
|||||||
@@ -160,6 +160,10 @@
|
|||||||
install_url = "https://addons.mozilla.org/firefox/downloads/file/4749958/bitwarden_password_manager-latest.xpi";
|
install_url = "https://addons.mozilla.org/firefox/downloads/file/4749958/bitwarden_password_manager-latest.xpi";
|
||||||
installation_mode = "force_installed";
|
installation_mode = "force_installed";
|
||||||
};
|
};
|
||||||
|
"@crw-extension-firefox" = {
|
||||||
|
install_url = "https://addons.mozilla.org/firefox/downloads/file/4790089/consumer_rights_wiki-latest.xpi";
|
||||||
|
installation_mode = "force_installed";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
DisableTelemetry = true;
|
DisableTelemetry = true;
|
||||||
DisableFirefoxStudies = true;
|
DisableFirefoxStudies = true;
|
||||||
@@ -304,6 +308,12 @@
|
|||||||
bookmarks = {
|
bookmarks = {
|
||||||
force = true;
|
force = true;
|
||||||
settings = [
|
settings = [
|
||||||
|
{
|
||||||
|
name = "Nixpkgs PRs";
|
||||||
|
tags = ["nixpkgs" "PR" "github"];
|
||||||
|
keyword = "nixpkgs prs";
|
||||||
|
url = "https://github.com/NixOS/nixpkgs/pulls";
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name = "Nixos Config";
|
name = "Nixos Config";
|
||||||
tags = ["github"];
|
tags = ["github"];
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
self.packages.${pkgs.system}.custom-dontkillsteam # kill app (if not steam or tomato-c
|
self.packages.${pkgs.system}.custom-dontkillsteam # kill app (if not steam or tomato-c
|
||||||
self.packages.${pkgs.system}.custom-killall # kill all windows except focused window
|
self.packages.${pkgs.system}.custom-killall # kill all windows except focused window
|
||||||
xdg-utils
|
xdg-utils
|
||||||
home-manager
|
|
||||||
];
|
];
|
||||||
# enable hyprland WM
|
# enable hyprland WM
|
||||||
programs.hyprland = {
|
programs.hyprland = {
|
||||||
@@ -42,6 +41,7 @@
|
|||||||
wayland.windowManager.hyprland.settings = {
|
wayland.windowManager.hyprland.settings = {
|
||||||
exec-once = [
|
exec-once = [
|
||||||
"qtbatticon" # custom battery tray
|
"qtbatticon" # custom battery tray
|
||||||
|
"nixpkgs-notifier listen" # tracks PR merge in nixos-unstable
|
||||||
];
|
];
|
||||||
monitor = [
|
monitor = [
|
||||||
"eDP-1, highres@highrr, 0x0, 1"
|
"eDP-1, highres@highrr, 0x0, 1"
|
||||||
@@ -58,6 +58,7 @@
|
|||||||
home.sessionVariables.NIXOS_OZONE_WL = "1";
|
home.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||||
wayland.windowManager.hyprland.plugins = [
|
wayland.windowManager.hyprland.plugins = [
|
||||||
#pkgs-unstable.hyprlandPlugins.hyprspace # currently broken
|
#pkgs-unstable.hyprlandPlugins.hyprspace # currently broken
|
||||||
|
#self.packages.${pkgs-unstable.system}.hypr-dynamic-cursors-manual
|
||||||
#pkgs-unstable.hyprlandPlugins.hypr-dynamic-cursors # currently broken
|
#pkgs-unstable.hyprlandPlugins.hypr-dynamic-cursors # currently broken
|
||||||
];
|
];
|
||||||
wayland.windowManager.hyprland.configType = "hyprlang";
|
wayland.windowManager.hyprland.configType = "hyprlang";
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{self, ...}: {
|
{self, ...}: {
|
||||||
flake.nixosModules.kdrive = {pkgs-unstable, ...}: {
|
flake.nixosModules.kdrive-laptop = {pkgs-unstable, ...}: {
|
||||||
environment.systemPackages = with pkgs-unstable; [
|
environment.systemPackages = with pkgs-unstable; [
|
||||||
rclone
|
rclone
|
||||||
self.packages.${pkgs.system}.custom-checkKdrive
|
self.packages.${pkgs.system}.custom-checkKdrive
|
||||||
self.packages.${pkgs.system}.custom-mountkdrive
|
self.packages.${pkgs.system}.custom-mountkdrive-laptop
|
||||||
];
|
];
|
||||||
# removes rclone error
|
# removes rclone error
|
||||||
programs.fuse = {
|
programs.fuse = {
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
packages.custom-mountkdrive = pkgs.writeShellApplication {
|
packages.custom-mountkdrive-laptop = pkgs.writeShellApplication {
|
||||||
name = "custom-mountkdrive";
|
name = "custom-mountkdrive";
|
||||||
runtimeInputs = with pkgs; [
|
runtimeInputs = with pkgs; [
|
||||||
rclone
|
rclone
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ _: {
|
|||||||
})
|
})
|
||||||
vim.lsp.config("pylsp", {
|
vim.lsp.config("pylsp", {
|
||||||
cmd = { "pylsp" },
|
cmd = { "pylsp" },
|
||||||
filetypes = { "python" },
|
filetypes = { "python", "py" },
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
settings = {
|
settings = {
|
||||||
pylsp = {
|
pylsp = {
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ _: {
|
|||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableDefaultConfig = false; # will be removed in the futur. Removes evaluation warning
|
enableDefaultConfig = false; # will be removed in the futur. Removes evaluation warning
|
||||||
/*settings = {
|
/*
|
||||||
|
settings = {
|
||||||
# equivalent to the default config
|
# equivalent to the default config
|
||||||
#forwardAgent = false;
|
#forwardAgent = false;
|
||||||
# give errors in home-manager 26.05
|
# give errors in home-manager 26.05
|
||||||
@@ -16,7 +17,8 @@ _: {
|
|||||||
#controlMaster = "no";
|
#controlMaster = "no";
|
||||||
#controlPath = "~/.ssh/master-%r@%n:%p";
|
#controlPath = "~/.ssh/master-%r@%n:%p";
|
||||||
#controlPersist = "no";
|
#controlPersist = "no";
|
||||||
};*/
|
};
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
services.ssh-agent.enable = true;
|
services.ssh-agent.enable = true;
|
||||||
home.file.".ssh/config".text = ''
|
home.file.".ssh/config".text = ''
|
||||||
|
|||||||
@@ -28,12 +28,12 @@
|
|||||||
disk
|
disk
|
||||||
disk-laptop
|
disk-laptop
|
||||||
fonts
|
fonts
|
||||||
games
|
gitBackup
|
||||||
hardware-configuration-laptop
|
hardware-configuration-laptop
|
||||||
hardwareUtils-laptop
|
hardwareUtils-laptop
|
||||||
hyprland
|
hyprland
|
||||||
IO
|
IO
|
||||||
kdrive
|
kdrive-laptop
|
||||||
latex
|
latex
|
||||||
ly
|
ly
|
||||||
mullvad
|
mullvad
|
||||||
@@ -54,6 +54,7 @@
|
|||||||
anki
|
anki
|
||||||
caelestia
|
caelestia
|
||||||
cursor
|
cursor
|
||||||
|
development
|
||||||
eza
|
eza
|
||||||
fastfetch
|
fastfetch
|
||||||
git
|
git
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ _: {
|
|||||||
services.upower.enable = true;
|
services.upower.enable = true;
|
||||||
|
|
||||||
# removes need for password for nixos-rebuild
|
# removes need for password for nixos-rebuild
|
||||||
security.sudo.extraRules = [
|
security.sudo = {
|
||||||
|
extraRules = [
|
||||||
{
|
{
|
||||||
users = ["tomasr"];
|
users = ["tomasr"];
|
||||||
commands = [
|
commands = [
|
||||||
@@ -46,5 +47,9 @@ _: {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
extraConfig = ''
|
||||||
|
Defaults pwfeedback
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
_: {
|
||||||
|
perSystem = _: {
|
||||||
|
packages.hypr-dynamic-cursors-manual = {
|
||||||
|
lib,
|
||||||
|
mkHyprlandPlugin,
|
||||||
|
fetchFromGitHub,
|
||||||
|
nix-update-script,
|
||||||
|
}:
|
||||||
|
mkHyprlandPlugin {
|
||||||
|
pluginName = "hypr-dynamic-cursors";
|
||||||
|
version = "0-unstable-2026-05-29";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "VirtCode";
|
||||||
|
repo = "hypr-dynamic-cursors";
|
||||||
|
rev = "1de08deb7d495124ce88b342fecc7e7542d0672f";
|
||||||
|
hash = "sha256-Ck9dFUfj/zDSab16CzsGWEMNeSNDhhDOB0JWeHzVvjk=";
|
||||||
|
};
|
||||||
|
|
||||||
|
dontUseCmakeConfigure = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/lib
|
||||||
|
mv out/dynamic-cursors.so $out/lib/libhypr-dynamic-cursors.so
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru.updateScript = nix-update-script {extraArgs = ["--version=branch"];};
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Plugin to make your Hyprland cursor more realistic";
|
||||||
|
homepage = "https://github.com/VirtCode/hypr-dynamic-cursors";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
maintainers = with lib.maintainers; [donovanglover];
|
||||||
|
platforms = lib.platforms.linux;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
_: {
|
{inputs, ...}: {
|
||||||
flake.nixosModules.development = {
|
flake.nixosModules.development = {
|
||||||
pkgs,
|
pkgs,
|
||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
@@ -31,6 +31,26 @@ _: {
|
|||||||
ltex-ls-plus
|
ltex-ls-plus
|
||||||
pylint
|
pylint
|
||||||
black
|
black
|
||||||
|
inputs.nixpkgs-notifier.packages.${pkgs.system}.default
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
flake.homeModules.development = _: {
|
||||||
|
home.file.".config/nixpkgs-notifier/config.json" = {
|
||||||
|
enable = true;
|
||||||
|
text = ''
|
||||||
|
{
|
||||||
|
"configTime": 3600,
|
||||||
|
"configFetchTime": 1,
|
||||||
|
"localNotify": true,
|
||||||
|
"matrix": {
|
||||||
|
"enable": true,
|
||||||
|
"room": "!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU",
|
||||||
|
"ping": true,
|
||||||
|
"userPing": "@notificationbot_0000",
|
||||||
|
"userPingServer": "matrix.org"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
{self, ...}: {
|
||||||
|
flake.nixosModules.gitBackup = {pkgs, ...}: {
|
||||||
|
environment.systemPackages = [
|
||||||
|
self.packages.${pkgs.system}.custom-gitBackup
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.user.services.custom-gitBackup = {
|
||||||
|
description = "Backup selected git repos";
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
|
||||||
|
ExecStart = "/run/current-system/sw/bin/custom-gitBackup";
|
||||||
|
|
||||||
|
TimeoutStartSec = "45min";
|
||||||
|
TimeoutStopSec = "10min";
|
||||||
|
|
||||||
|
RemainAfterExit = true;
|
||||||
|
|
||||||
|
Nice = 10;
|
||||||
|
IOSchedulingClass = "best-effort";
|
||||||
|
IOSchedulingPriority = 7;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Systemd USER timer
|
||||||
|
systemd.user.timers.custom-gitBackup = {
|
||||||
|
wantedBy = ["timers.target"];
|
||||||
|
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "Thu *-*-* 12:00:00";
|
||||||
|
|
||||||
|
Persistent = true; # if it happens during shutted down
|
||||||
|
|
||||||
|
RandomizedDelaySec = "20min";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
perSystem = {pkgs, ...}: {
|
||||||
|
packages.custom-gitBackup = pkgs.writeShellApplication {
|
||||||
|
name = "custom-gitBackup";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
rsync
|
||||||
|
matrix-commander-rs
|
||||||
|
libnotify
|
||||||
|
self.packages.${pkgs.system}.custom-checkKdrive
|
||||||
|
];
|
||||||
|
text = ''
|
||||||
|
# checks if kdrive is available
|
||||||
|
custom-checkKdrive
|
||||||
|
|
||||||
|
REPOS=(
|
||||||
|
"https://github.com/tomasriveral/nixos.git"
|
||||||
|
"https://github.com/tomasriveral/notewrapper.git"
|
||||||
|
"https://github.com/tomasriveral/fractal-cli.git"
|
||||||
|
"https://github.com/tomasriveral/boids.git"
|
||||||
|
"https://github.com/tomasriveral/Nixpkgs-tracker-notifier.git"
|
||||||
|
)
|
||||||
|
|
||||||
|
LOCAL_BACKUP_DIR="$HOME/.gitBackups"
|
||||||
|
CLOUD_DIR="$HOME/kdrive/Code/gitBackups"
|
||||||
|
|
||||||
|
# Create backup directories if they don't exist
|
||||||
|
mkdir -p "$LOCAL_BACKUP_DIR"
|
||||||
|
mkdir -p "$CLOUD_DIR"
|
||||||
|
|
||||||
|
notify_error() {
|
||||||
|
local message="$1"
|
||||||
|
notify-send "Git Backup Failed" "$message"
|
||||||
|
matrix-commander-rs --verbose -m "Git Backup Failed: $message <br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
|
||||||
|
--html \
|
||||||
|
-r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for REPO in "''${REPOS[@]}"; do
|
||||||
|
# Extract repo name (without .git)
|
||||||
|
REPO_NAME=$(basename "$REPO" .git)
|
||||||
|
LOCAL_REPO_PATH="$LOCAL_BACKUP_DIR/$REPO_NAME.git"
|
||||||
|
|
||||||
|
if [ ! -d "$LOCAL_REPO_PATH" ]; then
|
||||||
|
# Clone mirror if it doesn't exist
|
||||||
|
echo "Cloning $REPO..."
|
||||||
|
git clone --mirror "$REPO" "$LOCAL_REPO_PATH" || { notify_error "Failed to clone $REPO"; continue; }
|
||||||
|
else
|
||||||
|
# Update existing mirror
|
||||||
|
echo "Updating $REPO..."
|
||||||
|
cd "$LOCAL_REPO_PATH" || { notify_error "Cannot enter $LOCAL_REPO_PATH"; continue; }
|
||||||
|
git remote update || { notify_error "Failed to update $REPO"; continue; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Rsync to cloud directory (only changes, preserve permissions)
|
||||||
|
echo "Syncing $REPO_NAME to cloud..."
|
||||||
|
rsync -a --delete "$LOCAL_REPO_PATH/" "$CLOUD_DIR/$REPO_NAME/" || { notify_error "Failed to rsync $REPO_NAME"; continue; }
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "All backups completed."
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -6,10 +6,18 @@
|
|||||||
nix.settings.cores = 6;
|
nix.settings.cores = 6;
|
||||||
};
|
};
|
||||||
flake.nixosModules.nixUtils = {pkgs-unstable, ...}: {
|
flake.nixosModules.nixUtils = {pkgs-unstable, ...}: {
|
||||||
|
# Optimise the nix store
|
||||||
|
nix.optimise = {
|
||||||
|
automatic = true;
|
||||||
|
persistent = true;
|
||||||
|
randomDelaySec = "30min";
|
||||||
|
dates = "Thu *-*-* 16:00:00";
|
||||||
|
};
|
||||||
# Garbage collector of generations
|
# Garbage collector of generations
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
dates = "weekly";
|
dates = "Wed *-*-* 16:00:00";
|
||||||
|
persistent = true;
|
||||||
options = "--delete-older-than 7d"; # every week delete generations older than a month
|
options = "--delete-older-than 7d"; # every week delete generations older than a month
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
{self, inputs, ...}: {
|
{self, ...}: {
|
||||||
flake.nixosModules.otherUtils =
|
flake.nixosModules.otherUtils =
|
||||||
# try to keep packages here at a minium. Preferably use a dedicated file
|
# try to keep packages here at a minium. Preferably use a dedicated file
|
||||||
{
|
{pkgs, ...}: {
|
||||||
pkgs,
|
|
||||||
pkgs-unstable,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
gnome-calculator
|
gnome-calculator
|
||||||
snapshot
|
snapshot
|
||||||
@@ -22,7 +18,8 @@
|
|||||||
usbutils # used for lsusb
|
usbutils # used for lsusb
|
||||||
self.packages.${pkgs.system}.custom-tomato
|
self.packages.${pkgs.system}.custom-tomato
|
||||||
self.packages.${pkgs.system}.custom-syllabes
|
self.packages.${pkgs.system}.custom-syllabes
|
||||||
pkgs-unstable.bitwarden-desktop
|
# Electron 39 EOL. https://github.com/bitwarden/clients/pull/20448 should move it to 41. For the moment use the browser extension
|
||||||
|
#pkgs-unstable.bitwarden-desktop
|
||||||
fluffychat # matrix client
|
fluffychat # matrix client
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user