default.nix 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. { inputs, ... }:
  2. rec {
  3. # This one brings our custom packages from the 'pkgs' directory
  4. additions = final: _prev: import ../packages { pkgs = final; };
  5. # This one contains whatever you want to overlay
  6. # You can change versions, add patches, set compilation flags, anything really.
  7. # https://nixos.wiki/wiki/Overlays
  8. modifications = _final: prev: {
  9. # example = prev.example.overrideAttrs (oldAttrs: rec {
  10. # ...
  11. # });
  12. immich = prev.immich.overrideAttrs (oldAttrs:
  13. let
  14. patchedWeb = oldAttrs.passthru.web.overrideAttrs (webOld: {
  15. patches = (webOld.patches or [ ]) ++ [
  16. ./disable-picture-in-picture.patch
  17. ];
  18. });
  19. in
  20. {
  21. patches = (oldAttrs.patches or [ ]) ++ [
  22. ./video-geolocation.patch
  23. ];
  24. passthru = oldAttrs.passthru // {
  25. web = patchedWeb;
  26. };
  27. postInstall = ''
  28. rm -f $out/lib/node_modules/immich/build/www
  29. ln -s '${patchedWeb}' $out/lib/node_modules/immich/build/www
  30. '';
  31. });
  32. makeModulesClosure = x: prev.makeModulesClosure (x // { allowMissing = true; });
  33. tmuxPlugins = prev.tmuxPlugins // {
  34. tmux-select-pane-no-wrap = prev.tmux-select-pane-no-wrap;
  35. };
  36. vimPlugins = prev.vimPlugins // {
  37. opencode-nvim = prev.opencode-nvim;
  38. };
  39. };
  40. # When applied, the unstable nixpkgs set (declared in the flake inputs) will
  41. # be accessible through 'pkgs.unstable'
  42. unstable-packages = final: _prev: {
  43. unstable = import inputs.nixpkgs-unstable {
  44. system = final.system;
  45. overlays = [
  46. additions
  47. modifications
  48. ];
  49. config = {
  50. allowUnfree = true;
  51. allowUnsupportedSystem = true;
  52. };
  53. };
  54. };
  55. }