From 9d4deda1c48dc9de1ca5720a94f44a1d0223def2 Mon Sep 17 00:00:00 2001 From: Adam JOLY Date: Wed, 20 Nov 2024 21:25:52 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=E3=80=8C=F0=9F=8F=97=EF=B8=8F=E3=80=8D=20w?= =?UTF-8?q?ip(Flake):=20Started=20doing=20a=20package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 33 +++++++++++++++++++++++++++++++++ result | 1 + 3 files changed, 61 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 120000 result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..040b119 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1731755305, + "narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5a12cd0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "Fastclass flake"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + }; + + outputs = { self, nixpkgs, ... }: + let + supportedSystems = [ "x86_64-linux" ]; + forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f { + pkgs = import nixpkgs { inherit system; }; + }); + in + { + packages = forAllSystems ({ pkgs }: rec { + default = fastclass; + fastclass = pkgs.stdenv.mkDerivation { + name = "fastclass"; + src = self; + buildInputs = with pkgs; [ + clang + ]; + buildPhase = '' + make + ''; + installPhase = '' + mkdir -p $out/bin + cp class $out/bin + ''; + }; + }); + }; +} diff --git a/result b/result new file mode 120000 index 0000000..35a1c74 --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/kdf17rkmzzarakbddqvswk70pll7y4jk-fastclass \ No newline at end of file From a6ab7a886801f056fdf846c5f34092a769e14025 Mon Sep 17 00:00:00 2001 From: Adam JOLY Date: Wed, 20 Nov 2024 21:32:05 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=E3=80=8C=F0=9F=93=9D=E3=80=8D=20doc(README?= =?UTF-8?q?):=20Added=20readme=20instruction=20for=20nix=20flake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 7b3620f..ff9684c 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ A C program destined to make C++ classes faster following the orthodox canonical ## How to install +### Standalone First clone the repository: ```bash git clone https://github.com/Namonay/fastclass.git @@ -25,6 +26,16 @@ If you want to install to a custom path, you can input it as a make parameter: # This is the default path make install INSTALL_PATH="$HOME/.local/bin" ``` +### Nix way + +Add the input into the your flake +```nix +fastclass.url = "github:seekrs/fastclass"; +``` +And add the package into +```nix +inputs.fastclass.packages.${pkgs.system}.fastclass +``` ## How to use From 6b3e9f0406c37a2e6679509db0771a209d5b8872 Mon Sep 17 00:00:00 2001 From: Adam JOLY Date: Wed, 20 Nov 2024 21:33:22 +0100 Subject: [PATCH 3/5] =?UTF-8?q?=E3=80=8C=F0=9F=97=91=EF=B8=8F=E3=80=8D=20c?= =?UTF-8?q?lean:=20cleaned=20project.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.lock | 27 --------------------------- result | 1 - 2 files changed, 28 deletions(-) delete mode 100644 flake.lock delete mode 120000 result diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 040b119..0000000 --- a/flake.lock +++ /dev/null @@ -1,27 +0,0 @@ -{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1731755305, - "narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/result b/result deleted file mode 120000 index 35a1c74..0000000 --- a/result +++ /dev/null @@ -1 +0,0 @@ -/nix/store/kdf17rkmzzarakbddqvswk70pll7y4jk-fastclass \ No newline at end of file From eedde2989498a109b45c51d00e2dfe97ec1813bd Mon Sep 17 00:00:00 2001 From: Adam JOLY Date: Wed, 20 Nov 2024 21:50:35 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=E3=80=8C=E2=9C=A8=E3=80=8D=20feat(Makefile?= =?UTF-8?q?):=20Added=20new=20rule=20to=20make=20file=20to=20set=20automat?= =?UTF-8?q?icly=20user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 4 ++++ asdf.cpp | 33 +++++++++++++++++++++++++++++++++ asdf.hpp | 27 +++++++++++++++++++++++++++ flake.lock | 27 +++++++++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 asdf.cpp create mode 100644 asdf.hpp create mode 100644 flake.lock diff --git a/Makefile b/Makefile index 7d7a45b..7bddfb1 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,10 @@ ${NAME}: @${CC} ${FLAGS} ${SRCS} -o ${NAME}; \ printf "\e[1;32m[build successfull]\e[1;00m\n" +auto-name : + @${CC} ${FLAGS} ${SRCS} -D USER=\"$(USER)\" -o ${NAME}; \ + printf "\e[1;32m[build successfull]\e[1;00m\n" + install : @read -p "Enter your username, it will appear on your 42Header as (USERNAME@EMAIL) : " class_username; \ read -p "Enter your email, it will appear on your 42Header as (USERNAME@EMAIL): " class_email; \ diff --git a/asdf.cpp b/asdf.cpp new file mode 100644 index 0000000..0dc80c7 --- /dev/null +++ b/asdf.cpp @@ -0,0 +1,33 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* asdf.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: marvin +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/11/20 21:49:44 by marvin #+# #+# */ +/* Updated: 2024/11/20 21:49:44 by marvin ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "asdf.hpp" + +asdf::asdf(void) +{ + +} + +asdf::~asdf(void) +{ + +} + +asdf::asdf(asdf ©) +{ + *this = copy; +} + +asdf& asdf::operator=(const asdf& x) +{ + return (*this); +} diff --git a/asdf.hpp b/asdf.hpp new file mode 100644 index 0000000..3871358 --- /dev/null +++ b/asdf.hpp @@ -0,0 +1,27 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* asdf.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: marvin +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/11/20 21:49:44 by marvin #+# #+# */ +/* Updated: 2024/11/20 21:49:44 by marvin ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef __ASDF__ +# define __ASDF__ + +class asdf +{ + public: + asdf(void); + ~asdf(void); + asdf(asdf ©); + asdf& operator=(const asdf& x); + private: + +}; + +#endif \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..040b119 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1731755305, + "narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} From 752185bda66956b827cc0bea9c01e7b6160d1344 Mon Sep 17 00:00:00 2001 From: Adam JOLY Date: Wed, 20 Nov 2024 21:50:45 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=E3=80=8C=F0=9F=97=91=EF=B8=8F=E3=80=8D=20c?= =?UTF-8?q?lean:=20cleaned=20project.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asdf.cpp | 33 --------------------------------- asdf.hpp | 27 --------------------------- 2 files changed, 60 deletions(-) delete mode 100644 asdf.cpp delete mode 100644 asdf.hpp diff --git a/asdf.cpp b/asdf.cpp deleted file mode 100644 index 0dc80c7..0000000 --- a/asdf.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* asdf.cpp :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: marvin +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2024/11/20 21:49:44 by marvin #+# #+# */ -/* Updated: 2024/11/20 21:49:44 by marvin ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "asdf.hpp" - -asdf::asdf(void) -{ - -} - -asdf::~asdf(void) -{ - -} - -asdf::asdf(asdf ©) -{ - *this = copy; -} - -asdf& asdf::operator=(const asdf& x) -{ - return (*this); -} diff --git a/asdf.hpp b/asdf.hpp deleted file mode 100644 index 3871358..0000000 --- a/asdf.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* asdf.hpp :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: marvin +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2024/11/20 21:49:44 by marvin #+# #+# */ -/* Updated: 2024/11/20 21:49:44 by marvin ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#ifndef __ASDF__ -# define __ASDF__ - -class asdf -{ - public: - asdf(void); - ~asdf(void); - asdf(asdf ©); - asdf& operator=(const asdf& x); - private: - -}; - -#endif \ No newline at end of file