From f9ce8ebc7fa8f237a8d4ae7c6f0c3919d1b6559b Mon Sep 17 00:00:00 2001 From: Miles Kent Date: Tue, 17 Sep 2024 23:42:22 -0400 Subject: [PATCH] Pretty sure lab2 part 3 done result symlink is created as expected --- milesK/milesKlab2/{ => p1n2}/README.md | 0 milesK/milesKlab2/{ => p1n2}/default.nix | 0 milesK/milesKlab2/{ => p1n2}/flake.lock | 0 milesK/milesKlab2/{ => p1n2}/flake.nix | 0 milesK/milesKlab2/{ => p1n2}/hellolib.nix | 0 .../{ => p1n2}/hellolib/CMakeLists.txt | 0 .../hellolib/cmake/hellolibConfig.cmake.in | 0 .../{ => p1n2}/hellolib/include/hellolib.hpp | 0 .../{ => p1n2}/hellolib_exe/CMakeLists.txt | 0 .../{ => p1n2}/hellolib_exe/main.cpp | 0 milesK/milesKlab2/p3/CMakeLists.txt | 17 +++++ milesK/milesKlab2/p3/default.nix | 9 +++ milesK/milesKlab2/p3/flake.lock | 62 +++++++++++++++++++ milesK/milesKlab2/p3/flake.nix | 24 +++++++ milesK/milesKlab2/p3/main.cpp | 7 +++ 15 files changed, 119 insertions(+) rename milesK/milesKlab2/{ => p1n2}/README.md (100%) rename milesK/milesKlab2/{ => p1n2}/default.nix (100%) rename milesK/milesKlab2/{ => p1n2}/flake.lock (100%) rename milesK/milesKlab2/{ => p1n2}/flake.nix (100%) rename milesK/milesKlab2/{ => p1n2}/hellolib.nix (100%) rename milesK/milesKlab2/{ => p1n2}/hellolib/CMakeLists.txt (100%) rename milesK/milesKlab2/{ => p1n2}/hellolib/cmake/hellolibConfig.cmake.in (100%) rename milesK/milesKlab2/{ => p1n2}/hellolib/include/hellolib.hpp (100%) rename milesK/milesKlab2/{ => p1n2}/hellolib_exe/CMakeLists.txt (100%) rename milesK/milesKlab2/{ => p1n2}/hellolib_exe/main.cpp (100%) create mode 100644 milesK/milesKlab2/p3/CMakeLists.txt create mode 100644 milesK/milesKlab2/p3/default.nix create mode 100644 milesK/milesKlab2/p3/flake.lock create mode 100644 milesK/milesKlab2/p3/flake.nix create mode 100644 milesK/milesKlab2/p3/main.cpp 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; +}