about summary refs log tree commit diff stats
path: root/importers
diff options
context:
space:
mode:
authorAlan Pearce2024-05-03 11:52:06 +0200
committerAlan Pearce2024-05-03 11:52:06 +0200
commit1fb64b09e2dba34784732a61cbebc119cd847803 (patch)
tree1dc21f3c66c6682089bb8731f84d40ef13bcd424 /importers
parent0945da8f9654252008ff6bd56022f9363fd3cca6 (diff)
downloadsearchix-1fb64b09e2dba34784732a61cbebc119cd847803.tar.lz
searchix-1fb64b09e2dba34784732a61cbebc119cd847803.tar.zst
searchix-1fb64b09e2dba34784732a61cbebc119cd847803.zip
feat: create nixos options.json importer
Diffstat (limited to 'importers')
-rw-r--r--importers/nixos-options.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/importers/nixos-options.nix b/importers/nixos-options.nix
new file mode 100644
index 0000000..894f05e
--- /dev/null
+++ b/importers/nixos-options.nix
@@ -0,0 +1,17 @@
+{ pkgs ? import <nixpkgs> { }
+, system ? builtins.currentSystem
+, stateVersion ? pkgs.lib.version
+, ...
+}:
+let
+  inherit (pkgs) lib;
+  nixos = pkgs.nixos ({ lib, pkgs, config, ... }: {
+    nixpkgs.hostPlatform = system;
+    system.stateVersion = lib.versions.majorMinor stateVersion;
+  });
+
+  doc = pkgs.nixosOptionsDoc {
+    inherit (nixos) options;
+  };
+in
+doc.optionsJSON