Merge pull request #1 from 0x1d/feature/hyper-rice

feature/hyper-rice
This commit is contained in:
Patrick Balsiger
2025-08-19 10:31:17 +02:00
committed by GitHub
5 changed files with 286 additions and 139 deletions

View File

@@ -5,8 +5,9 @@ This repo contains my personal NixOS configuration with multiple desktop environ
## Quick Start ## Quick Start
### Available Configurations ### Available Configurations
- **`nixos`** - GNOME desktop environment - **`gnome`** - GNOME desktop environment
- **`hyprland`** - Hyprland window manager - **`kde`** - KDE Plasma desktop environment
- **`hyprland`** - Hyprland window manager
### Quick Commands ### Quick Commands
```bash ```bash

View File

@@ -9,7 +9,7 @@
outputs = { self, nixpkgs, home-manager }: { outputs = { self, nixpkgs, home-manager }: {
nixosConfigurations = { nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem { gnome = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
@@ -22,6 +22,19 @@
./users/master.nix ./users/master.nix
]; ];
}; };
kde = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
home-manager.nixosModules.home-manager
./configuration.nix
./hardware/lenovo-thinkpad-e14.nix
./system/base.nix
./system/packages.nix
./system/desktop/plasma.nix
./users/demo.nix
./users/master.nix
];
};
hyprland = nixpkgs.lib.nixosSystem { hyprland = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [

View File

@@ -195,83 +195,171 @@
# Create Waybar configuration # Create Waybar configuration
environment.etc."xdg/waybar/config".text = '' environment.etc."xdg/waybar/config".text = ''
{ {
"layer": "top", // "layer": "top", // Waybar at top layer
"position": "top", // "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 30, "height": 30, // Waybar height (to be removed for auto height)
"spacing": 4, // "width": 1280, // Waybar width
"modules-left": ["hyprland/workspaces"], "spacing": 4, // Gaps between modules (4px)
"modules-center": ["hyprland/window"], // Choose the order of the modules
"modules-right": ["battery", "pulseaudio", "network", "cpu", "memory", "clock", "tray"], "modules-left": ["hyprland/workspaces","hyprland/window", "hyprland/mode", "hyprland/scratchpad", "custom/media"],
"hyprland/workspaces": { //"modules-center": ["hyprland/window"],
"disable-scroll": true, "modules-right": ["pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "battery", "battery#bat2", "clock", "tray"],
"all-outputs": true, // Modules configuration
"format": "{name}", // "hyprland/workspaces": {
// "disable-scroll": true,
// "all-outputs": true,
// "warp-on-scroll": false,
// "format": "{icon}",
// //"format": "{name}: {icon}",
// "format-icons": {
// "1": "",
// "2": "",
// "3": "",
// "4": "",
// "5": "",
// "urgent": "",
// "focused": "",
// "default": ""
// }
// },
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{name} {icon}",
"format-icons": { "format-icons": {
"1": "1", "locked": "",
"2": "2", "unlocked": ""
"3": "3",
"4": "4",
"5": "5",
"urgent": "urgent"
} }
}, },
"hyprland/window": {
"format": "{}", "hyprland/mode": {
"max-length": 50 "format": "<span style=\"italic\">{}</span>"
}, },
"battery": { "hyprland/scratchpad": {
"states": { "format": "{icon} {count}",
"warning": 20, "show-empty": false,
"critical": 10 "format-icons": ["", ""],
"tooltip": true,
"tooltip-format": "{app}: {title}"
},
"mpd": {
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) {songPosition}|{queueLength} {volume}% ",
"format-disconnected": "Disconnected ",
"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
"unknown-tag": "N/A",
"interval": 2,
"consume-icons": {
"on": " "
}, },
"format": "{icon} {capacity}%", "random-icons": {
"format-charging": " {capacity}%", "off": "<span color=\"#f53c3c\"></span> ",
"format-plugged": " {capacity}%", "on": " "
"format-alt": "{icon} {time}", },
"format-icons": ["", "", "", "", ""], "repeat-icons": {
"on-click": "powerprofilesctl" "on": " "
},
"single-icons": {
"on": "1 "
},
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
// "icon-size": 21,
"spacing": 10
}, },
"clock": { "clock": {
"tooltip-format": "<big>{:%Y %B}</big>\\n<tt><small>{calendar}</small></tt>", // "timezone": "America/New_York",
"format": " {:%H:%M}", "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": " {:%Y-%m-%d %H:%M}" "format-alt": "{:%Y-%m-%d}"
}, },
"cpu": { "cpu": {
"format": " {usage}%", "format": "{usage}% ",
"format-icons": ["", "", "", "", ""],
"tooltip": false "tooltip": false
}, },
"memory": { "memory": {
"format": " {percentage}%", "format": "{}% "
"format-icons": ["", "", "", "", ""], },
"tooltip": false "temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C {icon}",
"format-icons": ["", "", ""]
},
"backlight": {
// "device": "acpi_video1",
"format": "{percent}% {icon}",
"format-icons": ["", "", "", "", "", "", "", "", ""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
}, },
"network": { "network": {
"format-wifi": " {essid}", // "interface": "wlp2*", // (Optional) To force the use of this interface
"format-ethernet": " {ipaddr}", "format-wifi": "{essid} ({signalStrength}%) ",
"format-disconnected": " Disconnected", "format-ethernet": "{ipaddr}/{cidr} ",
"format-icons": ["", "", "", "", ""], "tooltip-format": "{ifname} via {gwaddr} ",
"tooltip-format": "{ifname} via {gwaddr}", "format-linked": "{ifname} (No IP) ",
"max-length": 50 "format-disconnected": "Disconnected ",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
}, },
"pulseaudio": { "pulseaudio": {
"format": " {volume}%", // "scroll-step": 1, // %, can be a float
"format-bluetooth": " {volume}% ", "format": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " ", "format-bluetooth": "{volume}% {icon} {format_source}",
"format-muted": " ", "format-bluetooth-muted": " {icon} {format_source}",
"format-muted": " {format_source}",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": { "format-icons": {
"headphone": "", "headphone": "",
"hands-free": "", "hands-free": "",
"headset": "", "headset": "",
"phone": "", "phone": "",
"portable": "", "portable": "",
"car": "", "car": "",
"default": ["", "", "", ""] "default": ["", "", ""]
}, },
"on-click": "pavucontrol" "on-click": "pavucontrol"
}, },
"tray": { "custom/media": {
"spacing": 10 "format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
} }
} }
''; '';
@@ -281,105 +369,80 @@
* { * {
border: none; border: none;
border-radius: 0; border-radius: 0;
font-family: "JetBrainsMono Nerd Font", Roboto, Helvetica, Arial, sans-serif; /*font-family: "Hack", "Noto Color Emoji", sans-serif;*/
font-size: 13px; font-size: 12px;
/*font-weight: bold;*/
min-height: 0; min-height: 0;
} }
window#waybar { window#waybar {
background-color: rgba(43, 48, 59, 0.5); /*background: rgba(0,0,0,.2);*/
border-bottom: 3px solid rgba(100, 149, 237, 0.5); background: transparent;
color: #ffffff; /*border-bottom: 1px solid rgba(100, 114, 125, 0.5);*/
transition-property: background-color; color: #e5e9f0;
transition-duration: .5s; margin-bottom: 0px;
} padding-bottom:0px;
window#waybar.hidden {
opacity: 0.2;
} }
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button { #workspaces button {
padding: 0 5px; padding: 5px 5px;
background-color: transparent; background: transparent;
color: #ffffff; color: #ffffff;
border-bottom: 3px solid transparent; /*border-bottom: 3px solid transparent;*/
} border-radius: 10px;
#workspaces button:hover {
background: rgba(0, 0, 0, 0.2);
box-shadow: inherit;
border-bottom: 3px solid #ffffff;
} }
#workspaces button.active { #workspaces button.active {
background-color: #285577; /*background: #4c566a;*/
border-bottom: 3px solid #ffffff; background: rgba(0,0,0,.5);
padding: 5px;
margin: 5px;
/*border-bottom: 3px solid #e5e9f0;*/
} }
#workspaces button.urgent { #workspaces button.urgent {
background-color: #eb4d4b; background-color: #bf616a;
} }
#mode { #mode {
background-color: #64727d; background: #64727D;
border-bottom: 3px solid #ffffff; border-bottom: 3px solid #ffffff;
} }
#clock, #clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-media, #tray, #mode, #idle_inhibitor {
#battery, padding: 5px 8px;
#cpu, margin: 5px;
#memory, border-radius: 10px;
#disk, background: rgba(0,0,0,.5);
#temperature,
#backlight,
#network,
#pulseaudio,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#mpd {
padding: 0 10px;
margin: 0 4px;
color: #ffffff;
}
#window,
#workspaces {
margin: 0 4px;
}
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
} }
#clock { #clock {
background-color: #64727d; /*background-color: #64727D;*/
color: #e5e9f0;
font-weight: bold;
} }
#battery { #battery {
background-color: #ffffff; /*background-color: #000000;*/
color: #000000; color: #e5e9f0;
} }
#battery.charging, #battery.plugged { #battery.charging {
color: #ffffff; /*background-color: #000000;*/
background-color: #26a65b; color: #e5e9f0;
} }
@keyframes blink { @keyframes blink {
to { to {
background-color: #ffffff; /*background-color: #ffffff;*/
color: #000000; color: #000000;
} }
} }
#battery.critical:not(.charging) { #battery.critical:not(.charging) {
background-color: #f53c3c; background: #f53c3c;
color: #ffffff; color: #ffffff;
animation-name: blink; animation-name: blink;
animation-duration: 0.5s; animation-duration: 0.5s;
@@ -388,34 +451,76 @@
animation-direction: alternate; animation-direction: alternate;
} }
#battery.warning { #cpu {
background-color: #f39c12; /*background: #2ecc71;*/
color: #ffffff; color: #e5e9f0;
} }
label:focus { #memory {
background-color: #000000; /*background: #9b59b6;*/
color: #e5e9f0;
}
#backlight {
/*background: #90b1b1;*/
color: #e5e9f0;
}
#network {
/*background: #2980b9;*/
color: #e5e9f0;
} }
#network.disconnected { #network.disconnected {
background-color: #53a2ba; /*background: #f53c3c;*/
color: #e5e9f0;
}
#pulseaudio {
/*background: #000000;*/
color: #e5e9f0;
} }
#pulseaudio.muted { #pulseaudio.muted {
background-color: #90b1b1; /*background: #000000;*/
color: #e5e9f0;
}
#custom-media {
background: #66cc99;
color: #2a5c45;
}
.custom-spotify {
background: #66cc99;
}
.custom-vlc {
background: #ffa000;
}
#temperature {
/*background: #f0932b;*/
} }
#temperature.critical { #temperature.critical {
background-color: #eb4d4b; background: #eb4d4b;
} }
#tray > .passive { #tray {
-gtk-icon-effect: dim; /*background-color: #2980b9;*/
color: #e5e9f0;
} }
#tray > .needs-attention { #idle_inhibitor {
-gtk-icon-effect: highlight; background-color: #2d3436;
} }
#idle_inhibitor.activated {
background-color: #ecf0f1;
color: #2d3436;
}
''; '';
# Create Dunst configuration # Create Dunst configuration

View File

@@ -1,9 +1,32 @@
{ pkgs, ... }: { { pkgs, ... }: {
services.xserver = { #services.xserver = {
enable = true; # enable = true;
layout = "ch"; # layout = "ch";
xkbVariant = ""; # xkbVariant = "";
# displayManager.sddm.enable = true;
# desktopManager.plasma6.enable = true;
#};
services = {
desktopManager.plasma6.enable = true;
displayManager.sddm.enable = true; displayManager.sddm.enable = true;
desktopManager.plasma5.enable = true; displayManager.sddm.wayland.enable = true;
}; };
environment.systemPackages = with pkgs;
[
kdePackages.discover # Optional: Install if you use Flatpak or fwupd firmware update sevice
kdePackages.kcalc # Calculator
kdePackages.kcharselect # Tool to select and copy special characters from all installed fonts
kdePackages.kcolorchooser # A small utility to select a color
kdePackages.kolourpaint # Easy-to-use paint program
kdePackages.ksystemlog # KDE SystemLog Application
kdePackages.sddm-kcm # Configuration module for SDDM
kdiff3 # Compares and merges 2 or 3 files or directories
kdePackages.isoimagewriter # Optional: Program to write hybrid ISO files onto USB disks
kdePackages.partitionmanager # Optional Manage the disk devices, partitions and file systems on your computer
hardinfo2 # System information and benchmarks for Linux systems
haruna # Open source video player built with Qt/QML and libmpv
wayland-utils # Wayland utilities
wl-clipboard # Command-line copy/paste utilities for Wayland
];
} }

View File

@@ -76,6 +76,11 @@ in
python312Packages.pyaudio python312Packages.pyaudio
]; ];
fonts.packages = with pkgs; [
nerd-fonts._0xproto
nerd-fonts.droid-sans-mono
];
programs.nix-ld.enable = true; programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [ programs.nix-ld.libraries = with pkgs; [