From a7952ae44865ac85af7a732646fd695a3ad3505f Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 27 Apr 2026 11:01:45 +0100 Subject: [PATCH 1/3] Drop flake stuff --- flake.lock | 61 ------------------------------------------------------ flake.nix | 32 ---------------------------- 2 files changed, 93 deletions(-) delete mode 100644 flake.lock delete mode 100644 flake.nix diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 36493e8..0000000 --- a/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1741037377, - "narHash": "sha256-SvtvVKHaUX4Owb+PasySwZsoc5VUeTf1px34BByiOxw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "02032da4af073d0f6110540c8677f16d4be0117f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "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", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index c850903..0000000 --- a/flake.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = nixpkgs.legacyPackages.${system}; - overlay = final: prev: { - hell = prev.callCabal2nix "hell" ./. { }; - }; - haskellPackages = pkgs.haskell.packages.ghc910.extend overlay; - in - { - # nix build - packages.default = haskellPackages.hell; - - # nix develop - devShells.default = haskellPackages.shellFor { - packages = p: [ p.hell ]; - buildInputs = with haskellPackages; [ - stack - cabal-install - haskell-language-server - pandoc-cli - ]; - }; - } - ); -} From 24a5e260ad2e7a1f2f08ce6c56a6931a2a869732 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 27 Apr 2026 11:12:23 +0100 Subject: [PATCH 2/3] flake.nix for static build on arm64/amd64 --- DIST | 11 +++---- flake.lock | 61 +++++++++++++++++++++++++++++++++++++++ flake.nix | 50 ++++++++++++++++++++++++++++++++ scripts/install-hell.hell | 2 -- scripts/static-build.hell | 37 ------------------------ scripts/static-build.sh | 4 +++ 6 files changed, 119 insertions(+), 46 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix delete mode 100644 scripts/install-hell.hell delete mode 100644 scripts/static-build.hell create mode 100755 scripts/static-build.sh diff --git a/DIST b/DIST index fcefcd1..984a68f 100644 --- a/DIST +++ b/DIST @@ -1,9 +1,6 @@ Generate bindist: -arm64 - - hell scripts/static-build.hell --stack-arch aarch64-linux --filename hell-linux-arm64 --ghc-version ghc-9.8.2 --docker-container hell - -amd64 - - hell scripts/static-build.hell --stack-arch x86_64-linux --filename hell-linux-amd64 --ghc-version ghc-9.8.2 --docker-container hell-amd64 + nix build .#static-arm64 -o hell-linux-arm64-dir + cp ./hell-linux-arm64-dir/bin/hell hell-linux-arm64 + nix build .#static-amd64 -o hell-linux-amd64-dir + cp ./hell-linux-amd64-dir/bin/hell hell-linux-amd64 diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..20db77f --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1776877367, + "narHash": "sha256-EHq1/OX139R1RvBzOJ0aMRT3xnWyqtHBRUBuO1gFzjI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0726a0ecb6d4e08f6adced58726b95db924cef57", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "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", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..cdaa6e4 --- /dev/null +++ b/flake.nix @@ -0,0 +1,50 @@ +{ + description = "hell"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachSystem [ "aarch64-linux" "x86_64-linux" ] (system: + let + pkgs = import nixpkgs { inherit system; }; + + pkgsStaticArm64 = import nixpkgs { + localSystem = system; + crossSystem = { + config = "aarch64-unknown-linux-musl"; + isStatic = true; + }; + }; + pkgsStaticAmd64 = import nixpkgs { + localSystem = system; + crossSystem = { + config = "x86_64-unknown-linux-musl"; + isStatic = true; + }; + }; + + mkStaticApp = hp: hp.haskellPackages.callCabal2nix "hell" ./. {}; + + app = pkgs.haskellPackages.callCabal2nix "hell" ./. {}; + in { + devShells.default = pkgs.haskellPackages.shellFor { + name = "hell-dev"; + packages = _: [ app ]; + withHoogle = true; + buildInputs = with pkgs.haskellPackages; [ + cabal-install + haskell-language-server + fourmolu + hlint + pkgs.zlib + ]; + }; + packages = { + default = app; + static-arm64 = mkStaticApp pkgsStaticArm64; + static-amd64 = mkStaticApp pkgsStaticAmd64; + }; + } + ); +} diff --git a/scripts/install-hell.hell b/scripts/install-hell.hell deleted file mode 100644 index 587b0fa..0000000 --- a/scripts/install-hell.hell +++ /dev/null @@ -1,2 +0,0 @@ -main = do - Directory.copyFile "hell-linux-x86-64bit" "/usr/bin/hell" diff --git a/scripts/static-build.hell b/scripts/static-build.hell deleted file mode 100644 index 2af0cf4..0000000 --- a/scripts/static-build.hell +++ /dev/null @@ -1,37 +0,0 @@ -data Opts = Opts { - arch :: Text, - filename :: Text, - ghc :: Text, - container :: Text - } -options = - (\arch filename ghc container -> Main.Opts { arch, filename, ghc, container }) - <$> Options.strOption (Option.long "stack-arch" <> Option.help "x86_64-linux or aarch64-linux") - <*> Options.strOption (Option.long "filename" <> Option.help "e.g. hell-linux-amd64 or hell-linux-arm64") - <*> Options.strOption (Option.long "ghc-version" <> Option.help "e.g. ghc-9.8.2") - <*> Options.strOption (Option.long "docker-container" <> Option.help "e.g. hell or hell-amd64") - -main = do - opts <- Options.execParser (Options.info (Main.options <**> Options.helper) Options.fullDesc) - let arch = Record.get @"arch" opts - let filename = Record.get @"filename" opts - let ghc = Record.get @"ghc" opts - let container = Record.get @"container" opts - let distPath = ".stack-work/dist/" <> arch <> "/" <> ghc <> "/build/hell/" - - Process.runProcess_ (Process.proc "docker" ["exec", container, "stack", "build","--ghc-options", "-static -optl-static -fforce-recomp", "--force-dirty"]) - Directory.copyFile (distPath <> "/hell") filename - Process.runProcess_ (Process.proc "docker" ["exec", container, "strip", filename]) - pwd <- Directory.getCurrentDirectory - env <- Environment.getEnvironment - path <- Environment.getEnv "PATH" - Process.runProcess_ $ - Process.setEnv - (List.cons - ("PATH", - Text.concat - [pwd, - "/" <> distPath, ":", - path]) - env) $ - Process.proc "hell" ["scripts/check.hell"] diff --git a/scripts/static-build.sh b/scripts/static-build.sh new file mode 100755 index 0000000..fa1494f --- /dev/null +++ b/scripts/static-build.sh @@ -0,0 +1,4 @@ +nix build .#static-arm64 -o hell-linux-arm64-dir +cp ./hell-linux-arm64-dir/bin/hell hell-linux-arm64 +nix build .#static-amd64 -o hell-linux-amd64-dir +cp ./hell-linux-amd64-dir/bin/hell hell-linux-amd64 From 86bac831cb2b10cb03e1cbcbe1762f8b2511ac06 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 28 Apr 2026 10:44:01 +0100 Subject: [PATCH 3/3] Bump Hell version --- src/Hell.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hell.hs b/src/Hell.hs index 61e13d6..01b506e 100644 --- a/src/Hell.hs +++ b/src/Hell.hs @@ -171,7 +171,7 @@ commandParser = -- | Version of Hell. hellVersion :: Text -hellVersion = "2026-04-21" +hellVersion = "2026-04-28" -- | Dispatch on the command. dispatch :: Command -> IO ()