From 307f8125e2f3e0d5d6ddc2a278e393a973923180 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sun, 25 Aug 2024 13:15:02 -0400 Subject: [PATCH] Switch to process-compose-flake --- flake.lock | 34 +++++++++------------------------- flake.nix | 28 ++++++++++++++-------------- justfile | 2 +- 3 files changed, 24 insertions(+), 40 deletions(-) diff --git a/flake.lock b/flake.lock index 2167049..13dbd8f 100644 --- a/flake.lock +++ b/flake.lock @@ -228,21 +228,6 @@ "type": "github" } }, - "flake-root_3": { - "locked": { - "lastModified": 1723604017, - "narHash": "sha256-rBtQ8gg+Dn4Sx/s+pvjdq3CB2wQNzx9XGFq/JVGCB6k=", - "owner": "srid", - "repo": "flake-root", - "rev": "b759a56851e10cb13f6b8e5698af7b59c44be26e", - "type": "github" - }, - "original": { - "owner": "srid", - "repo": "flake-root", - "type": "github" - } - }, "fourmolu-nix": { "locked": { "lastModified": 1707266073, @@ -415,18 +400,18 @@ "type": "github" } }, - "proc-flake": { + "process-compose-flake": { "locked": { - "lastModified": 1713493374, - "narHash": "sha256-w2XKCa27RxCu32PKnResrKEcnOV/S6Qh1sWBWCUSjJ8=", - "owner": "srid", - "repo": "proc-flake", - "rev": "7bf695fad8caec98c122f1641ddca5e36477223f", + "lastModified": 1724606023, + "narHash": "sha256-rdGeNa/lCS8E1lXzPqgl+vZUUvnbEZT11Bqkx5jfYug=", + "owner": "Platonic-Systems", + "repo": "process-compose-flake", + "rev": "f6ce9481df9aec739e4e06b67492401a5bb4f0b1", "type": "github" }, "original": { - "owner": "srid", - "repo": "proc-flake", + "owner": "Platonic-Systems", + "repo": "process-compose-flake", "type": "github" } }, @@ -434,11 +419,10 @@ "inputs": { "ema": "ema", "flake-parts": "flake-parts_3", - "flake-root": "flake-root_3", "fourmolu-nix": "fourmolu-nix", "haskell-flake": "haskell-flake_3", "nixpkgs": "nixpkgs_3", - "proc-flake": "proc-flake", + "process-compose-flake": "process-compose-flake", "systems": "systems_2", "treefmt-nix": "treefmt-nix_3" } diff --git a/flake.nix b/flake.nix index c653489..0e74ba1 100644 --- a/flake.nix +++ b/flake.nix @@ -6,8 +6,7 @@ flake-parts.url = "github:hercules-ci/flake-parts"; haskell-flake.url = "github:srid/haskell-flake"; - flake-root.url = "github:srid/flake-root"; - proc-flake.url = "github:srid/proc-flake"; + process-compose-flake.url = "github:Platonic-Systems/process-compose-flake"; treefmt-nix.url = "github:numtide/treefmt-nix"; treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; fourmolu-nix.url = "github:jedimahdi/fourmolu-nix"; @@ -20,12 +19,11 @@ systems = import inputs.systems; imports = [ inputs.haskell-flake.flakeModule - inputs.flake-root.flakeModule - inputs.proc-flake.flakeModule + inputs.process-compose-flake.flakeModule inputs.treefmt-nix.flakeModule inputs.fourmolu-nix.flakeModule ]; - perSystem = { config, pkgs, lib, ... }: + perSystem = { config, self', pkgs, lib, ... }: let tailwind = pkgs.haskellPackages.tailwind; in @@ -41,8 +39,7 @@ # Auto formatters. This also adds a flake check to ensure that the # source tree was auto formatted. treefmt.config = { - inherit (config.flake-root) projectRootFile; - package = pkgs.treefmt; + projectRootFile = "flake.nix"; programs.fourmolu.enable = true; programs.nixpkgs-fmt.enable = true; @@ -65,11 +62,16 @@ extensions = [ "ImportQualifiedPost" ]; }; - # From https://github.com/srid/proc-flake - proc.groups.ema-tailwind-run = { - processes = { - haskell.command = "ghcid"; - tailwind.command = "${lib.getExe tailwind} -w -o ./static/tailwind.css './src/**/*.hs'"; + process-compose."ema-tailwind-run" = { + tui = false; + settings = { + processes = { + haskell.command = "ghcid"; + tailwind = { + command = "${lib.getExe tailwind} -w -o ./static/tailwind.css './src/**/*.hs'"; + is_tty = true; + }; + }; }; }; @@ -100,12 +102,10 @@ tailwind pkgs.just pkgs.nixd - config.proc.groups.ema-tailwind-run.package ]; inputsFrom = [ config.haskellProjects.default.outputs.devShell config.treefmt.build.devShell - config.flake-root.devShell ]; }; }; diff --git a/justfile b/justfile index 4a39b3f..c453d91 100644 --- a/justfile +++ b/justfile @@ -16,4 +16,4 @@ fmt: # Run the dev server (ghcid + tailwind) run: - ema-tailwind-run + nix run .#ema-tailwind-run