From 6b720901762bcb448ec8f8692f386fb3d4cacb71 Mon Sep 17 00:00:00 2001 From: Sagar <93700292+syntacticsagar@users.noreply.github.com> Date: Sun, 7 Apr 2024 10:13:35 +0100 Subject: [PATCH 1/2] Initial nix --- .envrc | 2 ++ flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 39 ++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 00000000000..82aad79ecf5 --- /dev/null +++ b/.envrc @@ -0,0 +1,2 @@ +# .envrc +use flake diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000000..c8aedb699ae --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1712192574, + "narHash": "sha256-LbbVOliJKTF4Zl2b9salumvdMXuQBr2kuKP5+ZwbYq4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f480f9d09e4b4cf87ee6151eba068197125714de", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000000..5cb3f393353 --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "The Open Food Network is an online marketplace for local food."; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + flake-utils = { + url = "github:numtide/flake-utils"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, flake-utils }: + let + systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; + outputs = flake-utils.lib.eachSystem systems (system: let + pkgs = nixpkgs.legacyPackages.${system}; + in rec { + devShells.default = pkgs.mkShell { + buildInputs = [ + pkgs.ruby + pkgs.bundler + pkgs.postgresql_16_jit + pkgs.nodejs_21 + pkgs.redis + pkgs.shared-mime-info + pkgs.libyaml + pkgs.yarn + ] ; + shellHook = pkgs.lib.optionalString pkgs.stdenv.isDarwin '' + export CPATH=$(xcrun --sdk macosx --show-sdk-path)/usr/include + + ''; + }; + }); + in outputs // {}; + + nixConfig = {}; +} From c987ce78c01148cf952bf801e92b124310ed2730 Mon Sep 17 00:00:00 2001 From: Sagar <93700292+syntacticsagar@users.noreply.github.com> Date: Mon, 15 Apr 2024 20:54:09 +0100 Subject: [PATCH 2/2] Adds packwerk --- Gemfile | 2 ++ Gemfile.lock | 23 +++++++++++++++++++++++ flake.nix | 8 +++++--- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 94f0e62398e..35dfa10e191 100644 --- a/Gemfile +++ b/Gemfile @@ -34,6 +34,8 @@ gem "mime-types" # required by fog gem "validates_lengths_from_database" gem "valid_email2" +gem 'packwerk' + gem "catalog", path: "./engines/catalog" gem 'dfc_provider', path: './engines/dfc_provider' gem "order_management", path: "./engines/order_management" diff --git a/Gemfile.lock b/Gemfile.lock index 205621294a4..2c50622ffca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -182,6 +182,13 @@ GEM base64 (0.2.0) bcp47_spec (0.2.1) bcrypt (3.1.20) + better_html (2.1.1) + actionview (>= 6.0) + activesupport (>= 6.0) + ast (~> 2.0) + erubi (~> 1.4) + parser (>= 2.4) + smart_properties bigdecimal (3.0.2) bindata (2.5.0) bindex (0.8.1) @@ -232,6 +239,7 @@ GEM ruby-rc4 (>= 0.1.5) concurrent-ruby (1.2.3) connection_pool (2.4.1) + constant_resolver (0.2.0) crack (1.0.0) bigdecimal rexml @@ -486,6 +494,17 @@ GEM validate_url webfinger (~> 2.0) orm_adapter (0.5.0) + packwerk (3.2.0) + activesupport (>= 6.0) + ast + better_html + bundler + constant_resolver (>= 0.2.0) + parallel + parser + prism (>= 0.24.0) + sorbet-runtime (>= 0.5.9914) + zeitwerk (>= 2.6.1) pagy (5.10.1) activesupport paper_trail (15.1.0) @@ -509,6 +528,7 @@ GEM ruby-rc4 ttfunk pg (1.2.3) + prism (0.25.0) private_address_check (0.5.0) pry (0.13.1) coderay (~> 1.1) @@ -734,6 +754,8 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + smart_properties (1.17.0) + sorbet-runtime (0.5.11346) spreadsheet_architect (5.0.0) caxlsx (>= 3.3.0, < 4) rodf (>= 1.0.0, < 2) @@ -926,6 +948,7 @@ DEPENDENCIES omniauth_openid_connect openid_connect order_management! + packwerk pagy (~> 5.1) paper_trail paranoia (~> 2.4) diff --git a/flake.nix b/flake.nix index 5cb3f393353..1019d17d88e 100644 --- a/flake.nix +++ b/flake.nix @@ -20,17 +20,19 @@ buildInputs = [ pkgs.ruby pkgs.bundler + pkgs.gcc pkgs.postgresql_16_jit pkgs.nodejs_21 pkgs.redis + pkgs.rubyPackages.prism pkgs.shared-mime-info pkgs.libyaml pkgs.yarn ] ; - shellHook = pkgs.lib.optionalString pkgs.stdenv.isDarwin '' - export CPATH=$(xcrun --sdk macosx --show-sdk-path)/usr/include + # shellHook = pkgs.lib.optionalString pkgs.stdenv.isDarwin '' + # export CPATH=$(xcrun --sdk macosx --show-sdk-path)/usr/include - ''; + # ''; }; }); in outputs // {};