summaryrefslogtreecommitdiff
path: root/nix/flake.nix
blob: 9e309a8c51a6e547badb9fa278045fd481e40827 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
  outputs = { self, nixpkgs }: let
    system = "x86_64-linux";
    pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
  in {
    devShells."${system}".default = pkgs.mkShell {
      buildInputs = with pkgs; [
        SDL2
      ];

      nativeBuildInputs = with pkgs; [
        binutils
        gcc
        gcc-arm-embedded
        gdb
        gnumake
        gtkwave
        pkg-config
        (python39.withPackages (py: [ py.numpy py.pillow ]))
        (quartus-prime-lite.override { supportedDevices = [ "Cyclone V" ]; })
        verilator
      ];

      shellHook = ''
        export MAKEFLAGS="AR=gcc-ar"
        export CXXFLAGS="-O3 -flto $(pkg-config --cflags sdl2)"
        export LDFLAGS="-O3 -flto $(pkg-config --libs sdl2)"
      '';
    };
  };
}