# The home.packages option allows you to install Nix packages into your# environment. home.packages = [
# # Adds the 'hello' command to your environment. It prints a friendly# # "Hello, world!" when run.# pkgs.hello# # It is sometimes useful to fine-tune packages, for example, by applying# # overrides. You can do that directly here, just don't forget the# # parentheses. Maybe you want to install Nerd Fonts with a limited number of# # fonts?# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })# # You can also create simple shell scripts directly inside your# # configuration. For example, this adds a command 'my-hello' to your# # environment:# (pkgs.writeShellScriptBin "my-hello" ''# echo "Hello, ${config.home.username}!"# '') pkgs.git
pkgs.tmux
pkgs.root
pkgs.yaml-cpp
pkgs.cmake
pkgs.zlib
];
flake.nixの設定
rootやC++などを導入したシェルを立ち上げるための設定をflake.nixに書きます。
こちらに関してはどこに作っても良いです。
私の場合は~/nix/に作成しました。
description ="Example C++ development environment for Zero to Nix";
# Flake inputs inputs = {
nixpkgs.url ="github:NixOS/nixpkgs"; # also valid: "nixpkgs" };
# Flake outputs outputs = { self, nixpkgs }:
let# Systems supported allSystems = [
"x86_64-linux"# 64-bit Intel/AMD Linux ];
# Helper to provide system-specific attributes forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
pkgs =import nixpkgs { inherit system; };
});
in {
# Development environment output devShells = forAllSystems ({ pkgs }: {
default = pkgs.mkShell {
# The Nix packages provided in the environment packages =with pkgs; [
gcc
cmake
root
yaml-cpp
zlib
];
};
});
};
}
git clone https://github.com/FumiHubCNS/artemis.git -b develop
cd artemis
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=~/install ..
make -j16
make install