about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-05-07 15:37:28 +0200
committerRobert Hensing <robert@roberthensing.nl>2023-05-10 15:55:09 +0200
commite5db80ae487b59b4e9f950d68983ffb0575e26c6 (patch)
treeb24eb183f8e6851d0a1daca9a702aa0c58780ae9 /flake.nix
parent693e2c32871dcea7fe2ef455ee77571d3a117499 (diff)
nixosModules.pkgsReadOnly: init
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index f9442d8ea2d2c..fa00bffcdf92f 100644
--- a/flake.nix
+++ b/flake.nix
@@ -57,6 +57,19 @@
 
       nixosModules = {
         notDetected = ./nixos/modules/installer/scan/not-detected.nix;
+
+        /*
+          Make the `nixpkgs.*` configuration read-only. Guarantees that `pkgs`
+          is the way you initialize it.
+
+          Example:
+
+              {
+                imports = [ nixpkgs.nixosModules.readOnlyPkgs ];
+                nixpkgs.pkgs = nixpkgs.legacyPackages.x86_64-linux;
+              }
+        */
+        readOnlyPkgs = ./nixos/modules/misc/nixpkgs/read-only.nix;
       };
     };
 }