From 0d53bea851e087fe330bee9a0a2fde2b7197efc6 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 1 Jun 2023 10:40:11 +0800 Subject: [PATCH] fix: set users.users..home for darwin system, bump home-manager to branch release-23.05 --- flake.lock | 8 ++++---- flake.nix | 5 +---- home/darwin/default.nix | 2 +- modules/darwin/core.nix | 6 ++++++ modules/nixos/user_group.nix | 1 + 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 75666c83..57dccc4b 100644 --- a/flake.lock +++ b/flake.lock @@ -239,17 +239,17 @@ ] }, "locked": { - "lastModified": 1684596126, - "narHash": "sha256-4RZZmygeEXpuBqEXGs38ZAcWjWKGwu13Iqbxub6wuJk=", + "lastModified": 1685108129, + "narHash": "sha256-6Jv6LxrLfaueHj095oBUKBk++eW4Ya0qfHwhQVQqyoo=", "owner": "nix-community", "repo": "home-manager", - "rev": "27ef11f0218d9018ebb2948d40133df2b1de622d", + "rev": "bec196cd9b5f34213c7dc90ef2a524336df70e30", "type": "github" }, "original": { "owner": "nix-community", "repo": "home-manager", - "rev": "27ef11f0218d9018ebb2948d40133df2b1de622d", + "rev": "bec196cd9b5f34213c7dc90ef2a524336df70e30", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 540b69ba..dd706333 100644 --- a/flake.nix +++ b/flake.nix @@ -51,10 +51,7 @@ # home-manager, used for managing user configuration home-manager = { - # lock to the commit at 2023-05-20, to avoid breaking changes for darwin - # TODO error when using the master branch of home-manager: - # Error: HOME is set to "/Users/admin" but we expect "/var/empty" - url = "github:nix-community/home-manager/27ef11f0218d9018ebb2948d40133df2b1de622d"; + url = "github:nix-community/home-manager/release-23.05"; # The `follows` keyword in inputs is used for inheritance. # Here, `inputs.nixpkgs` of home-manager is kept consistent with the `inputs.nixpkgs` of the current flake, # to avoid problems caused by different versions of nixpkgs dependencies. diff --git a/home/darwin/default.nix b/home/darwin/default.nix index 31baf8f4..1165eca0 100644 --- a/home/darwin/default.nix +++ b/home/darwin/default.nix @@ -19,7 +19,7 @@ home = { username = "admin"; # set homeDirectory make build fail - # homeDirectory = "/Users/admin"; + homeDirectory = "/Users/admin"; # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage diff --git a/modules/darwin/core.nix b/modules/darwin/core.nix index 9b4d8159..4f648797 100644 --- a/modules/darwin/core.nix +++ b/modules/darwin/core.nix @@ -58,4 +58,10 @@ ]; }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.admin = { + home = "/Users/admin"; + description = "admin"; + }; } \ No newline at end of file diff --git a/modules/nixos/user_group.nix b/modules/nixos/user_group.nix index 1aaebb86..c5d47fe7 100644 --- a/modules/nixos/user_group.nix +++ b/modules/nixos/user_group.nix @@ -8,6 +8,7 @@ }; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.ryan = { + home = "/home/ryan"; isNormalUser = true; description = "ryan"; extraGroups = [ "ryan" "users" "networkmanager" "wheel" "docker" "wireshark" "adbusers" ];