refactor
This commit is contained in:
parent
66c05f9093
commit
45d6f4b0f3
205 changed files with 9040 additions and 342 deletions
19
modules/nixos/desktop/addons/electron-support/default.nix
Normal file
19
modules/nixos/desktop/addons/electron-support/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.desktop.addons.electron-support;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.electron-support = with types; {
|
||||
enable = mkBoolOpt false
|
||||
"Whether to enable electron support in the desktop environment.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra.home.configFile."electron-flags.conf".source =
|
||||
./electron-flags.conf;
|
||||
|
||||
environment.sessionVariables = { NIXOS_OZONE_WL = "1"; };
|
||||
};
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
--enable-features=UseOzonePlatform
|
||||
--ozone-platform=wayland
|
|
@ -0,0 +1,23 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.desktop.addons.firefox-nordic-theme;
|
||||
profileDir = ".mozilla/firefox/${config.plusultra.user.name}";
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.firefox-nordic-theme = with types; {
|
||||
enable = mkBoolOpt false "Whether to enable the Nordic theme for firefox.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra.apps.firefox = {
|
||||
extraConfig = builtins.readFile
|
||||
"${pkgs.plusultra.firefox-nordic-theme}/configuration/user.js";
|
||||
userChrome = ''
|
||||
@import "${pkgs.plusultra.firefox-nordic-theme}/userChrome.css";
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
20
modules/nixos/desktop/addons/foot/default.nix
Normal file
20
modules/nixos/desktop/addons/foot/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.desktop.addons.foot;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.foot = with types; {
|
||||
enable = mkBoolOpt false "Whether to enable the gnome file manager.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra.desktop.addons.term = {
|
||||
enable = true;
|
||||
pkg = pkgs.foot;
|
||||
};
|
||||
|
||||
plusultra.home.configFile."foot/foot.ini".source = ./foot.ini;
|
||||
};
|
||||
}
|
50
modules/nixos/desktop/addons/foot/foot.ini
Normal file
50
modules/nixos/desktop/addons/foot/foot.ini
Normal file
|
@ -0,0 +1,50 @@
|
|||
###########################################
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
#░░█▀█░█░░░█░█░█▀▀░░░█░█░█░░░▀█▀░█▀▄░█▀█░░#
|
||||
#░░█▀▀░█░░░█░█░▀▀█░░░█░█░█░░░░█░░█▀▄░█▀█░░#
|
||||
#░░▀░░░▀▀▀░▀▀▀░▀▀▀░░░▀▀▀░▀▀▀░░▀░░▀░▀░▀░▀░░#
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
###########################################
|
||||
|
||||
[main]
|
||||
font=Hack Nerd Font Mono:size=12
|
||||
#,Noto Color Emoji:size=12
|
||||
line-height=14
|
||||
underline-offset=2
|
||||
pad=20x4 center
|
||||
term=xterm-256color
|
||||
|
||||
[scrollback]
|
||||
lines=2000
|
||||
|
||||
[url]
|
||||
protocols=http,https,ftp,ftps,file,gemini,gopher,mailto
|
||||
|
||||
[cursor]
|
||||
blink=yes
|
||||
|
||||
[colors]
|
||||
# Nord
|
||||
foreground=D8DEE9
|
||||
background=2E3440
|
||||
|
||||
regular0=2E3440
|
||||
regular1=BF616A
|
||||
regular2=A3BE8C
|
||||
regular3=EBCB8B
|
||||
regular4=81A1C1
|
||||
regular5=B48EAD
|
||||
regular6=88C0D0
|
||||
regular7=E5E9F0
|
||||
|
||||
bright0=4C566A
|
||||
bright1=BF616A
|
||||
bright2=A3BE8C
|
||||
bright3=EBCB8B
|
||||
bright4=8FBCBB
|
||||
bright5=B48EAD
|
||||
bright6=8FBCBB
|
||||
bright7=ECEFF4
|
||||
|
||||
[csd]
|
||||
size=0
|
118
modules/nixos/desktop/addons/gtk/default.nix
Normal file
118
modules/nixos/desktop/addons/gtk/default.nix
Normal file
|
@ -0,0 +1,118 @@
|
|||
{ options
|
||||
, config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.plusultra; let
|
||||
cfg = config.plusultra.desktop.addons.gtk;
|
||||
gdmCfg = config.services.xserver.displayManager.gdm;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.gtk = with types; {
|
||||
enable = mkBoolOpt false "Whether to customize GTK and apply themes.";
|
||||
theme = {
|
||||
name =
|
||||
mkOpt str "Nordic-darker"
|
||||
"The name of the GTK theme to apply.";
|
||||
pkg = mkOpt package pkgs.nordic "The package to use for the theme.";
|
||||
};
|
||||
cursor = {
|
||||
name =
|
||||
mkOpt str "Bibata-Modern-Ice"
|
||||
"The name of the cursor theme to apply.";
|
||||
pkg = mkOpt package pkgs.plusultra.bibata-cursors "The package to use for the cursor theme.";
|
||||
};
|
||||
icon = {
|
||||
name =
|
||||
mkOpt str "Papirus"
|
||||
"The name of the icon theme to apply.";
|
||||
pkg = mkOpt package pkgs.papirus-icon-theme "The package to use for the icon theme.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
cfg.icon.pkg
|
||||
cfg.cursor.pkg
|
||||
];
|
||||
|
||||
environment.sessionVariables = {
|
||||
XCURSOR_THEME = cfg.cursor.name;
|
||||
};
|
||||
|
||||
plusultra.home.extraOptions = {
|
||||
gtk = {
|
||||
enable = true;
|
||||
|
||||
theme = {
|
||||
name = cfg.theme.name;
|
||||
package = cfg.theme.pkg;
|
||||
};
|
||||
|
||||
cursorTheme = {
|
||||
name = cfg.cursor.name;
|
||||
package = cfg.cursor.pkg;
|
||||
};
|
||||
|
||||
iconTheme = {
|
||||
name = cfg.icon.name;
|
||||
package = cfg.icon.pkg;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# NOTE: In order to set the cursor theme in GDM we have to specify it in the
|
||||
# dconf profile. However, the NixOS module doesn't provide an easy way to do this so the relevant
|
||||
# parts have been extracted from:
|
||||
# https://github.com/NixOS/nixpkgs/blob/96e18717904dfedcd884541e5a92bf9ff632cf39/nixos/modules/services/x11/display-managers/gdm.nix
|
||||
#
|
||||
# NOTE: The GTK and icon themes don't seem to affect recent GDM versions. I've
|
||||
# left them here as reference for the future.
|
||||
programs.dconf.profiles = mkIf gdmCfg.enable {
|
||||
gdm =
|
||||
let
|
||||
customDconf = pkgs.writeTextFile {
|
||||
name = "gdm-dconf";
|
||||
destination = "/dconf/gdm-custom";
|
||||
text = ''
|
||||
${optionalString (!gdmCfg.autoSuspend) ''
|
||||
[org/gnome/settings-daemon/plugins/power]
|
||||
sleep-inactive-ac-type='nothing'
|
||||
sleep-inactive-battery-type='nothing'
|
||||
sleep-inactive-ac-timeout=0
|
||||
sleep-inactive-battery-timeout=0
|
||||
''}
|
||||
|
||||
[org/gnome/desktop/interface]
|
||||
gtk-theme='${cfg.theme.name}'
|
||||
cursor-theme='${cfg.cursor.name}'
|
||||
icon-theme='${cfg.icon.name}'
|
||||
'';
|
||||
};
|
||||
|
||||
customDconfDb = pkgs.stdenv.mkDerivation {
|
||||
name = "gdm-dconf-db";
|
||||
buildCommand = ''
|
||||
${pkgs.dconf}/bin/dconf compile $out ${customDconf}/dconf
|
||||
'';
|
||||
};
|
||||
in
|
||||
mkForce (
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "dconf-gdm-profile";
|
||||
buildCommand = ''
|
||||
# Check that the GDM profile starts with what we expect.
|
||||
if [ $(head -n 1 ${pkgs.gnome.gdm}/share/dconf/profile/gdm) != "user-db:user" ]; then
|
||||
echo "GDM dconf profile changed, please update gtk/default.nix"
|
||||
exit 1
|
||||
fi
|
||||
# Insert our custom DB behind it.
|
||||
sed '2ifile-db:${customDconfDb}' ${pkgs.gnome.gdm}/share/dconf/profile/gdm > $out
|
||||
'';
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
3
modules/nixos/desktop/addons/kanshi/config
Normal file
3
modules/nixos/desktop/addons/kanshi/config
Normal file
|
@ -0,0 +1,3 @@
|
|||
profile {
|
||||
output eDP-1 enable scale 2
|
||||
}
|
41
modules/nixos/desktop/addons/kanshi/default.nix
Normal file
41
modules/nixos/desktop/addons/kanshi/default.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.desktop.addons.kanshi;
|
||||
user = config.plusultra.user;
|
||||
home = config.users.users.${user.name}.home;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.kanshi = with types; {
|
||||
enable =
|
||||
mkBoolOpt false "Whether to enable Kanshi in the desktop environment.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra.home.configFile."kanshi/config".source = ./config;
|
||||
|
||||
environment.systemPackages = with pkgs; [ kanshi ];
|
||||
|
||||
# configuring kanshi
|
||||
systemd.user.services.kanshi = {
|
||||
description = "Kanshi output autoconfig ";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
environment = { XDG_CONFIG_HOME = "${home}/.config"; };
|
||||
serviceConfig = {
|
||||
ExecCondition = ''
|
||||
${pkgs.bash}/bin/bash -c '[ -n "$WAYLAND_DISPLAY" ]'
|
||||
'';
|
||||
|
||||
ExecStart = ''
|
||||
${pkgs.kanshi}/bin/kanshi
|
||||
'';
|
||||
|
||||
RestartSec = 5;
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
17
modules/nixos/desktop/addons/keyring/default.nix
Normal file
17
modules/nixos/desktop/addons/keyring/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.desktop.addons.keyring;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.keyring = with types; {
|
||||
enable = mkBoolOpt false "Whether to enable the gnome keyring.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [ gnome.seahorse ];
|
||||
};
|
||||
}
|
18
modules/nixos/desktop/addons/mako/config
Normal file
18
modules/nixos/desktop/addons/mako/config
Normal file
|
@ -0,0 +1,18 @@
|
|||
###########################################
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
#░░█▀█░█░░░█░█░█▀▀░░░█░█░█░░░▀█▀░█▀▄░█▀█░░#
|
||||
#░░█▀▀░█░░░█░█░▀▀█░░░█░█░█░░░░█░░█▀▄░█▀█░░#
|
||||
#░░▀░░░▀▀▀░▀▀▀░▀▀▀░░░▀▀▀░▀▀▀░░▀░░▀░▀░▀░▀░░#
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
###########################################
|
||||
|
||||
font=Hack Nerd Font Mono 10
|
||||
border-radius=8
|
||||
text-color=#2e3440ff
|
||||
background-color=#eceff4f4
|
||||
border-color=#d8dee9ff
|
||||
border-size=0
|
||||
margin=12,12,6
|
||||
padding=12,12,12,12
|
||||
default-timeout=5000
|
||||
max-visible=3
|
44
modules/nixos/desktop/addons/mako/default.nix
Normal file
44
modules/nixos/desktop/addons/mako/default.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.desktop.addons.mako;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.mako = with types; {
|
||||
enable = mkBoolOpt false "Whether to enable Mako in Sway.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ mako libnotify ];
|
||||
|
||||
systemd.user.services.mako = {
|
||||
description = "Mako notification daemon";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
Type = "dbus";
|
||||
BusName = "org.freedesktop.Notifications";
|
||||
|
||||
ExecCondition = ''
|
||||
${pkgs.bash}/bin/bash -c '[ -n "$WAYLAND_DISPLAY" ]'
|
||||
'';
|
||||
|
||||
ExecStart = ''
|
||||
${pkgs.mako}/bin/mako
|
||||
'';
|
||||
|
||||
ExecReload = ''
|
||||
${pkgs.mako}/bin/makoctl reload
|
||||
'';
|
||||
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
TimeoutStopSec = 10;
|
||||
};
|
||||
};
|
||||
|
||||
plusultra.home.configFile."mako/config".source = ./config;
|
||||
};
|
||||
}
|
20
modules/nixos/desktop/addons/nautilus/default.nix
Normal file
20
modules/nixos/desktop/addons/nautilus/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.desktop.addons.nautilus;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.nautilus = with types; {
|
||||
enable = mkBoolOpt false "Whether to enable the gnome file manager.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Enable support for browsing samba shares.
|
||||
services.gvfs.enable = true;
|
||||
networking.firewall.extraCommands =
|
||||
"iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns";
|
||||
|
||||
environment.systemPackages = with pkgs; [ gnome.nautilus ];
|
||||
};
|
||||
}
|
42
modules/nixos/desktop/addons/rofi/config.rasi
Normal file
42
modules/nixos/desktop/addons/rofi/config.rasi
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
vim: filetype=css
|
||||
*/
|
||||
|
||||
configuration {
|
||||
fullscreen: false;
|
||||
show-icons: false;
|
||||
sidebar-mode: false;
|
||||
}
|
||||
|
||||
* {
|
||||
// Default bg is transparent.
|
||||
background-color: transparent;
|
||||
// Default text is white
|
||||
text-color: white;
|
||||
spacing: 30;
|
||||
}
|
||||
|
||||
#window {
|
||||
// Default font
|
||||
font: "Nerd Font Hack 18";
|
||||
fullscreen: true;
|
||||
transparency: "background";
|
||||
|
||||
background-color: #282a36BA;
|
||||
|
||||
// Add dummy widgets on top and bottom so the sizing
|
||||
// nicely centers hdum, independent of resolution.
|
||||
children: [ dummy1, hdum, dummy2 ];
|
||||
}
|
||||
|
||||
#hdum {
|
||||
orientation: horizontal;
|
||||
// Add dummy widgets on left and right so the sizing
|
||||
// nicely centers mainbox, independent of resolution.
|
||||
children: [ dummy3, mainbox, dummy4 ];
|
||||
}
|
||||
|
||||
#element selected {
|
||||
text-color: #caa9fa;
|
||||
}
|
||||
|
18
modules/nixos/desktop/addons/rofi/default.nix
Normal file
18
modules/nixos/desktop/addons/rofi/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.desktop.addons.rofi;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.rofi = with types; {
|
||||
enable =
|
||||
mkBoolOpt false "Whether to enable Rofi in the desktop environment.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ rofi ];
|
||||
|
||||
plusultra.home.configFile."rofi/config.rasi".source = ./config.rasi;
|
||||
};
|
||||
}
|
3
modules/nixos/desktop/addons/swappy/config
Normal file
3
modules/nixos/desktop/addons/swappy/config
Normal file
|
@ -0,0 +1,3 @@
|
|||
[Default]
|
||||
save_dir=$HOME/Pictures/screenshots
|
||||
save_filename_format=%Y%m%d-%H%M%S.png
|
19
modules/nixos/desktop/addons/swappy/default.nix
Normal file
19
modules/nixos/desktop/addons/swappy/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.desktop.addons.swappy;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.swappy = with types; {
|
||||
enable =
|
||||
mkBoolOpt false "Whether to enable Swappy in the desktop environment.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ swappy ];
|
||||
|
||||
plusultra.home.configFile."swappy/config".source = ./config;
|
||||
plusultra.home.file."Pictures/screenshots/.keep".text = "";
|
||||
};
|
||||
}
|
14
modules/nixos/desktop/addons/term/default.nix
Normal file
14
modules/nixos/desktop/addons/term/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.desktop.addons.term;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.term = with types; {
|
||||
enable = mkBoolOpt false "Whether to enable the gnome file manager.";
|
||||
pkg = mkOpt package pkgs.foot "The terminal to install.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable { environment.systemPackages = [ cfg.pkg ]; };
|
||||
}
|
26
modules/nixos/desktop/addons/wallpapers/default.nix
Normal file
26
modules/nixos/desktop/addons/wallpapers/default.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ options, config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.desktop.addons.wallpapers;
|
||||
inherit (pkgs.plusultra) wallpapers;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.wallpapers = with types; {
|
||||
enable = mkBoolOpt false
|
||||
"Whether or not to add wallpapers to ~/Pictures/wallpapers.";
|
||||
};
|
||||
|
||||
config = {
|
||||
plusultra.home.file = lib.foldl
|
||||
(acc: name:
|
||||
let wallpaper = wallpapers.${name};
|
||||
in
|
||||
acc // {
|
||||
"Pictures/wallpapers/${wallpaper.fileName}".source = wallpaper;
|
||||
})
|
||||
{ }
|
||||
(wallpapers.names);
|
||||
};
|
||||
}
|
119
modules/nixos/desktop/addons/waybar/config
Normal file
119
modules/nixos/desktop/addons/waybar/config
Normal file
|
@ -0,0 +1,119 @@
|
|||
{
|
||||
"layer": "top",
|
||||
"modules-left": [
|
||||
"sway/workspaces",
|
||||
"custom/media",
|
||||
"sway/mode"
|
||||
],
|
||||
"modules-center": [],
|
||||
"modules-right": [
|
||||
"network",
|
||||
"pulseaudio",
|
||||
"cpu",
|
||||
"battery",
|
||||
"tray",
|
||||
"clock#date",
|
||||
"clock#time"
|
||||
],
|
||||
"sway/mode": {
|
||||
"format": "{}"
|
||||
},
|
||||
"custom/media": {
|
||||
"format": "{icon}",
|
||||
"return-type": "json",
|
||||
"format-icons": {
|
||||
"Playing": "",
|
||||
"Paused": "ﳌ"
|
||||
},
|
||||
"max-length": 70,
|
||||
"exec": "playerctl -a metadata --format '{\"text\": \"{{playerName}}\", \"tooltip\": \"{{playerName}}: {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F",
|
||||
"on-click": "playerctl play-pause"
|
||||
},
|
||||
"mpd": {
|
||||
"tooltip": false,
|
||||
"format": "{stateIcon} {artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})",
|
||||
"format-disconnected": "ﳌ",
|
||||
"format-stopped": "",
|
||||
"state-icons": {
|
||||
"playing": "",
|
||||
"paused": ""
|
||||
}
|
||||
},
|
||||
"pulseaudio": {
|
||||
"tooltip": true,
|
||||
"tooltip-format": "{volume}%",
|
||||
"scroll-step": 5,
|
||||
"format": "{icon}",
|
||||
"format-bluetooth": "",
|
||||
"format-muted": "婢",
|
||||
"format-icons": {
|
||||
"default": [
|
||||
"奄",
|
||||
"奔",
|
||||
"墳"
|
||||
]
|
||||
},
|
||||
"on-click": "gnome-control-center sound"
|
||||
},
|
||||
"network": {
|
||||
"tooltip": true,
|
||||
"format-wifi": " ",
|
||||
"tooltip-format-wifi": "{essid} @ {signalStrength}%",
|
||||
"format-ethernet": "",
|
||||
"on-click": "gnome-control-center wifi"
|
||||
},
|
||||
"temperature": {
|
||||
"tooltip": true,
|
||||
"tooltip-format": "{temperatureC} 糖",
|
||||
"critical-threshold": 70,
|
||||
"format-icons": [
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"format": "{icon}"
|
||||
},
|
||||
"cpu": {
|
||||
"tooltip": true,
|
||||
"format": "",
|
||||
"states": {
|
||||
"heavy": 70,
|
||||
"full": 90
|
||||
}
|
||||
},
|
||||
"memory": {
|
||||
"tooltip": true,
|
||||
"tooltip-format": "{used:0.1f}G/{total:0.1f}G",
|
||||
"format": "",
|
||||
"states": {
|
||||
"heavy": 70,
|
||||
"full": 90
|
||||
}
|
||||
},
|
||||
"battery": {
|
||||
"bat": "BAT1",
|
||||
"interval": 60,
|
||||
"states": {
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
},
|
||||
"format": "{icon}",
|
||||
"format-critical": "",
|
||||
"format-icons": {
|
||||
"default": ["", "", "", "", "", "", "", "", "", ""],
|
||||
"charging": ["", "", "", "", "", "", ""],
|
||||
"not": "",
|
||||
"plugged": ""
|
||||
}
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 16,
|
||||
"spacing": 10
|
||||
},
|
||||
"clock#date": {
|
||||
"format": "{:%a, %b %d}"
|
||||
},
|
||||
"clock#time": {
|
||||
"format": "{:%I:%M %p}"
|
||||
}
|
||||
}
|
19
modules/nixos/desktop/addons/waybar/default.nix
Normal file
19
modules/nixos/desktop/addons/waybar/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.desktop.addons.waybar;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.waybar = with types; {
|
||||
enable =
|
||||
mkBoolOpt false "Whether to enable Waybar in the desktop environment.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ waybar ];
|
||||
|
||||
plusultra.home.configFile."waybar/config".source = ./config;
|
||||
plusultra.home.configFile."waybar/style.css".source = ./style.css;
|
||||
};
|
||||
}
|
314
modules/nixos/desktop/addons/waybar/style.css
Normal file
314
modules/nixos/desktop/addons/waybar/style.css
Normal file
|
@ -0,0 +1,314 @@
|
|||
/*
|
||||
********************************************
|
||||
*░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░*
|
||||
*░░█▀█░█░░░█░█░█▀▀░░░█░█░█░░░▀█▀░█▀▄░█▀█░░*
|
||||
*░░█▀▀░█░░░█░█░▀▀█░░░█░█░█░░░░█░░█▀▄░█▀█░░*
|
||||
*░░▀░░░▀▀▀░▀▀▀░▀▀▀░░░▀▀▀░▀▀▀░░▀░░▀░▀░▀░▀░░*
|
||||
*░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░*
|
||||
********************************************
|
||||
*/
|
||||
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: Nerd Font Hack;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
#window {
|
||||
margin-top: 8px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
border-radius: 8px;
|
||||
transition: none;
|
||||
color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
window#waybar.termite #window,
|
||||
window#waybar.Firefox #window,
|
||||
window#waybar.Navigator #window,
|
||||
window#waybar.PCSX2 #window {
|
||||
color: #4d4d4d;
|
||||
background: #e6e6e6;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
border-radius: 12px;
|
||||
background: #eceff4;
|
||||
}
|
||||
|
||||
tooltip label {
|
||||
color: #2e3440;
|
||||
text-shadow: none;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
#workspaces button,
|
||||
#mode,
|
||||
#mpd,
|
||||
#custom-media,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#temperature,
|
||||
#cpu,
|
||||
#memory,
|
||||
#tray,
|
||||
#clock,
|
||||
#battery {
|
||||
color: #2e3440;
|
||||
background: #eceff4;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
margin-top: 8px;
|
||||
margin-left: 12px;
|
||||
margin-bottom: 0;
|
||||
border-radius: 8px;
|
||||
transition: none;
|
||||
background: #d8dee9;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
transition: none;
|
||||
font-size: 16px;
|
||||
border-radius: 8px;
|
||||
padding: 4px 8px;
|
||||
font-weight: bold;
|
||||
background: #d8dee9;
|
||||
}
|
||||
|
||||
#workspaces button.visible {
|
||||
color: #88c0d0;
|
||||
background: #eceff4;
|
||||
}
|
||||
|
||||
#workspaces button.visible:hover {
|
||||
color: #88c0d0;
|
||||
background: #eceff4;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
transition: none;
|
||||
box-shadow: inherit;
|
||||
text-shadow: inherit;
|
||||
color: #81a1c1;
|
||||
}
|
||||
|
||||
#custom-media {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
margin-bottom: 0;
|
||||
border-radius: 8px;
|
||||
transition: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#custom-media.Paused {
|
||||
color: #4c566a;
|
||||
background: #d8dee9;
|
||||
}
|
||||
|
||||
#custom-media.Playing {
|
||||
color: #eceff4;
|
||||
background: #8fbcbb;
|
||||
}
|
||||
|
||||
#network {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 10px;
|
||||
margin-bottom: 0;
|
||||
border-radius: 8px;
|
||||
transition: none;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
#network.disconnected,
|
||||
#network.disabled {
|
||||
color: #2e3440;
|
||||
background: #eceff4;
|
||||
}
|
||||
|
||||
#network.wifi {
|
||||
color: #d8dee9;
|
||||
background: #8fbcbb;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
margin-bottom: 0;
|
||||
border-radius: 8px;
|
||||
transition: none;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#pulseaudio.bluetooth {
|
||||
color: #d8dee9;
|
||||
background: #81a1c1;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
color: #d8dee9;
|
||||
background: #bf616a;
|
||||
}
|
||||
|
||||
#battery {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
margin-bottom: 0;
|
||||
border-radius: 8px;
|
||||
transition: none;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#battery.warning {
|
||||
color: #eceff4;
|
||||
background: #d08770;
|
||||
}
|
||||
|
||||
#battery.critical {
|
||||
color: #eceff4;
|
||||
background: #bf616a;
|
||||
}
|
||||
|
||||
#temperature {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
margin-bottom: 0;
|
||||
border-radius: 8px;
|
||||
transition: none;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
color: #d8dee9;
|
||||
background: #bf616a;
|
||||
animation: red-flash 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes red-flash {
|
||||
0% {
|
||||
background: #bf616a;
|
||||
}
|
||||
|
||||
50% {
|
||||
background: #d37f87;
|
||||
}
|
||||
|
||||
100% {
|
||||
background: #bf616a;
|
||||
}
|
||||
}
|
||||
|
||||
#cpu {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
margin-bottom: 0;
|
||||
border-radius: 8px;
|
||||
transition: none;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#cpu.heavy {
|
||||
color: #d8dee9;
|
||||
background: #d08770;
|
||||
}
|
||||
|
||||
#cpu.full {
|
||||
color: #d8dee9;
|
||||
background: #bf616a;
|
||||
}
|
||||
|
||||
#memory {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
margin-bottom: 0;
|
||||
border-radius: 8px;
|
||||
transition: none;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#memory.heavy {
|
||||
color: #d8dee9;
|
||||
background: #d08770;
|
||||
}
|
||||
|
||||
#memory.full {
|
||||
color: #d8dee9;
|
||||
background: #bf616a;
|
||||
}
|
||||
|
||||
#tray {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
margin-bottom: 0;
|
||||
border-radius: 8px;
|
||||
transition: none;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#mode {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
margin-bottom: 0;
|
||||
border-radius: 8px;
|
||||
transition: none;
|
||||
/* font-size: 20px; */
|
||||
color: #eceff4;
|
||||
background: #d08770;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#clock {
|
||||
margin-top: 8px;
|
||||
margin-bottom: 0;
|
||||
transition: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#clock.date {
|
||||
margin-left: 8px;
|
||||
border-radius: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 10px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
background: #e5e9f0;
|
||||
}
|
||||
|
||||
#clock.time {
|
||||
padding-left: 10px;
|
||||
padding-right: 16px;
|
||||
border-radius: 8px;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
margin-right: 12px;
|
||||
background: #d8dee9;
|
||||
}
|
3
modules/nixos/desktop/addons/wofi/config
Normal file
3
modules/nixos/desktop/addons/wofi/config
Normal file
|
@ -0,0 +1,3 @@
|
|||
stylesheet=./style.css
|
||||
term=foot
|
||||
insensitive=true
|
23
modules/nixos/desktop/addons/wofi/default.nix
Normal file
23
modules/nixos/desktop/addons/wofi/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.desktop.addons.wofi;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.wofi = with types; {
|
||||
enable =
|
||||
mkBoolOpt false "Whether to enable the Wofi in the desktop environment.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ wofi wofi-emoji ];
|
||||
|
||||
# config -> .config/wofi/config
|
||||
# css -> .config/wofi/style.css
|
||||
# colors -> $XDG_CACHE_HOME/wal/colors
|
||||
# plusultra.home.configFile."foot/foot.ini".source = ./foot.ini;
|
||||
plusultra.home.configFile."wofi/config".source = ./config;
|
||||
plusultra.home.configFile."wofi/style.css".source = ./style.css;
|
||||
};
|
||||
}
|
127
modules/nixos/desktop/addons/wofi/style.css
Normal file
127
modules/nixos/desktop/addons/wofi/style.css
Normal file
|
@ -0,0 +1,127 @@
|
|||
window {
|
||||
font-family: "Hack Nerd Font";
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#outer-box {
|
||||
padding: 10px;
|
||||
border-radius: 8px;
|
||||
background: #2e3440;
|
||||
}
|
||||
|
||||
#scroll {
|
||||
/* The Nordic gtk theme adds an outline to show scroll areas... */
|
||||
outline-color: transparent;
|
||||
}
|
||||
|
||||
#input {
|
||||
color: #e5e9f0;
|
||||
caret-color: #e5e9f0;
|
||||
background: #3b4252;
|
||||
border-top-color: #3b4252;
|
||||
border-left-color: #3b4252;
|
||||
border-right-color: #3b4252;
|
||||
border-bottom-color: #3b4252;
|
||||
box-shadow: 0 0 0 1px transparent inset;
|
||||
outline-color: transparent !important;
|
||||
}
|
||||
|
||||
#input:focus {
|
||||
background: #3b4252;
|
||||
border-color: #3b4252 !important;
|
||||
box-shadow: 0 0 0 1px transparent inset;
|
||||
border-top-color: #3b4252 !important;
|
||||
border-left-color: #3b4252 !important;
|
||||
border-right-color: #3b4252 !important;
|
||||
border-bottom-color: #3b4252 !important;
|
||||
box-shadow: none !important;
|
||||
outline-color: transparent !important;
|
||||
}
|
||||
|
||||
#input image.left {
|
||||
color: #d8dee9;
|
||||
}
|
||||
|
||||
#input:focus image.left {
|
||||
color: #e5e9f0;
|
||||
}
|
||||
|
||||
#input image.right {
|
||||
color: #d8dee9;
|
||||
}
|
||||
|
||||
#input:focus image.right {
|
||||
color: #e5e9f0;
|
||||
}
|
||||
|
||||
label {
|
||||
/* We set backgrounds on the block level. */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#scroll {
|
||||
padding-top: 6px;
|
||||
}
|
||||
|
||||
#entry {
|
||||
color: #4c566a;
|
||||
padding: 8px 8px;
|
||||
border-radius: 4px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#entry:selected {
|
||||
color: #eceff4;
|
||||
background: #8fbcbb;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
expander arrow {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
#entry #selected #text {
|
||||
color: #eceff4;
|
||||
}
|
||||
|
||||
expander list {
|
||||
margin-top: 8px;
|
||||
/* background: #8fbcbb; */
|
||||
background: transparent;
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
expander list #entry {
|
||||
transition: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
expander list #entry:hover,
|
||||
expander list #entry:active {
|
||||
/* color: #8fbcbb;
|
||||
background: #e5e9f0; */
|
||||
}
|
||||
|
||||
expander list #entry #selected {
|
||||
background: #8fbcbb;
|
||||
}
|
||||
|
||||
expander list #entry #selected label {
|
||||
color: #eceff4;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
expander list #entry:hover,
|
||||
expander list #entry:active {
|
||||
background: #8fbcbb;
|
||||
}
|
||||
|
||||
expander list #entry:hover label,
|
||||
expander list #entry:active label {
|
||||
color: #eceff4;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
expander list label {
|
||||
color: #d8dee9;
|
||||
}
|
24
modules/nixos/desktop/addons/xdg-portal/default.nix
Normal file
24
modules/nixos/desktop/addons/xdg-portal/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.desktop.addons.xdg-portal;
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.addons.xdg-portal = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to add support for xdg portal.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
xdg = {
|
||||
portal = {
|
||||
enable = true;
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-wlr
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
gtkUsePortal = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
333
modules/nixos/desktop/gnome/default.nix
Normal file
333
modules/nixos/desktop/gnome/default.nix
Normal file
|
@ -0,0 +1,333 @@
|
|||
{ options
|
||||
, config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
with lib.plusultra; let
|
||||
cfg = config.plusultra.desktop.gnome;
|
||||
gdmHome = config.users.users.gdm.home;
|
||||
|
||||
defaultExtensions = with pkgs.gnomeExtensions; [
|
||||
appindicator
|
||||
aylurs-widgets
|
||||
dash-to-dock
|
||||
emoji-selector
|
||||
gsconnect
|
||||
gtile
|
||||
just-perfection
|
||||
logo-menu
|
||||
no-overview
|
||||
remove-app-menu
|
||||
space-bar
|
||||
top-bar-organizer
|
||||
wireless-hid
|
||||
|
||||
# NOTE: These extensions are currently unsupported. They may also
|
||||
# no longer be required.
|
||||
|
||||
# audio-output-switcher
|
||||
# big-avatar
|
||||
# clear-top-bar
|
||||
];
|
||||
|
||||
default-attrs = mapAttrs (key: mkDefault);
|
||||
nested-default-attrs = mapAttrs (key: default-attrs);
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.gnome = with types; {
|
||||
enable =
|
||||
mkBoolOpt false "Whether or not to use Gnome as the desktop environment.";
|
||||
wallpaper = {
|
||||
light = mkOpt (oneOf [ str package ]) pkgs.plusultra.wallpapers.nord-rainbow-light-nix "The light wallpaper to use.";
|
||||
dark = mkOpt (oneOf [ str package ]) pkgs.plusultra.wallpapers.nord-rainbow-dark-nix "The dark wallpaper to use.";
|
||||
};
|
||||
color-scheme = mkOpt (enum [ "light" "dark" ]) "dark" "The color scheme to use.";
|
||||
wayland = mkBoolOpt true "Whether or not to use Wayland.";
|
||||
suspend =
|
||||
mkBoolOpt true "Whether or not to suspend the machine after inactivity.";
|
||||
monitors = mkOpt (nullOr path) null "The monitors.xml file to create.";
|
||||
extensions = mkOpt (listOf package) [ ] "Extra Gnome extensions to install.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra.system.xkb.enable = true;
|
||||
plusultra.desktop.addons = {
|
||||
gtk = enabled;
|
||||
wallpapers = enabled;
|
||||
electron-support = enabled;
|
||||
foot = enabled;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs;
|
||||
[
|
||||
(hiPrio plusultra.xdg-open-with-portal)
|
||||
wl-clipboard
|
||||
gnome.gnome-tweaks
|
||||
gnome.nautilus-python
|
||||
]
|
||||
++ defaultExtensions
|
||||
++ cfg.extensions;
|
||||
|
||||
environment.gnome.excludePackages = with pkgs.gnome; [
|
||||
pkgs.gnome-tour
|
||||
epiphany
|
||||
geary
|
||||
gnome-font-viewer
|
||||
gnome-system-monitor
|
||||
gnome-maps
|
||||
];
|
||||
|
||||
systemd.tmpfiles.rules =
|
||||
[
|
||||
"d ${gdmHome}/.config 0711 gdm gdm"
|
||||
]
|
||||
++ (
|
||||
# "./monitors.xml" comes from ~/.config/monitors.xml when GNOME
|
||||
# display information is updated.
|
||||
lib.optional (cfg.monitors != null) "L+ ${gdmHome}/.config/monitors.xml - - - - ${cfg.monitors}"
|
||||
);
|
||||
|
||||
systemd.services.plusultra-user-icon = {
|
||||
before = [ "display-manager.service" ];
|
||||
wantedBy = [ "display-manager.service" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = "root";
|
||||
Group = "root";
|
||||
};
|
||||
|
||||
script = ''
|
||||
config_file=/var/lib/AccountsService/users/${config.plusultra.user.name}
|
||||
icon_file=/run/current-system/sw/share/plusultra-icons/user/${config.plusultra.user.name}/${config.plusultra.user.icon.fileName}
|
||||
|
||||
if ! [ -d "$(dirname "$config_file")"]; then
|
||||
mkdir -p "$(dirname "$config_file")"
|
||||
fi
|
||||
|
||||
if ! [ -f "$config_file" ]; then
|
||||
echo "[User]
|
||||
Session=gnome
|
||||
SystemAccount=false
|
||||
Icon=$icon_file" > "$config_file"
|
||||
else
|
||||
icon_config=$(sed -E -n -e "/Icon=.*/p" $config_file)
|
||||
|
||||
if [[ "$icon_config" == "" ]]; then
|
||||
echo "Icon=$icon_file" >> $config_file
|
||||
else
|
||||
sed -E -i -e "s#^Icon=.*$#Icon=$icon_file#" $config_file
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
# Required for app indicators
|
||||
services.udev.packages = with pkgs; [ gnome3.gnome-settings-daemon ];
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
|
||||
libinput.enable = true;
|
||||
displayManager.gdm = {
|
||||
enable = true;
|
||||
wayland = cfg.wayland;
|
||||
autoSuspend = cfg.suspend;
|
||||
};
|
||||
desktopManager.gnome.enable = true;
|
||||
};
|
||||
|
||||
plusultra.home.extraOptions = {
|
||||
dconf.settings =
|
||||
let
|
||||
user = config.users.users.${config.plusultra.user.name};
|
||||
get-wallpaper = wallpaper:
|
||||
if lib.isDerivation wallpaper
|
||||
then builtins.toString wallpaper
|
||||
else wallpaper;
|
||||
in
|
||||
nested-default-attrs {
|
||||
"org/gnome/shell" = {
|
||||
disable-user-extensions = false;
|
||||
enabled-extensions =
|
||||
(builtins.map (extension: extension.extensionUuid) (cfg.extensions ++ defaultExtensions))
|
||||
++ [
|
||||
"native-window-placement@gnome-shell-extensions.gcampax.github.com"
|
||||
"drive-menu@gnome-shell-extensions.gcampax.github.com"
|
||||
"user-theme@gnome-shell-extensions.gcampax.github.com"
|
||||
];
|
||||
favorite-apps =
|
||||
[ "org.gnome.Nautilus.desktop" ]
|
||||
++ optional config.plusultra.apps.firefox.enable "firefox.desktop"
|
||||
++ optional config.plusultra.apps.vscode.enable "code.desktop"
|
||||
++ optional config.plusultra.desktop.addons.foot.enable "foot.desktop"
|
||||
++ optional config.plusultra.apps.logseq.enable "logseq.desktop"
|
||||
++ optional config.plusultra.apps.discord.enable "discord.desktop"
|
||||
++ optional config.plusultra.apps.element.enable "element-desktop.desktop"
|
||||
++ optional config.plusultra.apps.steam.enable "steam.desktop";
|
||||
};
|
||||
|
||||
"org/gnome/desktop/background" = {
|
||||
picture-uri = get-wallpaper cfg.wallpaper.light;
|
||||
picture-uri-dark = get-wallpaper cfg.wallpaper.dark;
|
||||
};
|
||||
"org/gnome/desktop/screensaver" = {
|
||||
picture-uri = get-wallpaper cfg.wallpaper.light;
|
||||
picture-uri-dark = get-wallpaper cfg.wallpaper.dark;
|
||||
};
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme =
|
||||
if cfg.color-scheme == "light"
|
||||
then "default"
|
||||
else "prefer-dark";
|
||||
enable-hot-corners = false;
|
||||
};
|
||||
"org/gnome/desktop/peripherals/touchpad" = {
|
||||
disable-while-typing = false;
|
||||
};
|
||||
"org/gnome/desktop/wm/preferences" = {
|
||||
num-workspaces = 10;
|
||||
resize-with-right-button = true;
|
||||
};
|
||||
"org/gnome/desktop/wm/keybindings" = {
|
||||
switch-to-workspace-1 = [ "<Super>1" ];
|
||||
switch-to-workspace-2 = [ "<Super>2" ];
|
||||
switch-to-workspace-3 = [ "<Super>3" ];
|
||||
switch-to-workspace-4 = [ "<Super>4" ];
|
||||
switch-to-workspace-5 = [ "<Super>5" ];
|
||||
switch-to-workspace-6 = [ "<Super>6" ];
|
||||
switch-to-workspace-7 = [ "<Super>7" ];
|
||||
switch-to-workspace-8 = [ "<Super>8" ];
|
||||
switch-to-workspace-9 = [ "<Super>9" ];
|
||||
switch-to-workspace-10 = [ "<Super>0" ];
|
||||
|
||||
move-to-workspace-1 = [ "<Shift><Super>1" ];
|
||||
move-to-workspace-2 = [ "<Shift><Super>2" ];
|
||||
move-to-workspace-3 = [ "<Shift><Super>3" ];
|
||||
move-to-workspace-4 = [ "<Shift><Super>4" ];
|
||||
move-to-workspace-5 = [ "<Shift><Super>5" ];
|
||||
move-to-workspace-6 = [ "<Shift><Super>6" ];
|
||||
move-to-workspace-7 = [ "<Shift><Super>7" ];
|
||||
move-to-workspace-8 = [ "<Shift><Super>8" ];
|
||||
move-to-workspace-9 = [ "<Shift><Super>9" ];
|
||||
move-to-workspace-10 = [ "<Shift><Super>0" ];
|
||||
};
|
||||
"org/gnome/shell/keybindings" = {
|
||||
# Remove the default hotkeys for opening favorited applications.
|
||||
switch-to-application-1 = [ ];
|
||||
switch-to-application-2 = [ ];
|
||||
switch-to-application-3 = [ ];
|
||||
switch-to-application-4 = [ ];
|
||||
switch-to-application-5 = [ ];
|
||||
switch-to-application-6 = [ ];
|
||||
switch-to-application-7 = [ ];
|
||||
switch-to-application-8 = [ ];
|
||||
switch-to-application-9 = [ ];
|
||||
switch-to-application-10 = [ ];
|
||||
};
|
||||
"org/gnome/mutter" = {
|
||||
edge-tiling = false;
|
||||
dynamic-workspaces = false;
|
||||
};
|
||||
|
||||
"org/gnome/shell/extensions/dash-to-dock" = {
|
||||
autohide = true;
|
||||
dock-fixed = false;
|
||||
dock-position = "BOTTOM";
|
||||
pressure-threshold = 200.0;
|
||||
require-pressure-to-show = true;
|
||||
show-favorites = true;
|
||||
hot-keys = false;
|
||||
};
|
||||
|
||||
"org/gnome/shell/extensions/just-perfection" = {
|
||||
panel-size = 48;
|
||||
activities-button = false;
|
||||
};
|
||||
|
||||
"org/gnome/shell/extensions/Logo-menu" = {
|
||||
hide-softwarecentre = true;
|
||||
|
||||
# Use right click to open Activities.
|
||||
menu-button-icon-click-type = 3;
|
||||
|
||||
# Use the NixOS logo.
|
||||
menu-button-icon-image = 23;
|
||||
|
||||
menu-button-terminal =
|
||||
if config.plusultra.desktop.addons.term.enable
|
||||
then lib.getExe config.plusultra.desktop.addons.term.pkg
|
||||
else lib.getExe pkgs.gnome.gnome-terminal;
|
||||
};
|
||||
|
||||
"org/gnome/shell/extensions/aylurs-widgets" = {
|
||||
background-clock = false;
|
||||
battery-bar = false;
|
||||
dash-board = false;
|
||||
date-menu-date-format = "%H:%M %B %d";
|
||||
date-menu-hide-clocks = true;
|
||||
date-menu-hide-system-levels = true;
|
||||
date-menu-hide-user = true;
|
||||
|
||||
# Hide the indincator
|
||||
date-menu-indicator-position = 2;
|
||||
|
||||
media-player = false;
|
||||
media-player-prefer = "firefox";
|
||||
notification-indicator = false;
|
||||
power-menu = false;
|
||||
quick-toggles = false;
|
||||
workspace-indicator = false;
|
||||
};
|
||||
|
||||
"org/gnome/shell/extensions/top-bar-organizer" = {
|
||||
left-box-order = [
|
||||
"menuButton"
|
||||
"activities"
|
||||
"dateMenu"
|
||||
"appMenu"
|
||||
];
|
||||
|
||||
center-box-order = [
|
||||
"Space Bar"
|
||||
];
|
||||
|
||||
right-box-order = [
|
||||
"keyboard"
|
||||
"EmojisMenu"
|
||||
"wireless-hid"
|
||||
"drive-menu"
|
||||
"vitalsMenu"
|
||||
"screenRecording"
|
||||
"screenSharing"
|
||||
"dwellClick"
|
||||
"a11y"
|
||||
"quickSettings"
|
||||
];
|
||||
};
|
||||
|
||||
"org/gnome/shell/extensions/space-bar/shortcuts" = {
|
||||
enable-activate-workspace-shortcuts = false;
|
||||
};
|
||||
"org/gnome/shell/extensions/space-bar/behavior" = {
|
||||
show-empty-workspaces = false;
|
||||
};
|
||||
|
||||
"org/gnome/shell/extensions/gtile" = {
|
||||
show-icon = false;
|
||||
grid-sizes = "8x2,4x2,2x2";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.kdeconnect = {
|
||||
enable = true;
|
||||
package = pkgs.gnomeExtensions.gsconnect;
|
||||
};
|
||||
|
||||
# Open firewall for samba connections to work.
|
||||
networking.firewall.extraCommands = "iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns";
|
||||
};
|
||||
}
|
31
modules/nixos/desktop/gnome/monitors.xml
Normal file
31
modules/nixos/desktop/gnome/monitors.xml
Normal file
|
@ -0,0 +1,31 @@
|
|||
<monitors version="2">
|
||||
<configuration>
|
||||
<logicalmonitor>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<scale>1</scale>
|
||||
<primary>yes</primary>
|
||||
<monitor>
|
||||
<monitorspec>
|
||||
<connector>DP-3</connector>
|
||||
<vendor>DEL</vendor>
|
||||
<product>Dell U4919DW</product>
|
||||
<serial>D3TXTY2</serial>
|
||||
</monitorspec>
|
||||
<mode>
|
||||
<width>5120</width>
|
||||
<height>1440</height>
|
||||
<rate>59.976879119873047</rate>
|
||||
</mode>
|
||||
</monitor>
|
||||
</logicalmonitor>
|
||||
<disabled>
|
||||
<monitorspec>
|
||||
<connector>HDMI-2</connector>
|
||||
<vendor>AOC</vendor>
|
||||
<product>28E850</product>
|
||||
<serial>0x00000000</serial>
|
||||
</monitorspec>
|
||||
</disabled>
|
||||
</configuration>
|
||||
</monitors>
|
BIN
modules/nixos/desktop/sway/background.png
Normal file
BIN
modules/nixos/desktop/sway/background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 MiB |
274
modules/nixos/desktop/sway/config
Normal file
274
modules/nixos/desktop/sway/config
Normal file
|
@ -0,0 +1,274 @@
|
|||
###########################################
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
#░░█▀█░█░░░█░█░█▀▀░░░█░█░█░░░▀█▀░█▀▄░█▀█░░#
|
||||
#░░█▀▀░█░░░█░█░▀▀█░░░█░█░█░░░░█░░█▀▄░█▀█░░#
|
||||
#░░▀░░░▀▀▀░▀▀▀░▀▀▀░░░▀▀▀░▀▀▀░░▀░░▀░▀░▀░▀░░#
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
###########################################
|
||||
|
||||
|
||||
#########################################
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
#░░█░█░█▀█░█▀▄░▀█▀░█▀█░█▀▄░█░░░█▀▀░█▀▀░░#
|
||||
#░░▀▄▀░█▀█░█▀▄░░█░░█▀█░█▀▄░█░░░█▀▀░▀▀█░░#
|
||||
#░░░▀░░▀░▀░▀░▀░▀▀▀░▀░▀░▀▀░░▀▀▀░▀▀▀░▀▀▀░░#
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
#########################################
|
||||
|
||||
# Modifier key (Mod1 = Alt, Mod4 = Meta)
|
||||
set $mod Mod4
|
||||
|
||||
# Movement keys
|
||||
set $left h
|
||||
set $down j
|
||||
set $up k
|
||||
set $right l
|
||||
|
||||
# Terminal
|
||||
set $term env @term@
|
||||
|
||||
# Swaylock
|
||||
set $swaylock swaylock-fancy -f "Hack-Regular-Nerd-Font-Complete"
|
||||
|
||||
# Menu
|
||||
set $menu-run wofi --show drun --prompt search
|
||||
|
||||
# Output names
|
||||
set $laptop-screen eDP-1
|
||||
# set $monitor-left HDMI-A-1
|
||||
# set $monitor-center HDMI-A-2
|
||||
|
||||
# Workspace names
|
||||
set $workspace1 1
|
||||
set $workspace2 2
|
||||
set $workspace3 3
|
||||
set $workspace4 4
|
||||
set $workspace5 5
|
||||
set $workspace6 6
|
||||
set $workspace7 7
|
||||
set $workspace8 8
|
||||
set $workspace9 9
|
||||
set $workspace10 10
|
||||
|
||||
#############################
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
#░░█▀█░█░█░▀█▀░█▀█░█░█░▀█▀░░#
|
||||
#░░█░█░█░█░░█░░█▀▀░█░█░░█░░░#
|
||||
#░░▀▀▀░▀▀▀░░▀░░▀░░░▀▀▀░░▀░░░#
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
#############################
|
||||
|
||||
# Backgrounds
|
||||
# output $monitor-left bg /home/short/Photos/wallpapers/left.jpg fill
|
||||
# output $monitor-center bg /home/short/Photos/wallpapers/center.jpg fill
|
||||
|
||||
# Positioning
|
||||
# output $monitor-left resolution 1920x1080 position 0,300
|
||||
# output $monitor-center resolution 1920x1080 position 1920,0
|
||||
|
||||
###################################################
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
#░░█░█░█▀▀░█░█░░░█▀▄░▀█▀░█▀█░█▀▄░▀█▀░█▀█░█▀▀░█▀▀░░#
|
||||
#░░█▀▄░█▀▀░░█░░░░█▀▄░░█░░█░█░█░█░░█░░█░█░█░█░▀▀█░░#
|
||||
#░░▀░▀░▀▀▀░░▀░░░░▀▀░░▀▀▀░▀░▀░▀▀░░▀▀▀░▀░▀░▀▀▀░▀▀▀░░#
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
###################################################
|
||||
|
||||
# Start a terminal
|
||||
bindsym $mod+Return exec $term
|
||||
|
||||
# Kill focused window
|
||||
bindsym $mod+q kill
|
||||
|
||||
# Reload configuration
|
||||
bindsym $mod+Shift+r reload
|
||||
|
||||
# Exit sway
|
||||
bindsym $mod+Shift+e exit
|
||||
|
||||
# Lock
|
||||
bindsym $mod+Control+l exec $swaylock
|
||||
|
||||
# Open run menu
|
||||
bindsym $mod+d exec $menu-run
|
||||
|
||||
# Drag floating windows while holding down modifier key
|
||||
floating_modifier $mod normal
|
||||
|
||||
# Sticky windows
|
||||
bindsym $mod+Shift+s sticky toggle
|
||||
|
||||
# Toggle fullscreen
|
||||
bindsym $mod+f fullscreen
|
||||
|
||||
# Toggle floating
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# Toggle floating focus
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
# Focus the parent container
|
||||
bindsym $mod+a focus parent
|
||||
|
||||
# Focus the child container
|
||||
bindsym $mod+c focus child
|
||||
|
||||
# Split horizontal
|
||||
bindsym $mod+b splith
|
||||
|
||||
# Split vertical
|
||||
bindsym $mod+v splitv
|
||||
|
||||
# Move window into scratchpad
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
|
||||
# Get window out of scratchpad
|
||||
bindsym $mod+minus scratchpad show
|
||||
|
||||
# Change layout style
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
bindsym $mod+Shift+v layout splitv
|
||||
bindsym $mod+Shift+b layout splith
|
||||
|
||||
# Moving focus
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
bindsym $mod+$up focus up
|
||||
bindsym $mod+$right focus right
|
||||
|
||||
# Moving windows
|
||||
bindsym $mod+Shift+$left move left
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$right move right
|
||||
|
||||
# Switching workspace
|
||||
bindsym $mod+1 workspace $workspace1
|
||||
bindsym $mod+2 workspace $workspace2
|
||||
bindsym $mod+3 workspace $workspace3
|
||||
bindsym $mod+4 workspace $workspace4
|
||||
bindsym $mod+5 workspace $workspace5
|
||||
bindsym $mod+6 workspace $workspace6
|
||||
bindsym $mod+7 workspace $workspace7
|
||||
bindsym $mod+8 workspace $workspace8
|
||||
bindsym $mod+9 workspace $workspace9
|
||||
bindsym $mod+0 workspace $workspace10
|
||||
|
||||
# Moving windows to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace $workspace1
|
||||
bindsym $mod+Shift+2 move container to workspace $workspace2
|
||||
bindsym $mod+Shift+3 move container to workspace $workspace3
|
||||
bindsym $mod+Shift+4 move container to workspace $workspace4
|
||||
bindsym $mod+Shift+5 move container to workspace $workspace5
|
||||
bindsym $mod+Shift+6 move container to workspace $workspace6
|
||||
bindsym $mod+Shift+7 move container to workspace $workspace7
|
||||
bindsym $mod+Shift+8 move container to workspace $workspace8
|
||||
bindsym $mod+Shift+9 move container to workspace $workspace9
|
||||
bindsym $mod+Shift+0 move container to workspace $workspace10
|
||||
|
||||
# Brightness
|
||||
bindsym XF86MonBrightnessUp exec brightnessctl set 5%+
|
||||
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
|
||||
|
||||
# Sound
|
||||
bindsym XF86AudioMute exec pulsemixer --toggle-mute
|
||||
bindsym XF86AudioRaiseVolume exec pulsemixer --change-volume +10
|
||||
bindsym XF86AudioLowerVolume exec pulsemixer --change-volume -10
|
||||
|
||||
# Media
|
||||
bindsym XF86AudioPrev exec playerctl previous
|
||||
bindsym XF86AudioPlay exec playerctl play-pause
|
||||
bindsym XF86AudioNext exec playerctl next
|
||||
|
||||
# Print screen
|
||||
bindsym Print exec grimshot --notify save screen - | swappy -f -
|
||||
bindsym Shift+Print exec grimshot --notify save area - | swappy -f -
|
||||
bindsym Control+Print exec grimshot --notify save window - | swappy -f -
|
||||
bindsym $mod+Print exec grimshot --notify copy screen
|
||||
bindsym $mod+Shift+Print exec grimshot --notify copy area
|
||||
bindsym $mod+Control+Print exec grimshot --notify copy window
|
||||
|
||||
# Airplane mode
|
||||
# bindsym XF86RFKill exec nmcli radio all $(test $(nmcli -g wifi radio all) == "enabled" && "off" || echo "on")
|
||||
|
||||
# Resize mode
|
||||
mode "resize" {
|
||||
# Shrink the width
|
||||
bindsym $left resize shrink width 10px
|
||||
|
||||
# Grow the width
|
||||
bindsym $right resize grow width 10px
|
||||
|
||||
# Grow the height
|
||||
bindsym $up resize grow height 10px
|
||||
|
||||
# Shrink the height
|
||||
bindsym $down resize shrink height 10px
|
||||
|
||||
# Return to default mode
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
# Enter resize mode
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
######################
|
||||
#░░░░░░░░░░░░░░░░░░░░#
|
||||
#░▀█▀░█▀█░█▀█░█░█░▀█▀#
|
||||
#░░█░░█░█░█▀▀░█░█░░█░#
|
||||
#░▀▀▀░▀░▀░▀░░░▀▀▀░░▀░#
|
||||
#░░░░░░░░░░░░░░░░░░░░#
|
||||
######################
|
||||
|
||||
input type:keyboard {
|
||||
xkb_options caps:swapescape
|
||||
}
|
||||
|
||||
input type:touchpad {
|
||||
natural_scroll enabled
|
||||
tap enabled
|
||||
tap_button_map lrm
|
||||
}
|
||||
|
||||
#################
|
||||
#░░░░░░░░░░░░░░░#
|
||||
#░░█▀▄░█▀█░█▀▄░░#
|
||||
#░░█▀▄░█▀█░█▀▄░░#
|
||||
#░░▀▀░░▀░▀░▀░▀░░#
|
||||
#░░░░░░░░░░░░░░░#
|
||||
#################
|
||||
|
||||
bar {
|
||||
# Run waybar
|
||||
swaybar_command waybar
|
||||
}
|
||||
|
||||
#########################
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
#░░█▀▀░▀█▀░█░█░█░░░█▀▀░░#
|
||||
#░░▀▀█░░█░░░█░░█░░░█▀▀░░#
|
||||
#░░▀▀▀░░▀░░░▀░░▀▀▀░▀▀▀░░#
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
#########################
|
||||
|
||||
# Remove title bars
|
||||
default_border pixel 1
|
||||
default_floating_border pixel 1
|
||||
|
||||
client.focused #8fbcbb #8fbcbb #eceff4 #eceff4
|
||||
client.focused_inactive #2E3440 #2E3440 #e5e9f0 #5e81ac
|
||||
client.unfocused #3b4252 #3b4252 #4c566a #5e81ac
|
||||
client.urgent #d08770 #d08770 #eceff4 #bf616a
|
||||
|
||||
for_window [app_id="wofi"] border none
|
||||
# for_window [app_id="firefox"] border none
|
||||
|
||||
# Don't focus moused over windows
|
||||
focus_follows_mouse no
|
||||
|
||||
# Gaps
|
||||
gaps outer 4
|
||||
gaps inner 5
|
148
modules/nixos/desktop/sway/default.nix
Normal file
148
modules/nixos/desktop/sway/default.nix
Normal file
|
@ -0,0 +1,148 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let
|
||||
cfg = config.plusultra.desktop.sway;
|
||||
term = config.plusultra.desktop.addons.term;
|
||||
substitutedConfig = pkgs.substituteAll {
|
||||
src = ./config;
|
||||
term = term.pkg.pname or term.pkg.name;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.plusultra.desktop.sway = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable Sway.";
|
||||
wallpaper = mkOpt (nullOr package) null "The wallpaper to display.";
|
||||
extraConfig =
|
||||
mkOpt str "" "Additional configuration for the Sway config file.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Desktop additions
|
||||
plusultra.desktop.addons = {
|
||||
gtk = enabled;
|
||||
foot = enabled;
|
||||
mako = enabled;
|
||||
rofi = enabled;
|
||||
wofi = enabled;
|
||||
swappy = enabled;
|
||||
kanshi = enabled;
|
||||
waybar = enabled;
|
||||
keyring = enabled;
|
||||
nautilus = enabled;
|
||||
xdg-portal = enabled;
|
||||
electron-support = enabled;
|
||||
};
|
||||
|
||||
plusultra.home.configFile."sway/config".text =
|
||||
fileWithText substitutedConfig ''
|
||||
#############################
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
#░░█▀▀░█░█░█▀▀░▀█▀░█▀▀░█▄█░░#
|
||||
#░░▀▀█░░█░░▀▀█░░█░░█▀▀░█░█░░#
|
||||
#░░▀▀▀░░▀░░▀▀▀░░▀░░▀▀▀░▀░▀░░#
|
||||
#░░░░░░░░░░░░░░░░░░░░░░░░░░░#
|
||||
#############################
|
||||
|
||||
# Launch services waiting for the systemd target sway-session.target
|
||||
exec "systemctl --user import-environment; systemctl --user start sway-session.target"
|
||||
|
||||
# Start a user session dbus (required for things like starting
|
||||
# applications through wofi).
|
||||
exec dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus
|
||||
|
||||
${optionalString (cfg.wallpaper != null) ''
|
||||
output * {
|
||||
bg ${cfg.wallpaper.gnomeFilePath or cfg.wallpaper} fill
|
||||
}
|
||||
''}
|
||||
|
||||
${cfg.extraConfig}
|
||||
'';
|
||||
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
rofi
|
||||
swaylock
|
||||
swayidle
|
||||
xwayland
|
||||
sway-contrib.grimshot
|
||||
swaylock-fancy
|
||||
wl-clipboard
|
||||
wf-recorder
|
||||
libinput
|
||||
playerctl
|
||||
brightnessctl
|
||||
glib # for gsettings
|
||||
gtk3.out # for gtk-launch
|
||||
gnome.gnome-control-center
|
||||
];
|
||||
|
||||
extraSessionCommands = ''
|
||||
export SDL_VIDEODRIVER=wayland
|
||||
export QT_QPA_PLATFORM=wayland
|
||||
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
|
||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||
export MOZ_ENABLE_WAYLAND=1
|
||||
export XDG_SESSION_TYPE=wayland
|
||||
export XDG_SESSION_DESKTOP=sway
|
||||
export XDG_CURRENT_DESKTOP=sway
|
||||
'';
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs;
|
||||
[
|
||||
(pkgs.writeTextFile {
|
||||
name = "startsway";
|
||||
destination = "/bin/startsway";
|
||||
executable = true;
|
||||
text = ''
|
||||
#! ${pkgs.bash}/bin/bash
|
||||
|
||||
# Import environment variables from the login manager
|
||||
systemctl --user import-environment
|
||||
|
||||
# Start Sway
|
||||
exec systemctl --user start sway.service
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
||||
# configuring sway itself (assmung a display manager starts it)
|
||||
systemd.user.targets.sway-session = {
|
||||
description = "Sway compositor session";
|
||||
documentation = [ "man:systemd.special(7)" ];
|
||||
bindsTo = [ "graphical-session.target" ];
|
||||
wants = [ "graphical-session-pre.target" ];
|
||||
after = [ "graphical-session-pre.target" ];
|
||||
};
|
||||
|
||||
systemd.user.services.sway = {
|
||||
description = "Sway - Wayland window manager";
|
||||
documentation = [ "man:sway(5)" ];
|
||||
bindsTo = [ "graphical-session.target" ];
|
||||
wants = [ "graphical-session-pre.target" ];
|
||||
after = [ "graphical-session-pre.target" ];
|
||||
# We explicitly unset PATH here, as we want it to be set by
|
||||
# systemctl --user import-environment in startsway
|
||||
environment.PATH = lib.mkForce null;
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = ''
|
||||
${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway --debug
|
||||
'';
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
TimeoutStopSec = 10;
|
||||
};
|
||||
};
|
||||
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.defaultSession = "sway";
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.displayManager.gdm.wayland = true;
|
||||
services.xserver.libinput.enable = true;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue