浏览代码

chore(odin): update caddy plugin hash and refine home-manager setup service

Update the hash for caddy withPlugins to the latest version. Convert the home-manager setup service from user-level to system-level, update paths to absolute, and adjust service configuration for proper execution.
Zander Hawke 7 月之前
父节点
当前提交
dddaa1eca1
共有 2 个文件被更改,包括 9 次插入7 次删除
  1. 1 1
      hosts/odin/services/caddy.nix
  2. 8 6
      hosts/odin/users/thomas.nix

+ 1 - 1
hosts/odin/services/caddy.nix

@@ -5,7 +5,7 @@
 
     package = pkgs.caddy.withPlugins {
       plugins = [ "github.com/caddy-dns/[email protected]" ];
-      hash = "sha256-p9AIi6MSWm0umUB83HPQoU8SyPkX5pMx989zAi8d/74=";
+      hash = "sha256-3NTI1fMlkpDB2Q/Q/CznEafscypEjJAOmTfAqWhHK1w=";
     };
 
     environmentFile = config.age.secrets."odin/services/caddy".path;

+ 8 - 6
hosts/odin/users/thomas.nix

@@ -14,29 +14,31 @@
     ];
   };
 
-  systemd.user.services.setup-home-manager =
+  systemd.services.setup-home-manager =
     let
       git = lib.getExe' pkgs.git "git";
       nix = lib.getExe' pkgs.nix "nix";
     in
     {
-      description = "Setup home-manager configuration on boot";
+      description = "Setup home-manager configuration for thomas";
       after = [ "network-online.target" ];
       wants = [ "network-online.target" ];
-      wantedBy = [ "default.target" ];
+      wantedBy = [ "multi-user.target" ];
 
       serviceConfig = {
         Type = "oneshot";
         RemainAfterExit = true;
+        User = "thomas";
+        Group = "users";
       };
 
       path = [ pkgs.git pkgs.nix ];
 
       script = ''
-        if [ "$USER" = "thomas" ] && [ ! -d "$HOME/workspace/control/home" ]; then
+        if [ ! -d "/home/thomas/workspace/control/home" ]; then
           echo "Setting up home environment..."
-          mkdir -p "$HOME/workspace/control"
-          cd "$HOME/workspace/control"
+          mkdir -p "/home/thomas/workspace/control"
+          cd "/home/thomas/workspace/control"
           ${git} clone https://codeberg.org/control/home.git
           cd home
           ${nix} run github:nix-community/home-manager -- switch -b backup --flake .#thomas@odin