aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-03-07 18:36:23 +0530
committerAkshay Nair <phenax5@gmail.com>2025-03-07 18:37:09 +0530
commitd7b0739cca80d0af95367e801972d10e3ea859db (patch)
tree88fd6fb5250def84d8398059e8cce82c0e2c791d
downloadnull-browser-d7b0739cca80d0af95367e801972d10e3ea859db.tar.gz
null-browser-d7b0739cca80d0af95367e801972d10e3ea859db.zip
Ah shit, here we go again
-rw-r--r--.envrc1
-rw-r--r--.gitignore3
-rw-r--r--CMakeLists.txt12
-rw-r--r--Makefile8
-rw-r--r--flake.lock61
-rw-r--r--flake.nix24
-rw-r--r--src/main.cpp20
7 files changed, 129 insertions, 0 deletions
diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000..3550a30
--- /dev/null
+++ b/.envrc
@@ -0,0 +1 @@
+use flake
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..902f3c7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+build/
+.cache/
+compile_commands.json
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..96fa737
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 3.16)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+project(web-browser
+ VERSION 0.0.0
+ LANGUAGES CXX)
+
+find_package(Qt6 REQUIRED COMPONENTS Widgets WebEngineWidgets)
+
+add_executable(web-browser src/main.cpp)
+
+target_link_libraries(web-browser Qt6::Widgets Qt6::WebEngineWidgets)
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..5f2da78
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,8 @@
+
+.PHONY: build
+build:
+ mkdir -p build
+ cd build/ && cmake ..
+ cd build/ && make
+ cp build/compile_commands.json .
+
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..68e20ed
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,61 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1731533236,
+ "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1741037377,
+ "narHash": "sha256-SvtvVKHaUX4Owb+PasySwZsoc5VUeTf1px34BByiOxw=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "02032da4af073d0f6110540c8677f16d4be0117f",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..7581784
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,24 @@
+{
+ inputs = {
+ flake-utils.url = "github:numtide/flake-utils";
+ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
+ };
+
+ outputs = { self, nixpkgs, flake-utils, ... }:
+ let
+ shell = { pkgs, ... }:
+ pkgs.mkShell {
+ buildInputs = with pkgs; [
+ cmake
+ gnumake
+ pkgs.qt6.full
+ clang-tools
+ ];
+ };
+ in flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = import nixpkgs { inherit system; };
+ in {
+ devShells.default = shell { inherit pkgs system; };
+ });
+}
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..275bed6
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,20 @@
+#include <QApplication>
+#include <QVBoxLayout>
+#include <QWebEngineView>
+#include <QWidget>
+
+int main(int argc, char *argv[]) {
+ QApplication app(argc, argv);
+ QWidget mainWindow;
+ mainWindow.setWindowTitle("Qt6 WebEngine");
+
+ QVBoxLayout *layout = new QVBoxLayout(&mainWindow);
+ QWebEngineView *view = new QWebEngineView();
+ view->setFixedSize(400, 400);
+ view->setUrl(QUrl("https://www.qt.io"));
+
+ layout->addWidget(view);
+ mainWindow.show();
+
+ return app.exec();
+}