Revert flake.nix

This commit is contained in:
James Eversole 2025-02-08 10:24:14 -06:00
parent fccee3e61c
commit 5024a2be4c
4 changed files with 39 additions and 82 deletions

View File

@ -55,9 +55,7 @@ tricu < !version -- Print tricu version
## Installation and Use ## Installation and Use
[Releases are available for Linux.](https://git.eversole.co/James/tricu/releases) You can easily build and run this project using [Nix](https://nixos.org/download/).
Or you can easily build and run this project using [Nix](https://nixos.org/download/).
- Quick Start (REPL): - Quick Start (REPL):
- `nix run git+https://git.eversole.co/James/tricu` - `nix run git+https://git.eversole.co/James/tricu`

44
flake.lock generated
View File

@ -18,55 +18,25 @@
"type": "github" "type": "github"
} }
}, },
"nh2pkgs": {
"flake": false,
"locked": {
"lastModified": 1718490232,
"narHash": "sha256-0Fh3aJZuTJVmiiKY/5SyvHlfhZ3HeZTDUQnd+Fx6/Qo=",
"type": "tarball",
"url": "https://github.com/nh2/nixpkgs/archive/ede5282c487a1fd2de64303ba59adad6726f1225.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/nh2/nixpkgs/archive/ede5282c487a1fd2de64303ba59adad6726f1225.tar.gz"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1738797219, "lastModified": 1734566935,
"narHash": "sha256-KRwX9Z1XavpgeSDVM/THdFd6uH8rNm/6R+7kIbGa+2s=", "narHash": "sha256-cnBItmSwoH132tH3D4jxmMLVmk8G5VJ6q/SC3kszv9E=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "1da52dd49a127ad74486b135898da2cef8c62665", "rev": "087408a407440892c1b00d80360fd64639b8091d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "owner": "NixOS",
"type": "indirect" "repo": "nixpkgs",
"type": "github"
} }
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nh2pkgs": "nh2pkgs", "nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"static-haskell-nix": "static-haskell-nix"
}
},
"static-haskell-nix": {
"flake": false,
"locked": {
"lastModified": 1718492291,
"narHash": "sha256-XbBHPJk3ln+uLW+Dsio7vJNYnsHhmqenbI7cLsP8kHg=",
"owner": "nh2",
"repo": "static-haskell-nix",
"rev": "481e7d73ca624278ef0f840a0a2ba09e3a583217",
"type": "github"
},
"original": {
"owner": "nh2",
"repo": "static-haskell-nix",
"type": "github"
} }
}, },
"systems": { "systems": {

View File

@ -2,56 +2,46 @@
description = "tricu"; description = "tricu";
inputs = { inputs = {
nh2pkgs = { nixpkgs.url = "github:NixOS/nixpkgs";
url = "https://github.com/nh2/nixpkgs/archive/ede5282c487a1fd2de64303ba59adad6726f1225.tar.gz";
type = "tarball";
flake = false;
};
static-haskell-nix = {
url = "github:nh2/static-haskell-nix";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, flake-utils, nh2pkgs, nixpkgs, static-haskell-nix }: outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
compiler = "ghc948"; pkgs = nixpkgs.legacyPackages.${system};
packageName = "tricu"; packageName = "tricu";
containerPackageName = "${packageName}-container";
overlay = self: super: { customGHC = pkgs.haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
haskell = super.haskell // { megaparsec
packages = super.haskell.packages // { ]);
${compiler} = super.haskell.packages.${compiler}.override {
overrides = final: prev: {
${packageName} = prev.callCabal2nix packageName ./. {};
};
};
};
};
};
overlays = [overlay]; haskellPackages = pkgs.haskellPackages;
pkgs = import nh2pkgs { inherit overlays system; }; enableSharedExecutables = false;
enableSharedLibraries = false;
survey = import "${static-haskell-nix}/survey" { inherit compiler pkgs; };
tricuStatic = survey.haskellPackages.${packageName};
tricu = pkgs.haskell.lib.justStaticExecutables self.packages.${system}.default;
in { in {
packages.default = tricuStatic;
packages.${packageName} =
haskellPackages.callCabal2nix packageName self rec {};
packages.default = self.packages.${system}.${packageName};
defaultPackage = self.packages.${system}.default;
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
buildInputs = with survey; [ buildInputs = with pkgs; [
haskellPackages.cabal-install haskellPackages.cabal-install
haskellPackages.ghc-events haskellPackages.ghc-events
haskellPackages.ghcid haskellPackages.ghcid
] ++ [pkgs.upx]; customGHC
upx
];
inputsFrom = builtins.attrValues self.packages.${system}; inputsFrom = builtins.attrValues self.packages.${system};
}; };
devShell = self.devShells.${system}.default; devShell = self.devShells.${system}.default;
}); });
} }

View File

@ -6,23 +6,22 @@ import Lexer
import Parser import Parser
import Research import Research
import Control.Exception (IOException, SomeException, catch, displayException) import Control.Exception (IOException, SomeException, catch
, displayException)
import Control.Monad (forM_) import Control.Monad (forM_)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Catch (handle, MonadCatch) import Control.Monad.Catch (handle, MonadCatch)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT) import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
import Data.Char (isSpace, isUpper) import Data.Char (isSpace, isUpper)
import Data.List ( dropWhile import Data.List (dropWhile, dropWhileEnd, isPrefixOf)
, dropWhileEnd
, isPrefixOf)
import System.Console.Haskeline
import Paths_tricu (version)
import Data.Version (showVersion) import Data.Version (showVersion)
import qualified Data.Text as T import Paths_tricu (version)
import qualified Data.Text.IO as T import System.Console.Haskeline
import qualified Data.Map as Map import qualified Data.Map as Map
import qualified Data.Text as T
import qualified Data.Text.IO as T
repl :: Env -> IO () repl :: Env -> IO ()
repl env = runInputT settings (withInterrupt (loop env Decode)) repl env = runInputT settings (withInterrupt (loop env Decode))