diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2023-09-01 00:00:00 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2023-09-13 09:24:49 +0000 |
| commit | 6423baebd92e45c9be85157c443dff42e65d8d14 (patch) | |
| tree | 6548edfd80d0cd9d1267378ebe816ec95e394137 /flake.nix | |
| parent | 5c5feaa732363e32e2a980a887fa42b4394b1a5e (diff) | |
refactor: rebuild app skeleton
Create skeleton for a complete rebuild of the prototype as a production
ready product.
Includes design patterns for:
- dependency injection
- unit testing with dependency mocking
- integration testing
- error handling
- config storage
BREAKING-CHANGE: ground-up redesign with incompatible protocol standards
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7c36e2d --- /dev/null +++ b/flake.nix | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | { | ||
| 2 | inputs = { | ||
| 3 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
| 4 | rust-overlay.url = "github:oxalica/rust-overlay"; | ||
| 5 | flake-utils.url = "github:numtide/flake-utils"; | ||
| 6 | }; | ||
| 7 | |||
| 8 | outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: | ||
| 9 | flake-utils.lib.eachDefaultSystem (system: | ||
| 10 | let | ||
| 11 | overlays = [ (import rust-overlay) ]; | ||
| 12 | pkgs = import nixpkgs { | ||
| 13 | inherit system overlays; | ||
| 14 | }; | ||
| 15 | in | ||
| 16 | with pkgs; | ||
| 17 | { | ||
| 18 | devShells.default = mkShell { | ||
| 19 | |||
| 20 | nativeBuildInputs = [ | ||
| 21 | # stable to be introduced when the following issue is resolved | ||
| 22 | # https://github.com/oxalica/rust-overlay/issues/136 | ||
| 23 | # rust-bin.stable.latest.default | ||
| 24 | # nightly for rustfmt | ||
| 25 | ( | ||
| 26 | rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override { | ||
| 27 | extensions = [ | ||
| 28 | "rust-src" | ||
| 29 | "rustfmt" | ||
| 30 | "clippy" | ||
| 31 | ]; | ||
| 32 | }) | ||
| 33 | ) | ||
| 34 | ]; | ||
| 35 | |||
| 36 | buildInputs = [ | ||
| 37 | rust-analyzer | ||
| 38 | gitlint | ||
| 39 | ]; | ||
| 40 | shellHook = '' | ||
| 41 | # auto-install git hooks | ||
| 42 | dot_git="$(git rev-parse --git-common-dir)" | ||
| 43 | if [[ ! -d "$dot_git/hooks" ]]; then mkdir "$dot_git/hooks"; fi | ||
| 44 | for hook in git_hooks/* ; do ln -sf "$(pwd)/$hook" "$dot_git/hooks/" ; done | ||
| 45 | |||
| 46 | # For rust-analyzer 'hover' tooltips to work. | ||
| 47 | export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc} | ||
| 48 | ''; | ||
| 49 | }; | ||
| 50 | } | ||
| 51 | ); | ||
| 52 | } | ||