flake.nix 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {
  2. inputs = { nixpkgs.url = "github:nixos/nixpkgs"; };
  3. outputs = { self, nixpkgs }:
  4. let
  5. supportedSystems =
  6. let
  7. unsupportedSystems = [
  8. # GHC not supported
  9. "armv5tel-linux"
  10. "armv6l-linux"
  11. "powerpc64le-linux"
  12. "riscv64-linux"
  13. # "error: attribute 'busybox' missing" when building
  14. # `bootstrap-tools`
  15. "mipsel-linux"
  16. ];
  17. in nixpkgs.lib.subtractLists unsupportedSystems nixpkgs.lib.systems.flakeExposed;
  18. perSystem = nixpkgs.lib.genAttrs supportedSystems;
  19. pkgsFor = system: import nixpkgs { inherit system; };
  20. buildResumeFor = system:
  21. let pkgs = pkgsFor system;
  22. in pkgs.runCommand "build-resume" {
  23. nativeBuildInputs = with pkgs; [ pandoc texlive.combined.scheme-context ];
  24. } ''
  25. cd ${self}
  26. make OUT_DIR="$out"
  27. '';
  28. in {
  29. packages = perSystem (system:
  30. let
  31. resume = buildResumeFor system;
  32. in
  33. {
  34. inherit resume;
  35. default = resume;
  36. });
  37. devShells = perSystem (system: {
  38. default = import ./shell.nix { pkgs = pkgsFor system; };
  39. });
  40. devShell = perSystem (system: self.devShells.${system}.default);
  41. defaultPackage = perSystem (system: self.packages.${system}.default);
  42. };
  43. }