diff --git a/flake.lock b/flake.lock index 9b948906..a207da7d 100644 --- a/flake.lock +++ b/flake.lock @@ -853,22 +853,6 @@ "type": "github" } }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1696039360, - "narHash": "sha256-g7nIUV4uq1TOVeVIDEZLb005suTWCUjSY0zYOlSBsyE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "32dcb45f66c0487e92db8303a798ebc548cadedc", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-unstable": { "locked": { "lastModified": 1675758091, @@ -1016,7 +1000,6 @@ "flake-compat": "flake-compat", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", - "nixpkgs-stable": "nixpkgs-stable", "serokell-nix": "serokell-nix" } }, @@ -1111,6 +1094,21 @@ "type": "github" } }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tullia": { "inputs": { "nix-nomad": "nix-nomad", @@ -1189,21 +1187,6 @@ "repo": "yants", "type": "github" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 8e4dca6b..11fe0661 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; @@ -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: { @@ -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 { @@ -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; [ @@ -91,7 +64,7 @@ ]); }); - inherit (pkgs) awscli reuse; + inherit (pkgs) reuse; }; apps.default = { diff --git a/js/404.html b/js/404.html deleted file mode 100644 index 31fab38e..00000000 --- a/js/404.html +++ /dev/null @@ -1,7 +0,0 @@ - - -404 Page Not Found diff --git a/js/JSInterface.hs b/js/JSInterface.hs deleted file mode 100644 index dc1bb895..00000000 --- a/js/JSInterface.hs +++ /dev/null @@ -1,37 +0,0 @@ -{- © 2019 Serokell - - - - SPDX-License-Identifier: MPL-2.0 - -} - -{-# LANGUAGE OverloadedStrings #-} -import GHCJS.Marshal -import GHCJS.Foreign -import GHCJS.Foreign.Callback -import GHCJS.Types -import JavaScript.Object -import qualified JavaScript.Object.Internal as O -import Data.JSString.Text -import qualified Data.JSString as S - -import Nixfmt - -foreign import javascript unsafe "window.nixfmt_ = $1" - js_set_logic :: JSVal -> IO () - -main :: IO () -main = do - callback <- syncCallback2 ThrowWouldBlock $ \text_ o -> do - let obj = O.Object o - Just width <- getProp (textToJSString "width") obj >>= fromJSVal - Just filename_ <- getProp (textToJSString "filename") obj >>= fromJSVal - let filename = S.unpack filename_ - let text = textFromJSVal text_ - out <- case format width filename text of - Left err -> do - setProp "err" (toJSBool True) obj - toJSVal $ S.pack err - Right out_ -> do - setProp "err" (toJSBool False) obj - toJSVal out_ - setProp "ret" out obj - js_set_logic $ jsval callback diff --git a/js/index.html b/js/index.html deleted file mode 100644 index 4bcbf42c..00000000 --- a/js/index.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - nixfmt online demo - - - - - - - - - - - - - - -
# nixfmt loading
-
xxx
- - Fork me on GitHub - - - diff --git a/nixfmt.cabal b/nixfmt.cabal index 832b28e3..61016937 100644 --- a/nixfmt.cabal +++ b/nixfmt.cabal @@ -36,10 +36,6 @@ executable nixfmt Paths_nixfmt other-extensions: DeriveDataTypeable hs-source-dirs: main - if impl(ghcjs) - buildable: False - else - buildable: True build-depends: base >= 4.12.0 && < 4.19 , cmdargs >= 0.10.20 && < 0.11 @@ -99,25 +95,3 @@ library -Wincomplete-uni-patterns -Wredundant-constraints -Wno-orphans - -executable js-interface - main-is: JSInterface.hs - - if impl(ghcjs) - buildable: True - ghc-options: - -Wall - -Wcompat - -Wincomplete-record-updates - -Wincomplete-uni-patterns - -Wredundant-constraints - -Wno-orphans - build-depends: - base >= 4.12.0 && < 4.19 - , ghcjs-base >= 0.2.0 && < 0.3 - , nixfmt - hs-source-dirs: js/ - else - buildable: False - - default-language: Haskell2010