From 56d6d0ec6aaeaa925f6d4c33d007c67860cb9c56 Mon Sep 17 00:00:00 2001
From: Popa Ioan Alexandru <alexioanpopa11@gmail.com>
Date: Sat, 9 Oct 2021 05:53:27 +0300
Subject: [PATCH] Added a proper version number + some Nix  stuff

---
 .gitignore  |  1 +
 default.nix | 28 ++++++++++++++++++++++++++++
 meson.build |  2 +-
 shell.nix   | 10 ++++++++++
 4 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 default.nix
 create mode 100644 shell.nix

diff --git a/.gitignore b/.gitignore
index 01f9cb9..3d8b272 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 build/
+result/
 .vscode/
\ No newline at end of file
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..095a3eb
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,28 @@
+{ pkgs, python3Packages }:
+python3Packages.buildPythonApplication rec {
+    pname = "themechanger";
+    version = "0.10.0";
+    format = "other";
+    src = ./.;
+    nativeBuildInputs = with pkgs; [
+        gobject-introspection
+        meson
+        ninja
+        pkg-config
+        wrapGAppsHook
+        desktop-file-utils
+        gtk3
+    ];
+    buildInputs = with pkgs; [
+        glib
+        gtk3
+        python3
+        gsettings-desktop-schemas
+    ];
+    propagatedBuildInputs = with python3Packages; [
+        pygobject3
+    ];
+    postPatch = ''
+        patchShebangs postinstall.py
+    '';
+}
\ No newline at end of file
diff --git a/meson.build b/meson.build
index bc84ea1..a760577 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
 project('themechanger', 'c',
-          version: '0.1.0',
+          version: '0.10.0',
     meson_version: '>= 0.50.0',
   default_options: [ 'warning_level=2',
                    ],
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..2f7da43
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,10 @@
+with import <nixpkgs> {};
+mkShell {
+    buildInputs = [
+        (import ./default.nix { inherit pkgs python3Packages; })
+    ];
+    shellHook = ''
+        themechanger
+        exit
+    '';
+}
\ No newline at end of file