mirror of
https://github.com/mipmip/home-manager-option-search.git
synced 2024-08-16 18:40:38 +03:00
Compare commits
4 Commits
d3cf4e7988
...
f5740ec6fe
Author | SHA1 | Date | |
---|---|---|---|
|
f5740ec6fe | ||
|
12b2c51e7c | ||
|
ebf87c8f86 | ||
|
fea3a76ddf |
19
.github/workflows/update.yml
vendored
19
.github/workflows/update.yml
vendored
@ -15,32 +15,17 @@ jobs:
|
||||
- uses: DeterminateSystems/nix-installer-action@main
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
|
||||
- name: master-options
|
||||
- name: extract-options-master (unstable)
|
||||
run: ./scripts/build_hm_options.sh
|
||||
|
||||
- name: update gitignore
|
||||
run: echo result > .gitignore
|
||||
|
||||
- name: release-options
|
||||
- name: extract-options-release-23.11 (stable)
|
||||
env:
|
||||
HM_RELEASE: release-23.11
|
||||
run: ./scripts/build_hm_options.sh
|
||||
|
||||
- name: release-options
|
||||
env:
|
||||
HM_RELEASE: release-23.05
|
||||
run: ./scripts/build_hm_options.sh
|
||||
#
|
||||
# - name: master-options
|
||||
# env:
|
||||
# RELEASE: release-22.11
|
||||
# run: ./scripts/build_hm_options.sh
|
||||
#
|
||||
# - name: master-options
|
||||
# env:
|
||||
# RELEASE: release-22.05
|
||||
# run: ./scripts/build_hm_options.sh
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,4 +2,5 @@
|
||||
.nix-gems
|
||||
.bundle
|
||||
result
|
||||
data/hm-options*
|
||||
data/hm-options-release-23.11.json
|
||||
data/hm-options-master.json
|
||||
|
1
data/hm-options-release-22.11.json
Normal file
1
data/hm-options-release-22.11.json
Normal file
File diff suppressed because one or more lines are too long
1
data/hm-options-release-23.05.json
Normal file
1
data/hm-options-release-23.05.json
Normal file
File diff suppressed because one or more lines are too long
@ -87,10 +87,7 @@
|
||||
<option value="master">unstable</option>
|
||||
<option value="release-23.11">23.11</option>
|
||||
<option value="release-23.05">23.05</option>
|
||||
<!--
|
||||
<option value="release-22.11">22.11</option>
|
||||
<option value="release-22.05">22.05</option>
|
||||
-->
|
||||
</select>
|
||||
<!--
|
||||
<label for="advcheck">
|
||||
|
@ -10,6 +10,6 @@ fi
|
||||
echo "building Home Manager options from ${HM_RELEASE}"
|
||||
|
||||
rm -Rf result
|
||||
nix build github:nix-community/home-manager/${HM_RELEASE}#docs-json --no-write-lock-file
|
||||
nix build github:nix-community/home-manager/${HM_RELEASE}#docs-json --no-write-lock-file
|
||||
rm -f ./data/hm-options-${HM_RELEASE}.json
|
||||
ruby ./scripts/parse_options-json.rb
|
||||
|
@ -13,24 +13,38 @@ p ENV['HM_RELEASE']
|
||||
in_file = File.read("./result/share/doc/home-manager/options.json")
|
||||
parsed = JSON.parse(in_file)
|
||||
|
||||
def isLiteralExpression(val, key)
|
||||
if val.key? key and val[key].instance_of? Hash and val[key].key? "_type" and val[key]['_type'] == 'literalExpression'
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def getValFor(val, key)
|
||||
if isLiteralExpression(val, key)
|
||||
val[key]['text']
|
||||
elsif val.key? key
|
||||
val[key]
|
||||
else
|
||||
""
|
||||
end
|
||||
end
|
||||
|
||||
def parseVal(val)
|
||||
val['example'] = getValFor(val, 'example')
|
||||
val['default'] = getValFor(val, 'default')
|
||||
|
||||
val
|
||||
end
|
||||
|
||||
options_arr = []
|
||||
parsed.each do | name, val |
|
||||
|
||||
next if name == '_module.args'
|
||||
|
||||
val['title'] = name
|
||||
|
||||
if val.key? "example"
|
||||
val['example'] = val['example']['text']
|
||||
else
|
||||
val['example'] = ""
|
||||
end
|
||||
|
||||
if val.key? "default"
|
||||
val['default'] = val['default']['text']
|
||||
else
|
||||
val['default'] = ""
|
||||
end
|
||||
val = parseVal(val)
|
||||
|
||||
options_arr << val
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user