add freecad, other touchups

This commit is contained in:
willemml 2023-02-06 00:13:43 -08:00
parent 125183aa81
commit f26588204b
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD
5 changed files with 50 additions and 7 deletions

View file

@ -14,13 +14,14 @@ rec {
".config/nixpkgs/config.nix".text = ''
# -*-nix-*-
{
packageOverrides = pkgs: {
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
inherit pkgs;
};
};
allowUnfree = true;
packageOverrides = pkgs: {
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
inherit pkgs;
};
};
allowUnfree = true;
}
'';
};
keyboard = {

View file

@ -438,7 +438,6 @@ in {
(setq nix-nixfmt-bin "${pkgs.nixfmt}/bin/nixfmt")
(setq nix-executable "/nix/var/nix/profiles/default/bin/nix")
'';
bindLocal.nix-mode-map = { "C-c C-y" = "nix-mode-format"; };
};
ob-calc = {

View file

@ -4,6 +4,7 @@ let
darwin = with pkgs; [
colima
coreutils
freecad-mac
gnused
iterm2
karabiner-elements

View file

@ -1,6 +1,7 @@
self: super: {
chromium-mac = super.callPackage ./chromium-mac.nix { pkgs = super; };
firefox-mac = super.callPackage ./firefox-mac.nix { pkgs = super; };
freecad-mac = super.callPackage ./freecad-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; };

41
overlays/freecad-mac.nix Normal file
View file

@ -0,0 +1,41 @@
{ pkgs, fetchurl, ... }:
let
version = "31483";
date = "2022-12-31";
appName = "FreeCAD";
pname = "freecad";
src = fetchurl {
url =
"https://github.com/FreeCAD/FreeCAD-Bundle/releases/download/weekly-builds/FreeCAD_weekly-builds-${version}-${date}-conda-macOS-arm-py311.dmg";
sha256 = "sha256-dm6QbAazx1vFrkakkCsfCqyGzRED9guI7yFMQ24mU9o=";
};
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
'';
}