diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..47882bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +db/mysql_data diff --git a/db/docker-compose.yml b/db/docker-compose.yml new file mode 100644 index 0000000..f82cf36 --- /dev/null +++ b/db/docker-compose.yml @@ -0,0 +1,12 @@ +services: + mysql: + image: mysql:8.0 + container_name: tresor-mysql + restart: always + environment: + MYSQL_DATABASE: tresordb + MYSQL_ROOT_PASSWORD: 1234 + ports: + - "3306:3306" + volumes: + - ./mysql_data:/var/lib/mysql diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..787db5d --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1742889210, + "narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "698214a32beb4f4c8e3942372c694f40848b360d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8d5fa5d --- /dev/null +++ b/flake.nix @@ -0,0 +1,24 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = { self, nixpkgs }: let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in { + devShells.${system}.default = pkgs.mkShell { + buildInputs = [ + pkgs.docker + pkgs.docker-compose + ]; + + shellHook = '' + docker compose -f db/docker-compose.yml up mysql -d + trap 'docker compose -f db/docker-compose.yml down' EXIT + ''; + }; + }; +}