From aad528d1b211e64ffe3f5688c141d442d7fa081a Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Thu, 9 Oct 2025 22:46:34 -0700 Subject: add a skeleton for documentation Change-Id: I528864e13c4b318dd70a004b8c2029831863c37c --- flake.nix | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index f495553..896a587 100644 --- a/flake.nix +++ b/flake.nix @@ -10,8 +10,9 @@ outputs = { self, nixpkgs, ... }@attrs: let supportedSystems = [ "aarch64-linux" "x86_64-linux" ]; - forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); + forAllPkgs = f: + nixpkgs.lib.genAttrs supportedSystems + (system: f (import nixpkgs { inherit system; })); in { nixosModules.default = { ... }: { imports = [ @@ -26,9 +27,31 @@ ]; }; - devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in { + packages = forAllPkgs (pkgs: { + documentation = pkgs.stdenv.mkDerivation rec { + name = "smalltech-documentation"; + version = "1.0"; + + src = ./.; + + nativeBuildInputs = with pkgs; [ mkdocs ]; + + buildPhase = '' + ls -al + ${pkgs.mkdocs}/bin/mkdocs build -f docs/mkdocs.yml + ''; + + installPhase = '' + rm $out/mkdocs.yml + ''; + }; + }); + + devShells = forAllPkgs (pkgs: { default = pkgs.mkShell { - buildInputs = with pkgs; [ ]; + buildInputs = with pkgs; [ + mkdocs + ]; }; }); }; -- cgit 1.4.1