Add configuration
This commit is contained in:
1 parent
eb62e19766
commit
3b4fe6f60c
16 files changed
+1488
No files matched your search
@@ -0,0 +1,98 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
home-manager.users.kasey = {
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
# Define a unityhub that includes fonts.
|
||||
unityhub = pkgs.unityhub.override {extraPkgs = pkgs: [pkgs.corefonts pkgs.ipafont];};
|
||||
in {
|
||||
imports = [
|
||||
inputs.umbriel.homeModules.default
|
||||
./umbriel.nix
|
||||
];
|
||||
|
||||
home.packages = [
|
||||
unityhub
|
||||
(pkgs.stdenvNoCC.mkDerivation rec {
|
||||
pname = "unity";
|
||||
version = "2022.3.22f1";
|
||||
dontFixup = true;
|
||||
|
||||
unitySrc = pkgs.fetchurl {
|
||||
url = "https://download.unity3d.com/download_unity/887be4894c44/LinuxEditorInstaller/Unity-2022.3.22f1.tar.xz";
|
||||
hash = "sha256-eE//d2kFHA9p7bA52NCUMeeuQASmSh20QDcJ3biKpQY=";
|
||||
};
|
||||
androidSupportSrc = pkgs.fetchurl {
|
||||
url = "https://download.unity3d.com/download_unity/887be4894c44/MacEditorTargetInstaller/UnitySetup-Android-Support-for-Editor-2022.3.22f1.pkg";
|
||||
hash = "sha256-Vqk8HgnFsUzjLvjIhIdJTLFHpyE6UDhwR7hN7/Jjpak=";
|
||||
};
|
||||
windowsSupportSrc = pkgs.fetchurl {
|
||||
url = "https://download.unity3d.com/download_unity/887be4894c44/MacEditorTargetInstaller/UnitySetup-Windows-Mono-Support-for-Editor-2022.3.22f1.pkg";
|
||||
hash = "sha256-iBGBpsg3IwooTqQSC/y14qq5QLuQEOvftQ07iGXCBZ0=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [pkgs.cpio pkgs.xarMinimal];
|
||||
buildInputs = [unityhub.fhsEnv];
|
||||
|
||||
unpackPhase = ''
|
||||
mkdir android
|
||||
xar -C android -xf "${androidSupportSrc}"
|
||||
mkdir windows
|
||||
xar -C windows -xf "${windowsSupportSrc}"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
# This Editor/version/Editor path helps Unity Hub recognize the version of the editor.
|
||||
mkdir -p "$out/bin" "$out/Editor/${version}/Editor/Data/PlaybackEngines/AndroidPlayer" "$out/Editor/${version}/Editor/Data/PlaybackEngines/WindowsStandaloneSupport"
|
||||
|
||||
tar -C "$out/Editor/${version}" -xf "${unitySrc}"
|
||||
gzip -d < android/TargetSupport.pkg.tmp/Payload | cpio -iD "$out/Editor/${version}/Editor/Data/PlaybackEngines/AndroidPlayer"
|
||||
gzip -d < windows/TargetSupport.pkg.tmp/Payload | cpio -iD "$out/Editor/${version}/Editor/Data/PlaybackEngines/WindowsStandaloneSupport"
|
||||
|
||||
# Create unity wrapper script
|
||||
cat > "$out/bin/unity" <<-EOF
|
||||
#!/bin/sh
|
||||
exec -a "$out/Editor/${version}/Editor/Unity" "${unityhub.fhsEnv}/bin/unityhub-fhs-env" "$out/Editor/${version}/Editor/Unity" "\$@"
|
||||
EOF
|
||||
chmod a+x "$out/bin/unity"
|
||||
|
||||
# Fix font fallback
|
||||
cat > "$out/Editor/${version}/Editor/Data/Resources/fontsettings.txt" <<-EOF
|
||||
English|default=Inter, IPAPGothic, Verdana, Tahoma
|
||||
English|Inter-Regular=Inter, IPAPGothic, Verdana, Tahoma
|
||||
English|Inter-SemiBold=Inter, IPAPGothic, Verdana, Tahoma
|
||||
English|Inter-Small=Inter, IPAPGothic, Verdana, Tahoma
|
||||
English|Inter-Italic=Inter, IPAPGothic, Verdana, Tahoma
|
||||
English|Inter-SemiBoldItalic=Inter, IPAPGothic, Verdana, Tahoma
|
||||
EOF
|
||||
'';
|
||||
})
|
||||
];
|
||||
home.stateVersion = "26.11";
|
||||
xdg.userDirs.enable = true;
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
"x-scheme-handler/tg" = "org.telegram.desktop.desktop";
|
||||
"x-scheme-handler/tonsite" = "org.telegram.desktop.desktop";
|
||||
};
|
||||
};
|
||||
services.xembed-sni-proxy.enable = true;
|
||||
services.mpd.enable = true;
|
||||
services.mpd-mpris.enable = true;
|
||||
};
|
||||
|
||||
nix.optimise.automatic = true;
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
alchemy = prev.callPackage ./alchemy-viewer/alchemy.nix {};
|
||||
})
|
||||
];
|
||||
}
|
||||
Reference in new issue
Block a user