summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..dcc0b7a
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,44 @@
+{
+ description = "A purely functional wayland compositor.";
+
+ inputs = {
+ nixpkgs = {
+ url = "github:nixos/nixpkgs/nixos-unstable";
+ };
+ flake-utils = {
+ url = "github:numtide/flake-utils";
+ };
+ nixos-apple-silicon = {
+ url = "github:tpwrules/nixos-apple-silicon";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs = { self, nixpkgs, flake-utils, nixos-apple-silicon }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ shell = name: overlays:
+ let
+ pkgs = import nixpkgs {
+ inherit system overlays;
+ };
+ haskell = pkgs.haskellPackages.ghcWithPackages (p:
+ with p; [ microlens microlens-mtl microlens-th haskell-language-server ]);
+ in
+ pkgs.mkShell {
+ inherit name;
+ packages = [ haskell pkgs.pkg-config pkgs.wayland pkgs.cabal-install ];
+ hardeningDisable = [ "fortify" ];
+ };
+ in
+ {
+ devShells = {
+ default = shell "highway" [];
+ asahi = shell "highway-asahi" [
+ (final: prev: {
+ mesa = nixos-apple-silicon.packages.${system}.mesa-asahi-edge;
+ })
+ ];
+ };
+ });
+}