From 68d637c8fd1c7c2fc8231623e8448a29b02b2fa5 Mon Sep 17 00:00:00 2001 From: Patrick Steele Date: Mon, 8 Jan 2024 22:23:28 -0500 Subject: [PATCH 1/2] feat: update nixpkgs Also, update the flake layout, and clean up old helper functions. --- .envrc | 1 + .github/workflows/test.yml | 2 +- .gitignore | 5 +- default.nix | 22 -- examples/examples.cabal | 36 ++-- examples/shell.nix | 1 - flake.lock | 43 ++++ flake.nix | 57 +++++ glpk-headers/shell.nix | 1 - .../math-programming-glpk.cabal | 18 +- math-programming-glpk/shell.nix | 1 - .../math-programming-tests.cabal | 18 +- math-programming-tests/shell.nix | 1 - .../src/Math/Programming/Tests/Fuzz.hs | 18 +- math-programming/math-programming.cabal | 16 +- math-programming/shell.nix | 1 - nix/sources.json | 26 --- nix/sources.nix | 194 ------------------ s/build | 3 - s/cabal | 3 - s/haskell-language-server | 3 - s/pipeline | 9 - s/update-project-nix | 3 - shell.nix | 19 -- 24 files changed, 160 insertions(+), 341 deletions(-) create mode 100644 .envrc delete mode 100644 default.nix delete mode 120000 examples/shell.nix create mode 100644 flake.lock create mode 100644 flake.nix delete mode 120000 glpk-headers/shell.nix delete mode 120000 math-programming-glpk/shell.nix delete mode 120000 math-programming-tests/shell.nix delete mode 120000 math-programming/shell.nix delete mode 100644 nix/sources.json delete mode 100644 nix/sources.nix delete mode 100755 s/build delete mode 100755 s/cabal delete mode 100755 s/haskell-language-server delete mode 100755 s/pipeline delete mode 100755 s/update-project-nix delete mode 100644 shell.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/.github/workflows/test.yml b/.github/workflows/test.yml index 25ef1ed..7f31de5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,4 +9,4 @@ jobs: - uses: cachix/install-nix-action@v18 with: nix_path: nixpkgs=channel:nixos-unstable - - run: s/pipeline + - run: cabal test all --test-show-details=streaming diff --git a/.gitignore b/.gitignore index 38bb2b4..38e8629 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ .dir-locals-2.el # Haskell -dist-newstyle/ \ No newline at end of file +dist-newstyle/ + +# direnv +.direnv diff --git a/default.nix b/default.nix deleted file mode 100644 index 9484e51..0000000 --- a/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ sources ? import ./nix/sources.nix -, pkgs ? import sources.nixpkgs { } -}: -let - overrides = self: super: { - examples = self.callCabal2nix "examples" ./examples {}; - glpk-headers = self.callCabal2nix "glpk-headers" ./glpk-headers {}; - math-programming = self.callCabal2nix "math-programming" ./math-programming {}; - math-programming-glpk = self.callCabal2nix "math-programming-glpk" ./math-programming-glpk {}; - math-programming-tests = self.callCabal2nix "math-programming-tests" ./math-programming-tests {}; - }; - hPkgs = pkgs.haskellPackages.override { inherit overrides; }; -in -with hPkgs; -{ inherit - examples - glpk-headers - math-programming - math-programming-glpk - math-programming-tests - ; -} diff --git a/examples/examples.cabal b/examples/examples.cabal index 1e9a161..1c96642 100644 --- a/examples/examples.cabal +++ b/examples/examples.cabal @@ -23,12 +23,12 @@ executable sudoku default-language: Haskell2010 ghc-options: -threaded -pgmL markdown-unlit build-depends: base <5 - , containers ^>=0.6 - , markdown-unlit ^>=0.5 - , math-programming ^>=0.5 - , math-programming-glpk ^>=0.5 - , mtl ^>=2.2 - , text ^>=1.2 + , containers >=0.6 + , markdown-unlit >=0.5 + , math-programming >=0.5 + , math-programming-glpk >=0.5 + , mtl >=2.2 + , text >=1.2 executable 3sat main-is: Example3SAT.lhs @@ -36,12 +36,12 @@ executable 3sat default-language: Haskell2010 ghc-options: -threaded -pgmL markdown-unlit build-depends: base <5 - , containers ^>=0.6 - , markdown-unlit ^>=0.5 - , math-programming ^>=0.5 - , math-programming-glpk ^>=0.5 - , mtl ^>=2.2 - , text ^>=1.2 + , containers >=0.6 + , markdown-unlit >=0.5 + , math-programming >=0.5 + , math-programming-glpk >=0.5 + , mtl >=2.2 + , text >=1.2 executable tutorial @@ -50,9 +50,9 @@ executable tutorial default-language: Haskell2010 ghc-options: -threaded -pgmL markdown-unlit build-depends: base <5 - , containers ^>=0.6 - , markdown-unlit ^>=0.5 - , math-programming ^>=0.5 - , math-programming-glpk ^>=0.5 - , mtl ^>=2.2 - , text ^>=1.2 + , containers >=0.6 + , markdown-unlit >=0.5 + , math-programming >=0.5 + , math-programming-glpk >=0.5 + , mtl >=2.2 + , text >=1.2 diff --git a/examples/shell.nix b/examples/shell.nix deleted file mode 120000 index 314b0bf..0000000 --- a/examples/shell.nix +++ /dev/null @@ -1 +0,0 @@ -../shell.nix \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5aaf9bf --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1766201043, + "narHash": "sha256-eplAP+rorKKd0gNjV3rA6+0WMzb1X1i16F5m5pASnjA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b3aad468604d3e488d627c0b43984eb60e75e782", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "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..7d5d20f --- /dev/null +++ b/flake.nix @@ -0,0 +1,57 @@ +{ + description = "A collection of libraries for mathematical programming"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + systems.url = "github:nix-systems/default"; + }; + + outputs = { self, nixpkgs, systems }: + let + forAllSystems = nixpkgs.lib.genAttrs (import systems); + mkPkgs = system: import nixpkgs { inherit system; overlays = [ self.overlays.default ]; }; + in + { + packages = forAllSystems (system: + let + pkgs = mkPkgs system; + in + { }); + + devShells = forAllSystems (system: + let + pkgs = mkPkgs system; + in + { + default = pkgs.haskellPackages.shellFor { + packages = hpkgs: with hpkgs; [ + examples + glpk-headers + math-programming + math-programming-glpk + math-programming-tests + ]; + buildInputs = with pkgs; [ + haskellPackages.haskell-language-server + ormolu + cabal-install + ]; + withHoogle = true; + }; + }); + + overlays = { + default = final: prev: { + haskellPackages = prev.haskellPackages.override { + overrides = hfinal: hprev: { + examples = hfinal.callCabal2nix "examples" ./examples { }; + glpk-headers = hfinal.callCabal2nix "glpk-headers" ./glpk-headers { }; + math-programming = hfinal.callCabal2nix "math-programming" ./math-programming { }; + math-programming-glpk = hfinal.callCabal2nix "math-programming-glpk" ./math-programming-glpk { }; + math-programming-tests = hfinal.callCabal2nix "math-programming-tests" ./math-programming-tests { }; + }; + }; + }; + }; + }; +} diff --git a/glpk-headers/shell.nix b/glpk-headers/shell.nix deleted file mode 120000 index 314b0bf..0000000 --- a/glpk-headers/shell.nix +++ /dev/null @@ -1 +0,0 @@ -../shell.nix \ No newline at end of file diff --git a/math-programming-glpk/math-programming-glpk.cabal b/math-programming-glpk/math-programming-glpk.cabal index ffd6b06..bc38fba 100644 --- a/math-programming-glpk/math-programming-glpk.cabal +++ b/math-programming-glpk/math-programming-glpk.cabal @@ -24,12 +24,12 @@ library other-modules: Math.Programming.Glpk.Internal ghc-options: -Wall build-depends: base <5 - , glpk-headers ^>=0.5 - , math-programming ^>=0.5 - , mtl ^>=2.2 - , text ^>=1.2 - , transformers ^>=0.5 - , unliftio ^>=0.2 + , glpk-headers >=0.5 + , math-programming >=0.5 + , mtl >=2.2 + , text >=1.2 + , transformers >=0.5 + , unliftio >=0.2 test-suite math-programming-glpk-test-suite default-language: Haskell2010 @@ -40,7 +40,7 @@ test-suite math-programming-glpk-test-suite ghc-options: -threaded -with-rtsopts=-N -Wall build-depends: math-programming-glpk , base <5 - , math-programming ^>=0.5 - , math-programming-tests ^>=0.5 - , unliftio ^>=0.2 + , math-programming >=0.5 + , math-programming-tests >=0.5 + , unliftio >=0.2 , hspec >=2.8 && < 3 diff --git a/math-programming-glpk/shell.nix b/math-programming-glpk/shell.nix deleted file mode 120000 index 314b0bf..0000000 --- a/math-programming-glpk/shell.nix +++ /dev/null @@ -1 +0,0 @@ -../shell.nix \ No newline at end of file diff --git a/math-programming-tests/math-programming-tests.cabal b/math-programming-tests/math-programming-tests.cabal index 688a827..62570eb 100644 --- a/math-programming-tests/math-programming-tests.cabal +++ b/math-programming-tests/math-programming-tests.cabal @@ -28,13 +28,13 @@ library other-modules: ghc-options: -Wall build-depends: base <5 - , containers ^>=0.6 - , math-programming ^>=0.5 - , microlens ^>=0.4 - , microlens-th ^>=0.4 - , microlens-mtl ^>=0.2 + , containers >=0.6 + , math-programming >=0.5 + , microlens >=0.4 + , microlens-th >=0.4 + , microlens-mtl >=0.2 , hspec >=2.8 && <3 - , QuickCheck ^>=2.14 - , random ^>=1.2 - , mtl ^>=2.2 - , text ^>=1.2 + , QuickCheck >=2.14 + , random >=1.2 + , mtl >=2.2 + , text >=1.2 diff --git a/math-programming-tests/shell.nix b/math-programming-tests/shell.nix deleted file mode 120000 index 314b0bf..0000000 --- a/math-programming-tests/shell.nix +++ /dev/null @@ -1 +0,0 @@ -../shell.nix \ No newline at end of file diff --git a/math-programming-tests/src/Math/Programming/Tests/Fuzz.hs b/math-programming-tests/src/Math/Programming/Tests/Fuzz.hs index 85437d5..dad938c 100644 --- a/math-programming-tests/src/Math/Programming/Tests/Fuzz.hs +++ b/math-programming-tests/src/Math/Programming/Tests/Fuzz.hs @@ -6,6 +6,7 @@ -- | Fuzz testing for math programming backends. module Math.Programming.Tests.Fuzz where +import Control.Monad import Control.Monad.IO.Class import Control.Monad.State import Control.Monad.Writer @@ -107,7 +108,7 @@ type LPFuzz v c o m = MonadIO m ) -evalPending :: LPFuzz v c o m => m () +evalPending :: (LPFuzz v c o m) => m () evalPending = do todo <- use pending case todo of @@ -117,10 +118,10 @@ evalPending = do evalAction x evalPending -evalAction :: LPFuzz v c o m => LPAction -> m () +evalAction :: (LPFuzz v c o m) => LPAction -> m () evalAction action = tell (S.singleton (show action)) >> evalAction' action -evalAction' :: LPFuzz v c o m => LPAction -> m () +evalAction' :: (LPFuzz v c o m) => LPAction -> m () evalAction' (AddVariable k) = add k addVariable variables evalAction' (AddThenRemoveVariable k) = addThenRemove k addVariable deleteVariable variables evalAction' (AddConstraint k) = add k makeConstraint constraints @@ -140,14 +141,14 @@ addThenRemove k create destroy focus = do Just v -> destroy v >> modifying focus (M.delete k) Nothing -> add k create focus -makeConstraint :: LPFuzz v c o m => m c +makeConstraint :: (LPFuzz v c o m) => m c makeConstraint = do lhs <- chooseExpr rhs <- chooseExpr op <- chooseInequality lhs `op` rhs -chooseExpr :: LPFuzz v c o m => m (Expr v) +chooseExpr :: (LPFuzz v c o m) => m (Expr v) chooseExpr = do g <- use randomGen vs <- use variables @@ -157,7 +158,7 @@ chooseExpr = do pure (esum terms) -chooseInequality :: LPFuzz v c o m => m (Expr v -> Expr v -> m c) +chooseInequality :: (LPFuzz v c o m) => m (Expr v -> Expr v -> m c) chooseInequality = do g <- use randomGen d3 <- liftIO (uniformRM (0 :: Int, 2) g) @@ -166,7 +167,7 @@ chooseInequality = do 1 -> pure (.>=.) _ -> pure (.==.) -makeObjective :: LPFuzz v c o m => m o +makeObjective :: (LPFuzz v c o m) => m o makeObjective = do g <- use randomGen minimizing <- liftIO (uniformM g) @@ -185,6 +186,7 @@ makeFuzzTests runner = describe "Fuzz testing" $ do prop "finds no failures" $ \seed (LPActions todo) -> do initState <- liftIO (initLPState seed todo) - runner . execWriterT + runner + . execWriterT . flip evalStateT initState $ evalPending diff --git a/math-programming/math-programming.cabal b/math-programming/math-programming.cabal index 444973a..b6a24a7 100644 --- a/math-programming/math-programming.cabal +++ b/math-programming/math-programming.cabal @@ -28,11 +28,11 @@ library ghc-options: -Wall -- Restrictions on transformers due to https://hub.darcs.net/ross/transformers/issue/90 build-depends: base <5 - , containers ^>=0.6 - , exceptions ^>=0.10 - , mtl ^>=2.2 - , text ^>=1.2 - , transformers ^>=0.5 + , containers >=0.6 + , exceptions >=0.10 + , mtl >=2.2 + , text >=1.2 + , transformers >=0.5 test-suite math-programming-test-suite default-language: Haskell2010 @@ -45,6 +45,6 @@ test-suite math-programming-test-suite build-depends: math-programming , base <5 , hspec >=2.8 && <3 - , mtl ^>=2.2 - , QuickCheck ^>=2.14 - , text ^>=1.2 + , mtl >=2.2 + , QuickCheck >=2.14 + , text >=1.2 diff --git a/math-programming/shell.nix b/math-programming/shell.nix deleted file mode 120000 index 314b0bf..0000000 --- a/math-programming/shell.nix +++ /dev/null @@ -1 +0,0 @@ -../shell.nix \ No newline at end of file diff --git a/nix/sources.json b/nix/sources.json deleted file mode 100644 index 785f809..0000000 --- a/nix/sources.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "niv": { - "branch": "master", - "description": "Easy dependency management for Nix projects", - "homepage": "https://github.com/nmattia/niv", - "owner": "nmattia", - "repo": "niv", - "rev": "689d0e5539eddd0b0f566aee7bb18629eee7df74", - "sha256": "1rld3lk42l6b01f2gcrhq8qm9vry1awmfl29zmpiqda9dy89vbx0", - "type": "tarball", - "url": "https://github.com/nmattia/niv/archive/689d0e5539eddd0b0f566aee7bb18629eee7df74.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "nixpkgs": { - "branch": "release-22.11", - "description": "Nix Packages collection", - "homepage": "", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e9ade2c8240e00a4784fac282a502efff2786bdc", - "sha256": "09cd90m59r5mj3fd44al66l1216ws659hwbwd0n18047pdlrcvm3", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/e9ade2c8240e00a4784fac282a502efff2786bdc.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - } -} diff --git a/nix/sources.nix b/nix/sources.nix deleted file mode 100644 index 9a01c8a..0000000 --- a/nix/sources.nix +++ /dev/null @@ -1,194 +0,0 @@ -# This file has been generated by Niv. - -let - - # - # The fetchers. fetch_ fetches specs of type . - # - - fetch_file = pkgs: name: spec: - let - name' = sanitizeName name + "-src"; - in - if spec.builtin or true then - builtins_fetchurl { inherit (spec) url sha256; name = name'; } - else - pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; - - fetch_tarball = pkgs: name: spec: - let - name' = sanitizeName name + "-src"; - in - if spec.builtin or true then - builtins_fetchTarball { name = name'; inherit (spec) url sha256; } - else - pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; - - fetch_git = name: spec: - let - ref = - if spec ? ref then spec.ref else - if spec ? branch then "refs/heads/${spec.branch}" else - if spec ? tag then "refs/tags/${spec.tag}" else - abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; - submodules = if spec ? submodules then spec.submodules else false; - submoduleArg = - let - nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; - emptyArgWithWarning = - if submodules == true - then - builtins.trace - ( - "The niv input \"${name}\" uses submodules " - + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " - + "does not support them" - ) - {} - else {}; - in - if nixSupportsSubmodules - then { inherit submodules; } - else emptyArgWithWarning; - in - builtins.fetchGit - ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); - - fetch_local = spec: spec.path; - - fetch_builtin-tarball = name: throw - ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. - $ niv modify ${name} -a type=tarball -a builtin=true''; - - fetch_builtin-url = name: throw - ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. - $ niv modify ${name} -a type=file -a builtin=true''; - - # - # Various helpers - # - - # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 - sanitizeName = name: - ( - concatMapStrings (s: if builtins.isList s then "-" else s) - ( - builtins.split "[^[:alnum:]+._?=-]+" - ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) - ) - ); - - # The set of packages used when specs are fetched using non-builtins. - mkPkgs = sources: system: - let - sourcesNixpkgs = - import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; - hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; - hasThisAsNixpkgsPath = == ./.; - in - if builtins.hasAttr "nixpkgs" sources - then sourcesNixpkgs - else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then - import {} - else - abort - '' - Please specify either (through -I or NIX_PATH=nixpkgs=...) or - add a package called "nixpkgs" to your sources.json. - ''; - - # The actual fetching function. - fetch = pkgs: name: spec: - - if ! builtins.hasAttr "type" spec then - abort "ERROR: niv spec ${name} does not have a 'type' attribute" - else if spec.type == "file" then fetch_file pkgs name spec - else if spec.type == "tarball" then fetch_tarball pkgs name spec - else if spec.type == "git" then fetch_git name spec - else if spec.type == "local" then fetch_local spec - else if spec.type == "builtin-tarball" then fetch_builtin-tarball name - else if spec.type == "builtin-url" then fetch_builtin-url name - else - abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; - - # If the environment variable NIV_OVERRIDE_${name} is set, then use - # the path directly as opposed to the fetched source. - replace = name: drv: - let - saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; - ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; - in - if ersatz == "" then drv else - # this turns the string into an actual Nix path (for both absolute and - # relative paths) - if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; - - # Ports of functions for older nix versions - - # a Nix version of mapAttrs if the built-in doesn't exist - mapAttrs = builtins.mapAttrs or ( - f: set: with builtins; - listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) - ); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 - range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 - stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 - stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); - concatMapStrings = f: list: concatStrings (map f list); - concatStrings = builtins.concatStringsSep ""; - - # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 - optionalAttrs = cond: as: if cond then as else {}; - - # fetchTarball version that is compatible between all the versions of Nix - builtins_fetchTarball = { url, name ? null, sha256 }@attrs: - let - inherit (builtins) lessThan nixVersion fetchTarball; - in - if lessThan nixVersion "1.12" then - fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchTarball attrs; - - # fetchurl version that is compatible between all the versions of Nix - builtins_fetchurl = { url, name ? null, sha256 }@attrs: - let - inherit (builtins) lessThan nixVersion fetchurl; - in - if lessThan nixVersion "1.12" then - fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchurl attrs; - - # Create the final "sources" from the config - mkSources = config: - mapAttrs ( - name: spec: - if builtins.hasAttr "outPath" spec - then abort - "The values in sources.json should not have an 'outPath' attribute" - else - spec // { outPath = replace name (fetch config.pkgs name spec); } - ) config.sources; - - # The "config" used by the fetchers - mkConfig = - { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null - , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) - , system ? builtins.currentSystem - , pkgs ? mkPkgs sources system - }: rec { - # The sources, i.e. the attribute set of spec name to spec - inherit sources; - - # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers - inherit pkgs; - }; - -in -mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/s/build b/s/build deleted file mode 100755 index 7db68e5..0000000 --- a/s/build +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env nix-shell -#! nix-shell -i bash ../shell.nix -cabal build "$@" \ No newline at end of file diff --git a/s/cabal b/s/cabal deleted file mode 100755 index 4437073..0000000 --- a/s/cabal +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env nix-shell -#! nix-shell -i bash ../shell.nix -cabal "$@" \ No newline at end of file diff --git a/s/haskell-language-server b/s/haskell-language-server deleted file mode 100755 index 200a983..0000000 --- a/s/haskell-language-server +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env nix-shell -#! nix-shell -i bash ../shell.nix -haskell-language-server "$@" diff --git a/s/pipeline b/s/pipeline deleted file mode 100755 index 284a71d..0000000 --- a/s/pipeline +++ /dev/null @@ -1,9 +0,0 @@ -#! /usr/bin/env nix-shell -#! nix-shell --pure --quiet -i bash ../shell.nix - -set -e - -echo "#" -echo "# Running tests..." -echo "#" -cabal test all --test-show-details=streaming "$@" diff --git a/s/update-project-nix b/s/update-project-nix deleted file mode 100755 index ab34ff2..0000000 --- a/s/update-project-nix +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env nix-shell -#! nix-shell -i bash ../nix/ci.nix -cabal2nix . > math-programming.nix diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 2525c7e..0000000 --- a/shell.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ sources ? import ./nix/sources.nix -, pkgs ? import sources.nixpkgs { } -}: -let - local = import ./default.nix { inherit sources pkgs; }; -in -pkgs.haskellPackages.shellFor { - packages = p: [ local.examples - local.glpk-headers - local.math-programming - local.math-programming-glpk - local.math-programming-tests - ]; - buildInputs = [ pkgs.cabal-install - pkgs.cabal2nix - pkgs.haskell-language-server - ]; - withHoogle = true; -} From 6a7c8bc34d277836eadf5c4a67155a257b178d66 Mon Sep 17 00:00:00 2001 From: Patrick Steele Date: Sun, 21 Dec 2025 11:29:54 -0500 Subject: [PATCH 2/2] fix: CI tests --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f31de5..ac22420 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,4 +9,5 @@ jobs: - uses: cachix/install-nix-action@v18 with: nix_path: nixpkgs=channel:nixos-unstable - - run: cabal test all --test-show-details=streaming + - run: | + nix develop --command cabal test all --test-show-details=streaming