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; [ environment.systemPackages = with pkgs; [
firefox firefox
thunderbird # v102 has various starting time issues - so back to stable thunderbird # v102 has various starting time issues - so back to stable
ungoogled-chromium
okular okular
texlive.combined.scheme-full texlive.combined.scheme-full
usbutils usbutils

View File

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

View File

@ -1,120 +1,127 @@
{ config, pkgs, lib, ...}: { config, pkgs, lib, nixosConfig, ... }:
{ with lib; {
programs.autorandr = { config =
enable = true; let
profiles = { cfg = nixosConfig.elss.graphical.i3;
"home" = { in
fingerprint = { mkIf cfg.enable {
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;
};
};
};
"e3027" = { programs.autorandr = {
fingerprint = { enable = true;
e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006"; profiles = {
DP-1 = "00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089"; "home" = {
}; fingerprint = {
config = { DP-1 = "00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
eDP-1 = { eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
enable = true; };
crtc = 0; config = {
position = "0x0"; eDP-1.enable = false;
mode = "3840x2160"; DP-1 = {
enable = true;
crtc = 1;
primary = true;
position = "0x0";
mode = "3840x2160";
dpi = 96;
};
};
}; };
DP-1 = { "mobile" = {
enable = true; fingerprint.eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
crtc = 1; config = {
position = "3840x0"; eDP-1 = {
mode = "1920x1200"; 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" = { "e3027" = {
fingerprint = { fingerprint = {
e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006"; e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
DP-1 = "00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089"; 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 = { hooks.postswitch = {
eDP-1 = { "polybar" = "systemctl --user restart polybar.service";
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";
};
};
} }

View File

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

View File

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

View File

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

View File

@ -1,27 +1,33 @@
{ config, pkgs, ...}: { config, pkgs, lib, nixosConfig, ... }:
{ with lib; {
services.kanshi = { config =
enable = true; let
profiles = { cfg = nixosConfig.elss.graphical.sway;
work = { in
outputs = [ mkIf cfg.enable {
{ services.kanshi = {
criteria = "Dell Inc. DELL U2720Q 1DNY123"; enable = true;
position = "1920,0"; profiles = {
} work = {
{ outputs = [
criteria = "eDP-1"; {
position = "5760,0"; criteria = "Dell Inc. DELL U2720Q 1DNY123";
} position = "1920,0";
]; }
}; {
unplugged = { criteria = "eDP-1";
outputs = [ position = "5760,0";
{ }
criteria = "eDP-1"; ];
} };
]; 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;
programs.mako = { iconPath = "${pkgs.numix-icon-theme}";
enable = true; font = "Hasklug Nerd Font 10";
iconPath = "${pkgs.numix-icon-theme}"; defaultTimeout = 8000;
font = "Hasklug Nerd Font 10"; # ignoreTimeout = true;
defaultTimeout = 8000;
# ignoreTimeout = true;
};
home.packages = [ pkgs.numix-icon-theme ]; };
home.packages = [ pkgs.numix-icon-theme ];
};
} }

View File

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

View File

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

View File

@ -1,111 +1,117 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, nixosConfig, ... }:
{ with lib; {
services = { config =
blueman-applet.enable = true; let
swayidle = { cfg = nixosConfig.elss.graphical.sway;
enable = true; in
events = [ mkIf cfg.enable {
services = {
{ event = "before-sleep"; command = "swaylock -KfeFi ~/.background-image"; } blueman-applet.enable = true;
{ event = "lock"; command = "swaylock -KfeFi ~/.background-image"; } swayidle = {
enable = true;
]; events = [
timeouts = [
{ timeout = 60; command = "swaylock -KfeFi ~/.background-image"; }
];
};
};
home.file.".background-image".source = ../../common/wallpaper/nix-wallpaper-nineish-dark-gray.png;
gtk.enable = true; { event = "before-sleep"; command = "swaylock -KfeFi ~/.background-image"; }
{ event = "lock"; command = "swaylock -KfeFi ~/.background-image"; }
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%";
];
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, ... }: { config, pkgs, lib, nixosConfig, ... }:
{ with lib; {
xdg.configFile."waybar/style.css" = { config =
source = conf/waybar/style.css; let
}; cfg = nixosConfig.elss.graphical.sway;
programs.waybar = { in
enable = true; mkIf cfg.enable {
systemd.enable = true; xdg.configFile."waybar/style.css" = {
settings = { source = conf/waybar/style.css;
mainBar = { };
modules-left = [ "sway/workspaces" "sway/mode" ]; programs.waybar = {
modules-center = [ "sway/window" ]; enable = true;
modules-right = [ "idle_inhibitor" "sway/language" "network#wifi" "network#base" "battery" "pulseaudio" "clock" "tray" ]; 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 &";
};
}; };
}; };
};
} }