-
-
Notifications
You must be signed in to change notification settings - Fork 262
stylix/darwin: add module #1892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
mkTarget, | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: | ||
|
||
mkTarget { | ||
name = "darwin"; | ||
humanName = "Darwin"; | ||
|
||
configElements = [ | ||
( | ||
{ | ||
image, | ||
pkgs, | ||
}: | ||
{ | ||
home.activation = { | ||
stylixBackground = '' | ||
run ${pkgs.callPackage ../../stylix/darwin/desktoppr.nix { }}/bin/desktoppr all ${image} | ||
''; | ||
}; | ||
} | ||
) | ||
( | ||
{ | ||
colors, | ||
}: | ||
|
||
{ | ||
|
||
targets.darwin.defaults."Apple Global Domain" = { | ||
AppleIconAppearanceCustomTintColor = builtins.readFile "${ | ||
pkgs.runCommand "color" { } '' | ||
full=$((16#${colors.base00})) | ||
red=$((($full >> 16) & 0xff)) | ||
red=$(echo "scale=10; $red.0 / 255.0 " | bc |awk '{printf "%f", $0}') | ||
green=$((($full >> 8) & 0xff)) | ||
green=$(echo "scale=10; $green.0 / 255.0 " | bc | awk '{printf "%f", $0}') | ||
blue=$(($full & 0xff)) | ||
blue=$(echo "scale=10; $blue.0 / 255.0 " | bc | awk '{printf "%f", $0}') | ||
echo "$red $green $blue 1.0" > $out | ||
'' | ||
|
||
}"; | ||
}; | ||
} | ||
) | ||
]; | ||
|
||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,5 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name = "Darwin"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
homepage = "https://github.com/nix-darwin/nix-darwin"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
maintainers = [ ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines 228 to 264 in 0ce0103
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
stdenv, | ||
fetchurl, | ||
lib, | ||
unzip, | ||
}: | ||
stdenv.mkDerivation { | ||
name = "desktoppr"; | ||
version = "0.5-218"; | ||
pname = "desktoppr"; | ||
src = fetchurl { | ||
url = "https://github.com/scriptingosx/desktoppr/releases/download/v0.5/desktoppr-0.5-218.zip"; | ||
hash = "sha256-Oa9gAQjOaJHYyT5JBUiFCxL1sQP1dqlFBm+GdmLHNNM="; | ||
}; | ||
|
||
buildInputs = [ | ||
unzip | ||
]; | ||
|
||
unpackPhase = '' | ||
runHook preUnpack | ||
|
||
unzip $src | ||
|
||
runHook postUnpack | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
|
||
mkdir -p $out/bin | ||
cp -r desktoppr $out/bin | ||
|
||
runHook postInstall | ||
''; | ||
|
||
} | ||
Comment on lines
+1
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This pr might be worth mentioning NixOS/nixpkgs#397284 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out. I suggest using the Nixpkgs module (after updating our Nixpkgs input) once it has been merged. |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to natively implement this in Nix. Also, take a look at existing Stylix modules, to find something similar as inspiration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like in colors.nix module that was recently merged for
mkHexOpacityColor
andmkHexColor