my nixos/home-manager configuration
1
fork

Configure Feed

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

update syncthing & add it to server

youn 68a810b8 fb5c0d1c

+67 -71
+3 -2
flake.nix
··· 144 144 ./home-manager/common.nix 145 145 ./home-manager/modules 146 146 agenix.homeManagerModules.default 147 - ] ++ modules; 147 + ] 148 + ++ modules; 148 149 }; 149 150 in 150 151 { ··· 157 158 ./nixos/laptop 158 159 nixos-hardware.nixosModules.framework-12th-gen-intel 159 160 ]; 160 - # 161 + # nixos-rebuild --target-host root@<hostname> switch --flake ~/nixfiles#server 161 162 "server" = mkNixosSystem [ 162 163 disko.nixosModules.disko 163 164 ./nixos/server
+12 -12
home-manager/desktop.nix
··· 39 39 # services 40 40 syncthing = { 41 41 enable = true; 42 - introducer.id = "GNRP5VZ-TGG7IN3-YSQHR6A-VMHHGYH-TMGVFVR-ZP7Y7XU-WE53UAZ-3GLQCA2"; 43 - folders = { 44 - "Desktop" = { 45 - id = "desktop-sehn"; 46 - path = "${user.homeDirectory}/Desktop"; 47 - }; 48 - "Pictures" = { 49 - id = "pictures-sehn"; 50 - path = "${user.homeDirectory}/Pictures"; 42 + overrideDevices = false; 43 + settings = { 44 + gui.enabled = false; 45 + devices = { 46 + "server" = { 47 + id = "TTUFKM7-A5RG55J-R3SN7YO-I2KAPCQ-FZROOD5-736WAXG-ZQXSIYZ-5PXUBAJ"; 48 + introducer = true; 49 + }; 51 50 }; 52 - "Videos" = { 53 - id = "video-sehn"; 54 - path = "${user.homeDirectory}/Videos"; 51 + folders = { 52 + "${user.homeDirectory}/Desktop".devices = [ "server" ]; 53 + "${user.homeDirectory}/Pictures".devices = [ "server" ]; 54 + "${user.homeDirectory}/Videos".devices = [ "server" ]; 55 55 }; 56 56 }; 57 57 };
+12 -12
home-manager/laptop.nix
··· 38 38 # services 39 39 syncthing = { 40 40 enable = true; 41 - introducer.id = "GNRP5VZ-TGG7IN3-YSQHR6A-VMHHGYH-TMGVFVR-ZP7Y7XU-WE53UAZ-3GLQCA2"; 42 - folders = { 43 - "Desktop" = { 44 - id = "desktop-sehn"; 45 - path = "${user.homeDirectory}/Desktop"; 46 - }; 47 - "Pictures" = { 48 - id = "pictures-sehn"; 49 - path = "${user.homeDirectory}/Pictures"; 41 + overrideDevices = false; 42 + settings = { 43 + gui.enabled = false; 44 + devices = { 45 + "server" = { 46 + id = "TTUFKM7-A5RG55J-R3SN7YO-I2KAPCQ-FZROOD5-736WAXG-ZQXSIYZ-5PXUBAJ"; 47 + introducer = true; 48 + }; 50 49 }; 51 - "Videos" = { 52 - id = "video-sehn"; 53 - path = "${user.homeDirectory}/Videos"; 50 + folders = { 51 + "${user.homeDirectory}/Desktop".devices = [ "server" ]; 52 + "${user.homeDirectory}/Pictures".devices = [ "server" ]; 53 + "${user.homeDirectory}/Videos".devices = [ "server" ]; 54 54 }; 55 55 }; 56 56 };
+7 -33
home-manager/modules/syncthing.nix
··· 10 10 { 11 11 options.modules.syncthing = { 12 12 enable = lib.mkEnableOption ""; 13 - introducer = { 14 - id = lib.mkOption { type = lib.types.str; }; 15 - name = lib.mkOption { 16 - type = lib.types.str; 17 - default = "node-0"; 18 - }; 13 + overrideDevices = lib.mkOption { 14 + type = lib.types.bool; 15 + default = false; 19 16 }; 20 - folders = lib.mkOption { 21 - type = lib.types.attrsOf ( 22 - lib.types.submodule { 23 - options = { 24 - id = lib.mkOption { type = lib.types.str; }; 25 - path = lib.mkOption { type = lib.types.str; }; 26 - }; 27 - } 28 - ); 17 + settings = lib.mkOption { 18 + type = lib.types.attrs; 29 19 default = { }; 30 20 }; 31 21 }; ··· 33 23 config = lib.mkIf cfg.enable { 34 24 services.syncthing = { 35 25 enable = true; 36 - settings = { 37 - devices = { 38 - "${cfg.introducer.name}" = { 39 - id = cfg.introducer.id; 40 - introducer = true; 41 - }; 42 - }; 43 - folders = lib.mapAttrs ( 44 - name: 45 - { id, path }: 46 - { 47 - enable = true; 48 - id = id; 49 - path = path; 50 - devices = [ "${cfg.introducer.name}" ]; 51 - } 52 - ) cfg.folders; 53 - }; 26 + overrideDevices = cfg.overrideDevices; 27 + settings = cfg.settings; 54 28 }; 55 29 56 30 xdg.desktopEntries.syncthing-ui = {
-4
home-manager/modules/zen-browser.nix
··· 70 70 bookmarks = { 71 71 settings = [ 72 72 { 73 - name = "Syncthing"; 74 - url = "http://127.0.0.1:8384"; 75 - } 76 - { 77 73 name = "ISEN"; 78 74 bookmarks = [ 79 75 {
+33 -8
nixos/server/default.nix
··· 1 1 { 2 2 modulesPath, 3 - pkgs, 4 - lib, 5 3 ssh, 6 4 ... 7 5 }: ··· 19 17 efiSupport = true; 20 18 efiInstallAsRemovable = true; 21 19 }; 20 + 21 + users.users."root" = { 22 + openssh.authorizedKeys.keys = [ ssh.public.text ]; 23 + }; 24 + 22 25 services.openssh.enable = true; 23 26 24 - environment.systemPackages = map lib.lowPrio [ 25 - pkgs.curl 26 - pkgs.gitMinimal 27 - ]; 28 - 29 - users.users.root.openssh.authorizedKeys.keys = [ ssh.public.text ]; 27 + services.syncthing = { 28 + enable = true; 29 + openDefaultPorts = true; 30 + overrideDevices = false; 31 + overrideFolders = false; 32 + settings = { 33 + gui.enabled = false; 34 + options = { 35 + announceLANAddresses = false; 36 + localAnnounceEnabled = false; 37 + natEnabled = false; 38 + }; 39 + devices = { 40 + "desktop" = { 41 + id = "XISPYUG-DNTVMB2-PHCHRCI-TMOTNJR-GJSK7LZ-6N4LN5P-GK6SISC-U43A2AD"; 42 + autoAcceptFolders = true; 43 + }; 44 + "laptop" = { 45 + id = "KTQFQBS-PJBRNJU-NYWCB4W-OFQJO7S-PDWZ2P2-SVVRTEP-IPLQNUQ-L4PSUA5"; 46 + autoAcceptFolders = true; 47 + }; 48 + "mobile" = { 49 + id = "C5FRWWE-HZQ2H7F-RO522LK-Q4JIGZL-ET6LZMT-CL737LK-A7LRPUW-OBWYQAC"; 50 + autoAcceptFolders = true; 51 + }; 52 + }; 53 + }; 54 + }; 30 55 31 56 system.stateVersion = "25.05"; 32 57 }