add meta values to apps, add overlays.nix

This commit is contained in:
willemml 2023-03-17 09:13:17 -07:00
parent 64b1f20745
commit 33eda39c79
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD
16 changed files with 142 additions and 81 deletions

View file

@ -31,6 +31,19 @@
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";
};
}
);

View file

@ -38,6 +38,26 @@
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" ];
}

View file

@ -9,7 +9,14 @@
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" ];
}

50
apps/pinentry-touchid.nix Normal file
View file

@ -0,0 +1,50 @@
{
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" ];
}

View file

@ -11,7 +11,16 @@
sha256 = "sha256-9h+gFAEU0tKrltOjnOKLfylbbBunGZqvPzQogdP9uQM=";
};
in
lib.mk-mac-binpkg { inherit pkgs src pname appName version; };
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" ];
}

View file

@ -11,7 +11,16 @@
name = "spotify-mac.dmg";
};
in
lib.mk-mac-binpkg { inherit pkgs src pname appName version; };
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" ];
}

View file

@ -22,6 +22,12 @@
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" ];

View file

@ -1,7 +1,8 @@
{
imports = [
./apps.nix
./home-manager
./lib
./apps.nix
./overlays.nix
];
}

14
flake-parts/overlays.nix Normal file
View file

@ -0,0 +1,14 @@
{ self, inputs, lib, ... }:
{
flake.overlays = {
default = final: prev: (
let
appsDir = self.lib.importDirToAttrs ../apps;
builtApps = lib.mapAttrs (name: value: value.definition self.lib prev) appsDir;
packages = import ../packages final prev;
in
builtApps // packages
);
};
}

View file

@ -1,11 +0,0 @@
self: super: {
chromium-mac = super.callPackage ./chromium-mac.nix { pkgs = super; };
darwin-zsh-completions = import ./darwin-zsh-completions.nix { pkgs = super; };
firefox-mac = super.callPackage ./firefox-mac.nix { pkgs = super; };
freecad-mac = super.callPackage ./freecad-mac.nix { pkgs = super; };
pinentry-mac = super.callPackage ./pinentry-mac.nix { pkgs = super; };
pinentry-touchid = super.callPackage ./pinentry-touchid.nix { pkgs = super; };
qbittorrent-mac = super.callPackage ./qbittorrent-mac.nix { pkgs = super; };
spotify-mac = super.callPackage ./spotify-mac.nix { pkgs = super; };
vlc-mac = super.callPackage ./vlc-mac.nix { pkgs = super; };
}

View file

@ -1,11 +0,0 @@
self: super: {
tree-sitter-grammars = super.tree-sitter-grammars // {
tree-sitter-python = super.tree-sitter-grammars.tree-sitter-python.overrideAttrs (_: {
nativeBuildInputs = [ super.nodejs super.tree-sitter ];
configurePhase = ''
tree-sitter generate --abi 13 src/grammar.json
'';
});
};
org-auctex = super.callPackage ./org-auctex.nix { pkgs = super; };
}

View file

@ -1,41 +0,0 @@
{ pkgs ? import <nixpkgs> {} }:
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
'';
}

View file

@ -1,8 +1,8 @@
# taken from nix-darwin repo
# https://github.com/LnL7/nix-darwin/blob/87b9d090ad39b25b2400029c64825fc2a8868943/modules/examples/lnl.nix
{ pkgs ? import <nixpkgs> {} }:
{ runCommand }:
pkgs.runCommand "darwin-zsh-completions-0.0.0"
runCommand "darwin-zsh-completions-0.0.0"
{ preferLocalBuild = true; }
''
mkdir -p $out/share/zsh/site-functions

4
packages/default.nix Normal file
View file

@ -0,0 +1,4 @@
_final: prev: {
org-auctex = prev.callPackage ./org-auctex.nix {};
darwin-zsh-completions = prev.callPackage ./darwin-zsh-completions.nix {};
}

View file

@ -1,10 +1,10 @@
{ pkgs }:
{ fetchFromGitHub, emacsPackages }:
pkgs.emacsPackages.trivialBuild {
emacsPackages.trivialBuild {
pname = "org-auctex";
version = "e1271557b9f36ca94cabcbac816748e7d0dc989c";
src = pkgs.fetchFromGitHub {
src = fetchFromGitHub {
owner = "karthink";
repo = "org-auctex";
rev = "e1271557b9f36ca94cabcbac816748e7d0dc989c";

View file

@ -1,9 +0,0 @@
{ withSystem, ... }:
{
flake = {
packages.aarch64-darwin.test = (withSystem "aarch64-darwin" ({ pkgs, ... }: pkgs.writeScriptBin "runme" ''
echo "I am currently being run!"
''));
};
}