diff options
| author | seth <[email protected]> | 2024-10-09 10:59:13 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-10-09 10:59:13 -0400 |
| commit | d17bca56238e9ca326d60e58230d0d354f23bfe8 (patch) | |
| tree | 12aee4c37a1490914e6307ce1b0023be2df93105 /flake.nix | |
| parent | 7d6495399d5e1ba429a339de1c3a00f121e89305 (diff) | |
back to astro for hopefully the last time (#146)
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 95 |
1 files changed, 19 insertions, 76 deletions
@@ -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; - } - ); }; } |
