Skip to content

Commit

Permalink
fix: update flakes
Browse files Browse the repository at this point in the history
  • Loading branch information
deemp committed Sep 24, 2023
1 parent ca3a387 commit 104f2c1
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 113 deletions.
49 changes: 18 additions & 31 deletions back/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,11 @@

inputs = { };

outputs =
inputs:
let
inputs_ =
let flakes = (import ../.).outputs.inputs.flakes; in
{
inherit (flakes.source-flake) flake-utils nixpkgs;
inherit (flakes) drv-tools devshell codium;
haskell-tools = flakes.language-tools.haskell;
};

outputs = outputs_ { } // { inputs = inputs_; outputs = outputs_; };

outputs_ =
inputs__:
let inputs = inputs_ // inputs__; in
inputs.flake-utils.lib.eachDefaultSystem (system:
outputs = inputs:
let flakes = (import ../.).outputs.inputs.flakes; in
flakes.makeFlake {
inputs = { inherit (flakes.all) flake-utils nixpkgs drv-tools devshell codium haskell-tools; };
perSystem = { inputs, system }:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
inherit (inputs.codium.lib.${system}) writeSettingsJSON mkCodium;
Expand All @@ -29,18 +17,17 @@
inherit (inputs.codium.lib.${system}) extensions settingsNix extensionsCommon settingsCommonNix;

packageName = "try-phi-back";
override =
{
overrides = self: super: {
eo-utils = self.callCabal2nix "eo-utils" ./eo-utils { };
phi-utils = self.callCabal2nix "phi-utils" ./phi-utils { };
language-utils = self.callCabal2nix "language-utils" ./language-utils { inherit (self) phi-utils eo-utils; };
"${packageName}" =
pkgs.haskell.lib.overrideCabal
(self.callCabal2nix packageName ./${packageName} { inherit (self) language-utils phi-utils eo-utils; })
(x: { librarySystemDepends = [ pkgs.zlib ] ++ (x.librarySystemDepends or [ ]); });
};
override = {
overrides = self: super: {
eo-utils = self.callCabal2nix "eo-utils" ./eo-utils { };
phi-utils = self.callCabal2nix "phi-utils" ./phi-utils { };
language-utils = self.callCabal2nix "language-utils" ./language-utils { inherit (self) phi-utils eo-utils; };
"${packageName}" =
pkgs.haskell.lib.overrideCabal
(self.callCabal2nix packageName ./${packageName} { inherit (self) language-utils phi-utils eo-utils; })
(x: { librarySystemDepends = [ pkgs.zlib ] ++ (x.librarySystemDepends or [ ]); });
};
};

inherit (toolsGHC {
version = "928";
Expand Down Expand Up @@ -138,9 +125,9 @@
inherit packages devShells;

image = backImage;
});
in
outputs;
};
};


nixConfig = {
extra-substituters = [
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 46 additions & 58 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,70 +1,58 @@
{
inputs.flakes.url = "github:deemp/flakes";

outputs =
inputs:
let
inputs_ =
let flakes = inputs.flakes.flakes; in
{
inherit (flakes.source-flake) flake-utils nixpkgs;
inherit (flakes) drv-tools flakes-tools workflows devshell codium;
inherit flakes;
};

outputs = outputs_ { } // { inputs = inputs_; outputs = outputs_; };

outputs_ =
inputs__:
let inputs = inputs_ // inputs__; in
inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
inherit (inputs.codium.lib.${system}) writeSettingsJSON mkCodium;
inherit (inputs.drv-tools.lib.${system}) mkShellApps getExe;
inherit (inputs.flakes-tools.lib.${system}) mkFlakesTools;
inherit (inputs.codium.lib.${system}) extensions settingsNixCommon extensionsCommon;
inherit (inputs.devshell.lib.${system}) mkShell mkRunCommands;
outputs = inputs: inputs.flakes.makeFlake {
inputs = {
inherit (inputs.flakes.all) flake-utils nixpkgs drv-tools flakes-tools workflows devshell codium;
inherit (inputs) flakes;
};
perSystem = { inputs, system }:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
inherit (inputs.codium.lib.${system}) writeSettingsJSON mkCodium;
inherit (inputs.drv-tools.lib.${system}) mkShellApps getExe;
inherit (inputs.flakes-tools.lib.${system}) mkFlakesTools;
inherit (inputs.codium.lib.${system}) extensions settingsNixCommon extensionsCommon;
inherit (inputs.devshell.lib.${system}) mkShell mkRunCommands;

backDir = "back";
frontDir = "front";
scripts = mkShellApps {
back = {
text = "cd ${backDir} && nix run";
description = "Run backend";
};
front = {
text = "cd ${frontDir} && nix run";
description = "Run frontend";
};
backDir = "back";
frontDir = "front";
scripts = mkShellApps {
back = {
text = "cd ${backDir} && nix run";
description = "Run backend";
};
front = {
text = "cd ${frontDir} && nix run";
description = "Run frontend";
};
};

packages = {
inherit (mkFlakesTools { dirs = [ "front" "back" "." ]; root = ./.; }) pushToCachix updateLocks;

writeSettings = writeSettingsJSON settingsNixCommon;
codium = mkCodium { extensions = extensionsCommon; };
packages = {
inherit (mkFlakesTools { dirs = [ "front" "back" "." ]; root = ./.; }) pushToCachix updateLocks;

writeWorkflows = import ./nix-files/workflow.nix {
name = "ci";
inherit backDir frontDir system;
inherit (inputs) workflows;
};
} // scripts;
writeSettings = writeSettingsJSON settingsNixCommon;
codium = mkCodium { extensions = extensionsCommon; };

devShells.default = mkShell {
commands =
mkRunCommands "ide" { "codium ." = packages.codium; inherit (packages) writeSettings; }
++ mkRunCommands "infra" { inherit (packages) writeWorkflows pushToCachix updateLocks; }
++ mkRunCommands "project" { inherit (packages) back front; }
;
writeWorkflows = import ./nix-files/workflow.nix {
name = "ci";
inherit backDir frontDir system;
inherit (inputs) workflows;
};
in
{
inherit packages devShells;
});
in
outputs;
} // scripts;

devShells.default = mkShell {
commands =
mkRunCommands "ide" { "codium ." = packages.codium; inherit (packages) writeSettings; }
++ mkRunCommands "infra" { inherit (packages) writeWorkflows pushToCachix updateLocks; }
++ mkRunCommands "project" { inherit (packages) back front; }
;
};
in
{
inherit packages devShells;
};
};

nixConfig = {
extra-substituters = [
Expand Down
28 changes: 7 additions & 21 deletions front/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,11 @@

inputs = { };

outputs =
inputs:
let
inputs_ =
let flakes = (import ../.).outputs.inputs.flakes; in
{
inherit (flakes.source-flake) flake-utils nixpkgs;
inherit (flakes) drv-tools devshell codium;
purescript-tools = flakes.language-tools.purescript;
};

outputs = outputs_ { } // { inputs = inputs_; outputs = outputs_; };

outputs_ =
inputs__:
let inputs = inputs_ // inputs__; in

inputs.flake-utils.lib.eachDefaultSystem (system:
outputs = inputs:
let flakes = (import ../.).outputs.inputs.flakes; in
flakes.makeFlake {
inputs = { inherit (flakes.all) flake-utils nixpkgs drv-tools devshell codium purescript-tools; };
perSystem = { inputs, system }:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
pursPkgs = inputs.purescript-tools.packages.${system};
Expand Down Expand Up @@ -67,9 +54,8 @@
in
{
inherit packages devShells;
});
in
outputs;
};
};

nixConfig = {
extra-substituters = [
Expand Down

1 comment on commit 104f2c1

@0pdd
Copy link

@0pdd 0pdd commented on 104f2c1 Sep 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to retrieve PDD puzzles from the code base and submit them to github. If you think that it's a bug on our side, please submit it to yegor256/0pdd:

set -x && set -e && set -o pipefail && cd /tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0 && pdd -v -f /tmp/20230924-103487-24gne9 [1]: + set -e + set -o pipefail + cd /tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0 + pdd -v -f...

Please, copy and paste this stack trace to GitHub:

UserError
set -x && set -e && set -o pipefail && cd /tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0 && pdd -v -f /tmp/20230924-103487-24gne9 [1]:
+ set -e
+ set -o pipefail
+ cd /tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0
+ pdd -v -f /tmp/20230924-103487-24gne9

My version is 0.23.2
Ruby version is 3.1.4 at x86_64-linux
Reading from root dir /tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/back/flake.lock is a binary file (70 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/editors/eo/README/dialect 1.png is a binary file (53554 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/editors/eo/README/dialect 2.png is a binary file (49368 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/editors/eo/README/eo  1.png is a binary file (55400 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/editors/eo/README/eo 2.png is a binary file (44144 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/editors/eo/docs/assets/gh.png is a binary file (4268 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/editors/eo/package-lock.json is a binary file (271791 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/editors/eo/package.json is a binary file (1044 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/editors/phi/docs/assets/gh.png is a binary file (4268 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/editors/phi/package-lock.json is a binary file (271793 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/editors/phi/package.json is a binary file (1045 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/flake.lock is a binary file (529 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/front/flake.lock is a binary file (70 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/front/package.json is a binary file (994 bytes)
/tmp/0pdd20230924-14-lhc4o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L3RyeS1waGkuZ2l0/renovate.json is a binary file (107 bytes)
Reading .envrc ...
Reading .github/workflows/ci.yaml ...
Reading .gitignore ...
Reading README.md ...
Reading back/.dockerignore ...
Reading back/.envrc ...
Reading back/.ghci ...
Reading back/.ghcid ...
Reading back/.gitignore ...
Reading back/Dockerfile ...
Reading back/LICENSE ...
Reading back/README.md ...
Reading back/Setup.hs ...
Reading back/cabal.project ...
Reading back/default.nix ...
Reading back/eo-utils/.ghci ...
Reading back/eo-utils/.ghcid ...
Reading back/eo-utils/.gitignore ...
Reading back/eo-utils/ChangeLog.md ...
Reading back/eo-utils/LICENSE ...
Reading back/eo-utils/README.md ...
Reading back/eo-utils/Setup.hs ...
Reading back/eo-utils/app/Main.hs ...
Reading back/eo-utils/eo-utils.cabal ...
Reading back/eo-utils/grammars/eo.g4 ...
Reading back/eo-utils/grammars/eo_fixed.g4 ...
Reading back/eo-utils/grammars/full-syntax.eo ...
Reading back/eo-utils/grammars/snippet.eo ...
Reading back/eo-utils/package.yaml ...
Reading back/eo-utils/src/EOParser.hs ...
Reading back/eo-utils/src/EnumerateNodes.hs ...
ERROR: ERROR: back/eo-utils/src/EnumerateNodes.hs; PDD::Error at back/eo-utils/src/EnumerateNodes.hs:215: TODO found, but puzzle can't be parsed, most probably because TODO is not followed by a puzzle marker, as this page explains: https://github.com/cqfn/pdd#how-to-format
If you can't understand the cause of this issue or you don't know how to fix it, please submit a GitHub issue, we will try to help you: https://github.com/cqfn/pdd/issues. This tool is still in its beta version and we will appreciate your feedback. Here is where you can find more documentation: https://github.com/cqfn/pdd/blob/master/README.md.
Exit code is 1

/app/objects/git_repo.rb:73:in `rescue in block in xml'
/app/objects/git_repo.rb:70:in `block in xml'
/app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tempfile.rb:317:in `open'
/app/objects/git_repo.rb:69:in `xml'
/app/objects/puzzles.rb:41:in `deploy'
/app/objects/jobs/job.rb:38:in `proceed'
/app/objects/jobs/job_starred.rb:32:in `proceed'
/app/objects/jobs/job_recorded.rb:31:in `proceed'
/app/objects/jobs/job_emailed.rb:33:in `proceed'
/app/objects/jobs/job_commiterrors.rb:33:in `proceed'
/app/objects/jobs/job_detached.rb:48:in `exclusive'
/app/objects/jobs/job_detached.rb:36:in `block in proceed'
/app/objects/jobs/job_detached.rb:36:in `fork'
/app/objects/jobs/job_detached.rb:36:in `proceed'
/app/0pdd.rb:531:in `process_request'
/app/0pdd.rb:367:in `block in <top (required)>'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1706:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1706:in `block in compile!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1019:in `block (3 levels) in route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1037:in `route_eval'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1019:in `block (2 levels) in route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1068:in `block in process_route'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1066:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1066:in `process_route'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1017:in `block in route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1014:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1014:in `route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1138:in `block in dispatch!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1109:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1109:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1133:in `dispatch!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:949:in `block in call!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1109:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1109:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:949:in `call!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:938:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/deflater.rb:44:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.6/lib/rack/protection/xss_header.rb:20:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.6/lib/rack/protection/path_traversal.rb:18:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.6/lib/rack/protection/json_csrf.rb:28:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.6/lib/rack/protection/base.rb:53:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.6/lib/rack/protection/base.rb:53:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.6/lib/rack/protection/frame_options.rb:33:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/logger.rb:17:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/common_logger.rb:38:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:261:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:254:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/head.rb:12:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/method_override.rb:24:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:219:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:2018:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1576:in `block in call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1792:in `synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1576:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/handler/webrick.rb:95:in `service'
/app/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:140:in `service'
/app/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:96:in `run'
/app/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/server.rb:310:in `block in start_thread'

Please sign in to comment.