-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.nix
89 lines (84 loc) · 2.61 KB
/
home.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
config,
pkgs,
lib,
...
}:
{
imports = [
../../homeCommon/emacsConfig.nix
../../homeCommon/bobPaintings.nix
../../homeCommon/homeConfig.nix
../../homeCommon/packages.nix
../../homeCommon/programs/programs.nix
./packages.nix
];
nixpkgs.config.allowUnfree = true;
targets.darwin.keybindings = {
"@$M" = "performZoom:";
};
home = {
sessionVariables = {
LC_ALL = "en_US.UTF-8";
LC_CTYPE = "en_US.UTF-8";
SHELL = "/run/current-system/sw/bin/bash";
};
sessionPath = [
"/run/current-system/sw/bin"
"/usr/local/bin"
];
activation = {
# https://github.com/nix-community/home-manager/issues/1341#issuecomment-1716147796
trampolineApps =
let
apps = pkgs.buildEnv {
name = "home-manager-applications";
paths = config.home.packages;
pathsToLink = "/Applications";
};
in
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
toDir="$HOME/Applications/HMApps"
fromDir="${apps}/Applications"
rm -rf "$toDir"
mkdir "$toDir"
(
cd "$fromDir"
for app in *.app; do
/usr/bin/osacompile -o "$toDir/$app" -e "do shell script \"open '$fromDir/$app'\""
icon="$(/usr/bin/plutil -extract CFBundleIconFile raw "$fromDir/$app/Contents/Info.plist")"
if [[ $icon != *".icns" ]]; then
icon="$icon.icns"
fi
mkdir -p "$toDir/$app/Contents/Resources"
cp -f "$fromDir/$app/Contents/Resources/$icon" "$toDir/$app/Contents/Resources/applet.icns"
done
)
'';
postgresFolder = config.lib.dag.entryAfter [ "writeBoundary" ] ''
if [ ! -d "${config.home.homeDirectory}/postgresDataDir" ]; then
$DRY_RUN_CMD mkdir -p "${config.home.homeDirectory}/postgresDataDir"
$DRY_RUN_CMD chown -R benkio:staff "${config.home.homeDirectory}/postgresDataDir"
fi
'';
};
# Look at the nixos packages for missing programs. installing them using homebrew
file = {
"browser.scpt".text = ''
on run argv
do shell script "defaultbrowser " & item 1 of argv
try
tell application "System Events"
tell application process "CoreServicesUIAgent"
tell window 1
tell (first button whose name starts with "use")
perform action "AXPress"
end tell
end tell
end tell
end tell
end try
end run'';
};
};
}