mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-12 19:27:17 +00:00
redo apps/packages
This commit is contained in:
parent
e5f4a95410
commit
d32c9060b8
26 changed files with 408 additions and 336 deletions
|
@ -1,51 +0,0 @@
|
||||||
{
|
|
||||||
definition = lib: pkgs:
|
|
||||||
(
|
|
||||||
let
|
|
||||||
versions = {
|
|
||||||
aarch64-darwin = "1101351";
|
|
||||||
x86_64-darwin = "1101350";
|
|
||||||
};
|
|
||||||
|
|
||||||
version = versions.${pkgs.stdenv.hostPlatform.system};
|
|
||||||
|
|
||||||
pname = "chromium";
|
|
||||||
appName = "Chromium";
|
|
||||||
|
|
||||||
srcs = {
|
|
||||||
aarch64-darwin = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac_Arm/${version}/chrome-mac.zip";
|
|
||||||
sha256 = "sha256-LlbYlJmFLzyHIiygofa0Btm7NAOvWXXhmbjMHldVoGo=";
|
|
||||||
name = "${pname}_aarch64_${version}.zip";
|
|
||||||
};
|
|
||||||
x86_64-darwin = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/${version}/chrome-mac.zip";
|
|
||||||
sha256 = "sha256-O+OnjakEpjCRbSjDysEA6RKKaKaSMw+LSO2ZLcxz2vM=";
|
|
||||||
name = "${pname}_x86_64_${version}.zip";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
src = srcs.${pkgs.stdenv.hostPlatform.system};
|
|
||||||
in
|
|
||||||
lib.mk-mac-binpkg {
|
|
||||||
inherit pkgs src pname appName version;
|
|
||||||
srcsubdir = "chrome-mac";
|
|
||||||
meta = with pkgs.lib; {
|
|
||||||
description = "An open source web browser from Google.";
|
|
||||||
longDescription = ''
|
|
||||||
Chromium is an open source web browser from Google that aims to build a
|
|
||||||
safer, faster, and more stable way for all Internet users to experience
|
|
||||||
the web. It has a minimalist user interface and provides the vast majority
|
|
||||||
of source code for Google Chrome (which has some additional features).
|
|
||||||
'';
|
|
||||||
homepage = "https://www.chromium.org/";
|
|
||||||
license = licenses.bsd3;
|
|
||||||
platforms = platforms.linux;
|
|
||||||
mainProgram = "chromium";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
definition = lib: pkgs: (
|
|
||||||
let
|
|
||||||
version = "109.0.1";
|
|
||||||
pname = "firefox";
|
|
||||||
appName = "Firefox";
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"https://download-installer.cdn.mozilla.net/pub/firefox/releases/${version}/mac/en-CA/Firefox%20${version}.dmg";
|
|
||||||
sha256 = "sha256-V/8W3qqYhJmte2tq/ZSPtYChdhv8WFQoSORYRaxva9Y=";
|
|
||||||
name = "${pname}_${version}.dmg";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
lib.mk-mac-binpkg { inherit pkgs src pname appName version; }
|
|
||||||
);
|
|
||||||
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
|
||||||
}
|
|
|
@ -1,63 +0,0 @@
|
||||||
{
|
|
||||||
definition = lib: pkgs:
|
|
||||||
let
|
|
||||||
version = "0.20.2";
|
|
||||||
date = "2022-12-27";
|
|
||||||
appName = "FreeCAD";
|
|
||||||
pname = "freecad";
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"https://github.com/FreeCAD/FreeCAD/releases/download/${version}/FreeCAD_${version}-${date}-conda-macOS-x86_64-py310.dmg";
|
|
||||||
sha256 = "sha256-OAi98HUacHcLHVYSadnQFPnEhutJvE4YfRBtPSZk00c=";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
pkgs.stdenv.mkDerivation {
|
|
||||||
inherit version src;
|
|
||||||
|
|
||||||
name = pname;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
export tempdir=$(mktemp -d -p /tmp)
|
|
||||||
|
|
||||||
cp $src freecad.dmg
|
|
||||||
/usr/bin/hdiutil attach -mountpoint "$tempdir" freecad.dmg
|
|
||||||
|
|
||||||
mkdir -p $out/Applications
|
|
||||||
|
|
||||||
cp -r "$tempdir/${appName}.app" $out/Applications
|
|
||||||
|
|
||||||
/usr/bin/hdiutil detach "$tempdir"
|
|
||||||
|
|
||||||
mkdir -p $out/bin
|
|
||||||
makeWrapper "$out/Applications/${appName}.app/Contents/MacOS/${appName}" "$out/bin/${pname}"
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
meta = with pkgs.lib; {
|
|
||||||
homepage = "https://www.freecadweb.org/";
|
|
||||||
description = "General purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler";
|
|
||||||
longDescription = ''
|
|
||||||
FreeCAD is an open-source parametric 3D modeler made primarily to design
|
|
||||||
real-life objects of any size. Parametric modeling allows you to easily
|
|
||||||
modify your design by going back into your model history and changing its
|
|
||||||
parameters.
|
|
||||||
FreeCAD allows you to sketch geometry constrained 2D shapes and use them
|
|
||||||
as a base to build other objects. It contains many components to adjust
|
|
||||||
dimensions or extract design details from 3D models to create high quality
|
|
||||||
production ready drawings.
|
|
||||||
FreeCAD is designed to fit a wide range of uses including product design,
|
|
||||||
mechanical engineering and architecture. Whether you are a hobbyist, a
|
|
||||||
programmer, an experienced CAD user, a student or a teacher, you will feel
|
|
||||||
right at home with FreeCAD.
|
|
||||||
'';
|
|
||||||
license = licenses.lgpl2Plus;
|
|
||||||
platforms = platforms.darwin;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
|
||||||
}
|
|
11
apps/home-switch.nix
Normal file
11
apps/home-switch.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{ writeShellApplication
|
||||||
|
, home-manager
|
||||||
|
,
|
||||||
|
}:
|
||||||
|
writeShellApplication {
|
||||||
|
name = "home-switch";
|
||||||
|
runtimeInputs = [ home-manager ];
|
||||||
|
text = ''
|
||||||
|
exec home-manager switch --flake . "$@"
|
||||||
|
'';
|
||||||
|
}
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
definition = lib: pkgs: pkgs.stdenv.mkDerivation {
|
|
||||||
name = "pinentry-mac";
|
|
||||||
src = pkgs.pinentry_mac;
|
|
||||||
installPhase = ''
|
|
||||||
# -*-sh-*-
|
|
||||||
|
|
||||||
mkdir -p "$out/bin"
|
|
||||||
|
|
||||||
cp "$src/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac" "$out/bin/pinentry-mac"
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Pinentry for GPG on Mac";
|
|
||||||
license = pkgs.lib.licenses.gpl2Plus;
|
|
||||||
homepage = "https://github.com/GPGTools/pinentry-mac";
|
|
||||||
platforms = pkgs.lib.platforms.darwin;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
{
|
|
||||||
definition = lib: pkgs: pkgs.stdenv.mkDerivation {
|
|
||||||
name = "pinentry-touchid";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "jorgelbg";
|
|
||||||
repo = "pinentry-touchid";
|
|
||||||
rev = "1170eb6bc7b23313aee622887b47b77be6e5fb5f";
|
|
||||||
sha256 = "sha256-asLFY7ztRKXEFsetB3Ym/0tJ1BBOn0yYpL8MIn1Z//0=";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
go
|
|
||||||
gopls
|
|
||||||
gotools
|
|
||||||
darwin.apple_sdk.frameworks.CoreFoundation
|
|
||||||
darwin.apple_sdk.frameworks.Foundation
|
|
||||||
darwin.apple_sdk.frameworks.LocalAuthentication
|
|
||||||
];
|
|
||||||
|
|
||||||
sourceRoot = ".";
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
unset GOROOT
|
|
||||||
|
|
||||||
export GOPATH="/tmp/gopath-$(echo $RANDOM | md5sum | head -c 20)"
|
|
||||||
export GOCACHE="/tmp/gocache-$(echo $RANDOM | md5sum | head -c 20)"
|
|
||||||
|
|
||||||
export NIX_LDFLAGS="-F${pkgs.darwin.apple_sdk.frameworks.CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_LDFLAGS";
|
|
||||||
|
|
||||||
cd source
|
|
||||||
|
|
||||||
go mod download
|
|
||||||
go build
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
mv pinentry-touchid $out/bin/pinentry-touchid
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Custom GPG pinentry program for macOS that allows using Touch ID for fetching the password from the macOS keychain.";
|
|
||||||
license = pkgs.lib.licenses.asl20;
|
|
||||||
homepage = "https://github.com/jorgelbg/pinentry-touchid";
|
|
||||||
platforms = pkgs.lib.platforms.darwin;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
definition = lib: pkgs:
|
|
||||||
let
|
|
||||||
version = "4.4.5";
|
|
||||||
appName = "qBittorrent";
|
|
||||||
pname = "qbittorrent";
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"https://phoenixnap.dl.sourceforge.net/project/qbittorrent/qbittorrent-mac/qbittorrent-${version}/qbittorrent-${version}.dmg";
|
|
||||||
sha256 = "sha256-9h+gFAEU0tKrltOjnOKLfylbbBunGZqvPzQogdP9uQM=";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
lib.mk-mac-binpkg {
|
|
||||||
inherit pkgs src pname appName version;
|
|
||||||
meta = with pkgs.lib; {
|
|
||||||
description = "Featureful free software BitTorrent client";
|
|
||||||
homepage = "https://www.qbittorrent.org/";
|
|
||||||
changelog = "https://github.com/qbittorrent/qBittorrent/blob/release-${version}/Changelog";
|
|
||||||
license = licenses.gpl2Plus;
|
|
||||||
platforms = platforms.darwin;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
definition = lib: pkgs:
|
|
||||||
let
|
|
||||||
appName = "Spotify";
|
|
||||||
pname = "spotify";
|
|
||||||
version = "sha256-JESQZtyPE9o5PW/f5GdxbqbyeHCxs/oZEW0AakMJgKg=";
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url = "https://download.scdn.co/Spotify.dmg";
|
|
||||||
hash = version;
|
|
||||||
name = "spotify-mac.dmg";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
lib.mk-mac-binpkg {
|
|
||||||
inherit pkgs src pname appName version;
|
|
||||||
meta = with pkgs.lib; {
|
|
||||||
homepage = "https://www.spotify.com/";
|
|
||||||
description = "Play music from the Spotify music service";
|
|
||||||
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
|
||||||
license = licenses.unfree;
|
|
||||||
platforms = platforms.darwin;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
{
|
|
||||||
definition = lib: pkgs:
|
|
||||||
let
|
|
||||||
appName = "VLC";
|
|
||||||
pname = "vlc";
|
|
||||||
version = "3.0.18";
|
|
||||||
srcs = {
|
|
||||||
aarch64-darwin = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"http://get.videolan.org/vlc/${version}/macosx/vlc-${version}-arm64.dmg";
|
|
||||||
sha256 = "sha256-mcJZvbxSIf1QgX9Ri3Dpv57hdeiQdDkDyYB7x3hmj0c=";
|
|
||||||
name = "${pname}_aarch64_${version}.dmg";
|
|
||||||
};
|
|
||||||
x86_64-darwin = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"http://get.videolan.org/vlc/${version}/macosx/vlc-${version}-intel64.dmg";
|
|
||||||
sha256 = "sha256-iO3N/Os70vaANn2QCdOKDBR/p1jy3TleQ0EsHgjOHMs=";
|
|
||||||
name = "${pname}_x86_64_${version}.dmg";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
src = srcs.${pkgs.stdenv.hostPlatform.system};
|
|
||||||
in
|
|
||||||
lib.mk-mac-binpkg {
|
|
||||||
inherit pkgs src pname appName version;
|
|
||||||
meta = with pkgs.lib; {
|
|
||||||
description = "Cross-platform media player and streaming server";
|
|
||||||
homepage = "http://www.videolan.org/vlc/";
|
|
||||||
license = licenses.lgpl21Plus;
|
|
||||||
platforms = platforms.darwin;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,16 +1,22 @@
|
||||||
{ lib, self, inputs, withSystem, config, ... }: {
|
# Copyright (c) 2018 Terje Larsen
|
||||||
flake =
|
|
||||||
let
|
# This work is licensed under the terms of the MIT license.
|
||||||
buildProgram = system: definition: (withSystem system ({ pkgs, self', ... }: definition self.lib pkgs));
|
# For a copy, see https://opensource.org/licenses/MIT.
|
||||||
defineProgram = system: name: definition: { ${system}.${name} = buildProgram system definition; };
|
|
||||||
appsDir = self.lib.importDirToAttrs ../apps;
|
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/apps.nix
|
||||||
builtPrograms = lib.mapAttrsToList (name: value: (lib.forEach (builtins.filter (system: builtins.elem system config.systems) value.systems) (system: defineProgram system name value.definition))) appsDir;
|
|
||||||
flattenedPrograms = lib.flatten builtPrograms;
|
{lib, ...}: {
|
||||||
assembledPrograms = builtins.foldl' (a: b: lib.recursiveUpdate a b) { } flattenedPrograms;
|
perSystem = {pkgs, ...}:
|
||||||
assembledApps = lib.mapAttrsRecursiveCond (as: !(as ? "type" && as.type == "derivation")) (path: value: { type = "app"; program = lib.getExe value; }) assembledPrograms;
|
lib.pipe ../apps [
|
||||||
in
|
lib.filesystem.listFilesRecursive
|
||||||
{
|
(map (file: pkgs.callPackage file {}))
|
||||||
apps = assembledApps;
|
(map (drv: {
|
||||||
programs = assembledPrograms;
|
apps.${drv.name} = {
|
||||||
};
|
type = "app";
|
||||||
|
program = lib.getExe drv;
|
||||||
|
};
|
||||||
|
checks."app-${drv.name}" = drv;
|
||||||
|
}))
|
||||||
|
(lib.fold lib.recursiveUpdate {})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,5 +4,6 @@
|
||||||
./home-manager
|
./home-manager
|
||||||
./lib
|
./lib
|
||||||
./overlays.nix
|
./overlays.nix
|
||||||
|
./packages.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,28 +31,6 @@
|
||||||
builtins.listToAttrs
|
builtins.listToAttrs
|
||||||
];
|
];
|
||||||
|
|
||||||
mk-mac-binpkg = { src, version, pname, appName, pkgs, srcsubdir ? ".", ... }: pkgs.stdenv.mkDerivation {
|
mk-mac-binpkg = import ../../packages/mk-mac-binpkg.nix;
|
||||||
inherit version src;
|
|
||||||
|
|
||||||
name = pname;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.undmg pkgs.unzip pkgs.makeWrapper ];
|
|
||||||
|
|
||||||
sourceRoot = ".";
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out/Applications
|
|
||||||
|
|
||||||
cp -r "${srcsubdir}/${appName}.app" $out/Applications
|
|
||||||
|
|
||||||
# wrap executable to $out/bin
|
|
||||||
mkdir -p $out/bin
|
|
||||||
makeWrapper "$out/Applications/${appName}.app/Contents/MacOS/${appName}" "$out/bin/${pname}"
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
72
flake-parts/packages.nix
Normal file
72
flake-parts/packages.nix
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
# Copyright (c) 2018 Terje Larsen
|
||||||
|
|
||||||
|
# This work is licensed under the terms of the MIT license.
|
||||||
|
# For a copy, see https://opensource.org/licenses/MIT.
|
||||||
|
|
||||||
|
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/packages.nix
|
||||||
|
|
||||||
|
{ self
|
||||||
|
, lib
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
perSystem =
|
||||||
|
{ config
|
||||||
|
, pkgs
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
overlays = [
|
||||||
|
self.overlays.default
|
||||||
|
];
|
||||||
|
pkgs' = pkgs.extend (lib.composeManyExtensions overlays);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = {
|
||||||
|
inherit (pkgs')
|
||||||
|
chromium-mac
|
||||||
|
darwin-zsh-completions
|
||||||
|
firefox-mac
|
||||||
|
freecad-mac
|
||||||
|
org-auctex
|
||||||
|
pinentry-mac
|
||||||
|
pinentry-touchid
|
||||||
|
qbittorrent-mac
|
||||||
|
spotify-mac
|
||||||
|
vlc-mac;
|
||||||
|
};
|
||||||
|
|
||||||
|
legacyPackages = {
|
||||||
|
wrapPackage =
|
||||||
|
{ wrapper
|
||||||
|
, package
|
||||||
|
, exes ? [ (lib.getExe package) ]
|
||||||
|
,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
wrapperExe = lib.getExe wrapper;
|
||||||
|
wrapExe = exe:
|
||||||
|
pkgs.writeShellScriptBin (builtins.baseNameOf exe) ''
|
||||||
|
exec ${wrapperExe} ${exe} "$@"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
pkgs.symlinkJoin {
|
||||||
|
name = "${package.name}-${wrapper.name}";
|
||||||
|
paths = (map wrapExe exes) ++ [ package ];
|
||||||
|
};
|
||||||
|
|
||||||
|
wrapPackages = pkgsWrapperFn: pkgNames: final: prev:
|
||||||
|
let
|
||||||
|
wrapper = pkgsWrapperFn final;
|
||||||
|
in
|
||||||
|
builtins.listToAttrs (map
|
||||||
|
(name: {
|
||||||
|
inherit name;
|
||||||
|
value = config.legacyPackages.wrapPackage {
|
||||||
|
inherit wrapper;
|
||||||
|
package = prev.${name};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
pkgNames);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -17,7 +17,7 @@ in
|
||||||
{
|
{
|
||||||
home.file.".gnupg/gpg-agent.conf" = mkIf stdenv.isDarwin {
|
home.file.".gnupg/gpg-agent.conf" = mkIf stdenv.isDarwin {
|
||||||
text = ''
|
text = ''
|
||||||
pinentry-program "${pkgs.pinentryTouchid}/bin/pinentry-touchid"
|
pinentry-program "${pkgs.pinentry-touchid}/bin/pinentry-touchid"
|
||||||
default-cache-ttl 30
|
default-cache-ttl 30
|
||||||
max-cache-ttl 600
|
max-cache-ttl 600
|
||||||
'';
|
'';
|
||||||
|
@ -41,8 +41,8 @@ in
|
||||||
pinentry = "pinentry-mac";
|
pinentry = "pinentry-mac";
|
||||||
} // lib.attrsets.mapAttrs (name: value: "open -a '" + value + "'") appCommands);
|
} // lib.attrsets.mapAttrs (name: value: "open -a '" + value + "'") appCommands);
|
||||||
|
|
||||||
programs.firefox.package = mkIf stdenv.isDarwin pkgs.firefoxMac;
|
programs.firefox.package = mkIf stdenv.isDarwin pkgs.firefox-mac;
|
||||||
programs.chromium.package = mkIf stdenv.isDarwin pkgs.chromiumMac;
|
programs.chromium.package = mkIf stdenv.isDarwin pkgs.chromium-mac;
|
||||||
|
|
||||||
targets.darwin = mkIf stdenv.isDarwin {
|
targets.darwin = mkIf stdenv.isDarwin {
|
||||||
defaults = {
|
defaults = {
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
let
|
let
|
||||||
darwin = with pkgs; [
|
darwin = with pkgs; [
|
||||||
pngpaste
|
pngpaste
|
||||||
pinentryTouchid
|
pinentry-touchid
|
||||||
pinentryMac
|
pinentry-mac
|
||||||
spoof-mac
|
spoof-mac
|
||||||
];
|
];
|
||||||
linux = with pkgs; [ ];
|
linux = with pkgs; [ ];
|
||||||
|
|
46
packages/chromium-mac.nix
Normal file
46
packages/chromium-mac.nix
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
{ fetchurl, lib, mkMacBinPackage, stdenv }:
|
||||||
|
|
||||||
|
let
|
||||||
|
versions = {
|
||||||
|
aarch64-darwin = "1101351";
|
||||||
|
x86_64-darwin = "1101350";
|
||||||
|
};
|
||||||
|
|
||||||
|
version = versions.${stdenv.hostPlatform.system};
|
||||||
|
|
||||||
|
pname = "chromium";
|
||||||
|
appName = "Chromium";
|
||||||
|
|
||||||
|
srcs = {
|
||||||
|
aarch64-darwin = fetchurl {
|
||||||
|
url =
|
||||||
|
"https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac_Arm/${version}/chrome-mac.zip";
|
||||||
|
sha256 = "sha256-LlbYlJmFLzyHIiygofa0Btm7NAOvWXXhmbjMHldVoGo=";
|
||||||
|
name = "${pname}_aarch64_${version}.zip";
|
||||||
|
};
|
||||||
|
x86_64-darwin = fetchurl {
|
||||||
|
url =
|
||||||
|
"https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/${version}/chrome-mac.zip";
|
||||||
|
sha256 = "sha256-O+OnjakEpjCRbSjDysEA6RKKaKaSMw+LSO2ZLcxz2vM=";
|
||||||
|
name = "${pname}_x86_64_${version}.zip";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
src = srcs.${stdenv.hostPlatform.system};
|
||||||
|
in
|
||||||
|
mkMacBinPackage {
|
||||||
|
inherit src pname appName version;
|
||||||
|
srcsubdir = "chrome-mac";
|
||||||
|
meta = with lib; {
|
||||||
|
description = "An open source web browser from Google.";
|
||||||
|
longDescription = ''
|
||||||
|
Chromium is an open source web browser from Google that aims to build a
|
||||||
|
safer, faster, and more stable way for all Internet users to experience
|
||||||
|
the web. It has a minimalist user interface and provides the vast majority
|
||||||
|
of source code for Google Chrome (which has some additional features).
|
||||||
|
'';
|
||||||
|
homepage = "https://www.chromium.org/";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
mainProgram = "chromium";
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,4 +1,13 @@
|
||||||
_final: prev: {
|
_final: prev: {
|
||||||
org-auctex = prev.callPackage ./org-auctex.nix {};
|
chromium-mac = prev.callPackage ./chromium-mac.nix { };
|
||||||
darwin-zsh-completions = prev.callPackage ./darwin-zsh-completions.nix {};
|
darwin-zsh-completions = prev.callPackage ./darwin-zsh-completions.nix { };
|
||||||
|
firefox-mac = prev.callPackage ./firefox-mac.nix { };
|
||||||
|
freecad-mac = prev.callPackage ./freecad-mac.nix { };
|
||||||
|
mkMacBinPackage = import ./mk-mac-binpkg.nix prev;
|
||||||
|
org-auctex = prev.callPackage ./org-auctex.nix { };
|
||||||
|
pinentry-mac = prev.callPackage ./pinentry-mac.nix { };
|
||||||
|
pinentry-touchid = prev.callPackage ./pinentry-touchid.nix { };
|
||||||
|
qbittorrent-mac = prev.callPackage ./qbittorrent-mac.nix { };
|
||||||
|
spotify-mac = prev.callPackage ./spotify-mac.nix { };
|
||||||
|
vlc-mac = prev.callPackage ./vlc-mac.nix { };
|
||||||
}
|
}
|
||||||
|
|
14
packages/firefox-mac.nix
Normal file
14
packages/firefox-mac.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{ fetchurl, lib, mkMacBinPackage }:
|
||||||
|
let
|
||||||
|
version = "109.0.1";
|
||||||
|
pname = "firefox";
|
||||||
|
appName = "Firefox";
|
||||||
|
src = fetchurl {
|
||||||
|
url =
|
||||||
|
"https://download-installer.cdn.mozilla.net/pub/firefox/releases/${version}/mac/en-CA/Firefox%20${version}.dmg";
|
||||||
|
sha256 = "sha256-V/8W3qqYhJmte2tq/ZSPtYChdhv8WFQoSORYRaxva9Y=";
|
||||||
|
name = "${pname}_${version}.dmg";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
mkMacBinPackage { inherit src pname appName version; }
|
||||||
|
|
60
packages/freecad-mac.nix
Normal file
60
packages/freecad-mac.nix
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
{ fetchurl, lib, makeWrapper, stdenv }:
|
||||||
|
let
|
||||||
|
version = "0.20.2";
|
||||||
|
date = "2022-12-27";
|
||||||
|
appName = "FreeCAD";
|
||||||
|
pname = "freecad";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url =
|
||||||
|
"https://github.com/FreeCAD/FreeCAD/releases/download/${version}/FreeCAD_${version}-${date}-conda-macOS-x86_64-py310.dmg";
|
||||||
|
sha256 = "sha256-OAi98HUacHcLHVYSadnQFPnEhutJvE4YfRBtPSZk00c=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
inherit version src;
|
||||||
|
|
||||||
|
name = pname;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
export tempdir=$(mktemp -d -p /tmp)
|
||||||
|
|
||||||
|
cp $src freecad.dmg
|
||||||
|
/usr/bin/hdiutil attach -mountpoint "$tempdir" freecad.dmg
|
||||||
|
|
||||||
|
mkdir -p $out/Applications
|
||||||
|
|
||||||
|
cp -r "$tempdir/${appName}.app" $out/Applications
|
||||||
|
|
||||||
|
/usr/bin/hdiutil detach "$tempdir"
|
||||||
|
|
||||||
|
mkdir -p $out/bin
|
||||||
|
makeWrapper "$out/Applications/${appName}.app/Contents/MacOS/${appName}" "$out/bin/${pname}"
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://www.freecadweb.org/";
|
||||||
|
description = "General purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler";
|
||||||
|
longDescription = ''
|
||||||
|
FreeCAD is an open-source parametric 3D modeler made primarily to design
|
||||||
|
real-life objects of any size. Parametric modeling allows you to easily
|
||||||
|
modify your design by going back into your model history and changing its
|
||||||
|
parameters.
|
||||||
|
FreeCAD allows you to sketch geometry constrained 2D shapes and use them
|
||||||
|
as a base to build other objects. It contains many components to adjust
|
||||||
|
dimensions or extract design details from 3D models to create high quality
|
||||||
|
production ready drawings.
|
||||||
|
FreeCAD is designed to fit a wide range of uses including product design,
|
||||||
|
mechanical engineering and architecture. Whether you are a hobbyist, a
|
||||||
|
programmer, an experienced CAD user, a student or a teacher, you will feel
|
||||||
|
right at home with FreeCAD.
|
||||||
|
'';
|
||||||
|
license = licenses.lgpl2Plus;
|
||||||
|
platforms = platforms.darwin;
|
||||||
|
};
|
||||||
|
}
|
23
packages/mk-mac-binpkg.nix
Normal file
23
packages/mk-mac-binpkg.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
pkgs: { src, version, pname, appName, srcsubdir ? ".", ... }: pkgs.stdenv.mkDerivation {
|
||||||
|
inherit version src;
|
||||||
|
|
||||||
|
name = pname;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgs.undmg pkgs.unzip pkgs.makeWrapper ];
|
||||||
|
|
||||||
|
sourceRoot = ".";
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/Applications
|
||||||
|
|
||||||
|
cp -r "${srcsubdir}/${appName}.app" $out/Applications
|
||||||
|
|
||||||
|
# wrap executable to $out/bin
|
||||||
|
mkdir -p $out/bin
|
||||||
|
makeWrapper "$out/Applications/${appName}.app/Contents/MacOS/${appName}" "$out/bin/${pname}"
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
{ fetchFromGitHub, emacsPackages }:
|
{ emacsPackages, fetchFromGitHub }:
|
||||||
|
|
||||||
emacsPackages.trivialBuild {
|
emacsPackages.trivialBuild {
|
||||||
pname = "org-auctex";
|
pname = "org-auctex";
|
||||||
|
|
19
packages/pinentry-mac.nix
Normal file
19
packages/pinentry-mac.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ lib, pinentry_mac, stdenv }: stdenv.mkDerivation {
|
||||||
|
name = "pinentry-mac";
|
||||||
|
src = pinentry_mac;
|
||||||
|
installPhase = ''
|
||||||
|
# -*-sh-*-
|
||||||
|
|
||||||
|
mkdir -p "$out/bin"
|
||||||
|
|
||||||
|
cp "$src/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac" "$out/bin/pinentry-mac"
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Pinentry for GPG on Mac";
|
||||||
|
license = licenses.gpl2Plus;
|
||||||
|
homepage = "https://github.com/GPGTools/pinentry-mac";
|
||||||
|
platforms = platforms.darwin;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
46
packages/pinentry-touchid.nix
Normal file
46
packages/pinentry-touchid.nix
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
{ fetchFromGitHub, lib, pkgs, stdenv }: stdenv.mkDerivation {
|
||||||
|
name = "pinentry-touchid";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "jorgelbg";
|
||||||
|
repo = "pinentry-touchid";
|
||||||
|
rev = "1170eb6bc7b23313aee622887b47b77be6e5fb5f";
|
||||||
|
sha256 = "sha256-asLFY7ztRKXEFsetB3Ym/0tJ1BBOn0yYpL8MIn1Z//0=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
go
|
||||||
|
gopls
|
||||||
|
gotools
|
||||||
|
darwin.apple_sdk.frameworks.CoreFoundation
|
||||||
|
darwin.apple_sdk.frameworks.Foundation
|
||||||
|
darwin.apple_sdk.frameworks.LocalAuthentication
|
||||||
|
];
|
||||||
|
|
||||||
|
sourceRoot = ".";
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
unset GOROOT
|
||||||
|
|
||||||
|
export GOPATH="/tmp/gopath-$(echo $RANDOM | md5sum | head -c 20)"
|
||||||
|
export GOCACHE="/tmp/gocache-$(echo $RANDOM | md5sum | head -c 20)"
|
||||||
|
|
||||||
|
export NIX_LDFLAGS="-F${pkgs.darwin.apple_sdk.frameworks.CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_LDFLAGS";
|
||||||
|
|
||||||
|
cd source
|
||||||
|
|
||||||
|
go mod download
|
||||||
|
go build
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
mv pinentry-touchid $out/bin/pinentry-touchid
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Custom GPG pinentry program for macOS that allows using Touch ID for fetching the password from the macOS keychain.";
|
||||||
|
license = licenses.asl20;
|
||||||
|
homepage = "https://github.com/jorgelbg/pinentry-touchid";
|
||||||
|
platforms = platforms.darwin;
|
||||||
|
};
|
||||||
|
}
|
22
packages/qbittorrent-mac.nix
Normal file
22
packages/qbittorrent-mac.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ fetchurl, lib, mkMacBinPackage }:
|
||||||
|
let
|
||||||
|
version = "4.4.5";
|
||||||
|
appName = "qBittorrent";
|
||||||
|
pname = "qbittorrent";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url =
|
||||||
|
"https://phoenixnap.dl.sourceforge.net/project/qbittorrent/qbittorrent-mac/qbittorrent-${version}/qbittorrent-${version}.dmg";
|
||||||
|
sha256 = "sha256-9h+gFAEU0tKrltOjnOKLfylbbBunGZqvPzQogdP9uQM=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
mkMacBinPackage {
|
||||||
|
inherit src pname appName version;
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Featureful free software BitTorrent client";
|
||||||
|
homepage = "https://www.qbittorrent.org/";
|
||||||
|
changelog = "https://github.com/qbittorrent/qBittorrent/blob/release-${version}/Changelog";
|
||||||
|
license = licenses.gpl2Plus;
|
||||||
|
platforms = platforms.darwin;
|
||||||
|
};
|
||||||
|
}
|
23
packages/spotify-mac.nix
Normal file
23
packages/spotify-mac.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ fetchurl, lib, mkMacBinPackage }:
|
||||||
|
let
|
||||||
|
appName = "Spotify";
|
||||||
|
pname = "spotify";
|
||||||
|
version = "sha256-JESQZtyPE9o5PW/f5GdxbqbyeHCxs/oZEW0AakMJgKg=";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://download.scdn.co/Spotify.dmg";
|
||||||
|
hash = version;
|
||||||
|
name = "spotify-mac.dmg";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
mkMacBinPackage {
|
||||||
|
inherit src pname appName version;
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://www.spotify.com/";
|
||||||
|
description = "Play music from the Spotify music service";
|
||||||
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
||||||
|
license = licenses.unfree;
|
||||||
|
platforms = platforms.darwin;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
32
packages/vlc-mac.nix
Normal file
32
packages/vlc-mac.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ fetchurl, lib, mkMacBinPackage, stdenv }:
|
||||||
|
let
|
||||||
|
appName = "VLC";
|
||||||
|
pname = "vlc";
|
||||||
|
version = "3.0.18";
|
||||||
|
srcs = {
|
||||||
|
aarch64-darwin = fetchurl {
|
||||||
|
url =
|
||||||
|
"http://get.videolan.org/vlc/${version}/macosx/vlc-${version}-arm64.dmg";
|
||||||
|
sha256 = "sha256-mcJZvbxSIf1QgX9Ri3Dpv57hdeiQdDkDyYB7x3hmj0c=";
|
||||||
|
name = "${pname}_aarch64_${version}.dmg";
|
||||||
|
};
|
||||||
|
x86_64-darwin = fetchurl {
|
||||||
|
url =
|
||||||
|
"http://get.videolan.org/vlc/${version}/macosx/vlc-${version}-intel64.dmg";
|
||||||
|
sha256 = "sha256-iO3N/Os70vaANn2QCdOKDBR/p1jy3TleQ0EsHgjOHMs=";
|
||||||
|
name = "${pname}_x86_64_${version}.dmg";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
src = srcs.${stdenv.hostPlatform.system};
|
||||||
|
in
|
||||||
|
mkMacBinPackage {
|
||||||
|
inherit src pname appName version;
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Cross-platform media player and streaming server";
|
||||||
|
homepage = "http://www.videolan.org/vlc/";
|
||||||
|
license = licenses.lgpl21Plus;
|
||||||
|
platforms = platforms.darwin;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue