diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..50c2f3f --- /dev/null +++ b/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "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" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1700883623, + "narHash": "sha256-L0VAwMUuJctNW94qLsF9nMDQ2CjM1evo9sLJm0p6N/g=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dc584735fc80a6fb657cc260136d85a9d6f61121", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..9e16972 --- /dev/null +++ b/flake.nix @@ -0,0 +1,53 @@ +{ + description = "Source files for my blog"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + haskellPackages = pkgs.haskellPackages; + + jailbreakUnbreak = pkg: + pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; })); + + packageName = "chaoszone"; + in rec { + packages.${packageName} = # (ref:haskell-package-def) + haskellPackages.callCabal2nix packageName self rec { + }; + + defaultPackage = self.packages.${system}.${packageName}; + + devShell = haskellPackages.shellFor { + packages = p: [ defaultPackage ]; + withHoogle = true; + buildInputs = with haskellPackages; [ + haskell-language-server + ghcid + cabal-install + ]; + }; + #devShell = pkgs.mkShell { + # buildInputs = with haskellPackages; [ + # haskell-language-server + # ghcid + # cabal-install + # ]; + # nativeBuildInputs = with pkgs; [ + # pkg-config + # glib + # freetype + # glew + # SDL2 + # ]; + # inputsFrom = builtins.attrValues self.packages.${system}; + #}; + }); +} +