From c0c5f6d209c1bcebb98e9b3bbee8d673e9db6e27 Mon Sep 17 00:00:00 2001 From: Towry Wang Date: Mon, 18 Nov 2024 16:46:48 +0800 Subject: [PATCH 1/2] fix: screenshots and dock --- nix/darwin/apple.nix | 7 +++++-- nix/hm/shared.nix | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nix/darwin/apple.nix b/nix/darwin/apple.nix index 81ddbff8..479ce2a8 100644 --- a/nix/darwin/apple.nix +++ b/nix/darwin/apple.nix @@ -4,7 +4,7 @@ ... }: { environment = { - systemPackages =[ + systemPackages = [ ]; }; @@ -52,13 +52,16 @@ # Settings of plist in ~/Library/Preferences/ "com.apple.finder" = { # Set home directory as startup window - NewWindowTargetPath = "file:///Users/${username}/"; + NewWindowTargetPath = "file:///Users/${username}/Downloads"; NewWindowTarget = "PfHm"; # Set search scope to directory FXDefaultSearchScope = "SCcf"; # Multi-file tab view FinderSpawnTab = true; }; + "com.apple.dock" = { + mru-spaces = 0; + }; "com.apple.desktopservices" = { # Disable creating .DS_Store files in network an USB volumes DSDontWriteNetworkStores = true; diff --git a/nix/hm/shared.nix b/nix/hm/shared.nix index ca55a474..1114d30c 100644 --- a/nix/hm/shared.nix +++ b/nix/hm/shared.nix @@ -18,6 +18,7 @@ in { run mkdir -p ${config.home.homeDirectory}/workspace run mkdir -p ${config.home.homeDirectory}/workspace/goenv run mkdir -p ${config.home.homeDirectory}/.local/bin + run mkdir -p ${config.home.homeDirectory}/Pictures/Screenshots ''; }; # TODO: move to module. From 7dba9d1123ba1b62944e3d002a60007d30595dca Mon Sep 17 00:00:00 2001 From: Towry Wang Date: Wed, 20 Nov 2024 09:27:24 +0800 Subject: [PATCH 2/2] feat: dark notify aarch64 --- nix/pkgs/dark-mode-notify.nix | 68 ++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/nix/pkgs/dark-mode-notify.nix b/nix/pkgs/dark-mode-notify.nix index 6e0f14bc..e04c1b61 100644 --- a/nix/pkgs/dark-mode-notify.nix +++ b/nix/pkgs/dark-mode-notify.nix @@ -1,35 +1,45 @@ -{pkgs, ...}: -pkgs.stdenv.mkDerivation rec { - name = "dark-notify"; +{pkgs, ...}: let version = "0.1.2"; - - src = pkgs.fetchurl { - url = "https://github.com/cormacrelf/dark-notify/releases/download/v${version}/dark-notify-v0.1.2.tar.gz"; - sha256 = "987c4e40ca9f7996f72d8967a74417e2fc7e8d7aea02e93bd314f80a80817f9a"; + tarballUrlMap = { + x86_64-darwin = { + url = "https://github.com/cormacrelf/dark-notify/releases/download/v${version}/dark-notify-v0.1.2.tar.gz"; + sha256 = "987c4e40ca9f7996f72d8967a74417e2fc7e8d7aea02e93bd314f80a80817f9a"; + }; + aarch64-darwin = { + url = "https://github.com/pze/dark-notify/releases/download/v0.1.2/dark-notify-aarch64-darwin-v0.1.2.tar.gz"; + sha256 = "0kf1ms88847j022lk7gw26zjxw9cvv3zz8xar88l0vx8f46xjss6"; + }; }; + tarball = tarballUrlMap.${pkgs.system}; +in + pkgs.stdenv.mkDerivation { + name = "dark-notify"; + version = version; - nativeBuildInputs = [ - # installShellFiles - pkgs.makeBinaryWrapper - ]; + src = pkgs.fetchurl tarball; - sourceRoot = "."; - installPhase = '' - mkdir -p $out/bin - mv dark-notify $out/bin/dark-notify - ''; + nativeBuildInputs = [ + # installShellFiles + pkgs.makeBinaryWrapper + ]; - postFixup = with pkgs; '' - wrapProgram $out/bin/dark-notify \ - --set PATH ${lib.makeBinPath [ - coreutils - bash - python3 - ]} - ''; + sourceRoot = "."; + installPhase = '' + mkdir -p $out/bin + mv dark-notify $out/bin/dark-notify + ''; - meta = { - description = "Watcher for macOS 10.14+ light/dark mode changes"; - homepage = "https://github.com/cormacrelf/dark-notify"; - }; -} + postFixup = with pkgs; '' + wrapProgram $out/bin/dark-notify \ + --set PATH ${lib.makeBinPath [ + coreutils + bash + python3 + ]} + ''; + + meta = { + description = "Watcher for macOS 10.14+ light/dark mode changes"; + homepage = "https://github.com/cormacrelf/dark-notify"; + }; + }