Skip to content

Commit b74e3c3

Browse files
committed
feat: update .gitignore and add Nix flake support
- Simplified .gitignore by removing unnecessary macOS and C++ rules - Added rules for build results and direnv files - Deleted Taskfile.yml as it's no longer needed - Introduced flake.nix and flake.lock for managing development environment using Nix flakes
1 parent 62cbfaa commit b74e3c3

File tree

4 files changed

+124
-124
lines changed

4 files changed

+124
-124
lines changed

.gitignore

+7-57
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,13 @@
1-
### https://raw.github.com/github/gitignore/b0012e4930d0a8c350254a3caeedf7441ea286a3/Global/macOS.gitignore
2-
build*
3-
cmake_build
4-
.build
5-
_build
1+
# Build folder
2+
result
3+
build
64

75
# General
86
.DS_Store
9-
.AppleDouble
10-
.LSOverride
117

12-
# Icon must end with two \r
13-
Icon
14-
15-
16-
# Thumbnails
17-
._*
8+
# Direnv
9+
.envrc
10+
.direnv
1811

19-
# Files that might appear in the root of a volume
20-
.DocumentRevisions-V100
21-
.fseventsd
22-
.Spotlight-V100
23-
.TemporaryItems
24-
.Trashes
25-
.VolumeIcon.icns
26-
.com.apple.timemachine.donotpresent
12+
# Task file
2713
.task
28-
29-
### https://raw.github.com/github/gitignore/b0012e4930d0a8c350254a3caeedf7441ea286a3/C++.gitignore
30-
31-
# Prerequisites
32-
*.d
33-
34-
# Compiled Object files
35-
*.slo
36-
*.lo
37-
*.o
38-
*.obj
39-
40-
# Precompiled Headers
41-
*.gch
42-
*.pch
43-
44-
# Compiled Dynamic libraries
45-
*.so
46-
*.dylib
47-
*.dll
48-
49-
# Fortran module files
50-
*.mod
51-
*.smod
52-
53-
# Compiled Static libraries
54-
*.lai
55-
*.la
56-
*.a
57-
*.lib
58-
59-
# Executables
60-
*.exe
61-
*.out
62-
*.app
63-
.envrc

Taskfile.yml

-67
This file was deleted.

flake.lock

+61
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
description = "Flake shell";
3+
# inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4+
inputs.nixpkgs.url = "github:gen740/nixpkgs/cxx-import-std";
5+
inputs.flake-utils.url = "github:numtide/flake-utils";
6+
7+
outputs =
8+
{ nixpkgs, flake-utils, ... }:
9+
flake-utils.lib.eachDefaultSystem (
10+
system: with nixpkgs.legacyPackages.${system}; {
11+
devShells.default = mkShellNoCC {
12+
packages = [
13+
llvmPackages_19.clang-tools
14+
(llvmPackages_19.libcxxClang.overrideAttrs (oldAttrs: {
15+
postFixup =
16+
oldAttrs.postFixup
17+
+ ''
18+
ln -sf ${oldAttrs.passthru.libcxx}/lib/libc++.modules.json $out/resource-root/libc++.modules.json
19+
ln -sf ${oldAttrs.passthru.libcxx}/share $out
20+
'';
21+
}))
22+
(cmake.overrideAttrs (oldAttrs: {
23+
version = "3.30.2";
24+
src = oldAttrs.src.overrideAttrs { outputHash = null; };
25+
}))
26+
ninja
27+
];
28+
};
29+
30+
defaultPackage = stdenv.mkDerivation {
31+
name = "import_std_example";
32+
src = ./.;
33+
nativeBuildInputs = [
34+
llvmPackages_19.clang-tools
35+
(llvmPackages_19.libcxxClang.overrideAttrs (oldAttrs: {
36+
postFixup =
37+
oldAttrs.postFixup
38+
+ ''
39+
ln -sf ${oldAttrs.passthru.libcxx}/lib/libc++.modules.json $out/resource-root/libc++.modules.json
40+
ln -sf ${oldAttrs.passthru.libcxx}/share $out
41+
'';
42+
}))
43+
(cmake.overrideAttrs (oldAttrs: {
44+
version = "3.30.2";
45+
src = oldAttrs.src.overrideAttrs { outputHash = null; };
46+
}))
47+
ninja
48+
];
49+
installPhase = ''
50+
mkdir -p $out/bin
51+
cp main $out/bin
52+
'';
53+
};
54+
}
55+
);
56+
}

0 commit comments

Comments
 (0)