From f65318b7654103a5638582f437bb7c397ac7a4c1 Mon Sep 17 00:00:00 2001 From: moons Date: Mon, 27 Jul 2026 19:43:42 +0900 Subject: [PATCH] mac --- hosts/m2/darwin.nix | 10 ++++++++++ modules/users/moons/darwin.nix | 14 ++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 hosts/m2/darwin.nix create mode 100644 modules/users/moons/darwin.nix diff --git a/hosts/m2/darwin.nix b/hosts/m2/darwin.nix new file mode 100644 index 0000000..a87d949 --- /dev/null +++ b/hosts/m2/darwin.nix @@ -0,0 +1,10 @@ +{ hostName, ... }: +{ + # networking.hostName and networking.localHostName are derived from the + # registry name; computerName controls the user-visible macOS name. + networking.computerName = hostName; + + # Keep this value stable after the first activation. It is independent of + # the Home Manager stateVersion in hosts/default.nix. + system.stateVersion = 7; +} diff --git a/modules/users/moons/darwin.nix b/modules/users/moons/darwin.nix new file mode 100644 index 0000000..5f42bce --- /dev/null +++ b/modules/users/moons/darwin.nix @@ -0,0 +1,14 @@ +{ primaryUser, ... }: +{ + # The account already exists in macOS; declaring only its home keeps + # nix-darwin from taking ownership of user creation and deletion. + users.users.${primaryUser}.home = "/Users/${primaryUser}"; + + nix.settings = { + allowed-users = [ primaryUser ]; + trusted-users = [ + "root" + primaryUser + ]; + }; +}