Compare commits
9 Commits
432453304e
...
restic
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e662bb181a | ||
|
|
cbce55a4fa | ||
|
|
2e5f045bb2 | ||
|
|
fcb50fb567 | ||
|
|
247d87adae | ||
|
|
e83fdadf7d | ||
|
|
593602d87a | ||
|
|
0c00e983d6 | ||
|
|
4e875f654f |
@@ -55,9 +55,12 @@
|
|||||||
btop
|
btop
|
||||||
yazi
|
yazi
|
||||||
uv
|
uv
|
||||||
|
(writeShellScriptBin "nhms" ''
|
||||||
|
nix run home-manager -- switch --flake ~/.config/home-manager --impure
|
||||||
|
'')
|
||||||
(writeShellScriptBin "nhmu" ''
|
(writeShellScriptBin "nhmu" ''
|
||||||
nix flake update --flake ~/.config/home-manager
|
nix flake update --flake ~/.config/home-manager
|
||||||
nix run home-manager -- switch --flake ~/.config/home-manager --impure
|
nhms
|
||||||
'')
|
'')
|
||||||
# # It is sometimes useful to fine-tune packages, for example, by applying
|
# # It is sometimes useful to fine-tune packages, for example, by applying
|
||||||
# # overrides. You can do that directly here, just don't forget the
|
# # overrides. You can do that directly here, just don't forget the
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
"/home/*/Videos"
|
"/home/*/Videos"
|
||||||
"/home/*/go"
|
"/home/*/go"
|
||||||
"/home/*/snap"
|
"/home/*/snap"
|
||||||
|
"/home/john/john-nas"
|
||||||
];
|
];
|
||||||
schedule-permission = "user";
|
schedule-permission = "user";
|
||||||
schedule-priority = "background";
|
schedule-priority = "background";
|
||||||
|
|||||||
@@ -46,20 +46,27 @@ in {
|
|||||||
resticprofileCmd = ''
|
resticprofileCmd = ''
|
||||||
${cfg.package}/bin/resticprofile --config "${config.xdg.configHome}/resticprofile/profiles.yaml"
|
${cfg.package}/bin/resticprofile --config "${config.xdg.configHome}/resticprofile/profiles.yaml"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# Define the rp script as a variable so we can reference it
|
||||||
|
rpScript = pkgs.writeShellScriptBin "rp" ''
|
||||||
|
set -e
|
||||||
|
sudo ${cfg.package}/bin/resticprofile --config "${config.xdg.configHome}/resticprofile/profiles.yaml" $@
|
||||||
|
'';
|
||||||
|
rpbackupScript = pkgs.writeShellScriptBin "rp-backup" ''
|
||||||
|
${rpScript}/bin/rp run-schedule backup@default
|
||||||
|
'';
|
||||||
in {
|
in {
|
||||||
# Add a script to manually unschedule and reschedule all resticprofiles
|
# Add a script to manually unschedule and reschedule all resticprofiles
|
||||||
home.packages = [
|
home.packages = [
|
||||||
cfg.package
|
cfg.package
|
||||||
(pkgs.writeShellScriptBin "rp" ''
|
rpScript
|
||||||
set -e
|
rpbackupScript
|
||||||
sudo ${cfg.package}/bin/resticprofile --config "${config.xdg.configHome}/resticprofile/profiles.yaml" $@
|
|
||||||
'')
|
|
||||||
(pkgs.writeShellScriptBin "rps" ''
|
(pkgs.writeShellScriptBin "rps" ''
|
||||||
set -e
|
set -e
|
||||||
rp unschedule --all
|
${rpScript}/bin/rp unschedule --all
|
||||||
rp schedule --all
|
${rpScript}/bin/rp schedule --all
|
||||||
'')
|
'')
|
||||||
(pkgs.writeShellScriptBin "rp-test" "rp run-schedule backup@default --dry-run")
|
(pkgs.writeShellScriptBin "rp-test" "${rpbackupScript}/bin/rp-backup --dry-run")
|
||||||
];
|
];
|
||||||
xdg.configFile."resticprofile/profiles.yaml".source = yamlFormat.generate "profiles" {
|
xdg.configFile."resticprofile/profiles.yaml".source = yamlFormat.generate "profiles" {
|
||||||
version = "2";
|
version = "2";
|
||||||
|
|||||||
@@ -38,6 +38,10 @@
|
|||||||
hostname = "192.168.1.110";
|
hostname = "192.168.1.110";
|
||||||
user = "root";
|
user = "root";
|
||||||
};
|
};
|
||||||
|
"gitea" = {
|
||||||
|
hostname = "192.168.1.104";
|
||||||
|
user = "john";
|
||||||
|
};
|
||||||
"hermes" = {
|
"hermes" = {
|
||||||
hostname = "192.168.1.150";
|
hostname = "192.168.1.150";
|
||||||
user = "root";
|
user = "root";
|
||||||
@@ -66,11 +70,27 @@
|
|||||||
hostname = "192.168.1.129";
|
hostname = "192.168.1.129";
|
||||||
user = "root";
|
user = "root";
|
||||||
};
|
};
|
||||||
|
"janus" = {
|
||||||
|
hostname = "janus.john-stream.com";
|
||||||
|
user = "root";
|
||||||
|
identitiesOnly = true;
|
||||||
|
identityFile = "~/.ssh/id_ed25519";
|
||||||
|
certificateFile = "~/.ssh/id_ed25519-cert.pub";
|
||||||
|
};
|
||||||
|
"soteria" = {
|
||||||
|
hostname = "soteria.john-stream.com";
|
||||||
|
user = "john";
|
||||||
|
identitiesOnly = true;
|
||||||
|
identityFile = "~/.ssh/id_ed25519";
|
||||||
|
certificateFile = "~/.ssh/id_ed25519-cert.pub";
|
||||||
|
};
|
||||||
"*.john-stream.com" = {
|
"*.john-stream.com" = {
|
||||||
user = "john";
|
user = "john";
|
||||||
identitiesOnly = true;
|
identitiesOnly = true;
|
||||||
identityFile = "~/.ssh/id_ed25519";
|
identityFile = "~/.ssh/id_ed25519";
|
||||||
certificateFile = "~/.ssh/id_ed25519-cert.pub";
|
certificateFile = "~/.ssh/id_ed25519-cert.pub";
|
||||||
|
addKeysToAgent = "yes";
|
||||||
|
forwardAgent = true;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(lib.mkIf (config.profile == "work") {
|
(lib.mkIf (config.profile == "work") {
|
||||||
|
|||||||
Reference in New Issue
Block a user