From 540a5e03fe7f1dd3736e3196aa8caa874d0ac3ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Thu, 23 Apr 2026 23:37:56 -0600 Subject: [PATCH] update --- .envrc | 1 + .gitignore | 1 + flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ qbe.cabal | 6 ++++-- 5 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 7263372..00eb306 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ dist-newstyle *.hi .ghc.environment.* *.tix +.direnv \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b3b5542 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1776949667, + "narHash": "sha256-GMSVw35Q+294GlrTUKlx087E31z7KurReQ1YHSKp5iw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "01fbdeef22b76df85ea168fbfe1bfd9e63681b30", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3026aeb --- /dev/null +++ b/flake.nix @@ -0,0 +1,42 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = { self, nixpkgs, ... }@inputs: + let + supportedSystems = [ + "aarch64-darwin" "aarch64-linux" + "x86_64-darwin" "x86_64-linux" + ]; + + each-system = f: nixpkgs.lib.genAttrs supportedSystems (system: f rec { + pkgs = import nixpkgs { + inherit system; + }; + inherit (pkgs) lib; + inherit system; + }); + in { + # Exposed as a REPL convenience. + _pkgs = each-system ({ pkgs, ... }: pkgs); + + packages = each-system ({ pkgs, ... }: { + # default = pkgs.callPackage ./default.nix {}; + }); + + devShells = each-system ({ pkgs, system, ... }: { + default = pkgs.haskellPackages.developPackage { + root = ./.; + modifier = drv: + pkgs.haskell.lib.addBuildTools + drv + (with pkgs; [ + cabal-install + qbe + gcc + ]); + }; + }); + }; +} diff --git a/qbe.cabal b/qbe.cabal index 7aa509a..3341b73 100644 --- a/qbe.cabal +++ b/qbe.cabal @@ -26,6 +26,7 @@ tested-with: , GHC == 9.0.2 , GHC == 9.2.2 , GHC == 9.4.2 + , GHC == 9.10.3 source-repository head type: git @@ -54,12 +55,13 @@ library || ^>= 4.14 || ^>= 4.15 || ^>= 4.17 + || ^>= 4.20 , text ^>= 1.2.5 || ^>= 2.0 - , text-short ^>= 0.1 + , text-short >= 0.1 || <=0.1.6.1 , bytestring ^>= 0.11.3 , hashable ^>= 1.4.0 - , deepseq ^>= 1.4.4 + , deepseq ^>= 1.4.4 || ^>= 1.5 , prettyprinter ^>= 1.7.1 hs-source-dirs: src