From 8e3e7a0c4551583493e212d70449cee308ef04c0 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 19 Jul 2024 17:31:22 -0700 Subject: use just as a task runner --- flake.nix | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index ac945a4..7a250c3 100644 --- a/flake.nix +++ b/flake.nix @@ -5,38 +5,14 @@ nixpkgs.url = "github:nixos/nixpkgs/master"; flake-utils.url = "github:numtide/flake-utils"; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; - treefmt-nix.url = "github:numtide/treefmt-nix"; }; - outputs = { self, nixpkgs, flake-utils, pre-commit-hooks, treefmt-nix, }: + outputs = { self, nixpkgs, flake-utils, pre-commit-hooks, }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; - treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; in { - formatter = treefmtEval.config.build.wrapper; - - packages = { - default = with pkgs; - stdenv.mkDerivation { - pname = "fcuny.net"; - version = self.lastModifiedDate; - src = ./.; - buildInputs = [ zola git ]; - buildPhase = '' - mkdir -p $out - ${pkgs.zola}/bin/zola build -o $out -f - ''; - dontInstall = true; - }; - zola = pkgs.writeShellScriptBin "zola" '' - set -euo pipefail - export PATH=${pkgs.lib.makeBinPath [ pkgs.zola pkgs.git ]} - zola serve - ''; - }; - checks = { pre-commit-check = pre-commit-hooks.lib.${system}.run { src = ./.; @@ -49,19 +25,11 @@ actionlint.enable = true; }; }; - formatting = treefmtEval.config.build.check self; - }; - - apps = { - default = { - type = "app"; - program = "${self.packages."${system}".zola}/bin/zola"; - }; }; devShells.default = pkgs.mkShell { inherit (self.checks.${system}.pre-commit-check) shellHook; - buildInputs = with pkgs; [ zola git treefmt lychee ]; + buildInputs = with pkgs; [ zola git treefmt lychee just taplo nodePackages.prettier ]; }; }); } -- cgit 1.4.1