1
0
Fork 0

nix-darwin: Fix Ventura fontrestore

This commit is contained in:
Daniel Kempkens 2022-10-26 09:55:10 +02:00
parent 5bcc409a37
commit b616d0a362
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
4 changed files with 90 additions and 25 deletions

View file

@ -27,11 +27,11 @@
]
},
"locked": {
"lastModified": 1666519227,
"narHash": "sha256-z74lSCJE5BzxCeE2r9FU4tvHkQXQyz70zmJ3coLP10w=",
"lastModified": 1666614183,
"narHash": "sha256-R5+bCtUquwSfQmRBbCYc6FT6xtCaAebh0KE187e8458=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "8be7f197120739b3ec15f994bdc48116726c6159",
"rev": "0f90e1c34caedd0bf765ebe47b92dd1ceffafcc8",
"type": "github"
},
"original": {
@ -79,11 +79,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1666558342,
"narHash": "sha256-qiH0Zgig28yaSyebehrrYiX1y53Y/xFcQW+EFMRSVI0=",
"lastModified": 1666649150,
"narHash": "sha256-kINnLxC0KFalUk4tVO/H5hUU7FVAOYYcUSWrsBpnl+I=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "186d9399f9eb64fb06ea4385732c1cf1624ae2b6",
"rev": "7dc4e4ebd71280842b4d30975439980baaac9db8",
"type": "github"
},
"original": {
@ -145,11 +145,11 @@
]
},
"locked": {
"lastModified": 1666514021,
"narHash": "sha256-SkcQn1pxfa3/L9GFnnF3OdgMI4ZNhuUYtOnPV2AxErw=",
"lastModified": 1666601049,
"narHash": "sha256-/uf+Ma6R3j1Ghsp+jP83fz3NQXnK9bszaZrRyuK9NOo=",
"owner": "nifoc",
"repo": "nix-overlay",
"rev": "b9b6fe4d169d0b67dc243ce412712b34955a2de0",
"rev": "7ce298ad6dd4f5194adaffc5125d54a629883b42",
"type": "github"
},
"original": {
@ -160,11 +160,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1666570118,
"narHash": "sha256-MTXmIYowHM1wyIYyqPdBLia5SjGnxETv0YkIbDsbkx4=",
"lastModified": 1666659249,
"narHash": "sha256-Qbyj7ya2ZTL5Vt5ONMUwgq/shNSqZVbxDInQbmDO5iw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "1e684b371cf05300bc2b432f958f285855bac8fb",
"rev": "d4f8e53720b554b6dac71c7ec62b3b51158905f9",
"type": "github"
},
"original": {

View file

@ -113,12 +113,12 @@ rec {
};
nvim-treesitter = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-treesitter";
version = "2022-10-24";
version = "2022-10-25";
src = pkgs.fetchFromGitHub {
owner = "nvim-treesitter";
repo = "nvim-treesitter";
rev = "682fa459173208997092adf872baa66a7f04692d";
sha256 = "0bnl2ba3qxk9vrp2l3ln5pbk3viggdsk8ds335xngvz2cs7fyfz5";
rev = "0eff7beaf8cf7e631a7e8edc0d363e0b0a8f6f1d";
sha256 = "0n6cljmljhzdbw8pfkppnkaxzim80d956py34gcm7rapm1h0zj4i";
fetchSubmodules = false;
};
passthru.withPlugins =
@ -230,12 +230,12 @@ rec {
};
nvim-lspconfig = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-lspconfig";
version = "2022-10-24";
version = "2022-10-25";
src = pkgs.fetchFromGitHub {
owner = "neovim";
repo = "nvim-lspconfig";
rev = "d8d48b7a8ce12605378fba6391348b99e8a7a4c1";
sha256 = "09hxcx6k9sfr2ckqyg888krvv7jqfi699xr7w84p6bii8j84bapq";
rev = "a035031fd6f6bcb5b433fe0f32d755ba7485406d";
sha256 = "1g7gwbwjdwk6x4crkc66331fmi27lbns49hvjmvyvn9b4rq0c1fn";
fetchSubmodules = false;
};
};
@ -417,12 +417,12 @@ rec {
};
cmp-nvim-lsp-document-symbol = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "cmp-nvim-lsp-document-symbol";
version = "2022-03-22";
version = "2022-10-24";
src = pkgs.fetchFromGitHub {
owner = "hrsh7th";
repo = "cmp-nvim-lsp-document-symbol";
rev = "c3f0086ed9882e52e0ae38dd5afa915f69054941";
sha256 = "1jprb86z081kpxyb2dhw3n1pq15dzcc9wlwmpb6k43mqd7k8q11l";
rev = "069a207be6a0327dcc62c957dbb38156b210733a";
sha256 = "1gpw9zmx60y6zrxb7ncgmak7sgzg8j5fhd4hqx2qkkrq6qkh07d3";
fetchSubmodules = false;
};
};
@ -498,8 +498,8 @@ rec {
src = pkgs.fetchFromGitHub {
owner = "rebelot";
repo = "heirline.nvim";
rev = "60cb8e596708278db1c6e98fa48291db2aa2ebd1";
sha256 = "03xlkf8j78vl8kf5csnpir0a7vyg4gybf5mihpx7xpp2kz7lb6qk";
rev = "f46554a0a4ea096867deb6ef8877cccbf5b7261b";
sha256 = "0v78limimn5ycybcibm4fkna4ad7aqnvczvcmc9igak7d5y4wsxr";
fetchSubmodules = false;
};
};

View file

@ -0,0 +1,51 @@
From f34b284d3f2b6cdeb08f247c16d5b7a69cb45061 Mon Sep 17 00:00:00 2001
From: Pavel Shirshov <pshirshov@eml.cc>
Date: Tue, 25 Oct 2022 22:01:55 +0100
Subject: [PATCH] fixes #559, #485: workaround for broken fontrestore on
Ventura
---
modules/fonts/default.nix | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/modules/fonts/default.nix b/modules/fonts/default.nix
index 14f9529f..44ea58bb 100644
--- a/modules/fonts/default.nix
+++ b/modules/fonts/default.nix
@@ -58,20 +58,22 @@ in
fi
done
- fontrestore default -n 2>&1 | while read -r f; do
- case $f in
- /Library/Fonts/*)
- font=''${f##*/}
- if [ ! -e "$systemConfig/Library/Fonts/$font" ]; then
- echo "removing font $font..." >&2
- rm "/Library/Fonts/$font"
- fi
- ;;
- /*)
- # ignoring unexpected fonts
- ;;
- esac
- done
+ if [[ "`sw_vers -productVersion`" < "13.0" ]]; then
+ fontrestore default -n 2>&1 | while read -r f; do
+ case $f in
+ /Library/Fonts/*)
+ font=''${f##*/}
+ if [ ! -e "$systemConfig/Library/Fonts/$font" ]; then
+ echo "removing font $font..." >&2
+ rm "/Library/Fonts/$font"
+ fi
+ ;;
+ /*)
+ # ignoring unexpected fonts
+ ;;
+ esac
+ done
+ fi
'';
};

View file

@ -1,6 +1,20 @@
{ nixpkgs, home-manager, darwin, inputs, ... }:
let
default-system = "aarch64-darwin";
patched-darwin =
let
src = nixpkgs.legacyPackages.${default-system}.applyPatches {
name = "nix-darwin";
src = darwin;
patches = [
../../patches/darwin/ventura-fontrestore.patch
];
};
in
nixpkgs.lib.fix (self: (import "${src}/flake.nix").outputs { inherit self nixpkgs; });
overlay-x86 = _: _: { pkgs-x86 = import nixpkgs { system = "x86_64-darwin"; }; };
overlay-neovim = inputs.neovim-nightly-overlay.overlay;
overlay-nifoc = inputs.nifoc-overlay.overlay;
@ -19,8 +33,8 @@ let
};
in
{
system = darwin.lib.darwinSystem {
system = "aarch64-darwin";
system = patched-darwin.lib.darwinSystem {
system = default-system;
modules = [
../hosts/Styx.nix