diff --git a/.envrc b/.envrc
index 1d953f4..3550a30 100644
--- a/.envrc
+++ b/.envrc
@@ -1 +1 @@
-use nix
+use flake
diff --git a/.gitignore b/.gitignore
index e09f1ce..1c40de5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,92 @@
/target
*.db
.env
+.direnv/
+
+# Covers JetBrains IDEs: IntelliJ, GoLand, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# AWS User-specific
+.idea/**/aws.xml
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn. Uncomment if using
+# auto-import.
+# .idea/artifacts
+# .idea/compiler.xml
+# .idea/jarRepositories.xml
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+# *.iml
+# *.ipr
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# SonarLint plugin
+.idea/sonarlint/
+.idea/sonarlint.xml # see https://community.sonarsource.com/t/is-the-file-idea-idea-idea-sonarlint-xml-intended-to-be-under-source-control/121119
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based HTTP Client
+.idea/httpRequests
+http-client.private.env.json
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
+
+# Apifox Helper cache
+.idea/.cache/.Apifox_Helper
+.idea/ApifoxUploaderProjectSetting.xml
+
+# Github Copilot persisted session migrations, see: https://github.com/microsoft/copilot-intellij-feedback/issues/712#issuecomment-3322062215
+.idea/**/copilot.data.migration.*.xml
+
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 13566b8..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
-# Editor-based HTTP Client requests
-/httpRequests/
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml
deleted file mode 100644
index 3967285..0000000
--- a/.idea/dataSources.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
- sqlite.xerial
- true
- org.sqlite.JDBC
- jdbc:sqlite:$PROJECT_DIR$/manifold.db
- $ProjectFileDir$
-
-
- postgresql
- true
- org.postgresql.Driver
- jdbc:postgresql://localhost:5432/badgey_development
-
-
-
- $ProjectFileDir$
-
-
- postgresql
- true
- org.postgresql.Driver
- jdbc:postgresql://172.16.5.167:5432/badgey
-
-
-
- $ProjectFileDir$
-
-
-
\ No newline at end of file
diff --git a/.idea/remote-targets.xml b/.idea/remote-targets.xml
deleted file mode 100644
index 32a7c5c..0000000
--- a/.idea/remote-targets.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..9e60c85
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,46 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1768302833,
+ "narHash": "sha256-h5bRFy9bco+8QcK7rGoOiqMxMbmn21moTACofNLRMP4=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "61db79b0c6b838d9894923920b612048e1201926",
+ "type": "github"
+ },
+ "original": {
+ "id": "nixpkgs",
+ "type": "indirect"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs",
+ "rust-overlay": "rust-overlay"
+ }
+ },
+ "rust-overlay": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1768272338,
+ "narHash": "sha256-Tg/kL8eKMpZtceDvBDQYU8zowgpr7ucFRnpP/AtfuRM=",
+ "owner": "oxalica",
+ "repo": "rust-overlay",
+ "rev": "03dda130a8701b08b0347fcaf850a190c53a3c1e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "oxalica",
+ "repo": "rust-overlay",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..9990e66
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,54 @@
+{
+ inputs = {
+ nixpkgs.url = "nixpkgs";
+ rust-overlay = {
+ url = "github:oxalica/rust-overlay";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs =
+ {
+ nixpkgs,
+ rust-overlay,
+ ...
+ }:
+ let
+ overlays = [ (import rust-overlay) ];
+ forAllSystems =
+ f:
+ builtins.mapAttrs (
+ system: packages:
+ let
+ pkgs = import nixpkgs {
+ inherit system overlays;
+ };
+ in
+ f pkgs
+ ) nixpkgs.legacyPackages;
+ in
+ {
+ devShells = forAllSystems (
+ pkgs: {
+ default = pkgs.mkShell {
+ shellHook = ''
+ export DATABASE_URL=sqlite://art.db?mode=rwc
+ '';
+ packages = with pkgs; [
+ # Rust toolchain
+ (rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
+ # LSP
+ rust-analyzer
+ clippy
+ tombi
+ openssl
+ postgresql
+ pkg-config
+ diesel-cli
+ gcc
+ ];
+ };
+ }
+ );
+ };
+}
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
new file mode 100644
index 0000000..9cab269
--- /dev/null
+++ b/rust-toolchain.toml
@@ -0,0 +1,3 @@
+[toolchain]
+channel = "stable"
+
diff --git a/shell.nix b/shell.nix
deleted file mode 100644
index 9dfd0bd..0000000
--- a/shell.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-{ pkgs ? import {}}:
-pkgs.mkShell {
- buildInputs = with pkgs; [
- openssl
- postgresql
- pkg-config
- diesel-cli
- ];
-}