From d31ece1c757e9f47305447da134bad64207f6e1e Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Mon, 24 Oct 2022 09:48:30 -0600 Subject: [PATCH] nix: add flake with dev shell --- .editorconfig | 12 +++++++----- .gitignore | 1 + flake.lock | 43 +++++++++++++++++++++++++++++++++++++++++++ flake.nix | 22 ++++++++++++++++++++++ shell.nix | 17 +++++++++++++++++ 5 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 shell.nix diff --git a/.editorconfig b/.editorconfig index c70b7be22..a04147116 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,15 +1,17 @@ root = true [*] -end_of_line = lf -insert_final_newline = true indent_style = space indent_size = 4 +tab_width = 4 +end_of_line = lf charset = utf-8 trim_trailing_whitespace = true - -[*.yml] -indent_size = 2 +insert_final_newline = true [*.md] trim_trailing_whitespace = false + +[*.{md,nix,yml,yaml}] +indent_size = 2 +tab_width = 2 diff --git a/.gitignore b/.gitignore index cf911a1de..4b5d02246 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ storage/framework/* /.idea /nbproject +/.direnv node_modules *.log diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..4a64ac964 --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1666539104, + "narHash": "sha256-jeuC+d375wHHxMOFLgu7etseCQVJuPNKoEc9X9CsErg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0e6df35f39651504249a05191f9a78d251707e22", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..050cc2415 --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + description = "Pterodactyl Panel"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + self, + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = import nixpkgs {inherit system;}; + in { + devShell = import ./shell.nix {inherit pkgs;}; + } + ); +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000..afe21af5e --- /dev/null +++ b/shell.nix @@ -0,0 +1,17 @@ +{pkgs ? import {}}: +with pkgs; + mkShell rec { + buildInputs = [ + alejandra + (php81.buildEnv { + extensions = ({ enabled, all }: enabled ++ (with all; [ + redis + xdebug + ])); + extraConfig = '' + xdebug.mode=debug + ''; + }) + php81Packages.composer + ]; + }