From 5207af59d0bfd4d2535c0e5ec5d295347b3a09e1 Mon Sep 17 00:00:00 2001 From: glenn Date: Tue, 26 Nov 2024 12:39:03 +0100 Subject: [PATCH] fix nextcloud restic premissions --- flake.nix | 3 +++ home/root.nix | 33 +++++++++++++++++++++++++++++++++ nextcloud.nix | 3 ++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 home/root.nix diff --git a/flake.nix b/flake.nix index 082e897..b43d58c 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,8 @@ useGlobalPkgs = true; useUserPackages = true; users.sondell = import ./home/sondell.nix; + # users.restic = import ./home/restic.nix; + users.root = import ./home/root.nix; }; }; homeModules = [ @@ -54,6 +56,7 @@ ./jellyfin.nix ./filebrowser.nix ./tail.nix + ./restic.nix # ./ai.nix ./ebooks.nix # ./matrix.nix TODO does not work atm, fixit diff --git a/home/root.nix b/home/root.nix new file mode 100644 index 0000000..ed1b98c --- /dev/null +++ b/home/root.nix @@ -0,0 +1,33 @@ +{ + # pkgs, + # config, + # lib, + ... +}: { + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "root"; + home.homeDirectory = "/root"; + programs = { + ssh = { + addKeysToAgent = "yes"; + enable = true; + matchBlocks."*".identityFile = [ + "/root/.ssh/tulpan" + ]; + }; + + # Let Home Manager install and manage itself. + home-manager.enable = true; + }; + + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "24.05"; +} diff --git a/nextcloud.nix b/nextcloud.nix index beefaf3..b9da869 100644 --- a/nextcloud.nix +++ b/nextcloud.nix @@ -41,6 +41,7 @@ in { User = "nextcloud"; }; }; + users.users.nextcloud.extraGroups = ["backup"]; services = { restic.backups = { @@ -50,7 +51,7 @@ in { paths = [ "/pool/var/lib/nextcloud" ]; - user = "sondell"; + user = "root"; timerConfig.OnCalendar = "02:05"; pruneOpts = [ "--keep-daily 10"