about summary refs log tree commit diff
path: root/pkgs/by-name/da/dark-mode-notify/package.nix
blob: 51ecb1d38397ac8b577ad24e37c11a8e9256d043 (plain) (blame)
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
{ lib
, fetchFromGitHub
, stdenv
, swift
, swiftpm
, swiftPackages
, darwin
}:

# Use the same stdenv, including clang, as Swift itself
# Fixes build issues, see https://github.com/NixOS/nixpkgs/pull/296082 and https://github.com/NixOS/nixpkgs/issues/295322
swiftPackages.stdenv.mkDerivation (final: {
  pname = "dark-mode-notify";
  version = "unstable-2022-07-18";

  src = fetchFromGitHub {
    owner = "bouk";
    repo = "dark-mode-notify";
    rev = "4d7fe211f81c5b67402fad4bed44995344a260d1";
    hash = "sha256-LsAQ5v5jgJw7KsJnQ3Mh6+LNj1EMHICMoD5WzF3hRmU=";
  };

  nativeBuildInputs = [
    swift
    swiftpm
  ];

  buildInputs = with darwin.apple_sdk.frameworks; [
    Foundation
    Cocoa
  ];

  makeFlags = [ "prefix=$(out)" ];

  meta = {
    description = "Run a script whenever dark mode changes in macOS";
    homepage = "https://github.com/bouk/dark-mode-notify";
    # Doesn't build on x86_64 because of some CoreGraphics issue, even with SDK 11.0
    platforms = [ "aarch64-darwin" ];
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ YorikSar ];
    mainProgram = "dark-mode-notify";
  };
})