mirror of
https://github.com/smg1024/nix-darwin.git
synced 2026-05-22 20:32:59 +09:00
refactor: migrate nix-darwin config to a flake-parts dendritic layout
This commit is contained in:
parent
f80b0b0d4f
commit
09801ac429
84 changed files with 1029 additions and 687 deletions
31
modules/aspects/activation.nix
Normal file
31
modules/aspects/activation.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{...}: {
|
||||
flake.modules.darwin.activation = {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
system.activationScripts.extraActivation.text = ''
|
||||
sudo -u ${config.repo.user.name} /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
||||
'';
|
||||
|
||||
system.activationScripts.applications.text = let
|
||||
env = pkgs.buildEnv {
|
||||
name = "system-applications";
|
||||
paths = config.environment.systemPackages;
|
||||
pathsToLink = ["/Applications"];
|
||||
};
|
||||
in
|
||||
lib.mkForce ''
|
||||
echo "setting up /Applications..." >&2
|
||||
rm -rf /Applications/Nix\ Apps
|
||||
mkdir -p /Applications/Nix\ Apps
|
||||
find ${env}/Applications -maxdepth 1 -type l -exec readlink '{}' + |
|
||||
while read -r src; do
|
||||
app_name=$(basename "$src")
|
||||
echo "copying $src" >&2
|
||||
${pkgs.mkalias}/bin/mkalias "$src" "/Applications/Nix Apps/$app_name"
|
||||
done
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue