mirror of
https://github.com/Smaug123/nix-dotfiles
synced 2025-10-06 15:08:41 +00:00
General faff (#9)
This commit is contained in:
@@ -81,14 +81,14 @@ type NixFile =
|
||||
|
||||
static member Parse (s : string) : NixFile =
|
||||
let pre, post =
|
||||
s.Split "\n] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [\n"
|
||||
s.Split "++ pkgs.vscode-utils.extensionsFromVscodeMarketplace ["
|
||||
|> function
|
||||
| [| pre ; post |] -> pre, post
|
||||
| _ -> failwith "Unexpected number of '++'"
|
||||
|
||||
let verbatim, skipped =
|
||||
match pre.Split "\n" |> List.ofArray with
|
||||
| "{ pkgs }:" :: "" :: "with pkgs.vscode-extensions; [" :: rest ->
|
||||
| "{pkgs}:" :: "with pkgs.vscode-extensions;" :: " [" :: rest ->
|
||||
rest
|
||||
|> List.map (fun s ->
|
||||
if s.StartsWith '#' then Choice2Of2 (s.[2..].Trim()) else Choice1Of2 (s.Trim())
|
||||
|
Reference in New Issue
Block a user