diff options
author | Alan Pearce | 2024-05-09 16:47:41 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-09 19:27:55 +0200 |
commit | e062ca72b222b890e345548bd8422d5df98e9fef (patch) | |
tree | 89f52ebfdb1fb8069e6323d9dde42f5491dad5d1 /importers/nixos-options.nix | |
parent | 967f6fdf5c1693d3aa27079b3ae28768fb7356c6 (diff) | |
download | searchix-e062ca72b222b890e345548bd8422d5df98e9fef.tar.lz searchix-e062ca72b222b890e345548bd8422d5df98e9fef.tar.zst searchix-e062ca72b222b890e345548bd8422d5df98e9fef.zip |
feat: import sources from configuration in go code and index options
Diffstat (limited to 'importers/nixos-options.nix')
-rw-r--r-- | importers/nixos-options.nix | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/importers/nixos-options.nix b/importers/nixos-options.nix deleted file mode 100644 index 3c0a18e..0000000 --- a/importers/nixos-options.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ nixpkgs ? <nixpkgs> -, pkgs ? import nixpkgs { } -, system ? builtins.currentSystem -, stateVersion ? pkgs.lib.version -, ... -}: -let - inherit (pkgs) lib; - inherit (lib) hasPrefix removePrefix; - - nixos = pkgs.nixos ({ lib, ... }: { - nixpkgs.hostPlatform = system; - system.stateVersion = lib.versions.majorMinor stateVersion; - }); - - inherit (nixos.config.system.nixos) revision; - - gitHubDeclaration = user: repo: ref: subpath: - # Default to `master` if we don't know what revision the system - # configuration is using (custom nixpkgs, etc.). - let urlRef = if ref != null then ref else "master"; - in { - url = "https://github.com/${user}/${repo}/blob/${urlRef}/${subpath}"; - name = "<${repo}/${subpath}>"; - }; - - doc = pkgs.nixosOptionsDoc { - inherit (nixos) options; - transformOptions = opt: opt // { - declarations = - map - (decl: - if hasPrefix (toString nixpkgs) (toString decl) - then - gitHubDeclaration "NixOS" "nixpkgs" revision - (removePrefix "/" - (removePrefix (toString nixpkgs) (toString decl))) - else if decl == "lib/modules.nix" then - gitHubDeclaration "NixOS" "nixpkgs" revision decl - else decl) - opt.declarations; - }; - }; -in -doc.optionsJSON |