https://github.com/nulladmin1/conversion
https://github.com/nulladmin1/conversion
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nulladmin1/conversion
- Owner: nulladmin1
- Created: 2024-10-24T00:36:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-24T01:03:30.000Z (over 1 year ago)
- Last Synced: 2024-10-24T16:07:03.702Z (over 1 year ago)
- Language: Nix
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nix Flake Template for C++ using
*All of this information is also included in the [README.md](https://github.com/nulladmin1/nix-flake-templates/blob/main/flake.nix)*
Initialize using
```shell
nix flake init --template "github:nulladmin1/nix-flake-templates#cpp"
```
This is how the structure of the template looks like:
```
📦 cpp
├─ 🔒 Cargo.lock
├─ ⚙️ CMakeLists.txt
├─ 🔒 flake.lock
├─ ⚙️ flake.nix
├─ 📁 src
│ ├─ 📝 hello.cpp
│ ├─ ⚙️ CMakeLists.txt
├─ 🔨 Makefile
├─ 📃 README.md
```
It includes a really simple Hello World program
#### Run using Nix
```shell
nix run
```
#### Go into Development Shell
```shell
nix develop
```
#### (Optional) Format [`flake.nix`](flake.nix) using ```Alejandra```
```shell
nix fmt
```
#### To customize it to your own needs
* In [`flake.nix`](flake.nix)
* Edit description
```nix
{
description = "Nix Flake Template for Python using Poetry";
# ...
}
```
* Change the name of the binary
```nix
{
# ...
program = "${self.packages.${system}.default}/bin/hello";
# ...
}
```
* For the structure and code
* Add necessary code into the [`src/`](src) directory and configure CMake accordingly