rails_edge_test 2.1.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/flake.nix ADDED
@@ -0,0 +1,94 @@
1
+ {
2
+ description = "dev env for rails_edge_test";
3
+
4
+ nixConfig = {
5
+ extra-substituters = "https://nixpkgs-ruby.cachix.org";
6
+ extra-trusted-public-keys = "nixpkgs-ruby.cachix.org-1:vrcdi50fTolOxWCZZkw0jakOnUI1T19oYJ+PRYdK4SM=";
7
+ };
8
+
9
+ inputs = {
10
+ nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
11
+ ruby-nix.url = "github:inscapist/ruby-nix";
12
+ # a fork that supports platform dependant gem
13
+ bundix = {
14
+ url = "github:inscapist/bundix/main";
15
+ inputs.nixpkgs.follows = "nixpkgs";
16
+ };
17
+ fu.url = "github:numtide/flake-utils";
18
+ };
19
+
20
+ outputs =
21
+ {
22
+ self,
23
+ nixpkgs,
24
+ fu,
25
+ ruby-nix,
26
+ bundix,
27
+ }:
28
+ with fu.lib;
29
+ eachDefaultSystem (
30
+ system:
31
+ let
32
+ assertVersion =
33
+ version: pkg:
34
+ (
35
+ assert (
36
+ pkgs.lib.assertMsg (builtins.toString pkg.version == version) ''
37
+ Expecting version of ${pkg.name} to be ${version} (this may be in .ruby-version) but got ${pkg.version};
38
+ ''
39
+ );
40
+ pkg
41
+ );
42
+
43
+ pkgs = import nixpkgs { inherit system; };
44
+ rubyNix = ruby-nix.lib pkgs;
45
+
46
+ gemset = if builtins.pathExists ./gemset.nix then import ./gemset.nix else { };
47
+
48
+ # If you want to override gem build config, see
49
+ # https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/ruby-modules/gem-config/default.nix
50
+ gemConfig = { };
51
+
52
+ ruby = (assertVersion (pkgs.lib.strings.fileContents "${self}/.ruby-version") pkgs.ruby_3_2);
53
+
54
+ # Running bundix regenerate `gemset.nix`
55
+ bundixcli = bundix.packages.${system}.default;
56
+
57
+ # Use these instead of the original `bundle <mutate>` commands
58
+ bundleLock = pkgs.writeShellScriptBin "bundle-lock" ''
59
+ export BUNDLE_PATH=vendor/bundle
60
+ bundle lock
61
+ '';
62
+ bundleUpdate = pkgs.writeShellScriptBin "bundle-update" ''
63
+ export BUNDLE_PATH=vendor/bundle
64
+ bundle lock --update
65
+ '';
66
+ in
67
+ rec {
68
+ inherit
69
+ (rubyNix {
70
+ inherit gemset ruby;
71
+ name = "rails_edge_test";
72
+ gemConfig = pkgs.defaultGemConfig // gemConfig;
73
+ })
74
+ env
75
+ ;
76
+
77
+ formatter = pkgs.nixfmt-rfc-style;
78
+ devShells = rec {
79
+ default = dev;
80
+ dev = pkgs.mkShell {
81
+ buildInputs = (
82
+ (with pkgs; [ sqlite ])
83
+ ++ [
84
+ env
85
+ bundixcli
86
+ bundleLock
87
+ bundleUpdate
88
+ ]
89
+ );
90
+ };
91
+ };
92
+ }
93
+ );
94
+ }