···8 wrappedBins = pkgs.runCommand "firejail-wrapped-binaries"
9 { preferLocalBuild = true;
10 allowSubstitutes = false;
0011 }
12 ''
13 mkdir -p $out/bin
014 ${lib.concatStringsSep "\n" (lib.mapAttrsToList (command: value:
15 let
16 opts = if builtins.isAttrs value
17 then value
18- else { executable = value; profile = null; extraArgs = []; };
19 args = lib.escapeShellArgs (
20 opts.extraArgs
21 ++ (optional (opts.profile != null) "--profile=${toString opts.profile}")
22- );
23 in
24 ''
25 cat <<_EOF >$out/bin/${command}
···27 exec /run/wrappers/bin/firejail ${args} -- ${toString opts.executable} "\$@"
28 _EOF
29 chmod 0755 $out/bin/${command}
0000030 '') cfg.wrappedBinaries)}
31 '';
32···42 description = lib.mdDoc "Executable to run sandboxed";
43 example = literalExpression ''"''${lib.getBin pkgs.firefox}/bin/firefox"'';
44 };
00000045 profile = mkOption {
46 type = types.nullOr types.path;
47 default = null;
···71 '';
72 description = lib.mdDoc ''
73 Wrap the binaries in firejail and place them in the global path.
74-75- You will get file collisions if you put the actual application binary in
76- the global environment (such as by adding the application package to
77- `environment.systemPackages`), and applications started via
78- .desktop files are not wrapped if they specify the absolute path to the
79- binary.
80 '';
81 };
82 };
···8 wrappedBins = pkgs.runCommand "firejail-wrapped-binaries"
9 { preferLocalBuild = true;
10 allowSubstitutes = false;
11+ # take precedence over non-firejailed versions
12+ meta.priority = -1;
13 }
14 ''
15 mkdir -p $out/bin
16+ mkdir -p $out/share/applications
17 ${lib.concatStringsSep "\n" (lib.mapAttrsToList (command: value:
18 let
19 opts = if builtins.isAttrs value
20 then value
21+ else { executable = value; desktop = null; profile = null; extraArgs = []; };
22 args = lib.escapeShellArgs (
23 opts.extraArgs
24 ++ (optional (opts.profile != null) "--profile=${toString opts.profile}")
25+ );
26 in
27 ''
28 cat <<_EOF >$out/bin/${command}
···30 exec /run/wrappers/bin/firejail ${args} -- ${toString opts.executable} "\$@"
31 _EOF
32 chmod 0755 $out/bin/${command}
33+34+ ${lib.optionalString (opts.desktop != null) ''
35+ substitute ${opts.desktop} $out/share/applications/$(basename ${opts.desktop}) \
36+ --replace ${opts.executable} $out/bin/${command}
37+ ''}
38 '') cfg.wrappedBinaries)}
39 '';
40···50 description = lib.mdDoc "Executable to run sandboxed";
51 example = literalExpression ''"''${lib.getBin pkgs.firefox}/bin/firefox"'';
52 };
53+ desktop = mkOption {
54+ type = types.nullOr types.path;
55+ default = null;
56+ description = lib.mkDoc ".desktop file to modify. Only necessary if it uses the absolute path to the executable.";
57+ example = literalExpression ''"''${pkgs.firefox}/share/applications/firefox.desktop"'';
58+ };
59 profile = mkOption {
60 type = types.nullOr types.path;
61 default = null;
···85 '';
86 description = lib.mdDoc ''
87 Wrap the binaries in firejail and place them in the global path.
00000088 '';
89 };
90 };
+3-2
nixos/modules/services/web-apps/mastodon.nix
···658 recommendedProxySettings = true; # required for redirections to work
659 virtualHosts."${cfg.localDomain}" = {
660 root = "${cfg.package}/public/";
661- forceSSL = true; # mastodon only supports https
662- enableACME = true;
0663664 locations."/system/".alias = "/var/lib/mastodon/public-system/";
665
···658 recommendedProxySettings = true; # required for redirections to work
659 virtualHosts."${cfg.localDomain}" = {
660 root = "${cfg.package}/public/";
661+ # mastodon only supports https, but you can override this if you offload tls elsewhere.
662+ forceSSL = lib.mkDefault true;
663+ enableACME = lib.mkDefault true;
664665 locations."/system/".alias = "/var/lib/mastodon/public-system/";
666
···1{ lib, stdenv, fetchurl, ocamlPackages, gnome2, pkg-config, makeWrapper, glib
2-, libtool, libpng, bison, expat, fontconfig, gd, pango, libjpeg, libwebp, xlibsWrapper, libXaw
3}:
4# We need an old version of Graphviz for format compatibility reasons.
5# This version is vulnerable, but monotone-viz will never feed it bad input.
6let graphviz_2_0 = import ./graphviz-2.0.nix {
7- inherit lib stdenv fetchurl pkg-config xlibsWrapper libpng libjpeg expat libXaw
8 bison libtool fontconfig pango gd libwebp;
9 }; in
10let inherit (gnome2) libgnomecanvas; in
···1{ lib, stdenv, fetchurl, ocamlPackages, gnome2, pkg-config, makeWrapper, glib
2+, libtool, libpng, bison, expat, fontconfig, gd, pango, libjpeg, libwebp, libX11, libXaw
3}:
4# We need an old version of Graphviz for format compatibility reasons.
5# This version is vulnerable, but monotone-viz will never feed it bad input.
6let graphviz_2_0 = import ./graphviz-2.0.nix {
7+ inherit lib stdenv fetchurl pkg-config libX11 libpng libjpeg expat libXaw
8 bison libtool fontconfig pango gd libwebp;
9 }; in
10let inherit (gnome2) libgnomecanvas; in
···17, CoreFoundation
18, CoreServices
19, Security
20+21+, enableMinimal ? false
22}:
2324let
···125 sed -i "s|https://files.pythonhosted.org/packages/[[:alnum:]]*/[[:alnum:]]*/[[:alnum:]]*/|file://$NIX_BUILD_TOP/$sourceRoot/hack_pydeps/|g" $sourceRoot/setup.py
126 '';
127128+ # Now, copy the "sl web" (aka edenscm-isl) results into the output of this
129+ # package, so that the command can actually work. NOTES:
130+ #
131+ # 1) This applies on all systems (so no conditional a la postFixup)
132+ # 2) This doesn't require any kind of fixup itself, so we leave it out
133+ # of postFixup for that reason, too
134+ # 3) If asked, we optionally patch in a hardcoded path to the 'nodejs' package,
135+ # so that 'sl web' always works
136+ # 4) 'sl web' will still work if 'nodejs' is in $PATH, just not OOTB
137+ preFixup = ''
138+ sitepackages=$out/lib/${python38Packages.python.libPrefix}/site-packages
139+ chmod +w $sitepackages
140+ cp -r ${isl} $sitepackages/edenscm-isl
141+ '' + lib.optionalString (!enableMinimal) ''
142+ chmod +w $sitepackages/edenscm-isl/run-isl
143+ substituteInPlace $sitepackages/edenscm-isl/run-isl \
144+ --replace 'NODE=node' 'NODE=${nodejs}/bin/node'
145+ '';
146+147 postFixup = lib.optionalString stdenv.isLinux ''
148 wrapProgram $out/bin/sl \
149 --set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive"
···159 ]);
160161 buildInputs = [
0162 openssl
163 ] ++ lib.optionals stdenv.isDarwin [
164+ curl
165 libiconv
166 CoreFoundation
167 CoreServices
···186 runHook preInstall
187188 mkdir -p $out
0189 cp -r ${sapling}/* $out
0000190191 runHook postInstall
192 '';
···1-{ lib, stdenv, fetchurl, fetchpatch, python, buildPythonPackage, pkg-config, glib, isPy3k, pythonAtLeast }:
2-3-buildPythonPackage rec {
4- pname = "pygobject";
5- version = "2.28.7";
6- format = "other";
7- disabled = pythonAtLeast "3.9";
8-9- src = fetchurl {
10- url = "mirror://gnome/sources/pygobject/2.28/${pname}-${version}.tar.xz";
11- sha256 = "0nkam61rsn7y3wik3vw46wk5q2cjfh2iph57hl9m39rc8jijb7dv";
12- };
13-14- outputs = [ "out" "devdoc" ];
15-16- patches = lib.optionals stdenv.isDarwin [
17- ./pygobject-2.0-fix-darwin.patch
18- (fetchpatch {
19- url = "https://github.com/macports/macports-ports/raw/f2975d5bbbc2459c661905c5a850cc661fa32f55/python/py-gobject/files/py-gobject-dynamic_lookup-11.patch";
20- sha256 = "sha256-mtlyu+La3+iC5iQAmVJzDA5E35XGaRQy/EKXzvrWRCg=";
21- extraPrefix = "";
22- })
23- ];
24-25- configureFlags = [ "--disable-introspection" ];
26-27- nativeBuildInputs = [ pkg-config ];
28- buildInputs = [ glib ];
29-30- # in a "normal" setup, pygobject and pygtk are installed into the
31- # same site-packages: we need a pth file for both. pygtk.py would be
32- # used to select a specific version, in our setup it should have no
33- # effect, but we leave it in case somebody expects and calls it.
34- postInstall = lib.optionalString (!isPy3k) ''
35- mv $out/lib/${python.libPrefix}/site-packages/{pygtk.pth,${pname}-${version}.pth}
36-37- # Prevent wrapping of codegen files as these are meant to be
38- # executed by the python program
39- chmod a-x $out/share/pygobject/*/codegen/*.py
40- '';
41-42- meta = with lib; {
43- homepage = "https://pygobject.readthedocs.io/";
44- description = "Python bindings for GLib";
45- platforms = platforms.unix;
46- };
47-}
···1-{ lib, stdenv
2-, buildPythonPackage
3-, fetchPypi
4-, isPy3k
5-, pkgs
6-}:
7-8-buildPythonPackage rec {
9- pname = "pysqlite";
10- version = "2.8.3";
11-12- src = fetchPypi {
13- inherit pname version;
14- sha256 = "17d3335863e8cf8392eea71add33dab3f96d060666fe68ab7382469d307f4490";
15- };
16-17- # Need to use the builtin sqlite3 on Python 3
18- disabled = isPy3k;
19-20- # Since the `.egg' file is zipped, the `NEEDED' of the `.so' files
21- # it contains is not taken into account. Thus, we must explicitly make
22- # it a propagated input.
23- propagatedBuildInputs = [ pkgs.sqlite ];
24-25- patchPhase = ''
26- substituteInPlace "setup.cfg" \
27- --replace "/usr/local/include" "${pkgs.sqlite.dev}/include" \
28- --replace "/usr/local/lib" "${pkgs.sqlite.out}/lib"
29- ${lib.optionalString (!stdenv.isDarwin) ''export LDSHARED="$CC -pthread -shared"''}
30- '';
31-32- meta = with lib; {
33- homepage = "https://pysqlite.org/";
34- description = "Python bindings for the SQLite embedded relational database engine";
35- longDescription = ''
36- pysqlite is a DB-API 2.0-compliant database interface for SQLite.
37-38- SQLite is a relational database management system contained in
39- a relatively small C library. It is a public domain project
40- created by D. Richard Hipp. Unlike the usual client-server
41- paradigm, the SQLite engine is not a standalone process with
42- which the program communicates, but is linked in and thus
43- becomes an integral part of the program. The library
44- implements most of SQL-92 standard, including transactions,
45- triggers and most of complex queries.
46-47- pysqlite makes this powerful embedded SQL engine available to
48- Python programmers. It stays compatible with the Python
49- database API specification 2.0 as much as possible, but also
50- exposes most of SQLite's native API, so that it is for example
51- possible to create user-defined SQL functions and aggregates
52- in Python.
53- '';
54- license = licenses.bsd3;
55- };
56-57-}
···1+{ lib, rustPlatform, fetchFromGitHub, pkg-config, libxkbcommon }:
2+3+rustPlatform.buildRustPackage rec {
4+ pname = "wpaperd";
5+ version = "0.2.0";
6+7+ src = fetchFromGitHub {
8+ owner = "danyspin97";
9+ repo = pname;
10+ rev = version;
11+ sha256 = "n1zlC2afog0UazsJEBAzXpnhVDeP3xqpNGXlJ65umHQ=";
12+ };
13+14+ nativeBuildInputs = [
15+ pkg-config
16+ ];
17+ buildInputs = [
18+ libxkbcommon
19+ ];
20+21+ cargoSha256 = "8ZMdbJvedDqoDr2rhKM1TMB5N4aRde04x/9H212fe68=";
22+23+ meta = with lib; {
24+ description = "Minimal wallpaper daemon for Wayland";
25+ longDescription = ''
26+ It allows the user to choose a different image for each output (aka for each monitor)
27+ just as swaybg. Moreover, a directory can be chosen and wpaperd will randomly choose
28+ an image from it. Optionally, the user can set a duration, after which the image
29+ displayed will be changed with another random one.
30+ '';
31+ homepage = "https://github.com/danyspin97/wpaperd";
32+ license = licenses.gpl3Plus;
33+ platforms = platforms.linux;
34+ maintainers = with maintainers; [ DPDmancul ];
35+ };
36+}