From cd9788bba6077c1c2ff148b9bd27b43a0f7d4b89 Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Sat, 24 Sep 2022 20:34:17 +0100 Subject: [PATCH] Protect palette.json from garbage collection :zap: Making palette.json part of the system closure will protect it from garbage collection, so future configurations can be evaluated without having to generate the palette again. The generator is not kept, only the palette which came from it, so this uses very little disk space. As evaluations will no longer need the palette generator unless the wallpaper was changed, I've removed the recommendation to add a binary cache - the overhead of querying the cache for unrelated builds outweighs the remaining benefits of it. --- .flakeaway.json | 9 --------- README.md | 12 ------------ stylix/palette.nix | 14 +++++++++++--- 3 files changed, 11 insertions(+), 24 deletions(-) delete mode 100644 .flakeaway.json diff --git a/.flakeaway.json b/.flakeaway.json deleted file mode 100644 index b20f8062..00000000 --- a/.flakeaway.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "outputStores": [ - { - "store": "danth", - "authToken": "lEaE5jUApvnP4H7Yi/hHUHdKFpChnQtARUngvzUXYmGeFHJ2q7j/ijBVB/BubFX/ACsnxDDCrQRny+lyQGzcoLwhdCc0lCJ3Xu2gamz3YuNa3bWJ8V9t5Cue3SMXZ2YwrJNG0wUBAqW3lZRdGDqiPJVMlYzgMDN2Gm9MoRkJvhGpeHJ1cgiG/V5yQt/RmUQ331K0bEr1WelDe4uDeEl3h4xF4co7/I/PK7xHWyE/B07q4loFLj5wSuFYi3nmJrYWTi5svco7P2ZYy1A6zAJlW4eC1CIcsJsDE+wrgPCSTit/znlA4De4GWPOZbDgNoEvtGMnst5bBA5GWKLHgt5AQQ==", - "type": "cachix" - } - ] -} \ No newline at end of file diff --git a/README.md b/README.md index 849ab244..a1097114 100644 --- a/README.md +++ b/README.md @@ -42,18 +42,6 @@ for example: Stylix relies on [Home Manager](https://github.com/nix-community/home-manager) for a lot of its work, so that needs to be imported too. -## Binary cache - -Stylix includes a Haskell program which generates color palettes. -To avoid compiling this from source, add the following settings: - -```nix -nix.settings = { - substituters = "https://danth.cachix.org"; - trusted-public-keys = "danth.cachix.org-1:wpodfSL7suXRc/rJDZZUptMa1t4MJ795hemRN0q84vI="; -}; -``` - ## Wallpaper To get started, you need to set a wallpaper image. diff --git a/stylix/palette.nix b/stylix/palette.nix index 124a765a..4f8af471 100644 --- a/stylix/palette.nix +++ b/stylix/palette.nix @@ -77,7 +77,15 @@ in { }; }; - # This attrset can be used like a function too, see - # https://github.com/SenchoPens/base16.nix#mktheme - config.lib.stylix.colors = base16.mkSchemeAttrs cfg.base16Scheme; + config = { + # Making palette.json part of the system closure will protect it from + # garbage collection, so future configurations can be evaluated without + # having to generate the palette again. The generator is not kept, only the + # palette which came from it, so this uses very little disk space. + system.extraDependencies = [ paletteJSON ]; + + # This attrset can be used like a function too, see + # https://github.com/SenchoPens/base16.nix#mktheme + lib.stylix.colors = base16.mkSchemeAttrs cfg.base16Scheme; + }; }