diff --git a/milesK/milesKlab2/README.md b/milesK/milesKlab2/p1n2/README.md similarity index 100% rename from milesK/milesKlab2/README.md rename to milesK/milesKlab2/p1n2/README.md diff --git a/milesK/milesKlab2/default.nix b/milesK/milesKlab2/p1n2/default.nix similarity index 100% rename from milesK/milesKlab2/default.nix rename to milesK/milesKlab2/p1n2/default.nix diff --git a/milesK/milesKlab2/flake.lock b/milesK/milesKlab2/p1n2/flake.lock similarity index 100% rename from milesK/milesKlab2/flake.lock rename to milesK/milesKlab2/p1n2/flake.lock diff --git a/milesK/milesKlab2/flake.nix b/milesK/milesKlab2/p1n2/flake.nix similarity index 100% rename from milesK/milesKlab2/flake.nix rename to milesK/milesKlab2/p1n2/flake.nix diff --git a/milesK/milesKlab2/hellolib.nix b/milesK/milesKlab2/p1n2/hellolib.nix similarity index 100% rename from milesK/milesKlab2/hellolib.nix rename to milesK/milesKlab2/p1n2/hellolib.nix diff --git a/milesK/milesKlab2/hellolib/CMakeLists.txt b/milesK/milesKlab2/p1n2/hellolib/CMakeLists.txt similarity index 100% rename from milesK/milesKlab2/hellolib/CMakeLists.txt rename to milesK/milesKlab2/p1n2/hellolib/CMakeLists.txt diff --git a/milesK/milesKlab2/hellolib/cmake/hellolibConfig.cmake.in b/milesK/milesKlab2/p1n2/hellolib/cmake/hellolibConfig.cmake.in similarity index 100% rename from milesK/milesKlab2/hellolib/cmake/hellolibConfig.cmake.in rename to milesK/milesKlab2/p1n2/hellolib/cmake/hellolibConfig.cmake.in diff --git a/milesK/milesKlab2/hellolib/include/hellolib.hpp b/milesK/milesKlab2/p1n2/hellolib/include/hellolib.hpp similarity index 100% rename from milesK/milesKlab2/hellolib/include/hellolib.hpp rename to milesK/milesKlab2/p1n2/hellolib/include/hellolib.hpp diff --git a/milesK/milesKlab2/hellolib_exe/CMakeLists.txt b/milesK/milesKlab2/p1n2/hellolib_exe/CMakeLists.txt similarity index 100% rename from milesK/milesKlab2/hellolib_exe/CMakeLists.txt rename to milesK/milesKlab2/p1n2/hellolib_exe/CMakeLists.txt diff --git a/milesK/milesKlab2/hellolib_exe/main.cpp b/milesK/milesKlab2/p1n2/hellolib_exe/main.cpp similarity index 100% rename from milesK/milesKlab2/hellolib_exe/main.cpp rename to milesK/milesKlab2/p1n2/hellolib_exe/main.cpp diff --git a/milesK/milesKlab2/p3/CMakeLists.txt b/milesK/milesKlab2/p3/CMakeLists.txt new file mode 100644 index 0000000..75961e3 --- /dev/null +++ b/milesK/milesKlab2/p3/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.15...3.30) +project(hellolib_exe VERSION 0.1.0 LANGUAGES CXX) + +# Find the hellolib library +find_package(hellolib REQUIRED) + +# Create the executable +add_executable(hellolib_exe main.cpp) + +# Link hellolib to the executable +target_link_libraries(hellolib_exe PRIVATE hellolib) + +# Installation rules for the executable +install(TARGETS hellolib_exe + RUNTIME DESTINATION bin +) + diff --git a/milesK/milesKlab2/p3/default.nix b/milesK/milesKlab2/p3/default.nix new file mode 100644 index 0000000..f4a4b66 --- /dev/null +++ b/milesK/milesKlab2/p3/default.nix @@ -0,0 +1,9 @@ +{ stdenv, cmake, hellolib }: + +stdenv.mkDerivation rec { + pname = "hellolib_exe"; + version = "0.1.0"; + src = ./.; + nativeBuildInputs = [ cmake ]; + buildInputs = [ hellolib ]; +} diff --git a/milesK/milesKlab2/p3/flake.lock b/milesK/milesKlab2/p3/flake.lock new file mode 100644 index 0000000..8bf2d2e --- /dev/null +++ b/milesK/milesKlab2/p3/flake.lock @@ -0,0 +1,62 @@ +{ + "nodes": { + "hellolib": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1726630447, + "narHash": "sha256-1jrxhRzHBiovxC5t5Zv22j6rhdGGng9XgPtqoi4vxr4=", + "owner": "mileskent", + "repo": "hellolib", + "rev": "5b711b1213b3efb77f31b2b68c933c49558af66d", + "type": "github" + }, + "original": { + "owner": "mileskent", + "repo": "hellolib", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1704290814, + "narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1704290814, + "narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "hellolib": "hellolib", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/milesK/milesKlab2/p3/flake.nix b/milesK/milesKlab2/p3/flake.nix new file mode 100644 index 0000000..2f77d8c --- /dev/null +++ b/milesK/milesKlab2/p3/flake.nix @@ -0,0 +1,24 @@ +{ + description = "Hello"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; + hellolib.url = "github:mileskent/hellolib"; + }; + outputs = {self, nixpkgs, hellolib}: + let + pkgs = import nixpkgs { + system = "x86_64-linux"; + overlays = [ self.overlays.default hellolib.overlays.default ]; + }; + + hellolib_overlay = final: prev: { + hellolib = final.callPackage ./default.nix { }; + }; + my_overlays = [ hellolib_overlay ]; + in + + { + packages.x86_64-linux.default = pkgs.hellolib; + overlays.default = nixpkgs.lib.composeManyExtensions my_overlays; + }; +} diff --git a/milesK/milesKlab2/p3/main.cpp b/milesK/milesKlab2/p3/main.cpp new file mode 100644 index 0000000..98127b5 --- /dev/null +++ b/milesK/milesKlab2/p3/main.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main (void) { + std::cout << hello() << std::endl; + return 0; +}