-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflake.nix
64 lines (54 loc) · 1.77 KB
/
flake.nix
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
description = "A template for Nix based C++ project setup.";
inputs = {
# Pointing to the current stable release of nixpkgs. You can
# customize this to point to an older version or unstable if you
# like everything shining.
#
# E.g.
#
# nixpkgs.url = "github:NixOS/nixpkgs/unstable";
nixpkgs.url = "github:NixOS/nixpkgs/22.11";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, ... }@inputs: inputs.utils.lib.eachSystem [
# Add the system/architecture you would like to support here. Note that not
# all packages in the official nixpkgs support all platforms.
"x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin"
] (system: let
pkgs = import nixpkgs {
inherit system;
# Add overlays here if you need to override the nixpkgs
# official packages.
overlays = [];
# Uncomment this if you need unfree software (e.g. cuda) for
# your project.
#
# config.allowUnfree = true;
};
in {
devShells.default = pkgs.mkShell rec {
# Update the name to something that suites your project.
name = "my-c++-project";
packages = with pkgs; [
# Development Tools
llvmPackages_14.clang
cmake
cmakeCurses
# Development time dependencies
gtest
# Build time and Run time dependencies
spdlog
abseil-cpp
];
# Setting up the environment variables you need during
# development.
shellHook = let
icon = "f121";
in ''
export PS1="$(echo -e '\u${icon}') {\[$(tput sgr0)\]\[\033[38;5;228m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]} (${name}) \\$ \[$(tput sgr0)\]"
'';
};
packages.default = pkgs.callPackage ./default.nix {};
});
}