my nixos/home-manager configuration
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(backup): sync claude-code projects

Signed-off-by: Youn Mélois <youn@melois.dev>

+39 -6
+4
home-manager/clever-cloud.nix
··· 15 15 enable = true; 16 16 device = "laptop"; 17 17 }; 18 + backup = { 19 + enable = true; 20 + folders = [ ]; 21 + }; 18 22 }; 19 23 20 24 home.stateVersion = "25.05";
+12 -1
home-manager/modules/backup/default.nix
··· 15 15 16 16 options.modules.backup = { 17 17 enable = lib.mkEnableOption "backup"; 18 + folders = lib.mkOption { 19 + type = lib.types.listOf lib.types.str; 20 + default = [ 21 + "Desktop" 22 + "Pictures" 23 + "Videos" 24 + ]; 25 + }; 18 26 }; 19 27 20 28 config = lib.mkIf cfg.enable { 21 29 services = { 22 - syncthing.enable = true; 30 + syncthing = { 31 + enable = true; 32 + folders = cfg.folders; 33 + }; 23 34 }; 24 35 }; 25 36 }
+19 -5
home-manager/modules/backup/syncthing.nix
··· 9 9 cfg = config.services.syncthing; 10 10 in 11 11 { 12 + options.services.syncthing = { 13 + folders = lib.mkOption { 14 + type = lib.types.listOf lib.types.str; 15 + default = [ 16 + "Desktop" 17 + "Pictures" 18 + "Videos" 19 + ]; 20 + }; 21 + }; 22 + 12 23 config = lib.mkIf cfg.enable { 13 24 services.syncthing = { 14 25 overrideDevices = false; ··· 20 31 introducer = true; 21 32 }; 22 33 }; 23 - folders = { 24 - "${user.homeDirectory}/Desktop".devices = [ "server" ]; 25 - "${user.homeDirectory}/Pictures".devices = [ "server" ]; 26 - "${user.homeDirectory}/Videos".devices = [ "server" ]; 27 - }; 34 + folders = builtins.listToAttrs ( 35 + builtins.map (folder: { 36 + name = "${user.homeDirectory}/${folder}"; 37 + value = { 38 + devices = [ "server" ]; 39 + }; 40 + }) cfg.folders 41 + ); 28 42 }; 29 43 }; 30 44
+4
home-manager/modules/dev/claude-code.nix
··· 48 48 programs.git.ignores = lib.mkIf config.programs.git.enable [ 49 49 "**/.claude/settings.local.json" 50 50 ]; 51 + 52 + services.syncthing = lib.mkIf config.services.syncthing.enable { 53 + folders = [ ".claude/projects" ]; 54 + }; 51 55 }; 52 56 }