diff --git a/.gitignore b/.gitignore index bcd1508..e2f8d96 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,6 @@ yarn-debug.log* .yarn-integrity # ignore environment variables -.env \ No newline at end of file +.env +vendor/ +result \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index e08a0ff..33a4bfc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -107,7 +107,7 @@ GEM listen (3.7.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.12.0) + loofah (2.13.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) @@ -116,12 +116,12 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_mime (1.1.2) + mini_portile2 (2.6.1) minitest (5.14.4) msgpack (1.4.2) nio4r (2.5.8) nokogiri (1.12.5) - racc (~> 1.4) - nokogiri (1.12.5-x86_64-linux) + mini_portile2 (~> 2.6.1) racc (~> 1.4) orm_adapter (0.5.0) pg (1.2.3) @@ -194,7 +194,7 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2) semantic_range (3.0.0) - spring (3.1.1) + spring (4.0.0) sprockets (4.0.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -234,7 +234,6 @@ GEM PLATFORMS ruby - x86_64-linux DEPENDENCIES bootsnap (>= 1.4.4) @@ -264,4 +263,4 @@ RUBY VERSION ruby 3.0.2p107 BUNDLED WITH - 2.2.31 + 2.2.33 diff --git a/config/database.yml b/config/database.yml index 0fafb55..8fa22ed 100644 --- a/config/database.yml +++ b/config/database.yml @@ -37,11 +37,11 @@ development: # Connect on a TCP socket. Omitted by default since the client uses a # domain socket that doesn't need configuration. Windows does not have # domain sockets, so uncomment these lines. - #host: localhost + host: localhost # The TCP port the server listens on. Defaults to 5432. # If your server runs on a different port number, change accordingly. - #port: 5432 + port: 5432 # Schema search path. The server defaults to $user,public #schema_search_path: myapp,sharedapp,public @@ -59,6 +59,8 @@ test: <<: *default database: janus_test username: postgres + host: localhost + port: 5432 # As with config/credentials.yml, you never want to store sensitive information, # like your database password, in your source code. If your source code is diff --git a/default.nix b/default.nix index 402f610..91970a8 100644 --- a/default.nix +++ b/default.nix @@ -1,13 +1,17 @@ -{stdenv, bundlerEnv, ruby_3_0}: +{pkgs ? import {}}: +with pkgs; let + ruby = ruby_3_0; gems = bundlerEnv { name = "env"; - inherit ruby_3_0; - gemdir = ./.; + inherit ruby; + gemfile = ./Gemfile; + lockfile = ./Gemfile.lock; + gemset = import ./gemset.nix; }; in stdenv.mkDerivation { name = "janus"; src = ./.; - buildInputs = [gems ruby_3_0]; + buildInputs = [gems gems.wrappedRuby yarn]; } diff --git a/fuck.nix b/fuck.nix deleted file mode 100644 index 954056f..0000000 --- a/fuck.nix +++ /dev/null @@ -1,24 +0,0 @@ -{pkgs ? import {}}: -with pkgs; -let - ruby = ruby_3_0; - rubyEnv = bundlerEnv { - name = "project-bundler-env"; - inherit ruby; - gemdir = ./.; - gemfile = ./Gemfile; - lockfile = ./Gemfile.lock; - gemset = ./gemset.nix; - }; -in - mkShell { - nativeBuildInputs = [ - #rubyPackages_3_0.nokogiri - ]; - buildInputs = [ - #rubyPackages_3_0.nokogiri - rubyEnv - rubyEnv.wrappedRuby - yarn - ]; - } diff --git a/gemset.nix b/gemset.nix index d0bb02a..596edf9 100644 --- a/gemset.nix +++ b/gemset.nix @@ -374,10 +374,10 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "1nqcya57x2n58y1dify60i0dpla40n4yir928khp4nj5jrn9mgmw"; + sha256 = "17rvbrqcci1579d7dpbsfmz1f9g7msk82lyh9ip5h29dkrnixcgg"; type = "gem"; }; - version = "2.12.0"; + version = "2.13.0"; }; mail = { dependencies = ["mini_mime"]; @@ -430,6 +430,16 @@ }; version = "1.1.2"; }; + mini_portile2 = { + groups = ["default" "development" "test"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1lvxm91hi0pabnkkg47wh1siv56s6slm2mdq1idfm86dyfidfprq"; + type = "gem"; + }; + version = "2.6.1"; + }; minitest = { groups = ["default" "development" "test"]; platforms = []; @@ -461,7 +471,7 @@ version = "2.5.8"; }; nokogiri = { - dependencies = ["racc"]; + dependencies = ["mini_portile2" "racc"]; groups = ["default" "development" "test"]; platforms = []; source = { @@ -761,10 +771,10 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "0w0v6fyic3a4vq1imzcp0x4b3cgbm1gi7jn7qma9768zaqmxv8gw"; + sha256 = "1ihmqcqylfx04bigg0fswmlvp0639f1j47kdir4g9lc76yw3c6ia"; type = "gem"; }; - version = "3.1.1"; + version = "4.0.0"; }; sprockets = { dependencies = ["concurrent-ruby" "rack"]; diff --git a/lock.sh b/lock.sh new file mode 100755 index 0000000..48294b4 --- /dev/null +++ b/lock.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p ruby_3_0 bundler bundix + +rm -f gemset.nix Gemfile.lock +BUNDLE_FORCE_RUBY_PLATFORM=1 bundle lock +bundix --ruby=ruby_3_0 \ No newline at end of file diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 9e9b203..0000000 --- a/shell.nix +++ /dev/null @@ -1,13 +0,0 @@ -with import {}; - -stdenv.mkDerivation { - name = "env"; - buildInputs = [ - ruby_3_0.devEnv - libxml2 - libxslt - zlib - bundix - gnumake - ]; -}