Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into rfc101-style
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil committed Mar 13, 2024
2 parents d640e3d + 0c2fb12 commit 96a8ca8
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 385 deletions.
38 changes: 3 additions & 35 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,17 @@ on:
branches:
- master

env:
CDN_DISTRIBUTION_ID: E13UN1J1JFIWUZ
CDN_BUCKET: s3://nixfmt.serokell.io

jobs:
check:
runs-on: [self-hosted, nix]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26

- name: reuse lint
run: nix shell .#packages.x86_64-linux.reuse -c reuse lint

# - name: hlint
# run: nix build -L .#checks.x86_64-linux.hlint
# if: success() || failure()

# - name: stylish-haskell
# run: nix build -L .#checks.x86_64-linux.stylish-haskell
# if: success() || failure()

- name: build nixfmt
run: nix build -L .#nixfmt-static
if: success() || failure()

- name: build webdemo
run: nix build -L .#nixfmt-webdemo
if: success() || failure()

- name: build awscli
run: nix shell .#awscli
if: success() || failure()

deploy:
runs-on: [self-hosted, nix]
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v4

- name: deploy webdemo
run: |
nix build .#nixfmt-webdemo
nix shell .#awscli -c aws s3 cp --recursive result/ "$CDN_BUCKET"
# delete files that don't exist anymore, use `--size-only` so behavior won't depend on local file timestamps
nix shell .#awscli -c aws s3 sync --delete --size-only result/ "$CDN_BUCKET"
nix shell .#awscli -c aws cloudfront create-invalidation --distribution-id "$CDN_DISTRIBUTION_ID" --paths '/*'
17 changes: 0 additions & 17 deletions flake.lock

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

31 changes: 2 additions & 29 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05";

flake-utils.url = "github:numtide/flake-utils";

Expand All @@ -22,7 +21,7 @@
};
};

outputs = { self, nixpkgs, nixpkgs-stable, flake-utils, serokell-nix, ... }:
outputs = { self, nixpkgs, flake-utils, serokell-nix, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlay = self: super: {
Expand All @@ -38,26 +37,8 @@
overlays = [ overlay serokell-nix.overlay ];
};

pkgs-stable = import nixpkgs-stable {
inherit system;
overlays = [ overlay ];
};

inherit (pkgs) haskell lib;

ghcjsPackages = pkgs-stable.haskell.packages.ghcjs810.override (old: {
overrides = (self: super: {
QuickCheck = haskell.lib.dontCheck super.QuickCheck;
tasty-quickcheck = haskell.lib.dontCheck super.tasty-quickcheck;
scientific = haskell.lib.dontCheck super.scientific;
temporary = haskell.lib.dontCheck super.temporary;
time-compat = haskell.lib.dontCheck super.time-compat;
text-short = haskell.lib.dontCheck super.text-short;
vector = haskell.lib.dontCheck super.vector;
aeson = super.aeson_1_5_6_0;
});
});

regexes =
[ ".*.cabal$" "^src.*" "^main.*" "^Setup.hs$" "^js.*" "LICENSE" ];
src = builtins.path {
Expand All @@ -74,14 +55,6 @@
nixfmt = pkgs.haskellPackages.nixfmt;
nixfmt-static = haskell.lib.justStaticExecutables nixfmt;
nixfmt-deriver = nixfmt-static.cabal2nixDeriver;
nixfmt-js = ghcjsPackages.callCabal2nix "nixfmt" src { };
nixfmt-webdemo = pkgs.runCommandNoCC "nixfmt-webdemo" { } ''
mkdir $out
cp ${./js/index.html} $out/index.html
cp ${./js/404.html} $out/404.html
cp ${nixfmt-js}/bin/js-interface.jsexe/{rts,lib,out,runmain}.js $out
substituteInPlace $out/index.html --replace ../dist/build/js-interface/js-interface.jsexe/ ./
'';

nixfmt-shell = nixfmt.env.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs ++ (with pkgs; [
Expand All @@ -92,7 +65,7 @@
]);
});

inherit (pkgs) awscli reuse;
inherit (pkgs) reuse;
};

apps.default = {
Expand Down
7 changes: 0 additions & 7 deletions js/404.html

This file was deleted.

37 changes: 0 additions & 37 deletions js/JSInterface.hs

This file was deleted.

Loading

0 comments on commit 96a8ca8

Please sign in to comment.