Skip to content
Snippets Groups Projects
Commit 98a329d7 authored by Jens Nolte's avatar Jens Nolte
Browse files

Move sway to desktop layer.

This also fixes dependencies for qbar blocks and installs the sway
config and the start script via the 'desktop' dotfiles-profile.
parent a80a5aaf
No related branches found
No related tags found
No related merge requests found
File moved
# start sway when logging in on tty1
if [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ] && [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
exec sway --config ${swayConfig} &> /run/user/$UID/sway_log
fi
\ No newline at end of file
{ pkgs, ... }:
let
swaylockWithIdle = pkgs.writeScriptBin "swaylock-with-idle" ''
#!/usr/bin/env zsh
trap 'swaymsg "output * dpms on"' EXIT INT HUP TERM
swayidle -w \
timeout 10 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
&
swaylock $@
kill %1
'';
blockPath = ../../desktop/blocks;
in
{
imports = [
./base.nix
];
environment.systemPackages = with pkgs; [
# desktop programs
glxinfo
gnome3.gnome-disk-utility
vscode
# soft desktop dependencies
swaylockWithIdle
zsh
mako
rofi
qt5.qtwayland
acpilight
# qbar block dependencies
python3
acpi
perl
sysstat
zsh
bash
wirelesstools
lm_sensors
jq
];
fonts.fonts = [ pkgs.fira-code ];
programs.sway_on_tty1.enable = true;
sound.enable = true;
hardware.pulseaudio.enable = true;
users = {
users.jens = {
packages = with pkgs; [
......@@ -35,4 +72,22 @@
dotfiles.profiles = [ "kitty" "vscode" "desktop" ];
};
};
programs.sway.enable = true;
programs.sway.extraPackages = with pkgs; [ swaylock swayidle xwayland kitty cool-retro-term ];
# QT_QPA_PLATFORM=wayland requires qt5.qtwayland in systemPackages
programs.sway.extraSessionCommands = ''
export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
'';
environment.loginShellInit = ''
# start sway when logging in on tty1
if [ "$USER" = jens ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ] && [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
exec sway &> /run/user/$UID/sway_log
fi
'';
}
......@@ -2,7 +2,6 @@
{
imports = [
./sway.nix
#./loginctl-linger.nix
./dotfiles.nix
];
......
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.sway_on_tty1;
swayConfig = ./../../sway/sway-config;
swaylockWithIdle = pkgs.writeScriptBin "swaylock-with-idle" ''
#!/usr/bin/env zsh
trap 'swaymsg "output * dpms on"' EXIT INT HUP TERM
swayidle -w \
timeout 10 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
&
swaylock $@
kill %1
'';
in
{
options.programs.sway_on_tty1 = {
enable = mkEnableOption "Start sway with system config when logging in on tty1";
};
config = mkIf cfg.enable {
programs.sway.enable = true;
programs.sway.extraPackages = with pkgs; [ swaylock swayidle xwayland kitty cool-retro-term ];
# QT_QPA_PLATFORM=wayland requires qt5.qtwayland in systemPackages
programs.sway.extraSessionCommands = ''
export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
'';
environment.loginShellInit = ''
# start sway when logging in on tty1
if [ "$USER" = jens ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ] && [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
exec sway --config ${swayConfig} &> /run/user/$UID/sway_log
fi
'';
environment.systemPackages = with pkgs; [ qbar swaylockWithIdle zsh mako rofi qt5.qtwayland ];
};
}
......@@ -7,7 +7,6 @@ let
# Import packages defined here
# e.g.:
#mypkg = haskell.packages.ghc865.callPackage ./mypkg { };
qbar = haskellPackages.callPackage ./qbar { };
dotnet-sdk = self.callPackage ./dotnet-sdk { };
};
......
{ mkDerivation, aeson, async, attoparsec, base, bytestring, colour
, concurrent-extra, directory, fetchgit, filepath, hpack, mtl
, network, optparse-applicative, pipes, pipes-aeson
, pipes-concurrency, pipes-network, pipes-parse, stdenv, stm, text
, time, typed-process, unix, unordered-containers
}:
mkDerivation {
pname = "qbar";
version = "0.1.0.0";
src = fetchgit {
url = "https://git.c3pb.de/jens/qbar";
sha256 = "1bf4ff522fp7rhhw3rnz6mc2iy9yf8dgbj3705wfdnbviaxcixaa";
rev = "ccc975c4bbac56e212d6dddc070ee345d0c14000";
fetchSubmodules = true;
};
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson async attoparsec base bytestring colour concurrent-extra
directory filepath mtl network optparse-applicative pipes
pipes-aeson pipes-concurrency pipes-network pipes-parse stm text
time typed-process unix unordered-containers
];
libraryToolDepends = [ hpack ];
executableHaskellDepends = [
aeson async attoparsec base bytestring colour concurrent-extra
directory filepath mtl network optparse-applicative pipes
pipes-aeson pipes-concurrency pipes-network pipes-parse stm text
time typed-process unix unordered-containers
];
testHaskellDepends = [
aeson async attoparsec base bytestring colour concurrent-extra
directory filepath mtl network optparse-applicative pipes
pipes-aeson pipes-concurrency pipes-network pipes-parse stm text
time typed-process unix unordered-containers
];
prePatch = "hpack";
license = stdenv.lib.licenses.bsd3;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment