From fa87a28f9e09d24739f34b721b4b0574f36db7d9 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 11 Nov 2024 23:20:21 +0000 Subject: [PATCH] Add devenv --- .envrc | 4 +- .gitignore | 9 ++++ devenv.lock | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++ devenv.nix | 14 +++++++ devenv.yaml | 15 +++++++ flake.lock | 27 ------------ flake.nix | 19 --------- 7 files changed, 157 insertions(+), 47 deletions(-) create mode 100644 devenv.lock create mode 100644 devenv.nix create mode 100644 devenv.yaml delete mode 100644 flake.lock delete mode 100644 flake.nix diff --git a/.envrc b/.envrc index 3550a30f..894571bf 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,3 @@ -use flake +source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k=" + +use devenv diff --git a/.gitignore b/.gitignore index d679d63f..7f1712ec 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,12 @@ source/build /.direnv/ +# Devenv +.devenv* +devenv.local.nix + +# direnv +.direnv + +# pre-commit +.pre-commit-config.yaml diff --git a/devenv.lock b/devenv.lock new file mode 100644 index 00000000..da3e6d3d --- /dev/null +++ b/devenv.lock @@ -0,0 +1,116 @@ +{ + "nodes": { + "devenv": { + "locked": { + "dir": "src/modules", + "lastModified": 1731361978, + "owner": "cachix", + "repo": "devenv", + "rev": "4b770aa91211fc1875d9d07aedf80ea2eae012d5", + "type": "github" + }, + "original": { + "dir": "src/modules", + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1716977621, + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "4267e705586473d3e5c8d50299e71503f16a6fb6", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1731239293, + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9256f7c71a195ebe7a218043d9f93390d49e6884", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1731363552, + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/devenv.nix b/devenv.nix new file mode 100644 index 00000000..5a6856f2 --- /dev/null +++ b/devenv.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: + +{ + packages = [ pkgs.git ]; + + languages.php = { + enable = true; + version = "8.3"; + }; + + processes.sculpin-watch.exec = "sculpin generate --server --watch"; + + scripts.sculpin-build.exec = "sculpin generate --env prod --clean --no-interaction"; +} diff --git a/devenv.yaml b/devenv.yaml new file mode 100644 index 00000000..116a2adb --- /dev/null +++ b/devenv.yaml @@ -0,0 +1,15 @@ +# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json +inputs: + nixpkgs: + url: github:cachix/devenv-nixpkgs/rolling + +# If you're using non-OSS software, you can set allowUnfree to true. +# allowUnfree: true + +# If you're willing to use a package that's vulnerable +# permittedInsecurePackages: +# - "openssl-1.1.1w" + +# If you have more than one devenv you can merge them +#imports: +# - ./backend diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 04466fad..00000000 --- a/flake.lock +++ /dev/null @@ -1,27 +0,0 @@ -{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1722813957, - "narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa", - "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 deleted file mode 100644 index 362b998d..00000000 --- a/flake.nix +++ /dev/null @@ -1,19 +0,0 @@ -# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. -{ - description = "A Nix Flake for oliverdavies-uk"; - - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - - outputs = { nixpkgs, ... }: - let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - - inherit (pkgs) mkShell; - in { - devShells.${system}.default = - mkShell { buildInputs = with pkgs; [ bashInteractive nodePackages.pnpm nodejs php82 php82Packages.composer ]; }; - - formatter.${system} = pkgs.nixfmt; - }; -}