From 0c24f903794cd3ff04cbbabbaf5c31de9387d028 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Thu, 26 Feb 2026 20:03:17 +0100 Subject: [PATCH] Added a web devflake (currently a copy of the CPP one), uses Go, and the traditional web stack (HTML, JS, CSS) --- dev-flakes/web/.envrc | 3 +++ dev-flakes/web/flake.nix | 49 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 dev-flakes/web/.envrc create mode 100644 dev-flakes/web/flake.nix diff --git a/dev-flakes/web/.envrc b/dev-flakes/web/.envrc new file mode 100644 index 0000000..9f43b25 --- /dev/null +++ b/dev-flakes/web/.envrc @@ -0,0 +1,3 @@ +FLAKEDIR=~/Developer/nix/NixOSDots/dev-flakes + +use flake ${FLAKEDIR}/web diff --git a/dev-flakes/web/flake.nix b/dev-flakes/web/flake.nix new file mode 100644 index 0000000..8921ca7 --- /dev/null +++ b/dev-flakes/web/flake.nix @@ -0,0 +1,49 @@ +{ + description = "General C++ dev enviroment"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + in + { + packages.default = pkgs.stdenv.mkDerivation { + pname = "myapp"; + version = "0.1.0"; + src = self; + + nativeBuildInputs = with pkgs; [ cmake ninja ]; + buildInputs = with pkgs; [ ]; + }; + + devShells.default = pkgs.mkShell { + name = "cpp-dev"; + + # In the dev shell, you get more tools than just what's needed to build + packages = with pkgs; [ + gcc + clang + cmake + ninja + gdb + valgrind + clang-tools + ccache + ]; + + shellHook = '' + echo "C++ loaded" + export CC="ccache gcc" + export CXX="ccache g++" + ''; + }; + }); +}