1
0
mirror of https://github.com/ellmau/nixos.git synced 2025-12-19 09:29:36 +01:00

Add nixosConfiguration-awareness to the homemanager module

This commit is contained in:
Stefan Ellmauthaler 2022-08-18 10:59:04 +02:00
parent f81d99efbd
commit 1b56086048
Failed to extract signature
12 changed files with 509 additions and 452 deletions

View File

@ -69,6 +69,7 @@ with lib; {
environment.systemPackages = with pkgs; [
firefox
thunderbird # v102 has various starting time issues - so back to stable
ungoogled-chromium
okular
texlive.combined.scheme-full
usbutils

View File

@ -71,6 +71,7 @@ with lib; {
environment.systemPackages = with pkgs; [
gnome3.adwaita-icon-theme
wl-clipboard
wl-mirror
networkmanagerapplet
pavucontrol
pamixer

View File

@ -1,120 +1,127 @@
{ config, pkgs, lib, ...}:
{
programs.autorandr = {
enable = true;
profiles = {
"home" = {
fingerprint = {
DP-1 = "00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
};
config = {
eDP-1.enable = false;
DP-1 = {
enable = true;
crtc = 1;
primary = true;
position = "0x0";
mode = "3840x2160";
dpi = 96;
};
};
};
"mobile" = {
fingerprint.eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
config = {
eDP-1 = {
enable = true;
primary = true;
mode = "3840x2160";
dpi = 192;
};
};
};
"work" = {
fingerprint = {
eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
DP-2 = "00ffffffffffff0010acb5414c4133452c1e0104b53c22783eee95a3544c99260f5054a54b00e1c0d100d1c0b300a94081808100714f4dd000a0f0703e803020350055502100001a000000ff0031444e593132330a2020202020000000fd00184b1e8c36010a202020202020000000fc0044454c4c205532373230510a2001af020319f14c101f2005140413121103020123097f0783010000a36600a0f0703e803020350055502100001a565e00a0a0a029503020350055502100001a114400a0800025503020360055502100001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9";
};
config = {
eDP-1 = {
enable = true;
crtc = 0;
position = "3840x0";
mode = "3840x2160";
#dpi = 288;
dpi = 96;
};
DP-2 = {
enable = true;
primary = true;
mode = "3840x2160";
#dpi = 144;
dpi = 96;
position = "0x0";
};
};
};
"home-nuc" = {
fingerprint = {
DP-2 = "00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
};
config = {
DP-2 = {
enable = true;
crtc = 1;
primary = true;
position = "0x0";
mode = "3840x2160";
dpi = 96;
};
};
};
{ config, pkgs, lib, nixosConfig, ... }:
with lib; {
config =
let
cfg = nixosConfig.elss.graphical.i3;
in
mkIf cfg.enable {
"e3027" = {
fingerprint = {
e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
DP-1 = "00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
};
config = {
eDP-1 = {
enable = true;
crtc = 0;
position = "0x0";
mode = "3840x2160";
programs.autorandr = {
enable = true;
profiles = {
"home" = {
fingerprint = {
DP-1 = "00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
};
config = {
eDP-1.enable = false;
DP-1 = {
enable = true;
crtc = 1;
primary = true;
position = "0x0";
mode = "3840x2160";
dpi = 96;
};
};
};
DP-1 = {
enable = true;
crtc = 1;
position = "3840x0";
mode = "1920x1200";
"mobile" = {
fingerprint.eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
config = {
eDP-1 = {
enable = true;
primary = true;
mode = "3840x2160";
dpi = 192;
};
};
};
"work" = {
fingerprint = {
eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
DP-2 = "00ffffffffffff0010acb5414c4133452c1e0104b53c22783eee95a3544c99260f5054a54b00e1c0d100d1c0b300a94081808100714f4dd000a0f0703e803020350055502100001a000000ff0031444e593132330a2020202020000000fd00184b1e8c36010a202020202020000000fc0044454c4c205532373230510a2001af020319f14c101f2005140413121103020123097f0783010000a36600a0f0703e803020350055502100001a565e00a0a0a029503020350055502100001a114400a0800025503020360055502100001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9";
};
config = {
eDP-1 = {
enable = true;
crtc = 0;
position = "3840x0";
mode = "3840x2160";
#dpi = 288;
dpi = 96;
};
DP-2 = {
enable = true;
primary = true;
mode = "3840x2160";
#dpi = 144;
dpi = 96;
position = "0x0";
};
};
};
"home-nuc" = {
fingerprint = {
DP-2 = "00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
};
config = {
DP-2 = {
enable = true;
crtc = 1;
primary = true;
position = "0x0";
mode = "3840x2160";
dpi = 96;
};
};
};
};
};
"e3027-clone" = {
fingerprint = {
e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
DP-1 = "00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
"e3027" = {
fingerprint = {
e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
DP-1 = "00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
};
config = {
eDP-1 = {
enable = true;
crtc = 0;
position = "0x0";
mode = "3840x2160";
};
DP-1 = {
enable = true;
crtc = 1;
position = "3840x0";
mode = "1920x1200";
};
};
};
"e3027-clone" = {
fingerprint = {
e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
DP-1 = "00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
};
config = {
eDP-1 = {
enable = true;
crtc = 0;
position = "0x0";
mode = "1920x1200";
};
DP-1 = {
enable = true;
crtc = 1;
position = "0x0";
mode = "1920x1200";
};
};
};
};
config = {
eDP-1 = {
enable = true;
crtc = 0;
position = "0x0";
mode = "1920x1200";
};
DP-1 = {
enable = true;
crtc = 1;
position = "0x0";
mode = "1920x1200";
};
hooks.postswitch = {
"polybar" = "systemctl --user restart polybar.service";
};
};
};
hooks.postswitch = {
"polybar" = "systemctl --user restart polybar.service";
};
};
}

View File

@ -1,15 +1,15 @@
{ config, lib, pkgs, ... }:
{
imports = [
# ./autorandr.nix
# ./dunst.nix
./autorandr.nix
./dunst.nix
./git.nix
./gpg.nix
./i3.nix
./kanshi.nix
./mako.nix
./nextcloud.nix
# ./polybar.nix
./polybar.nix
./zsh.nix
./sway.nix

View File

@ -1,37 +1,43 @@
{ config, pkgs, ...}:
{
services.dunst = {
iconTheme = {
package = pkgs.numix-icon-theme;
name = "Numix";
size = "26";
};
settings = {
global = {
geometry = "800x5-30+50";
transparency = 10;
frame_color = "#839496";
font = "Hasklug Nerd Font 10";
timeout = 5;
follow = "mouse";
markup = "full";
icon_position = "left";
history_length = 32;
dmenu = "${pkgs.rofi}/bin/rofi -dmenu";
word_wrap = true;
};
urgency_critical = {
foreground = "#fdf6e3";
background = "#dc322f";
};
urgency_normal = {
foreground = "#fdf6e3";
background = "#859900";
};
urgency_low = {
foreground = "#fdf6e3";
background = "#2aa198";
{ config, pkgs, lib, nixosConfig, ... }:
with lib; {
config =
let
cfg = nixosConfig.elss.graphical.i3;
in
mkIf cfg.enable {
services.dunst = {
iconTheme = {
package = pkgs.numix-icon-theme;
name = "Numix";
size = "26";
};
settings = {
global = {
geometry = "800x5-30+50";
transparency = 10;
frame_color = "#839496";
font = "Hasklug Nerd Font 10";
timeout = 5;
follow = "mouse";
markup = "full";
icon_position = "left";
history_length = 32;
dmenu = "${pkgs.rofi}/bin/rofi -dmenu";
word_wrap = true;
};
urgency_critical = {
foreground = "#fdf6e3";
background = "#dc322f";
};
urgency_normal = {
foreground = "#fdf6e3";
background = "#859900";
};
urgency_low = {
foreground = "#fdf6e3";
background = "#2aa198";
};
};
};
};
};
}

View File

@ -1,9 +1,15 @@
{ config, pkgs, lib, ...}:
{
xdg = {
configFile."i3" = {
source = conf/i3;
recursive = true;
{ config, pkgs, lib, nixosConfig, ... }:
with lib; {
config =
let
cfg = nixosConfig.elss.graphical;
in
mkIf cfg.enable {
xdg = {
configFile."i3" = {
source = conf/i3;
recursive = true;
};
};
};
};
}

View File

@ -1,27 +1,33 @@
{ config, pkgs, ...}:
{
services.kanshi = {
enable = true;
profiles = {
work = {
outputs = [
{
criteria = "Dell Inc. DELL U2720Q 1DNY123";
position = "1920,0";
}
{
criteria = "eDP-1";
position = "5760,0";
}
];
};
unplugged = {
outputs = [
{
criteria = "eDP-1";
}
];
{ config, pkgs, lib, nixosConfig, ... }:
with lib; {
config =
let
cfg = nixosConfig.elss.graphical.sway;
in
mkIf cfg.enable {
services.kanshi = {
enable = true;
profiles = {
work = {
outputs = [
{
criteria = "Dell Inc. DELL U2720Q 1DNY123";
position = "1920,0";
}
{
criteria = "eDP-1";
position = "5760,0";
}
];
};
unplugged = {
outputs = [
{
criteria = "eDP-1";
}
];
};
};
};
};
};
}

View File

@ -1,14 +1,20 @@
{ config, pkgs, lib, nixosConfig, ... }:
with lib; {
config =
let
cfg = nixosConfig.elss.graphical.sway;
in
mkIf cfg.enable {
{ config, pkgs, ...}:
{
programs.mako = {
enable = true;
iconPath = "${pkgs.numix-icon-theme}";
font = "Hasklug Nerd Font 10";
defaultTimeout = 8000;
# ignoreTimeout = true;
};
programs.mako = {
enable = true;
iconPath = "${pkgs.numix-icon-theme}";
font = "Hasklug Nerd Font 10";
defaultTimeout = 8000;
# ignoreTimeout = true;
home.packages = [ pkgs.numix-icon-theme ];
};
home.packages = [ pkgs.numix-icon-theme ];
};
}

View File

@ -1,7 +1,13 @@
{ pkgs, ... }:
{
services.nextcloud-client = {
enable = true;
startInBackground = true;
};
{ config, pkgs, lib, nixosConfig, ... }:
with lib; {
config =
let
cfg = nixosConfig.elss.graphical;
in
mkIf cfg.enable {
services.nextcloud-client = {
enable = true;
startInBackground = true;
};
};
}

View File

@ -1,58 +1,63 @@
{ config, pkgs, ...}:
{
services.polybar = {
enable = true;
package = pkgs.polybarFull;
settings =
let
# solarized theme colours ~ https://en.wikipedia.org/wiki/Solarized
{ config, pkgs, lib, nixosConfig, ... }:
with lib; {
config =
let
cfg = nixosConfig.elss.graphical.i3;
in
mkIf cfg.enable {
services.polybar = {
enable = true;
package = pkgs.polybarFull;
settings =
let
# solarized theme colours ~ https://en.wikipedia.org/wiki/Solarized
#content tones
Base01 = "#586e75";
Base00 = "#657b83";
Base0 = "#839496";
Base1 = "#93a1a1";
# background tones
Base2 = "#eee8d5";
Base3 = "#fdf6e3";
# accent tones
Yellow = "#b58900";
Orange = "#cb4b16";
Red = "#dc322f";
Magenta = "#d33682";
Violet = "#6c71c4";
Blue = "#268bd2";
Cyan = "#2aa198";
Green = "#859900";
#content tones
Base01 = "#586e75";
Base00 = "#657b83";
Base0 = "#839496";
Base1 = "#93a1a1";
# background tones
Base2 = "#eee8d5";
Base3 = "#fdf6e3";
# accent tones
Yellow = "#b58900";
Orange = "#cb4b16";
Red = "#dc322f";
Magenta = "#d33682";
Violet = "#6c71c4";
Blue = "#268bd2";
Cyan = "#2aa198";
Green = "#859900";
foreground_col = Base3;
background_col = Base01;
foreground_col = Base3;
background_col = Base01;
# old bg/fg stuff
#foreground_col = "#eee8d5";
#background_col = "#6c71c4";
foreground_altcol = "#66deff";
primary_col = "#ffb52a";
secondary_col = "#e60053";
alert_col = "#dc322f";
# old bg/fg stuff
#foreground_col = "#eee8d5";
#background_col = "#6c71c4";
foreground_altcol = "#66deff";
primary_col = "#ffb52a";
secondary_col = "#e60053";
alert_col = "#dc322f";
dpi = ''
''${env:DPI:0}
'';
dpi = ''
''${env:DPI:0}
'';
#polyheight = 60;
fonts = [
"Hasklig:style=Regular"
"all-the-icons:style=Regular"
"Webdings:style=Regular"
"Noto Emoji:scale=10"
"Unifont:style=Regular"
"Material Icons:size=12;0"
"Weather Icons:size=12;0"
"Hasklug Nerd Font,Hasklig Medium:style=Medium,Regular"
];
in
#polyheight = 60;
fonts = [
"Hasklig:style=Regular"
"all-the-icons:style=Regular"
"Webdings:style=Regular"
"Noto Emoji:scale=10"
"Unifont:style=Regular"
"Material Icons:size=12;0"
"Weather Icons:size=12;0"
"Hasklug Nerd Font,Hasklig Medium:style=Medium,Regular"
];
in
{
"bar/main" = {
font = fonts;
@ -66,8 +71,8 @@
foreground = foreground_col;
monitor = ''
''${env:MONITOR:}
'';
''${env:MONITOR:}
'';
width = "100%";
#height = polyheight;
padding = 0;
@ -75,10 +80,10 @@
radius = 14;
module-margin = 1;
line-size = 2;
dpi-x = dpi;
dpi-y = dpi;
tray = {
position = "right";
padding = 2;
@ -97,8 +102,8 @@
foreground = foreground_col;
monitor = ''
''${env:MONITOR:}
'';
''${env:MONITOR:}
'';
width = "100%";
#height = polyheight;
radius = 14;
@ -108,18 +113,18 @@
dpi-x = dpi;
dpi-y = dpi;
};
"module/volume" = {
type = "internal/pulseaudio";
format.volume = "<ramp-volume> <label-volume>";
label.muted.text = "🔇";
label.muted.foreground = "#666";
ramp.volume = ["🔈" "🔉" "🔊"];
ramp.volume = [ "🔈" "🔉" "🔊" ];
click.right = "${pkgs.pavucontrol}/bin/pavucontrol &";
# format-volume-underline = Base2;
# format-muted-underline = Base2;
};
"module/i3" = {
"module/i3" = {
type = "internal/i3";
format = "<label-state> <label-mode>";
index-sort = "true";
@ -137,7 +142,7 @@
#;label-focused-background = ${colors.background-alt}
#;label-focused-background = #9f78e1
label-focused-background = foreground_col;
label-focused-underline= foreground_col;
label-focused-underline = foreground_col;
label-focused-foreground = background_col;
label-focused-padding = "2";
@ -157,7 +162,7 @@
label-urgent-background = alert_col;
label-urgent-foreground = primary_col;
label-urgent-padding = "2";
#; Separator in between workspaces
#; label-separator = |
};
@ -211,7 +216,7 @@
format-connected = " <label-connected>";
format-connected-prefix-foreground = foreground_altcol;
label-connected = "%local_ip%";
format-disconnected = "";
format-disconnected-background = "#5479b7";
#;format-disconnected = <label-disconnected>
@ -241,12 +246,12 @@
adapter = "ADP1";
full-at = "98";
format-charging-background= "#689d6a";
format-charging-prefix = ''" "'';
format-charging-background = "#689d6a";
format-charging-prefix = ''" "'';
format-charging = "<label-charging>";
format-discharging-prefix = ''" "'';
format-discharging = "<label-discharging>";
format-discharging-background= "#689d6a";
format-discharging-background = "#689d6a";
format-full-prefix = ''" "'';
format-charging-underline = "#ffaa55";
@ -306,7 +311,7 @@
menu-2-1 = "cancel";
menu-2-1-exec = "menu-open-0";
};
"module/xbacklight" = {
type = "internal/xbacklight";
@ -343,13 +348,14 @@
label = "%title%";
};
};
script = ''
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
MONITOR=$m polybar --reload main &
done;
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep -v '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
MONITOR=$m polybar --reload aux &
done;
'';
script = ''
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
MONITOR=$m polybar --reload main &
done;
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep -v '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
MONITOR=$m polybar --reload aux &
done;
'';
};
};
}

View File

@ -1,111 +1,117 @@
{ config, pkgs, lib, ... }:
{
services = {
blueman-applet.enable = true;
swayidle = {
enable = true;
events = [
{ event = "before-sleep"; command = "swaylock -KfeFi ~/.background-image"; }
{ event = "lock"; command = "swaylock -KfeFi ~/.background-image"; }
];
timeouts = [
{ timeout = 60; command = "swaylock -KfeFi ~/.background-image"; }
];
};
};
home.file.".background-image".source = ../../common/wallpaper/nix-wallpaper-nineish-dark-gray.png;
{ config, pkgs, lib, nixosConfig, ... }:
with lib; {
config =
let
cfg = nixosConfig.elss.graphical.sway;
in
mkIf cfg.enable {
services = {
blueman-applet.enable = true;
swayidle = {
enable = true;
events = [
gtk.enable = true;
home.packages = [
pkgs.gnome-icon-theme
pkgs.swaylock
pkgs.pulseaudioFull
];
wayland.windowManager.sway = {
enable = true;
config = {
down = "k";
up = "l";
left = "j";
right = "semicolon";
modifier = "Mod4";
keybindings =
let
modifier = config.wayland.windowManager.sway.config.modifier;
bctl = "${pkgs.brightnessctl}/bin/brightnessctl";
in
lib.mkOptionDefault {
"${modifier}+Shift+q" = "kill";
"${modifier}+d" = "exec ${pkgs.rofi}/bin/rofi -show drun";
"${modifier}+Tab" = "exec ${pkgs.rofi}/bin/rofi -show window";
"${modifier}+BackSpace" = ''mode "$mode_system"'';
XF86MonBrightnessDown = "exec ${bctl} s 2%-";
XF86MonBrightnessUp = "exec ${bctl} s 2%+";
XF86AudioMute = "exec ${pkgs.pamixer}/bin/pamixer -t";
XF86AudioLowerVolume = "exec ${pkgs.pulseaudioFull}/bin/pactl set-sink-volume @DEFAULT_SINK@ -10%";
XF86AudioRaiseVolume = "exec ${pkgs.pulseaudioFull}/bin/pactl set-sink-volume @DEFAULT_SINK@ +10%";
{ event = "before-sleep"; command = "swaylock -KfeFi ~/.background-image"; }
{ event = "lock"; command = "swaylock -KfeFi ~/.background-image"; }
];
timeouts = [
{ timeout = 60; command = "swaylock -KfeFi ~/.background-image"; }
];
};
keycodebindings =
let
modifier = config.wayland.windowManager.sway.config.modifier;
in
{ };
startup = [
{
command = "--no-startup-id nm-applet --indicator";
always = true;
}
{
command = "--no-startup-id blueman-applet";
always = true;
}
{
command = "--no-startup-id systemctl --user restart waybar.service";
always = true;
}
{
command = "--no-startup-id .config/i3/keepassxc.sh";
}
{
command = ''--no-startup-id swaymsg output "*" bg .background-image fill'';
always = true;
}
];
terminal = "alacritty";
window = {
titlebar = true;
};
home.file.".background-image".source = ../../common/wallpaper/nix-wallpaper-nineish-dark-gray.png;
bars = [ ];
gtk.enable = true;
home.packages = [
pkgs.gnome-icon-theme
pkgs.swaylock
pkgs.pulseaudioFull
];
wayland.windowManager.sway = {
enable = true;
config = {
down = "k";
up = "l";
left = "j";
right = "semicolon";
modifier = "Mod4";
keybindings =
let
modifier = config.wayland.windowManager.sway.config.modifier;
bctl = "${pkgs.brightnessctl}/bin/brightnessctl";
in
lib.mkOptionDefault {
"${modifier}+Shift+q" = "kill";
"${modifier}+d" = "exec ${pkgs.rofi}/bin/rofi -show drun";
"${modifier}+Tab" = "exec ${pkgs.rofi}/bin/rofi -show window";
"${modifier}+BackSpace" = ''mode "$mode_system"'';
XF86MonBrightnessDown = "exec ${bctl} s 2%-";
XF86MonBrightnessUp = "exec ${bctl} s 2%+";
XF86AudioMute = "exec ${pkgs.pamixer}/bin/pamixer -t";
XF86AudioLowerVolume = "exec ${pkgs.pulseaudioFull}/bin/pactl set-sink-volume @DEFAULT_SINK@ -10%";
XF86AudioRaiseVolume = "exec ${pkgs.pulseaudioFull}/bin/pactl set-sink-volume @DEFAULT_SINK@ +10%";
};
keycodebindings =
let
modifier = config.wayland.windowManager.sway.config.modifier;
in
{ };
startup = [
{
command = "--no-startup-id nm-applet --indicator";
always = true;
}
{
command = "--no-startup-id blueman-applet";
always = true;
}
{
command = "--no-startup-id systemctl --user restart waybar.service";
always = true;
}
{
command = "--no-startup-id .config/i3/keepassxc.sh";
}
{
command = ''--no-startup-id swaymsg output "*" bg .background-image fill'';
always = true;
}
];
terminal = "alacritty";
window = {
titlebar = true;
};
bars = [ ];
};
extraConfig = ''
input "type:keyboard" {
xkb_layout us,de
xkb_variant euro,nodeadkeys
xkb_options grp:win_space_toggle
}
set $mode_system System (l) lock, (CTRL+e) logout, (CTRL+r) reboot, (CTRL+s) shutdown
set $i3lockwall swaylock -KfeFi ~/.background-image
mode "$mode_system" {
bindsym l exec --no-startup-id $i3lockwall, mode "default"
bindsym Ctrl+e exec --no-startup-id swaymsg exit, mode "default"
#bindsym s exec --no-startup-id $i3lockwall && systemctl suspend, mode "default"
#bindsym h exec --no-startup-id $i3lockwall && systemctl hibernate, mode "default"
bindsym Ctrl+r exec --no-startup-id systemctl reboot, mode "default"
bindsym Ctrl+s exec --no-startup-id systemctl poweroff -i, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
'';
};
};
extraConfig = ''
input "type:keyboard" {
xkb_layout us,de
xkb_variant euro,nodeadkeys
xkb_options grp:win_space_toggle
}
set $mode_system System (l) lock, (CTRL+e) logout, (CTRL+r) reboot, (CTRL+s) shutdown
set $i3lockwall swaylock -KfeFi ~/.background-image
mode "$mode_system" {
bindsym l exec --no-startup-id $i3lockwall, mode "default"
bindsym Ctrl+e exec --no-startup-id swaymsg exit, mode "default"
#bindsym s exec --no-startup-id $i3lockwall && systemctl suspend, mode "default"
#bindsym h exec --no-startup-id $i3lockwall && systemctl hibernate, mode "default"
bindsym Ctrl+r exec --no-startup-id systemctl reboot, mode "default"
bindsym Ctrl+s exec --no-startup-id systemctl poweroff -i, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
'';
};
}

View File

@ -1,85 +1,91 @@
{ config, pkgs, llib, ... }:
{
xdg.configFile."waybar/style.css" = {
source = conf/waybar/style.css;
};
programs.waybar = {
enable = true;
systemd.enable = true;
settings = {
mainBar = {
modules-left = [ "sway/workspaces" "sway/mode" ];
modules-center = [ "sway/window" ];
modules-right = [ "idle_inhibitor" "sway/language" "network#wifi" "network#base" "battery" "pulseaudio" "clock" "tray" ];
{ config, pkgs, lib, nixosConfig, ... }:
with lib; {
config =
let
cfg = nixosConfig.elss.graphical.sway;
in
mkIf cfg.enable {
xdg.configFile."waybar/style.css" = {
source = conf/waybar/style.css;
};
programs.waybar = {
enable = true;
systemd.enable = true;
settings = {
mainBar = {
modules-left = [ "sway/workspaces" "sway/mode" ];
modules-center = [ "sway/window" ];
modules-right = [ "idle_inhibitor" "sway/language" "network#wifi" "network#base" "battery" "pulseaudio" "clock" "tray" ];
"idle_inhibitor" = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
};
};
battery = {
states = {
good = 95;
warning = 30;
critical = 15;
};
format = "{capacity}% {icon}";
format-charging = "{capacity}% ";
format-plugged = "{capacity}% ";
format-alt = "{time} {icon}";
format-icons = [ "" "" "" "" "" ];
};
"clock" = {
format-alt = "{:%a, %d. %b %H:%M}";
};
"network#wifi" = {
interface = "wlp2s0";
format = "{ifname}";
format-wifi = "{essid} ({signalStrength}%) ";
format-ethernet = "{ipaddr}/{cidr} ";
format-disconnected = "wifi:";
tooltip-format = "{ifname} via {gwaddr} ";
tooltip-format-wifi = "{essid} ({signalStrength}%) ";
tooltip-format-ethernet = "{ifname} ";
tooltip-format-disconnected = "Disconnected";
max-length = 50;
};
"network#base" = {
format = "{ifname}";
format-wifi = "{essid} ({signalStrength}%) ";
format-ethernet = "{ipaddr}/{cidr} ";
format-disconnected = "";
tooltip-format = "{ifname} via {gwaddr} ";
tooltip-format-wifi = "{essid} ({signalStrength}%) ";
tooltip-format-ethernet = "{ifname} ";
tooltip-format-disconnected = "Disconnected";
max-length = 50;
};
pulseaudio = {
format = "{icon} {volume:2}%";
format-bluetooth = "{icon} {volume}%";
format-muted = "🔇";
format-icons = {
headphones = "";
default = [
"🔈"
"🔉"
"🔊"
];
};
scroll-step = 5;
on-click = "${pkgs.pamixer}/bin/pamixer -t";
on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol &";
};
"idle_inhibitor" = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
};
};
battery = {
states = {
good = 95;
warning = 30;
critical = 15;
};
format = "{capacity}% {icon}";
format-charging = "{capacity}% ";
format-plugged = "{capacity}% ";
format-alt = "{time} {icon}";
format-icons = [ "" "" "" "" "" ];
};
"clock" = {
format-alt = "{:%a, %d. %b %H:%M}";
};
"network#wifi" = {
interface = "wlp2s0";
format = "{ifname}";
format-wifi = "{essid} ({signalStrength}%) ";
format-ethernet = "{ipaddr}/{cidr} ";
format-disconnected = "wifi:";
tooltip-format = "{ifname} via {gwaddr} ";
tooltip-format-wifi = "{essid} ({signalStrength}%) ";
tooltip-format-ethernet = "{ifname} ";
tooltip-format-disconnected = "Disconnected";
max-length = 50;
};
"network#base" = {
format = "{ifname}";
format-wifi = "{essid} ({signalStrength}%) ";
format-ethernet = "{ipaddr}/{cidr} ";
format-disconnected = "";
tooltip-format = "{ifname} via {gwaddr} ";
tooltip-format-wifi = "{essid} ({signalStrength}%) ";
tooltip-format-ethernet = "{ifname} ";
tooltip-format-disconnected = "Disconnected";
max-length = 50;
};
pulseaudio = {
format = "{icon} {volume:2}%";
format-bluetooth = "{icon} {volume}%";
format-muted = "🔇";
format-icons = {
headphones = "";
default = [
"🔈"
"🔉"
"🔊"
];
};
scroll-step = 5;
on-click = "${pkgs.pamixer}/bin/pamixer -t";
on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol &";
};
};
};
};
}