Skip to content

Commit

Permalink
upd workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
deemp committed Jul 22, 2023
1 parent c00f3a4 commit ad57edc
Show file tree
Hide file tree
Showing 16 changed files with 397 additions and 425 deletions.
385 changes: 216 additions & 169 deletions .github/workflows/ci.yaml

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions app_purescript/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(import
(
let
lock = (builtins.fromJSON (builtins.readFile ../flake.lock)).nodes.flakes.locked;
in
(
import
"${fetchTarball {
url = "https://github.com/deemp/flakes/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
}}/source-flake"
).outputs.flake-compat.outPath
)
{ src = ./.; }
).defaultNix
6 changes: 3 additions & 3 deletions app_purescript/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
source ${./app.env}
npx parcel serve -p $PORT --host $HOST dev/index.html
'';
description = "run app";
description = "Run app";
};
test = {
# https://github.com/mozilla/geckodriver/releases/tag/v0.31.0
Expand All @@ -57,12 +57,12 @@
kill $parcel_pid || echo "test finished"
'';
runtimeInputs = tools ++ [ pkgs.poetry pkgs.geckodriver pkgs.firefox ];
description = "test app";
description = "Test app";
};
build = {
text = build;
runtimeInputs = tools;
description = "lint app";
description = "Build app";
};
};
devShells.default = mkShell {
Expand Down
15 changes: 15 additions & 0 deletions app_python/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(import
(
let
lock = (builtins.fromJSON (builtins.readFile ../flake.lock)).nodes.flakes.locked;
in
(
import
"${fetchTarball {
url = "https://github.com/deemp/flakes/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
}}/source-flake"
).outputs.flake-compat.outPath
)
{ src = ./.; }
).defaultNix
5 changes: 3 additions & 2 deletions app_python/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,16 @@
runtimeInputs = [ pkgs.poetry ];
};
};
in
{
devShells.default = mkShell {
packages = [ pkgs.poetry ];
bash.extra = activateVenv;
commands =
mkRunCommands "scripts" { inherit (packages) run-start test lint; }
++ mkCommands "tools" tools;
};
in
{
inherit packages devShells;
});
in
outputs;
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.

5 changes: 3 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
inherit (flakes) codium drv-tools devshell flakes-tools workflows env2json json2md;
python-tools = flakes.language-tools.python;
purescript-tools = flakes.language-tools.purescript;
app-python = import ./app_python;
app-purescript = import ./app_purescript;
app_python = import ./app_python;
app_purescript = import ./app_purescript;
inherit flakes;
};

Expand All @@ -27,6 +27,7 @@
in
{
inherit devShells packages;
formatter = inputs.formatter.${system};
});
in
outputs;
Expand Down
4 changes: 2 additions & 2 deletions nix-files/commands.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ pkgs, scripts, system, drv-tools }:
{ pkgs, scripts, system, inputs }:
let
inherit (import ./data.nix) dockerPorts langs commandNames serviceNames langPython langPurescript appName;
inherit (drv-tools.lib.${system}) mkShellApp mkBin mkShellApps;
inherit (inputs.drv-tools.lib.${system}) mkShellApp mkBin mkShellApps;

# we assume that the commands will start in the corresponding directories
mkCommands = lang:
Expand Down
16 changes: 4 additions & 12 deletions nix-files/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ inputs
, system
, root
,
}:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
Expand All @@ -13,20 +12,13 @@ let
inherit (import ./data.nix) appPurescript appPython langPurescript langPython;
inherit (builtins) map attrValues;

writeConfigs =
(import ./write-configs.nix
{
inherit (inputs) json2md env2json terrafix drv-tools workflows codium;
inherit system pkgs commands;
}
);
writeConfigs = import ./write-configs.nix { inherit system pkgs commands inputs; };

commands = import ./commands.nix {
inherit pkgs system;
inherit (inputs) drv-tools;
inherit pkgs system inputs;
scripts = {
${langPurescript} = inputs.app-purescript.scripts.${system};
${langPython} = inputs.app-python.scripts.${system};
${langPurescript} = inputs.${appPurescript}.scripts.${system};
${langPython} = inputs.${appPython}.scripts.${system};
};
};

Expand Down
12 changes: 3 additions & 9 deletions nix-files/docs.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{ pkgs, env2json, system }:
{ pkgs, inputs, system }:
let
inherit (import ./data.nix)
appName
langs
commandNames
taskNames
actionNames
;
inherit (import ./data.nix) appName langs commandNames taskNames actionNames;
runTask = task: "`Command palette` -> `Tasks: Run Task` -> `${task}`";
nixDevelop = command: "`${command}`";
link = title: source: "[${title}](${source})";
Expand Down Expand Up @@ -79,7 +73,7 @@ in
(
let
actionNames_ = actionNames.apps // { stop = "stop"; };
mkJSON = env2json.functions.${system}.mkJSON;
mkJSON = inputs.env2json.lib.${system}.mkJSON;
ports =
builtins.foldl' (a: b: a // b) { } (builtins.map
(lang:
Expand Down
Loading

0 comments on commit ad57edc

Please sign in to comment.