commit 9338cfadfda5f19b2d824f465019d4055ae55014 Author: Thomas Avé Date: Wed Oct 2 11:57:21 2024 +0200 Initial Commit diff --git a/C++/.envrc b/C++/.envrc new file mode 100644 index 0000000..3a707b2 --- /dev/null +++ b/C++/.envrc @@ -0,0 +1,14 @@ +[ -e ".devenv" ] || rm -rf .devenv +[ -L ".devenv" ] || (mkdir -p "$HOME/.cache/devenv$PWD" && ln -s "$HOME/.cache/devenv$PWD" .devenv) + +if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" +fi + +watch_file flake.nix +watch_file flake.lock + +if ! use flake . --impure +then + echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 +fi diff --git a/C++/flake.nix b/C++/flake.nix new file mode 100644 index 0000000..bfbbc63 --- /dev/null +++ b/C++/flake.nix @@ -0,0 +1,20 @@ +{ + description = "Environment for building a C++ projects"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + outputs = { nixpkgs, ... }: + let + system = "x86_64-linux"; # Adjust for your system + pkgs = import nixpkgs { inherit system; }; + dependencies = with pkgs; [ + cmake + gnumake + clang + ]; + in { + devShells."${system}".default = pkgs.mkShell { + packages = dependencies; + }; + }; +} diff --git a/DevEnv/Python/.envrc b/DevEnv/Python/.envrc new file mode 100644 index 0000000..3a707b2 --- /dev/null +++ b/DevEnv/Python/.envrc @@ -0,0 +1,14 @@ +[ -e ".devenv" ] || rm -rf .devenv +[ -L ".devenv" ] || (mkdir -p "$HOME/.cache/devenv$PWD" && ln -s "$HOME/.cache/devenv$PWD" .devenv) + +if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" +fi + +watch_file flake.nix +watch_file flake.lock + +if ! use flake . --impure +then + echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 +fi diff --git a/DevEnv/Python/flake.nix b/DevEnv/Python/flake.nix new file mode 100644 index 0000000..121e7ca --- /dev/null +++ b/DevEnv/Python/flake.nix @@ -0,0 +1,54 @@ +{ + inputs = { + nixpkgs.url = "github:cachix/devenv-nixpkgs/rolling"; + nixpkgs-python.url = "github:cachix/nixpkgs-python"; + nixpkgs-python.inputs = { nixpkgs.follows = "nixpkgs"; }; + systems.url = "github:nix-systems/default"; + devenv.url = "github:cachix/devenv"; + devenv.inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixConfig = { + extra-trusted-public-keys = [ + "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" + "nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU=" + ]; + extra-substituters = [ + "https://devenv.cachix.org" + "https://nixpkgs-python.cachix.org" + ]; + }; + + outputs = { self, nixpkgs, devenv, systems, ... } @ inputs: + let + forEachSystem = nixpkgs.lib.genAttrs (import systems); + in + { + packages = forEachSystem (system: { + devenv-up = self.devShells.${system}.default.config.procfileScript; + }); + + devShells = forEachSystem + (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + default = devenv.lib.mkShell { + inherit inputs pkgs; + modules = [ + { + languages.python = { + enable = true; + version = "3.11.3"; + venv.enable = true; + venv.requirements = ./requirements.txt; + }; + packages = [ pkgs.zsh pkgs.python311Packages.tkinter ]; + processes.run.exec = "python main.py"; + } + ]; + }; + }); + }; +} diff --git a/Go/flake.nix b/Go/flake.nix new file mode 100644 index 0000000..4d4102d --- /dev/null +++ b/Go/flake.nix @@ -0,0 +1,45 @@ +{ + description = "Generic Go Flake"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + }; + + outputs = inputs @ {flake-parts, ...}: + flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["x86_64-linux" "aarch64-linux"]; + perSystem = { + pkgs, + lib, + ... + }: let + example = pkgs.buildGoModule { + pname = "example"; + version = "0.1.0"; + + src = builtins.path { + name = "example-source"; + path = ./src; + }; + vendorHash = "sha256-0YG2kf1500UpSdDK+ONGTKGZFrIivi/O1g2uIkgd4DA="; + meta = with lib; { + description = "Generic Go Package"; + homepage = "https://git.thomasave.be/thomasave/example"; + license = licenses.mit; + maintainers = with maintainers; [thomasave]; + platforms = platforms.linux; + mainProgram = "example"; + }; + }; + in { + formatter = pkgs.alejandra; + packages = { + default = example; + inherit example; + }; + }; + }; +} diff --git a/Java/.envrc b/Java/.envrc new file mode 100644 index 0000000..3a707b2 --- /dev/null +++ b/Java/.envrc @@ -0,0 +1,14 @@ +[ -e ".devenv" ] || rm -rf .devenv +[ -L ".devenv" ] || (mkdir -p "$HOME/.cache/devenv$PWD" && ln -s "$HOME/.cache/devenv$PWD" .devenv) + +if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" +fi + +watch_file flake.nix +watch_file flake.lock + +if ! use flake . --impure +then + echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 +fi diff --git a/Java/flake.nix b/Java/flake.nix new file mode 100644 index 0000000..1b6ccd5 --- /dev/null +++ b/Java/flake.nix @@ -0,0 +1,18 @@ +{ + description = "Generic Java Application"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + outputs = { nixpkgs, ... }: + let + system = "x86_64-linux"; # Adjust for your system + pkgs = import nixpkgs { inherit system; }; + dependencies = with pkgs; [ + maven + ]; + in { + devShells."${system}".default = pkgs.mkShell { + packages = dependencies; + }; + }; +} diff --git a/LaTeX/.envrc b/LaTeX/.envrc new file mode 100644 index 0000000..3a707b2 --- /dev/null +++ b/LaTeX/.envrc @@ -0,0 +1,14 @@ +[ -e ".devenv" ] || rm -rf .devenv +[ -L ".devenv" ] || (mkdir -p "$HOME/.cache/devenv$PWD" && ln -s "$HOME/.cache/devenv$PWD" .devenv) + +if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" +fi + +watch_file flake.nix +watch_file flake.lock + +if ! use flake . --impure +then + echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 +fi diff --git a/LaTeX/flake.nix b/LaTeX/flake.nix new file mode 100644 index 0000000..97917ee --- /dev/null +++ b/LaTeX/flake.nix @@ -0,0 +1,20 @@ +{ + description = "Nix environment with LaTeX"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + outputs = { nixpkgs, ... }: + let + system = "x86_64-linux"; # Adjust for your system + pkgs = import nixpkgs { inherit system; }; + + texliveFull = pkgs.texliveFull.withPackages (ps: [ ps.uantwerpendocs ]); + dependencies = [ + texliveFull + ]; + in { + devShells."${system}".default = pkgs.mkShell { + packages = dependencies; + }; + }; +} diff --git a/Python/.envrc b/Python/.envrc new file mode 100644 index 0000000..3a707b2 --- /dev/null +++ b/Python/.envrc @@ -0,0 +1,14 @@ +[ -e ".devenv" ] || rm -rf .devenv +[ -L ".devenv" ] || (mkdir -p "$HOME/.cache/devenv$PWD" && ln -s "$HOME/.cache/devenv$PWD" .devenv) + +if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" +fi + +watch_file flake.nix +watch_file flake.lock + +if ! use flake . --impure +then + echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 +fi diff --git a/Python/README.md b/Python/README.md new file mode 100644 index 0000000..7e59600 --- /dev/null +++ b/Python/README.md @@ -0,0 +1 @@ +# README diff --git a/Python/flake.nix b/Python/flake.nix new file mode 100644 index 0000000..5b670f4 --- /dev/null +++ b/Python/flake.nix @@ -0,0 +1,24 @@ +{ + description = "Generic Python Dependencies"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + outputs = { nixpkgs, ... }: + let + system = "x86_64-linux"; # Adjust for your system + pkgs = import nixpkgs { inherit system; }; + dependencies = with pkgs; with python311Packages; [ + python + ]; + in { + devShells."${system}".default = pkgs.mkShell { + packages = dependencies; + }; + packages.x86_64-linux.default = pkgs.python311Packages.buildPythonApplication { + pname = "app"; + src = ./.; + version = "1.0"; + buildInputs = dependencies; + }; + }; +} diff --git a/Python/setup.py b/Python/setup.py new file mode 100644 index 0000000..863e7a4 --- /dev/null +++ b/Python/setup.py @@ -0,0 +1,13 @@ +from setuptools import setup, find_packages + + +setup( + name="app", + version="1.0", + packages=find_packages(), + entry_points = { + 'console_scripts': [ + 'app = src:main', + ], + }, +) diff --git a/Python/src/__init__.py b/Python/src/__init__.py new file mode 100644 index 0000000..3339ef2 --- /dev/null +++ b/Python/src/__init__.py @@ -0,0 +1,5 @@ +def main(): + pass + +if __name__ == "__main__": + main()