|
12 | 12 | inherit (package) mkPackage; |
13 | 13 | EOF |
14 | 14 | printf 'in mkPackage %s {\n' "$1" |
15 | | - printf ' config = {\n' |
16 | 15 | if test -n "$2"; then |
17 | | - printf ' optional = true;\n' |
| 16 | + printf ' optional = true;\n' |
18 | 17 | fi |
19 | 18 | if test -n "$3"; then |
20 | | - printf ' only = [ %s ];\n' "$3" |
| 19 | + printf ' only = [ %s ];\n' "$3" |
21 | 20 | fi |
22 | 21 | if test -n "$4"; then |
23 | | - printf ' except = [ %s ];\n' "$4" |
| 22 | + printf ' except = [ %s ];\n' "$4" |
24 | 23 | fi |
| 24 | + printf ' config = {\n' |
25 | 25 | printf ' %s = [ %s ];\n' "$5" "$6" |
26 | 26 | printf ' };\n}\n' |
27 | 27 | } |
@@ -101,14 +101,16 @@ validate_package() { |
101 | 101 | except="$(parse_profiles except $profiles)" |
102 | 102 | fi |
103 | 103 |
|
104 | | - if contains "$content" "use_brew formula"; then |
| 104 | + if contains "$content" "use_nix"; then |
| 105 | + migrate_to_nix "$1" "pkgs.$(read_match "$content" "use_nix" | item_at 3 | strip)" nixpkgs.add "$optional" "$only" "$except" |
| 106 | + elif contains "$content" "use_brew formula"; then |
105 | 107 | migrate_to_nix "$1" "$(read_match "$content" "use_brew formula" | item_at 3 | normalize)" brew.add.formula "$optional" "$only" "$except" |
106 | 108 | elif contains "$content" "use_brew cask"; then |
107 | 109 | migrate_to_nix "$1" "$(read_match "$content" "use_brew cask" | item_at 3 | normalize | xargs sh -c 'out="";for i in $*; do case "$1" in -*) continue;; *);; esac;if test -n "$out"; then out="$out ";fi;out="$out\"$i\""; done; printf "%s" "$out"' sh)" brew.add.cask "$optional" "$only" "$except" |
108 | 110 | elif contains "$content" "use_brew_tap"; then |
109 | 111 | migrate_to_nix "$1" "$(read_match "$content" "use_brew_tap" | item_at 2 | normalize | xargs sh -c 'out="";for i in $*; do case "$1" in -*) continue;; *);; esac;if test -n "$out"; then out="$out ";fi;out="$out\"$i\""; done; printf "%s" "$out"' sh)" brew.add.tap "$optional" "$only" "$except" |
110 | | - elif contains "$content" "has_executable"; then |
111 | | - migrate_to_nix "$1" "pkgs.$(read_match "$content" "has_executable" | item_at 2 | strip)" nixpkgs.add "$optional" "$only" "$except" |
| 112 | + # elif contains "$content" "has_executable"; then |
| 113 | + # migrate_to_nix "$1" "pkgs.$(read_match "$content" "has_executable" | item_at 2 | strip)" nixpkgs.add "$optional" "$only" "$except" |
112 | 114 | else |
113 | 115 | printf ' skipped\n' |
114 | 116 | return 1 |
|
0 commit comments