|
8 | 8 | # that also didn’t work.
|
9 | 9 | environment.systemPackages = [ pkgs.nodejs ];
|
10 | 10 | home-manager.users.jayman = { pkgs, ... }: {
|
11 |
| - home.packages = [ |
| 11 | + # Adapted from |
| 12 | + # <https://nix-community.github.io/home-manager/index.html#_how_do_i_install_packages_from_nixpkgs_unstable>. |
| 13 | + home.packages = let |
| 14 | + url = "https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-unstable.tar.gz"; |
| 15 | + tarball = builtins.fetchTarball url; |
| 16 | + unstablePkgs = import tarball {}; |
| 17 | + # Thanks to strager |
| 18 | + # (<https://stackoverflow.com/users/39992/strager>) |
| 19 | + # for this idea: |
| 20 | + # <https://stackoverflow.com/a/71245733/7593853> |
| 21 | + pyOverrides = finalAttrs: previousAttrs: { |
| 22 | + # The version of python3Packages.cffi in |
| 23 | + # the stable version of nixpkgs doesn’t |
| 24 | + # work with Python 3.11. See |
| 25 | + # <https://foss.heptapod.net/pypy/cffi/-/issues/551>. |
| 26 | + # |
| 27 | + # The only reason we want cffi to work |
| 28 | + # with Python 3.11 it’s an indirect |
| 29 | + # dependency of pre-commit. See below |
| 30 | + # for why we want to run pre-commit with |
| 31 | + # Python 3.11. |
| 32 | + cffi = unstablePkgs.python311Packages.cffi; |
| 33 | + }; |
| 34 | + overlay = finalAttrs: previousAttrs: { |
| 35 | + python311 = previousAttrs.python311.override { |
| 36 | + packageOverrides = pyOverrides; |
| 37 | + }; |
| 38 | + }; |
| 39 | + pkgs = import <nixpkgs> { |
| 40 | + overlays = [ overlay ]; |
| 41 | + }; |
| 42 | + in [ |
12 | 43 | pkgs.cargo # Used for this repo’s pre-commit config
|
13 | 44 | pkgs.gcc # Used for this repo’s pre-commit config
|
14 | 45 | pkgs.go # Used for this repo’s pre-commit config
|
| 46 | + |
| 47 | + # In a future commit, I’m going to add a Python |
| 48 | + # script that requires Python 3.11. We need to |
| 49 | + # make sure that pre-commit uses Python 3.11 so |
| 50 | + # that the mypy hook uses Python 3.11. If we |
| 51 | + # were to run the mypy hook with Python 3.10, |
| 52 | + # then the mypy hook would fail to check that |
| 53 | + # Python 3.11-only script. |
15 | 54 | (pkgs.pre-commit.override {
|
16 |
| - python3Packages = pkgs.python310Packages; |
| 55 | + python3Packages = pkgs.python311Packages; |
17 | 56 | })
|
| 57 | + |
18 | 58 | (import applications/git-bhc.nix)
|
19 | 59 | (import applications/git-tb.nix)
|
20 | 60 | ];
|
|
0 commit comments