move overrides to overlay.nix

This commit is contained in:
Kopatz
2024-05-20 12:27:28 +02:00
parent effdbf8ac5
commit e9c3f0871c
8 changed files with 350 additions and 368 deletions

View File

@@ -1 +1,9 @@
My NixOS setup
## options
I put my options under the `custom` key.
For example: `custom.graphical.plasma.enable = true;`
## pkgs
To build some of the custom pkgs you need a ssh key linked to github with access to my repos.

View File

@@ -1,9 +1,7 @@
{ config, osConfig, pkgs, inputs, lib, ... }:
with lib;
let
cfg = osConfig.custom.graphical.hyprland;
in
{
let cfg = osConfig.custom.graphical.hyprland;
in {
config = lib.mkIf cfg.enable {
programs.swaylock.enable = true;
wayland.windowManager.hyprland = {
@@ -27,7 +25,8 @@ in
# laptop
"eDP-1,3840x2160@60,0x0,2"
"DP-3,1920x1080@60,1920x0,1"
] else [
] else
[
# Default
",preferred,auto,auto"
];
@@ -53,9 +52,7 @@ in
follow_mouse = 1;
touchpad = {
natural_scroll = true;
};
touchpad = { natural_scroll = true; };
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
};
@@ -100,14 +97,13 @@ in
#animation = border, 1, 10, default
#animation = borderangle, 1, 8, default
#animation = fade, 1, 7, default
animation = [
"workspaces, 0"
];
animation = [ "workspaces, 0" ];
};
dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
pseudotile =
true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true; # you probably want this
};
@@ -133,7 +129,6 @@ in
# float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
"$mainMod" = "SUPER";
@@ -161,7 +156,8 @@ in
"$mainMod, F, fullscreen"
"$mainMod, V, togglefloating"
"$mainMod, I, exec, ${rofi} -show drun -show-icons"
"$mainMod, S, exec, cat ~/songs | shuf -n 1 | sed \"s/^/b\.p /g\" | ${wl-copy}"
''
$mainMod, S, exec, cat ~/songs | shuf -n 1 | sed "s/^/b.p /g" | ${wl-copy}''
"$mainMod, R, exec, ${swww} img $(ls -d /synced/default/dinge/Bg/* | shuf -n 1)"
" , Print, exec, ${grim} -g \"$(${slurp} -d)\" - | ${wl-copy}"
"ALT, SPACE, exec, ${rofi} -show combi"
@@ -234,7 +230,6 @@ in
#"immediate, class:^(Risk.*)$"
];
exec-once = [
"${pkgs.swww}/bin/swww init; sleep 1;"
"${pkgs.swww} img $(ls -d /synced/default/dinge/Bg/* | shuf -n 1)"

View File

@@ -1,9 +1,7 @@
{ config, osConfig, pkgs, inputs, lib, ... }:
with lib;
let
cfg = osConfig.custom.graphical.hyprland;
in
{
let cfg = osConfig.custom.graphical.hyprland;
in {
config = let
# styles from https://github.com/khaneliman/khanelinix/blob/8375f8cfbe5bfd87565b4dc34c9d30630c17336d/modules/home/desktop/addons/waybar/default.nix
theme = builtins.readFile ./styles/catppuccin.css;
@@ -28,20 +26,13 @@ in
#"hyprland/window"
];
modules-center = [ ];
modules-right = [
"group/stats"
"group/other"
];
modules-right = [ "group/stats" "group/other" ];
"cpu" = {
"format" = " {usage}%";
"tooltip" = true;
};
"disk" = {
"format" = " {percentage_used}%";
};
"memory" = {
"format" = "󰍛 {}%";
};
"disk" = { "format" = " {percentage_used}%"; };
"memory" = { "format" = "󰍛 {}%"; };
"idle_inhibitor" = {
"format" = "{icon} ";
@@ -81,10 +72,7 @@ in
"phone" = "";
"portable" = "";
"car" = "";
"default" = [
""
""
];
"default" = [ "" "" ];
};
"scroll-step" = 1;
"on-click" = "${pkgs.pavucontrol}/bin/pavucontrol";
@@ -99,7 +87,9 @@ in
"temperature".critical-threshold = 80;
"temperature".format = "{temperatureC}°C ";
"temperature".interval = 5;
"temperature".hwmon-path = lib.mkIf (osConfig.networking.hostName == "nix-laptop") "/sys/class/hwmon/hwmon6/temp1_input";
"temperature".hwmon-path =
lib.mkIf (osConfig.networking.hostName == "nix-laptop")
"/sys/class/hwmon/hwmon6/temp1_input";
"backlight".format = "{percent}% {icon}";
"backlight".states = [ 0 50 ];
"backlight".format-icons = [ "" "" ];
@@ -114,23 +104,11 @@ in
"tray".spacing = 10;
"group/stats" = {
"orientation" = "horizontal";
"modules" = [
"network"
"cpu"
"memory"
"disk"
"temperature"
];
"modules" = [ "network" "cpu" "memory" "disk" "temperature" ];
};
"group/other" = {
"orientation" = "horizontal";
"modules" = [
"tray"
"backlight"
"pulseaudio"
"battery"
"clock"
];
"modules" = [ "tray" "backlight" "pulseaudio" "battery" "clock" ];
};
"hyprland/window" = {
"format" = "{}";
@@ -174,7 +152,8 @@ in
"class<firefox-beta>" = "";
"class<firefox-developer-edition>" = "";
"class<firefox> title<.*github.*>" = "";
"class<firefox> title<.*twitch|youtube|plex|tntdrama|bally sports.*>" = "";
"class<firefox> title<.*twitch|youtube|plex|tntdrama|bally sports.*>" =
"";
"class<kitty>" = "";
"class<org.wezfurlong.wezterm>" = "";
"class<mediainfo-gui>" = "󱂷";
@@ -200,7 +179,8 @@ in
};
};
};
style = "${theme}${style}${notificationsStyle}${powerStyle}${statsStyle}${workspacesStyle}";
style =
"${theme}${style}${notificationsStyle}${powerStyle}${statsStyle}${workspacesStyle}";
};
};
}

View File

@@ -1,9 +1,7 @@
{ config, pkgs, lib, inputs, ... }:
with lib;
let
cfg = config.custom.graphical.hyprland;
in
{
let cfg = config.custom.graphical.hyprland;
in {
options.custom.graphical.hyprland = {
enable = mkEnableOption "Enables hyprland";
};
@@ -11,14 +9,13 @@ in
enable = mkEnableOption "Enables xwaylandvideobridge for hyprland";
};
config = let
patchedWaybar = pkgs.unstable.waybar.overrideAttrs (oldAttrs: { mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; });
in mkIf cfg.enable {
config = mkIf cfg.enable {
services.xserver = {
xkb.layout = config.mainUser.layout;
xkb.variant = config.mainUser.variant;
enable = true;
displayManager = mkIf (!config.services.xserver.displayManager.sddm.enable) {
displayManager =
mkIf (!config.services.xserver.displayManager.sddm.enable) {
gdm.enable = true;
};
};
@@ -64,7 +61,6 @@ in
# $ nix search wget
environment.systemPackages = with pkgs; [
# hyprland stuff
patchedWaybar
dunst
swww
rofi-wayland

View File

@@ -20,7 +20,7 @@ in
fonts.packages = with pkgs; [
#uw-ttyp0
corefonts
(nerdfonts.override { fonts = ["Hack" "Noto"]; })
nerdfonts
#noto-fonts
#noto-fonts-emoji
noto-fonts-cjk

View File

@@ -34,7 +34,7 @@ in {
let nerdfonts = pkgs.nerdfonts.override { fonts = [ "Hack" "Noto" ]; };
in mkIf cfg.enable {
stylix = {
autoEnable = true;
autoEnable = mkForce true;
polarity = "dark";
image = cfg.image;
override = cfg.override;

View File

@@ -7,6 +7,9 @@
# You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays
modifications = final: prev: {
discord = prev.discord.override { withVencord = true; };
nerdfonts = prev.nerdfonts.override { fonts = ["Hack" "Noto"]; };
waybar = prev.waybar.overrideAttrs (oldAttrs: { mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; });
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });

View File

@@ -24,7 +24,7 @@
shell = pkgs.zsh;
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [
(discord.override { withVencord = true; })
discord
brave
];
openssh.authorizedKeys.keys = [ config.mainUser.sshKey ];