move niri setup to one folder

This commit is contained in:
twoneis 2024-07-02 02:35:36 +02:00
parent 5af0909a70
commit e0d9c1c57c
10 changed files with 329 additions and 362 deletions

View file

@ -1,47 +1,24 @@
{ { lib, ... }: {
base = { options = with lib; {
hex = "#191724"; theme = mkOption {
type = with types; attrsOf str;
default = {
base = "#191724";
surface = "#1f1d2e";
overlay = "#26233a";
muted = "#6e6a86";
subtle = "#908caa";
text = "#e0def4";
love = "#eb6f92";
gold = "#f6c177";
rose = "#ebbcba";
pine = "#31748f";
foam = "#9ccfd8";
iris = "#c4a7e7";
highlight-low = "#21202e";
highlight-med = "#403d52";
highlight-high = "#524f67";
}; };
surface = {
hex = "#1f1d2e";
}; };
overlay = {
hex = "#26233a";
};
muted = {
hex = "#6e6a86";
};
subtle = {
hex = "#908caa";
};
text = {
hex = "#e0def4";
};
love = {
hex = "#eb6f92";
};
gold = {
hex = "#f6c177";
};
rose = {
hex = "#ebbcba";
};
pine = {
hex = "#31748f";
};
foam = {
hex = "#9ccfd8";
};
iris = {
hex = "#c4a7e7";
};
highlight-low = {
hex = "#21202e";
};
highlight-med = {
hex = "#403d52";
};
highlight-high = {
hex = "#524f67";
}; };
} }

View file

@ -1,13 +1,12 @@
{ inputs, pkgs, lib, ... }: { { inputs, pkgs, lib, ... }: {
imports = [ imports = [
./colors.nix
./audio ./audio
./bluetooth ./bluetooth
./containers ./containers
./games ./games
./gnome
./home ./home
./niri ./niri
./plasma
./virt ./virt
]; ];

View file

@ -1,17 +1,4 @@
{ config, lib, ... }: let { ... }: {
modules = lib.lists.flatten [
(if config.withNiri then [
./niri-setup
./themes
] else [])
(if config.withGnome then [
./themes
] else [])
(if config.full then [
./programs
] else [])
];
in {
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
@ -19,7 +6,9 @@ in {
users.twoneis = { users.twoneis = {
imports = [ imports = [
./utils ./utils
] ++ modules; ./programs
./themes
];
home = { home = {
username = "twoneis"; username = "twoneis";

View file

@ -1,136 +0,0 @@
{ lib, osConfig, pkgs, ... }: let
theme = import ../../colors.nix;
in lib.mkIf (osConfig.withNiri) {
programs.fuzzel= {
enable = true;
settings = {
colors = with lib; with strings; {
background = concatStrings [ theme.base.hex "ee" ];
text = concatStrings [ theme.text.hex "ff" ];
match = concatStrings [ theme.gold.hex "ff" ];
selection = concatStrings [theme.highlight-med.hex "ee" ];
selection-text = concatStrings [ theme.text.hex "ff" ];
selection-match = concatStrings [ theme.gold.hex "ff" ];
border = concatStrings [ theme.overlay.hex "ff" ];
};
};
};
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
modules-left = [
"memory"
"cpu"
"temperature"
];
modules-center = [
"clock"
];
modules-right = [
"network"
"wireplumber"
"battery"
];
"cpu" = {
interval = 10;
format = "{usage}%";
};
"temperature" = {
hwmon-path = osConfig.hwmonPath;
format = "{temperatureC}°C ";
interval = 10;
tooltip = false;
};
"memory" = {
interval = 30;
format = "{percentage}% ";
};
"clock" = {
format = "{:%H:%M}";
format-alt = "{:%a, %Y-%m-%d}";
};
"battery" = {
states = {
good = 80;
warning = 50;
critical = 20;
};
format = "{icon}";
format-alt = "{capacity}%";
format-icons = ["" "" "" "" ""];
tooltip = false;
};
"network" = {
format-wifi = "{icon}";
format-alt = "{essid}";
format-ethernet = "󰈁";
format-disconnected = "󰤭";
format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"];
tooltip = false;
};
"wireplumber" = {
format = "{icon}";
format-alt = "{volume}%";
format-muted = "";
format-icons = ["" "" ""];
tooltip = false;
};
};
};
style = builtins.readFile(./waybar.css);
};
services.mako = {
enable = true;
defaultTimeout = 5000;
maxVisible = 3;
font = "AlegreyaSans";
backgroundColor = theme.base.hex;
borderColor = theme.muted.hex;
textColor = theme.text.hex;
borderSize = 1;
borderRadius = 8;
icons = false;
};
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
settings = with lib; with strings; {
ignore-empty-password = true;
screenshots = true;
clock = true;
submit-on-touch = true;
indicator = true;
indicator-caps-lock = true;
indicator-radius = 100;
indicator-thickness = 4;
inside-color = concatStrings [ theme.overlay.hex "aa" ];
inside-clear-color = concatStrings [ theme.subtle.hex "aa" ];
inside-caps-lock-color = concatStrings [ theme.rose.hex "aa" ];
inside-ver-color = concatStrings [ theme.foam.hex "aa" ];
inside-wrong-color = concatStrings [ theme.love.hex "aa" ];
line-uses-inside = true;
ring-color = theme.surface.hex;
ring-clear-color = theme.muted.hex;
ring-caps-lock-color = theme.gold.hex;
ring-ver-color = theme.pine.hex;
ring-wrong-color = theme.love.hex;
seperator-color = theme.base.hex;
key-hl-color = theme.iris.hex;
bs-hl-color = theme.love.hex;
caps-lock-key-hl-color = theme.iris.hex;
caps-lock-bs-hl-color = theme.love.hex;
text-color = theme.text.hex;
text-clear-color = theme.text.hex;
text-caps-lock-color = theme.text.hex;
text-ver-color = theme.text.hex;
text-wrong-color = theme.text.hex;
effect-blur = "30x10";
};
};
}

View file

@ -1,176 +1,44 @@
{ lib, config, pkgs, ... }: lib.mkIf (config.withNiri) { { lib, config, pkgs, ... }: lib.mkIf (config.withNiri) {
programs.niri.enable = true; programs.niri.enable = true;
environment.systemPackages = with pkgs; [
home-manager.users.twoneis = {
home.packages = with pkgs; [
brightnessctl brightnessctl
swaybg swaybg
]; ];
home-manager.users.twoneis = {
programs.niri = { programs.niri = {
settings = { settings = import ./niri-settings.nix { config = config; };
input = {
keyboard = {
xkb = {
layout = "us";
options = "compose:ralt";
};
};
touchpad = {
tap = true;
natural-scroll = true;
};
tablet = {
map-to-output = "DP-3";
};
touch = {
map-to-output = "eDP-1";
};
power-key-handling.enable = false;
};
outputs."eDP-1" = {
scale = 1.0;
mode = {
width = 2736;
height = 1824;
refresh = 59.959;
};
position = {
x=0;
y=0;
};
}; };
outputs."DP-1" = { programs.fuzzel= {
scale = 1.0; enable = true;
mode = { settings = import ./fuzzel-settings.nix { lib = lib; config = config; };
width = 5120;
height = 2160;
refresh = 59.940;
};
position = {
x=2736;
y=0;
};
}; };
layout = { programs.waybar = {
focus-ring = { enable = true;
width = 4; settings = import ./waybar-settings.nix { config = config; };
active.gradient = { style = builtins.readFile(./waybar.css);
from="#31748f";
to="#9ccfd8";
angle=135;
};
inactive.color = "#c4a7e7";
}; };
preset-column-widths = [ services.mako = {
{ proportion = 0.25; } enable = true;
{ proportion = 0.5; } defaultTimeout = 5000;
{ proportion = 0.75; } maxVisible = 3;
]; font = "AlegreyaSans";
backgroundColor = config.theme.base;
default-column-width = { proportion = 0.25; }; borderColor = config.theme.muted;
gaps = 4; textColor = config.theme.text;
borderSize = 1;
borderRadius = 8;
icons = false;
}; };
window-rules = [ programs.swaylock = {
{ enable = true;
geometry-corner-radius = { package = pkgs.swaylock-effects;
top-left = 8.0; settings = import ./swaylock-settings.nix { lib = lib; config = config; };
top-right = 8.0;
bottom-left = 8.0;
bottom-right= 8.0;
};
clip-to-geometry = true;
} {
matches = [{app-id = "gamescope";}];
open-fullscreen = true;
}
];
prefer-no-csd = true;
screenshot-path = "~/Pictures/Screenshots/%Y-%m-%d-%H-%M-%S.png";
hotkey-overlay.skip-at-startup = true;
spawn-at-startup = [
{ command = ["waybar"]; }
{ command = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0"]; }
{ command = ["brightnessctl" "s" "50%"]; }
{ command = ["swaybg" "-c" "1f1d2e"]; }
];
binds = {
"Mod+T".action.spawn = "alacritty";
"Mod+B".action.spawn = "firefox";
"Mod+S".action.spawn = ["fuzzel" "-I" "-T" "alacritty" "-p" ""];
"XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "-l" "1" "@DEFAULT_AUDIO_SINK@" "5%+"];
"XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"];
"XF86MonBrightnessDown".action.spawn = ["brightnessctl" "-n=10%" "s" "5%-"];
"XF86MonBrightnessUp".action.spawn = ["brightnessctl" "s" "5%+"];
"Mod+Backspace".action.close-window = [];
"Mod+Left".action.focus-column-left = [];
"Mod+Right".action.focus-column-right = [];
"Mod+Up".action.focus-window-up = [];
"Mod+Down".action.focus-window-down = [];
"Mod+Comma".action.focus-column-left = [];
"Mod+Period".action.focus-column-right = [];
"Mod+E".action.focus-window-up = [];
"Mod+O".action.focus-window-down = [];
"Mod+Shift+Left".action.move-column-left = [];
"Mod+Shift+Right".action.move-column-right = [];
"Mod+Shift+Up".action.move-window-up = [];
"Mod+Shift+Down".action.move-window-down = [];
"Mod+Shift+Comma".action.move-column-left = [];
"Mod+Shift+Period".action.move-column-right = [];
"Mod+Shift+E".action.move-window-up = [];
"Mod+Shift+O".action.move-window-down = [];
"Mod+Ctrl+Left".action.focus-monitor-left = [];
"Mod+Ctrl+Right".action.focus-monitor-right = [];
"Mod+Ctrl+Up".action.focus-monitor-up = [];
"Mod+Ctrl+Down".action.focus-monitor-down = [];
"Mod+Ctrl+Comma".action.focus-monitor-left = [];
"Mod+Ctrl+Period".action.focus-monitor-right = [];
"Mod+Ctrl+E".action.focus-monitor-up = [];
"Mod+Ctrl+O".action.focus-monitor-down = [];
"Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = [];
"Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = [];
"Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = [];
"Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = [];
"Mod+Shift+Ctrl+Comma".action.move-column-to-monitor-left = [];
"Mod+Shift+Ctrl+Period".action.move-column-to-monitor-right = [];
"Mod+Shift+Ctrl+E".action.move-column-to-monitor-up = [];
"Mod+Shift+Ctrl+O".action.move-column-to-monitor-down = [];
"Mod+P".action.consume-window-into-column = [];
"Mod+Shift+P".action.expel-window-from-column = [];
"Mod+Z".action.switch-preset-column-width = [];
"Mod+F".action.maximize-column = [];
"Mod+Shift+F".action.fullscreen-window = [];
"Mod+K".action.center-column = [];
"Mod+Plus".action.set-column-width = "+10%";
"Mod+Minus".action.set-column-width = "-10%";
"Mod+Shift+Plus".action.set-window-height = "+10%";
"Mod+Shift+Minus".action.set-window-height = "-10%";
"Mod+Shift+S".action.screenshot = [];
"Mod+Shift+Ctrl+S".action.screenshot-window = [];
"Print".action.screenshot-screen = [];
"Mod+Shift+L".action.spawn = "swaylock";
"Mod+Shift+Q".action.quit = [];
};
};
}; };
}; };
} }

View file

@ -0,0 +1,11 @@
{ lib, config, ... }: {
colors = with lib; with strings; {
background = concatStrings [ config.theme.base "ee" ];
text = concatStrings [ config.theme.text "ff" ];
match = concatStrings [ config.theme.gold "ff" ];
selection = concatStrings [ config.theme.highlight-med "ee" ];
selection-text = concatStrings [ config.theme.text "ff" ];
selection-match = concatStrings [ config.theme.gold "ff" ];
border = concatStrings [ config.theme.overlay "ff" ];
};
}

View file

@ -0,0 +1,164 @@
{ config, ... }: {
input = {
keyboard = {
xkb = {
layout = "us";
options = "compose:ralt";
};
};
touchpad = {
tap = true;
natural-scroll = true;
};
tablet = {
map-to-output = "DP-3";
};
touch = {
map-to-output = "eDP-1";
};
power-key-handling.enable = false;
};
outputs."eDP-1" = {
scale = 1.0;
mode = {
width = 2736;
height = 1824;
refresh = 59.959;
};
position = {
x=0;
y=0;
};
};
outputs."DP-1" = {
scale = 1.0;
mode = {
width = 5120;
height = 2160;
refresh = 59.940;
};
position = {
x=2736;
y=0;
};
};
layout = {
focus-ring = {
width = 4;
active.gradient = {
from=config.theme.rose;
to=config.theme.pine;
angle=135;
};
inactive.color = config.theme.iris;
};
preset-column-widths = [
{ proportion = 0.25; }
{ proportion = 0.5; }
{ proportion = 0.75; }
];
default-column-width = { proportion = 0.25; };
gaps = 4;
};
window-rules = [
{
geometry-corner-radius = {
top-left = 8.0;
top-right = 8.0;
bottom-left = 8.0;
bottom-right= 8.0;
};
clip-to-geometry = true;
} {
matches = [{app-id = "gamescope";}];
open-fullscreen = true;
}
];
prefer-no-csd = true;
screenshot-path = "~/Pictures/Screenshots/%Y-%m-%d-%H-%M-%S.png";
hotkey-overlay.skip-at-startup = true;
spawn-at-startup = [
{ command = ["waybar"]; }
{ command = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0"]; }
{ command = ["brightnessctl" "s" "50%"]; }
{ command = ["swaybg" "-c" "1f1d2e"]; }
];
binds = {
"Mod+T".action.spawn = "alacritty";
"Mod+B".action.spawn = "firefox";
"Mod+S".action.spawn = ["fuzzel" "-I" "-T" "alacritty" "-p" ""];
"XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "-l" "1" "@DEFAULT_AUDIO_SINK@" "5%+"];
"XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"];
"XF86MonBrightnessDown".action.spawn = ["brightnessctl" "-n=10%" "s" "5%-"];
"XF86MonBrightnessUp".action.spawn = ["brightnessctl" "s" "5%+"];
"Mod+Backspace".action.close-window = [];
"Mod+Left".action.focus-column-left = [];
"Mod+Right".action.focus-column-right = [];
"Mod+Up".action.focus-window-up = [];
"Mod+Down".action.focus-window-down = [];
"Mod+Comma".action.focus-column-left = [];
"Mod+Period".action.focus-column-right = [];
"Mod+E".action.focus-window-up = [];
"Mod+O".action.focus-window-down = [];
"Mod+Shift+Left".action.move-column-left = [];
"Mod+Shift+Right".action.move-column-right = [];
"Mod+Shift+Up".action.move-window-up = [];
"Mod+Shift+Down".action.move-window-down = [];
"Mod+Shift+Comma".action.move-column-left = [];
"Mod+Shift+Period".action.move-column-right = [];
"Mod+Shift+E".action.move-window-up = [];
"Mod+Shift+O".action.move-window-down = [];
"Mod+Ctrl+Left".action.focus-monitor-left = [];
"Mod+Ctrl+Right".action.focus-monitor-right = [];
"Mod+Ctrl+Up".action.focus-monitor-up = [];
"Mod+Ctrl+Down".action.focus-monitor-down = [];
"Mod+Ctrl+Comma".action.focus-monitor-left = [];
"Mod+Ctrl+Period".action.focus-monitor-right = [];
"Mod+Ctrl+E".action.focus-monitor-up = [];
"Mod+Ctrl+O".action.focus-monitor-down = [];
"Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = [];
"Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = [];
"Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = [];
"Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = [];
"Mod+Shift+Ctrl+Comma".action.move-column-to-monitor-left = [];
"Mod+Shift+Ctrl+Period".action.move-column-to-monitor-right = [];
"Mod+Shift+Ctrl+E".action.move-column-to-monitor-up = [];
"Mod+Shift+Ctrl+O".action.move-column-to-monitor-down = [];
"Mod+P".action.consume-window-into-column = [];
"Mod+Shift+P".action.expel-window-from-column = [];
"Mod+Z".action.switch-preset-column-width = [];
"Mod+F".action.maximize-column = [];
"Mod+Shift+F".action.fullscreen-window = [];
"Mod+K".action.center-column = [];
"Mod+Plus".action.set-column-width = "+10%";
"Mod+Minus".action.set-column-width = "-10%";
"Mod+Shift+Plus".action.set-window-height = "+10%";
"Mod+Shift+Minus".action.set-window-height = "-10%";
"Mod+Shift+S".action.screenshot = [];
"Mod+Shift+Ctrl+S".action.screenshot-window = [];
"Print".action.screenshot-screen = [];
"Mod+Shift+L".action.spawn = "swaylock";
"Mod+Shift+Q".action.quit = [];
};
}

View file

@ -0,0 +1,32 @@
{ lib, config, ... }: {
ignore-empty-password = true;
screenshots = true;
clock = true;
submit-on-touch = true;
indicator = true;
indicator-caps-lock = true;
indicator-radius = 100;
indicator-thickness = 4;
inside-color = lib.strings.concatStrings [ config.theme.overlay "aa" ];
inside-clear-color = lib.strings.concatStrings [ config.theme.subtle "aa" ];
inside-caps-lock-color = lib.strings.concatStrings [ config.theme.rose "aa" ];
inside-ver-color = lib.strings.concatStrings [ config.theme.foam "aa" ];
inside-wrong-color = lib.strings.concatStrings [ config.theme.love "aa" ];
line-uses-inside = true;
ring-color = config.theme.surface;
ring-clear-color = config.theme.muted;
ring-caps-lock-color = config.theme.gold;
ring-ver-color = config.theme.pine;
ring-wrong-color = config.theme.love;
seperator-color = config.theme.base;
key-hl-color = config.theme.iris;
bs-hl-color = config.theme.love;
caps-lock-key-hl-color = config.theme.iris;
caps-lock-bs-hl-color = config.theme.love;
text-color = config.theme.text;
text-clear-color = config.theme.text;
text-caps-lock-color = config.theme.text;
text-ver-color = config.theme.text;
text-wrong-color = config.theme.text;
effect-blur = "30x10";
}

View file

@ -0,0 +1,63 @@
{ config, ... }: {
mainBar = {
layer = "top";
position = "top";
modules-left = [
"memory"
"cpu"
"temperature"
];
modules-center = [
"clock"
];
modules-right = [
"network"
"wireplumber"
"battery"
];
"cpu" = {
interval = 10;
format = "{usage}%";
};
"temperature" = {
hwmon-path = config.hwmonPath;
format = "{temperatureC}°C ";
interval = 10;
tooltip = false;
};
"memory" = {
interval = 30;
format = "{percentage}% ";
};
"clock" = {
format = "{:%H:%M}";
format-alt = "{:%a, %Y-%m-%d}";
};
"battery" = {
states = {
good = 80;
warning = 50;
critical = 20;
};
format = "{icon}";
format-alt = "{capacity}%";
format-icons = ["" "" "" "" ""];
tooltip = false;
};
"network" = {
format-wifi = "{icon}";
format-alt = "{essid}";
format-ethernet = "󰈁";
format-disconnected = "󰤭";
format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"];
tooltip = false;
};
"wireplumber" = {
format = "{icon}";
format-alt = "{volume}%";
format-muted = "";
format-icons = ["" "" ""];
tooltip = false;
};
};
}