|
91 | 91 | exe,
|
92 | 92 | dir,
|
93 | 93 | net ? false,
|
| 94 | + cfg ? "", |
94 | 95 | }: {
|
95 | 96 | "${pkg}" = {
|
96 | 97 | executable = exe;
|
97 |
| - profile = mkFirejailProfile {inherit pkg dir net;}; |
| 98 | + profile = mkFirejailProfile {inherit pkg dir net cfg;}; |
98 | 99 | };
|
99 | 100 | };
|
100 | 101 | mkFirejailProfile = {
|
101 | 102 | pkg,
|
102 | 103 | dir,
|
103 |
| - net ? false, |
| 104 | + net, |
| 105 | + cfg, |
104 | 106 | }:
|
105 |
| - pkgs.writeText "${pkg}.local" '' |
106 |
| - include default.profile |
| 107 | + pkgs.writeText "${pkg}.local" ( |
| 108 | + '' |
| 109 | + include default.profile |
107 | 110 |
|
108 |
| - include disable-X11.inc |
109 |
| - include disable-common.inc |
110 |
| - include disable-devel.inc |
111 |
| - include disable-exec.inc |
112 |
| - include disable-interpreters.inc |
113 |
| - include disable-proc.inc |
114 |
| - include disable-programs.inc |
115 |
| - include disable-shell.inc |
116 |
| - include disable-write-mnt.inc |
117 |
| - include disable-xdg.inc |
| 111 | + include disable-X11.inc |
| 112 | + include disable-common.inc |
| 113 | + include disable-devel.inc |
| 114 | + include disable-exec.inc |
| 115 | + include disable-interpreters.inc |
| 116 | + include disable-proc.inc |
| 117 | + include disable-programs.inc |
| 118 | + include disable-shell.inc |
| 119 | + include disable-write-mnt.inc |
| 120 | + include disable-xdg.inc |
118 | 121 |
|
119 |
| - # no3d |
120 |
| - # nosound |
121 |
| - apparmor |
122 |
| - caps.drop all |
123 |
| - machine-id |
124 |
| - ${ |
125 |
| - if net |
126 |
| - then "" |
127 |
| - else "net none" |
128 |
| - } |
129 |
| - netfilter |
130 |
| - nodvd |
131 |
| - nogroups |
132 |
| - noinput |
133 |
| - nonewprivs |
134 |
| - noprinters |
135 |
| - noroot |
136 |
| - notv |
137 |
| - nou2f |
138 |
| - novideo |
139 |
| - shell none |
| 122 | + # no3d |
| 123 | + # nosound |
| 124 | + apparmor |
| 125 | + caps.drop all |
| 126 | + machine-id |
| 127 | + ${ |
| 128 | + if net |
| 129 | + then "" |
| 130 | + else "net none" |
| 131 | + } |
| 132 | + netfilter |
| 133 | + nodvd |
| 134 | + nogroups |
| 135 | + noinput |
| 136 | + nonewprivs |
| 137 | + noprinters |
| 138 | + noroot |
| 139 | + notv |
| 140 | + nou2f |
| 141 | + novideo |
| 142 | + shell none |
140 | 143 |
|
141 |
| - disable-mnt |
142 |
| - private ''${HOME}/.firejail/${dir} |
143 |
| - private-bin none |
144 |
| - private-cache |
145 |
| - private-cwd |
146 |
| - private-dev |
147 |
| - ${ |
148 |
| - if net |
149 |
| - then "" |
150 |
| - else "private-etc none" |
151 |
| - } |
152 |
| - private-lib none |
153 |
| - private-opt none |
154 |
| - private-srv none |
155 |
| - private-tmp |
156 |
| - seccomp |
157 |
| - ${ |
158 |
| - if net |
159 |
| - then "" |
160 |
| - else "x11 none" |
161 |
| - } |
| 144 | + disable-mnt |
| 145 | + private ''${HOME}/.firejail/${dir} |
| 146 | + private-bin none |
| 147 | + private-cache |
| 148 | + private-cwd |
| 149 | + private-dev |
| 150 | + ${ |
| 151 | + if net |
| 152 | + then "" |
| 153 | + else "private-etc none" |
| 154 | + } |
| 155 | + private-lib none |
| 156 | + private-opt none |
| 157 | + private-srv none |
| 158 | + private-tmp |
| 159 | + seccomp |
| 160 | + ${ |
| 161 | + if net |
| 162 | + then "" |
| 163 | + else "x11 none" |
| 164 | + } |
162 | 165 |
|
163 |
| - dbus-system none |
164 |
| - dbus-user none |
| 166 | + dbus-system none |
| 167 | + dbus-user none |
165 | 168 |
|
166 |
| - restrict-namespaces |
167 |
| - ''; |
| 169 | + restrict-namespaces |
| 170 | + '' |
| 171 | + + cfg |
| 172 | + ); |
168 | 173 | mkFirejailWrapper = {
|
169 | 174 | pkgs,
|
170 | 175 | pkg,
|
|
806 | 811 | "networkmanager"
|
807 | 812 | "scanner"
|
808 | 813 | "ydotool"
|
| 814 | + "render" |
| 815 | + "video" |
809 | 816 | "lp"
|
810 | 817 | ];
|
811 | 818 | #
|
@@ -899,6 +906,37 @@ in {
|
899 | 906 | -file ./ashes/Ashes2063EnrichedFDPatch.pk3 \
|
900 | 907 | -file ./SimpleSlots.1.1.pk7
|
901 | 908 | '';
|
| 909 | + } |
| 910 | + // mkFirejailCustom { |
| 911 | + pkg = "tabby-download-embed"; |
| 912 | + dir = "tabby"; |
| 913 | + net = true; |
| 914 | + exe = '' |
| 915 | + ${import ./tabby.nix}/bin/tabby \ |
| 916 | + download --model Nomic-Embed-Text |
| 917 | + ''; |
| 918 | + } |
| 919 | + // mkFirejailCustom { |
| 920 | + pkg = "tabby-download-qwen"; |
| 921 | + dir = "tabby"; |
| 922 | + net = true; |
| 923 | + exe = '' |
| 924 | + ${import ./tabby.nix}/bin/tabby \ |
| 925 | + download --model Qwen2.5-Coder-0.5B |
| 926 | + ''; |
| 927 | + } |
| 928 | + // mkFirejailCustom { |
| 929 | + pkg = "tabby-serve-qwen"; |
| 930 | + dir = "tabby"; |
| 931 | + cfg = '' |
| 932 | + env SWC_DEBUG=1 |
| 933 | + env RUST_LOG=trace |
| 934 | + env TABBY_DISABLE_USAGE_COLLECTION=1 |
| 935 | + ''; |
| 936 | + exe = '' |
| 937 | + ${import ./tabby-socat.nix}/bin/tabby-socat \ |
| 938 | + serve --model Qwen2.5-Coder-0.5B |
| 939 | + ''; |
902 | 940 | };
|
903 | 941 |
|
904 | 942 | #
|
|
0 commit comments