Skip to content
Snippets Groups Projects
Commit b51aeba8 authored by Evy Storozhenko's avatar Evy Storozhenko
Browse files

added initial cpp version

parent 8b6c3a58
No related branches found
No related tags found
No related merge requests found
use flake
cmake_minimum_required(VERSION 3.0)
set(CMAKE_CXX_STANDARD 20)
project(day01 LANGUAGES CXX VERSION 1.0.0)
add_executable(main
${PROJECT_SOURCE_DIR}/main.cpp
)
\ No newline at end of file
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1701268161,
"narHash": "sha256-hL4jGGwMHHmyx6G9wi6IrYa8RLkoEtzCb4zWITH1B40=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "67be70a859530f6f7c358568eaa6ab0d84b36b01",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
{
description = "AoC 2023 - day 01 cpp";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils, ... }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
buildInputs = with pkgs; [
ninja
cmake
];
in
{
defaultPackage = pkgs.stdenv.mkDerivation {
name = "main";
inherit buildInputs;
src = ./.;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp ./main $out/bin/
runHook postInstall
'';
};
devShell = with pkgs; mkShell {
buildInputs = buildInputs ++ [ clang-tools lldb ];
};
}
);
}
int main() {}
/nix/store/jq765ilimf52jh2jbllj7l67b1cq00gv-main
\ No newline at end of file
......@@ -10,12 +10,30 @@
},
"locked": {
"lastModified": 1,
"narHash": "sha256-Skcd0y3BZ27ycrNGxmHcMyGRPat8mYU0IXM1Lc/174I=",
"path": "/nix/store/lylqmpv4yipaapna82jpnmsxd7r4m82q-source/day01",
"narHash": "sha256-tY3L0BwQAOShopkV4HZ+v9zwM16Yj+joLr+5xi6Bwx8=",
"path": "/nix/store/wl49h89zff154wpqbagplgk7sw1z74ds-source/day01",
"type": "path"
},
"original": {
"path": "/nix/store/lylqmpv4yipaapna82jpnmsxd7r4m82q-source/day01",
"path": "/nix/store/wl49h89zff154wpqbagplgk7sw1z74ds-source/day01",
"type": "path"
}
},
"day01cpp": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils_2"
},
"locked": {
"lastModified": 1,
"narHash": "sha256-gwH89EDWFx3eparAlrWPU/9GnsltYgNk0Kia2ZwycgI=",
"path": "/nix/store/wl49h89zff154wpqbagplgk7sw1z74ds-source/day01cpp",
"type": "path"
},
"original": {
"path": "/nix/store/wl49h89zff154wpqbagplgk7sw1z74ds-source/day01cpp",
"type": "path"
}
},
......@@ -81,9 +99,10 @@
"root": {
"inputs": {
"day01": "day01",
"day01cpp": "day01cpp",
"naersk": "naersk_2",
"nixpkgs": "nixpkgs",
"utils": "utils_2"
"utils": "utils_3"
}
},
"systems": {
......@@ -116,6 +135,21 @@
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
......@@ -151,6 +185,24 @@
"repo": "flake-utils",
"type": "github"
}
},
"utils_3": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
......
......@@ -7,6 +7,10 @@
url = "./day01";
inputs.nixpkgs.follows = "nixpkgs";
};
day01cpp = {
url = "./day01cpp";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk = {
url = "github:nix-community/naersk/master";
inputs.nixpkgs.follows = "nixpkgs";
......@@ -14,12 +18,16 @@
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils, naersk, day01 }:
outputs = { self, nixpkgs, utils, naersk, day01, day01cpp }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
packages.day01 = day01.defaultPackage.${system};
});
packages = {
day01 = day01.defaultPackage.${system};
day01cpp = day01cpp.defaultPackage.${system};
};
}
);
}
/nix/store/bmsr9z02zcchqqij4ai42b327qg32zyv-aoc-0.1.0
\ No newline at end of file
/nix/store/hl50b172fpp2v07pc9l1pwa1yab2hqvp-main
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment