diff --git a/dev/flake-module.nix b/dev/flake-module.nix index f4fb450..216cb2a 100644 --- a/dev/flake-module.nix +++ b/dev/flake-module.nix @@ -3,6 +3,7 @@ flakeModuleArgs@{ config, lib, inputs, ... }: { imports = [ inputs.pre-commit-hooks-nix.flakeModule + ../site/flake-module.nix ]; systems = [ "x86_64-linux" "aarch64-darwin" ]; perSystem = system: { config, self', inputs', pkgs, ... }: { @@ -11,6 +12,9 @@ flakeModuleArgs@{ config, lib, inputs, ... }: nativeBuildInputs = [ pkgs.nixpkgs-fmt pkgs.pre-commit + pkgs.hci + pkgs.netlify-cli + pkgs.pandoc ]; shellHook = '' ${config.pre-commit.installationScript} @@ -43,9 +47,22 @@ flakeModuleArgs@{ config, lib, inputs, ... }: }; flake = { options.herculesCI = lib.mkOption { type = lib.types.raw; }; - config.herculesCI = { + config.herculesCI = { branch, ... }: { onPush.default.outputs = { inherit (config.flake) packages checks; + effects = + let + pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; + effects = inputs.hercules-ci-effects.lib.withPkgs pkgs; + in + { + netlifyDeploy = effects.runIf (branch == "main") (effects.netlifyDeploy { + content = config.flake.packages.x86_64-linux.websitePackage; + secretName = "default-netlify"; + siteId = "29a153b1-3698-433c-bc73-62415efb8117"; + productionDeployment = true; + }); + }; }; }; diff --git a/dev/flake.lock b/dev/flake.lock index 28eacfb..1165ae2 100644 --- a/dev/flake.lock +++ b/dev/flake.lock @@ -15,18 +15,51 @@ "type": "github" } }, - "nixpkgs": { + "hercules-ci-effects": { + "inputs": { + "nixpkgs": "nixpkgs" + }, "locked": { - "lastModified": 1652734403, - "narHash": "sha256-pIp7mRuYQd4JY2Ih4QaDjKVFgu7f1yHRRAvpb/rU9Mg=", + "lastModified": 1653415319, + "narHash": "sha256-h+YUX7ZYujf73KL1R07LsEnhV7uV8oxSKEhH4bDj0Jc=", "owner": "hercules-ci", - "repo": "nixpkgs", - "rev": "0b02135d3bdf49f9154f60e7a4c9d54d5e0ee70d", + "repo": "hercules-ci-effects", + "rev": "1f904af1824e7393702daaf40a8fed56ebead0d7", "type": "github" }, "original": { "owner": "hercules-ci", - "ref": "functionTo-properly", + "repo": "hercules-ci-effects", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1647297614, + "narHash": "sha256-ulGq3W5XsrBMU/u5k9d4oPy65pQTkunR4HKKtTq0RwY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "73ad5f9e147c0d2a2061f1d4bd91e05078dc0b58", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1653465299, + "narHash": "sha256-+1jyM4dsppYFgiJf+VkAAS/l5iF0y5J7D2l1fLzT8DA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5862243e1ab8c0a19cb448f523c27c167dcd826b", + "type": "github" + }, + "original": { + "owner": "NixOS", "repo": "nixpkgs", "type": "github" } @@ -55,7 +88,8 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs", + "hercules-ci-effects": "hercules-ci-effects", + "nixpkgs": "nixpkgs_2", "pre-commit-hooks-nix": "pre-commit-hooks-nix" } } diff --git a/dev/flake.nix b/dev/flake.nix index af815b4..41ac8a4 100644 --- a/dev/flake.nix +++ b/dev/flake.nix @@ -4,10 +4,12 @@ inputs = { # Flakes don't give us a good way to depend on .., so we don't. # This has drastic consequences of course. - nixpkgs.url = "github:hercules-ci/nixpkgs/functionTo-properly"; + nixpkgs.url = "github:NixOS/nixpkgs"; pre-commit-hooks-nix.url = "github:hercules-ci/pre-commit-hooks.nix/flakeModule"; pre-commit-hooks-nix.inputs.nixpkgs.follows = "nixpkgs"; + + hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects"; }; outputs = { self, ... }: diff --git a/site/flake-module.nix b/site/flake-module.nix new file mode 100644 index 0000000..827488c --- /dev/null +++ b/site/flake-module.nix @@ -0,0 +1,22 @@ +{ ... }: { + perSystem = system: { config, self', inputs', pkgs, lib, ... }: { + packages.websitePackage = pkgs.stdenvNoCC.mkDerivation { + name = "site"; + nativeBuildInputs = [ pkgs.pandoc ]; + src = lib.cleanSourceWith { + filter = path: type: + path == ./. + || baseNameOf path == "index.html"; + src = ./.; + }; + buildPhase = '' + pandoc --from docbook --to html5 \ + ${config.packages.optionsDocBook} >options.html + ''; + installPhase = '' + mkdir -p $out + cp *.html $out/ + ''; + }; + }; +} diff --git a/site/index.html b/site/index.html new file mode 100644 index 0000000..759f7be --- /dev/null +++ b/site/index.html @@ -0,0 +1,42 @@ + + + + flake-modules-core + + + +

flake-modules-core

+ +

+ Compose flakes with the (NixOS) module system. +

+ +

+ Testimonials: +

+ +
+ yeah.. powerful stuff +
+ +
+ I cannot tell you how freeing the flake-modules concept is
+ fucking hell
+ I feel like a hipster using it too +
+ +

+ Learn more: +

+ +

+ GitHub +

+ +

+ Options Reference +

+ + + + \ No newline at end of file