about summary refs log tree commit diff
path: root/nixos/modules/programs/ccache.nix
diff options
context:
space:
mode:
authorEmery Hemingway <ehmry@posteo.net>2024-02-08 11:39:29 +0100
committerEmery Hemingway <ehmry@posteo.net>2024-02-23 11:08:02 +0000
commitd843ec4e3d651e42a5d1b0d251984199bbbf149d (patch)
treea096e43b74947966a5458c96ee9b5fbaef83c9ee /nixos/modules/programs/ccache.nix
parente7d3db0954a744a06bce2086bbbf50768b865639 (diff)
downloadnixlib-d843ec4e3d651e42a5d1b0d251984199bbbf149d.tar
nixlib-d843ec4e3d651e42a5d1b0d251984199bbbf149d.tar.gz
nixlib-d843ec4e3d651e42a5d1b0d251984199bbbf149d.tar.bz2
nixlib-d843ec4e3d651e42a5d1b0d251984199bbbf149d.tar.lz
nixlib-d843ec4e3d651e42a5d1b0d251984199bbbf149d.tar.xz
nixlib-d843ec4e3d651e42a5d1b0d251984199bbbf149d.tar.zst
nixlib-d843ec4e3d651e42a5d1b0d251984199bbbf149d.zip
nixos/ccache: do not "with lib;"
Diffstat (limited to 'nixos/modules/programs/ccache.nix')
-rw-r--r--nixos/modules/programs/ccache.nix19
1 files changed, 9 insertions, 10 deletions
diff --git a/nixos/modules/programs/ccache.nix b/nixos/modules/programs/ccache.nix
index 567c853e8c7d..628123b0ddf0 100644
--- a/nixos/modules/programs/ccache.nix
+++ b/nixos/modules/programs/ccache.nix
@@ -1,29 +1,28 @@
 { config, pkgs, lib, ... }:
 
-with lib;
 let
   cfg = config.programs.ccache;
 in {
   options.programs.ccache = {
     # host configuration
-    enable = mkEnableOption (lib.mdDoc "CCache");
-    cacheDir = mkOption {
-      type = types.path;
+    enable = lib.mkEnableOption (lib.mdDoc "CCache");
+    cacheDir = lib.mkOption {
+      type = lib.types.path;
       description = lib.mdDoc "CCache directory";
       default = "/var/cache/ccache";
     };
     # target configuration
-    packageNames = mkOption {
-      type = types.listOf types.str;
+    packageNames = lib.mkOption {
+      type = lib.types.listOf lib.types.str;
       description = lib.mdDoc "Nix top-level packages to be compiled using CCache";
       default = [];
       example = [ "wxGTK32" "ffmpeg" "libav_all" ];
     };
   };
 
-  config = mkMerge [
+  config = lib.mkMerge [
     # host configuration
-    (mkIf cfg.enable {
+    (lib.mkIf cfg.enable {
       systemd.tmpfiles.rules = [ "d ${cfg.cacheDir} 0770 root nixbld -" ];
 
       # "nix-ccache --show-stats" and "nix-ccache --clear"
@@ -50,9 +49,9 @@ in {
     })
 
     # target configuration
-    (mkIf (cfg.packageNames != []) {
+    (lib.mkIf (cfg.packageNames != []) {
       nixpkgs.overlays = [
-        (self: super: genAttrs cfg.packageNames (pn: super.${pn}.override { stdenv = builtins.trace "with ccache: ${pn}" self.ccacheStdenv; }))
+        (self: super: lib.genAttrs cfg.packageNames (pn: super.${pn}.override { stdenv = builtins.trace "with ccache: ${pn}" self.ccacheStdenv; }))
 
         (self: super: {
           ccacheWrapper = super.ccacheWrapper.override {