├── .gitignore ├── README.md ├── gallery └── shell.png ├── javascript └── flake.nix ├── ocaml ├── README.md ├── flake.lock ├── flake.nix └── melange │ ├── flake.lock │ └── flake.nix └── python ├── .ipynb_checkpoints └── Untitled-checkpoint.ipynb ├── README.md ├── python310 ├── README.md ├── flake.lock └── flake.nix └── python311 ├── README.md ├── flake.lock └── flake.nix /.gitignore: -------------------------------------------------------------------------------- 1 | .lock 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Development Environment 2 | ![alt text](https://github.com/kemalmao19/devShell/blob/main/gallery/shell.png?raw=true "Python DevShell") 3 | 4 | this repositori provide a way to create Development Environment using flake.nix 5 | 6 | ## Why Nix? 7 | I use nix develop to set up (currently) python development environment for different projects. 8 | I use a flake.nix to describe what package and library that i need and use **nix develop** to set up the environment for me. 9 | 10 | 📌 Flake Nix is a fantastic tool that simplifies the setup and maintenance of Development projects. It allows me to create isolated, reproducible environments effortlessly, ensuring consistency across teams and deployments. 11 | 12 | 🛠️ With Flake Nix, managing dependencies has become a breeze! Gone are the days of battling with package conflicts and version mismatches. I can confidently develop projects without worrying about unexpected surprises during deployment. 13 | 14 | 🐍 Additionally, Flake Nix provides a seamless way to switch between different Python versions, enabling me to test my code across multiple environments effortlessly. 15 | 16 | 💻 This tool has transformed my development process, making it smoother, more efficient, and reducing setup time significantly. Now, I can focus more on writing clean, robust code and **less on dealing with environment issues**. 17 | 18 | 19 | ## How to use it? 20 | in the folder python ther is flake.nix file. 21 | Then you can run **nix develop -c $SHELL** and nix will prepare python and its library for you to run. 22 | -------------------------------------------------------------------------------- /gallery/shell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kemalmao19/devShell/50c33eb8421898e1f4b156a029f17c0749dde6d0/gallery/shell.png -------------------------------------------------------------------------------- /javascript/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Example JavaScript development environment for Zero to Nix"; 3 | 4 | # Flake inputs 5 | inputs = { 6 | nixpkgs.url = "github:NixOS/nixpkgs"; 7 | }; 8 | 9 | # Flake outputs 10 | outputs = { self, nixpkgs }: 11 | let 12 | # Systems supported 13 | allSystems = [ 14 | "x86_64-linux" # 64-bit Intel/AMD Linux 15 | "aarch64-linux" # 64-bit ARM Linux 16 | "x86_64-darwin" # 64-bit Intel macOS 17 | "aarch64-darwin" # 64-bit ARM macOS 18 | ]; 19 | 20 | # Helper to provide system-specific attributes 21 | forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f { 22 | pkgs = import nixpkgs { inherit system; }; 23 | }); 24 | in 25 | { 26 | # Development environment output 27 | devShells = forAllSystems ({ pkgs }: { 28 | default = pkgs.mkShell { 29 | # The Nix packages provided in the environment 30 | packages = with pkgs; [ 31 | nodejs_18 # Node.js 18, plus npm, npx, and corepack 32 | ]; 33 | }; 34 | }); 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /ocaml/README.md: -------------------------------------------------------------------------------- 1 | # Ocaml Environment 2 | 3 | this env use lates ocaml version (now 4.14) 4 | -------------------------------------------------------------------------------- /ocaml/flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "nixpkgs": { 4 | "locked": { 5 | "lastModified": 1690026219, 6 | "narHash": "sha256-oOduRk/kzQxOBknZXTLSEYd7tk+GoKvr8wV6Ab+t4AU=", 7 | "owner": "NixOS", 8 | "repo": "nixpkgs", 9 | "rev": "f465da166263bc0d4b39dfd4ca28b777c92d4b73", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "NixOS", 14 | "repo": "nixpkgs", 15 | "type": "github" 16 | } 17 | }, 18 | "root": { 19 | "inputs": { 20 | "nixpkgs": "nixpkgs" 21 | } 22 | } 23 | }, 24 | "root": "root", 25 | "version": 7 26 | } 27 | -------------------------------------------------------------------------------- /ocaml/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Ocaml Environment"; 3 | 4 | # Flake inputs 5 | inputs = { 6 | nixpkgs.url = "github:NixOS/nixpkgs"; # also valid: "nixpkgs" 7 | }; 8 | 9 | # Flake outputs 10 | outputs = { self, nixpkgs }: 11 | let 12 | # Systems supported 13 | allSystems = [ 14 | "x86_64-linux" # 64-bit Intel/AMD Linux 15 | "aarch64-linux" # 64-bit ARM Linux 16 | "x86_64-darwin" # 64-bit Intel macOS 17 | "aarch64-darwin" # 64-bit ARM macOS 18 | ]; 19 | 20 | # Helper to provide system-specific attributes 21 | forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f { 22 | pkgs = import nixpkgs { inherit system; }; 23 | }); 24 | in 25 | { 26 | # Development environment output 27 | devShells = forAllSystems ({ pkgs }: { 28 | default = pkgs.mkShell { 29 | # The Nix packages provided in the environment 30 | packages = with pkgs; [ 31 | ocaml 32 | opam 33 | # merlin 34 | ]; 35 | }; 36 | }); 37 | }; 38 | } -------------------------------------------------------------------------------- /ocaml/melange/flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-utils": { 4 | "inputs": { 5 | "systems": "systems" 6 | }, 7 | "locked": { 8 | "lastModified": 1694529238, 9 | "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", 10 | "owner": "numtide", 11 | "repo": "flake-utils", 12 | "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", 13 | "type": "github" 14 | }, 15 | "original": { 16 | "owner": "numtide", 17 | "repo": "flake-utils", 18 | "type": "github" 19 | } 20 | }, 21 | "flake-utils_2": { 22 | "inputs": { 23 | "systems": "systems_2" 24 | }, 25 | "locked": { 26 | "lastModified": 1694529238, 27 | "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", 28 | "owner": "numtide", 29 | "repo": "flake-utils", 30 | "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", 31 | "type": "github" 32 | }, 33 | "original": { 34 | "owner": "numtide", 35 | "repo": "flake-utils", 36 | "type": "github" 37 | } 38 | }, 39 | "melange": { 40 | "inputs": { 41 | "flake-utils": "flake-utils_2", 42 | "melange-compiler-libs": "melange-compiler-libs", 43 | "nix-filter": "nix-filter", 44 | "nixpkgs": "nixpkgs" 45 | }, 46 | "locked": { 47 | "lastModified": 1700274195, 48 | "narHash": "sha256-XSY+O0f+wASb16dNQ7nQWoGMXEuV0e82R0DUs8nS2gs=", 49 | "owner": "melange-re", 50 | "repo": "melange", 51 | "rev": "46628038b558fd68631ef7f3b28550f93572a920", 52 | "type": "github" 53 | }, 54 | "original": { 55 | "owner": "melange-re", 56 | "repo": "melange", 57 | "type": "github" 58 | } 59 | }, 60 | "melange-compiler-libs": { 61 | "inputs": { 62 | "flake-utils": [ 63 | "melange", 64 | "flake-utils" 65 | ], 66 | "nixpkgs": [ 67 | "melange", 68 | "nixpkgs" 69 | ] 70 | }, 71 | "locked": { 72 | "lastModified": 1699766336, 73 | "narHash": "sha256-8cLYukUceL5LWoTSe8R4N/D0PYR0kdDbkhNqwNKjW8U=", 74 | "owner": "melange-re", 75 | "repo": "melange-compiler-libs", 76 | "rev": "d0775b4fa818804a63ac3e5edf17908ce62e4075", 77 | "type": "github" 78 | }, 79 | "original": { 80 | "owner": "melange-re", 81 | "repo": "melange-compiler-libs", 82 | "type": "github" 83 | } 84 | }, 85 | "nix-filter": { 86 | "locked": { 87 | "lastModified": 1694857738, 88 | "narHash": "sha256-bxxNyLHjhu0N8T3REINXQ2ZkJco0ABFPn6PIe2QUfqo=", 89 | "owner": "numtide", 90 | "repo": "nix-filter", 91 | "rev": "41fd48e00c22b4ced525af521ead8792402de0ea", 92 | "type": "github" 93 | }, 94 | "original": { 95 | "owner": "numtide", 96 | "repo": "nix-filter", 97 | "type": "github" 98 | } 99 | }, 100 | "nixpkgs": { 101 | "inputs": { 102 | "flake-utils": [ 103 | "melange", 104 | "flake-utils" 105 | ], 106 | "nixpkgs": "nixpkgs_2" 107 | }, 108 | "locked": { 109 | "lastModified": 1700183883, 110 | "narHash": "sha256-gs5Nozn0uVtvmk+ZAm4n7AVgTmaS0FIrfPOMK/Jynxw=", 111 | "owner": "nix-ocaml", 112 | "repo": "nix-overlays", 113 | "rev": "7e524cd8f8e5538333692137991694ec3453dbed", 114 | "type": "github" 115 | }, 116 | "original": { 117 | "owner": "nix-ocaml", 118 | "repo": "nix-overlays", 119 | "type": "github" 120 | } 121 | }, 122 | "nixpkgs_2": { 123 | "locked": { 124 | "lastModified": 1700130609, 125 | "narHash": "sha256-pFtz286KaVHUmBOQztMNSgvT7hxcDe409vnDJxWQH7A=", 126 | "owner": "NixOS", 127 | "repo": "nixpkgs", 128 | "rev": "54f00576aa6139a9d54062d0edc2fb31423f0ffb", 129 | "type": "github" 130 | }, 131 | "original": { 132 | "owner": "NixOS", 133 | "repo": "nixpkgs", 134 | "rev": "54f00576aa6139a9d54062d0edc2fb31423f0ffb", 135 | "type": "github" 136 | } 137 | }, 138 | "nixpkgs_3": { 139 | "locked": { 140 | "lastModified": 1700397899, 141 | "narHash": "sha256-i0Moap5CNEvN8WyEzFACj3Bf9JN5n4p9QguJr8NX0IM=", 142 | "owner": "nixos", 143 | "repo": "nixpkgs", 144 | "rev": "9dcde59abd9e65dc5a2bacc6c96f4b63262ce928", 145 | "type": "github" 146 | }, 147 | "original": { 148 | "owner": "nixos", 149 | "repo": "nixpkgs", 150 | "type": "github" 151 | } 152 | }, 153 | "root": { 154 | "inputs": { 155 | "flake-utils": "flake-utils", 156 | "melange": "melange", 157 | "nixpkgs": "nixpkgs_3" 158 | } 159 | }, 160 | "systems": { 161 | "locked": { 162 | "lastModified": 1681028828, 163 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 164 | "owner": "nix-systems", 165 | "repo": "default", 166 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 167 | "type": "github" 168 | }, 169 | "original": { 170 | "owner": "nix-systems", 171 | "repo": "default", 172 | "type": "github" 173 | } 174 | }, 175 | "systems_2": { 176 | "locked": { 177 | "lastModified": 1681028828, 178 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 179 | "owner": "nix-systems", 180 | "repo": "default", 181 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 182 | "type": "github" 183 | }, 184 | "original": { 185 | "owner": "nix-systems", 186 | "repo": "default", 187 | "type": "github" 188 | } 189 | } 190 | }, 191 | "root": "root", 192 | "version": 7 193 | } 194 | -------------------------------------------------------------------------------- /ocaml/melange/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Melange starter"; 3 | 4 | inputs = { 5 | flake-utils.url = "github:numtide/flake-utils"; 6 | nixpkgs.url = "github:nixos/nixpkgs"; 7 | 8 | # Depend on the Melange flake, which provides the overlay 9 | melange.url = "github:melange-re/melange"; 10 | }; 11 | 12 | outputs = { self, nixpkgs, flake-utils, melange }: 13 | flake-utils.lib.eachDefaultSystem (system: 14 | let 15 | pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [ 16 | # Set the OCaml set of packages to the 5.1 release line 17 | (self: super: { ocamlPackages = super.ocaml-ng.ocamlPackages_5_1; }) 18 | # Apply the Melange overlay 19 | melange.overlays.default 20 | ]; 21 | inherit (pkgs) ocamlPackages; 22 | in 23 | 24 | { 25 | devShells.default = pkgs.mkShell { 26 | nativeBuildInputs = with ocamlPackages; [ 27 | ocaml 28 | dune_3 29 | findlib 30 | ocaml-lsp 31 | ocamlPackages.melange 32 | ]; 33 | buildInputs = [ ocamlPackages.melange ]; 34 | }; 35 | }); 36 | } 37 | -------------------------------------------------------------------------------- /python/.ipynb_checkpoints/Untitled-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 5 6 | } 7 | -------------------------------------------------------------------------------- /python/README.md: -------------------------------------------------------------------------------- 1 | # Python Version Available: 310 and 311 2 | u can choose/use both/add more version you want 3 | -------------------------------------------------------------------------------- /python/python310/README.md: -------------------------------------------------------------------------------- 1 | # Features 2 | - Python 310 3 | - Jupyter Notebook 4 | - Basic Data Science Libraries 5 | - You can add more libraries, just go here https://search.nixos.org/packages 6 | -------------------------------------------------------------------------------- /python/python310/flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "nixpkgs": { 4 | "locked": { 5 | "lastModified": 1689695516, 6 | "narHash": "sha256-31TCmqPkNZ6YeteDyNMyo4568a9vx9jQZAR5yT4Ei3I=", 7 | "owner": "NixOS", 8 | "repo": "nixpkgs", 9 | "rev": "5a2c27c83272b01a984686fef9dca8341c750cee", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "NixOS", 14 | "repo": "nixpkgs", 15 | "type": "github" 16 | } 17 | }, 18 | "root": { 19 | "inputs": { 20 | "nixpkgs": "nixpkgs" 21 | } 22 | } 23 | }, 24 | "root": "root", 25 | "version": 7 26 | } 27 | -------------------------------------------------------------------------------- /python/python310/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "This is my python dev: Data Science Libraries Edition"; 3 | 4 | # Flake inputs 5 | inputs = { 6 | nixpkgs.url = "github:NixOS/nixpkgs"; # also valid: "nixpkgs" 7 | }; 8 | 9 | # Flake outputs 10 | outputs = { self, nixpkgs, }: 11 | let 12 | # Systems supported 13 | allSystems = [ 14 | "x86_64-linux" # 64-bit Intel/AMD Linux 15 | "aarch64-linux" # 64-bit ARM Linux 16 | "x86_64-darwin" # 64-bit Intel macOS 17 | "aarch64-darwin" # 64-bit ARM macOS 18 | ]; 19 | 20 | # Helper to provide system-specific attributes 21 | forAllSystems = f: 22 | nixpkgs.lib.genAttrs allSystems 23 | (system: f { pkgs = import nixpkgs { inherit system; }; }); 24 | in { 25 | # Development environment output 26 | devShells = forAllSystems ({ pkgs }: { 27 | default = 28 | let 29 | # Use Python 3.11 30 | python = pkgs.python310; 31 | 32 | in pkgs.mkShell { 33 | # The Nix packages provided in the environment 34 | packages = [ 35 | # Python plus helper tools 36 | (python.withPackages (ps: 37 | with ps; [ 38 | 39 | # notebook 40 | jupyter 41 | jupyterlab 42 | ipykernel 43 | ipython 44 | 45 | # scientific computing 46 | pandas # Data structures & tools 47 | numpy # Array & matrices 48 | scipy # Integral, solving differential, equations, optimizations) 49 | 50 | # Visualization 51 | matplotlib # plot & graphs 52 | seaborn # heat maps, time series, violin plot 53 | 54 | # Algorithmic Libraries 55 | scikit-learn-extra # Machine learning: regression, classificatons,.. 56 | statsmodels # Ecplore data, estimate statistical models, & perform statistical test. 57 | 58 | # Formatting 59 | black 60 | 61 | # Probabilistic 62 | pymc 63 | 64 | ])) 65 | ]; 66 | }; 67 | }); 68 | }; 69 | } 70 | -------------------------------------------------------------------------------- /python/python311/README.md: -------------------------------------------------------------------------------- 1 | # Features 2 | - Python 311 3 | - Jupyter Notebook 4 | - Basic Data Science Libraries 5 | - You can add more libraries, just go here https://search.nixos.org/packages 6 | -------------------------------------------------------------------------------- /python/python311/flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "nixpkgs": { 4 | "locked": { 5 | "lastModified": 1689695516, 6 | "narHash": "sha256-31TCmqPkNZ6YeteDyNMyo4568a9vx9jQZAR5yT4Ei3I=", 7 | "owner": "NixOS", 8 | "repo": "nixpkgs", 9 | "rev": "5a2c27c83272b01a984686fef9dca8341c750cee", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "NixOS", 14 | "repo": "nixpkgs", 15 | "type": "github" 16 | } 17 | }, 18 | "root": { 19 | "inputs": { 20 | "nixpkgs": "nixpkgs" 21 | } 22 | } 23 | }, 24 | "root": "root", 25 | "version": 7 26 | } 27 | -------------------------------------------------------------------------------- /python/python311/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "This is my python dev: Data Science Libraries Edition"; 3 | 4 | # Flake inputs 5 | inputs = { 6 | nixpkgs.url = "github:NixOS/nixpkgs"; # also valid: "nixpkgs" 7 | }; 8 | 9 | # Flake outputs 10 | outputs = { self, nixpkgs, }: 11 | let 12 | # Systems supported 13 | allSystems = [ 14 | "x86_64-linux" # 64-bit Intel/AMD Linux 15 | "aarch64-linux" # 64-bit ARM Linux 16 | "x86_64-darwin" # 64-bit Intel macOS 17 | "aarch64-darwin" # 64-bit ARM macOS 18 | ]; 19 | 20 | # Helper to provide system-specific attributes 21 | forAllSystems = f: 22 | nixpkgs.lib.genAttrs allSystems 23 | (system: f { pkgs = import nixpkgs { inherit system; }; }); 24 | in { 25 | # Development environment output 26 | devShells = forAllSystems ({ pkgs }: { 27 | default = let 28 | # Use Python 3.11 29 | python = pkgs.python311; 30 | 31 | in pkgs.mkShell { 32 | # The Nix packages provided in the environment 33 | packages = [ 34 | # Python plus helper tools 35 | (python.withPackages (ps: 36 | with ps; [ 37 | 38 | # notebook 39 | jupyter 40 | jupyterlab 41 | ipykernel 42 | ipython 43 | 44 | # scientific computing 45 | pandas # Data structures & tools 46 | numpy # Array & matrices 47 | scipy # Integral, solving differential, equations, optimizations) 48 | 49 | # Visualization 50 | matplotlib # plot & graphs 51 | seaborn # heat maps, time series, violin plot 52 | 53 | # Algorithmic Libraries 54 | scikit-learn-extra # Machine learning: regression, classificatons,.. 55 | statsmodels # Ecplore data, estimate statistical models, & perform statistical test. 56 | 57 | # Formatting 58 | black 59 | 60 | # Probabilistic 61 | # pymc #support < 311 62 | 63 | ])) 64 | ]; 65 | }; 66 | }); 67 | }; 68 | } 69 | --------------------------------------------------------------------------------