aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2024-07-19 17:31:22 -0700
committerFranck Cuny <franck@fcuny.net>2024-07-19 17:31:22 -0700
commit8e3e7a0c4551583493e212d70449cee308ef04c0 (patch)
tree61eadc2daa598a145e54190fcbcf14c759d5eccc /flake.nix
parentcheck for broken links (diff)
downloadfcuny.net-8e3e7a0c4551583493e212d70449cee308ef04c0.tar.gz
use just as a task runner
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix36
1 files changed, 2 insertions, 34 deletions
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 ];
};
});
}