uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
39
pkgs/applications/window-managers/sway/bg.nix
Normal file
39
pkgs/applications/window-managers/sway/bg.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ lib, stdenv, fetchFromGitHub
|
||||
, meson, ninja, pkg-config, scdoc
|
||||
, wayland, wayland-protocols, cairo, gdk-pixbuf
|
||||
, wayland-scanner
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "swaybg";
|
||||
version = "1.1.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "swaywm";
|
||||
repo = "swaybg";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-Lt/hn/K+CjcmU3Bs5wChiZq0VGNcraH4tSVYsmYnKjc=";
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
depsBuildBuild = [ pkg-config ];
|
||||
nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-scanner ];
|
||||
buildInputs = [ wayland wayland-protocols cairo gdk-pixbuf ];
|
||||
|
||||
mesonFlags = [
|
||||
"-Dgdk-pixbuf=enabled" "-Dman-pages=enabled"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Wallpaper tool for Wayland compositors";
|
||||
longDescription = ''
|
||||
A wallpaper utility for Wayland compositors, that is compatible with any
|
||||
Wayland compositor which implements the following Wayland protocols:
|
||||
wlr-layer-shell, xdg-output, and xdg-shell.
|
||||
'';
|
||||
inherit (src.meta) homepage;
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ primeos ];
|
||||
};
|
||||
}
|
||||
97
pkgs/applications/window-managers/sway/contrib.nix
Normal file
97
pkgs/applications/window-managers/sway/contrib.nix
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
{ lib, stdenv
|
||||
|
||||
, fetchurl
|
||||
, coreutils
|
||||
, makeWrapper
|
||||
, sway-unwrapped
|
||||
, installShellFiles
|
||||
, wl-clipboard
|
||||
, libnotify
|
||||
, slurp
|
||||
, grim
|
||||
, jq
|
||||
, bash
|
||||
|
||||
, python3Packages
|
||||
}:
|
||||
|
||||
{
|
||||
|
||||
grimshot = stdenv.mkDerivation rec {
|
||||
pname = "grimshot";
|
||||
version = sway-unwrapped.version;
|
||||
|
||||
src = sway-unwrapped.src;
|
||||
|
||||
dontBuild = true;
|
||||
dontConfigure = true;
|
||||
|
||||
outputs = [ "out" "man" ];
|
||||
|
||||
strictDeps = true;
|
||||
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
||||
buildInputs = [ bash ];
|
||||
installPhase = ''
|
||||
installManPage contrib/grimshot.1
|
||||
|
||||
install -Dm 0755 contrib/grimshot $out/bin/grimshot
|
||||
wrapProgram $out/bin/grimshot --set PATH \
|
||||
"${lib.makeBinPath [
|
||||
sway-unwrapped
|
||||
wl-clipboard
|
||||
coreutils
|
||||
libnotify
|
||||
slurp
|
||||
grim
|
||||
jq
|
||||
] }"
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
installCheckPhase = ''
|
||||
# check always returns 0
|
||||
if [[ $($out/bin/grimshot check | grep "NOT FOUND") ]]; then false
|
||||
else
|
||||
echo "grimshot check passed"
|
||||
fi
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A helper for screenshots within sway";
|
||||
homepage = "https://github.com/swaywm/sway/tree/master/contrib";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [
|
||||
sway-unwrapped.meta.maintainers
|
||||
evils
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
inactive-windows-transparency = python3Packages.buildPythonApplication rec {
|
||||
# long name is long
|
||||
lname = "inactive-windows-transparency";
|
||||
pname = "sway-${lname}";
|
||||
version = sway-unwrapped.version;
|
||||
|
||||
src = sway-unwrapped.src;
|
||||
|
||||
format = "other";
|
||||
dontBuild = true;
|
||||
dontConfigure = true;
|
||||
|
||||
propagatedBuildInputs = [ python3Packages.i3ipc ];
|
||||
|
||||
installPhase = ''
|
||||
install -Dm 0755 $src/contrib/${lname}.py $out/bin/${lname}.py
|
||||
'';
|
||||
|
||||
meta = sway-unwrapped.meta // {
|
||||
description = "It makes inactive sway windows transparent";
|
||||
homepage = "https://github.com/swaywm/sway/tree/${sway-unwrapped.version}/contrib";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
95
pkgs/applications/window-managers/sway/default.nix
Normal file
95
pkgs/applications/window-managers/sway/default.nix
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
{ lib, stdenv, fetchFromGitHub, substituteAll, swaybg
|
||||
, meson, ninja, pkg-config, wayland-scanner, scdoc
|
||||
, wayland, libxkbcommon, pcre, json_c, libevdev
|
||||
, pango, cairo, libinput, libcap, pam, gdk-pixbuf, librsvg
|
||||
, wlroots, wayland-protocols, libdrm
|
||||
, nixosTests
|
||||
# Used by the NixOS module:
|
||||
, isNixOS ? false
|
||||
|
||||
, enableXWayland ? true
|
||||
, systemdSupport ? stdenv.isLinux
|
||||
, dbusSupport ? true
|
||||
, dbus
|
||||
, trayEnabled ? systemdSupport && dbusSupport
|
||||
}:
|
||||
|
||||
# The "sd-bus-provider" meson option does not include a "none" option,
|
||||
# but it is silently ignored iff "-Dtray=disabled". We use "basu"
|
||||
# (which is not in nixpkgs) instead of "none" to alert us if this
|
||||
# changes: https://github.com/swaywm/sway/issues/6843#issuecomment-1047288761
|
||||
assert trayEnabled -> systemdSupport && dbusSupport;
|
||||
let sd-bus-provider = if systemdSupport then "libsystemd" else "basu"; in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "sway-unwrapped";
|
||||
version = "1.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "swaywm";
|
||||
repo = "sway";
|
||||
rev = version;
|
||||
sha256 = "0ss3l258blyf2d0lwd7pi7ga1fxfj8pxhag058k7cmjhs3y30y5l";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./load-configuration-from-etc.patch
|
||||
|
||||
(substituteAll {
|
||||
src = ./fix-paths.patch;
|
||||
inherit swaybg;
|
||||
})
|
||||
] ++ lib.optionals (!isNixOS) [
|
||||
# References to /nix/store/... will get GC'ed which causes problems when
|
||||
# copying the default configuration:
|
||||
./sway-config-no-nix-store-references.patch
|
||||
] ++ lib.optionals isNixOS [
|
||||
# Use /run/current-system/sw/share and /etc instead of /nix/store
|
||||
# references:
|
||||
./sway-config-nixos-paths.patch
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
depsBuildBuild = [
|
||||
pkg-config
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
meson ninja pkg-config wayland-scanner scdoc
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
wayland libxkbcommon pcre json_c libevdev
|
||||
pango cairo libinput libcap pam gdk-pixbuf librsvg
|
||||
wayland-protocols libdrm
|
||||
(wlroots.override { inherit enableXWayland; })
|
||||
] ++ lib.optionals dbusSupport [
|
||||
dbus
|
||||
];
|
||||
|
||||
mesonFlags =
|
||||
[ "-Dsd-bus-provider=${sd-bus-provider}" ]
|
||||
++ lib.optional (!enableXWayland) "-Dxwayland=disabled"
|
||||
++ lib.optional (!trayEnabled) "-Dtray=disabled"
|
||||
;
|
||||
|
||||
passthru.tests.basic = nixosTests.sway;
|
||||
|
||||
meta = with lib; {
|
||||
description = "An i3-compatible tiling Wayland compositor";
|
||||
longDescription = ''
|
||||
Sway is a tiling Wayland compositor and a drop-in replacement for the i3
|
||||
window manager for X11. It works with your existing i3 configuration and
|
||||
supports most of i3's features, plus a few extras.
|
||||
Sway allows you to arrange your application windows logically, rather
|
||||
than spatially. Windows are arranged into a grid by default which
|
||||
maximizes the efficiency of your screen and can be quickly manipulated
|
||||
using only the keyboard.
|
||||
'';
|
||||
homepage = "https://swaywm.org";
|
||||
changelog = "https://github.com/swaywm/sway/releases/tag/${version}";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ primeos synthetica ma27 ];
|
||||
};
|
||||
}
|
||||
11
pkgs/applications/window-managers/sway/fix-paths.patch
Normal file
11
pkgs/applications/window-managers/sway/fix-paths.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--- a/sway/config.c
|
||||
+++ b/sway/config.c
|
||||
@@ -276,7 +276,7 @@
|
||||
|
||||
if (!(config->active_bar_modifiers = create_list())) goto cleanup;
|
||||
|
||||
- if (!(config->swaybg_command = strdup("swaybg"))) goto cleanup;
|
||||
+ if (!(config->swaybg_command = strdup("@swaybg@/bin/swaybg"))) goto cleanup;
|
||||
|
||||
if (!(config->config_chain = create_list())) goto cleanup;
|
||||
config->current_config_path = NULL;
|
||||
38
pkgs/applications/window-managers/sway/idle.nix
Normal file
38
pkgs/applications/window-managers/sway/idle.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ lib, stdenv, fetchFromGitHub
|
||||
, meson, ninja, pkg-config, scdoc, wayland-scanner
|
||||
, wayland, wayland-protocols
|
||||
, systemdSupport ? stdenv.isLinux, systemd
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "swayidle";
|
||||
version = "1.7.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "swaywm";
|
||||
repo = "swayidle";
|
||||
rev = version;
|
||||
sha256 = "06iq12p4438d6bv3jlqsf01wjaxrzlnj1bnicn41kad563aq41xl";
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-scanner ];
|
||||
buildInputs = [ wayland wayland-protocols ]
|
||||
++ lib.optionals systemdSupport [ systemd ];
|
||||
|
||||
mesonFlags = [ "-Dman-pages=enabled" "-Dlogind=${if systemdSupport then "enabled" else "disabled"}" ];
|
||||
|
||||
postPatch = "substituteInPlace main.c --replace '%lu' '%zu'";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Idle management daemon for Wayland";
|
||||
longDescription = ''
|
||||
Sway's idle management daemon. It is compatible with any Wayland
|
||||
compositor which implements the KDE idle protocol.
|
||||
'';
|
||||
inherit (src.meta) homepage;
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ primeos ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
From 92283df3acbffa5c1bb21f23cdd686113d905114 Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Hilhorst <git@hilhorst.be>
|
||||
Date: Wed, 31 Mar 2021 21:14:13 +0200
|
||||
Subject: [PATCH] Load configs from /etc but fallback to /nix/store
|
||||
|
||||
This change will load all configuration files from /etc, to make it easy
|
||||
to override them, but fallback to /nix/store/.../etc/sway/config to make
|
||||
Sway work out-of-the-box with the default configuration on non NixOS
|
||||
systems.
|
||||
|
||||
Original patch by Michael Weiss, updated for Sway 1.6 by Patrick Hilhorst
|
||||
|
||||
Co-authored-by: Michael Weiss <dev.primeos@gmail.com>
|
||||
---
|
||||
meson.build | 3 ++-
|
||||
sway/config.c | 3 ++-
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index b7a29660..8ae8ceb3 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -164,7 +164,8 @@ if scdoc.found()
|
||||
endforeach
|
||||
endif
|
||||
|
||||
-add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
|
||||
+add_project_arguments('-DSYSCONFDIR="/@0@"'.format(sysconfdir), language : 'c')
|
||||
+add_project_arguments('-DNIX_SYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
|
||||
|
||||
version = '"@0@"'.format(meson.project_version())
|
||||
git = find_program('git', native: true, required: false)
|
||||
diff --git a/sway/config.c b/sway/config.c
|
||||
index 76b9ec08..fb5b51aa 100644
|
||||
--- a/sway/config.c
|
||||
+++ b/sway/config.c
|
||||
@@ -374,7 +374,8 @@ static char *get_config_path(void) {
|
||||
{ .prefix = home, .config_folder = ".i3"},
|
||||
{ .prefix = config_home, .config_folder = "i3"},
|
||||
{ .prefix = SYSCONFDIR, .config_folder = "sway"},
|
||||
- { .prefix = SYSCONFDIR, .config_folder = "i3"}
|
||||
+ { .prefix = SYSCONFDIR, .config_folder = "i3"},
|
||||
+ { .prefix = NIX_SYSCONFDIR, .config_folder = "sway"},
|
||||
};
|
||||
|
||||
size_t num_config_paths = sizeof(config_paths)/sizeof(config_paths[0]);
|
||||
--
|
||||
2.30.1
|
||||
52
pkgs/applications/window-managers/sway/lock-effects.nix
Normal file
52
pkgs/applications/window-managers/sway/lock-effects.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, meson
|
||||
, ninja
|
||||
, pkg-config
|
||||
, scdoc
|
||||
, wayland
|
||||
, wayland-protocols
|
||||
, wayland-scanner
|
||||
, libxkbcommon
|
||||
, cairo
|
||||
, gdk-pixbuf
|
||||
, pam
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "swaylock-effects";
|
||||
version = "unstable-2021-10-21";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mortie";
|
||||
repo = "swaylock-effects";
|
||||
rev = "a8fc557b86e70f2f7a30ca9ff9b3124f89e7f204";
|
||||
sha256 = "sha256-GN+cxzC11Dk1nN9wVWIyv+rCrg4yaHnCePRYS1c4JTk=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
sed -iE "s/version: '1\.3',/version: '${version}',/" meson.build
|
||||
'';
|
||||
|
||||
strictDeps = true;
|
||||
nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-scanner];
|
||||
buildInputs = [ wayland wayland-protocols libxkbcommon cairo gdk-pixbuf pam ];
|
||||
|
||||
mesonFlags = [
|
||||
"-Dpam=enabled"
|
||||
"-Dgdk-pixbuf=enabled"
|
||||
"-Dman-pages=enabled"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Screen locker for Wayland";
|
||||
longDescription = ''
|
||||
Swaylock, with fancy effects
|
||||
'';
|
||||
inherit (src.meta) homepage;
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ gnxlxnxx ma27 ];
|
||||
};
|
||||
}
|
||||
51
pkgs/applications/window-managers/sway/lock-fancy.nix
Normal file
51
pkgs/applications/window-managers/sway/lock-fancy.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{ lib, stdenv, fetchFromGitHub, coreutils, grim, gawk, jq, swaylock
|
||||
, imagemagick, getopt, fontconfig, wmctrl, makeWrapper, bash
|
||||
}:
|
||||
|
||||
let
|
||||
depsPath = lib.makeBinPath [
|
||||
coreutils
|
||||
grim
|
||||
gawk
|
||||
jq
|
||||
swaylock
|
||||
imagemagick
|
||||
getopt
|
||||
fontconfig
|
||||
wmctrl
|
||||
];
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "swaylock-fancy-unstable";
|
||||
version = "2021-10-11";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Big-B";
|
||||
repo = "swaylock-fancy";
|
||||
rev = "265fbfb438392339bf676b0a9dbe294abe2a699e";
|
||||
sha256 = "NjxeJyWYXBb1P8sXKgb2EWjF+cNodTE83r1YwRYoBjM=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace swaylock-fancy \
|
||||
--replace "/usr/share" "$out/share"
|
||||
'';
|
||||
|
||||
strictDeps = true;
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ bash ];
|
||||
|
||||
makeFlags = [ "PREFIX=${placeholder "out"}" ];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/swaylock-fancy \
|
||||
--prefix PATH : "${depsPath}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "This is an swaylock bash script that takes a screenshot of the desktop, blurs the background and adds a lock icon and text";
|
||||
homepage = "https://github.com/Big-B/swaylock-fancy";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ ma27 ];
|
||||
};
|
||||
}
|
||||
47
pkgs/applications/window-managers/sway/lock.nix
Normal file
47
pkgs/applications/window-managers/sway/lock.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{ lib, stdenv, fetchFromGitHub, fetchpatch
|
||||
, meson, ninja, pkg-config, scdoc, wayland-scanner
|
||||
, wayland, wayland-protocols, libxkbcommon, cairo, gdk-pixbuf, pam
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "swaylock";
|
||||
version = "1.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "swaywm";
|
||||
repo = "swaylock";
|
||||
rev = version;
|
||||
sha256 = "sha256-VVGgidmSQWKxZNx9Cd6z52apxpxVfmX3Ut/G9kzfDcY=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# remove once when updating to 1.7
|
||||
# https://github.com/swaywm/swaylock/pull/235
|
||||
(fetchpatch {
|
||||
url = "https://github.com/swaywm/swaylock/commit/5a1e6ad79aa7d79b32d36cda39400f3e889b8f8f.diff";
|
||||
sha256 = "sha256-ZcZVImUzvng7sluC6q2B5UL8sVunLe4PIfc+tyw48RQ=";
|
||||
})
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
depsBuildBuild = [ pkg-config ];
|
||||
nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-scanner ];
|
||||
buildInputs = [ wayland wayland-protocols libxkbcommon cairo gdk-pixbuf pam ];
|
||||
|
||||
mesonFlags = [
|
||||
"-Dpam=enabled" "-Dgdk-pixbuf=enabled" "-Dman-pages=enabled"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Screen locker for Wayland";
|
||||
longDescription = ''
|
||||
swaylock is a screen locking utility for Wayland compositors.
|
||||
Important note: If you don't use the Sway module (programs.sway.enable)
|
||||
you need to set "security.pam.services.swaylock = {};" manually.
|
||||
'';
|
||||
inherit (src.meta) homepage;
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ primeos ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
diff --git a/config.in b/config.in
|
||||
index 08703bef..f3872730 100644
|
||||
--- a/config.in
|
||||
+++ b/config.in
|
||||
@@ -22,8 +22,8 @@ set $menu dmenu_path | dmenu | xargs swaymsg exec --
|
||||
|
||||
### Output configuration
|
||||
#
|
||||
-# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/)
|
||||
-output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
|
||||
+# Default wallpaper (more resolutions are available in /run/current-system/sw/share/backgrounds/sway/)
|
||||
+output * bg /run/current-system/sw/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
|
||||
#
|
||||
# Example configuration:
|
||||
#
|
||||
@@ -214,4 +214,4 @@ bar {
|
||||
}
|
||||
}
|
||||
|
||||
-include @sysconfdir@/sway/config.d/*
|
||||
+include /etc/sway/config.d/*
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
diff --git a/config.in b/config.in
|
||||
--- a/config.in
|
||||
+++ b/config.in
|
||||
@@ -21,8 +21,8 @@ set $menu dmenu_path | dmenu | xargs swaymsg exec
|
||||
|
||||
### Output configuration
|
||||
#
|
||||
-# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/)
|
||||
-output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
|
||||
+# Default wallpaper
|
||||
+#output * bg ~/.config/sway/backgrounds/Sway_Wallpaper_Blue_1920x1080.png fill
|
||||
#
|
||||
# Example configuration:
|
||||
#
|
||||
@@ -213,5 +213,3 @@ bar {
|
||||
inactive_workspace #32323200 #32323200 #5c5c5c
|
||||
}
|
||||
}
|
||||
-
|
||||
-include @sysconfdir@/sway/config.d/*
|
||||
|
||||
63
pkgs/applications/window-managers/sway/wrapper.nix
Normal file
63
pkgs/applications/window-managers/sway/wrapper.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{ lib
|
||||
, sway-unwrapped
|
||||
, makeWrapper, symlinkJoin, writeShellScriptBin
|
||||
, withBaseWrapper ? true, extraSessionCommands ? "", dbus
|
||||
, withGtkWrapper ? false, wrapGAppsHook, gdk-pixbuf, glib, gtk3
|
||||
, extraOptions ? [] # E.g.: [ "--verbose" ]
|
||||
# Used by the NixOS module:
|
||||
, isNixOS ? false
|
||||
|
||||
, enableXWayland ? true
|
||||
, dbusSupport ? true
|
||||
}:
|
||||
|
||||
assert extraSessionCommands != "" -> withBaseWrapper;
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
sway = sway-unwrapped.override { inherit isNixOS enableXWayland; };
|
||||
baseWrapper = writeShellScriptBin "sway" ''
|
||||
set -o errexit
|
||||
if [ ! "$_SWAY_WRAPPER_ALREADY_EXECUTED" ]; then
|
||||
export XDG_CURRENT_DESKTOP=sway
|
||||
${extraSessionCommands}
|
||||
export _SWAY_WRAPPER_ALREADY_EXECUTED=1
|
||||
fi
|
||||
if [ "$DBUS_SESSION_BUS_ADDRESS" ]; then
|
||||
export DBUS_SESSION_BUS_ADDRESS
|
||||
exec ${sway}/bin/sway "$@"
|
||||
else
|
||||
exec ${if !dbusSupport then "" else "${dbus}/bin/dbus-run-session"} ${sway}/bin/sway "$@"
|
||||
fi
|
||||
'';
|
||||
in symlinkJoin {
|
||||
name = "sway-${sway.version}";
|
||||
|
||||
paths = (optional withBaseWrapper baseWrapper)
|
||||
++ [ sway ];
|
||||
|
||||
strictDeps = false;
|
||||
nativeBuildInputs = [ makeWrapper ]
|
||||
++ (optional withGtkWrapper wrapGAppsHook);
|
||||
|
||||
buildInputs = optionals withGtkWrapper [ gdk-pixbuf glib gtk3 ];
|
||||
|
||||
# We want to run wrapProgram manually
|
||||
dontWrapGApps = true;
|
||||
|
||||
postBuild = ''
|
||||
${optionalString withGtkWrapper "gappsWrapperArgsHook"}
|
||||
|
||||
wrapProgram $out/bin/sway \
|
||||
${optionalString withGtkWrapper ''"''${gappsWrapperArgs[@]}"''} \
|
||||
${optionalString (extraOptions != []) "${concatMapStrings (x: " --add-flags " + x) extraOptions}"}
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit (sway.passthru) tests;
|
||||
providedSessions = [ "sway" ];
|
||||
};
|
||||
|
||||
inherit (sway) meta;
|
||||
}
|
||||
33
pkgs/applications/window-managers/sway/wsr.nix
Normal file
33
pkgs/applications/window-managers/sway/wsr.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ lib, fetchFromGitHub, rustPlatform, libxcb, python3 }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "swaywsr";
|
||||
version = "1.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pedroscaff";
|
||||
repo = pname;
|
||||
rev = "6c4671c702f647395d983aaf607286db1c692db6";
|
||||
sha256 = "0bmpbhyvgnbi5baj6v0wdxpdh9cnlzvcc44vh3vihmzsp6i5q05a";
|
||||
};
|
||||
|
||||
cargoSha256 = "1pmkyw60ggn5filb47nyf97g1arrw7nfa4yjndnx35zw12mkj61d";
|
||||
|
||||
nativeBuildInputs = [ python3 ];
|
||||
buildInputs = [ libxcb ];
|
||||
|
||||
# has not tests
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Automatically change sway workspace names based on their contents";
|
||||
longDescription = ''
|
||||
Automatically sets the workspace names to match the windows on the workspace.
|
||||
The chosen name for a workspace is a composite of the app_id or WM_CLASS X11
|
||||
window property for each window in a workspace.
|
||||
'';
|
||||
homepage = "https://github.com/pedroscaff/swaywsr";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.sebbadk ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue