Massive nixfmt reformatting
This commit is contained in:
parent
fe4492f004
commit
b29ddd5e65
109 changed files with 4323 additions and 2368 deletions
|
@ -1,24 +1,34 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
kwallet = { pkgs, lib, ... }: {
|
||||
home.packages = with pkgs; [ kdePackages.kwallet kdePackages.ksshaskpass ];
|
||||
home.sessionVariables = {
|
||||
# https://wiki.archlinux.org/title/KDE_Wallet#Using_the_KDE_Wallet_to_store_ssh_key_passphrases
|
||||
SSH_ASKPASS = lib.getExe pkgs.kdePackages.ksshaskpass;
|
||||
SSH_ASKPASS_REQUIRE = "prefer";
|
||||
kwallet =
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
kdePackages.kwallet
|
||||
kdePackages.ksshaskpass
|
||||
];
|
||||
home.sessionVariables = {
|
||||
# https://wiki.archlinux.org/title/KDE_Wallet#Using_the_KDE_Wallet_to_store_ssh_key_passphrases
|
||||
SSH_ASKPASS = lib.getExe pkgs.kdePackages.ksshaskpass;
|
||||
SSH_ASKPASS_REQUIRE = "prefer";
|
||||
};
|
||||
# Enable this for sway
|
||||
wayland.windowManager.sway.config.startup = [
|
||||
{ command = "${pkgs.kdePackages.kwallet-pam}/libexec/pam_kwallet_init"; }
|
||||
];
|
||||
# Automatic dbus activation
|
||||
xdg.dataFile."dbus-1/services/org.freedesktop.secrets.service".text = ''
|
||||
[D-BUS Service]
|
||||
Name=org.freedesktop.secrets
|
||||
Exec=${pkgs.kdePackages.kwallet}/bin/kwalletd6
|
||||
'';
|
||||
};
|
||||
# Enable this for sway
|
||||
wayland.windowManager.sway.config.startup = [
|
||||
{ command = "${pkgs.kdePackages.kwallet-pam}/libexec/pam_kwallet_init"; }
|
||||
];
|
||||
# Automatic dbus activation
|
||||
xdg.dataFile."dbus-1/services/org.freedesktop.secrets.service".text = ''
|
||||
[D-BUS Service]
|
||||
Name=org.freedesktop.secrets
|
||||
Exec=${pkgs.kdePackages.kwallet}/bin/kwalletd6
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
|
@ -27,33 +37,34 @@ in
|
|||
./modules/X11/xfce4-notifyd.nix
|
||||
kwallet
|
||||
];
|
||||
config = (mkIf pkgs.stdenv.isLinux {
|
||||
home.packages = with pkgs; [
|
||||
psmisc # killall and friends
|
||||
file # Query file type
|
||||
zip
|
||||
python3
|
||||
config = (
|
||||
mkIf pkgs.stdenv.isLinux {
|
||||
home.packages = with pkgs; [
|
||||
psmisc # killall and friends
|
||||
file # Query file type
|
||||
zip
|
||||
python3
|
||||
|
||||
pinentry-gnome3 # until pinentry-qt introduces caching
|
||||
];
|
||||
pinentry-gnome3 # until pinentry-qt introduces caching
|
||||
];
|
||||
|
||||
systemd.user.startServices = "sd-switch";
|
||||
systemd.user.startServices = "sd-switch";
|
||||
|
||||
# Audio stuff!
|
||||
# services.easyeffects.enable = true;
|
||||
# Audio stuff!
|
||||
# services.easyeffects.enable = true;
|
||||
|
||||
# Bluetooth controls
|
||||
# services.mpris-proxy.enable = true;
|
||||
# Bluetooth controls
|
||||
# services.mpris-proxy.enable = true;
|
||||
|
||||
# Owncloud
|
||||
services.owncloud-client.enable = true;
|
||||
services.owncloud-client.package = pkgs.owncloud-client.overrideAttrs (attrs: {
|
||||
buildInputs = attrs.buildInputs ++ [ pkgs.qt6.qtwayland ];
|
||||
});
|
||||
systemd.user.services.owncloud-client.Unit.After = [ "graphical-session.target" ];
|
||||
# Owncloud
|
||||
services.owncloud-client.enable = true;
|
||||
services.owncloud-client.package = pkgs.owncloud-client.overrideAttrs (attrs: {
|
||||
buildInputs = attrs.buildInputs ++ [ pkgs.qt6.qtwayland ];
|
||||
});
|
||||
systemd.user.services.owncloud-client.Unit.After = [ "graphical-session.target" ];
|
||||
|
||||
# UDisks automounter
|
||||
services.udiskie.enable = true;
|
||||
});
|
||||
# UDisks automounter
|
||||
services.udiskie.enable = true;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
@ -52,7 +57,6 @@
|
|||
$pdf_previewer = '${lib.getExe' pkgs.xdg-utils "xdg-open"}';
|
||||
'';
|
||||
|
||||
|
||||
home.sessionVariables = {
|
||||
# Bat theme
|
||||
BAT_THEME = "GitHub";
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
{ config, options, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
options,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
|
@ -157,7 +163,6 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
|
||||
tide = {
|
||||
enable = true;
|
||||
leftItems = options.programs.fish.tide.leftItems.default;
|
||||
|
@ -172,10 +177,7 @@ in
|
|||
};
|
||||
|
||||
everywhereAbbrs = {
|
||||
lsports =
|
||||
if pkgs.stdenv.isDarwin
|
||||
then "lsof -i -P | grep LISTEN"
|
||||
else "ss -tulp";
|
||||
lsports = if pkgs.stdenv.isDarwin then "lsof -i -P | grep LISTEN" else "ss -tulp";
|
||||
};
|
||||
|
||||
shellInit = ''
|
||||
|
@ -234,11 +236,11 @@ in
|
|||
bind -M default gl end-of-line
|
||||
|
||||
# Everywhere abbrs
|
||||
${
|
||||
concatStringsSep "\n"
|
||||
(mapAttrsToList (k: v: "abbr --add --position anywhere -- ${k} ${escapeShellArg v}")
|
||||
config.programs.fish.everywhereAbbrs)
|
||||
}
|
||||
${concatStringsSep "\n" (
|
||||
mapAttrsToList (
|
||||
k: v: "abbr --add --position anywhere -- ${k} ${escapeShellArg v}"
|
||||
) config.programs.fish.everywhereAbbrs
|
||||
)}
|
||||
|
||||
# Replace today with actual today
|
||||
abbr --add --position anywhere today -f echo-today
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
|
@ -42,25 +47,38 @@ in
|
|||
leftItems = mkOption {
|
||||
type = types.listOf types.str;
|
||||
description = "The list of left-items. Note that `newline` and `character` is not included here and will always appear last";
|
||||
default = [ "os" "context" "pwd" "git" ];
|
||||
default = [
|
||||
"os"
|
||||
"context"
|
||||
"pwd"
|
||||
"git"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
config.programs.fish =
|
||||
let
|
||||
tideItems = attrsets.mapAttrs' (name: def: { name = "_tide_item_${name}"; value = def; });
|
||||
tideItems = attrsets.mapAttrs' (
|
||||
name: def: {
|
||||
name = "_tide_item_${name}";
|
||||
value = def;
|
||||
}
|
||||
);
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
functions = tideItems ({
|
||||
nix_shell = ''
|
||||
# In a Nix Shell
|
||||
if set -qx DIRENV_FILE && test -f $DIRENV_FILE && rg -q "^use flake" $DIRENV_FILE
|
||||
set -U tide_nix_shell_color "FFA500"
|
||||
set -U tide_nix_shell_bg_color normal
|
||||
_tide_print_item nix_shell "❄"
|
||||
end
|
||||
'';
|
||||
} // cfg.items);
|
||||
functions = tideItems (
|
||||
{
|
||||
nix_shell = ''
|
||||
# In a Nix Shell
|
||||
if set -qx DIRENV_FILE && test -f $DIRENV_FILE && rg -q "^use flake" $DIRENV_FILE
|
||||
set -U tide_nix_shell_color "FFA500"
|
||||
set -U tide_nix_shell_bg_color normal
|
||||
_tide_print_item nix_shell "❄"
|
||||
end
|
||||
'';
|
||||
}
|
||||
// cfg.items
|
||||
);
|
||||
plugins = [
|
||||
{
|
||||
name = "tide";
|
||||
|
@ -78,7 +96,9 @@ in
|
|||
config.xdg.configFile."fish/tide/init.fish" = {
|
||||
text = ''
|
||||
# Configure tide items
|
||||
set -U tide_left_prompt_items ${concatMapStringsSep " " escapeShellArg cfg.leftItems} newline character
|
||||
set -U tide_left_prompt_items ${
|
||||
concatMapStringsSep " " escapeShellArg cfg.leftItems
|
||||
} newline character
|
||||
set -U tide_right_prompt_items ${concatMapStringsSep " " escapeShellArg cfg.rightItems} time
|
||||
'';
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
@ -14,19 +19,22 @@
|
|||
home.homeDirectory = "/home/nki";
|
||||
|
||||
# More packages
|
||||
home.packages = (with pkgs; [
|
||||
# Gaming stuff
|
||||
wineWowPackages.full
|
||||
# wine-lol
|
||||
winetricks
|
||||
lutris
|
||||
steam
|
||||
home.packages = (
|
||||
with pkgs;
|
||||
[
|
||||
# Gaming stuff
|
||||
wineWowPackages.full
|
||||
# wine-lol
|
||||
winetricks
|
||||
lutris
|
||||
steam
|
||||
|
||||
# Manage tlmc
|
||||
flacon
|
||||
ttaenc
|
||||
picard
|
||||
]);
|
||||
# Manage tlmc
|
||||
flacon
|
||||
ttaenc
|
||||
picard
|
||||
]
|
||||
);
|
||||
|
||||
# Enable X11 configuration
|
||||
linux.graphical.type = "wayland";
|
||||
|
@ -46,12 +54,24 @@
|
|||
# 144hz adaptive refresh ON!
|
||||
nki.programs.kitty.enable = true;
|
||||
nki.programs.kitty.fontSize = 14;
|
||||
programs.my-waybar.makeBars = with config.common.monitors; barWith: [
|
||||
# For primary
|
||||
(barWith { extraSettings = { output = [ home_4k.meta.connection ]; }; })
|
||||
# For secondary, hide mpd
|
||||
(barWith { showMedia = false; showConnectivity = false; extraSettings = { output = [ home_1440.meta.connection ]; }; })
|
||||
];
|
||||
programs.my-waybar.makeBars =
|
||||
with config.common.monitors;
|
||||
barWith: [
|
||||
# For primary
|
||||
(barWith {
|
||||
extraSettings = {
|
||||
output = [ home_4k.meta.connection ];
|
||||
};
|
||||
})
|
||||
# For secondary, hide mpd
|
||||
(barWith {
|
||||
showMedia = false;
|
||||
showConnectivity = false;
|
||||
extraSettings = {
|
||||
output = [ home_1440.meta.connection ];
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
# Yellow light!
|
||||
services.wlsunset = {
|
||||
|
@ -72,10 +92,28 @@
|
|||
# ncmpcpp
|
||||
programs.ncmpcpp.enable = true;
|
||||
programs.ncmpcpp.bindings = [
|
||||
{ key = "j"; command = "scroll_down"; }
|
||||
{ key = "k"; command = "scroll_up"; }
|
||||
{ key = "J"; command = [ "select_item" "scroll_down" ]; }
|
||||
{ key = "K"; command = [ "select_item" "scroll_up" ]; }
|
||||
{
|
||||
key = "j";
|
||||
command = "scroll_down";
|
||||
}
|
||||
{
|
||||
key = "k";
|
||||
command = "scroll_up";
|
||||
}
|
||||
{
|
||||
key = "J";
|
||||
command = [
|
||||
"select_item"
|
||||
"scroll_down"
|
||||
];
|
||||
}
|
||||
{
|
||||
key = "K";
|
||||
command = [
|
||||
"select_item"
|
||||
"scroll_up"
|
||||
];
|
||||
}
|
||||
];
|
||||
programs.ncmpcpp.settings = {
|
||||
# General
|
||||
|
@ -133,4 +171,3 @@
|
|||
# changes in each release.
|
||||
home.stateVersion = "21.05";
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,15 @@ in
|
|||
in
|
||||
{
|
||||
grammar.src = src;
|
||||
grammar.compile.args = [ "-c" "-fpic" "../parser.c" "../scanner.c" "../unicode.h" "-I" ".." ];
|
||||
grammar.compile.args = [
|
||||
"-c"
|
||||
"-fpic"
|
||||
"../parser.c"
|
||||
"../scanner.c"
|
||||
"../unicode.h"
|
||||
"-I"
|
||||
".."
|
||||
];
|
||||
queries.src = src;
|
||||
queries.path = "queries";
|
||||
};
|
||||
|
@ -79,9 +87,24 @@ in
|
|||
rev = "0e36bed171768908f331ff7dff9d956bae016efb";
|
||||
hash = "sha256-bpiT3FraOZhJaoiFWAoVJX1O+plnIi8aXOW2LwyU23M=";
|
||||
};
|
||||
grammar.compile.args = [ "-c" "-fpic" "../scanner.cc" "../parser.c" "-I" ".." ];
|
||||
grammar.link.args = [ "-shared" "-fpic" "scanner.o" "parser.o" ];
|
||||
grammar.link.flags = [ "-O3" "-lstdc++" ];
|
||||
grammar.compile.args = [
|
||||
"-c"
|
||||
"-fpic"
|
||||
"../scanner.cc"
|
||||
"../parser.c"
|
||||
"-I"
|
||||
".."
|
||||
];
|
||||
grammar.link.args = [
|
||||
"-shared"
|
||||
"-fpic"
|
||||
"scanner.o"
|
||||
"parser.o"
|
||||
];
|
||||
grammar.link.flags = [
|
||||
"-O3"
|
||||
"-lstdc++"
|
||||
];
|
||||
|
||||
queries.src = pkgs.fetchFromGitHub {
|
||||
owner = "helix-editor";
|
||||
|
@ -115,8 +138,18 @@ in
|
|||
|
||||
go = {
|
||||
grammar.src = tree-sitter-go;
|
||||
grammar.compile.args = [ "-c" "-fpic" "../parser.c" "-I" ".." ];
|
||||
grammar.link.args = [ "-shared" "-fpic" "parser.o" ];
|
||||
grammar.compile.args = [
|
||||
"-c"
|
||||
"-fpic"
|
||||
"../parser.c"
|
||||
"-I"
|
||||
".."
|
||||
];
|
||||
grammar.link.args = [
|
||||
"-shared"
|
||||
"-fpic"
|
||||
"parser.o"
|
||||
];
|
||||
queries.src = tree-sitter-go;
|
||||
queries.path = "queries";
|
||||
};
|
||||
|
@ -132,11 +165,20 @@ in
|
|||
in
|
||||
{
|
||||
grammar.src = src;
|
||||
grammar.compile.args = [ "-c" "-fpic" "../parser.c" "-I" ".." ];
|
||||
grammar.link.args = [ "-shared" "-fpic" "parser.o" ];
|
||||
grammar.compile.args = [
|
||||
"-c"
|
||||
"-fpic"
|
||||
"../parser.c"
|
||||
"-I"
|
||||
".."
|
||||
];
|
||||
grammar.link.args = [
|
||||
"-shared"
|
||||
"-fpic"
|
||||
"parser.o"
|
||||
];
|
||||
queries.src = src;
|
||||
queries.path = "queries";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ./common.nix ];
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
discord = pkgs.armcord.override { nss = pkgs.nss_latest; };
|
||||
|
@ -30,15 +35,18 @@ in
|
|||
'';
|
||||
|
||||
# More packages
|
||||
home.packages = (with pkgs; [
|
||||
mate.mate-terminal
|
||||
home.packages = (
|
||||
with pkgs;
|
||||
[
|
||||
mate.mate-terminal
|
||||
|
||||
firefox-wayland
|
||||
firefox-wayland
|
||||
|
||||
discord
|
||||
discord
|
||||
|
||||
typora
|
||||
]);
|
||||
typora
|
||||
]
|
||||
);
|
||||
|
||||
# Graphical set up
|
||||
linux.graphical.type = "wayland";
|
||||
|
@ -125,4 +133,3 @@ in
|
|||
# changes in each release.
|
||||
home.stateVersion = "21.05";
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
|
@ -28,7 +33,10 @@ in
|
|||
};
|
||||
shell = {
|
||||
program = "/bin/sh";
|
||||
args = [ "-ic" "${config.programs.fish.package}/bin/fish" ];
|
||||
args = [
|
||||
"-ic"
|
||||
"${config.programs.fish.package}/bin/fish"
|
||||
];
|
||||
};
|
||||
colors = {
|
||||
# Default colors
|
||||
|
@ -57,7 +65,11 @@ in
|
|||
};
|
||||
|
||||
key_bindings = [
|
||||
{ key = "C"; mods = "Alt|Control"; action = "SpawnNewInstance"; }
|
||||
{
|
||||
key = "C";
|
||||
mods = "Alt|Control";
|
||||
action = "SpawnNewInstance";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.linux.graphical;
|
||||
|
@ -17,34 +22,56 @@ let
|
|||
end
|
||||
'';
|
||||
|
||||
mkPackageWithDesktopOption = opts: mkOption ({
|
||||
type = types.submodule {
|
||||
options = {
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
description = "The package for " + description;
|
||||
mkPackageWithDesktopOption =
|
||||
opts:
|
||||
mkOption (
|
||||
{
|
||||
type = types.submodule {
|
||||
options = {
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
description = "The package for " + description;
|
||||
};
|
||||
desktopFile = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "The desktop file name for " + description + ", defaults to [packagename].desktop";
|
||||
};
|
||||
};
|
||||
};
|
||||
desktopFile = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "The desktop file name for " + description + ", defaults to [packagename].desktop";
|
||||
};
|
||||
};
|
||||
};
|
||||
} // opts);
|
||||
}
|
||||
// opts
|
||||
);
|
||||
|
||||
desktopFileOf = cfg: if cfg.desktopFile == null then "${cfg.package}/share/applications/${cfg.package.pname}.desktop" else cfg.desktopFile;
|
||||
desktopFileOf =
|
||||
cfg:
|
||||
if cfg.desktopFile == null then
|
||||
"${cfg.package}/share/applications/${cfg.package.pname}.desktop"
|
||||
else
|
||||
cfg.desktopFile;
|
||||
in
|
||||
{
|
||||
imports = [ ./x11.nix ./wayland.nix ./alacritty.nix ];
|
||||
imports = [
|
||||
./x11.nix
|
||||
./wayland.nix
|
||||
./alacritty.nix
|
||||
];
|
||||
options.linux.graphical = {
|
||||
type = mkOption {
|
||||
type = types.nullOr (types.enum [ "x11" "wayland" ]);
|
||||
type = types.nullOr (
|
||||
types.enum [
|
||||
"x11"
|
||||
"wayland"
|
||||
]
|
||||
);
|
||||
description = "Enable linux graphical configurations, with either 'x11' or 'wayland'";
|
||||
default = null;
|
||||
};
|
||||
wallpaper = mkOption {
|
||||
type = types.oneOf [ types.str types.path ];
|
||||
type = types.oneOf [
|
||||
types.str
|
||||
types.path
|
||||
];
|
||||
description = "Path to the wallpaper file";
|
||||
default = "";
|
||||
};
|
||||
|
@ -59,52 +86,61 @@ in
|
|||
};
|
||||
defaults = {
|
||||
webBrowser = mkPackageWithDesktopOption { description = "default web browser"; };
|
||||
terminal = mkPackageWithDesktopOption { description = "default terminal"; default.package = pkgs.kitty; };
|
||||
discord = mkPackageWithDesktopOption { description = "Discord client"; default.package = pkgs.vesktop; };
|
||||
terminal = mkPackageWithDesktopOption {
|
||||
description = "default terminal";
|
||||
default.package = pkgs.kitty;
|
||||
};
|
||||
discord = mkPackageWithDesktopOption {
|
||||
description = "Discord client";
|
||||
default.package = pkgs.vesktop;
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkIf (cfg.type != null) {
|
||||
# Packages
|
||||
|
||||
home.packages = (with pkgs; [
|
||||
cfg.defaults.webBrowser.package
|
||||
cfg.defaults.terminal.package
|
||||
home.packages = (
|
||||
with pkgs;
|
||||
[
|
||||
cfg.defaults.webBrowser.package
|
||||
cfg.defaults.terminal.package
|
||||
|
||||
## GUI stuff
|
||||
evince # PDF reader
|
||||
gparted
|
||||
vscode
|
||||
feh # For images?
|
||||
deluge # Torrent client
|
||||
pavucontrol # PulseAudio control panel
|
||||
sublime-music # For navidrome
|
||||
# cinny-desktop
|
||||
gajim
|
||||
vivaldi
|
||||
# Audio
|
||||
qpwgraph # Pipewire graph
|
||||
audacity
|
||||
vlc
|
||||
## GUI stuff
|
||||
evince # PDF reader
|
||||
gparted
|
||||
vscode
|
||||
feh # For images?
|
||||
deluge # Torrent client
|
||||
pavucontrol # PulseAudio control panel
|
||||
sublime-music # For navidrome
|
||||
# cinny-desktop
|
||||
gajim
|
||||
vivaldi
|
||||
# Audio
|
||||
qpwgraph # Pipewire graph
|
||||
audacity
|
||||
vlc
|
||||
|
||||
unstable.zotero
|
||||
libreoffice
|
||||
unstable.zotero
|
||||
libreoffice
|
||||
|
||||
mpv # for anki
|
||||
anki-bin
|
||||
mpv # for anki
|
||||
anki-bin
|
||||
|
||||
# Chat stuff
|
||||
tdesktop
|
||||
whatsapp-for-linux
|
||||
slack
|
||||
zoom-us
|
||||
# Chat stuff
|
||||
tdesktop
|
||||
whatsapp-for-linux
|
||||
slack
|
||||
zoom-us
|
||||
|
||||
|
||||
## CLI stuff
|
||||
dex # .desktop file management, startup
|
||||
# sct # Display color temperature
|
||||
xdg-utils # Open stuff
|
||||
wifi-indicator
|
||||
] ++ cfg.startup);
|
||||
## CLI stuff
|
||||
dex # .desktop file management, startup
|
||||
# sct # Display color temperature
|
||||
xdg-utils # Open stuff
|
||||
wifi-indicator
|
||||
]
|
||||
++ cfg.startup
|
||||
);
|
||||
|
||||
# OBS
|
||||
programs.obs-studio = {
|
||||
|
@ -129,7 +165,10 @@ in
|
|||
xdg.mimeApps.enable = true;
|
||||
|
||||
xdg.mimeApps.associations.added = {
|
||||
"x-scheme-handler/mailto" = [ "thunderbird.desktop" "org.gnome.Evolution.desktop" ];
|
||||
"x-scheme-handler/mailto" = [
|
||||
"thunderbird.desktop"
|
||||
"org.gnome.Evolution.desktop"
|
||||
];
|
||||
"application/pdf" = [ "org.gnome.Evince.desktop" ];
|
||||
"text/plain" = [ "kakoune.desktop" ];
|
||||
|
||||
|
@ -154,7 +193,10 @@ in
|
|||
};
|
||||
xdg.mimeApps.defaultApplications = {
|
||||
# Email
|
||||
"x-scheme-handler/mailto" = [ "thunderbird.desktop" "org.gnome.Evolution.desktop" ];
|
||||
"x-scheme-handler/mailto" = [
|
||||
"thunderbird.desktop"
|
||||
"org.gnome.Evolution.desktop"
|
||||
];
|
||||
"x-scheme-handler/webcal" = [ "thunderbird.desktop" ];
|
||||
"x-scheme-handler/webcals" = [ "thunderbird.desktop" ];
|
||||
|
||||
|
@ -246,7 +288,10 @@ in
|
|||
## Qt
|
||||
qt.enable = true;
|
||||
qt.platformTheme.name = "kde";
|
||||
qt.platformTheme.package = with pkgs.kdePackages; [ plasma-integration systemsettings ];
|
||||
qt.platformTheme.package = with pkgs.kdePackages; [
|
||||
plasma-integration
|
||||
systemsettings
|
||||
];
|
||||
qt.style.package = [ pkgs.kdePackages.breeze ];
|
||||
qt.style.name = "Breeze";
|
||||
|
||||
|
@ -267,7 +312,8 @@ in
|
|||
};
|
||||
autoStartup = listToAttrs (map f cfg.startup);
|
||||
in
|
||||
autoStartup // {
|
||||
autoStartup
|
||||
// {
|
||||
## Polkit UI
|
||||
"autostart/polkit.desktop".text = ''
|
||||
${builtins.readFile "${pkgs.pantheon.pantheon-agent-polkit}/etc/xdg/autostart/io.elementary.desktop.agent-polkit.desktop"}
|
||||
|
@ -304,5 +350,3 @@ in
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,40 +1,60 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
notificationModule = { config, pkgs, lib, ... }:
|
||||
notificationModule =
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
swaync = pkgs.swaynotificationcenter;
|
||||
in
|
||||
with lib; mkIf (config.linux.graphical.type == "wayland") {
|
||||
with lib;
|
||||
mkIf (config.linux.graphical.type == "wayland") {
|
||||
services.swaync = {
|
||||
enable = true;
|
||||
settings.widgets = [ "inhibitors" "title" "dnd" "mpris" "notifications" ];
|
||||
settings.widgets = [
|
||||
"inhibitors"
|
||||
"title"
|
||||
"dnd"
|
||||
"mpris"
|
||||
"notifications"
|
||||
];
|
||||
style = ./swaync.css;
|
||||
};
|
||||
|
||||
programs.my-waybar = {
|
||||
extraSettings = [{
|
||||
modules-right = mkAfter [ "custom/swaync" ];
|
||||
modules."custom/swaync" = {
|
||||
tooltip = false;
|
||||
format = "{icon} {}";
|
||||
format-icons = {
|
||||
notification = "<span foreground='red'><sup></sup></span>";
|
||||
none = "";
|
||||
dnd-notification = "<span foreground='red'><sup></sup></span>";
|
||||
dnd-none = "";
|
||||
inhibited-notification = "<span foreground='red'><sup></sup></span>";
|
||||
inhibited-none = "";
|
||||
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>";
|
||||
dnd-inhibited-none = "";
|
||||
extraSettings = [
|
||||
{
|
||||
modules-right = mkAfter [ "custom/swaync" ];
|
||||
modules."custom/swaync" = {
|
||||
tooltip = false;
|
||||
format = "{icon} {}";
|
||||
format-icons = {
|
||||
notification = "<span foreground='red'><sup></sup></span>";
|
||||
none = "";
|
||||
dnd-notification = "<span foreground='red'><sup></sup></span>";
|
||||
dnd-none = "";
|
||||
inhibited-notification = "<span foreground='red'><sup></sup></span>";
|
||||
inhibited-none = "";
|
||||
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>";
|
||||
dnd-inhibited-none = "";
|
||||
};
|
||||
return-type = "json";
|
||||
# exec-if = "which swaync-client";
|
||||
exec = "${swaync}/bin/swaync-client -swb";
|
||||
on-click = "${swaync}/bin/swaync-client -t -sw";
|
||||
on-click-right = "${swaync}/bin/swaync-client -d -sw";
|
||||
escape = true;
|
||||
};
|
||||
return-type = "json";
|
||||
# exec-if = "which swaync-client";
|
||||
exec = "${swaync}/bin/swaync-client -swb";
|
||||
on-click = "${swaync}/bin/swaync-client -t -sw";
|
||||
on-click-right = "${swaync}/bin/swaync-client -d -sw";
|
||||
escape = true;
|
||||
};
|
||||
}];
|
||||
}
|
||||
];
|
||||
extraStyle = mkAfter ''
|
||||
#custom-swaync {
|
||||
background: #F0FFFF;
|
||||
|
@ -44,32 +64,43 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
plasmaModule = { pkgs, ... }: {
|
||||
home.packages = with pkgs.kdePackages; [
|
||||
discover
|
||||
kmail
|
||||
kontact
|
||||
akonadi
|
||||
kdepim-runtime
|
||||
kmail-account-wizard
|
||||
akonadi-import-wizard
|
||||
];
|
||||
xdg.configFile."plasma-workspace/env/wayland.sh".source = pkgs.writeScript "plasma-wayland-env.sh" ''
|
||||
export NIXOS_OZONE_WL=1
|
||||
'';
|
||||
xdg.dataFile."dbus-1/services/org.freedesktop.Notifications.service".source = "${pkgs.kdePackages.plasma-workspace}/share/dbus-1/services/org.kde.plasma.Notifications.service";
|
||||
};
|
||||
plasmaModule =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs.kdePackages; [
|
||||
discover
|
||||
kmail
|
||||
kontact
|
||||
akonadi
|
||||
kdepim-runtime
|
||||
kmail-account-wizard
|
||||
akonadi-import-wizard
|
||||
];
|
||||
xdg.configFile."plasma-workspace/env/wayland.sh".source =
|
||||
pkgs.writeScript "plasma-wayland-env.sh" ''
|
||||
export NIXOS_OZONE_WL=1
|
||||
'';
|
||||
xdg.dataFile."dbus-1/services/org.freedesktop.Notifications.service".source =
|
||||
"${pkgs.kdePackages.plasma-workspace}/share/dbus-1/services/org.kde.plasma.Notifications.service";
|
||||
};
|
||||
|
||||
rofi-rbw-script = pkgs.writeShellApplication {
|
||||
name = "rofi-rbw-script";
|
||||
runtimeInputs = with pkgs; [ rofi wtype rofi-rbw ];
|
||||
runtimeInputs = with pkgs; [
|
||||
rofi
|
||||
wtype
|
||||
rofi-rbw
|
||||
];
|
||||
text = "rofi-rbw";
|
||||
meta.mainProgram = "rofi-rbw-script";
|
||||
};
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
imports = [ notificationModule plasmaModule ];
|
||||
imports = [
|
||||
notificationModule
|
||||
plasmaModule
|
||||
];
|
||||
config = mkIf (config.linux.graphical.type == "wayland") {
|
||||
# Additional packages
|
||||
home.packages = with pkgs; [
|
||||
|
@ -92,7 +123,12 @@ with lib;
|
|||
font = "monospace";
|
||||
terminal = "${lib.getExe config.programs.kitty.package}";
|
||||
theme = "Paper";
|
||||
plugins = with pkgs; [ rofi-bluetooth rofi-calc rofi-rbw rofi-power-menu ];
|
||||
plugins = with pkgs; [
|
||||
rofi-bluetooth
|
||||
rofi-calc
|
||||
rofi-rbw
|
||||
rofi-power-menu
|
||||
];
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
|
@ -129,4 +165,3 @@ with lib;
|
|||
# };
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.linux.graphical;
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
imports = [ ./x11/hidpi.nix ./x11/i3.nix ];
|
||||
imports = [
|
||||
./x11/hidpi.nix
|
||||
./x11/i3.nix
|
||||
];
|
||||
options.linux.graphical.hasDE = mkOption {
|
||||
type = types.bool;
|
||||
description = "When enabled, disable stuff that already comes with a DE";
|
||||
|
@ -43,4 +51,3 @@ with lib;
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
|
@ -18,12 +23,14 @@ let
|
|||
"10: 10"
|
||||
];
|
||||
wsAttrs = builtins.listToAttrs (
|
||||
map
|
||||
(i: { name = toString (remainder i 10); value = builtins.elemAt workspaces (i - 1); })
|
||||
(range 1 11)
|
||||
map (i: {
|
||||
name = toString (remainder i 10);
|
||||
value = builtins.elemAt workspaces (i - 1);
|
||||
}) (range 1 11)
|
||||
);
|
||||
remainder = x: y: x - (builtins.div x y) * y;
|
||||
range = from: to:
|
||||
range =
|
||||
from: to:
|
||||
let
|
||||
f = cur: if cur == to then [ ] else [ cur ] ++ f (cur + 1);
|
||||
in
|
||||
|
@ -40,27 +47,55 @@ in
|
|||
xsession.windowManager.i3 = {
|
||||
enable = true;
|
||||
config.assigns = {
|
||||
"${wsAttrs."1"}" = [{ class = "^firefox$"; }];
|
||||
"${wsAttrs."2"}" = [{ class = "^discord$"; }];
|
||||
"${wsAttrs."1"}" = [ { class = "^firefox$"; } ];
|
||||
"${wsAttrs."2"}" = [ { class = "^discord$"; } ];
|
||||
};
|
||||
config.bars = [{
|
||||
command = "${pkgs.i3-gaps}/bin/i3bar -t";
|
||||
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-default.toml";
|
||||
position = "top";
|
||||
colors = {
|
||||
background = "#00000080";
|
||||
statusline = "#ffffff";
|
||||
separator = "#666666";
|
||||
config.bars = [
|
||||
{
|
||||
command = "${pkgs.i3-gaps}/bin/i3bar -t";
|
||||
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-default.toml";
|
||||
position = "top";
|
||||
colors = {
|
||||
background = "#00000080";
|
||||
statusline = "#ffffff";
|
||||
separator = "#666666";
|
||||
|
||||
focusedWorkspace = { background = "#4c7899"; border = "#285577"; text = "#ffffff"; };
|
||||
activeWorkspace = { background = "#333333"; border = "#5f676a"; text = "#ffffff"; };
|
||||
inactiveWorkspace = { background = "#333333"; border = "#222222"; text = "#888888"; };
|
||||
urgentWorkspace = { background = "#2f343a"; border = "#900000"; text = "#ffffff"; };
|
||||
bindingMode = { background = "#2f343a"; border = "#900000"; text = "#ffffff"; };
|
||||
};
|
||||
}];
|
||||
focusedWorkspace = {
|
||||
background = "#4c7899";
|
||||
border = "#285577";
|
||||
text = "#ffffff";
|
||||
};
|
||||
activeWorkspace = {
|
||||
background = "#333333";
|
||||
border = "#5f676a";
|
||||
text = "#ffffff";
|
||||
};
|
||||
inactiveWorkspace = {
|
||||
background = "#333333";
|
||||
border = "#222222";
|
||||
text = "#888888";
|
||||
};
|
||||
urgentWorkspace = {
|
||||
background = "#2f343a";
|
||||
border = "#900000";
|
||||
text = "#ffffff";
|
||||
};
|
||||
bindingMode = {
|
||||
background = "#2f343a";
|
||||
border = "#900000";
|
||||
text = "#ffffff";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
config.focus.newWindow = "none";
|
||||
config.fonts = { names = [ "FantasqueSansMono Nerd Font Mono" "monospace" ]; size = 11.0; };
|
||||
config.fonts = {
|
||||
names = [
|
||||
"FantasqueSansMono Nerd Font Mono"
|
||||
"monospace"
|
||||
];
|
||||
size = 11.0;
|
||||
};
|
||||
config.gaps.outer = 5;
|
||||
config.gaps.inner = 5;
|
||||
config.gaps.smartGaps = true;
|
||||
|
@ -69,53 +104,57 @@ in
|
|||
config.window.titlebar = false;
|
||||
|
||||
# Keybindings
|
||||
config.keybindings = lib.mkOptionDefault ({
|
||||
## vim-style movements
|
||||
"${mod}+h" = "focus left";
|
||||
"${mod}+j" = "focus down";
|
||||
"${mod}+k" = "focus up";
|
||||
"${mod}+l" = "focus right";
|
||||
"${mod}+Shift+h" = "move left";
|
||||
"${mod}+Shift+j" = "move down";
|
||||
"${mod}+Shift+k" = "move up";
|
||||
"${mod}+Shift+l" = "move right";
|
||||
## Splits
|
||||
"${mod}+v" = "split v";
|
||||
"${mod}+Shift+v" = "split h";
|
||||
## Run
|
||||
"${mod}+r" = "exec ${pkgs.dmenu}/bin/dmenu_run";
|
||||
"${mod}+d" = "exec i3-dmenu-desktop --dmenu='${pkgs.dmenu}/bin/dmenu -i'";
|
||||
} // (
|
||||
builtins.listToAttrs (lib.flatten (map
|
||||
(key: [
|
||||
{
|
||||
name = "${mod}+${key}";
|
||||
value = "workspace ${builtins.getAttr key wsAttrs}";
|
||||
}
|
||||
{
|
||||
name = "${mod}+Shift+${key}";
|
||||
value = "move to workspace ${builtins.getAttr key wsAttrs}";
|
||||
}
|
||||
])
|
||||
(builtins.attrNames wsAttrs))
|
||||
)));
|
||||
config.keybindings = lib.mkOptionDefault (
|
||||
{
|
||||
## vim-style movements
|
||||
"${mod}+h" = "focus left";
|
||||
"${mod}+j" = "focus down";
|
||||
"${mod}+k" = "focus up";
|
||||
"${mod}+l" = "focus right";
|
||||
"${mod}+Shift+h" = "move left";
|
||||
"${mod}+Shift+j" = "move down";
|
||||
"${mod}+Shift+k" = "move up";
|
||||
"${mod}+Shift+l" = "move right";
|
||||
## Splits
|
||||
"${mod}+v" = "split v";
|
||||
"${mod}+Shift+v" = "split h";
|
||||
## Run
|
||||
"${mod}+r" = "exec ${pkgs.dmenu}/bin/dmenu_run";
|
||||
"${mod}+d" = "exec i3-dmenu-desktop --dmenu='${pkgs.dmenu}/bin/dmenu -i'";
|
||||
}
|
||||
// (builtins.listToAttrs (
|
||||
lib.flatten (
|
||||
map (key: [
|
||||
{
|
||||
name = "${mod}+${key}";
|
||||
value = "workspace ${builtins.getAttr key wsAttrs}";
|
||||
}
|
||||
{
|
||||
name = "${mod}+Shift+${key}";
|
||||
value = "move to workspace ${builtins.getAttr key wsAttrs}";
|
||||
}
|
||||
]) (builtins.attrNames wsAttrs)
|
||||
)
|
||||
))
|
||||
);
|
||||
|
||||
# Workspace
|
||||
config.defaultWorkspace = "workspace ${builtins.getAttr "1" wsAttrs}";
|
||||
config.startup = [
|
||||
{ command = "firefox"; }
|
||||
{ command = "discord"; }
|
||||
{ command = "dex -ae i3"; }
|
||||
{ command = "ibus-daemon -drxR"; }
|
||||
] ++
|
||||
(
|
||||
if (config.linux.graphical.wallpaper != "")
|
||||
then [{ command = "${pkgs.feh}/bin/feh --bg-fill ${config.linux.graphical.wallpaper}"; }]
|
||||
else [ ]
|
||||
);
|
||||
config.startup =
|
||||
[
|
||||
{ command = "firefox"; }
|
||||
{ command = "discord"; }
|
||||
{ command = "dex -ae i3"; }
|
||||
{ command = "ibus-daemon -drxR"; }
|
||||
]
|
||||
++ (
|
||||
if (config.linux.graphical.wallpaper != "") then
|
||||
[ { command = "${pkgs.feh}/bin/feh --bg-fill ${config.linux.graphical.wallpaper}"; } ]
|
||||
else
|
||||
[ ]
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
# i3status
|
||||
programs.i3status-rust.enable = true;
|
||||
programs.i3status-rust.bars.default = {
|
||||
|
@ -154,5 +193,3 @@ in
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
{
|
||||
xsession.windowManager.i3.config = mkIf (config.linux.graphical.x11.enablei3) {
|
||||
startup = [{ command = "${pkgs.flameshot}/bin/flameshot"; }];
|
||||
startup = [ { command = "${pkgs.flameshot}/bin/flameshot"; } ];
|
||||
keybindings = mkOptionDefault { "Print" = "exec ${pkgs.flameshot}/bin/flameshot gui"; };
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,24 +1,42 @@
|
|||
# A monitor list and common sway set up
|
||||
{ config, pkgs, lib, ... }: with lib;
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
monitors = {
|
||||
# Internal
|
||||
"framework" = {
|
||||
name = "BOE 0x0BCA Unknown";
|
||||
meta.mode = { width = 2256; height = 1504; refresh = 60.0; };
|
||||
meta.mode = {
|
||||
width = 2256;
|
||||
height = 1504;
|
||||
refresh = 60.0;
|
||||
};
|
||||
scale = 1.25;
|
||||
};
|
||||
"yoga" = {
|
||||
name = "AU Optronics 0xD291 Unknown";
|
||||
meta.connection = "eDP-1";
|
||||
meta.mode = { width = 1920; height = 1080; refresh = 60.026; };
|
||||
meta.mode = {
|
||||
width = 1920;
|
||||
height = 1080;
|
||||
refresh = 60.026;
|
||||
};
|
||||
scale = 1;
|
||||
};
|
||||
# External
|
||||
## Work @ EPFL
|
||||
"work" = {
|
||||
name = "LG Electronics LG ULTRAFINE 301MAXSGHD10";
|
||||
meta.mode = { width = 3840; height = 2160; refresh = 60.0; };
|
||||
meta.mode = {
|
||||
width = 3840;
|
||||
height = 2160;
|
||||
refresh = 60.0;
|
||||
};
|
||||
scale = 1.25;
|
||||
};
|
||||
"home_4k" = {
|
||||
|
@ -27,8 +45,15 @@ let
|
|||
adaptive_sync = "on";
|
||||
meta = {
|
||||
connection = "DP-2";
|
||||
mode = { width = 3840; height = 2160; refresh = 60.0; };
|
||||
fixedPosition = { x = 0; y = 0; };
|
||||
mode = {
|
||||
width = 3840;
|
||||
height = 2160;
|
||||
refresh = 60.0;
|
||||
};
|
||||
fixedPosition = {
|
||||
x = 0;
|
||||
y = 0;
|
||||
};
|
||||
niriName = "PNP(AOC) U28G2G6B PPYP2JA000013";
|
||||
};
|
||||
};
|
||||
|
@ -37,15 +62,26 @@ let
|
|||
adaptive_sync = "on";
|
||||
meta = {
|
||||
connection = "DP-3";
|
||||
mode = { width = 2560; height = 1440; refresh = 165.0; };
|
||||
fixedPosition = { x = 2560; y = 0; };
|
||||
mode = {
|
||||
width = 2560;
|
||||
height = 1440;
|
||||
refresh = 165.0;
|
||||
};
|
||||
fixedPosition = {
|
||||
x = 2560;
|
||||
y = 0;
|
||||
};
|
||||
niriName = "PNP(AOC) Q27G2G3R3B VXJP6HA000442";
|
||||
};
|
||||
};
|
||||
|
||||
"viewsonic_1080" = {
|
||||
name = "ViewSonic Corporation XG2402 SERIES V4K182501054";
|
||||
meta.mode = { width = 1920; height = 1080; refresh = 144.0; };
|
||||
meta.mode = {
|
||||
width = 1920;
|
||||
height = 1080;
|
||||
refresh = 144.0;
|
||||
};
|
||||
adaptive_sync = "on";
|
||||
};
|
||||
|
||||
|
@ -53,13 +89,21 @@ let
|
|||
|
||||
eachMonitor = _name: monitor: {
|
||||
name = monitor.name;
|
||||
value = builtins.removeAttrs monitor [ "scale" "name" "meta" ] // (lib.optionalAttrs (monitor ? scale) {
|
||||
scale = toString monitor.scale;
|
||||
}) // {
|
||||
mode = with monitor.meta.mode; "${toString width}x${toString height}@${toString refresh}Hz";
|
||||
} // (lib.optionalAttrs (monitor.meta ? fixedPosition) {
|
||||
position = with monitor.meta.fixedPosition; "${toString x} ${toString y}";
|
||||
});
|
||||
value =
|
||||
builtins.removeAttrs monitor [
|
||||
"scale"
|
||||
"name"
|
||||
"meta"
|
||||
]
|
||||
// (lib.optionalAttrs (monitor ? scale) {
|
||||
scale = toString monitor.scale;
|
||||
})
|
||||
// {
|
||||
mode = with monitor.meta.mode; "${toString width}x${toString height}@${toString refresh}Hz";
|
||||
}
|
||||
// (lib.optionalAttrs (monitor.meta ? fixedPosition) {
|
||||
position = with monitor.meta.fixedPosition; "${toString x} ${toString y}";
|
||||
});
|
||||
};
|
||||
in
|
||||
{
|
||||
|
@ -73,4 +117,3 @@ in
|
|||
mapAttrs' eachMonitor config.common.monitors
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
|
@ -91,10 +96,13 @@ in
|
|||
|
||||
# Add an extra syntax_color config
|
||||
xdg.configFile."broot/conf.toml".source = mkOverride 1 (
|
||||
tomlFormat.generate "broot-config" (with config.programs.broot; {
|
||||
inherit (settings) verbs modal skin;
|
||||
syntax_theme = "base16-ocean.light";
|
||||
})
|
||||
tomlFormat.generate "broot-config" (
|
||||
with config.programs.broot;
|
||||
{
|
||||
inherit (settings) verbs modal skin;
|
||||
syntax_theme = "base16-ocean.light";
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
{ config, options, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
options,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.my-kakoune;
|
||||
in
|
||||
{
|
||||
imports = [ ./fish-session.nix ./tree-sitter.nix ];
|
||||
imports = [
|
||||
./fish-session.nix
|
||||
./tree-sitter.nix
|
||||
];
|
||||
|
||||
options.programs.my-kakoune = {
|
||||
enable = mkEnableOption "My version of the kakoune configuration";
|
||||
|
@ -38,7 +47,11 @@ in
|
|||
let
|
||||
kakouneFaces =
|
||||
let
|
||||
txt = strings.concatStringsSep "\n" (builtins.attrValues (builtins.mapAttrs (name: face: "face global ${name} \"${face}\"") cfg.extraFaces));
|
||||
txt = strings.concatStringsSep "\n" (
|
||||
builtins.attrValues (
|
||||
builtins.mapAttrs (name: face: "face global ${name} \"${face}\"") cfg.extraFaces
|
||||
)
|
||||
);
|
||||
in
|
||||
pkgs.writeText "faces.kak" txt;
|
||||
in
|
||||
|
@ -51,15 +64,13 @@ in
|
|||
# Load faces
|
||||
source ${kakouneFaces}
|
||||
'';
|
||||
} // lib.mapAttrs'
|
||||
(name: attrs: {
|
||||
name = "kak/autoload/${name}";
|
||||
value = attrs // {
|
||||
target = "kak/autoload/${name}";
|
||||
};
|
||||
})
|
||||
cfg.autoloadFile;
|
||||
}
|
||||
// lib.mapAttrs' (name: attrs: {
|
||||
name = "kak/autoload/${name}";
|
||||
value = attrs // {
|
||||
target = "kak/autoload/${name}";
|
||||
};
|
||||
}) cfg.autoloadFile;
|
||||
xdg.dataFile."kak".source = "${cfg.package}/share/kak";
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.my-kakoune.tree-sitter;
|
||||
|
@ -14,14 +19,44 @@ let
|
|||
default = "src";
|
||||
};
|
||||
grammar.compile = {
|
||||
command = mkOption { type = types.str; default = "${pkgs.gcc}/bin/gcc"; };
|
||||
args = mkOption { type = types.listOf types.str; default = [ "-c" "-fpic" "../parser.c" "../scanner.c" "-I" ".." ]; };
|
||||
flags = mkOption { type = types.listOf types.str; default = [ "-O3" ]; };
|
||||
command = mkOption {
|
||||
type = types.str;
|
||||
default = "${pkgs.gcc}/bin/gcc";
|
||||
};
|
||||
args = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [
|
||||
"-c"
|
||||
"-fpic"
|
||||
"../parser.c"
|
||||
"../scanner.c"
|
||||
"-I"
|
||||
".."
|
||||
];
|
||||
};
|
||||
flags = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ "-O3" ];
|
||||
};
|
||||
};
|
||||
grammar.link = {
|
||||
command = mkOption { type = types.str; default = "${pkgs.gcc}/bin/gcc"; };
|
||||
args = mkOption { type = types.listOf types.str; default = [ "-shared" "-fpic" "parser.o" "scanner.o" ]; };
|
||||
flags = mkOption { type = types.listOf types.str; default = [ "-O3" ]; };
|
||||
command = mkOption {
|
||||
type = types.str;
|
||||
default = "${pkgs.gcc}/bin/gcc";
|
||||
};
|
||||
args = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [
|
||||
"-shared"
|
||||
"-fpic"
|
||||
"parser.o"
|
||||
"scanner.o"
|
||||
];
|
||||
};
|
||||
flags = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ "-O3" ];
|
||||
};
|
||||
};
|
||||
queries.src = mkOption {
|
||||
type = types.package;
|
||||
|
@ -34,12 +69,27 @@ let
|
|||
};
|
||||
};
|
||||
mkGrammarPackage =
|
||||
{ name
|
||||
, src
|
||||
, grammarPath ? "src"
|
||||
, grammarCompileArgs ? [ "-O3" "-c" "-fpic" "../parser.c" "../scanner.c" "-I" ".." ]
|
||||
, grammarLinkArgs ? [ "-shared" "-fpic" "parser.o" "scanner.o" ]
|
||||
}: pkgs.stdenv.mkDerivation {
|
||||
{
|
||||
name,
|
||||
src,
|
||||
grammarPath ? "src",
|
||||
grammarCompileArgs ? [
|
||||
"-O3"
|
||||
"-c"
|
||||
"-fpic"
|
||||
"../parser.c"
|
||||
"../scanner.c"
|
||||
"-I"
|
||||
".."
|
||||
],
|
||||
grammarLinkArgs ? [
|
||||
"-shared"
|
||||
"-fpic"
|
||||
"parser.o"
|
||||
"scanner.o"
|
||||
],
|
||||
}:
|
||||
pkgs.stdenv.mkDerivation {
|
||||
inherit src;
|
||||
name = "kak-tree-sitter-grammar-${name}.so";
|
||||
version = "latest";
|
||||
|
@ -215,43 +265,54 @@ in
|
|||
toTs = name: "ts_${strings.concatStringsSep "_" (strings.splitString "." name)}";
|
||||
toScm = name: strings.concatStringsSep "." (strings.splitString "_" name);
|
||||
|
||||
definedFaces = attrsets.mapAttrs' (name: value: { inherit value; name = toTs name; }) allGroups;
|
||||
aliasFaces = attrsets.mapAttrs' (name: value: { name = toTs name; value = "@${toTs value}"; }) aliases;
|
||||
definedFaces = attrsets.mapAttrs' (name: value: {
|
||||
inherit value;
|
||||
name = toTs name;
|
||||
}) allGroups;
|
||||
aliasFaces = attrsets.mapAttrs' (name: value: {
|
||||
name = toTs name;
|
||||
value = "@${toTs value}";
|
||||
}) aliases;
|
||||
faces = attrsets.recursiveUpdate definedFaces aliasFaces;
|
||||
|
||||
toml = pkgs.formats.toml { };
|
||||
|
||||
toLanguageConf = name: lang: with lang; {
|
||||
grammar = {
|
||||
source.local.path = mkGrammarPackage {
|
||||
inherit name;
|
||||
src = grammar.src;
|
||||
grammarPath = grammar.path;
|
||||
grammarCompileArgs = grammar.compile.flags ++ grammar.compile.args;
|
||||
grammarLinkArgs = grammar.link.flags ++ grammar.link.args;
|
||||
toLanguageConf =
|
||||
name: lang: with lang; {
|
||||
grammar = {
|
||||
source.local.path = mkGrammarPackage {
|
||||
inherit name;
|
||||
src = grammar.src;
|
||||
grammarPath = grammar.path;
|
||||
grammarCompileArgs = grammar.compile.flags ++ grammar.compile.args;
|
||||
grammarLinkArgs = grammar.link.flags ++ grammar.link.args;
|
||||
};
|
||||
compile = grammar.compile.command;
|
||||
compile_args = grammar.compile.args;
|
||||
compile_flags = grammar.compile.flags;
|
||||
link = grammar.link.command;
|
||||
link_args = grammar.link.args ++ [
|
||||
"-o"
|
||||
"${name}.so"
|
||||
];
|
||||
link_flags = grammar.link.flags;
|
||||
};
|
||||
queries = rec {
|
||||
path = if queries.path == null then "runtime/queries/${name}" else queries.path;
|
||||
source.local.path = "${queries.src}/${path}";
|
||||
};
|
||||
compile = grammar.compile.command;
|
||||
compile_args = grammar.compile.args;
|
||||
compile_flags = grammar.compile.flags;
|
||||
link = grammar.link.command;
|
||||
link_args = grammar.link.args ++ [ "-o" "${name}.so" ];
|
||||
link_flags = grammar.link.flags;
|
||||
};
|
||||
queries = rec {
|
||||
path = if queries.path == null then "runtime/queries/${name}" else queries.path;
|
||||
source.local.path = "${queries.src}/${path}";
|
||||
};
|
||||
};
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
assertions = with lib.asserts; ([ ]
|
||||
++ attrsets.mapAttrsToList
|
||||
(name: _: {
|
||||
assertion = (! (builtins.hasAttr name allGroups));
|
||||
message = "${name} was both defined and aliased";
|
||||
})
|
||||
aliases
|
||||
);
|
||||
assertions =
|
||||
with lib.asserts;
|
||||
(
|
||||
[ ]
|
||||
++ attrsets.mapAttrsToList (name: _: {
|
||||
assertion = (!(builtins.hasAttr name allGroups));
|
||||
message = "${name} was both defined and aliased";
|
||||
}) aliases
|
||||
);
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."kak-tree-sitter/config.toml" = {
|
||||
|
@ -271,4 +332,3 @@ in
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.nki.programs.kitty;
|
||||
cmd = "cmd";
|
||||
in
|
||||
with lib; {
|
||||
with lib;
|
||||
{
|
||||
programs.kitty = mkIf (cfg.enable && pkgs.stdenv.isDarwin) {
|
||||
|
||||
# Darwin-specific setup
|
||||
|
@ -24,4 +30,3 @@ with lib; {
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,21 +1,41 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.nki.programs.kitty;
|
||||
|
||||
theme = { lib, options, config, ... }: {
|
||||
programs.kitty = lib.mkIf config.nki.programs.kitty.enable (
|
||||
if builtins.hasAttr "themeFile" options.programs.kitty then {
|
||||
themeFile = "ayu_light";
|
||||
} else {
|
||||
theme = "Ayu Light";
|
||||
}
|
||||
);
|
||||
};
|
||||
theme =
|
||||
{
|
||||
lib,
|
||||
options,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.kitty = lib.mkIf config.nki.programs.kitty.enable (
|
||||
if builtins.hasAttr "themeFile" options.programs.kitty then
|
||||
{
|
||||
themeFile = "ayu_light";
|
||||
}
|
||||
else
|
||||
{
|
||||
theme = "Ayu Light";
|
||||
}
|
||||
);
|
||||
};
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
imports = [ theme ./darwin.nix ./linux.nix ./tabs.nix ];
|
||||
imports = [
|
||||
theme
|
||||
./darwin.nix
|
||||
./linux.nix
|
||||
./tabs.nix
|
||||
];
|
||||
|
||||
options.nki.programs.kitty = {
|
||||
enable = mkEnableOption "Enable kitty";
|
||||
|
@ -73,14 +93,17 @@ with lib;
|
|||
let
|
||||
# Background color and transparency
|
||||
background =
|
||||
if isNull cfg.background then {
|
||||
background_opacity = "0.93";
|
||||
dynamic_background_opacity = true;
|
||||
} else {
|
||||
background_image = "${cfg.background}";
|
||||
background_image_layout = "scaled";
|
||||
background_tint = "0.85";
|
||||
};
|
||||
if isNull cfg.background then
|
||||
{
|
||||
background_opacity = "0.93";
|
||||
dynamic_background_opacity = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
background_image = "${cfg.background}";
|
||||
background_image_layout = "scaled";
|
||||
background_tint = "0.85";
|
||||
};
|
||||
in
|
||||
mkMerge [
|
||||
background
|
||||
|
@ -123,4 +146,3 @@ with lib;
|
|||
'';
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.nki.programs.kitty;
|
||||
in
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.nki.programs.kitty;
|
||||
|
@ -7,33 +12,33 @@ in
|
|||
with lib;
|
||||
{
|
||||
programs.kitty = mkIf cfg.enableTabs {
|
||||
keybindings = {
|
||||
"${cmd}+t" = "new_tab_with_cwd";
|
||||
"${cmd}+shift+t" = "new_tab";
|
||||
"${cmd}+shift+o" = "launch --cwd=current --location=vsplit";
|
||||
"${cmd}+o" = "launch --cwd=current --location=hsplit";
|
||||
"${cmd}+r" = "start_resizing_window";
|
||||
"${cmd}+shift+r" = "layout_action rotate";
|
||||
## Move the active window in the indicated direction
|
||||
"${cmd}+shift+h" = "move_window left";
|
||||
"${cmd}+shift+k" = "move_window up";
|
||||
"${cmd}+shift+j" = "move_window down";
|
||||
"${cmd}+shift+l" = "move_window right";
|
||||
## Switch focus to the neighboring window in the indicated direction
|
||||
"${cmd}+h" = "neighboring_window left";
|
||||
"${cmd}+k" = "neighboring_window up";
|
||||
"${cmd}+j" = "neighboring_window down ";
|
||||
"${cmd}+l" = "neighboring_window right";
|
||||
## Detach window to its own tab
|
||||
"${cmd}+shift+d" = "detach_window new-tab";
|
||||
## Change layout to fullscreen (stack) and back
|
||||
"${cmd}+f" = "toggle_layout stack";
|
||||
}
|
||||
# Tab bindings
|
||||
// builtins.listToAttrs
|
||||
(map
|
||||
(x: attrsets.nameValuePair "${cmd}+${toString x}" "goto_tab ${toString x}")
|
||||
(lists.range 1 9));
|
||||
keybindings =
|
||||
{
|
||||
"${cmd}+t" = "new_tab_with_cwd";
|
||||
"${cmd}+shift+t" = "new_tab";
|
||||
"${cmd}+shift+o" = "launch --cwd=current --location=vsplit";
|
||||
"${cmd}+o" = "launch --cwd=current --location=hsplit";
|
||||
"${cmd}+r" = "start_resizing_window";
|
||||
"${cmd}+shift+r" = "layout_action rotate";
|
||||
## Move the active window in the indicated direction
|
||||
"${cmd}+shift+h" = "move_window left";
|
||||
"${cmd}+shift+k" = "move_window up";
|
||||
"${cmd}+shift+j" = "move_window down";
|
||||
"${cmd}+shift+l" = "move_window right";
|
||||
## Switch focus to the neighboring window in the indicated direction
|
||||
"${cmd}+h" = "neighboring_window left";
|
||||
"${cmd}+k" = "neighboring_window up";
|
||||
"${cmd}+j" = "neighboring_window down ";
|
||||
"${cmd}+l" = "neighboring_window right";
|
||||
## Detach window to its own tab
|
||||
"${cmd}+shift+d" = "detach_window new-tab";
|
||||
## Change layout to fullscreen (stack) and back
|
||||
"${cmd}+f" = "toggle_layout stack";
|
||||
}
|
||||
# Tab bindings
|
||||
// builtins.listToAttrs (
|
||||
map (x: attrsets.nameValuePair "${cmd}+${toString x}" "goto_tab ${toString x}") (lists.range 1 9)
|
||||
);
|
||||
settings = {
|
||||
# Tab settings
|
||||
tab_bar_edge = "top";
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
{ config, osConfig, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
osConfig,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.my-niri;
|
||||
|
||||
|
@ -26,16 +32,33 @@ in
|
|||
lock-command = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
description = "The command to lock the screen";
|
||||
default = [ "${pkgs.swaylock}/bin/swaylock" ]
|
||||
++ (if wallpaper == "" then [ "" ] else [ "-i" "${wallpaper}" "-s" "fill" ])
|
||||
++ [ "-l" "-k" ];
|
||||
default =
|
||||
[ "${pkgs.swaylock}/bin/swaylock" ]
|
||||
++ (
|
||||
if wallpaper == "" then
|
||||
[ "" ]
|
||||
else
|
||||
[
|
||||
"-i"
|
||||
"${wallpaper}"
|
||||
"-s"
|
||||
"fill"
|
||||
]
|
||||
)
|
||||
++ [
|
||||
"-l"
|
||||
"-k"
|
||||
];
|
||||
};
|
||||
|
||||
workspaces = lib.mkOption {
|
||||
type = lib.types.attrsOf
|
||||
(lib.types.submodule {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule {
|
||||
options = {
|
||||
name = lib.mkOption { type = lib.types.str; description = "workspace name"; };
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "workspace name";
|
||||
};
|
||||
fixed = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
|
@ -47,7 +70,8 @@ in
|
|||
description = "Default monitor to spawn workspace in";
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
description = "A mapping of ordering to workspace names, for fixed workspaces";
|
||||
};
|
||||
};
|
||||
|
@ -55,17 +79,39 @@ in
|
|||
config = lib.mkIf cfg.enable {
|
||||
programs.my-niri.workspaces = {
|
||||
# Default workspaces, always there
|
||||
"01" = { name = "🌏 web"; };
|
||||
"02" = { name = "💬 chat"; };
|
||||
"03" = { name = "⚙️ code"; };
|
||||
"04" = { name = "🎶 music"; };
|
||||
"05" = { name = "🔧 extra"; };
|
||||
"06" = { name = "🧰 6"; };
|
||||
"07" = { name = "🔩 7"; };
|
||||
"08" = { name = "🛠️ 8"; };
|
||||
"09" = { name = "🔨 9"; };
|
||||
"10" = { name = "🎲 misc"; };
|
||||
"99" = { name = "📧 Email"; };
|
||||
"01" = {
|
||||
name = "🌏 web";
|
||||
};
|
||||
"02" = {
|
||||
name = "💬 chat";
|
||||
};
|
||||
"03" = {
|
||||
name = "⚙️ code";
|
||||
};
|
||||
"04" = {
|
||||
name = "🎶 music";
|
||||
};
|
||||
"05" = {
|
||||
name = "🔧 extra";
|
||||
};
|
||||
"06" = {
|
||||
name = "🧰 6";
|
||||
};
|
||||
"07" = {
|
||||
name = "🔩 7";
|
||||
};
|
||||
"08" = {
|
||||
name = "🛠️ 8";
|
||||
};
|
||||
"09" = {
|
||||
name = "🔨 9";
|
||||
};
|
||||
"10" = {
|
||||
name = "🎲 misc";
|
||||
};
|
||||
"99" = {
|
||||
name = "📧 Email";
|
||||
};
|
||||
};
|
||||
systemd.user.services.swaync.Install.WantedBy = [ "niri.service" ];
|
||||
systemd.user.services.swaync.Unit.After = [ "niri.service" ];
|
||||
|
@ -84,7 +130,10 @@ in
|
|||
Unit = {
|
||||
Description = "XWayland Client for niri";
|
||||
PartOf = [ "xwayland.target" ];
|
||||
Before = [ "xwayland.target" "xdg-desktop-autostart.target" ];
|
||||
Before = [
|
||||
"xwayland.target"
|
||||
"xdg-desktop-autostart.target"
|
||||
];
|
||||
After = [ "niri.service" ];
|
||||
};
|
||||
Install.WantedBy = [ "niri.service" ];
|
||||
|
@ -97,16 +146,20 @@ in
|
|||
};
|
||||
|
||||
programs.niri.settings = {
|
||||
environment = {
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||
QT_IM_MODULE = "fcitx";
|
||||
# export NIXOS_OZONE_WL=1 # Until text-input is merged
|
||||
DISPLAY = xwayland-display;
|
||||
} // lib.optionalAttrs osConfig.services.desktopManager.plasma6.enable {
|
||||
XDG_MENU_PREFIX = "plasma-";
|
||||
environment =
|
||||
{
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||
QT_IM_MODULE = "fcitx";
|
||||
# export NIXOS_OZONE_WL=1 # Until text-input is merged
|
||||
DISPLAY = xwayland-display;
|
||||
}
|
||||
// lib.optionalAttrs osConfig.services.desktopManager.plasma6.enable {
|
||||
XDG_MENU_PREFIX = "plasma-";
|
||||
};
|
||||
input.keyboard.xkb = {
|
||||
layout = "jp";
|
||||
};
|
||||
input.keyboard.xkb = { layout = "jp"; };
|
||||
input.touchpad = lib.mkIf cfg.enableLaptop {
|
||||
tap = true;
|
||||
dwt = true;
|
||||
|
@ -138,9 +191,25 @@ in
|
|||
|
||||
spawn-at-startup = [
|
||||
# Wallpaper
|
||||
{ command = [ (lib.getExe pkgs.swaybg) "-i" "${wallpaper}" "-m" "fill" ]; }
|
||||
{
|
||||
command = [
|
||||
(lib.getExe pkgs.swaybg)
|
||||
"-i"
|
||||
"${wallpaper}"
|
||||
"-m"
|
||||
"fill"
|
||||
];
|
||||
}
|
||||
# Waybar
|
||||
{ command = [ "systemctl" "--user" "start" "xdg-desktop-portal-gtk.service" "xdg-desktop-portal.service" ]; }
|
||||
{
|
||||
command = [
|
||||
"systemctl"
|
||||
"--user"
|
||||
"start"
|
||||
"xdg-desktop-portal-gtk.service"
|
||||
"xdg-desktop-portal.service"
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
layout = {
|
||||
|
@ -154,11 +223,24 @@ in
|
|||
|
||||
focus-ring = {
|
||||
width = 4;
|
||||
active.gradient = { from = "#00447AFF"; to = "#71C4FFAA"; angle = 45; };
|
||||
active.gradient = {
|
||||
from = "#00447AFF";
|
||||
to = "#71C4FFAA";
|
||||
angle = 45;
|
||||
};
|
||||
inactive.color = "#505050";
|
||||
};
|
||||
border.enable = false;
|
||||
struts = let v = 8; in { left = v; right = v; bottom = v; top = v; };
|
||||
struts =
|
||||
let
|
||||
v = 8;
|
||||
in
|
||||
{
|
||||
left = v;
|
||||
right = v;
|
||||
bottom = v;
|
||||
top = v;
|
||||
};
|
||||
};
|
||||
|
||||
prefer-no-csd = true;
|
||||
|
@ -166,18 +248,31 @@ in
|
|||
workspaces =
|
||||
let
|
||||
fixedWorkspaces = lib.filterAttrs (_: w: w.fixed) cfg.workspaces;
|
||||
workspaceConfig = lib.mapAttrs
|
||||
(_: w: { inherit (w) name; } // (lib.optionalAttrs (w.monitor != null) {
|
||||
workspaceConfig = lib.mapAttrs (
|
||||
_: w:
|
||||
{
|
||||
inherit (w) name;
|
||||
}
|
||||
// (lib.optionalAttrs (w.monitor != null) {
|
||||
open-on-output = w.monitor;
|
||||
}))
|
||||
fixedWorkspaces;
|
||||
})
|
||||
) fixedWorkspaces;
|
||||
in
|
||||
workspaceConfig;
|
||||
|
||||
window-rules = [
|
||||
# Rounded Corners
|
||||
{
|
||||
geometry-corner-radius = let v = 8.0; in { bottom-left = v; bottom-right = v; top-left = v; top-right = v; };
|
||||
geometry-corner-radius =
|
||||
let
|
||||
v = 8.0;
|
||||
in
|
||||
{
|
||||
bottom-left = v;
|
||||
bottom-right = v;
|
||||
top-left = v;
|
||||
top-right = v;
|
||||
};
|
||||
clip-to-geometry = true;
|
||||
}
|
||||
# Workspace assignments
|
||||
|
@ -185,9 +280,18 @@ in
|
|||
open-on-workspace = cfg.workspaces."01".name;
|
||||
open-maximized = true;
|
||||
matches = [
|
||||
{ at-startup = true; app-id = "^firefox$"; }
|
||||
{ at-startup = true; app-id = "^librewolf$"; }
|
||||
{ at-startup = true; app-id = "^zen$"; }
|
||||
{
|
||||
at-startup = true;
|
||||
app-id = "^firefox$";
|
||||
}
|
||||
{
|
||||
at-startup = true;
|
||||
app-id = "^librewolf$";
|
||||
}
|
||||
{
|
||||
at-startup = true;
|
||||
app-id = "^zen$";
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
|
@ -225,7 +329,7 @@ in
|
|||
|
||||
# xwaylandvideobridge
|
||||
{
|
||||
matches = [{ app-id = "^xwaylandvideobridge$"; }];
|
||||
matches = [ { app-id = "^xwaylandvideobridge$"; } ];
|
||||
open-floating = true;
|
||||
focus-ring.enable = false;
|
||||
opacity = 0.0;
|
||||
|
@ -242,15 +346,15 @@ in
|
|||
|
||||
# Kitty dimming
|
||||
{
|
||||
matches = [{ app-id = "kitty"; }];
|
||||
excludes = [{ is-focused = true; }];
|
||||
matches = [ { app-id = "kitty"; } ];
|
||||
excludes = [ { is-focused = true; } ];
|
||||
opacity = 0.95;
|
||||
}
|
||||
];
|
||||
|
||||
layer-rules = [
|
||||
{
|
||||
matches = [{ namespace = "^swaync-.*"; }];
|
||||
matches = [ { namespace = "^swaync-.*"; } ];
|
||||
block-out-from = "screen-capture";
|
||||
}
|
||||
];
|
||||
|
@ -268,14 +372,38 @@ in
|
|||
"Mod+Shift+P".action = spawn "rofi-rbw-script";
|
||||
|
||||
# Audio and Volume
|
||||
"XF86AudioPrev" = { action = spawn playerctl "previous"; allow-when-locked = true; };
|
||||
"XF86AudioPlay" = { action = spawn playerctl "play-pause"; allow-when-locked = true; };
|
||||
"Shift+XF86AudioPlay" = { action = spawn playerctl "stop"; allow-when-locked = true; };
|
||||
"XF86AudioNext" = { action = spawn playerctl "next"; allow-when-locked = true; };
|
||||
"XF86AudioRecord" = { action = spawn amixer "-q" "set" "Capture" "toggle"; allow-when-locked = true; };
|
||||
"XF86AudioMute" = { action = spawn amixer "-q" "set" "Master" "toggle"; allow-when-locked = true; };
|
||||
"XF86AudioLowerVolume" = { action = spawn amixer "-q" "set" "Master" "3%-"; allow-when-locked = true; };
|
||||
"XF86AudioRaiseVolume" = { action = spawn amixer "-q" "set" "Master" "3%+"; allow-when-locked = true; };
|
||||
"XF86AudioPrev" = {
|
||||
action = spawn playerctl "previous";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioPlay" = {
|
||||
action = spawn playerctl "play-pause";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"Shift+XF86AudioPlay" = {
|
||||
action = spawn playerctl "stop";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioNext" = {
|
||||
action = spawn playerctl "next";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioRecord" = {
|
||||
action = spawn amixer "-q" "set" "Capture" "toggle";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioMute" = {
|
||||
action = spawn amixer "-q" "set" "Master" "toggle";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioLowerVolume" = {
|
||||
action = spawn amixer "-q" "set" "Master" "3%-";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
"XF86AudioRaiseVolume" = {
|
||||
action = spawn amixer "-q" "set" "Master" "3%+";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
|
||||
# Backlight
|
||||
"XF86MonBrightnessDown".action = spawn brightnessctl "s" "10%-";
|
||||
|
@ -320,10 +448,22 @@ in
|
|||
"Mod+Ctrl+O".action = move-workspace-up;
|
||||
|
||||
# Mouse bindings
|
||||
"Mod+WheelScrollDown" = { action = focus-workspace-down; cooldown-ms = 150; };
|
||||
"Mod+WheelScrollUp" = { action = focus-workspace-up; cooldown-ms = 150; };
|
||||
"Mod+Ctrl+WheelScrollDown" = { action = move-column-to-workspace-down; cooldown-ms = 150; };
|
||||
"Mod+Ctrl+WheelScrollUp" = { action = move-column-to-workspace-up; cooldown-ms = 150; };
|
||||
"Mod+WheelScrollDown" = {
|
||||
action = focus-workspace-down;
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
"Mod+WheelScrollUp" = {
|
||||
action = focus-workspace-up;
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollDown" = {
|
||||
action = move-column-to-workspace-down;
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollUp" = {
|
||||
action = move-column-to-workspace-up;
|
||||
cooldown-ms = 150;
|
||||
};
|
||||
|
||||
"Mod+WheelScrollRight".action = focus-column-right;
|
||||
"Mod+WheelScrollLeft".action = focus-column-left;
|
||||
|
@ -338,26 +478,66 @@ in
|
|||
#
|
||||
# For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on
|
||||
# will all refer to the 3rd workspace.
|
||||
"Mod+1" = lib.mkIf cfg.workspaces."01".fixed { action = focus-workspace (cfg.workspaces."01".name); };
|
||||
"Mod+2" = lib.mkIf cfg.workspaces."02".fixed { action = focus-workspace (cfg.workspaces."02".name); };
|
||||
"Mod+3" = lib.mkIf cfg.workspaces."03".fixed { action = focus-workspace (cfg.workspaces."03".name); };
|
||||
"Mod+4" = lib.mkIf cfg.workspaces."04".fixed { action = focus-workspace (cfg.workspaces."04".name); };
|
||||
"Mod+5" = lib.mkIf cfg.workspaces."05".fixed { action = focus-workspace (cfg.workspaces."05".name); };
|
||||
"Mod+6" = lib.mkIf cfg.workspaces."06".fixed { action = focus-workspace (cfg.workspaces."06".name); };
|
||||
"Mod+7" = lib.mkIf cfg.workspaces."07".fixed { action = focus-workspace (cfg.workspaces."07".name); };
|
||||
"Mod+8" = lib.mkIf cfg.workspaces."08".fixed { action = focus-workspace (cfg.workspaces."08".name); };
|
||||
"Mod+9" = lib.mkIf cfg.workspaces."09".fixed { action = focus-workspace (cfg.workspaces."09".name); };
|
||||
"Mod+0" = lib.mkIf cfg.workspaces."10".fixed { action = focus-workspace (cfg.workspaces."10".name); };
|
||||
"Mod+Shift+1" = lib.mkIf cfg.workspaces."01".fixed { action = move-column-to-workspace (cfg.workspaces."01".name); };
|
||||
"Mod+Shift+2" = lib.mkIf cfg.workspaces."02".fixed { action = move-column-to-workspace (cfg.workspaces."02".name); };
|
||||
"Mod+Shift+3" = lib.mkIf cfg.workspaces."03".fixed { action = move-column-to-workspace (cfg.workspaces."03".name); };
|
||||
"Mod+Shift+4" = lib.mkIf cfg.workspaces."04".fixed { action = move-column-to-workspace (cfg.workspaces."04".name); };
|
||||
"Mod+Shift+5" = lib.mkIf cfg.workspaces."05".fixed { action = move-column-to-workspace (cfg.workspaces."05".name); };
|
||||
"Mod+Shift+6" = lib.mkIf cfg.workspaces."06".fixed { action = move-column-to-workspace (cfg.workspaces."06".name); };
|
||||
"Mod+Shift+7" = lib.mkIf cfg.workspaces."07".fixed { action = move-column-to-workspace (cfg.workspaces."07".name); };
|
||||
"Mod+Shift+8" = lib.mkIf cfg.workspaces."08".fixed { action = move-column-to-workspace (cfg.workspaces."08".name); };
|
||||
"Mod+Shift+9" = lib.mkIf cfg.workspaces."09".fixed { action = move-column-to-workspace (cfg.workspaces."09".name); };
|
||||
"Mod+Shift+0" = lib.mkIf cfg.workspaces."10".fixed { action = move-column-to-workspace (cfg.workspaces."10".name); };
|
||||
"Mod+1" = lib.mkIf cfg.workspaces."01".fixed {
|
||||
action = focus-workspace (cfg.workspaces."01".name);
|
||||
};
|
||||
"Mod+2" = lib.mkIf cfg.workspaces."02".fixed {
|
||||
action = focus-workspace (cfg.workspaces."02".name);
|
||||
};
|
||||
"Mod+3" = lib.mkIf cfg.workspaces."03".fixed {
|
||||
action = focus-workspace (cfg.workspaces."03".name);
|
||||
};
|
||||
"Mod+4" = lib.mkIf cfg.workspaces."04".fixed {
|
||||
action = focus-workspace (cfg.workspaces."04".name);
|
||||
};
|
||||
"Mod+5" = lib.mkIf cfg.workspaces."05".fixed {
|
||||
action = focus-workspace (cfg.workspaces."05".name);
|
||||
};
|
||||
"Mod+6" = lib.mkIf cfg.workspaces."06".fixed {
|
||||
action = focus-workspace (cfg.workspaces."06".name);
|
||||
};
|
||||
"Mod+7" = lib.mkIf cfg.workspaces."07".fixed {
|
||||
action = focus-workspace (cfg.workspaces."07".name);
|
||||
};
|
||||
"Mod+8" = lib.mkIf cfg.workspaces."08".fixed {
|
||||
action = focus-workspace (cfg.workspaces."08".name);
|
||||
};
|
||||
"Mod+9" = lib.mkIf cfg.workspaces."09".fixed {
|
||||
action = focus-workspace (cfg.workspaces."09".name);
|
||||
};
|
||||
"Mod+0" = lib.mkIf cfg.workspaces."10".fixed {
|
||||
action = focus-workspace (cfg.workspaces."10".name);
|
||||
};
|
||||
"Mod+Shift+1" = lib.mkIf cfg.workspaces."01".fixed {
|
||||
action = move-column-to-workspace (cfg.workspaces."01".name);
|
||||
};
|
||||
"Mod+Shift+2" = lib.mkIf cfg.workspaces."02".fixed {
|
||||
action = move-column-to-workspace (cfg.workspaces."02".name);
|
||||
};
|
||||
"Mod+Shift+3" = lib.mkIf cfg.workspaces."03".fixed {
|
||||
action = move-column-to-workspace (cfg.workspaces."03".name);
|
||||
};
|
||||
"Mod+Shift+4" = lib.mkIf cfg.workspaces."04".fixed {
|
||||
action = move-column-to-workspace (cfg.workspaces."04".name);
|
||||
};
|
||||
"Mod+Shift+5" = lib.mkIf cfg.workspaces."05".fixed {
|
||||
action = move-column-to-workspace (cfg.workspaces."05".name);
|
||||
};
|
||||
"Mod+Shift+6" = lib.mkIf cfg.workspaces."06".fixed {
|
||||
action = move-column-to-workspace (cfg.workspaces."06".name);
|
||||
};
|
||||
"Mod+Shift+7" = lib.mkIf cfg.workspaces."07".fixed {
|
||||
action = move-column-to-workspace (cfg.workspaces."07".name);
|
||||
};
|
||||
"Mod+Shift+8" = lib.mkIf cfg.workspaces."08".fixed {
|
||||
action = move-column-to-workspace (cfg.workspaces."08".name);
|
||||
};
|
||||
"Mod+Shift+9" = lib.mkIf cfg.workspaces."09".fixed {
|
||||
action = move-column-to-workspace (cfg.workspaces."09".name);
|
||||
};
|
||||
"Mod+Shift+0" = lib.mkIf cfg.workspaces."10".fixed {
|
||||
action = move-column-to-workspace (cfg.workspaces."10".name);
|
||||
};
|
||||
|
||||
"Mod+asciicircum".action = focus-workspace (cfg.workspaces."99".name);
|
||||
"Mod+Shift+asciicircum".action = move-column-to-workspace (cfg.workspaces."99".name);
|
||||
|
@ -392,4 +572,3 @@ in
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
{ pkgs, lib, options, config, osConfig, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
options,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.my-sway;
|
||||
|
@ -22,12 +29,14 @@ let
|
|||
mail = "📧 Email";
|
||||
};
|
||||
wsAttrs = builtins.listToAttrs (
|
||||
map
|
||||
(i: { name = toString (remainder i 10); value = builtins.elemAt workspaces (i - 1); })
|
||||
(range 1 11)
|
||||
map (i: {
|
||||
name = toString (remainder i 10);
|
||||
value = builtins.elemAt workspaces (i - 1);
|
||||
}) (range 1 11)
|
||||
);
|
||||
remainder = x: y: x - (builtins.div x y) * y;
|
||||
range = from: to:
|
||||
range =
|
||||
from: to:
|
||||
let
|
||||
f = cur: if cur == to then [ ] else [ cur ] ++ f (cur + 1);
|
||||
in
|
||||
|
@ -64,7 +73,10 @@ in
|
|||
default = true;
|
||||
};
|
||||
wallpaper = mkOption {
|
||||
type = types.oneOf [ types.path types.str ];
|
||||
type = types.oneOf [
|
||||
types.path
|
||||
types.str
|
||||
];
|
||||
description = "Path to the wallpaper to be used";
|
||||
default = config.linux.graphical.wallpaper;
|
||||
};
|
||||
|
@ -83,14 +95,20 @@ in
|
|||
lockCmd = mkOption {
|
||||
type = types.str;
|
||||
description = "The screen lock command";
|
||||
default = "${pkgs.swaylock}/bin/swaylock"
|
||||
default =
|
||||
"${pkgs.swaylock}/bin/swaylock"
|
||||
+ (if cfg.wallpaper == "" then "" else " -i ${cfg.wallpaper} -s fill")
|
||||
+ " -l -k";
|
||||
};
|
||||
};
|
||||
|
||||
config.systemd.user.targets.sway-session = mkIf cfg.enable {
|
||||
Unit.Before = [ "tray.target" "xwayland.target" "xdg-desktop-portal.service" "xdg-desktop-autostart.target" ];
|
||||
Unit.Before = [
|
||||
"tray.target"
|
||||
"xwayland.target"
|
||||
"xdg-desktop-portal.service"
|
||||
"xdg-desktop-autostart.target"
|
||||
];
|
||||
Unit.Upholds = [ "waybar.service" ];
|
||||
Unit.Wants = [ "xdg-desktop-autostart.target" ];
|
||||
};
|
||||
|
@ -107,13 +125,16 @@ in
|
|||
enable = true;
|
||||
package = cfg.package;
|
||||
systemd.enable = true;
|
||||
systemd.variables = options.wayland.windowManager.sway.systemd.variables.default ++ [
|
||||
"PATH" # for portals
|
||||
"XDG_DATA_DIRS" # For extra icons
|
||||
"XDG_DATA_HOME" # For extra icons
|
||||
] ++ lib.optionals osConfig.services.desktopManager.plasma6.enable [
|
||||
"XDG_MENU_PREFIX"
|
||||
];
|
||||
systemd.variables =
|
||||
options.wayland.windowManager.sway.systemd.variables.default
|
||||
++ [
|
||||
"PATH" # for portals
|
||||
"XDG_DATA_DIRS" # For extra icons
|
||||
"XDG_DATA_HOME" # For extra icons
|
||||
]
|
||||
++ lib.optionals osConfig.services.desktopManager.plasma6.enable [
|
||||
"XDG_MENU_PREFIX"
|
||||
];
|
||||
# systemd.extraCommands = options.wayland.windowManager.sway.systemd.extraCommands.default
|
||||
# ++ [
|
||||
# "systemctl --user restart xdg-desktop-portal.service"
|
||||
|
@ -137,7 +158,8 @@ in
|
|||
### Seats
|
||||
#
|
||||
# Cursor
|
||||
seat."*".xcursor_theme = "${config.home.pointerCursor.name} ${toString config.home.pointerCursor.size}";
|
||||
seat."*".xcursor_theme =
|
||||
"${config.home.pointerCursor.name} ${toString config.home.pointerCursor.size}";
|
||||
|
||||
### Programs
|
||||
#
|
||||
|
@ -158,110 +180,120 @@ in
|
|||
#
|
||||
# Main modifier
|
||||
modifier = mod;
|
||||
keybindings = {
|
||||
### Default Bindings
|
||||
#
|
||||
## App management
|
||||
"${mod}+Return" = "exec ${swayCfg.config.terminal}";
|
||||
"${mod}+Shift+q" = "kill";
|
||||
"${mod}+d" = "exec ${swayCfg.config.menu}";
|
||||
## Windowing
|
||||
# Focus
|
||||
"${mod}+${swayCfg.config.left}" = "focus left";
|
||||
"${mod}+${swayCfg.config.down}" = "focus down";
|
||||
"${mod}+${swayCfg.config.up}" = "focus up";
|
||||
"${mod}+${swayCfg.config.right}" = "focus right";
|
||||
"${mod}+Left" = "focus left";
|
||||
"${mod}+Down" = "focus down";
|
||||
"${mod}+Up" = "focus up";
|
||||
"${mod}+Right" = "focus right";
|
||||
# Move
|
||||
"${mod}+Shift+${swayCfg.config.left}" = "move left";
|
||||
"${mod}+Shift+${swayCfg.config.down}" = "move down";
|
||||
"${mod}+Shift+${swayCfg.config.up}" = "move up";
|
||||
"${mod}+Shift+${swayCfg.config.right}" = "move right";
|
||||
"${mod}+Shift+Left" = "move left";
|
||||
"${mod}+Shift+Down" = "move down";
|
||||
"${mod}+Shift+Up" = "move up";
|
||||
"${mod}+Shift+Right" = "move right";
|
||||
# Toggles
|
||||
"${mod}+f" = "fullscreen toggle";
|
||||
"${mod}+a" = "focus parent";
|
||||
# Layouts
|
||||
"${mod}+s" = "layout stacking";
|
||||
"${mod}+w" = "layout tabbed";
|
||||
"${mod}+e" = "layout toggle split";
|
||||
# Floating
|
||||
"${mod}+Shift+space" = "floating toggle";
|
||||
# Scratchpad
|
||||
"${mod}+Shift+minus" = "move scratchpad";
|
||||
# Resize
|
||||
"${mod}+r" = "mode resize";
|
||||
"${mod}+minus" = "scratchpad show";
|
||||
## Reload and exit
|
||||
"${mod}+Shift+c" = "reload";
|
||||
"${mod}+Shift+e" =
|
||||
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
|
||||
# Launcher
|
||||
"${mod}+space" = "exec rofi -show drun";
|
||||
"${mod}+tab" = "exec ${./rofi-window.py}";
|
||||
"${mod}+shift+p" = "exec rofi-rbw-script";
|
||||
} // {
|
||||
## Splits
|
||||
"${mod}+v" = "split v";
|
||||
"${mod}+Shift+v" = "split h";
|
||||
## Run
|
||||
"${mod}+r" = "exec ${config.wayland.windowManager.sway.config.menu}";
|
||||
"${mod}+Shift+r" = "mode resize";
|
||||
## Screenshot
|
||||
"Print" = "exec ${screenshotScript}/bin/screenshot";
|
||||
"Shift+Print" = "exec ${screenshotEditScript}/bin/screenshot";
|
||||
## Locking
|
||||
"${mod}+semicolon" = "exec ${cfg.lockCmd}";
|
||||
## Multimedia
|
||||
"XF86AudioPrev" = "exec ${playerctl} previous";
|
||||
"XF86AudioPlay" = "exec ${playerctl} play-pause";
|
||||
"Shift+XF86AudioPlay" = "exec ${playerctl} stop";
|
||||
"XF86AudioNext" = "exec ${playerctl} next";
|
||||
"XF86AudioRecord" = "exec ${pkgs.alsa-utils}/bin/amixer -q set Capture toggle";
|
||||
"XF86AudioMute" = "exec ${pkgs.alsa-utils}/bin/amixer -q set Master toggle";
|
||||
"XF86AudioLowerVolume" = "exec ${pkgs.alsa-utils}/bin/amixer -q set Master 3%-";
|
||||
"XF86AudioRaiseVolume" = "exec ${pkgs.alsa-utils}/bin/amixer -q set Master 3%+";
|
||||
## Backlight
|
||||
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 10%-";
|
||||
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 10%+";
|
||||
"Shift+XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -d kbd_backlight s 25%-";
|
||||
"Shift+XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -d kbd_backlight s 25%+";
|
||||
} //
|
||||
# Map the workspaces
|
||||
(builtins.listToAttrs (lib.flatten (map
|
||||
(key: [
|
||||
keybindings =
|
||||
{
|
||||
### Default Bindings
|
||||
#
|
||||
## App management
|
||||
"${mod}+Return" = "exec ${swayCfg.config.terminal}";
|
||||
"${mod}+Shift+q" = "kill";
|
||||
"${mod}+d" = "exec ${swayCfg.config.menu}";
|
||||
## Windowing
|
||||
# Focus
|
||||
"${mod}+${swayCfg.config.left}" = "focus left";
|
||||
"${mod}+${swayCfg.config.down}" = "focus down";
|
||||
"${mod}+${swayCfg.config.up}" = "focus up";
|
||||
"${mod}+${swayCfg.config.right}" = "focus right";
|
||||
"${mod}+Left" = "focus left";
|
||||
"${mod}+Down" = "focus down";
|
||||
"${mod}+Up" = "focus up";
|
||||
"${mod}+Right" = "focus right";
|
||||
# Move
|
||||
"${mod}+Shift+${swayCfg.config.left}" = "move left";
|
||||
"${mod}+Shift+${swayCfg.config.down}" = "move down";
|
||||
"${mod}+Shift+${swayCfg.config.up}" = "move up";
|
||||
"${mod}+Shift+${swayCfg.config.right}" = "move right";
|
||||
"${mod}+Shift+Left" = "move left";
|
||||
"${mod}+Shift+Down" = "move down";
|
||||
"${mod}+Shift+Up" = "move up";
|
||||
"${mod}+Shift+Right" = "move right";
|
||||
# Toggles
|
||||
"${mod}+f" = "fullscreen toggle";
|
||||
"${mod}+a" = "focus parent";
|
||||
# Layouts
|
||||
"${mod}+s" = "layout stacking";
|
||||
"${mod}+w" = "layout tabbed";
|
||||
"${mod}+e" = "layout toggle split";
|
||||
# Floating
|
||||
"${mod}+Shift+space" = "floating toggle";
|
||||
# Scratchpad
|
||||
"${mod}+Shift+minus" = "move scratchpad";
|
||||
# Resize
|
||||
"${mod}+r" = "mode resize";
|
||||
"${mod}+minus" = "scratchpad show";
|
||||
## Reload and exit
|
||||
"${mod}+Shift+c" = "reload";
|
||||
"${mod}+Shift+e" =
|
||||
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
|
||||
# Launcher
|
||||
"${mod}+space" = "exec rofi -show drun";
|
||||
"${mod}+tab" = "exec ${./rofi-window.py}";
|
||||
"${mod}+shift+p" = "exec rofi-rbw-script";
|
||||
}
|
||||
// {
|
||||
## Splits
|
||||
"${mod}+v" = "split v";
|
||||
"${mod}+Shift+v" = "split h";
|
||||
## Run
|
||||
"${mod}+r" = "exec ${config.wayland.windowManager.sway.config.menu}";
|
||||
"${mod}+Shift+r" = "mode resize";
|
||||
## Screenshot
|
||||
"Print" = "exec ${screenshotScript}/bin/screenshot";
|
||||
"Shift+Print" = "exec ${screenshotEditScript}/bin/screenshot";
|
||||
## Locking
|
||||
"${mod}+semicolon" = "exec ${cfg.lockCmd}";
|
||||
## Multimedia
|
||||
"XF86AudioPrev" = "exec ${playerctl} previous";
|
||||
"XF86AudioPlay" = "exec ${playerctl} play-pause";
|
||||
"Shift+XF86AudioPlay" = "exec ${playerctl} stop";
|
||||
"XF86AudioNext" = "exec ${playerctl} next";
|
||||
"XF86AudioRecord" = "exec ${pkgs.alsa-utils}/bin/amixer -q set Capture toggle";
|
||||
"XF86AudioMute" = "exec ${pkgs.alsa-utils}/bin/amixer -q set Master toggle";
|
||||
"XF86AudioLowerVolume" = "exec ${pkgs.alsa-utils}/bin/amixer -q set Master 3%-";
|
||||
"XF86AudioRaiseVolume" = "exec ${pkgs.alsa-utils}/bin/amixer -q set Master 3%+";
|
||||
## Backlight
|
||||
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 10%-";
|
||||
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 10%+";
|
||||
"Shift+XF86MonBrightnessDown" =
|
||||
"exec ${pkgs.brightnessctl}/bin/brightnessctl -d kbd_backlight s 25%-";
|
||||
"Shift+XF86MonBrightnessUp" =
|
||||
"exec ${pkgs.brightnessctl}/bin/brightnessctl -d kbd_backlight s 25%+";
|
||||
}
|
||||
//
|
||||
# Map the workspaces
|
||||
(builtins.listToAttrs (
|
||||
lib.flatten (
|
||||
map (key: [
|
||||
{
|
||||
name = "${mod}+${key}";
|
||||
value = "workspace ${builtins.getAttr key wsAttrs}";
|
||||
}
|
||||
{
|
||||
name = "${mod}+Shift+${key}";
|
||||
value = "move to workspace ${builtins.getAttr key wsAttrs}";
|
||||
}
|
||||
]) (builtins.attrNames wsAttrs)
|
||||
)
|
||||
))
|
||||
// {
|
||||
# Extra workspaces
|
||||
"${mod}+asciicircum" = "workspace ${extraWorkspaces.mail}";
|
||||
"${mod}+shift+asciicircum" = "move to workspace ${extraWorkspaces.mail}";
|
||||
}
|
||||
//
|
||||
# Move workspaces between outputs
|
||||
{
|
||||
name = "${mod}+${key}";
|
||||
value = "workspace ${builtins.getAttr key wsAttrs}";
|
||||
}
|
||||
{
|
||||
name = "${mod}+Shift+${key}";
|
||||
value = "move to workspace ${builtins.getAttr key wsAttrs}";
|
||||
}
|
||||
])
|
||||
(builtins.attrNames wsAttrs))
|
||||
)) //
|
||||
{
|
||||
# Extra workspaces
|
||||
"${mod}+asciicircum" = "workspace ${extraWorkspaces.mail}";
|
||||
"${mod}+shift+asciicircum" = "move to workspace ${extraWorkspaces.mail}";
|
||||
} //
|
||||
# Move workspaces between outputs
|
||||
{
|
||||
"${mod}+ctrl+h" = "move workspace to output left";
|
||||
"${mod}+ctrl+l" = "move workspace to output right";
|
||||
};
|
||||
"${mod}+ctrl+h" = "move workspace to output left";
|
||||
"${mod}+ctrl+l" = "move workspace to output right";
|
||||
};
|
||||
|
||||
### Fonts
|
||||
#
|
||||
fonts = {
|
||||
names = [ "monospace" "FontAwesome5Free" ];
|
||||
names = [
|
||||
"monospace"
|
||||
"FontAwesome5Free"
|
||||
];
|
||||
size = cfg.fontSize;
|
||||
};
|
||||
|
||||
|
@ -298,21 +330,31 @@ in
|
|||
];
|
||||
};
|
||||
# Commands
|
||||
window.commands = [
|
||||
{ criteria = { title = ".*"; }; command = "inhibit_idle fullscreen"; }
|
||||
] ++ (
|
||||
# Floating assignments
|
||||
let
|
||||
criterias = [
|
||||
{ app_id = ".*float.*"; }
|
||||
{ app_id = "org\\.freedesktop\\.impl\\.portal\\.desktop\\..*"; }
|
||||
{ class = ".*float.*"; }
|
||||
{ title = "Extension: .*Bitwarden.*"; }
|
||||
];
|
||||
toCommand = criteria: { inherit criteria; command = "floating enable"; };
|
||||
in
|
||||
map toCommand criterias
|
||||
);
|
||||
window.commands =
|
||||
[
|
||||
{
|
||||
criteria = {
|
||||
title = ".*";
|
||||
};
|
||||
command = "inhibit_idle fullscreen";
|
||||
}
|
||||
]
|
||||
++ (
|
||||
# Floating assignments
|
||||
let
|
||||
criterias = [
|
||||
{ app_id = ".*float.*"; }
|
||||
{ app_id = "org\\.freedesktop\\.impl\\.portal\\.desktop\\..*"; }
|
||||
{ class = ".*float.*"; }
|
||||
{ title = "Extension: .*Bitwarden.*"; }
|
||||
];
|
||||
toCommand = criteria: {
|
||||
inherit criteria;
|
||||
command = "floating enable";
|
||||
};
|
||||
in
|
||||
map toCommand criterias
|
||||
);
|
||||
# Focus
|
||||
focus.followMouse = true;
|
||||
focus.mouseWarping = true;
|
||||
|
@ -334,36 +376,50 @@ in
|
|||
# swaynag
|
||||
swaynag.enable = true;
|
||||
# Environment Variables
|
||||
extraSessionCommands = ''
|
||||
export QT_QPA_PLATFORM=wayland
|
||||
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
|
||||
export QT_IM_MODULE=fcitx
|
||||
export GTK_IM_MODULE=fcitx # Til text-input is merged
|
||||
# export NIXOS_OZONE_WL=1 # Until text-input is merged
|
||||
extraSessionCommands =
|
||||
''
|
||||
export QT_QPA_PLATFORM=wayland
|
||||
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
|
||||
export QT_IM_MODULE=fcitx
|
||||
export GTK_IM_MODULE=fcitx # Til text-input is merged
|
||||
# export NIXOS_OZONE_WL=1 # Until text-input is merged
|
||||
|
||||
'' + (if config.services.gnome-keyring.enable then ''
|
||||
# gnome-keyring
|
||||
if type gnome-keyring-daemon >/dev/null; then
|
||||
eval `gnome-keyring-daemon`
|
||||
export SSH_AUTH_SOCK
|
||||
fi
|
||||
'' else "") + lib.optionalString osConfig.services.desktopManager.plasma6.enable ''
|
||||
export XDG_MENU_PREFIX=plasma-
|
||||
'';
|
||||
''
|
||||
+ (
|
||||
if config.services.gnome-keyring.enable then
|
||||
''
|
||||
# gnome-keyring
|
||||
if type gnome-keyring-daemon >/dev/null; then
|
||||
eval `gnome-keyring-daemon`
|
||||
export SSH_AUTH_SOCK
|
||||
fi
|
||||
''
|
||||
else
|
||||
""
|
||||
)
|
||||
+ lib.optionalString osConfig.services.desktopManager.plasma6.enable ''
|
||||
export XDG_MENU_PREFIX=plasma-
|
||||
'';
|
||||
# Extra
|
||||
wrapperFeatures.base = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
|
||||
extraConfig =
|
||||
(if cfg.enableLaptop then ''
|
||||
# Lock screen on lid close
|
||||
bindswitch lid:off exec ${cfg.lockCmd}
|
||||
(
|
||||
if cfg.enableLaptop then
|
||||
''
|
||||
# Lock screen on lid close
|
||||
bindswitch lid:off exec ${cfg.lockCmd}
|
||||
|
||||
# Gesture bindings
|
||||
bindgesture swipe:3:right workspace prev
|
||||
bindgesture swipe:3:left workspace next
|
||||
bindgesture swipe:3:up exec ${./rofi-window.py}
|
||||
'' else "") + ''
|
||||
# Gesture bindings
|
||||
bindgesture swipe:3:right workspace prev
|
||||
bindgesture swipe:3:left workspace next
|
||||
bindgesture swipe:3:up exec ${./rofi-window.py}
|
||||
''
|
||||
else
|
||||
""
|
||||
)
|
||||
+ ''
|
||||
## swayfx stuff
|
||||
# Rounded corners
|
||||
corner_radius 5
|
||||
|
@ -378,10 +434,10 @@ in
|
|||
# Blur
|
||||
for_window [app_id=".*kitty.*"] blur enable
|
||||
blur_xray disable
|
||||
'' + ''
|
||||
''
|
||||
+ ''
|
||||
# Enable portal stuff
|
||||
exec ${pkgs.writeShellScript "start-portals.sh" ''
|
||||
''}
|
||||
exec ${pkgs.writeShellScript "start-portals.sh" ''''}
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -393,20 +449,28 @@ in
|
|||
# { timeout = 15 * 60; command = cfg.lockCmd; }
|
||||
];
|
||||
events = [
|
||||
{ event = "lock"; command = cfg.lockCmd; }
|
||||
{ event = "before-sleep"; command = cfg.lockCmd; }
|
||||
{
|
||||
event = "lock";
|
||||
command = cfg.lockCmd;
|
||||
}
|
||||
{
|
||||
event = "before-sleep";
|
||||
command = cfg.lockCmd;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
config.home.packages = mkIf cfg.enable (with pkgs; [
|
||||
# Needed for QT_QPA_PLATFORM
|
||||
kdePackages.qtwayland
|
||||
# For waybar
|
||||
font-awesome
|
||||
]);
|
||||
config.home.packages = mkIf cfg.enable (
|
||||
with pkgs;
|
||||
[
|
||||
# Needed for QT_QPA_PLATFORM
|
||||
kdePackages.qtwayland
|
||||
# For waybar
|
||||
font-awesome
|
||||
]
|
||||
);
|
||||
|
||||
config.programs.rofi = mkIf cfg.enable {
|
||||
font = lib.mkForce "monospace ${toString cfg.fontSize}";
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.my-sway;
|
||||
|
@ -6,15 +11,22 @@ let
|
|||
# Set up an ibus script
|
||||
ibusNext = (
|
||||
let
|
||||
input-methods = [ "xkb:us::eng" "mozc-jp" "Bamboo" ];
|
||||
next = m:
|
||||
input-methods = [
|
||||
"xkb:us::eng"
|
||||
"mozc-jp"
|
||||
"Bamboo"
|
||||
];
|
||||
next =
|
||||
m:
|
||||
let
|
||||
nextRec = l:
|
||||
if (length l == 1)
|
||||
then head input-methods
|
||||
else if (m == head l)
|
||||
then (head (tail l))
|
||||
else nextRec (tail l);
|
||||
nextRec =
|
||||
l:
|
||||
if (length l == 1) then
|
||||
head input-methods
|
||||
else if (m == head l) then
|
||||
(head (tail l))
|
||||
else
|
||||
nextRec (tail l);
|
||||
in
|
||||
nextRec input-methods;
|
||||
changeTo = m: ''
|
||||
|
@ -52,4 +64,3 @@ in
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.my-waybar;
|
||||
in
|
||||
|
@ -47,382 +52,418 @@ in
|
|||
};
|
||||
config.programs.waybar =
|
||||
let
|
||||
barWith = { showMedia ? true, showConnectivity ? true, extraSettings ? { }, ... }: lib.mkMerge ([{
|
||||
layer = "top";
|
||||
position = "top";
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/mode"
|
||||
"sway/window"
|
||||
"niri/workspaces"
|
||||
"niri/window"
|
||||
];
|
||||
modules-center = [
|
||||
];
|
||||
modules-right =
|
||||
lib.optional showMedia (if cfg.enableMpd then "mpd" else "custom/media")
|
||||
++ [
|
||||
"tray"
|
||||
"pulseaudio"
|
||||
] ++ lib.optionals showConnectivity [
|
||||
"bluetooth"
|
||||
"network"
|
||||
] ++ [
|
||||
"cpu"
|
||||
"memory"
|
||||
"temperature"
|
||||
] ++ lib.optionals cfg.enableLaptopBars [ "battery" "battery#bat2" ]
|
||||
++ [
|
||||
"clock"
|
||||
];
|
||||
barWith =
|
||||
{
|
||||
showMedia ? true,
|
||||
showConnectivity ? true,
|
||||
extraSettings ? { },
|
||||
...
|
||||
}:
|
||||
lib.mkMerge (
|
||||
[
|
||||
{
|
||||
layer = "top";
|
||||
position = "top";
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/mode"
|
||||
"sway/window"
|
||||
"niri/workspaces"
|
||||
"niri/window"
|
||||
];
|
||||
modules-center = [
|
||||
];
|
||||
modules-right =
|
||||
lib.optional showMedia (if cfg.enableMpd then "mpd" else "custom/media")
|
||||
++ [
|
||||
"tray"
|
||||
"pulseaudio"
|
||||
]
|
||||
++ lib.optionals showConnectivity [
|
||||
"bluetooth"
|
||||
"network"
|
||||
]
|
||||
++ [
|
||||
"cpu"
|
||||
"memory"
|
||||
"temperature"
|
||||
]
|
||||
++ lib.optionals cfg.enableLaptopBars [
|
||||
"battery"
|
||||
"battery#bat2"
|
||||
]
|
||||
++ [
|
||||
"clock"
|
||||
];
|
||||
|
||||
modules = {
|
||||
"sway/workspaces" = {
|
||||
format = "{name}";
|
||||
};
|
||||
"sway/mode" = {
|
||||
format = "<span style=\"italic\">{}</span>";
|
||||
};
|
||||
"sway/window" = {
|
||||
max-length = 70;
|
||||
format = "{title}";
|
||||
"rewrite" = {
|
||||
"(.*) — Mozilla Firefox" = "[🌎] $1";
|
||||
"(.*) - Mozilla Thunderbird" = "[📧] $1";
|
||||
"(.*) - Kakoune" = "[⌨️] $1";
|
||||
"(.*) - fish" = "[>_] $1";
|
||||
"(.*) - Discord" = "[🗨️] $1";
|
||||
# ArmCord thing
|
||||
"• Discord \\| (.*)" = "[🗨️] $1";
|
||||
"\\((\\d+)\\) Discord \\| (.*)" = "[🗨️] {$1} $2";
|
||||
};
|
||||
};
|
||||
"niri/window" = {
|
||||
format = "{title}";
|
||||
"rewrite" = {
|
||||
"(.*) — Mozilla Firefox" = "[🌎] $1";
|
||||
"(.*) - Mozilla Thunderbird" = "[📧] $1";
|
||||
"(.*) - Kakoune" = "[⌨️] $1";
|
||||
"(.*) - fish" = "[>_] $1";
|
||||
"(.*) - Discord" = "[🗨️] $1";
|
||||
# ArmCord thing
|
||||
"• Discord \\| (.*)" = "[🗨️] $1";
|
||||
"\\((\\d+)\\) Discord \\| (.*)" = "[🗨️] {$1} $2";
|
||||
};
|
||||
};
|
||||
"tray" = {
|
||||
icon-size = 21;
|
||||
spacing = 10;
|
||||
};
|
||||
"clock" = {
|
||||
# format = "{:📅 %Y-%m-%d | 🕰️ %H:%M [%Z]}";
|
||||
format = "📅 {0:%Y-%m-%d} |️ 🕰️ {0:%H:%M [%Z]}";
|
||||
tooltip-format = "\n<span size='9pt' font_family='Noto Sans Mono CJK JP'>{calendar}</span>";
|
||||
timezones = [
|
||||
"Europe/Zurich"
|
||||
"America/Toronto"
|
||||
"Asia/Tokyo"
|
||||
"Asia/Ho_Chi_Minh"
|
||||
];
|
||||
calendar = {
|
||||
mode = "year";
|
||||
mode-mon-col = 3;
|
||||
weeks-pos = "right";
|
||||
on-scroll = 1;
|
||||
on-click-right = "mode";
|
||||
format = {
|
||||
months = "<span color='#ffead3'><b>{}</b></span>";
|
||||
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
||||
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
|
||||
weekdays = "<span color='#ffcc66'><b>日 月 火 水 木 金 土</b></span>"; # See https://github.com/Alexays/Waybar/issues/3132
|
||||
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
|
||||
modules = {
|
||||
"sway/workspaces" = {
|
||||
format = "{name}";
|
||||
};
|
||||
"sway/mode" = {
|
||||
format = "<span style=\"italic\">{}</span>";
|
||||
};
|
||||
"sway/window" = {
|
||||
max-length = 70;
|
||||
format = "{title}";
|
||||
"rewrite" = {
|
||||
"(.*) — Mozilla Firefox" = "[🌎] $1";
|
||||
"(.*) - Mozilla Thunderbird" = "[📧] $1";
|
||||
"(.*) - Kakoune" = "[⌨️] $1";
|
||||
"(.*) - fish" = "[>_] $1";
|
||||
"(.*) - Discord" = "[🗨️] $1";
|
||||
# ArmCord thing
|
||||
"• Discord \\| (.*)" = "[🗨️] $1";
|
||||
"\\((\\d+)\\) Discord \\| (.*)" = "[🗨️] {$1} $2";
|
||||
};
|
||||
};
|
||||
"niri/window" = {
|
||||
format = "{title}";
|
||||
"rewrite" = {
|
||||
"(.*) — Mozilla Firefox" = "[🌎] $1";
|
||||
"(.*) - Mozilla Thunderbird" = "[📧] $1";
|
||||
"(.*) - Kakoune" = "[⌨️] $1";
|
||||
"(.*) - fish" = "[>_] $1";
|
||||
"(.*) - Discord" = "[🗨️] $1";
|
||||
# ArmCord thing
|
||||
"• Discord \\| (.*)" = "[🗨️] $1";
|
||||
"\\((\\d+)\\) Discord \\| (.*)" = "[🗨️] {$1} $2";
|
||||
};
|
||||
};
|
||||
"tray" = {
|
||||
icon-size = 21;
|
||||
spacing = 10;
|
||||
};
|
||||
"clock" = {
|
||||
# format = "{:📅 %Y-%m-%d | 🕰️ %H:%M [%Z]}";
|
||||
format = "📅 {0:%Y-%m-%d} |️ 🕰️ {0:%H:%M [%Z]}";
|
||||
tooltip-format = "\n<span size='9pt' font_family='Noto Sans Mono CJK JP'>{calendar}</span>";
|
||||
timezones = [
|
||||
"Europe/Zurich"
|
||||
"America/Toronto"
|
||||
"Asia/Tokyo"
|
||||
"Asia/Ho_Chi_Minh"
|
||||
];
|
||||
calendar = {
|
||||
mode = "year";
|
||||
mode-mon-col = 3;
|
||||
weeks-pos = "right";
|
||||
on-scroll = 1;
|
||||
on-click-right = "mode";
|
||||
format = {
|
||||
months = "<span color='#ffead3'><b>{}</b></span>";
|
||||
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
||||
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
|
||||
weekdays = "<span color='#ffcc66'><b>日 月 火 水 木 金 土</b></span>"; # See https://github.com/Alexays/Waybar/issues/3132
|
||||
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
|
||||
};
|
||||
};
|
||||
actions = {
|
||||
on-click-middle = "mode";
|
||||
on-click-right = "tz_up";
|
||||
on-scroll-up = "shift_up";
|
||||
on-scroll-down = "shift_down";
|
||||
};
|
||||
};
|
||||
"cpu" = {
|
||||
format = "{usage}% ";
|
||||
};
|
||||
"memory" = {
|
||||
format = "{}% ";
|
||||
};
|
||||
"temperature" = {
|
||||
# thermal-zone = 2;
|
||||
# hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input";
|
||||
critical-threshold = 80;
|
||||
# format-critical = "{temperatureC}°C ";
|
||||
format = "{temperatureC}°C ";
|
||||
};
|
||||
"backlight" = {
|
||||
# device = "acpi_video1";
|
||||
format = "{percent}% {icon}";
|
||||
states = [
|
||||
0
|
||||
50
|
||||
];
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
"battery" = lib.mkIf cfg.enableLaptopBars {
|
||||
states = {
|
||||
good = 95;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{capacity}% {icon}";
|
||||
# format-good = ""; # An empty format will hide the module
|
||||
# format-full = "";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
"battery#bat2" = lib.mkIf cfg.enableLaptopBars {
|
||||
bat = "BAT2";
|
||||
};
|
||||
"network" = {
|
||||
# interface = wlp2s0 # (Optional) To force the use of this interface
|
||||
format-wifi = "{essid} ({signalStrength}%) ";
|
||||
format-ethernet = "{ifname} ";
|
||||
format-disconnected = "Disconnected ⚠";
|
||||
interval = 7;
|
||||
on-click = "${cfg.terminal} ${lib.getExe' pkgs.iwd "iwctl"}";
|
||||
};
|
||||
"bluetooth" = {
|
||||
format = " {status}";
|
||||
format-connected = " {device_alias}";
|
||||
format-connected-battery = " {device_alias} {device_battery_percentage}%";
|
||||
# format-device-preference= [ "device1", "device2" ], // preference list deciding the displayed devic;
|
||||
tooltip-format = "{controller_alias}\t{controller_address}\n\n{num_connections} connected";
|
||||
tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}";
|
||||
tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
|
||||
tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%";
|
||||
on-click = "${pkgs.blueman}/bin/blueman-manager";
|
||||
};
|
||||
"pulseaudio" = {
|
||||
# scroll-step = 1;
|
||||
format = "{volume}% {icon}";
|
||||
format-bluetooth = "{volume}% {icon}";
|
||||
format-muted = "";
|
||||
format-icons = {
|
||||
headphones = "";
|
||||
handsfree = "";
|
||||
headset = "";
|
||||
phone = "";
|
||||
portable = "";
|
||||
car = "";
|
||||
default = [
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
};
|
||||
"mpd" = {
|
||||
"format" =
|
||||
"{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) 🎧";
|
||||
"format-disconnected" = "Disconnected 🎧";
|
||||
"format-stopped" = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped 🎧";
|
||||
"interval" = 2;
|
||||
"consume-icons" = {
|
||||
"on" = " "; # Icon shows only when "consume" is on
|
||||
};
|
||||
"random-icons" = {
|
||||
"off" = "<span color=\"#f53c3c\"></span> "; # Icon grayed out when "random" is off;
|
||||
"on" = " ";
|
||||
};
|
||||
"repeat-icons" = {
|
||||
"on" = " ";
|
||||
};
|
||||
"single-icons" = {
|
||||
"on" = "1 ";
|
||||
};
|
||||
"state-icons" = {
|
||||
"paused" = "";
|
||||
"playing" = "";
|
||||
};
|
||||
"tooltip-format" = "MPD (connected)";
|
||||
"tooltip-format-disconnected" = "MPD (disconnected)";
|
||||
"on-click" = "${pkgs.mpc_cli}/bin/mpc toggle";
|
||||
"on-click-right" = "${pkgs.mpc_cli}/bin/mpc stop";
|
||||
"on-click-middle" = "${cfg.terminal} --class=kitty_ncmpcpp ${pkgs.ncmpcpp}/bin/ncmpcpp";
|
||||
};
|
||||
"custom/media" = {
|
||||
"format" = "{icon}{}";
|
||||
"return-type" = "json";
|
||||
"format-icons" = {
|
||||
"Playing" = " ";
|
||||
"Paused" = " ";
|
||||
};
|
||||
"max-length" = 80;
|
||||
"exec" =
|
||||
"${lib.getExe pkgs.playerctl} -a metadata --format '{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F";
|
||||
"on-click" = "${lib.getExe pkgs.playerctl} play-pause";
|
||||
};
|
||||
};
|
||||
};
|
||||
actions = {
|
||||
on-click-middle = "mode";
|
||||
on-click-right = "tz_up";
|
||||
on-scroll-up = "shift_up";
|
||||
on-scroll-down = "shift_down";
|
||||
};
|
||||
};
|
||||
"cpu" = {
|
||||
format = "{usage}% ";
|
||||
};
|
||||
"memory" = {
|
||||
format = "{}% ";
|
||||
};
|
||||
"temperature" = {
|
||||
# thermal-zone = 2;
|
||||
# hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input";
|
||||
critical-threshold = 80;
|
||||
# format-critical = "{temperatureC}°C ";
|
||||
format = "{temperatureC}°C ";
|
||||
};
|
||||
"backlight" = {
|
||||
# device = "acpi_video1";
|
||||
format = "{percent}% {icon}";
|
||||
states = [ 0 50 ];
|
||||
format-icons = [ "" "" ];
|
||||
};
|
||||
"battery" = lib.mkIf cfg.enableLaptopBars {
|
||||
states = {
|
||||
good = 95;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{capacity}% {icon}";
|
||||
# format-good = ""; # An empty format will hide the module
|
||||
# format-full = "";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
};
|
||||
"battery#bat2" = lib.mkIf cfg.enableLaptopBars {
|
||||
bat = "BAT2";
|
||||
};
|
||||
"network" = {
|
||||
# interface = wlp2s0 # (Optional) To force the use of this interface
|
||||
format-wifi = "{essid} ({signalStrength}%) ";
|
||||
format-ethernet = "{ifname} ";
|
||||
format-disconnected = "Disconnected ⚠";
|
||||
interval = 7;
|
||||
on-click = "${cfg.terminal} ${lib.getExe' pkgs.iwd "iwctl"}";
|
||||
};
|
||||
"bluetooth" = {
|
||||
format = " {status}";
|
||||
format-connected = " {device_alias}";
|
||||
format-connected-battery = " {device_alias} {device_battery_percentage}%";
|
||||
# format-device-preference= [ "device1", "device2" ], // preference list deciding the displayed devic;
|
||||
tooltip-format = "{controller_alias}\t{controller_address}\n\n{num_connections} connected";
|
||||
tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}";
|
||||
tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
|
||||
tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%";
|
||||
on-click = "${pkgs.blueman}/bin/blueman-manager";
|
||||
};
|
||||
"pulseaudio" = {
|
||||
# scroll-step = 1;
|
||||
format = "{volume}% {icon}";
|
||||
format-bluetooth = "{volume}% {icon}";
|
||||
format-muted = "";
|
||||
format-icons = {
|
||||
headphones = "";
|
||||
handsfree = "";
|
||||
headset = "";
|
||||
phone = "";
|
||||
portable = "";
|
||||
car = "";
|
||||
default = [ "" "" ];
|
||||
};
|
||||
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
};
|
||||
"mpd" = {
|
||||
"format" = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) 🎧";
|
||||
"format-disconnected" = "Disconnected 🎧";
|
||||
"format-stopped" = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped 🎧";
|
||||
"interval" = 2;
|
||||
"consume-icons" = {
|
||||
"on" = " "; # Icon shows only when "consume" is on
|
||||
};
|
||||
"random-icons" = {
|
||||
"off" = "<span color=\"#f53c3c\"></span> "; # Icon grayed out when "random" is off;
|
||||
"on" = " ";
|
||||
};
|
||||
"repeat-icons" = {
|
||||
"on" = " ";
|
||||
};
|
||||
"single-icons" = {
|
||||
"on" = "1 ";
|
||||
};
|
||||
"state-icons" = {
|
||||
"paused" = "";
|
||||
"playing" = "";
|
||||
};
|
||||
"tooltip-format" = "MPD (connected)";
|
||||
"tooltip-format-disconnected" = "MPD (disconnected)";
|
||||
"on-click" = "${pkgs.mpc_cli}/bin/mpc toggle";
|
||||
"on-click-right" = "${pkgs.mpc_cli}/bin/mpc stop";
|
||||
"on-click-middle" = "${cfg.terminal} --class=kitty_ncmpcpp ${pkgs.ncmpcpp}/bin/ncmpcpp";
|
||||
};
|
||||
"custom/media" = {
|
||||
"format" = "{icon}{}";
|
||||
"return-type" = "json";
|
||||
"format-icons" = {
|
||||
"Playing" = " ";
|
||||
"Paused" = " ";
|
||||
};
|
||||
"max-length" = 80;
|
||||
"exec" = "${lib.getExe pkgs.playerctl} -a metadata --format '{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F";
|
||||
"on-click" = "${lib.getExe pkgs.playerctl} play-pause";
|
||||
};
|
||||
};
|
||||
}] ++
|
||||
cfg.extraSettings
|
||||
++ [ extraSettings ]);
|
||||
}
|
||||
]
|
||||
++ cfg.extraSettings
|
||||
++ [ extraSettings ]
|
||||
);
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
systemd.target = "sway-session.target";
|
||||
settings = cfg.makeBars barWith;
|
||||
style = ''
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: monospace, 'Font Awesome 5', 'Symbols Nerd Font Mono', 'SFNS Display', Helvetica, Arial, sans-serif;
|
||||
font-size: ${toString (cfg.fontSize * 1.1)}px;
|
||||
min-height: 0;
|
||||
}
|
||||
style =
|
||||
''
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: monospace, 'Font Awesome 5', 'Symbols Nerd Font Mono', 'SFNS Display', Helvetica, Arial, sans-serif;
|
||||
font-size: ${toString (cfg.fontSize * 1.1)}px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: rgba(43, 48, 59, 0.8);
|
||||
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
|
||||
color: #ffffff;
|
||||
}
|
||||
window#waybar {
|
||||
background: rgba(43, 48, 59, 0.8);
|
||||
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.0;
|
||||
}
|
||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background: transparent;
|
||||
color: #ffffff;
|
||||
border-bottom: 3px solid transparent;
|
||||
}
|
||||
window#waybar.hidden {
|
||||
opacity: 0.0;
|
||||
}
|
||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background: transparent;
|
||||
color: #ffffff;
|
||||
border-bottom: 3px solid transparent;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
background: #64727D;
|
||||
border-bottom: 3px solid #ffffff;
|
||||
}
|
||||
#workspaces button.focused {
|
||||
background: #64727D;
|
||||
border-bottom: 3px solid #ffffff;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
#workspaces button.urgent {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#window, #sway, #sway-window {
|
||||
padding-left: 1em;
|
||||
margin-bottom: 0.4em;
|
||||
}
|
||||
#window, #sway, #sway-window {
|
||||
padding-left: 1em;
|
||||
margin-bottom: 0.4em;
|
||||
}
|
||||
|
||||
#mode {
|
||||
background: #64727D;
|
||||
border-bottom: 3px solid #ffffff;
|
||||
}
|
||||
#mode {
|
||||
background: #64727D;
|
||||
border-bottom: 3px solid #ffffff;
|
||||
}
|
||||
|
||||
/* #clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #bluetooth, #custom-media, #tray, #mode, #idle_inhibitor, #mpd { */
|
||||
.modules-right > * > * {
|
||||
margin: 0.2em 0 0.4em 0;
|
||||
padding: 0.2em 0.5em;
|
||||
border: 1px solid rgba(0, 0, 0, 0.25);
|
||||
border-radius: 0.3em;
|
||||
}
|
||||
/* #clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #bluetooth, #custom-media, #tray, #mode, #idle_inhibitor, #mpd { */
|
||||
.modules-right > * > * {
|
||||
margin: 0.2em 0 0.4em 0;
|
||||
padding: 0.2em 0.5em;
|
||||
border: 1px solid rgba(0, 0, 0, 0.25);
|
||||
border-radius: 0.3em;
|
||||
}
|
||||
|
||||
.modules-right > *:not(:last-child) > * {
|
||||
margin-right: 0.4em;
|
||||
}
|
||||
.modules-right > *:not(:last-child) > * {
|
||||
margin-right: 0.4em;
|
||||
}
|
||||
|
||||
#clock {
|
||||
background-color: #64727D;
|
||||
}
|
||||
#clock {
|
||||
background-color: #64727D;
|
||||
}
|
||||
|
||||
#battery {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
#battery {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#battery.charging {
|
||||
color: #ffffff;
|
||||
background-color: #26A65B;
|
||||
}
|
||||
#battery.charging {
|
||||
color: #ffffff;
|
||||
background-color: #26A65B;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background: #f53c3c;
|
||||
color: #ffffff;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
#battery.critical:not(.charging) {
|
||||
background: #f53c3c;
|
||||
color: #ffffff;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
background: #2ecc71;
|
||||
color: #000000;
|
||||
}
|
||||
#cpu {
|
||||
background: #2ecc71;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#memory {
|
||||
background: #9b59b6;
|
||||
}
|
||||
#memory {
|
||||
background: #9b59b6;
|
||||
}
|
||||
|
||||
#backlight {
|
||||
background: #90b1b1;
|
||||
}
|
||||
#backlight {
|
||||
background: #90b1b1;
|
||||
}
|
||||
|
||||
#network {
|
||||
background: #2980b9;
|
||||
}
|
||||
#network {
|
||||
background: #2980b9;
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
background: #f53c3c;
|
||||
}
|
||||
#network.disconnected {
|
||||
background: #f53c3c;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
background: #f1c40f;
|
||||
color: #000000;
|
||||
}
|
||||
#pulseaudio {
|
||||
background: #f1c40f;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
background: #90b1b1;
|
||||
}
|
||||
#pulseaudio.muted {
|
||||
background: #90b1b1;
|
||||
}
|
||||
|
||||
#bluetooth {
|
||||
background: DarkSlateBlue;
|
||||
color: white;
|
||||
}
|
||||
#bluetooth {
|
||||
background: DarkSlateBlue;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#custom-media {
|
||||
background: #66cc99;
|
||||
color: #2a5c45;
|
||||
}
|
||||
#custom-media {
|
||||
background: #66cc99;
|
||||
color: #2a5c45;
|
||||
}
|
||||
|
||||
.custom-spotify {
|
||||
background: #66cc99;
|
||||
}
|
||||
.custom-spotify {
|
||||
background: #66cc99;
|
||||
}
|
||||
|
||||
.custom-vlc {
|
||||
background: #ffa000;
|
||||
}
|
||||
.custom-vlc {
|
||||
background: #ffa000;
|
||||
}
|
||||
|
||||
#temperature {
|
||||
background: #f0932b;
|
||||
}
|
||||
#temperature {
|
||||
background: #f0932b;
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
background: #eb4d4b;
|
||||
}
|
||||
#temperature.critical {
|
||||
background: #eb4d4b;
|
||||
}
|
||||
|
||||
#tray {
|
||||
background-color: #2980b9;
|
||||
}
|
||||
#tray {
|
||||
background-color: #2980b9;
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
background-color: #2d3436;
|
||||
}
|
||||
#idle_inhibitor {
|
||||
background-color: #2d3436;
|
||||
}
|
||||
|
||||
#idle_inhibitor.activated {
|
||||
background-color: #ecf0f1;
|
||||
color: #2d3436;
|
||||
}
|
||||
#idle_inhibitor.activated {
|
||||
background-color: #ecf0f1;
|
||||
color: #2d3436;
|
||||
}
|
||||
|
||||
#mpd {
|
||||
background-color: teal;
|
||||
color: white;
|
||||
}
|
||||
'' + cfg.extraStyle;
|
||||
#mpd {
|
||||
background-color: teal;
|
||||
color: white;
|
||||
}
|
||||
''
|
||||
+ cfg.extraStyle;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
openconnect-epfl = pkgs.writeShellApplication {
|
||||
name = "openconnect-epfl";
|
||||
runtimeInputs = with pkgs; [ openconnect rbw ];
|
||||
runtimeInputs = with pkgs; [
|
||||
openconnect
|
||||
rbw
|
||||
];
|
||||
text = ''
|
||||
METHOD="Microsoft Entra ID"
|
||||
RBW_ENTRY="EPFL Microsoft Auth"
|
||||
|
@ -20,4 +28,3 @@ in
|
|||
{
|
||||
home.packages = [ openconnect-epfl ];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
@ -56,9 +61,11 @@
|
|||
powerprofilesctl set $new_profile
|
||||
'';
|
||||
in
|
||||
[{
|
||||
modules."battery"."on-click" = change-mode;
|
||||
}];
|
||||
[
|
||||
{
|
||||
modules."battery"."on-click" = change-mode;
|
||||
}
|
||||
];
|
||||
|
||||
# input-remapping
|
||||
xdg.configFile."autostart/input-remapper-autoload.desktop".source =
|
||||
|
@ -75,7 +82,7 @@
|
|||
settings = [
|
||||
{
|
||||
profile.name = "undocked";
|
||||
profile.outputs = [{ criteria = "eDP-1"; }];
|
||||
profile.outputs = [ { criteria = "eDP-1"; } ];
|
||||
}
|
||||
{
|
||||
profile.name = "work-both";
|
||||
|
@ -85,7 +92,10 @@
|
|||
position = "0,${toString (builtins.floor ((2160 / work.scale - 1200) + 1200 / 3))}";
|
||||
status = "enable";
|
||||
}
|
||||
{ criteria = work.name; position = "1920,0"; }
|
||||
{
|
||||
criteria = work.name;
|
||||
position = "1920,0";
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
|
@ -111,4 +121,3 @@
|
|||
# changes in each release.
|
||||
home.stateVersion = "21.05";
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
{ pkgs, options, config, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
options,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
iio-sway = pkgs.stdenv.mkDerivation {
|
||||
|
@ -11,7 +17,11 @@ let
|
|||
hash = "sha256-JGacKajslCOvd/BFfFSf7s1/hgF6rJqJ6H6xNnsuMb4=";
|
||||
};
|
||||
buildInputs = with pkgs; [ dbus ];
|
||||
nativeBuildInputs = with pkgs; [ meson ninja pkg-config ];
|
||||
nativeBuildInputs = with pkgs; [
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
];
|
||||
meta.mainProgram = "iio-sway";
|
||||
};
|
||||
in
|
||||
|
@ -31,10 +41,13 @@ in
|
|||
home.homeDirectory = "/home/nki";
|
||||
|
||||
# More packages
|
||||
home.packages = (with pkgs; [
|
||||
# Note-taking
|
||||
rnote
|
||||
]);
|
||||
home.packages = (
|
||||
with pkgs;
|
||||
[
|
||||
# Note-taking
|
||||
rnote
|
||||
]
|
||||
);
|
||||
|
||||
# Graphical set up
|
||||
linux.graphical.type = "wayland";
|
||||
|
@ -65,7 +78,9 @@ in
|
|||
programs.my-niri.enable = true;
|
||||
programs.my-niri.enableLaptop = true;
|
||||
# Assign some of the workspaces to big screen
|
||||
programs.my-niri.workspaces = lib.genAttrs [ "06" "07" "08" "09" "10" ] (_: { monitor = config.common.monitors.work.name; });
|
||||
programs.my-niri.workspaces = lib.genAttrs [ "06" "07" "08" "09" "10" ] (_: {
|
||||
monitor = config.common.monitors.work.name;
|
||||
});
|
||||
programs.niri.settings = {
|
||||
# input.keyboard.xkb.options = "ctrl:swapcaps";
|
||||
input.mouse = lib.mkForce {
|
||||
|
@ -110,19 +125,29 @@ in
|
|||
settings = [
|
||||
{
|
||||
profile.name = "undocked";
|
||||
profile.outputs = [{ criteria = "eDP-1"; }];
|
||||
profile.outputs = [ { criteria = "eDP-1"; } ];
|
||||
}
|
||||
{
|
||||
profile.name = "work-both";
|
||||
profile.outputs = [
|
||||
{ criteria = "eDP-1"; position = "0,${toString (builtins.floor ((2160 / work.scale - 1200) + 1200 / 3))}"; status = "enable"; }
|
||||
{ criteria = work.name; position = "1920,0"; }
|
||||
{
|
||||
criteria = "eDP-1";
|
||||
position = "0,${toString (builtins.floor ((2160 / work.scale - 1200) + 1200 / 3))}";
|
||||
status = "enable";
|
||||
}
|
||||
{
|
||||
criteria = work.name;
|
||||
position = "1920,0";
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
profile.name = "work-one";
|
||||
profile.outputs = [
|
||||
{ criteria = "eDP-1"; status = "disable"; }
|
||||
{
|
||||
criteria = "eDP-1";
|
||||
status = "disable";
|
||||
}
|
||||
{ criteria = work.name; }
|
||||
];
|
||||
}
|
||||
|
@ -139,4 +164,3 @@ in
|
|||
# changes in each release.
|
||||
home.stateVersion = "21.05";
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
let
|
||||
# osu-pkg = pkgs.unstable.osu-lazer-bin;
|
||||
osu-pkg = with pkgs; with lib;
|
||||
osu-pkg =
|
||||
with pkgs;
|
||||
with lib;
|
||||
appimageTools.wrapType2 rec {
|
||||
pname = "osu-lazer-bin";
|
||||
version = "2025.321.0";
|
||||
|
@ -13,7 +15,8 @@ let
|
|||
extraPkgs = pkgs: with pkgs; [ icu ];
|
||||
|
||||
extraInstallCommands =
|
||||
let contents = appimageTools.extract { inherit pname version src; };
|
||||
let
|
||||
contents = appimageTools.extract { inherit pname version src; };
|
||||
in
|
||||
''
|
||||
mv -v $out/bin/${pname} $out/bin/osu\!
|
||||
|
@ -30,4 +33,3 @@ in
|
|||
xdg.mimeApps.defaultApplications."x-scheme-handler/osu" = "osu!.desktop";
|
||||
# home.packages = [ pkgs.osu-lazer ];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue