diff --git a/docs/default.nix b/docs/default.nix
index f8188b26..ea04e331 100644
--- a/docs/default.nix
+++ b/docs/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, pkgsLib, coricamuLib, config, inputs, ... }:
+{ pkgs, pkgsLib, coricamuLib, inputs, ... }:
{
baseUrl = "https://danth.github.io/stylix/";
@@ -11,7 +11,6 @@
Home
NixOS options
Home Manager options
- Haskell internals
GitHub repository
'';
@@ -76,24 +75,4 @@
};
}
];
-
- files.haddock =
- let
- ghc = pkgs.haskellPackages.ghcWithPackages
- (ps: with ps; [ json JuicyPixels random ]);
- in
- pkgs.stdenvNoCC.mkDerivation {
- name = "palette-generator-haddock";
- src = ../palette-generator;
- buildInputs = [ ghc ];
- buildPhase = ''
- haddock $src/**/*.hs \
- --html \
- --ignore-all-exports \
- --use-contents '${config.baseUrl}' \
- --odir $out
- '';
- dontInstall = true;
- dontFixup = true;
- };
}
diff --git a/flake.nix b/flake.nix
index 0e4849b0..020ee98b 100644
--- a/flake.nix
+++ b/flake.nix
@@ -31,32 +31,12 @@
in recursiveUpdate docsOutputs {
packages = genAttrs [ "aarch64-linux" "i686-linux" "x86_64-linux" ] (
system:
- let
- pkgs = nixpkgs.legacyPackages.${system};
-
- ghc =
- pkgs.haskellPackages.ghcWithPackages
- (ps: with ps; [ json JuicyPixels random ]);
-
+ let pkgs = nixpkgs.legacyPackages.${system};
in {
- palette-generator = pkgs.stdenvNoCC.mkDerivation {
- name = "palette-generator";
- src = ./palette-generator;
- buildInputs = [ ghc ];
- buildPhase = ''
- ghc -O -threaded -Wall -Wno-type-defaults Stylix/Main.hs
- '';
- installPhase = ''
- install -D Stylix/Main $out/bin/palette-generator
- '';
- };
+ palette-generator = pkgs.callPackage ./palette-generator { };
}
);
- hydraJobs = {
- inherit (self.packages.x86_64-linux) docs palette-generator;
- };
-
nixosModules.stylix = { pkgs, ... }@args: {
imports = [
(import ./stylix/nixos {
diff --git a/palette-generator/default.nix b/palette-generator/default.nix
new file mode 100644
index 00000000..a5b0c054
--- /dev/null
+++ b/palette-generator/default.nix
@@ -0,0 +1,38 @@
+{ haskellPackages, stdenvNoCC }:
+
+let
+ ghc = haskellPackages.ghcWithPackages (ps: with ps; [
+ JuicyPixels
+ json
+ random
+ ]);
+
+ # `nix build .#palette-generator.passthru.docs` and open in a web browser
+ docs = stdenvNoCC.mkDerivation {
+ name = "palette-generator-haddock";
+
+ src = ./.;
+ buildInputs = [ ghc ];
+
+ buildPhase = ''
+ haddock $src/**/*.hs --html --ignore-all-exports --odir $out
+ '';
+ dontInstall = true;
+ dontFixup = true;
+ };
+
+in stdenvNoCC.mkDerivation {
+ name = "palette-generator";
+
+ src = ./.;
+ buildInputs = [ ghc ];
+
+ buildPhase = ''
+ ghc -O -threaded -Wall -Wno-type-defaults Stylix/Main.hs
+ '';
+ installPhase = ''
+ install -D Stylix/Main $out/bin/palette-generator
+ '';
+
+ passthru = { inherit docs; };
+}