From 6858e1cfefd23e898783c8f1be5e94eebe4a793b Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sat, 24 Feb 2024 11:24:35 -0700 Subject: [PATCH 01/18] flake: init with building package --- .gitignore | 5 +- flake.lock | 1282 ++++++++++++++++++++++++++++++++++++++++ flake.nix | 24 + nix/antlr/default.nix | 27 + nix/antlr/mk-antlr.nix | 98 +++ nix/factorio-sat.nix | 32 + nix/luaparser.nix | 14 + nix/packages.nix | 18 + 8 files changed, 1499 insertions(+), 1 deletion(-) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 nix/antlr/default.nix create mode 100644 nix/antlr/mk-antlr.nix create mode 100644 nix/factorio-sat.nix create mode 100644 nix/luaparser.nix create mode 100644 nix/packages.nix diff --git a/.gitignore b/.gitignore index 38706c1..4fd2842 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ __pycache__/ /.venv/ *.egg-info/ -build/ \ No newline at end of file +build/ + +# Nix +/result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8392bd8 --- /dev/null +++ b/flake.lock @@ -0,0 +1,1282 @@ +{ + "nodes": { + "HTTP": { + "flake": false, + "locked": { + "lastModified": 1451647621, + "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", + "owner": "phadej", + "repo": "HTTP", + "rev": "9bc0996d412fef1787449d841277ef663ad9a915", + "type": "github" + }, + "original": { + "owner": "phadej", + "repo": "HTTP", + "type": "github" + } + }, + "blank": { + "locked": { + "lastModified": 1625557891, + "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", + "owner": "divnix", + "repo": "blank", + "rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "blank", + "type": "github" + } + }, + "cabal-32": { + "flake": false, + "locked": { + "lastModified": 1603716527, + "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=", + "owner": "haskell", + "repo": "cabal", + "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.2", + "repo": "cabal", + "type": "github" + } + }, + "cabal-34": { + "flake": false, + "locked": { + "lastModified": 1645834128, + "narHash": "sha256-wG3d+dOt14z8+ydz4SL7pwGfe7SiimxcD/LOuPCV6xM=", + "owner": "haskell", + "repo": "cabal", + "rev": "5ff598c67f53f7c4f48e31d722ba37172230c462", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.4", + "repo": "cabal", + "type": "github" + } + }, + "cabal-36": { + "flake": false, + "locked": { + "lastModified": 1669081697, + "narHash": "sha256-I5or+V7LZvMxfbYgZATU4awzkicBwwok4mVoje+sGmU=", + "owner": "haskell", + "repo": "cabal", + "rev": "8fd619e33d34924a94e691c5fea2c42f0fc7f144", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.6", + "repo": "cabal", + "type": "github" + } + }, + "cardano-shell": { + "flake": false, + "locked": { + "lastModified": 1608537748, + "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", + "owner": "input-output-hk", + "repo": "cardano-shell", + "rev": "9392c75087cb9a3d453998f4230930dea3a95725", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-shell", + "type": "github" + } + }, + "deploy-rs": { + "inputs": { + "flake-compat": "flake-compat_2", + "nixpkgs": "nixpkgs_2", + "utils": "utils" + }, + "locked": { + "lastModified": 1648475189, + "narHash": "sha256-gAGAS6IagwoUr1B0ohE3iR6sZ8hP4LSqzYLC8Mq3WGU=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "83e0c78291cd08cb827ba0d553ad9158ae5a95c3", + "type": "github" + }, + "original": { + "id": "deploy-rs", + "type": "indirect" + } + }, + "devshell": { + "inputs": { + "flake-utils": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "flake-utils" + ], + "nixpkgs": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1663445644, + "narHash": "sha256-+xVlcK60x7VY1vRJbNUEAHi17ZuoQxAIH4S4iUFUGBA=", + "owner": "numtide", + "repo": "devshell", + "rev": "e3dc3e21594fe07bdb24bdf1c8657acaa4cb8f66", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "dmerge": { + "inputs": { + "nixlib": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "nixpkgs" + ], + "yants": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "yants" + ] + }, + "locked": { + "lastModified": 1659548052, + "narHash": "sha256-fzI2gp1skGA8mQo/FBFrUAtY0GQkAIAaV/V127TJPyY=", + "owner": "divnix", + "repo": "data-merge", + "rev": "d160d18ce7b1a45b88344aa3f13ed1163954b497", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "data-merge", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1648199409, + "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1627913399, + "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", + "type": "github" + }, + "original": { + "id": "flake-compat", + "type": "indirect" + } + }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1672831974, + "narHash": "sha256-z9k3MfslLjWQfnjBtEtJZdq3H7kyi2kQtUThfTgdRk0=", + "owner": "input-output-hk", + "repo": "flake-compat", + "rev": "45f2638735f8cdc40fe302742b79f248d23eb368", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "hkm/gitlab-fix", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_5": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1631561581, + "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "flake-utils_3": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "locked": { + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "get-tested-src": { + "flake": false, + "locked": { + "lastModified": 1687355864, + "narHash": "sha256-yQ4coxfnp2Jsw1kvwf2/Zn72Kltze2WrfHN54eLR070=", + "owner": "Sereja313", + "repo": "get-tested", + "rev": "455bbd047374ed907900b49641a4ea7f0a905709", + "type": "github" + }, + "original": { + "owner": "Sereja313", + "ref": "issue-8-emit-ghc-versions", + "repo": "get-tested", + "type": "github" + } + }, + "ghc-8.6.5-iohk": { + "flake": false, + "locked": { + "lastModified": 1600920045, + "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", + "owner": "input-output-hk", + "repo": "ghc", + "rev": "95713a6ecce4551240da7c96b6176f980af75cae", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "release/8.6.5-iohk", + "repo": "ghc", + "type": "github" + } + }, + "gitignore-nix": { + "flake": false, + "locked": { + "lastModified": 1611672876, + "narHash": "sha256-qHu3uZ/o9jBHiA3MEKHJ06k7w4heOhA+4HCSIvflRxo=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "211907489e9f198594c0eb0ca9256a1949c9d412", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gomod2nix": { + "inputs": { + "nixpkgs": "nixpkgs_4", + "utils": "utils_2" + }, + "locked": { + "lastModified": 1655245309, + "narHash": "sha256-d/YPoQ/vFn1+GTmSdvbSBSTOai61FONxB4+Lt6w/IVI=", + "owner": "tweag", + "repo": "gomod2nix", + "rev": "40d32f82fc60d66402eb0972e6e368aeab3faf58", + "type": "github" + }, + "original": { + "owner": "tweag", + "repo": "gomod2nix", + "type": "github" + } + }, + "hackage": { + "flake": false, + "locked": { + "lastModified": 1678926579, + "narHash": "sha256-5t1QRBTsEM2wREtDf3xrHp9Kphs+AdQZKAEltaylIJQ=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "fb58b0ba5773c5f0211f284b0fae061426cf8267", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "haskell-nix": { + "inputs": { + "HTTP": "HTTP", + "cabal-32": "cabal-32", + "cabal-34": "cabal-34", + "cabal-36": "cabal-36", + "cardano-shell": "cardano-shell", + "flake-compat": "flake-compat_4", + "flake-utils": "flake-utils_3", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", + "hackage": "hackage", + "hpc-coveralls": "hpc-coveralls", + "hydra": "hydra", + "iserv-proxy": "iserv-proxy", + "nixpkgs": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "nixpkgs-unstable" + ], + "nixpkgs-2003": "nixpkgs-2003", + "nixpkgs-2105": "nixpkgs-2105", + "nixpkgs-2111": "nixpkgs-2111", + "nixpkgs-2205": "nixpkgs-2205", + "nixpkgs-2211": "nixpkgs-2211", + "nixpkgs-unstable": "nixpkgs-unstable", + "old-ghc-nix": "old-ghc-nix", + "stackage": "stackage", + "tullia": "tullia" + }, + "locked": { + "lastModified": 1678950661, + "narHash": "sha256-lvL54W90BTvwLVnFjPYmFVmgHyaGcFrt5FBy1F0rro8=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "fce554bc6a41d12f7a18a0e8290bf43f925d7a29", + "type": "github" + }, + "original": { + "id": "haskell-nix", + "type": "indirect" + } + }, + "hpc-coveralls": { + "flake": false, + "locked": { + "lastModified": 1607498076, + "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", + "type": "github" + }, + "original": { + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "type": "github" + } + }, + "hydra": { + "inputs": { + "nix": "nix", + "nixpkgs": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "hydra", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1671755331, + "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", + "owner": "NixOS", + "repo": "hydra", + "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", + "type": "github" + }, + "original": { + "id": "hydra", + "type": "indirect" + } + }, + "incl": { + "inputs": { + "nixlib": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1669263024, + "narHash": "sha256-E/+23NKtxAqYG/0ydYgxlgarKnxmDbg6rCMWnOBqn9Q=", + "owner": "divnix", + "repo": "incl", + "rev": "ce7bebaee048e4cd7ebdb4cee7885e00c4e2abca", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "incl", + "type": "github" + } + }, + "iserv-proxy": { + "flake": false, + "locked": { + "lastModified": 1670983692, + "narHash": "sha256-avLo34JnI9HNyOuauK5R69usJm+GfW3MlyGlYxZhTgY=", + "ref": "hkm/remote-iserv", + "rev": "50d0abb3317ac439a4e7495b185a64af9b7b9300", + "revCount": 10, + "type": "git", + "url": "https://gitlab.haskell.org/hamishmack/iserv-proxy.git" + }, + "original": { + "ref": "hkm/remote-iserv", + "type": "git", + "url": "https://gitlab.haskell.org/hamishmack/iserv-proxy.git" + } + }, + "lowdown-src": { + "flake": false, + "locked": { + "lastModified": 1633514407, + "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "repo": "lowdown", + "type": "github" + } + }, + "lowdown-src_2": { + "flake": false, + "locked": { + "lastModified": 1632468475, + "narHash": "sha256-NNOm9CbdA8cuwbvaBHslGbPTiU6bh1Ao+MpEPx4rSGo=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "6bd668af3fd098bdd07a1bedd399564141e275da", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "repo": "lowdown", + "type": "github" + } + }, + "n2c": { + "inputs": { + "flake-utils": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "flake-utils" + ], + "nixpkgs": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1665039323, + "narHash": "sha256-SAh3ZjFGsaCI8FRzXQyp56qcGdAqgKEfJWPCQ0Sr7tQ=", + "owner": "nlewo", + "repo": "nix2container", + "rev": "b008fe329ffb59b67bf9e7b08ede6ee792f2741a", + "type": "github" + }, + "original": { + "owner": "nlewo", + "repo": "nix2container", + "type": "github" + } + }, + "nix": { + "inputs": { + "lowdown-src": "lowdown-src", + "nixpkgs": "nixpkgs_3", + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1661606874, + "narHash": "sha256-9+rpYzI+SmxJn+EbYxjGv68Ucp22bdFUSy/4LkHkkDQ=", + "owner": "NixOS", + "repo": "nix", + "rev": "11e45768b34fdafdcf019ddbd337afa16127ff0f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "2.11.0", + "repo": "nix", + "type": "github" + } + }, + "nix-nomad": { + "inputs": { + "flake-compat": "flake-compat_5", + "flake-utils": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "nix2container", + "flake-utils" + ], + "gomod2nix": "gomod2nix", + "nixpkgs": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "nixpkgs" + ], + "nixpkgs-lib": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1658277770, + "narHash": "sha256-T/PgG3wUn8Z2rnzfxf2VqlR1CBjInPE0l1yVzXxPnt0=", + "owner": "tristanpemble", + "repo": "nix-nomad", + "rev": "054adcbdd0a836ae1c20951b67ed549131fd2d70", + "type": "github" + }, + "original": { + "owner": "tristanpemble", + "repo": "nix-nomad", + "type": "github" + } + }, + "nix2container": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1658567952, + "narHash": "sha256-XZ4ETYAMU7XcpEeAFP3NOl9yDXNuZAen/aIJ84G+VgA=", + "owner": "nlewo", + "repo": "nix2container", + "rev": "60bb43d405991c1378baf15a40b5811a53e32ffa", + "type": "github" + }, + "original": { + "owner": "nlewo", + "repo": "nix2container", + "type": "github" + } + }, + "nix_2": { + "inputs": { + "lowdown-src": "lowdown-src_2", + "nixpkgs": "nixpkgs_7" + }, + "locked": { + "lastModified": 1633098935, + "narHash": "sha256-UtuBczommNLwUNEnfRI7822z4vPA7OoRKsgAZ8zsHQI=", + "owner": "nixos", + "repo": "nix", + "rev": "4f496150eb4e0012914c11f0a3ff4df2412b1d09", + "type": "github" + }, + "original": { + "id": "nix", + "type": "indirect" + } + }, + "nixago": { + "inputs": { + "flake-utils": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "flake-utils" + ], + "nixago-exts": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "blank" + ], + "nixpkgs": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1661824785, + "narHash": "sha256-/PnwdWoO/JugJZHtDUioQp3uRiWeXHUdgvoyNbXesz8=", + "owner": "nix-community", + "repo": "nixago", + "rev": "8c1f9e5f1578d4b2ea989f618588d62a335083c3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixago", + "type": "github" + } + }, + "nixfmt": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable", + "serokell-nix": "serokell-nix" + }, + "locked": { + "lastModified": 1702548379, + "narHash": "sha256-QxxQ316RGZf2TjM7UxMFKEQk9cMS8kkO0Ffw8KE33pE=", + "owner": "serokell", + "repo": "nixfmt", + "rev": "422b1aebb44c4f12af025eda0ee6a99c6e50d738", + "type": "github" + }, + "original": { + "owner": "serokell", + "repo": "nixfmt", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1696165369, + "narHash": "sha256-pd1cjFHCoEf9q5f9B0HhlOwwpBI9RP3HbUE6xjI7wAI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d7186d62bb68fac3c90f1d95515e613ef299e992", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2003": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105": { + "locked": { + "lastModified": 1659914493, + "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2111": { + "locked": { + "lastModified": 1659446231, + "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2205": { + "locked": { + "lastModified": 1672580127, + "narHash": "sha256-3lW3xZslREhJogoOkjeZtlBtvFMyxHku7I/9IVehhT8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0874168639713f547c05947c76124f78441ea46c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-22.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2211": { + "locked": { + "lastModified": 1675730325, + "narHash": "sha256-uNvD7fzO5hNlltNQUAFBPlcEjNG5Gkbhl/ROiX+GZU4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b7ce17b1ebf600a72178f6302c77b6382d09323f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-22.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "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, + "narHash": "sha256-7gFSQbSVAFUHtGCNHPF7mPc5CcqDk9M2+inlVPZSneg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "747927516efcb5e31ba03b7ff32f61f6d47e7d87", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1648219316, + "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1657693803, + "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "365e1b3a859281cf11b94f87231adeabbdd878a2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.05-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1653581809, + "narHash": "sha256-Uvka0V5MTGbeOfWte25+tfRL3moECDh1VwokWSZUdoY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "83658b28fe638a170a19b8933aa008b30640fbd1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1654807842, + "narHash": "sha256-ADymZpr6LuTEBXcy6RtFHcUZdjKTBRTMYwu19WOx17E=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fc909087cc3386955f21b4665731dbdaceefb1d8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1665087388, + "narHash": "sha256-FZFPuW9NWHJteATOf79rZfwfRn5fE0wi9kRzvGfDHPA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "95fda953f6db2e9496d2682c4fc7b82f959878f7", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_7": { + "locked": { + "lastModified": 1632864508, + "narHash": "sha256-d127FIvGR41XbVRDPVvozUPQ/uRHbHwvfyKHwEt5xFM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "82891b5e2c2359d7e58d08849e4c89511ab94234", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-21.05-small", + "type": "indirect" + } + }, + "nixpkgs_8": { + "locked": { + "lastModified": 1708681911, + "narHash": "sha256-M+5cnbsyX7ibpSGhQZ0J5nd8oakrT496uf7m2Vfh9Wc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "7a40e035af98adfb0e9db9b8c2b8775f8ea772a1", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "nosys": { + "locked": { + "lastModified": 1667881534, + "narHash": "sha256-FhwJ15uPLRsvaxtt/bNuqE/ykMpNAPF0upozFKhTtXM=", + "owner": "divnix", + "repo": "nosys", + "rev": "2d0d5207f6a230e9d0f660903f8db9807b54814f", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "nosys", + "type": "github" + } + }, + "old-ghc-nix": { + "flake": false, + "locked": { + "lastModified": 1631092763, + "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", + "owner": "angerman", + "repo": "old-ghc-nix", + "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", + "type": "github" + }, + "original": { + "owner": "angerman", + "ref": "master", + "repo": "old-ghc-nix", + "type": "github" + } + }, + "root": { + "inputs": { + "nixfmt": "nixfmt", + "nixpkgs": "nixpkgs_8", + "systems": "systems_2" + } + }, + "serokell-nix": { + "inputs": { + "deploy-rs": "deploy-rs", + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_2", + "get-tested-src": "get-tested-src", + "gitignore-nix": "gitignore-nix", + "haskell-nix": "haskell-nix", + "nix": "nix_2", + "nixpkgs": [ + "nixfmt", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1695391091, + "narHash": "sha256-vYBB7s9bJxgmMQXFg4XWSd3VW4CYjnBRy7mkv1QXsiE=", + "owner": "serokell", + "repo": "serokell.nix", + "rev": "567820afeec19e53b134038a3f307171eaa6668f", + "type": "github" + }, + "original": { + "owner": "serokell", + "repo": "serokell.nix", + "type": "github" + } + }, + "stackage": { + "flake": false, + "locked": { + "lastModified": 1678925630, + "narHash": "sha256-rl8qnpAUJl4tRZpaZ5DpgSueNfreArW09t4zTnOaoYA=", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "bf29b23fb77017e78c6e7b199b2c7bfb5079c4cd", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "stackage.nix", + "type": "github" + } + }, + "std": { + "inputs": { + "arion": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "blank" + ], + "blank": "blank", + "devshell": "devshell", + "dmerge": "dmerge", + "flake-utils": "flake-utils_5", + "incl": "incl", + "makes": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "blank" + ], + "microvm": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "blank" + ], + "n2c": "n2c", + "nixago": "nixago", + "nixpkgs": "nixpkgs_6", + "nosys": "nosys", + "yants": "yants" + }, + "locked": { + "lastModified": 1674526466, + "narHash": "sha256-tMTaS0bqLx6VJ+K+ZT6xqsXNpzvSXJTmogkraBGzymg=", + "owner": "divnix", + "repo": "std", + "rev": "516387e3d8d059b50e742a2ff1909ed3c8f82826", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "std", + "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" + } + }, + "systems_2": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "tullia": { + "inputs": { + "nix-nomad": "nix-nomad", + "nix2container": "nix2container", + "nixpkgs": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "nixpkgs" + ], + "std": "std" + }, + "locked": { + "lastModified": 1675695930, + "narHash": "sha256-B7rEZ/DBUMlK1AcJ9ajnAPPxqXY6zW2SBX+51bZV0Ac=", + "owner": "input-output-hk", + "repo": "tullia", + "rev": "621365f2c725608f381b3ad5b57afef389fd4c31", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "tullia", + "type": "github" + } + }, + "utils": { + "locked": { + "lastModified": 1648297722, + "narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_2": { + "locked": { + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "yants": { + "inputs": { + "nixpkgs": [ + "nixfmt", + "serokell-nix", + "haskell-nix", + "tullia", + "std", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1667096281, + "narHash": "sha256-wRRec6ze0gJHmGn6m57/zhz/Kdvp9HS4Nl5fkQ+uIuA=", + "owner": "divnix", + "repo": "yants", + "rev": "d18f356ec25cb94dc9c275870c3a7927a10f8c3c", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "yants", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f2f94f4 --- /dev/null +++ b/flake.nix @@ -0,0 +1,24 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + systems.url = "github:nix-systems/default-linux"; + nixfmt.url = "github:serokell/nixfmt"; + }; + + outputs = { self, nixpkgs, systems, nixfmt }: + let + inherit (nixpkgs) lib; + + eachSystem = lib.genAttrs (import systems); + pkgsFor = + eachSystem (system: import nixpkgs { localSystem.system = system; }); + in { + packages = eachSystem (system: + let pkgs = pkgsFor.${system}; + in pkgs.callPackage ./nix/packages.nix { } // { + default = self.packages.${system}.factorio-sat; + }); + + formatter = eachSystem (system: nixfmt.packages.${system}.default); + }; +} diff --git a/nix/antlr/default.nix b/nix/antlr/default.nix new file mode 100644 index 0000000..8bd2ea6 --- /dev/null +++ b/nix/antlr/default.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, callPackage, python3, libuuid }: +let + # This import is a builder extracted from Nixpkgs. + mkAntlr = callPackage ./mk-antlr.nix { }; + + versions."4.7.2" = { + + antlr = (mkAntlr { + version = "4.7.2"; + sourceSha256 = "sha256-kta+K/c6cUdOuW6jWMpX4tA22GXsaDBwtalzw4z+gN4="; + jarSha256 = "sha256-aFI4bXl17/KRcdrgAswiMlFRDTXyka4neUjzgaezgLQ="; + extraCppBuildInputs = lib.optional stdenv.isLinux libuuid; + extraCppCmakeFlags = [ "-DANTLR4_INSTALL=ON" ]; + }).antlr; + + pythonOverrides = pypkgs: pypkgs0: { + antlr4-python3-runtime = pypkgs.toPythonModule + ((pypkgs0.antlr4-python3-runtime.override { + antlr4 = versions."4.7.2".antlr; + }).overridePythonAttrs { + postPatch = ""; + doCheck = false; + }); + }; + + }; +in versions diff --git a/nix/antlr/mk-antlr.nix b/nix/antlr/mk-antlr.nix new file mode 100644 index 0000000..c5e56f5 --- /dev/null +++ b/nix/antlr/mk-antlr.nix @@ -0,0 +1,98 @@ +# Copied from Nixpkgs +# + +{ lib, stdenv, fetchurl, jre, fetchFromGitHub, cmake, ninja, pkg-config + +# darwin only +, CoreFoundation ? null + + # ANTLR 4.8 & 4.9 +, libuuid + +# ANTLR 4.9 +, utf8cpp }: +{ version, sourceSha256, jarSha256, extraCppBuildInputs ? [ ] +, extraCppCmakeFlags ? [ ] }: rec { + source = fetchFromGitHub { + owner = "antlr"; + repo = "antlr4"; + rev = version; + sha256 = sourceSha256; + }; + + antlr = stdenv.mkDerivation { + pname = "antlr"; + inherit version; + + src = fetchurl { + url = "https://www.antlr.org/download/antlr-${version}-complete.jar"; + sha256 = jarSha256; + }; + + dontUnpack = true; + + installPhase = '' + mkdir -p "$out"/{share/java,bin} + cp "$src" "$out/share/java/antlr-${version}-complete.jar" + + echo "#! ${stdenv.shell}" >> "$out/bin/antlr" + echo "'${jre}/bin/java' -cp '$out/share/java/antlr-${version}-complete.jar:$CLASSPATH' -Xmx500M org.antlr.v4.Tool \"\$@\"" >> "$out/bin/antlr" + + echo "#! ${stdenv.shell}" >> "$out/bin/antlr-parse" + echo "'${jre}/bin/java' -cp '$out/share/java/antlr-${version}-complete.jar:$CLASSPATH' -Xmx500M org.antlr.v4.gui.Interpreter \"\$@\"" >> "$out/bin/antlr-parse" + + echo "#! ${stdenv.shell}" >> "$out/bin/grun" + echo "'${jre}/bin/java' -cp '$out/share/java/antlr-${version}-complete.jar:$CLASSPATH' org.antlr.v4.gui.TestRig \"\$@\"" >> "$out/bin/grun" + + chmod a+x "$out/bin/antlr" "$out/bin/antlr-parse" "$out/bin/grun" + ln -s "$out/bin/antlr"{,4} + ln -s "$out/bin/antlr"{,4}-parse + ''; + + inherit jre; + + passthru = { + inherit runtime; + jarLocation = "${antlr}/share/java/antlr-${version}-complete.jar"; + }; + + meta = with lib; { + description = "Powerful parser generator"; + longDescription = '' + ANTLR (ANother Tool for Language Recognition) is a powerful parser + generator for reading, processing, executing, or translating structured + text or binary files. It's widely used to build languages, tools, and + frameworks. From a grammar, ANTLR generates a parser that can build and + walk parse trees. + ''; + homepage = "https://www.antlr.org/"; + sourceProvenance = with sourceTypes; [ binaryBytecode ]; + license = licenses.bsd3; + platforms = platforms.unix; + }; + }; + + runtime = { + cpp = stdenv.mkDerivation { + pname = "antlr-runtime-cpp"; + inherit version; + src = source; + sourceRoot = "${source.name}/runtime/Cpp"; + + outputs = [ "out" "dev" "doc" ]; + + nativeBuildInputs = [ cmake ninja pkg-config ]; + buildInputs = lib.optional stdenv.isDarwin CoreFoundation + ++ extraCppBuildInputs; + + cmakeFlags = extraCppCmakeFlags; + + meta = with lib; { + description = "C++ target for ANTLR 4"; + homepage = "https://www.antlr.org/"; + license = licenses.bsd3; + platforms = platforms.unix; + }; + }; + }; +} diff --git a/nix/factorio-sat.nix b/nix/factorio-sat.nix new file mode 100644 index 0000000..e680977 --- /dev/null +++ b/nix/factorio-sat.nix @@ -0,0 +1,32 @@ +{ sourceRoot ? ../., lib, buildPythonApplication, makeWrapper, setuptools +, pygame, pillow, pyopengl, graphviz, ffmpeg-python, numpy, python-sat +, luaparser, }: +let + self = buildPythonApplication { + pname = "Factorio-SAT"; + version = "unstable"; + + src = sourceRoot; + pyproject = true; + + nativeBuildInputs = [ setuptools makeWrapper ]; + + dependencies = [ + numpy + python-sat + luaparser + (pygame.overrideAttrs { + # evidently broken at the moment + installCheckPhase = ""; + }) + pillow + pyopengl + graphviz + ffmpeg-python + ]; + + preBuild = '' + sed -i 's/python-sat/python-sat==${python-sat.version}/g' pyproject.toml + ''; + }; +in self diff --git a/nix/luaparser.nix b/nix/luaparser.nix new file mode 100644 index 0000000..1a7fd16 --- /dev/null +++ b/nix/luaparser.nix @@ -0,0 +1,14 @@ +{ lib, buildPythonPackage, fetchPypi, setuptools-scm, setuptools, six +, multimethod, antlr4, antlr4-python3-runtime }: +buildPythonPackage rec { + pname = "luaparser"; + version = "3.2.1"; + pyproject = true; + src = fetchPypi { + inherit pname version; + hash = "sha256-7oF6Wc5C/fqRmXoludubGkGRruVIwjeeNqNI4ukCUmk="; + }; + # I don't know how python dependencies work but this does + build-system = [ setuptools-scm ]; + dependencies = [ setuptools six antlr4 antlr4-python3-runtime multimethod ]; +} diff --git a/nix/packages.nix b/nix/packages.nix new file mode 100644 index 0000000..1bf23ff --- /dev/null +++ b/nix/packages.nix @@ -0,0 +1,18 @@ +{ lib, callPackage, python3 }: +let + antlr4_7_2 = (callPackage ./antlr { })."4.7.2"; + + python = python3.override { + self = python; + packageOverrides = lib.composeManyExtensions [ + antlr4_7_2.pythonOverrides + (pypkgs: _: { + luaparser = pypkgs.toPythonModule (pypkgs.callPackage ./luaparser.nix { }); + }) + ]; + }; + + factorio-sat = python.pkgs.callPackage ./factorio-sat.nix { }; +in { + inherit factorio-sat; +} From d09e4e26247550a1c2eabe663ff14c7944cf3977 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sat, 2 Mar 2024 01:06:10 -0700 Subject: [PATCH 02/18] use XDG_CONFIG_HOME for assets --- factorio_sat/assets/fetch.py | 26 ++++++++++++++++---------- factorio_sat/tilemaps.py | 32 +++++++++++++++++--------------- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/factorio_sat/assets/fetch.py b/factorio_sat/assets/fetch.py index 5220546..0e256c4 100644 --- a/factorio_sat/assets/fetch.py +++ b/factorio_sat/assets/fetch.py @@ -3,8 +3,12 @@ import json import shutil import sys +import os + from os import path +ASSETS_DIR = path.join(os.getenv("XDG_DATA_HOME"), "factorio-sat/assets") + try: from luaparser import ast except ModuleNotFoundError: @@ -12,8 +16,8 @@ ast = None -def fetch_tilemaps(base_directory: str): - graphics_directory = path.join(base_directory, 'graphics', 'entity') +def copy_game_tilemaps(base_dir: str, assets_dir: str): + graphics_dir = path.join(base_dir, 'graphics', 'entity') files = [ ('assembling-machine-1', 'hr-assembling-machine-1.png'), @@ -46,8 +50,9 @@ def fetch_tilemaps(base_directory: str): ] for file in files: - source = path.join(graphics_directory, *file) - destination = path.join(path.dirname(__file__), file[-1]) + source = path.join(graphics_dir, *file) + + destination = path.join(assets_dir, file[-1]) print('Copying: {} -> {}'.format(source, destination)) shutil.copyfile(source, destination) @@ -130,9 +135,9 @@ def get_recipes_for_variant(data, variant): return recipes -def fetch_recipes(base_directory): +def copy_game_recipes(base_dir, assets_dir): data = [] - for file in glob.glob(path.join(base_directory, 'prototypes', 'recipe', '*.lua')): + for file in glob.glob(path.join(base_dir, 'prototypes', 'recipe', '*.lua')): with open(file) as f: text = f.read() @@ -142,7 +147,7 @@ def fetch_recipes(base_directory): data += entry for variant in ('normal', 'expensive'): - with open(path.join(path.dirname(__file__), f'{variant}-recipes.json'), 'w') as f: + with open(path.join(assets_dir, f'{variant}-recipes.json'), 'w') as f: json.dump(get_recipes_for_variant(data, variant), f) @@ -170,11 +175,12 @@ def main(): if not path.exists(game_directory): raise RuntimeError('Factorio not found at: {}'.format(game_directory)) - base_directory = path.join(game_directory, 'data', 'base') + game_base_dir = path.join(game_directory, 'data', 'base') - fetch_tilemaps(base_directory) + os.makedirs(ASSETS_DIR, exist_ok=True) + copy_game_tilemaps(game_base_dir, ASSETS_DIR) if ast is not None: - fetch_recipes(base_directory) + copy_game_recipes(game_base_dir, ASSETS_DIR) if __name__ == '__main__': diff --git a/factorio_sat/tilemaps.py b/factorio_sat/tilemaps.py index 8b4d1f3..55dc3a3 100644 --- a/factorio_sat/tilemaps.py +++ b/factorio_sat/tilemaps.py @@ -1,9 +1,12 @@ +import os + from typing import * from os import path from OpenGL.GL import * from PIL import Image +ASSETS_DIR = os.path.join(os.getenv("XDG_DATA_HOME"), "factorio-sat/assets") def get_texture_size(texture: int) -> Tuple[int, int]: glBindTexture(GL_TEXTURE_2D, texture) @@ -88,29 +91,28 @@ def render(self, x, y, lower=(0, 0), upper=(1, 1)): def init(): global BELT, UNDERGROUND, SPLITTER_EAST, SPLITTER_WEST, SPLITTER_NORTH, SPLITTER_SOUTH, INSERTER_PLATFORM, INSERTER_HAND_BASE, INSERTER_HAND_OPEN, INSERTER_HAND_CLOSED, ASSEMBLING_MACHINE - base_path = path.join(path.dirname(__file__), 'assets') - BELT = Tilemap(load_image(path.join(base_path, 'hr-transport-belt.png')), (128, 128), PIXELS_PER_UNIT) - UNDERGROUND = Tilemap(load_image(path.join(base_path, 'hr-underground-belt-structure.png')), (192, 192), PIXELS_PER_UNIT) + BELT = Tilemap(load_image(path.join(ASSETS_DIR, 'hr-transport-belt.png')), (128, 128), PIXELS_PER_UNIT) + UNDERGROUND = Tilemap(load_image(path.join(ASSETS_DIR, 'hr-underground-belt-structure.png')), (192, 192), PIXELS_PER_UNIT) SPLITTER_EAST = [ - Tilemap(load_image(path.join(base_path, 'hr-splitter-east.png')), (90, 84), PIXELS_PER_UNIT), - Tilemap(load_image(path.join(base_path, 'hr-splitter-east-top_patch.png')), (90, 104), PIXELS_PER_UNIT), + Tilemap(load_image(path.join(ASSETS_DIR, 'hr-splitter-east.png')), (90, 84), PIXELS_PER_UNIT), + Tilemap(load_image(path.join(ASSETS_DIR, 'hr-splitter-east-top_patch.png')), (90, 104), PIXELS_PER_UNIT), ] SPLITTER_WEST = [ - Tilemap(load_image(path.join(base_path, 'hr-splitter-west.png')), (90, 86), PIXELS_PER_UNIT), - Tilemap(load_image(path.join(base_path, 'hr-splitter-west-top_patch.png')), (90, 96), PIXELS_PER_UNIT), + Tilemap(load_image(path.join(ASSETS_DIR, 'hr-splitter-west.png')), (90, 86), PIXELS_PER_UNIT), + Tilemap(load_image(path.join(ASSETS_DIR, 'hr-splitter-west-top_patch.png')), (90, 96), PIXELS_PER_UNIT), ] - SPLITTER_SOUTH = Tilemap(load_image(path.join(base_path, 'hr-splitter-south.png')), (164, 64), PIXELS_PER_UNIT) - SPLITTER_NORTH = Tilemap(load_image(path.join(base_path, 'hr-splitter-north.png')), (160, 70), PIXELS_PER_UNIT) + SPLITTER_SOUTH = Tilemap(load_image(path.join(ASSETS_DIR, 'hr-splitter-south.png')), (164, 64), PIXELS_PER_UNIT) + SPLITTER_NORTH = Tilemap(load_image(path.join(ASSETS_DIR, 'hr-splitter-north.png')), (160, 70), PIXELS_PER_UNIT) - INSERTER_PLATFORM = Tilemap(load_image(path.join(base_path, 'hr-inserter-platform.png')), (105, 79), - PIXELS_PER_UNIT), Tilemap(load_image(path.join(base_path, 'hr-long-handed-inserter-platform.png')), (105, 79), PIXELS_PER_UNIT) + INSERTER_PLATFORM = Tilemap(load_image(path.join(ASSETS_DIR, 'hr-inserter-platform.png')), (105, 79), + PIXELS_PER_UNIT), Tilemap(load_image(path.join(ASSETS_DIR, 'hr-long-handed-inserter-platform.png')), (105, 79), PIXELS_PER_UNIT) - INSERTER_HAND_BASE = load_image(path.join(base_path, 'hr-inserter-hand-base.png')), load_image(path.join(base_path, 'hr-long-handed-inserter-hand-base.png')) - INSERTER_HAND_OPEN = load_image(path.join(base_path, 'hr-inserter-hand-open.png')), load_image(path.join(base_path, 'hr-long-handed-inserter-hand-open.png')) - INSERTER_HAND_CLOSED = load_image(path.join(base_path, 'hr-inserter-hand-closed.png')), load_image(path.join(base_path, 'hr-long-handed-inserter-hand-closed.png')) + INSERTER_HAND_BASE = load_image(path.join(ASSETS_DIR, 'hr-inserter-hand-base.png')), load_image(path.join(ASSETS_DIR, 'hr-long-handed-inserter-hand-base.png')) + INSERTER_HAND_OPEN = load_image(path.join(ASSETS_DIR, 'hr-inserter-hand-open.png')), load_image(path.join(ASSETS_DIR, 'hr-long-handed-inserter-hand-open.png')) + INSERTER_HAND_CLOSED = load_image(path.join(ASSETS_DIR, 'hr-inserter-hand-closed.png')), load_image(path.join(ASSETS_DIR, 'hr-long-handed-inserter-hand-closed.png')) - ASSEMBLING_MACHINE = Tilemap(load_image(path.join(base_path, 'hr-assembling-machine-1.png')), (214, 226), PIXELS_PER_UNIT) + ASSEMBLING_MACHINE = Tilemap(load_image(path.join(ASSETS_DIR, 'hr-assembling-machine-1.png')), (214, 226), PIXELS_PER_UNIT) PIXELS_PER_UNIT = 64 From a9766a1d519af9489344641dc1cfafe3b69afed3 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sat, 2 Mar 2024 02:14:16 -0700 Subject: [PATCH 03/18] nix: add cli package --- nix/cli.nix | 39 +++++++++++++++++++++++++++++++++++++++ nix/packages.nix | 8 +++++--- 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 nix/cli.nix diff --git a/nix/cli.nix b/nix/cli.nix new file mode 100644 index 0000000..6210138 --- /dev/null +++ b/nix/cli.nix @@ -0,0 +1,39 @@ +{ lib, writeShellApplication, factorio-sat, }: +let + exes = lib.pipe (builtins.readDir "${factorio-sat}/bin") [ + (lib.filterAttrs + (name: kind: kind == "regular" && !(lib.hasPrefix "." name))) + (lib.mapAttrsToList (name: _: name)) + (lib.traceValSeq) + ]; +in writeShellApplication { + name = "factorio-sat"; + text = '' + show_cmds() { + echo '${lib.concatStringsSep ", " exes}' + } + + if [[ $# -eq 0 ]]; then + echo 'Need subcommand.' + echo + show_cmds + fi + + exe="$1" + shift 1 + case "$exe" in + ${ + lib.concatMapStrings (exe: '' + ${exe}) + ${lib.getExe' factorio-sat exe} "$@" + ;; + '') exes + } + *) + echo "No such subcommand: $exe" + echo + show_cmds + exit 1 + esac + ''; +} diff --git a/nix/packages.nix b/nix/packages.nix index 1bf23ff..eabda58 100644 --- a/nix/packages.nix +++ b/nix/packages.nix @@ -7,12 +7,14 @@ let packageOverrides = lib.composeManyExtensions [ antlr4_7_2.pythonOverrides (pypkgs: _: { - luaparser = pypkgs.toPythonModule (pypkgs.callPackage ./luaparser.nix { }); + luaparser = + pypkgs.toPythonModule (pypkgs.callPackage ./luaparser.nix { }); }) ]; }; factorio-sat = python.pkgs.callPackage ./factorio-sat.nix { }; -in { - inherit factorio-sat; + factorio-sat-cli = callPackage ./cli.nix { inherit factorio-sat; }; +in { # # + inherit factorio-sat factorio-sat-cli; } From 229d33cd52821f2b25a69111b6504b715e2ac3ce Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sat, 2 Mar 2024 02:21:53 -0700 Subject: [PATCH 04/18] nix: add default overlay --- flake.nix | 2 ++ nix/overlay.nix | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 nix/overlay.nix diff --git a/flake.nix b/flake.nix index f2f94f4..ba376f5 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,8 @@ pkgsFor = eachSystem (system: import nixpkgs { localSystem.system = system; }); in { + overlays.default = import ./nix/overlay.nix; + packages = eachSystem (system: let pkgs = pkgsFor.${system}; in pkgs.callPackage ./nix/packages.nix { } // { diff --git a/nix/overlay.nix b/nix/overlay.nix new file mode 100644 index 0000000..875dc6d --- /dev/null +++ b/nix/overlay.nix @@ -0,0 +1,18 @@ +pkgs: pkgs0: +let + inherit (pkgs) lib; + antlr4_7_2 = (pkgs.callPackage ./antlr { })."4.7.2"; + python = pkgs.python3.override { + self = python; + packageOverrides = lib.composeManyExtensions [ + antlr4_7_2.pythonOverrides + (pypkgs: _: { + luaparser = + pypkgs.toPythonModule (pypkgs.callPackage ./luaparser.nix { }); + }) + ]; + }; +in { + factorio-sat = python.pkgs.callPackage ./factorio-sat.nix { }; + factorio-sat-cli = pkgs.callPackage ./cli.nix { }; +} From 21439fdc130d539f77f280e4f83b18f98c488a8a Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sat, 2 Mar 2024 02:28:45 -0700 Subject: [PATCH 05/18] flake: inherit packages from applied overlays --- flake.nix | 16 +++++++++------- nix/packages.nix | 20 -------------------- 2 files changed, 9 insertions(+), 27 deletions(-) delete mode 100644 nix/packages.nix diff --git a/flake.nix b/flake.nix index ba376f5..1df42d8 100644 --- a/flake.nix +++ b/flake.nix @@ -10,16 +10,18 @@ inherit (nixpkgs) lib; eachSystem = lib.genAttrs (import systems); - pkgsFor = - eachSystem (system: import nixpkgs { localSystem.system = system; }); + pkgsFor = eachSystem (system: + import nixpkgs { + localSystem.system = system; + overlays = [ self.overlays.default ]; + }); in { overlays.default = import ./nix/overlay.nix; - packages = eachSystem (system: - let pkgs = pkgsFor.${system}; - in pkgs.callPackage ./nix/packages.nix { } // { - default = self.packages.${system}.factorio-sat; - }); + packages = eachSystem (system: { + inherit (pkgsFor.${system}) factorio-sat factorio-sat-cli; + default = self.packages.${system}.factorio-sat; + }); formatter = eachSystem (system: nixfmt.packages.${system}.default); }; diff --git a/nix/packages.nix b/nix/packages.nix deleted file mode 100644 index eabda58..0000000 --- a/nix/packages.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ lib, callPackage, python3 }: -let - antlr4_7_2 = (callPackage ./antlr { })."4.7.2"; - - python = python3.override { - self = python; - packageOverrides = lib.composeManyExtensions [ - antlr4_7_2.pythonOverrides - (pypkgs: _: { - luaparser = - pypkgs.toPythonModule (pypkgs.callPackage ./luaparser.nix { }); - }) - ]; - }; - - factorio-sat = python.pkgs.callPackage ./factorio-sat.nix { }; - factorio-sat-cli = callPackage ./cli.nix { inherit factorio-sat; }; -in { # # - inherit factorio-sat factorio-sat-cli; -} From effe9dec65df91fb941ac6c85b6c35fae1f44cf3 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sat, 2 Mar 2024 03:57:01 -0700 Subject: [PATCH 06/18] flake: add devShell with commands --- flake.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 1df42d8..f3cbdf8 100644 --- a/flake.nix +++ b/flake.nix @@ -16,12 +16,20 @@ overlays = [ self.overlays.default ]; }); in { - overlays.default = import ./nix/overlay.nix; + devShells = lib.mapAttrs (system: pkgs: { + default = pkgs.mkShell { + packages = [ pkgs.factorio-sat pkgs.factorio-sat-cli ]; + }; + }) pkgsFor; - packages = eachSystem (system: { - inherit (pkgsFor.${system}) factorio-sat factorio-sat-cli; + overlays = { + default = import ./nix/overlay.nix; + }; + + packages = lib.mapAttrs (system: pkgs: { + inherit (pkgs) factorio-sat factorio-sat-cli; default = self.packages.${system}.factorio-sat; - }); + }) pkgsFor; formatter = eachSystem (system: nixfmt.packages.${system}.default); }; From c29df86a277af718d8286e37f73d03c868e85d2c Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 18 Aug 2024 13:29:23 -0700 Subject: [PATCH 07/18] flake: inputs: update nixpkgs --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 8392bd8..b355147 100644 --- a/flake.lock +++ b/flake.lock @@ -1018,11 +1018,11 @@ }, "nixpkgs_8": { "locked": { - "lastModified": 1708681911, - "narHash": "sha256-M+5cnbsyX7ibpSGhQZ0J5nd8oakrT496uf7m2Vfh9Wc=", + "lastModified": 1724011724, + "narHash": "sha256-YMMETBa2U31DJHuQkOjFTrdn89KEz1WfyG4HCUQzcXU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7a40e035af98adfb0e9db9b8c2b8775f8ea772a1", + "rev": "757247cb45d828a765660149e687a610a31ab622", "type": "github" }, "original": { From 7ba8915c54b1ab0e67652b14dfe7e4d095a83bd3 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 18 Aug 2024 13:32:18 -0700 Subject: [PATCH 08/18] flake: inputs: remove nixfmt (use from nixpkgs) --- flake.lock | 1244 +--------------------------------------------------- flake.nix | 10 +- 2 files changed, 6 insertions(+), 1248 deletions(-) diff --git a/flake.lock b/flake.lock index b355147..00626e3 100644 --- a/flake.lock +++ b/flake.lock @@ -1,1022 +1,6 @@ { "nodes": { - "HTTP": { - "flake": false, - "locked": { - "lastModified": 1451647621, - "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", - "owner": "phadej", - "repo": "HTTP", - "rev": "9bc0996d412fef1787449d841277ef663ad9a915", - "type": "github" - }, - "original": { - "owner": "phadej", - "repo": "HTTP", - "type": "github" - } - }, - "blank": { - "locked": { - "lastModified": 1625557891, - "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", - "owner": "divnix", - "repo": "blank", - "rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "blank", - "type": "github" - } - }, - "cabal-32": { - "flake": false, - "locked": { - "lastModified": 1603716527, - "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=", - "owner": "haskell", - "repo": "cabal", - "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.2", - "repo": "cabal", - "type": "github" - } - }, - "cabal-34": { - "flake": false, - "locked": { - "lastModified": 1645834128, - "narHash": "sha256-wG3d+dOt14z8+ydz4SL7pwGfe7SiimxcD/LOuPCV6xM=", - "owner": "haskell", - "repo": "cabal", - "rev": "5ff598c67f53f7c4f48e31d722ba37172230c462", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.4", - "repo": "cabal", - "type": "github" - } - }, - "cabal-36": { - "flake": false, - "locked": { - "lastModified": 1669081697, - "narHash": "sha256-I5or+V7LZvMxfbYgZATU4awzkicBwwok4mVoje+sGmU=", - "owner": "haskell", - "repo": "cabal", - "rev": "8fd619e33d34924a94e691c5fea2c42f0fc7f144", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.6", - "repo": "cabal", - "type": "github" - } - }, - "cardano-shell": { - "flake": false, - "locked": { - "lastModified": 1608537748, - "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", - "owner": "input-output-hk", - "repo": "cardano-shell", - "rev": "9392c75087cb9a3d453998f4230930dea3a95725", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "cardano-shell", - "type": "github" - } - }, - "deploy-rs": { - "inputs": { - "flake-compat": "flake-compat_2", - "nixpkgs": "nixpkgs_2", - "utils": "utils" - }, - "locked": { - "lastModified": 1648475189, - "narHash": "sha256-gAGAS6IagwoUr1B0ohE3iR6sZ8hP4LSqzYLC8Mq3WGU=", - "owner": "serokell", - "repo": "deploy-rs", - "rev": "83e0c78291cd08cb827ba0d553ad9158ae5a95c3", - "type": "github" - }, - "original": { - "id": "deploy-rs", - "type": "indirect" - } - }, - "devshell": { - "inputs": { - "flake-utils": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "flake-utils" - ], - "nixpkgs": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1663445644, - "narHash": "sha256-+xVlcK60x7VY1vRJbNUEAHi17ZuoQxAIH4S4iUFUGBA=", - "owner": "numtide", - "repo": "devshell", - "rev": "e3dc3e21594fe07bdb24bdf1c8657acaa4cb8f66", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, - "dmerge": { - "inputs": { - "nixlib": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "nixpkgs" - ], - "yants": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "yants" - ] - }, - "locked": { - "lastModified": 1659548052, - "narHash": "sha256-fzI2gp1skGA8mQo/FBFrUAtY0GQkAIAaV/V127TJPyY=", - "owner": "divnix", - "repo": "data-merge", - "rev": "d160d18ce7b1a45b88344aa3f13ed1163954b497", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "data-merge", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1648199409, - "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_3": { - "flake": false, - "locked": { - "lastModified": 1627913399, - "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", - "type": "github" - }, - "original": { - "id": "flake-compat", - "type": "indirect" - } - }, - "flake-compat_4": { - "flake": false, - "locked": { - "lastModified": 1672831974, - "narHash": "sha256-z9k3MfslLjWQfnjBtEtJZdq3H7kyi2kQtUThfTgdRk0=", - "owner": "input-output-hk", - "repo": "flake-compat", - "rev": "45f2638735f8cdc40fe302742b79f248d23eb368", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "ref": "hkm/gitlab-fix", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_5": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "locked": { - "lastModified": 1631561581, - "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", - "type": "github" - }, - "original": { - "id": "flake-utils", - "type": "indirect" - } - }, - "flake-utils_3": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_5": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "get-tested-src": { - "flake": false, - "locked": { - "lastModified": 1687355864, - "narHash": "sha256-yQ4coxfnp2Jsw1kvwf2/Zn72Kltze2WrfHN54eLR070=", - "owner": "Sereja313", - "repo": "get-tested", - "rev": "455bbd047374ed907900b49641a4ea7f0a905709", - "type": "github" - }, - "original": { - "owner": "Sereja313", - "ref": "issue-8-emit-ghc-versions", - "repo": "get-tested", - "type": "github" - } - }, - "ghc-8.6.5-iohk": { - "flake": false, - "locked": { - "lastModified": 1600920045, - "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", - "owner": "input-output-hk", - "repo": "ghc", - "rev": "95713a6ecce4551240da7c96b6176f980af75cae", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "ref": "release/8.6.5-iohk", - "repo": "ghc", - "type": "github" - } - }, - "gitignore-nix": { - "flake": false, - "locked": { - "lastModified": 1611672876, - "narHash": "sha256-qHu3uZ/o9jBHiA3MEKHJ06k7w4heOhA+4HCSIvflRxo=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "211907489e9f198594c0eb0ca9256a1949c9d412", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "gomod2nix": { - "inputs": { - "nixpkgs": "nixpkgs_4", - "utils": "utils_2" - }, - "locked": { - "lastModified": 1655245309, - "narHash": "sha256-d/YPoQ/vFn1+GTmSdvbSBSTOai61FONxB4+Lt6w/IVI=", - "owner": "tweag", - "repo": "gomod2nix", - "rev": "40d32f82fc60d66402eb0972e6e368aeab3faf58", - "type": "github" - }, - "original": { - "owner": "tweag", - "repo": "gomod2nix", - "type": "github" - } - }, - "hackage": { - "flake": false, - "locked": { - "lastModified": 1678926579, - "narHash": "sha256-5t1QRBTsEM2wREtDf3xrHp9Kphs+AdQZKAEltaylIJQ=", - "owner": "input-output-hk", - "repo": "hackage.nix", - "rev": "fb58b0ba5773c5f0211f284b0fae061426cf8267", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "hackage.nix", - "type": "github" - } - }, - "haskell-nix": { - "inputs": { - "HTTP": "HTTP", - "cabal-32": "cabal-32", - "cabal-34": "cabal-34", - "cabal-36": "cabal-36", - "cardano-shell": "cardano-shell", - "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_3", - "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", - "hackage": "hackage", - "hpc-coveralls": "hpc-coveralls", - "hydra": "hydra", - "iserv-proxy": "iserv-proxy", - "nixpkgs": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "nixpkgs-unstable" - ], - "nixpkgs-2003": "nixpkgs-2003", - "nixpkgs-2105": "nixpkgs-2105", - "nixpkgs-2111": "nixpkgs-2111", - "nixpkgs-2205": "nixpkgs-2205", - "nixpkgs-2211": "nixpkgs-2211", - "nixpkgs-unstable": "nixpkgs-unstable", - "old-ghc-nix": "old-ghc-nix", - "stackage": "stackage", - "tullia": "tullia" - }, - "locked": { - "lastModified": 1678950661, - "narHash": "sha256-lvL54W90BTvwLVnFjPYmFVmgHyaGcFrt5FBy1F0rro8=", - "owner": "input-output-hk", - "repo": "haskell.nix", - "rev": "fce554bc6a41d12f7a18a0e8290bf43f925d7a29", - "type": "github" - }, - "original": { - "id": "haskell-nix", - "type": "indirect" - } - }, - "hpc-coveralls": { - "flake": false, - "locked": { - "lastModified": 1607498076, - "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", - "owner": "sevanspowell", - "repo": "hpc-coveralls", - "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", - "type": "github" - }, - "original": { - "owner": "sevanspowell", - "repo": "hpc-coveralls", - "type": "github" - } - }, - "hydra": { - "inputs": { - "nix": "nix", - "nixpkgs": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "hydra", - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1671755331, - "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", - "owner": "NixOS", - "repo": "hydra", - "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", - "type": "github" - }, - "original": { - "id": "hydra", - "type": "indirect" - } - }, - "incl": { - "inputs": { - "nixlib": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1669263024, - "narHash": "sha256-E/+23NKtxAqYG/0ydYgxlgarKnxmDbg6rCMWnOBqn9Q=", - "owner": "divnix", - "repo": "incl", - "rev": "ce7bebaee048e4cd7ebdb4cee7885e00c4e2abca", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "incl", - "type": "github" - } - }, - "iserv-proxy": { - "flake": false, - "locked": { - "lastModified": 1670983692, - "narHash": "sha256-avLo34JnI9HNyOuauK5R69usJm+GfW3MlyGlYxZhTgY=", - "ref": "hkm/remote-iserv", - "rev": "50d0abb3317ac439a4e7495b185a64af9b7b9300", - "revCount": 10, - "type": "git", - "url": "https://gitlab.haskell.org/hamishmack/iserv-proxy.git" - }, - "original": { - "ref": "hkm/remote-iserv", - "type": "git", - "url": "https://gitlab.haskell.org/hamishmack/iserv-proxy.git" - } - }, - "lowdown-src": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, - "lowdown-src_2": { - "flake": false, - "locked": { - "lastModified": 1632468475, - "narHash": "sha256-NNOm9CbdA8cuwbvaBHslGbPTiU6bh1Ao+MpEPx4rSGo=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "6bd668af3fd098bdd07a1bedd399564141e275da", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, - "n2c": { - "inputs": { - "flake-utils": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "flake-utils" - ], - "nixpkgs": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1665039323, - "narHash": "sha256-SAh3ZjFGsaCI8FRzXQyp56qcGdAqgKEfJWPCQ0Sr7tQ=", - "owner": "nlewo", - "repo": "nix2container", - "rev": "b008fe329ffb59b67bf9e7b08ede6ee792f2741a", - "type": "github" - }, - "original": { - "owner": "nlewo", - "repo": "nix2container", - "type": "github" - } - }, - "nix": { - "inputs": { - "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs_3", - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1661606874, - "narHash": "sha256-9+rpYzI+SmxJn+EbYxjGv68Ucp22bdFUSy/4LkHkkDQ=", - "owner": "NixOS", - "repo": "nix", - "rev": "11e45768b34fdafdcf019ddbd337afa16127ff0f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "2.11.0", - "repo": "nix", - "type": "github" - } - }, - "nix-nomad": { - "inputs": { - "flake-compat": "flake-compat_5", - "flake-utils": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "nix2container", - "flake-utils" - ], - "gomod2nix": "gomod2nix", - "nixpkgs": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "nixpkgs" - ], - "nixpkgs-lib": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1658277770, - "narHash": "sha256-T/PgG3wUn8Z2rnzfxf2VqlR1CBjInPE0l1yVzXxPnt0=", - "owner": "tristanpemble", - "repo": "nix-nomad", - "rev": "054adcbdd0a836ae1c20951b67ed549131fd2d70", - "type": "github" - }, - "original": { - "owner": "tristanpemble", - "repo": "nix-nomad", - "type": "github" - } - }, - "nix2container": { - "inputs": { - "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_5" - }, - "locked": { - "lastModified": 1658567952, - "narHash": "sha256-XZ4ETYAMU7XcpEeAFP3NOl9yDXNuZAen/aIJ84G+VgA=", - "owner": "nlewo", - "repo": "nix2container", - "rev": "60bb43d405991c1378baf15a40b5811a53e32ffa", - "type": "github" - }, - "original": { - "owner": "nlewo", - "repo": "nix2container", - "type": "github" - } - }, - "nix_2": { - "inputs": { - "lowdown-src": "lowdown-src_2", - "nixpkgs": "nixpkgs_7" - }, - "locked": { - "lastModified": 1633098935, - "narHash": "sha256-UtuBczommNLwUNEnfRI7822z4vPA7OoRKsgAZ8zsHQI=", - "owner": "nixos", - "repo": "nix", - "rev": "4f496150eb4e0012914c11f0a3ff4df2412b1d09", - "type": "github" - }, - "original": { - "id": "nix", - "type": "indirect" - } - }, - "nixago": { - "inputs": { - "flake-utils": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "flake-utils" - ], - "nixago-exts": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "blank" - ], - "nixpkgs": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1661824785, - "narHash": "sha256-/PnwdWoO/JugJZHtDUioQp3uRiWeXHUdgvoyNbXesz8=", - "owner": "nix-community", - "repo": "nixago", - "rev": "8c1f9e5f1578d4b2ea989f618588d62a335083c3", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixago", - "type": "github" - } - }, - "nixfmt": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "nixpkgs-stable": "nixpkgs-stable", - "serokell-nix": "serokell-nix" - }, - "locked": { - "lastModified": 1702548379, - "narHash": "sha256-QxxQ316RGZf2TjM7UxMFKEQk9cMS8kkO0Ffw8KE33pE=", - "owner": "serokell", - "repo": "nixfmt", - "rev": "422b1aebb44c4f12af025eda0ee6a99c6e50d738", - "type": "github" - }, - "original": { - "owner": "serokell", - "repo": "nixfmt", - "type": "github" - } - }, "nixpkgs": { - "locked": { - "lastModified": 1696165369, - "narHash": "sha256-pd1cjFHCoEf9q5f9B0HhlOwwpBI9RP3HbUE6xjI7wAI=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d7186d62bb68fac3c90f1d95515e613ef299e992", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2003": { - "locked": { - "lastModified": 1620055814, - "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-20.03-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2105": { - "locked": { - "lastModified": 1659914493, - "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2111": { - "locked": { - "lastModified": 1659446231, - "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.11-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2205": { - "locked": { - "lastModified": 1672580127, - "narHash": "sha256-3lW3xZslREhJogoOkjeZtlBtvFMyxHku7I/9IVehhT8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0874168639713f547c05947c76124f78441ea46c", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2211": { - "locked": { - "lastModified": 1675730325, - "narHash": "sha256-uNvD7fzO5hNlltNQUAFBPlcEjNG5Gkbhl/ROiX+GZU4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b7ce17b1ebf600a72178f6302c77b6382d09323f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.11-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-regression": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "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, - "narHash": "sha256-7gFSQbSVAFUHtGCNHPF7mPc5CcqDk9M2+inlVPZSneg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "747927516efcb5e31ba03b7ff32f61f6d47e7d87", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1648219316, - "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1657693803, - "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "365e1b3a859281cf11b94f87231adeabbdd878a2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.05-small", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1653581809, - "narHash": "sha256-Uvka0V5MTGbeOfWte25+tfRL3moECDh1VwokWSZUdoY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "83658b28fe638a170a19b8933aa008b30640fbd1", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_5": { - "locked": { - "lastModified": 1654807842, - "narHash": "sha256-ADymZpr6LuTEBXcy6RtFHcUZdjKTBRTMYwu19WOx17E=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "fc909087cc3386955f21b4665731dbdaceefb1d8", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_6": { - "locked": { - "lastModified": 1665087388, - "narHash": "sha256-FZFPuW9NWHJteATOf79rZfwfRn5fE0wi9kRzvGfDHPA=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "95fda953f6db2e9496d2682c4fc7b82f959878f7", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_7": { - "locked": { - "lastModified": 1632864508, - "narHash": "sha256-d127FIvGR41XbVRDPVvozUPQ/uRHbHwvfyKHwEt5xFM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "82891b5e2c2359d7e58d08849e4c89511ab94234", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-21.05-small", - "type": "indirect" - } - }, - "nixpkgs_8": { "locked": { "lastModified": 1724011724, "narHash": "sha256-YMMETBa2U31DJHuQkOjFTrdn89KEz1WfyG4HCUQzcXU=", @@ -1031,156 +15,13 @@ "type": "github" } }, - "nosys": { - "locked": { - "lastModified": 1667881534, - "narHash": "sha256-FhwJ15uPLRsvaxtt/bNuqE/ykMpNAPF0upozFKhTtXM=", - "owner": "divnix", - "repo": "nosys", - "rev": "2d0d5207f6a230e9d0f660903f8db9807b54814f", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "nosys", - "type": "github" - } - }, - "old-ghc-nix": { - "flake": false, - "locked": { - "lastModified": 1631092763, - "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", - "owner": "angerman", - "repo": "old-ghc-nix", - "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", - "type": "github" - }, - "original": { - "owner": "angerman", - "ref": "master", - "repo": "old-ghc-nix", - "type": "github" - } - }, "root": { "inputs": { - "nixfmt": "nixfmt", - "nixpkgs": "nixpkgs_8", - "systems": "systems_2" - } - }, - "serokell-nix": { - "inputs": { - "deploy-rs": "deploy-rs", - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_2", - "get-tested-src": "get-tested-src", - "gitignore-nix": "gitignore-nix", - "haskell-nix": "haskell-nix", - "nix": "nix_2", - "nixpkgs": [ - "nixfmt", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1695391091, - "narHash": "sha256-vYBB7s9bJxgmMQXFg4XWSd3VW4CYjnBRy7mkv1QXsiE=", - "owner": "serokell", - "repo": "serokell.nix", - "rev": "567820afeec19e53b134038a3f307171eaa6668f", - "type": "github" - }, - "original": { - "owner": "serokell", - "repo": "serokell.nix", - "type": "github" - } - }, - "stackage": { - "flake": false, - "locked": { - "lastModified": 1678925630, - "narHash": "sha256-rl8qnpAUJl4tRZpaZ5DpgSueNfreArW09t4zTnOaoYA=", - "owner": "input-output-hk", - "repo": "stackage.nix", - "rev": "bf29b23fb77017e78c6e7b199b2c7bfb5079c4cd", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "stackage.nix", - "type": "github" - } - }, - "std": { - "inputs": { - "arion": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "blank" - ], - "blank": "blank", - "devshell": "devshell", - "dmerge": "dmerge", - "flake-utils": "flake-utils_5", - "incl": "incl", - "makes": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "blank" - ], - "microvm": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "blank" - ], - "n2c": "n2c", - "nixago": "nixago", - "nixpkgs": "nixpkgs_6", - "nosys": "nosys", - "yants": "yants" - }, - "locked": { - "lastModified": 1674526466, - "narHash": "sha256-tMTaS0bqLx6VJ+K+ZT6xqsXNpzvSXJTmogkraBGzymg=", - "owner": "divnix", - "repo": "std", - "rev": "516387e3d8d059b50e742a2ff1909ed3c8f82826", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "std", - "type": "github" + "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" - } - }, - "systems_2": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -1194,87 +35,6 @@ "repo": "default-linux", "type": "github" } - }, - "tullia": { - "inputs": { - "nix-nomad": "nix-nomad", - "nix2container": "nix2container", - "nixpkgs": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "nixpkgs" - ], - "std": "std" - }, - "locked": { - "lastModified": 1675695930, - "narHash": "sha256-B7rEZ/DBUMlK1AcJ9ajnAPPxqXY6zW2SBX+51bZV0Ac=", - "owner": "input-output-hk", - "repo": "tullia", - "rev": "621365f2c725608f381b3ad5b57afef389fd4c31", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "tullia", - "type": "github" - } - }, - "utils": { - "locked": { - "lastModified": 1648297722, - "narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "utils_2": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "yants": { - "inputs": { - "nixpkgs": [ - "nixfmt", - "serokell-nix", - "haskell-nix", - "tullia", - "std", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1667096281, - "narHash": "sha256-wRRec6ze0gJHmGn6m57/zhz/Kdvp9HS4Nl5fkQ+uIuA=", - "owner": "divnix", - "repo": "yants", - "rev": "d18f356ec25cb94dc9c275870c3a7927a10f8c3c", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "yants", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index f3cbdf8..f5fb43c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,10 +2,9 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs"; systems.url = "github:nix-systems/default-linux"; - nixfmt.url = "github:serokell/nixfmt"; }; - outputs = { self, nixpkgs, systems, nixfmt }: + outputs = { self, nixpkgs, systems }: let inherit (nixpkgs) lib; @@ -22,15 +21,14 @@ }; }) pkgsFor; - overlays = { - default = import ./nix/overlay.nix; - }; + overlays = { default = import ./nix/overlay.nix; }; packages = lib.mapAttrs (system: pkgs: { inherit (pkgs) factorio-sat factorio-sat-cli; default = self.packages.${system}.factorio-sat; }) pkgsFor; - formatter = eachSystem (system: nixfmt.packages.${system}.default); + formatter = + eachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-classic); }; } From 247872b47fb45dffe307ce7480b0896606f46238 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 18 Aug 2024 13:37:18 -0700 Subject: [PATCH 09/18] nix: cli: remove trace --- nix/cli.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nix/cli.nix b/nix/cli.nix index 6210138..8c568ad 100644 --- a/nix/cli.nix +++ b/nix/cli.nix @@ -4,7 +4,6 @@ let (lib.filterAttrs (name: kind: kind == "regular" && !(lib.hasPrefix "." name))) (lib.mapAttrsToList (name: _: name)) - (lib.traceValSeq) ]; in writeShellApplication { name = "factorio-sat"; From af6baefbacbee1dc8b2d98da8ecb5cabecd23434 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 18 Aug 2024 13:43:09 -0700 Subject: [PATCH 10/18] flake: devShell: include inputsFrom factorio-sat --- flake.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index f5fb43c..ff52e68 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,8 @@ in { devShells = lib.mapAttrs (system: pkgs: { default = pkgs.mkShell { - packages = [ pkgs.factorio-sat pkgs.factorio-sat-cli ]; + inputsFrom = with pkgs; [ factorio-sat ]; + packages = with pkgs; [ factorio-sat factorio-sat-cli ]; }; }) pkgsFor; From 9d4024fd3421618ee2d3a9daecf9b4395b6b208e Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 18 Aug 2024 13:52:34 -0700 Subject: [PATCH 11/18] flake: apps: add cli as default --- flake.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flake.nix b/flake.nix index ff52e68..cde84ea 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,14 @@ overlays = [ self.overlays.default ]; }); in { + apps = lib.mapAttrs (system: pkgs: { + default = self.apps.${system}.cli; + cli = { + type = "app"; + program = lib.getExe pkgs.factorio-sat-cli; + }; + }) pkgsFor; + devShells = lib.mapAttrs (system: pkgs: { default = pkgs.mkShell { inputsFrom = with pkgs; [ factorio-sat ]; From 0a9ca90b0bd41bda2a96319f5866725a972c6235 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 18 Aug 2024 13:53:50 -0700 Subject: [PATCH 12/18] nix: cli: exit 1 if no subcommand --- nix/cli.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/cli.nix b/nix/cli.nix index 8c568ad..a3a32af 100644 --- a/nix/cli.nix +++ b/nix/cli.nix @@ -16,6 +16,7 @@ in writeShellApplication { echo 'Need subcommand.' echo show_cmds + exit 1 fi exe="$1" From b073ef870c429c7d89281672986f48f15c5c119f Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 18 Aug 2024 14:03:21 -0700 Subject: [PATCH 13/18] nix: package: get ver and name from pyproject.toml --- nix/factorio-sat.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/nix/factorio-sat.nix b/nix/factorio-sat.nix index e680977..f92cd50 100644 --- a/nix/factorio-sat.nix +++ b/nix/factorio-sat.nix @@ -1,10 +1,13 @@ -{ sourceRoot ? ../., lib, buildPythonApplication, makeWrapper, setuptools -, pygame, pillow, pyopengl, graphviz, ffmpeg-python, numpy, python-sat -, luaparser, }: +{ sourceRoot ? ../., lib, buildPythonApplication +, makeWrapper, setuptools, pygame, pillow, pyopengl, graphviz, ffmpeg-python +, numpy, python-sat, luaparser, }: let + pyproject = lib.importTOML "${sourceRoot}/pyproject.toml"; + version = pyproject.project.version; + self = buildPythonApplication { - pname = "Factorio-SAT"; - version = "unstable"; + pname = pyproject.project.name; + inherit version; src = sourceRoot; pyproject = true; From 5285dd36107938ce0b8de202ba7df255018e79a7 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 18 Aug 2024 14:12:07 -0700 Subject: [PATCH 14/18] nix: package: set meta attrs --- nix/factorio-sat.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/nix/factorio-sat.nix b/nix/factorio-sat.nix index f92cd50..7bf371a 100644 --- a/nix/factorio-sat.nix +++ b/nix/factorio-sat.nix @@ -1,6 +1,6 @@ -{ sourceRoot ? ../., lib, buildPythonApplication -, makeWrapper, setuptools, pygame, pillow, pyopengl, graphviz, ffmpeg-python -, numpy, python-sat, luaparser, }: +{ sourceRoot ? ../., lib, buildPythonApplication, makeWrapper, setuptools +, pygame, pillow, pyopengl, graphviz, ffmpeg-python, numpy, python-sat +, luaparser, }: let pyproject = lib.importTOML "${sourceRoot}/pyproject.toml"; version = pyproject.project.version; @@ -31,5 +31,13 @@ let preBuild = '' sed -i 's/python-sat/python-sat==${python-sat.version}/g' pyproject.toml ''; + + meta = { + inherit (pyproject.project.urls) homepage; + inherit (pyproject.project) description; + license = lib.licenses.gpl3Plus; + platforms = lib.platforms.all; + # mainProgram = there is none, use the factorio-sat-cli wrapper + }; }; in self From 9a1085e4b95fc2a6ab15ab34c917f1c9182742f5 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 18 Aug 2024 14:12:28 -0700 Subject: [PATCH 15/18] nix: package: meta: set myself as maintainer --- nix/factorio-sat.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/factorio-sat.nix b/nix/factorio-sat.nix index 7bf371a..1b1e0c1 100644 --- a/nix/factorio-sat.nix +++ b/nix/factorio-sat.nix @@ -38,6 +38,7 @@ let license = lib.licenses.gpl3Plus; platforms = lib.platforms.all; # mainProgram = there is none, use the factorio-sat-cli wrapper + maintainers = [ lib.maintainers.spikespaz ]; }; }; in self From 14ac6af0eb8116c593130b67fc4321e6a97b0288 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 18 Aug 2024 14:19:49 -0700 Subject: [PATCH 16/18] nix: package: append date and git rev to ver --- flake.nix | 2 +- nix/factorio-sat.nix | 11 +++++++---- nix/overlay.nix | 14 +++++++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index cde84ea..f759f59 100644 --- a/flake.nix +++ b/flake.nix @@ -30,7 +30,7 @@ }; }) pkgsFor; - overlays = { default = import ./nix/overlay.nix; }; + overlays = { default = import ./nix/overlay.nix { inherit self; }; }; packages = lib.mapAttrs (system: pkgs: { inherit (pkgs) factorio-sat factorio-sat-cli; diff --git a/nix/factorio-sat.nix b/nix/factorio-sat.nix index 1b1e0c1..56e9456 100644 --- a/nix/factorio-sat.nix +++ b/nix/factorio-sat.nix @@ -1,9 +1,12 @@ -{ sourceRoot ? ../., lib, buildPythonApplication, makeWrapper, setuptools -, pygame, pillow, pyopengl, graphviz, ffmpeg-python, numpy, python-sat -, luaparser, }: +{ sourceRoot ? ../., versionSuffix ? null, lib, buildPythonApplication +, makeWrapper, setuptools, pygame, pillow, pyopengl, graphviz, ffmpeg-python +, numpy, python-sat, luaparser, }: let pyproject = lib.importTOML "${sourceRoot}/pyproject.toml"; - version = pyproject.project.version; + version = if versionSuffix == null then + pyproject.project.version + else + pyproject.project.version + versionSuffix; self = buildPythonApplication { pname = pyproject.project.name; diff --git a/nix/overlay.nix b/nix/overlay.nix index 875dc6d..37b9478 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -1,3 +1,4 @@ +{ self }: pkgs: pkgs0: let inherit (pkgs) lib; @@ -12,7 +13,18 @@ let }) ]; }; + + mkDate = longDate: + (lib.concatStringsSep "-" [ + (builtins.substring 0 4 longDate) + (builtins.substring 4 2 longDate) + (builtins.substring 6 2 longDate) + ]); + date = mkDate (self.lastModifiedDate or "19700101"); + rev = self.shortRev or "dirty"; in { - factorio-sat = python.pkgs.callPackage ./factorio-sat.nix { }; + factorio-sat = python.pkgs.callPackage ./factorio-sat.nix { + versionSuffix = "+date=${date}_${rev}"; + }; factorio-sat-cli = pkgs.callPackage ./cli.nix { }; } From 4d5cc1370f1cd676ef457a72e7f7c92f1c20af2b Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 18 Aug 2024 14:22:19 -0700 Subject: [PATCH 17/18] flake: overlay: rename arg to pass flake check --- nix/overlay.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nix/overlay.nix b/nix/overlay.nix index 37b9478..7080a00 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -1,7 +1,9 @@ { self }: -pkgs: pkgs0: -let +final: _: +let pkgs = final; +in let inherit (pkgs) lib; + antlr4_7_2 = (pkgs.callPackage ./antlr { })."4.7.2"; python = pkgs.python3.override { self = python; From d2379cd77517d5822bc33cba0f9a5051c19ea23c Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 18 Aug 2024 17:03:58 -0700 Subject: [PATCH 18/18] nix: cli: fix unquoted binary path --- nix/cli.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/cli.nix b/nix/cli.nix index a3a32af..f56d296 100644 --- a/nix/cli.nix +++ b/nix/cli.nix @@ -25,7 +25,7 @@ in writeShellApplication { ${ lib.concatMapStrings (exe: '' ${exe}) - ${lib.getExe' factorio-sat exe} "$@" + '${lib.getExe' factorio-sat exe}' "$@" ;; '') exes }