mirror of
https://github.com/Nickiel12/nicks-nix-config.git
synced 2024-11-24 05:35:29 -08:00
Compare commits
3 commits
d6c9a492cc
...
364e69481d
Author | SHA1 | Date | |
---|---|---|---|
364e69481d | |||
7447cdd889 | |||
7502947071 |
7 changed files with 234 additions and 107 deletions
18
flake.lock
18
flake.lock
|
@ -122,11 +122,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1697931116,
|
"lastModified": 1698162493,
|
||||||
"narHash": "sha256-KdjQQBavncOSLgv/AM/hwWH8GAYeP3O2XXLfXSuJzQ0=",
|
"narHash": "sha256-Zehw3cWiTXGGlDDjzTgIX1BhWG+049D/RcSMAiypAcM=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "81ab14626273ca38cba947d9a989c9d72b5e7593",
|
"rev": "14b54157201fd574b0fa1b3ce7394c9d3a87fbc1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -192,11 +192,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1697929210,
|
"lastModified": 1698181360,
|
||||||
"narHash": "sha256-RkQZif6QhswEwv7484mrKfIU8XmIWm+ED6llbr4IyxM=",
|
"narHash": "sha256-oEfGhb3MzTglzMqDItLvBnn2Ja3YmyjGZ2iRFb5+Vz0=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "fb000224952bf7749a9e8b3779104ef7ea4465c8",
|
"rev": "98e7aaa5cfad782b8effe134bff3717280ec41ca",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -294,11 +294,11 @@
|
||||||
"pre-commit-hooks": "pre-commit-hooks"
|
"pre-commit-hooks": "pre-commit-hooks"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1697928654,
|
"lastModified": 1698063089,
|
||||||
"narHash": "sha256-dyMe4/EhJhqZICJ06HkhA6DIBK5z8vRtwreGgfhLMFU=",
|
"narHash": "sha256-fJRcsO+KHf0K04fRHIS6HETJRWMakTNbUaWx8WeYHX4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixvim",
|
"repo": "nixvim",
|
||||||
"rev": "56f46166f998d4adddb1c43dbf54d4c0604eef29",
|
"rev": "0c5dcb56d105addedd001f043e6a32ab9f1abe92",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -6,6 +6,11 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
# max cores used per derivation
|
||||||
|
nix.settings.cores = 8;
|
||||||
|
# max derivations that can be built at once
|
||||||
|
# nix.settings.max-jobs = 2;
|
||||||
|
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
security.pam.services.kwallet = {
|
security.pam.services.kwallet = {
|
||||||
|
|
|
@ -2,12 +2,17 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
hostname = osConfig.networking.hostName;
|
||||||
|
|
||||||
|
monitor_config = import ./monitors.nix { hostname = hostname; };
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./ewwbar.nix
|
./ewwbar.nix
|
||||||
./keybinds.nix
|
./keybinds.nix
|
||||||
|
./displays.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
@ -26,21 +31,15 @@ in
|
||||||
# Whether to enable patching wlroots for better Nvidia support
|
# Whether to enable patching wlroots for better Nvidia support
|
||||||
enableNvidiaPatches = true;
|
enableNvidiaPatches = true;
|
||||||
|
|
||||||
extraConfig = if (osConfig.networking.hostName == "NicksNixDesktop") then
|
extraConfig = lib.strings.concatStrings [
|
||||||
|
monitor_config
|
||||||
''
|
''
|
||||||
monitor=DP-2, 2560x1440@144, 1920x0, 1
|
|
||||||
monitor=DP-3, 1920x1080@60, 0x360,1
|
|
||||||
|
|
||||||
env = LIBVA_DRIVER_NAME,nvidia
|
|
||||||
env = XDG_SESSION_TYPE,wayland
|
|
||||||
env = GBM_BACKEND,nvidia-drm
|
|
||||||
env = WLR_NO_HARDWARE_CURSORS,1
|
|
||||||
''
|
''
|
||||||
else ''
|
];
|
||||||
|
|
||||||
'';
|
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
|
||||||
"$mod" = "SUPER";
|
"$mod" = "SUPER";
|
||||||
|
|
||||||
exec-once = [
|
exec-once = [
|
||||||
|
|
26
modules/hyprland/displays.nix
Normal file
26
modules/hyprland/displays.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ osConfig, ...}:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
hostname = osConfig.networking.hostName;
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
wayland.windowManager.hyprland.settings = {
|
||||||
|
workspace = if (hostname == "NicksNixDesktop") then [
|
||||||
|
"1,monitor:DP-2"
|
||||||
|
"3,monitor:DP-2"
|
||||||
|
"5,monitor:DP-2"
|
||||||
|
"7,monitor:DP-2"
|
||||||
|
"9,monitor:DP-2"
|
||||||
|
|
||||||
|
"2,monitor:DP-3"
|
||||||
|
"4,monitor:DP-3"
|
||||||
|
"6,monitor:DP-3"
|
||||||
|
"8,monitor:DP-3"
|
||||||
|
"10,monitor:DP-3"
|
||||||
|
] else [
|
||||||
|
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,54 +1,43 @@
|
||||||
* {
|
* {
|
||||||
all: unset; //Unsets everything so you can style everything from scratch
|
all: unset; //Unsets everything so you can style everything from scratch
|
||||||
}
|
}
|
||||||
|
|
||||||
//Global Styles
|
//Global Styles
|
||||||
.bar {
|
.bar-main {
|
||||||
background-color: #3a3a3a;
|
color: #b0b4bc;
|
||||||
color: #b0b4bc;
|
margin: 15px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
padding-bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Styles on classes (see eww.yuck for more information)
|
.bar-section {
|
||||||
|
background-color: rgba(200, 200, 200, 0.5);
|
||||||
.sidestuff slider {
|
border-radius: 15;
|
||||||
all: unset;
|
|
||||||
color: #ffd5cd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.metric scale trough highlight {
|
.sep {
|
||||||
all: unset;
|
color: rgba(200, 200, 200, 0.5);
|
||||||
background-color: #D35D6E;
|
|
||||||
color: #000000;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
}
|
||||||
.metric scale trough {
|
|
||||||
all: unset;
|
.time {
|
||||||
background-color: #4e4e4e;
|
font-weight: bold;
|
||||||
border-radius: 50px;
|
padding-right: 20px;
|
||||||
min-height: 3px;
|
|
||||||
min-width: 50px;
|
|
||||||
margin-left: 10px;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
}
|
||||||
.metric scale trough highlight {
|
|
||||||
all: unset;
|
.alert {
|
||||||
background-color: #D35D6E;
|
color: #aa5555;
|
||||||
color: #000000;
|
padding: 5px;
|
||||||
border-radius: 10px;
|
|
||||||
}
|
}
|
||||||
.metric scale trough {
|
|
||||||
all: unset;
|
.regular {
|
||||||
background-color: #4e4e4e;
|
color: #b0b4bc;
|
||||||
border-radius: 50px;
|
padding: 5px;
|
||||||
min-height: 3px;
|
|
||||||
min-width: 50px;
|
|
||||||
margin-left: 10px;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
}
|
||||||
.label-ram {
|
|
||||||
font-size: large;
|
.active-workspace {
|
||||||
}
|
background-color: rgba(150, 150, 150, 0.4);
|
||||||
.workspaces button:hover {
|
border-radius: 10;
|
||||||
color: #D35D6E;
|
padding-left: 10px;
|
||||||
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +1,140 @@
|
||||||
(defwidget bar []
|
(defwidget bar []
|
||||||
(centerbox :orientation "h"
|
(centerbox :orientation "h"
|
||||||
(workspaces)
|
(workspaces :names active-workspaces :current-idx current-workspace)
|
||||||
(music)
|
(music)
|
||||||
(sidestuff)))
|
(info)))
|
||||||
|
|
||||||
(defwidget sidestuff []
|
(deflisten active-workspaces :initial "[]" "bash ./scripts/get-workspaces")
|
||||||
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
|
(deflisten current-workspace :initial "1" "bash ./scripts/get-active-workspace")
|
||||||
(metric :label "🔊"
|
(defwidget workspaces [names current-idx]
|
||||||
:value volume
|
(box
|
||||||
:onchange "amixer -D pulse sset Master {}%")
|
:halign "start"
|
||||||
(metric :label ""
|
:hexpand false
|
||||||
:value {EWW_RAM.used_mem_perc}
|
:space-evenly true
|
||||||
:onchange "")
|
:spacing "12"
|
||||||
(metric :label "💾"
|
:css "* {margin-left: 20px; margin-right: 20px;}"
|
||||||
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
|
(box
|
||||||
:onchange "")
|
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "1" ? "active-workspace" : "regular"}
|
||||||
time))
|
(label :text {names =~ `"1"` ? "" : ""}))
|
||||||
|
(box
|
||||||
|
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "2" ? "active-workspace" : "regular"}
|
||||||
|
(label :text {names =~ `"2"` ? "" : ""}))
|
||||||
|
(box
|
||||||
|
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "3" ? "active-workspace" : "regular"}
|
||||||
|
(label :text {names =~ `"3"` ? "" : ""}))
|
||||||
|
(box
|
||||||
|
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "4" ? "active-workspace" : "regular"}
|
||||||
|
(label :text {names =~ `"4"` ? "" : ""}))
|
||||||
|
(box
|
||||||
|
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "5" ? "active-workspace" : "regular"}
|
||||||
|
(label :text {names =~ `"5"` ? "" : ""}))
|
||||||
|
(box
|
||||||
|
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "6" ? "active-workspace" : "regular"}
|
||||||
|
(label :text {names =~ `"6"` ? "" : ""}))
|
||||||
|
(box
|
||||||
|
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "7" ? "active-workspace" : "regular"}
|
||||||
|
(label :text {names =~ `"7"` ? "" : ""}))
|
||||||
|
(box
|
||||||
|
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "8" ? "active-workspace" : "regular"}
|
||||||
|
(label :text {names =~ `"8"` ? "" : ""}))
|
||||||
|
(box
|
||||||
|
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "9" ? "active-workspace" : "regular"}
|
||||||
|
(label :text {names =~ `"9"` ? "" : ""}))))
|
||||||
|
|
||||||
(deflisten workspaces :initial "[]" "bash ./scripts/get-workspaces")
|
(defwidget info []
|
||||||
(deflisten current_workspace :initial "1" "bash ./scripts/get-active-workspace")
|
(box
|
||||||
(defwidget workspaces []
|
:class "side-stuff"
|
||||||
(eventbox :onscroll "bash ./scripts/change-active-workspace {} ${current_workspace}" :class "workspaces-widget"
|
:halign "end"
|
||||||
(box :space-evenly true
|
:space-evenly false
|
||||||
(label :text "${workspaces}${current_workspace}" :visible false)
|
:spacing "25"
|
||||||
(for workspace in workspaces
|
(box
|
||||||
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
|
:space-evenly false
|
||||||
(box :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}"
|
:spacing "10"
|
||||||
(label :text "${workspace.id}")
|
(_volume :volume volume)
|
||||||
)
|
(_battery :status {EWW_BATTERY.BAT0.status} :battery {EWW_BATTERY.BAT0.capacity}))
|
||||||
)
|
(_network :strength net-strength :name net-name)
|
||||||
)
|
(sep)
|
||||||
)
|
(buttons)))
|
||||||
)
|
|
||||||
)
|
(defvar eww "eww -c $HOME/.config/eww")
|
||||||
|
|
||||||
|
(defwidget revealer-on-hover [toggle togglename ?transition ?duration]
|
||||||
|
(eventbox
|
||||||
|
:onhover "${eww} update ${togglename}=true"
|
||||||
|
:onhoverlost "${eww} update ${togglename}=false"
|
||||||
|
(box
|
||||||
|
:space-evenly false
|
||||||
|
(children :nth 0)
|
||||||
|
(revealer
|
||||||
|
:reveal toggle
|
||||||
|
:transition {transition ?: "slideright"}
|
||||||
|
:duration {duration ?: "300ms"}
|
||||||
|
(children :nth 1)))))
|
||||||
|
|
||||||
|
(defvar volume-visible false)
|
||||||
|
(defwidget _volume [volume]
|
||||||
|
(box
|
||||||
|
:hexpand false
|
||||||
|
:class {volume > 100 ? "alert" : "regular"}
|
||||||
|
(revealer-on-hover
|
||||||
|
:toggle volume-visible
|
||||||
|
:togglename "volume-visible"
|
||||||
|
(label :text {volume <= 0 ? " " :
|
||||||
|
volume < 33 ? " " :
|
||||||
|
volume < 66 ? " " :
|
||||||
|
volume < 99 ? " " : " "})
|
||||||
|
(label :text "${volume}%"))))
|
||||||
|
|
||||||
|
|
||||||
|
(defvar battery-visible false)
|
||||||
|
(defwidget _battery [status battery]
|
||||||
|
(box
|
||||||
|
:hexpand false
|
||||||
|
:class {battery < 20 ? "alert" : "regular"}
|
||||||
|
(revealer-on-hover
|
||||||
|
:toggle battery-visible
|
||||||
|
:togglename "battery-visible"
|
||||||
|
(label :text {status == 'Charging' ? "" :
|
||||||
|
battery < 20 ? "" :
|
||||||
|
battery < 40 ? "" :
|
||||||
|
battery < 60 ? "" :
|
||||||
|
battery < 80 ? "" : ""})
|
||||||
|
(label :text "${battery}%"))))
|
||||||
|
|
||||||
|
(defvar network-visible false)
|
||||||
|
(defwidget _network [strength name]
|
||||||
|
(box
|
||||||
|
:hexpand false
|
||||||
|
:vexpand true
|
||||||
|
:class "regular"
|
||||||
|
(revealer-on-hover
|
||||||
|
:toggle network-visible
|
||||||
|
:togglename "network-visible"
|
||||||
|
:ransition "slidedown"
|
||||||
|
(label :text {strength == "" ? " " :
|
||||||
|
strength < 26 ? " " :
|
||||||
|
strength < 51 ? " " :
|
||||||
|
strength < 76 ? " " : " "})
|
||||||
|
(label :text "${name} (${strength})"))))
|
||||||
|
|
||||||
|
(defwidget buttons []
|
||||||
|
(box
|
||||||
|
:halign "end"
|
||||||
|
:hexpand false
|
||||||
|
:space-evenly true
|
||||||
|
:spacing "15"
|
||||||
|
(box (button :onclick `hyprctl dispatch exit` " "))
|
||||||
|
(box (button :onclick `reboot` " "))
|
||||||
|
(box (button :onclick `shutdown now` " "))))
|
||||||
|
|
||||||
|
(defwidget sep [] (box :hexpand false (label :class "sep" :text "|")))
|
||||||
|
|
||||||
|
(defpoll net-strength :interval "5s" :initial `N/A`
|
||||||
|
`nmcli -t -f SIGNAL,ACTIVE device wifi | awk -F':' '{if($2=="yes")print$1}'`)
|
||||||
|
(defpoll net-name :interval "60s" :initial "N/A" "nmcli -t -f NAME c show --active | head -n 1")
|
||||||
|
|
||||||
|
(deflisten music :initial ""
|
||||||
|
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true")
|
||||||
|
|
||||||
(defwidget music []
|
(defwidget music []
|
||||||
(box :class "music"
|
(box :class "music"
|
||||||
|
@ -41,23 +143,6 @@
|
||||||
:halign "center"
|
:halign "center"
|
||||||
{music != "" ? "🎵${music}" : ""}))
|
{music != "" ? "🎵${music}" : ""}))
|
||||||
|
|
||||||
|
|
||||||
(defwidget metric [label value onchange]
|
|
||||||
(box :orientation "h"
|
|
||||||
:class "metric"
|
|
||||||
:space-evenly false
|
|
||||||
(box :class "label" label)
|
|
||||||
(scale :min 0
|
|
||||||
:max 101
|
|
||||||
:active {onchange != ""}
|
|
||||||
:value value
|
|
||||||
:onchange onchange)))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(deflisten music :initial ""
|
|
||||||
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true")
|
|
||||||
|
|
||||||
(defpoll volume :interval "1s"
|
(defpoll volume :interval "1s"
|
||||||
"scripts/getvol")
|
"scripts/getvol")
|
||||||
|
|
||||||
|
@ -66,6 +151,7 @@
|
||||||
|
|
||||||
(defwindow bar
|
(defwindow bar
|
||||||
:monitor 0
|
:monitor 0
|
||||||
|
:exclusive true
|
||||||
:windowtype "dock"
|
:windowtype "dock"
|
||||||
:geometry (geometry :x "0%"
|
:geometry (geometry :x "0%"
|
||||||
:y "0%"
|
:y "0%"
|
||||||
|
|
22
modules/hyprland/monitors.nix
Normal file
22
modules/hyprland/monitors.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ hostname ? "undefined" }:
|
||||||
|
|
||||||
|
# Yes, this is less efficient, but I wanted to save this solution to the issue for future reference
|
||||||
|
let
|
||||||
|
monitor_config = if (hostname == "NicksNixDesktop") then
|
||||||
|
''
|
||||||
|
monitor=DP-2, 2560x1440@144, 1920x0, 1
|
||||||
|
monitor=DP-3, 1920x1080@60, 0x360,1
|
||||||
|
|
||||||
|
env = LIBVA_DRIVER_NAME,nvidia
|
||||||
|
env = XDG_SESSION_TYPE,wayland
|
||||||
|
env = GBM_BACKEND,nvidia-drm
|
||||||
|
env = WLR_NO_HARDWARE_CURSORS,1
|
||||||
|
''
|
||||||
|
else if (hostname == "NicksNixLaptop") then ''
|
||||||
|
|
||||||
|
'' else ''
|
||||||
|
|
||||||
|
'';
|
||||||
|
|
||||||
|
in monitor_config
|
||||||
|
|
Loading…
Reference in a new issue