User avatar
tog Hertog tog @hertog@mastodon.hermitcollective.net
1y
re: Nix qeustion, C++, not screenreader safe My error log is simply this.
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o src/game.o -c src/game.cpp
src/game.cpp:1:10: fatal error: SFML/Graphics.hpp: No such file or directory
    1 | #include <SFML/Graphics.hpp>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
scons: *** [src/game.o] Error 1
scons: building terminated because of errors.


The $NIX_CFLAGS_COMPILE variable shows:
-frandom-seed=lxzf700k52 -isystem /nix/store/6gfnx12avg78svzvpxd8dnhhaaxxzy49-sfml-2.5.1/include -isystem /nix/store/901c80rlps5q05bnjk1sj4zaz5k736nc-python3-3.12.7/include -isystem /nix/store/6gfnx12avg78svzvpxd8dnhhaaxxzy49-sfml-2.5.1/include -isystem /nix/store/901c80rlps5q05bnjk1sj4zaz5k736nc-python3-3.12.7/include


And my flake (now just with packages again is this:
{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
  };

  # Flake outputs
  outputs = { self, nixpkgs, ... }:
    let
      allSystems = [
        "x86_64-linux" # 64-bit Intel/AMD Linux
        "aarch64-linux" # 64-bit ARM Linux
      ];

      forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
        pkgs = import nixpkgs { inherit system; };
      });
    in
    {
      # Development environment output
      devShells = forAllSystems ({ pkgs }: {
          default = pkgs.mkShell {
            packages = with pkgs; [
              skim
              ripgrep
              onefetch

              sfml
              scons
            ];
            
            shellHook = ''
              onefetch
            '';
          };
      });
    };
  }