chore(nix): Migrate inkscape from homebrew to nix

Also add overlay to ignore pytest for some python packages, because
python is pain
This commit is contained in:
Ahmad Ansori Palembani 2024-07-16 16:29:32 +07:00
parent 6088674857
commit a0dd718b4e
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
2 changed files with 30 additions and 6 deletions

View file

@ -7,7 +7,17 @@
# NOTE: List packages installed in system profile. To search by name, run: # NOTE: List packages installed in system profile. To search by name, run:
# `nix-env -qaP | grep wget` # `nix-env -qaP | grep wget`
environment.systemPackages = [ environment.systemPackages =
let
dontCheckPython = drv: drv.overridePythonAttrs (old: {
});
python = (pkgs.python312Full.withPackages (py: [
py.pip
py.tkinter
py.dnspython
]));
in
[
pkgs.zsh pkgs.zsh
pkgs.git pkgs.git
pkgs.vim pkgs.vim
@ -16,11 +26,8 @@
pkgs.passExtensions.pass-otp pkgs.passExtensions.pass-otp
pkgs.gnupg pkgs.gnupg
pkgs.htop-vim pkgs.htop-vim
(pkgs.python312Full.withPackages (py: [ python
py.pip (pkgs.inkscape.override { python3 = python; })
py.tkinter
]))
# FIXME: Build failed, dnspython pytest keep returning FAILED caused by timeout. Maybe find a way to bypass check for them
# (pkgs.poetry.override { python3 = python; }) # (pkgs.poetry.override { python3 = python; })
pkgs.fastfetch pkgs.fastfetch
pkgs.eza pkgs.eza

View file

@ -1,10 +1,27 @@
{ inputs, nixpkgs, nix-darwin, home-manager, vars, ... }: { inputs, nixpkgs, nix-darwin, home-manager, vars, ... }:
let let
disablePyChecks = pkg: pkg.overridePythonAttrs (old: {
doCheck = false;
doInstallCheck = false;
dontCheck = true;
});
systemConfig = system: { systemConfig = system: {
system = system; system = system;
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [(final: prev: {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [(pyfinal: pyprev: {
dnspython = (disablePyChecks pyprev.dnspython).overridePythonAttrs (old: {
disabledTests = [
# This test is unreliable when my internet is throttled by Indonesian ISP, timeout everywhere... lovely...
"test_resolver"
] ++ old.disabledTests;
});
pillow = disablePyChecks pyprev.pillow;
cherrypy = disablePyChecks pyprev.cherrypy;
})];
})];
config.allowUnfree = true; config.allowUnfree = true;
}; };
}; };