git.iko.soy/typeable/nixpkgs
on master help sign in
Merge master into staging-next
commit563389a7fdd85b1ca1d4c6590785df62f52c8d6d authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> dateSat 22 May 2021, 12:27 (5 years ago) parentcc35c7fae5268b
22 files changed+550−26
nixos/modules/services/hardware/spacenavd.nix+1−2 nixos/modules/services/misc/nix-daemon.nix+7−1 pkgs/applications/graphics/freecad/default.nix+2 pkgs/applications/misc/rofimoji/default.nix+3−5 pkgs/applications/misc/spnavcfg/configure-cfgfile-path.patch+100 pkgs/applications/misc/spnavcfg/configure-pidfile-path.patch+40 pkgs/applications/misc/spnavcfg/default.nix+9 pkgs/applications/networking/instant-messengers/signal-desktop/default.nix+2−2 pkgs/applications/version-management/git-and-tools/lab/default.nix+3−3 pkgs/applications/video/qstopmotion/default.nix+5−2 pkgs/development/haskell-modules/configuration-common.nix+14−4 pkgs/development/libraries/libspnav/configure-socket-path.patch+47 pkgs/development/libraries/libspnav/default.nix+6 pkgs/development/python-modules/xdg/default.nix+2−2 pkgs/development/web/twitter-bootstrap/default.nix+2−2 pkgs/misc/drivers/spacenavd/configure-cfgfile-path.patch+63 pkgs/misc/drivers/spacenavd/configure-pidfile-path.patch+82 pkgs/misc/drivers/spacenavd/configure-socket-path.patch+118 pkgs/misc/drivers/spacenavd/default.nix+9 pkgs/tools/misc/fetchutils/default.nix+29 pkgs/tools/nix/nixos-generators/default.nix+2−2 pkgs/top-level/all-packages.nix+4−1
nixos/modules/services/hardware/spacenavd.nix+1−2
@@ -13,13 +13,12 @@ in {
1313 };
1414
1515 config = mkIf cfg.enable {
16− systemd.services.spacenavd = {
16+ systemd.user.services.spacenavd = {
1717 description = "Daemon for the Spacenavigator 6DOF mice by 3Dconnexion";
1818 after = [ "syslog.target" ];
1919 wantedBy = [ "graphical.target" ];
2020 serviceConfig = {
2121 ExecStart = "${pkgs.spacenavd}/bin/spacenavd -d -l syslog";
22− StandardError = "syslog";
2322 };
2423 };
2524 };
nixos/modules/services/misc/nix-daemon.nix+7−1
@@ -12,6 +12,8 @@ let
1212
1313 isNix23 = versionAtLeast nixVersion "2.3pre";
1414
15+ isNix24 = versionAtLeast nixVersion "2.4pre";
16+
1517 makeNixBuildUser = nr: {
1618 name = "nixbld${toString nr}";
1719 value = {
@@ -41,7 +43,11 @@ let
4143 max-jobs = ${toString (cfg.maxJobs)}
4244 cores = ${toString (cfg.buildCores)}
4345 sandbox = ${if (builtins.isBool cfg.useSandbox) then boolToString cfg.useSandbox else cfg.useSandbox}
44− extra-sandbox-paths = ${toString cfg.sandboxPaths}
46+ ${if isNix24 then ''
47+ sandbox-paths = ${toString cfg.sandboxPaths}
48+ '' else ''
49+ extra-sandbox-paths = ${toString cfg.sandboxPaths}
50+ ''}
4551 substituters = ${toString cfg.binaryCaches}
4652 trusted-substituters = ${toString cfg.trustedBinaryCaches}
4753 trusted-public-keys = ${toString cfg.binaryCachePublicKeys}
pkgs/applications/graphics/freecad/default.nix+2
@@ -23,6 +23,7 @@
2323, opencascade-occt
2424, pivy
2525, pkg-config
26+, ply
2627, pycollada
2728, pyside2
2829, pyside2-tools
@@ -80,6 +81,7 @@ mkDerivation rec {
8081 ode
8182 opencascade-occt
8283 pivy
84+ ply # for openSCAD file support
8385 pycollada
8486 pyside2
8587 pyside2-tools
pkgs/applications/misc/rofimoji/default.nix+3−5
@@ -6,7 +6,6 @@
66, x11Support ? true
77
88, ConfigArgParse
9−, pyxdg
109, rofi
1110, wl-clipboard
1211, wtype
@@ -16,18 +15,18 @@
1615
1716buildPythonApplication rec {
1817 pname = "rofimoji";
19− version = "4.3.0";
18+ version = "5.1.0";
2019
2120 src = fetchFromGitHub {
2221 owner = "fdw";
2322 repo = "rofimoji";
2423 rev = version;
25− sha256 = "08ayndpifr04njpijc5n5ii5nvibfpab39p6ngyyj0pb43792a8j";
24+ sha256 = "sha256-bLV0hYDjVH11euvNHUHZFcCVywuceRljkCqyX4aANVs=";
2625 };
2726
2827 # `rofi` and the `waylandSupport` and `x11Support` dependencies
2928 # contain binaries needed at runtime.
30− propagatedBuildInputs = with lib; [ ConfigArgParse pyxdg rofi ]
29+ propagatedBuildInputs = with lib; [ ConfigArgParse rofi ]
3130 ++ optionals waylandSupport [ wl-clipboard wtype ]
3231 ++ optionals x11Support [ xdotool xsel ];
3332
@@ -35,7 +34,6 @@ buildPythonApplication rec {
3534 # and has additional dependencies.
3635 postPatch = ''
3736 rm -rf extractors
38− substituteInPlace setup.py --replace 'pyxdg==0.26' 'pyxdg'
3937 '';
4038
4139 # no tests executed
pkgs/applications/misc/spnavcfg/configure-cfgfile-path.patchnew file+100
@@ -0,0 +1,100 @@
1+diff --git a/back.c b/back.c
2+index c1810dc..75416fb 100644
3+--- a/back.c
4++++ b/back.c
5+@@ -25,7 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
6+ #include "cfgfile.h"
7+ #include "cmd.h"
8+
9+-#define CFGFILE "/etc/spnavrc"
10+
11+ int get_daemon_pid(void);
12+ static int update_cfg(void);
13+@@ -127,7 +126,7 @@ int get_daemon_pid(void)
14+
15+ static int update_cfg(void)
16+ {
17+- if(write_cfg(CFGFILE, &cfg) == -1) {
18++ if(write_cfg(cfg_path(), &cfg) == -1) {
19+ fprintf(stderr, "failed to update config file\n");
20+ return -1;
21+ }
22+diff --git a/cfgfile.c b/cfgfile.c
23+index 5a9c502..2ea323d 100644
24+--- a/cfgfile.c
25++++ b/cfgfile.c
26+@@ -22,12 +22,40 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
27+ #include <ctype.h>
28+ #include <errno.h>
29+ #include <fcntl.h>
30++#include <unistd.h>
31++#include <sys/types.h>
32++#include <pwd.h>
33+ #include "cfgfile.h"
34+
35+ enum {TX, TY, TZ, RX, RY, RZ};
36+
37+ static const int def_axmap[] = {0, 2, 1, 3, 5, 4};
38+ static const int def_axinv[] = {0, 1, 1, 0, 1, 1};
39++static char* config_path;
40++
41++char* cfg_path()
42++{
43++ char* buf;
44++ if((buf = getenv("XDG_CONFIG_HOME"))) {
45++ if(config_path == NULL) {
46++ config_path = malloc(strlen(buf) + strlen("/spnavrc") + 1);
47++ if ( config_path != NULL) {
48++ sprintf(config_path, "%s/spnavrc", buf);
49++ }
50++ };
51++ return config_path;
52++ } else {
53++ if (!(buf = getenv("HOME"))) {
54++ struct passwd *pw = getpwuid(getuid());
55++ buf = pw->pw_dir;
56++ }
57++ config_path = malloc(strlen(buf) + strlen("/.config/spnavrc") + 1);
58++ if ( config_path != NULL) {
59++ sprintf(config_path, "%s/.config/spnavrc", buf);
60++ }
61++ return config_path;
62++ }
63++}
64+
65+ void default_cfg(struct cfg *cfg)
66+ {
67+diff --git a/cfgfile.h b/cfgfile.h
68+index dfed8c9..5bb1b2c 100644
69+--- a/cfgfile.h
70++++ b/cfgfile.h
71+@@ -47,6 +47,7 @@ struct cfg {
72+ int devid[MAX_CUSTOM][2]; /* custom USB vendor/product id list */
73+ };
74+
75++char* cfg_path(void);
76+ void default_cfg(struct cfg *cfg);
77+ int read_cfg(const char *fname, struct cfg *cfg);
78+ int write_cfg(const char *fname, struct cfg *cfg);
79+diff --git a/front_gtk.c b/front_gtk.c
80+index e4c2cd7..6a800a0 100644
81+--- a/front_gtk.c
82++++ b/front_gtk.c
83+@@ -28,8 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
84+ #include "cmd.h"
85+ #include "ui.h"
86+
87+-#define CFGFILE "/etc/spnavrc"
88+-
89+ #define CHK_AXINV_TRANS_X "axinv_trans_x"
90+ #define CHK_AXINV_TRANS_Y "axinv_trans_y"
91+ #define CHK_AXINV_TRANS_Z "axinv_trans_z"
92+@@ -121,7 +119,7 @@ void frontend(int pfd)
93+
94+ gtk_init(&argc, 0);
95+
96+- read_cfg(CFGFILE, &cfg);
97++ read_cfg(cfg_path(), &cfg);
98+
99+ create_ui();
100+
pkgs/applications/misc/spnavcfg/configure-pidfile-path.patchnew file+40
@@ -0,0 +1,40 @@
1+diff --git a/back.c b/back.c
2+index f364e31..c1810dc 100644
3+--- a/back.c
4++++ b/back.c
5+@@ -26,7 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
6+ #include "cmd.h"
7+
8+ #define CFGFILE "/etc/spnavrc"
9+-#define PIDFILE "/var/run/spnavd.pid"
10+
11+ int get_daemon_pid(void);
12+ static int update_cfg(void);
13+@@ -97,11 +96,26 @@ int get_daemon_pid(void)
14+ {
15+ FILE *fp;
16+ char buf[64];
17++ char* xdg_runtime_dir;
18++ char* pidfile;
19+
20+- if(!(fp = fopen(PIDFILE, "r"))) {
21++ if(!(xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"))){
22++ fprintf(stderr, "XDG_RUNTIME_DIR not set, can't find spacenav pid file\n");
23++ return -1;
24++ }
25++ pidfile = malloc(strlen(xdg_runtime_dir) + strlen("/spnavd.pid") + 1);
26++ if (pidfile == NULL) {
27++ fprintf(stderr, "failed to allocate memory\n");
28++ return -1;
29++ }
30++ sprintf(pidfile, "%s/spnavd.pid", xdg_runtime_dir);
31++
32++ if(!(fp = fopen(pidfile, "r"))) {
33+ fprintf(stderr, "no spacenav pid file, can't find daemon\n");
34++ free(pidfile);
35+ return -1;
36+ }
37++ free(pidfile);
38+ if(!fgets(buf, sizeof buf, fp) || !isdigit(buf[0])) {
39+ fprintf(stderr, "corrupted pidfile, can't find the daemon\n");
40+ fclose(fp);
pkgs/applications/misc/spnavcfg/default.nix+9
@@ -11,6 +11,15 @@ stdenv.mkDerivation rec {
1111 sha256 = "180mkdis15gxs79rr3f7hpwa1p6v81bybw37pzzdjnmqwqrc08a0";
1212 };
1313
14+ patches = [
15+ # Changes the pidfile path from /run/spnavd.pid to $XDG_RUNTIME_DIR/spnavd.pid
16+ # to allow for a user service
17+ ./configure-pidfile-path.patch
18+ # Changes the config file path from /etc/spnavrc to $XDG_CONFIG_HOME/spnavrc or $HOME/.config/spnavrc
19+ # to allow for a user service
20+ ./configure-cfgfile-path.patch
21+ ];
22+
1423 postPatch = ''
1524 sed -i s/4775/775/ Makefile.in
1625 '';
pkgs/applications/networking/instant-messengers/signal-desktop/default.nix+2−2
@@ -28,7 +28,7 @@ let
2828 else "");
2929in stdenv.mkDerivation rec {
3030 pname = "signal-desktop";
31− version = "5.2.0"; # Please backport all updates to the stable channel.
31+ version = "5.2.1"; # Please backport all updates to the stable channel.
3232 # All releases have a limited lifetime and "expire" 90 days after the release.
3333 # When releases "expire" the application becomes unusable until an update is
3434 # applied. The expiration date for the current release can be extracted with:
@@ -38,7 +38,7 @@ in stdenv.mkDerivation rec {
3838
3939 src = fetchurl {
4040 url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
41− sha256 = "0jvimpmz1d0pg9zpnyzm7a3g7vzapq62cphmvjhh67dxv5jih37k";
41+ sha256 = "0hkl8h49565kncvczv5fv4gak55lycygwb8i8igkgc4my0ykzs2z";
4242 };
4343
4444 nativeBuildInputs = [
pkgs/applications/version-management/git-and-tools/lab/default.nix+3−3
@@ -2,18 +2,18 @@
22
33buildGoModule rec {
44 pname = "lab";
5− version = "0.21.0";
5+ version = "0.22.0";
66
77 src = fetchFromGitHub {
88 owner = "zaquestion";
99 repo = "lab";
1010 rev = "v${version}";
11− sha256 = "sha256-mkhJmrKpIISd0m0m8fQ9vKuEr6h23BBxK6yo5fB+xcA=";
11+ sha256 = "sha256-CyXEmlsc40JtwDjRYNWqN+3cuoG8K07jAQdd1rktvS8=";
1212 };
1313
1414 subPackages = [ "." ];
1515
16− vendorSha256 = "sha256-cf+DVnGjSNV2eZ8S/Vk+VPlykoSjngrQuPeA9IshBUg=";
16+ vendorSha256 = "sha256-PSS7OPbM+XsylqDlWc4h+oZrOua2kSWKLEuyjqo/cxM=";
1717
1818 doCheck = false;
1919
pkgs/applications/video/qstopmotion/default.nix+5−2
@@ -6,7 +6,7 @@
66, qtquickcontrols
77, qtimageformats
88, qtxmlpatterns
9−, ffmpeg_3
9+, ffmpeg
1010, guvcview
1111, cmake
1212, ninja
@@ -40,7 +40,6 @@ mkDerivation rec {
4040 v4l-utils
4141 libv4l
4242 pcre
43− ffmpeg_3
4443 guvcview
4544 qwt
4645 ];
@@ -64,6 +63,10 @@ mkDerivation rec {
6463 grep -rl 'qwt' . | xargs sed -i 's@<qwt/qwt_slider.h>@<qwt_slider.h>@g'
6564 '';
6665
66+ qtWrapperArgs = [
67+ "--prefix" "PATH" ":" (lib.makeBinPath [ ffmpeg ])
68+ ];
69+
6770 meta = with lib; {
6871 homepage = "http://www.qstopmotion.org";
6972 description = "Create stopmotion animation with a (web)camera";
pkgs/development/haskell-modules/configuration-common.nix+14−4
@@ -203,6 +203,13 @@ self: super: {
203203 sha256 = "0pqmijfkysjixg3gb4kmrqdif7s2saz8qi6k337jf15i0npzln8d";
204204 revert = true;
205205 })
206+ # fix broken location annotations (necessary for update-nix-fetchgit).
207+ # Can be removed on the next hnix release after
208+ # https://github.com/haskell-nix/hnix/pull/936 is merged.
209+ (pkgs.fetchpatch {
210+ url = "https://github.com/expipiplus1/hnix/commit/7cd998426ab7d930d288a1d6e266dc4e85cece3d.patch";
211+ sha256 = "19ay6vxa90ykgdd0fis2djvki2kpgfsq7z55iyqg965m583vsfr6";
212+ })
206213 ] ++ (drv.patches or []);
207214 }));
208215
@@ -1405,10 +1412,7 @@ self: super: {
14051412 }"
14061413 '';
14071414
1408− # 2021-04-09: test failure
1409− # PR pending https://github.com/expipiplus1/update-nix-fetchgit/pull/60
1410− doCheck = false;
1411−
1415+ # These can both be removed upon the release of update-nix-fetchgit-0.2.7
14121416 patches = [
14131417 # 2021-05-17 compile with hnix >= 0.13
14141418 # https://github.com/expipiplus1/update-nix-fetchgit/pull/64
@@ -1416,6 +1420,12 @@ self: super: {
14161420 url = "https://github.com/expipiplus1/update-nix-fetchgit/commit/bc28c8b26c38093aa950574802012c0cd8447ce8.patch";
14171421 sha256 = "1dwd1jdsrx3ss6ql1bk2ch7ln74mkq6jy9ms8vi8kmf3gbg8l9fg";
14181422 })
1423+ # Fix test failure
1424+ # https://github.com/expipiplus1/update-nix-fetchgit/pull/60
1425+ (pkgs.fetchpatch {
1426+ url = "https://github.com/expipiplus1/update-nix-fetchgit/commit/4a43e1ea4e7e1c18de81e3f9fe0b86faa70865f5.patch";
1427+ sha256 = "1z74c1blgwr4q37m1rhlj7534qbnp3nnxf63m8j2b7iz0ljgm0m9";
1428+ })
14191429 ] ++ (drv.patches or []);
14201430 }));
14211431
pkgs/development/libraries/libspnav/configure-socket-path.patchnew file+47
@@ -0,0 +1,47 @@
1+diff --git a/spnav.c b/spnav.c
2+index f9e10f8..27149f7 100644
3+--- a/spnav.c
4++++ b/spnav.c
5+@@ -36,7 +36,7 @@ OF SUCH DAMAGE.
6+ #include <sys/select.h>
7+ #include "spnav.h"
8+
9+-#define SPNAV_SOCK_PATH "/var/run/spnav.sock"
10++#define DEFAULT_SPNAV_SOCK_PATH "/run/spnav.sock"
11+
12+ #ifdef USE_X11
13+ #include <X11/Xlib.h>
14+@@ -70,6 +70,24 @@ static struct event_node *ev_queue, *ev_queue_tail;
15+ /* AF_UNIX socket used for alternative communication with daemon */
16+ static int sock = -1;
17+
18++static char *spath = NULL;
19++
20++static char *socket_path()
21++{
22++ char *xdg_runtime_dir;
23++ if((xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"))) {
24++ if ( spath == NULL ) {
25++ spath = malloc(strlen(xdg_runtime_dir) + strlen("/spnav.sock") + 1);
26++ if ( spath != NULL ) {
27++ sprintf(spath, "%s/spnav.sock", xdg_runtime_dir);
28++ }
29++ }
30++ if(access(spath, F_OK) != -1){
31++ return spath;
32++ }
33++ }
34++ return DEFAULT_SPNAV_SOCK_PATH;
35++}
36+
37+ int spnav_open(void)
38+ {
39+@@ -92,7 +110,7 @@ int spnav_open(void)
40+
41+ memset(&addr, 0, sizeof addr);
42+ addr.sun_family = AF_UNIX;
43+- strncpy(addr.sun_path, SPNAV_SOCK_PATH, sizeof(addr.sun_path));
44++ strncpy(addr.sun_path, socket_path(), sizeof(addr.sun_path));
45+
46+
47+ if(connect(s, (struct sockaddr*)&addr, sizeof addr) == -1) {
pkgs/development/libraries/libspnav/default.nix+6
@@ -14,6 +14,12 @@ stdenv.mkDerivation rec {
1414 nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
1515 buildInputs = [ libX11 ];
1616
17+ patches = [
18+ # Changes the socket path from /run/spnav.sock to $XDG_RUNTIME_DIR/spnav.sock
19+ # to allow for a user service
20+ ./configure-socket-path.patch
21+ ];
22+
1723 configureFlags = [ "--disable-debug"];
1824 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
1925
pkgs/development/python-modules/xdg/default.nix+2−2
@@ -5,7 +5,7 @@
55}:
66
77buildPythonPackage rec {
8− version = "5.0.1";
8+ version = "5.0.2";
99 pname = "xdg";
1010 disabled = isPy27;
1111 format = "pyproject";
@@ -14,7 +14,7 @@ buildPythonPackage rec {
1414 owner = "srstevenson";
1515 repo = pname;
1616 rev = version;
17− sha256 = "sha256-WMY9Hs9SbErTp8hVBoCWTz4dLQhuzqTRpXFEyE7+woo=";
17+ sha256 = "sha256-wZfihMrq83Bye5CE5p7bTlI9Z7CsCkSd8Art5ws4vsY=";
1818 };
1919
2020 nativeBuildInputs = [ poetry-core ];
pkgs/development/web/twitter-bootstrap/default.nix+2−2
@@ -2,11 +2,11 @@
22
33stdenv.mkDerivation rec {
44 pname = "bootstrap";
5− version = "5.0.0";
5+ version = "5.0.1";
66
77 src = fetchurl {
88 url = "https://github.com/twbs/bootstrap/releases/download/v${version}/${pname}-${version}-dist.zip";
9− sha256 = "sha256-CsPvq8exUL2k/b/QK9c2S68DIsDDR8qxho0WgDJ3/Vs=";
9+ sha256 = "sha256-eep9s1YxTHeDDh+WhDMENho/N3AfJHVitis22bIGa6w=";
1010 };
1111
1212 nativeBuildInputs = [ unzip ];
pkgs/misc/drivers/spacenavd/configure-cfgfile-path.patchnew file+63
@@ -0,0 +1,63 @@
1+diff --git a/src/spnavd.c b/src/spnavd.c
2+index 2d4eca6..a5227ed 100644
3+--- a/src/spnavd.c
4++++ b/src/spnavd.c
5+@@ -27,6 +27,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
6+ #include <sys/select.h>
7+ #include <sys/socket.h>
8+ #include <sys/un.h>
9++#include <sys/types.h>
10++#include <pwd.h>
11+ #include "spnavd.h"
12+ #include "logger.h"
13+ #include "dev.h"
14+@@ -47,13 +49,39 @@ static void handle_events(fd_set *rset);
15+ static void sig_handler(int s);
16+ static char *fix_path(char *str);
17+
18+-static char *cfgfile = DEF_CFGFILE;
19++static char* config_path;
20++char* cfg_path()
21++{
22++ char* buf;
23++ if((buf = getenv("XDG_CONFIG_HOME"))) {
24++ if(config_path == NULL) {
25++ config_path = malloc(strlen(buf) + strlen("/spnavrc") + 1);
26++ if ( config_path != NULL) {
27++ sprintf(config_path, "%s/spnavrc", buf);
28++ }
29++ };
30++ return config_path;
31++ } else {
32++ if (!(buf = getenv("HOME"))) {
33++ struct passwd *pw = getpwuid(getuid());
34++ buf = pw->pw_dir;
35++ }
36++ config_path = malloc(strlen(buf) + strlen("/.config/spnavrc") + 1);
37++ if ( config_path != NULL) {
38++ sprintf(config_path, "%s/.config/spnavrc", buf);
39++ }
40++ return config_path;
41++ }
42++}
43++
44++static char *cfgfile = NULL;
45+ static char *logfile = DEF_LOGFILE;
46+ static char *pidpath = NULL;
47+
48+ int main(int argc, char **argv)
49+ {
50+ int i, pid, ret, become_daemon = 1;
51++ cfgfile = cfg_path();
52+
53+ for(i=1; i<argc; i++) {
54+ if(argv[i][0] == '-') {
55+@@ -247,7 +275,7 @@ static void print_usage(const char *argv0)
56+ printf("usage: %s [options]\n", argv0);
57+ printf("options:\n");
58+ printf(" -d: do not daemonize\n");
59+- printf(" -c <file>: config file path (default: " DEF_CFGFILE ")\n");
60++ printf(" -c <file>: config file path (default: %s)\n", cfg_path());
61+ printf(" -l <file>|syslog: log file path or log to syslog (default: " DEF_LOGFILE ")\n");
62+ printf(" -v: verbose output\n");
63+ printf(" -V,-version: print version number and exit\n");
pkgs/misc/drivers/spacenavd/configure-pidfile-path.patchnew file+82
@@ -0,0 +1,82 @@
1+diff --git a/src/spnavd.c b/src/spnavd.c
2+index 03080da..2d4eca6 100644
3+--- a/src/spnavd.c
4++++ b/src/spnavd.c
5+@@ -42,12 +42,14 @@ static void cleanup(void);
6+ static void daemonize(void);
7+ static int write_pid_file(void);
8+ static int find_running_daemon(void);
9++static char *pidfile_path(void);
10+ static void handle_events(fd_set *rset);
11+ static void sig_handler(int s);
12+ static char *fix_path(char *str);
13+
14+ static char *cfgfile = DEF_CFGFILE;
15+ static char *logfile = DEF_LOGFILE;
16++static char *pidpath = NULL;
17+
18+ int main(int argc, char **argv)
19+ {
20+@@ -270,7 +272,7 @@ static void cleanup(void)
21+ remove_device(tmp);
22+ }
23+
24+- remove(PIDFILE);
25++ remove(pidfile_path());
26+ }
27+
28+ static void daemonize(void)
29+@@ -314,7 +316,7 @@ static int write_pid_file(void)
30+ FILE *fp;
31+ int pid = getpid();
32+
33+- if(!(fp = fopen(PIDFILE, "w"))) {
34++ if(!(fp = fopen(pidfile_path(), "w"))) {
35+ return -1;
36+ }
37+ fprintf(fp, "%d\n", pid);
38+@@ -329,7 +331,7 @@ static int find_running_daemon(void)
39+ struct sockaddr_un addr;
40+
41+ /* try to open the pid-file */
42+- if(!(fp = fopen(PIDFILE, "r"))) {
43++ if(!(fp = fopen(pidfile_path(), "r"))) {
44+ return -1;
45+ }
46+ if(fscanf(fp, "%d\n", &pid) != 1) {
47+@@ -356,6 +358,22 @@ static int find_running_daemon(void)
48+ return pid;
49+ }
50+
51++char *pidfile_path(void)
52++{
53++ char *xdg_runtime_dir;
54++ if((xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"))) {
55++ if ( pidpath == NULL ) {
56++ pidpath = malloc(strlen(xdg_runtime_dir) + strlen("/spnavd.pid") + 1);
57++ if ( pidpath != NULL ) {
58++ sprintf(pidpath, "%s/spnavd.pid", xdg_runtime_dir);
59++ }
60++ };
61++ return pidpath;
62++ } else {
63++ return DEFAULT_PIDFILE;
64++ }
65++}
66++
67+ static void handle_events(fd_set *rset)
68+ {
69+ int dev_fd, hotplug_fd;
70+diff --git a/src/spnavd.h b/src/spnavd.h
71+index 2d1c48b..17d22d3 100644
72+--- a/src/spnavd.h
73++++ b/src/spnavd.h
74+@@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
75+ #define DEF_CFGFILE "/etc/spnavrc"
76+ #define DEF_LOGFILE "/var/log/spnavd.log"
77+
78+-#define PIDFILE "/var/run/spnavd.pid"
79++#define DEFAULT_PIDFILE "/run/spnavd.pid"
80+ #define DEFAULT_SOCK_NAME "/run/spnav.sock"
81+ #define SYSLOG_ID "spnavd"
82+
pkgs/misc/drivers/spacenavd/configure-socket-path.patchnew file+118
@@ -0,0 +1,118 @@
1+diff --git a/src/proto_unix.c b/src/proto_unix.c
2+index 998f234..d38452c 100644
3+--- a/src/proto_unix.c
4++++ b/src/proto_unix.c
5+@@ -36,11 +36,14 @@ enum {
6+
7+ static int lsock = -1;
8+
9++static char *spath = NULL;
10++
11+ int init_unix(void)
12+ {
13+ int s;
14+ mode_t prev_umask;
15+ struct sockaddr_un addr;
16++ char *sock_path;
17+
18+ if(lsock >= 0) return 0;
19+
20+@@ -49,16 +52,18 @@ int init_unix(void)
21+ return -1;
22+ }
23+
24+- unlink(SOCK_NAME); /* in case it already exists */
25++ sock_path = socket_path();
26++
27++ unlink(sock_path); /* in case it already exists */
28+
29+ memset(&addr, 0, sizeof addr);
30+ addr.sun_family = AF_UNIX;
31+- strcpy(addr.sun_path, SOCK_NAME);
32++ strcpy(addr.sun_path, sock_path);
33+
34+ prev_umask = umask(0);
35+
36+ if(bind(s, (struct sockaddr*)&addr, sizeof addr) == -1) {
37+- logmsg(LOG_ERR, "failed to bind unix socket: %s: %s\n", SOCK_NAME, strerror(errno));
38++ logmsg(LOG_ERR, "failed to bind unix socket: %s: %s\n", sock_path, strerror(errno));
39+ close(s);
40+ return -1;
41+ }
42+@@ -68,7 +73,7 @@ int init_unix(void)
43+ if(listen(s, 8) == -1) {
44+ logmsg(LOG_ERR, "listen failed: %s\n", strerror(errno));
45+ close(s);
46+- unlink(SOCK_NAME);
47++ unlink(sock_path);
48+ return -1;
49+ }
50+
51+@@ -82,7 +87,7 @@ void close_unix(void)
52+ close(lsock);
53+ lsock = -1;
54+
55+- unlink(SOCK_NAME);
56++ unlink(socket_path());
57+ }
58+ }
59+
60+@@ -173,3 +178,19 @@ int handle_uevents(fd_set *rset)
61+
62+ return 0;
63+ }
64++
65++char *socket_path(void)
66++{
67++ char *xdg_runtime_dir;
68++ if((xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"))) {
69++ if ( spath == NULL ) {
70++ spath = malloc(strlen(xdg_runtime_dir) + strlen("/spnav.sock") + 1);
71++ if ( spath != NULL ) {
72++ sprintf(spath, "%s/spnav.sock", xdg_runtime_dir);
73++ }
74++ };
75++ return spath;
76++ } else {
77++ return DEFAULT_SOCK_NAME;
78++ }
79++}
80+diff --git a/src/proto_unix.h b/src/proto_unix.h
81+index 045b379..ec4509c 100644
82+--- a/src/proto_unix.h
83++++ b/src/proto_unix.h
84+@@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
85+ #include "event.h"
86+ #include "client.h"
87+
88++char *socket_path(void);
89+ int init_unix(void);
90+ void close_unix(void);
91+ int get_unix_socket(void);
92+diff --git a/src/spnavd.c b/src/spnavd.c
93+index cbea191..03080da 100644
94+--- a/src/spnavd.c
95++++ b/src/spnavd.c
96+@@ -344,7 +344,7 @@ static int find_running_daemon(void)
97+ }
98+ memset(&addr, 0, sizeof addr);
99+ addr.sun_family = AF_UNIX;
100+- strncpy(addr.sun_path, SOCK_NAME, sizeof addr.sun_path);
101++ strncpy(addr.sun_path, socket_path(), sizeof addr.sun_path);
102+
103+ if(connect(s, (struct sockaddr*)&addr, sizeof addr) == -1) {
104+ close(s);
105+diff --git a/src/spnavd.h b/src/spnavd.h
106+index fa0a916..2d1c48b 100644
107+--- a/src/spnavd.h
108++++ b/src/spnavd.h
109+@@ -26,8 +26,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
110+ #define DEF_CFGFILE "/etc/spnavrc"
111+ #define DEF_LOGFILE "/var/log/spnavd.log"
112+
113+-#define SOCK_NAME "/var/run/spnav.sock"
114+ #define PIDFILE "/var/run/spnavd.pid"
115++#define DEFAULT_SOCK_NAME "/run/spnav.sock"
116+ #define SYSLOG_ID "spnavd"
117+
118+ /* Multiple devices support */
pkgs/misc/drivers/spacenavd/default.nix+9
@@ -17,6 +17,15 @@ stdenv.mkDerivation rec {
1717 url = "https://github.com/FreeSpacenav/spacenavd/commit/d6a25d5c3f49b9676d039775efc8bf854737c43c.patch";
1818 sha256 = "02pdgcvaqc20qf9hi3r73nb9ds7yk2ps9nnxaj0x9p50xjnhfg5c";
1919 })
20+ # Changes the socket path from /run/spnav.sock to $XDG_RUNTIME_DIR/spnav.sock
21+ # to allow for a user service
22+ ./configure-socket-path.patch
23+ # Changes the pidfile path from /run/spnavd.pid to $XDG_RUNTIME_DIR/spnavd.pid
24+ # to allow for a user service
25+ ./configure-pidfile-path.patch
26+ # Changes the config file path from /etc/spnavrc to $XDG_CONFIG_HOME/spnavrc or $HOME/.config/spnavrc
27+ # to allow for a user service
28+ ./configure-cfgfile-path.patch
2029 ];
2130
2231 buildInputs = [ libX11 ]
pkgs/tools/misc/fetchutils/default.nixnew file+29
@@ -0,0 +1,29 @@
1+{ lib, stdenvNoCC, fetchFromGitHub, bash, scdoc }:
2+
3+stdenvNoCC.mkDerivation rec {
4+ pname = "fetchutils";
5+ version = "unstable-2021-03-16";
6+
7+ src = fetchFromGitHub {
8+ owner = "lptstr";
9+ repo = pname;
10+ rev = "882781a297e86f4ad4eaf143e0777fb3e7c69526";
11+ sha256 = "sha256-ONrVZC6GBV5v3TeBekW9ybZjDHF3FNyXw1rYknqKRbk=";
12+ };
13+
14+ buildInputs = [ bash scdoc ];
15+
16+ installFlags = [ "DESTDIR=$(out)" "PREFIX=" ];
17+
18+ postPatch = ''
19+ patchShebangs --host src/*
20+ '';
21+
22+ meta = with lib; {
23+ description = "A collection of small shell utilities to fetch system information";
24+ homepage = "https://github.com/lptstr/fetchutils";
25+ license = licenses.mit;
26+ platforms = platforms.unix;
27+ maintainers = with maintainers; [ fortuneteller2k ];
28+ };
29+}
pkgs/tools/nix/nixos-generators/default.nix+2−2
@@ -2,12 +2,12 @@
22
33stdenv.mkDerivation rec {
44 pname = "nixos-generators";
5− version = "1.2.0";
5+ version = "1.3.0";
66 src = fetchFromGitHub {
77 owner = "nix-community";
88 repo = "nixos-generators";
99 rev = version;
10− sha256 = "1iwc39hzvzzyndxwbnl3fck7phxnjpnhy8zn4nyp8is1fiw0648v";
10+ sha256 = "1gbj2jw7zv3mnq1lyj4q53jpfj642jy7lvg0kp060znvhws3370y";
1111 };
1212 nativeBuildInputs = [ makeWrapper ];
1313 installFlags = [ "PREFIX=$(out)" ];
pkgs/top-level/all-packages.nix+4−1
@@ -407,6 +407,8 @@ in
407407
408408 etBook = callPackage ../data/fonts/et-book { };
409409
410+ fetchutils = callPackage ../tools/misc/fetchutils { };
411+
410412 fet-sh = callPackage ../tools/misc/fet-sh { };
411413
412414 fetchbower = callPackage ../build-support/fetchbower {
@@ -23641,6 +23643,7 @@ in
2364123643 boost
2364223644 matplotlib
2364323645 pivy
23646+ ply
2364423647 pycollada
2364523648 pyside2
2364623649 pyside2-tools
@@ -26157,7 +26160,7 @@ in
2615726160 rofi-systemd = callPackage ../tools/system/rofi-systemd { };
2615826161
2615926162 rofimoji = callPackage ../applications/misc/rofimoji {
26160− inherit (python3Packages) buildPythonApplication ConfigArgParse pyxdg;
26163+ inherit (python3Packages) buildPythonApplication ConfigArgParse;
2616126164 };
2616226165
2616326166 rootlesskit = callPackage ../tools/virtualization/rootlesskit {};