summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2024-10-09 10:59:13 -0400
committerGitHub <[email protected]>2024-10-09 10:59:13 -0400
commitd17bca56238e9ca326d60e58230d0d354f23bfe8 (patch)
tree12aee4c37a1490914e6307ce1b0023be2df93105 /flake.nix
parent7d6495399d5e1ba429a339de1c3a00f121e89305 (diff)
back to astro for hopefully the last time (#146)
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix95
1 files changed, 19 insertions, 76 deletions
diff --git a/flake.nix b/flake.nix
index 48e7350..f22841b 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,16 +1,12 @@
{
description = "Getchoo's website";
- inputs = {
- nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
- nix-filter.url = "github:numtide/nix-filter";
- };
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs =
{
self,
nixpkgs,
- nix-filter,
}:
let
inherit (nixpkgs) lib;
@@ -20,95 +16,42 @@
nixpkgsFor = forAllSystems (system: nixpkgs.legacyPackages.${system});
in
{
- apps = forAllSystems (
- system:
- let
- pkgs = nixpkgsFor.${system};
- in
- {
- serve = {
- type = "app";
- program = toString (
- pkgs.runCommand "serve-website" { nativeBuildInputs = [ pkgs.zola ]; } ''
- tmpdir=$(mktemp -d)
- cd ${self.packages.${system}.website.src}
- zola serve --force --output-dir "$tmpdir"
- ''
- );
- };
- }
- );
-
devShells = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
+
+ baseNodeTools = [
+ pkgs.corepack
+ pkgs.nodejs
+ pkgs.nrr
+ ];
in
{
default = pkgs.mkShellNoCC {
- packages = [
- pkgs.zola
+ packages = baseNodeTools ++ [
+ # Node tools
+ pkgs.astro-language-server
+ pkgs.oxlint
+ pkgs.typescript-language-server
+ # For CI
pkgs.actionlint
+
+ # Nix tools
pkgs.deadnix
pkgs.nil
pkgs.statix
self.formatter.${system}
];
};
+
+ ci = pkgs.mkShellNoCC {
+ packages = baseNodeTools;
+ };
}
);
formatter = forAllSystems (system: nixpkgsFor.${system}.nixfmt-rfc-style);
-
- packages = forAllSystems (
- system:
- let
- pkgs = nixpkgsFor.${system};
- in
- {
- website = pkgs.callPackage (
- {
- lib,
- stdenvNoCC,
- writeShellApplication,
- zola,
- }:
-
- stdenvNoCC.mkDerivation {
- pname = "getchoo-website";
- version = self.shortRev or self.dirtyShortRev or "unknown";
-
- src = nix-filter.lib.filter {
- root = self;
- include = [
- "config.toml"
- "content"
- "highlight_themes"
- "sass"
- "static"
- "templates"
- ];
- };
-
- nativeBuildInputs = [ zola ];
-
- postBuild = "zola build --output-dir $out";
-
- dontConfigure = true;
- dontInstall = true;
- dontFixup = true;
-
- meta = {
- homepage = "https://github.com/getchoo/website";
- license = lib.licenses.mit;
- maintainers = with lib.maintainers; [ getchoo ];
- };
- }
- ) { };
-
- default = self.packages.${system}.website;
- }
- );
};
}