Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ compile_commands.json
.cache/
dbc_extract3/cache/live/DBCache.bin
dbc_extract3/cache/ptr/DBCache.bin
.direnv
.envrc
result
.pre-commit-config.yaml

apikey.txt

Expand Down
142 changes: 142 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

96 changes: 96 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
description = "simulationcraft";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs =
{
flake-utils,
treefmt-nix,
nixpkgs,
git-hooks,
self,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
treefmt = treefmt-nix.lib.evalModule pkgs (_: {
projectRootFile = "flake.nix";
programs = {
actionlint.enable = true;
dockerfmt.enable = true;
nixfmt.enable = true;
};
});

githooksEval = git-hooks.lib.${system}.run {
src = self;
hooks.treefmt = {
enable = true;
package = treefmt.config.build.wrapper;
};
};

llvm = pkgs.llvmPackages_latest;
packages = with pkgs; [
clang-tools
llvm.clang
llvm.lldb
qt6.qtbase
qt6.qtwebengine
];

nbi = with pkgs; [
pkg-config
curlFull
cmake
qt6.wrapQtAppsHook
];

qtCmakePath = pkgs.symlinkJoin {
name = "qt6-cmake";
paths = with pkgs.qt6; [
qtbase
qtwebengine
];
};

rev = self.rev or "dirty";
in
{
formatter = treefmt.config.build.wrapper;
devShells.default = pkgs.mkShell {
nativeBuildInputs = nbi;
packages = packages;
shellHook = ''
${githooksEval.shellHook}
'';
};

packages.simc = llvm.stdenv.mkDerivation {
pname = "simc";
version = "1201.01.${rev}";
src = self;
nativeBuildInputs = nbi;
buildInputs = packages;
sconsFlags = "";
enableParallelBuilding = true;
cmakeFlags = [ "-DCMAKE_PREFIX_PATH=${qtCmakePath}/lib/cmake" ];
};
packages.default = self.packages.${system}.simc;
}
);
}
Loading