diff --git a/README.md b/README.md index 91f8b8a..ca0eab5 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ baseline level of compatibility: the core attributes that constitute a flake. - Reuse project logic written by others + # Getting Started diff --git a/dev/README.md b/dev/README.md index b5001c5..270517d 100644 --- a/dev/README.md +++ b/dev/README.md @@ -1,5 +1,5 @@ -# Separate `tools` flake +# Separate `dev` flake Wouldn't recommend this pattern normally, but I'm trying to keep deps low for `flake-parts` until we have split dev inputs diff --git a/dev/flake-module.nix b/dev/flake-module.nix index 95fdb63..ae227e5 100644 --- a/dev/flake-module.nix +++ b/dev/flake-module.nix @@ -3,8 +3,7 @@ { imports = [ inputs.pre-commit-hooks-nix.flakeModule - inputs.hercules-ci-effects.flakeModule - ../site/flake-module.nix + inputs.hercules-ci-effects.flakeModule # herculesCI attr ]; systems = [ "x86_64-linux" "aarch64-darwin" ]; perSystem = { config, self', inputs', pkgs, ... }: { @@ -13,10 +12,6 @@ nativeBuildInputs = [ pkgs.nixpkgs-fmt pkgs.pre-commit - pkgs.hci - pkgs.netlify-cli - pkgs.pandoc - pkgs.mdbook ]; shellHook = '' ${config.pre-commit.installationScript} @@ -31,19 +26,6 @@ }; }; - herculesCI = herculesCI@{ config, ... }: { - onPush.default.outputs = { - effects = - withSystem "x86_64-linux" ({ config, pkgs, hci-effects, ... }: { - netlifyDeploy = hci-effects.netlifyDeploy { - content = config.packages.siteContent; - secretName = "default-netlify"; - siteId = "29a153b1-3698-433c-bc73-62415efb8117"; - productionDeployment = herculesCI.config.repo.branch == "main"; - }; - }); - }; - }; flake = { # for repl exploration / debug config.config = config; diff --git a/site/.gitignore b/site/.gitignore deleted file mode 100644 index 7585238..0000000 --- a/site/.gitignore +++ /dev/null @@ -1 +0,0 @@ -book diff --git a/site/book.toml b/site/book.toml deleted file mode 100644 index fbede22..0000000 --- a/site/book.toml +++ /dev/null @@ -1,6 +0,0 @@ -[book] -authors = ["Robert Hensing", "Various module authors"] -language = "en" -multilingual = false -src = "src" -title = "flake-parts" diff --git a/site/flake-module.nix b/site/flake-module.nix deleted file mode 100644 index b5c43d9..0000000 --- a/site/flake-module.nix +++ /dev/null @@ -1,137 +0,0 @@ -{ inputs, ... }: { - perSystem = { config, self', inputs', pkgs, lib, ... }: - let - inherit (lib) filter any hasPrefix concatMap removePrefix; - - libNix = import ../lib.nix { inherit lib; }; - eval = libNix.evalFlakeModule { self = { inputs = { inherit (inputs) nixpkgs; }; }; } { - imports = [ - inputs.pre-commit-hooks-nix.flakeModule - inputs.hercules-ci-effects.flakeModule - inputs.haskell-flake.flakeModule - inputs.dream2nix.flakeModuleBeta - ]; - }; - opts = eval.options; - - filterTransformOptions = { sourceName, sourcePath, baseUrl }: - let sourcePathStr = toString sourcePath; - in - opt: - let - declarations = concatMap - (decl: - if hasPrefix sourcePathStr (toString decl) - then - let subpath = removePrefix sourcePathStr (toString decl); - in [{ url = baseUrl + subpath; name = sourceName + subpath; }] - else [ ] - ) - opt.declarations; - in - if declarations == [ ] - then opt // { visible = false; } - else opt // { inherit declarations; }; - - optionsDoc = { sourceName, baseUrl, sourcePath, title }: pkgs.runCommand "option-doc-${sourceName}" - { - nativeBuildInputs = [ pkgs.libxslt.bin pkgs.pandoc ]; - inputDoc = (pkgs.nixosOptionsDoc { - options = opts; - documentType = "none"; - transformOptions = filterTransformOptions { - inherit sourceName baseUrl sourcePath; - }; - warningsAreErrors = true; # not sure if feasible long term - markdownByDefault = true; - }).optionsDocBook; - inherit title; - } '' - xsltproc --stringparam title "$title" \ - -o options.db.xml ${./options.xsl} \ - "$inputDoc" - mkdir $out - pandoc --verbose --from docbook --to html options.db.xml >$out/options.md; - ''; - - repos = { - flake-parts = { - title = "Core Options"; - sourceName = "flake-parts"; - baseUrl = "https://github.com/hercules-ci/flake-parts/blob/main"; - sourcePath = ../.; - }; - pre-commit-hooks-nix = { - title = "pre-commit-hooks.nix"; - sourceName = "pre-commit-hooks.nix"; - baseUrl = "https://github.com/hercules-ci/pre-commit-hooks.nix/blob/flakeModule"; - sourcePath = inputs.pre-commit-hooks-nix; - }; - hercules-ci-effects = { - title = "hercules-ci-effects"; - sourceName = "hercules-ci-effects"; - baseUrl = "https://github.com/hercules-ci/hercules-ci-effects/blob/master"; - sourcePath = inputs.hercules-ci-effects; - }; - haskell-flake = { - title = "haskell-flake"; - sourceName = "haskell-flake"; - baseUrl = "https://github.com/srid/haskell-flake/blob/master"; - sourcePath = inputs.haskell-flake; - }; - dream2nix = { - title = "dream2nix beta"; - sourceName = "dream2nix"; - baseUrl = "https://github.com/nix-community/dream2nix/blob/master"; - sourcePath = inputs.dream2nix; - }; - }; - - generatedDocs = lib.mapAttrs (k: optionsDoc) repos; - generatedDocs' = lib.mapAttrs' (name: value: { name = "generated-docs-${name}"; inherit value; }) generatedDocs; - - in - { - packages = { - siteContent = pkgs.stdenvNoCC.mkDerivation { - name = "site"; - nativeBuildInputs = [ pkgs.mdbook ]; - src = ./.; - buildPhase = '' - runHook preBuild - - { - while read ln; do - case "$ln" in - *end_of_intro*) - break - ;; - *) - echo "$ln" - ;; - esac - done - cat src/intro-continued.md - } <${../README.md} >src/README.md - - mkdir -p src/options - ${lib.concatStringsSep "\n" - (lib.mapAttrsToList - (name: generated: '' - cp '${generated}/options.md' 'src/options/${name}.md' - '') - generatedDocs) - } - - mdbook build --dest-dir $out - - echo '
to the options' \ - >$out/options.html - - runHook postBuild - ''; - dontInstall = true; - }; - } // generatedDocs'; - }; -} diff --git a/site/options.xsl b/site/options.xsl deleted file mode 100644 index 830825d..0000000 --- a/site/options.xsl +++ /dev/null @@ -1,54 +0,0 @@ - -