Compare commits

..

3 Commits

Author SHA1 Message Date
8ea328d20d Revert to Gnome 2026-06-08 01:57:04 +01:00
b918a86ecf merge 2026-06-03 20:40:10 +01:00
6a9bdab235 WIP: nixos on laptop 2026-06-03 20:34:44 +01:00
12 changed files with 841 additions and 265 deletions

View File

@ -52,6 +52,8 @@
optimise.automatic = true;
};
security.apparmor.enable = true;
# unfree
nixpkgs.config.allowUnfree = true;
@ -75,6 +77,7 @@
usbutils # lsusb
wget
zsh
bc
android-tools
# media
@ -115,6 +118,7 @@
".." = "cd ..";
"lsa" = "ls -al";
"yt-dlp" = "yt-dlp --paths ~/Downloads";
};
environment.pathsToLink = [

View File

@ -11,12 +11,10 @@
qt.style = "adwaita-dark";
qt.platformTheme = "gnome";
#hyprland
services.displayManager.sddm.enable = true; # use sddm until gnome 50 due to https://github.com/systemd/systemd/issues/39259
services.displayManager.sddm.wayland.enable = true;
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
services.libinput.enable = true; # hyprland and trackpad
# Enable CUPS to print documents.
services.printing.enable = true;
@ -26,17 +24,10 @@
openFirewall = true;
};
services.tailscale.enable = true;
services.printing.drivers = [
pkgs.brlaser
pkgs.brgenml1lpr
pkgs.brgenml1cupswrapper
];
# Enable automatic login for the user.
# services.displayManager.autoLogin.enable = true;
# services.displayManager.autoLogin.user = "admin";
# services.gnome.gnome-keyring.enable = true;
# security.pam.services.gdm.enableGnomeKeyring = true; #unlock PAM
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
systemd.services."getty@tty1".enable = false;
@ -46,15 +37,15 @@
# "--config=/mnt/services/emulators/retroarch/retroarch.cfg"
#];
services.ollama = {
enable = true;
openFirewall = true;
host = "0.0.0.0";
# Optional: preload models, see https://ollama.com/library
loadModels = [ "gemma4" ];
package = pkgs.ollama-cuda;
#services.ollama = {
# enable = true;
# openFirewall = true;
# host = "0.0.0.0";
# # Optional: preload models, see https://ollama.com/library
# loadModels = [ "gemma4" ];
# package = pkgs.ollama-cuda;
};
#};
programs.chromium = {
enable = true;
@ -67,6 +58,8 @@
hardware.keyboard.qmk.enable = true;
services.logind.settings."Login"."HandlePowerKey" = "suspend";
boot = {
# Graphical boot
plymouth.enable = true;
@ -95,8 +88,6 @@
})
];
services.mullvad-vpn.enable = true;
environment.systemPackages = with pkgs; [
brave
firefox
@ -105,21 +96,21 @@
orca-slicer
gimp
inkscape
unstable.protonmail-desktop
#unstable.protonmail-desktop
#bitwarden-desktop
libreoffice
freecad
kiwix
obs-studio
obsidian
unstable.proton-authenticator
#unstable.proton-authenticator #x86 only
prismlauncher
unstable.signal-desktop
tor-browser
#tor-browser #x86 only
wireshark
monero-gui
moonlight-qt
nvtopPackages.nvidia
#nvtopPackages.nvidia
dconf-editor
kdePackages.kdenlive
element-desktop
@ -128,33 +119,37 @@
veracrypt
lmms
restic-browser
texliveFull
# games
#gnome-2048
#gnome-chess
#cataclysm-dda
#endless-sky
#mindustry
##mindustry #x86 only
#openrct2
#openttd
#osu-lazer-bin
#runelite
##osu-lazer-bin #x86 only
##runelite #x86 only
#unciv
#webcord
#wesnoth
#xonotic
#zeroad #0ad
#zeroad # 0ad
# game utils
#mangohud
#umu-launcher
mangohud
#umu-launcher #x86 only
# emu
#ryubing
#xemu
#xenia-canary
#xenia-canary #86 only
#retroarch-full
#rpcs3
#dolphin-emu
#cemu
#cemu #x86 only
# backup
keepassxc
@ -167,45 +162,43 @@
hinting.autohint = true;
};
services.sunshine = {
enable = true;
autoStart = true;
capSysAdmin = true;
openFirewall = true;
package = pkgs.sunshine.override {
cudaSupport = true;
};
};
#services.sunshine = {
# enable = true;
# autoStart = true;
# capSysAdmin = true;
# openFirewall = true;
# package = pkgs.sunshine.override {
# cudaSupport = true;
# };
#};
services.hardware.openrgb.enable = true;
services.hardware.openrgb.package = pkgs.openrgb-with-all-plugins;
#services.hardware.openrgb.enable = true;
#services.hardware.openrgb.package = pkgs.openrgb-with-all-plugins;
programs = {
localsend = {
enable = true;
openFirewall = true;
};
coolercontrol = {
enable = true;
};
#coolercontrol = {
# enable = true;
#};
gamescope = {
enable = true;
#capSysNice = true;
};
#steam = { #x86 only
# enable = true;
# gamescopeSession.enable = true;
# remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
# dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
# localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
#};
steam = {
enable = true;
gamescopeSession.enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
};
gamemode.enable = true;
#gamemode.enable = true;
};
fileSystems."/mnt/media" = {
@ -252,59 +245,58 @@
imports = [ inputs.nix-flatpak.nixosModules.nix-flatpak ];
#services.flatpak = {
# enable = true;
# update.auto = {
# enable = true;
# onCalendar = "weekly"; # Default value
# };
# packages = [
# "com.bitwarden.desktop"
# "com.orcaslicer.OrcaSlicer"
# "me.proton.Mail"
# "org.audacityteam.Audacity"
# "org.blender.Blender"
# "org.freecad.FreeCAD"
# "org.gimp.GIMP"
# "org.inkscape.Inkscape"
# "org.kiwix.desktop"
# "org.libreoffice.LibreOffice"
# "md.obsidian.Obsidian"
# "com.obsproject.Studio"
# "org.prismlauncher.PrismLauncher"
# "org.signal.Signal"
# "org.wireshark.Wireshark"
# "org.getmonero.Monero"
# "com.moonlight_stream.Moonlight"
# "org.kde.kdenlive"
# "im.riot.Riot"
# "com.chirpmyradio.chirp"
# "io.lmms.LMMS"
services.flatpak = {
enable = true;
update.auto = {
enable = true;
onCalendar = "weekly"; # Default value
};
# packages = [
# "com.bitwarden.desktop"
# "com.orcaslicer.OrcaSlicer"
# "me.proton.Mail"
# "org.audacityteam.Audacity"
# "org.blender.Blender"
# "org.freecad.FreeCAD"
# "org.gimp.GIMP"
# "org.inkscape.Inkscape"
# "org.kiwix.desktop"
# "org.libreoffice.LibreOffice"
# "md.obsidian.Obsidian"
# "com.obsproject.Studio"
# "org.prismlauncher.PrismLauncher"
# "org.wireshark.Wireshark"
# "org.getmonero.Monero"
# "com.moonlight_stream.Moonlight"
# "org.kde.kdenlive"
# "im.riot.Riot"
# "com.chirpmyradio.chirp"
# "io.lmms.LMMS"
# # games
# "com.github.Anuken.Mindustry"
# "com.play0ad.zeroad"
# "io.github.endless_sky.endless_sky"
# "io.github.spacingbat3.webcord"
# "io.github.yairm210.unciv"
# "io.openrct2.OpenRCT2"
# "net.runelite.RuneLite"
# "org.cataclysmdda.CataclysmDDA"
# "org.openttd.OpenTTD"
# "org.wesnoth.Wesnoth"
# "org.xonotic.Xonotic"
# "sh.ppy.osu"
#
# # emu
# "io.github.ryubing.Ryujinx"
# "app.xemu.xemu"
# "net.rpcs3.RPCS3"
# "org.DolphinEmu.dolphin-emu"
# "info.cemu.Cemu"
# # games
# "com.github.Anuken.Mindustry"
# "com.play0ad.zeroad"
# "io.github.endless_sky.endless_sky"
# "io.github.spacingbat3.webcord"
# "io.github.yairm210.unciv"
# "io.openrct2.OpenRCT2"
# "net.runelite.RuneLite"
# "org.cataclysmdda.CataclysmDDA"
# "org.openttd.OpenTTD"
# "org.wesnoth.Wesnoth"
# "org.xonotic.Xonotic"
# "sh.ppy.osu"
#
# # emu
# "io.github.ryubing.Ryujinx"
# "app.xemu.xemu"
# "net.rpcs3.RPCS3"
# "org.DolphinEmu.dolphin-emu"
# "info.cemu.Cemu"
# # backup
# "org.keepassxc.KeePassXC"
#
# ];
#};
# # backup
# "org.keepassxc.KeePassXC"
#
# ];
};
}

View File

@ -1,9 +1,14 @@
{ pkgs, ... }:
{
# Enable the GNOME Desktop Environment.
services.desktopManager.gnome.enable = false;
services.desktopManager.gnome.enable = true;
services.gnome.games.enable = true;
services.displayManager.gdm.enable = true;
environment.systemPackages = with pkgs; [
gnome-console
gnomeExtensions.appindicator
gnomeExtensions.blur-my-shell
gnomeExtensions.caffeine
@ -12,14 +17,13 @@
environment.gnome.excludePackages = with pkgs; [
epiphany # web browser
geary # email
decibels # audio player
gnome-calendar
gnome-music
gnome-software
gnome-tour
totem # video player
xterm
gnome-music
gnome-text-editor
showtime
yelp # help
];
@ -48,6 +52,7 @@
pkgs.gnomeExtensions.caffeine.extensionUuid
pkgs.gnomeExtensions.dash-to-dock.extensionUuid
];
always-show-log-out = true;
};
"org/gnome/desktop/calendar" = {
show-weekdate = true;
@ -59,13 +64,13 @@
enable-hot-corners = false;
font-name = "Noto Sans 11";
gtk-theme = "Adwaita-dark";
monospace-font-name = "Fira Mono 12";
monospace-font-name = "JetBrains Nerd Font Mono 12";
};
"org/gnome/desktop/peripherals/mouse" = {
accel-profile = "flat";
};
"org/gnome/desktop/wm/preferences" = {
button-layout = ":minimize,maximize,close";
button-layout = "close,maximize,minimize:";
};
"org/gnome/nautilus/list-view" = {
default-zoom-level = "small";
@ -75,12 +80,16 @@
};
"org/gnome/shell/extensions/dash-to-dock" = {
click-action = "minimize-or-previews";
dock-fixed = true;
dock-fixed = false;
multi-monitor = true;
show-mounts = false;
show-show-apps-button = true;
apply-custom-theme = true;
};
"org/gnome/peripherals.keyboard" = {
delay = "200";
repeat-interval = "30";
};
"org/gnome/shell/keybindings" = {
show-screenshot-ui = [ "<Shift><Super>s" ];
};

View File

@ -5,6 +5,10 @@
programs.hyprland.enable = true;
security.pam.services.hyprlock = { };
#display manager
services.displayManager.sddm.enable = true; # use sddm until gnome 50 due to https://github.com/systemd/systemd/issues/39259
services.displayManager.sddm.wayland.enable = true;
#wifi
networking.wireless.iwd.enable = true;
@ -25,14 +29,32 @@
tesseract # ocr
hyprpicker
satty # image annotation
brightnessctl
rofimoji
# dev
jq # for scripts
# gnome stuff
gnome-calculator
nautilus
gnome-font-viewer
gnome-calendar
gnome-characters
gnome-clocks
gnome-contacts
gnome-font-viewer
gnome-maps
gnome-weather
loupe # image viewer
nautilus # file managr
papers # doc viewer
simple-scan # document scanner
snapshot # camera
];
programs.seahorse.enable = true; # keyring viewer
services.upower.enable = true; # battery stuff
services.udisks2.enable = true; # udiskie automount USB
}

BIN
firmware/all_firmware.tar.gz Executable file

Binary file not shown.

Binary file not shown.

37
flake.lock generated
View File

@ -1,5 +1,41 @@
{
"nodes": {
"apple-silicon-support": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1779284798,
"narHash": "sha256-D0I5TMDo8n1EvVc0d1dshsA+hzFRNxgx9YyMmkWMy+w=",
"owner": "nix-community",
"repo": "nixos-apple-silicon",
"rev": "f2506ef24a154e2bcc8fb10f2c73579324f9ead0",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-apple-silicon",
"type": "github"
}
},
"flake-compat": {
"locked": {
"lastModified": 1761640442,
"narHash": "sha256-AtrEP6Jmdvrqiv4x2xa5mrtaIp3OEe8uBYCDZDS+hu8=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "4a56054d8ffc173222d09dad23adf4ba946c8884",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@ -181,6 +217,7 @@
},
"root": {
"inputs": {
"apple-silicon-support": "apple-silicon-support",
"home-manager": "home-manager",
"home-manager-unstable": "home-manager-unstable",
"lazyvim": "lazyvim",

View File

@ -13,6 +13,10 @@
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
lazyvim.url = "github:pfassina/lazyvim-nix";
nix-flatpak.url = "github:gmodena/nix-flatpak";
apple-silicon-support = {
url = "github:nix-community/nixos-apple-silicon";
inputs.nixpkgs.follows = "nixpkgs"; # avoids a second nixpkgs copy
};
};
outputs =
@ -24,6 +28,7 @@
nix-darwin,
lazyvim,
nix-flatpak,
apple-silicon-support,
...
}@inputs:
{
@ -38,7 +43,8 @@
./config/common.nix
./config/linux.nix
./config/desktop.nix
./config/hyprland.nix
#./config/hyprland.nix
./config/gnome.nix
./hosts/desktop/hardware.nix
./hosts/desktop/settings.nix
home-manager.nixosModules.home-manager
@ -54,7 +60,7 @@
imports = [
./home/common.nix
./home/desktop.nix
./home/hyprland.nix
#./home/hyprland.nix
];
};
}
@ -108,6 +114,42 @@
}
];
};
nixosConfigurations.macbook-air = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit self inputs;
inherit nix-flatpak;
hostname = "macbook-air";
};
#inherit system;
modules = [
./config/common.nix
./config/linux.nix
./config/desktop.nix
./config/gnome.nix
./hosts/macbook-air/hardware.nix
./hosts/macbook-air/settings.nix
apple-silicon-support.nixosModules.apple-silicon-support
{ hardware.asahi.peripheralFirmwareDirectory = "${self}/firmware"; }
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit lazyvim;
inherit inputs;
hostname = "macbook-air";
};
home-manager.users.admin = {
imports = [
./home/common.nix
./home/desktop.nix
#./home/hyprland.nix
];
};
}
];
};
};
}

View File

@ -26,7 +26,6 @@
config = {
profile = "high-quality";
ytdl-format = "bestvideo+bestaudio";
cache-default = 4000000;
loop-file = "inf";
};
@ -38,12 +37,12 @@
lazyvim = {
enable = true;
plugins = {
colorscheme = ''
return {
"kepano/flexoki-neovim"
}
'';
};
colorscheme = ''
return {
"kepano/flexoki-neovim"
}
'';
};
};
# neovim = {
# enable = true;

View File

@ -1,4 +1,9 @@
{ pkgs, hostname, ... }:
{
config,
pkgs,
hostname,
...
}:
let
nix_background = "rgb(16, 15, 15)";
nix_text = "rgb(206, 205, 195)";
@ -9,7 +14,7 @@ let
nix_font = "JetBrainsMono Nerd Font";
nix_border_size = 3;
nix_corner = 10;
nix_bar_height = 30;
nix_bar_height = if (hostname == "macbook-air") then 38 else 26;
in
{
home.pointerCursor = {
@ -23,6 +28,16 @@ in
# gtk = {
# enable = true;
# };
#
#
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-hyprland
];
};
services.udiskie.enable = true; # automount USB
@ -89,6 +104,25 @@ in
};
};
services.hyprsunset = {
enable = true;
settings = {
max-gamma = 150;
profile = [
{
time = "7:30";
identity = true;
}
{
time = "21:00";
temperature = 2500;
gamma = 0.8;
}
];
};
};
services.hyprpaper = {
enable = true;
settings = {
@ -97,8 +131,7 @@ in
"~/Downloads/wall.jpg"
];
wallpaper = [
"DP-2,~/Downloads/wall.jpg"
"HDMI-A-1,~/Downloads/wall.jpg"
",~/Downloads/wall.jpg"
];
};
};
@ -118,11 +151,13 @@ in
gaps = true;
gap_size = 15;
corner_radius = nix_corner;
layer = "top";
};
urgency_critical = {
frame_color = nix_alert;
timeout = 0;
layer = "overlay"; # show above fullscreen apps
};
};
@ -181,7 +216,7 @@ in
border-radius: 0;
min-height: 0;
font-family: '${nix_font}';
font-size: 14px; /* up from 12px */
font-size: 12px; /* up from 12px */
}
.modules-left {
@ -211,7 +246,6 @@ in
#cpu,
#battery,
#pulseaudio,
#custom-power,
#idle_inhibitor,
#bluetooth,
#privacy,
@ -265,11 +299,11 @@ in
opacity: 0;
}
#privacy privacy-item *{
#privacy privacy-item * {
min-width: 12px;
margin-left: 5px;
margin-right: 0;
font-size: 10px;
font-size: 9px;
padding-bottom: 1px;
color: #ffffff;
}
@ -291,23 +325,78 @@ in
"hyprland/workspaces"
"hyprland/submap"
];
modules-center = [
"clock"
"idle_inhibitor"
];
modules-center =
if hostname == "macbook-air" then
[ ]
else
[
"clock"
"idle_inhibitor"
];
modules-right = [
"group/minimized"
"hyprland/language"
"bluetooth"
"network"
"pulseaudio"
"custom/power"
"battery"
"privacy"
];
]
++ (
if hostname == "macbook-air" then
[
"clock"
"idle_inhibitor"
]
else
[ ]
);
privacy = {
icon-size = 14;
};
battery = {
format = "{capacity}% {icon}";
format-discharging = "{icon}";
format-charging = "{icon}";
format-plugged = "";
format-icons = {
charging = [
"󰢜"
"󰂆"
"󰂇"
"󰂈"
"󰢝"
"󰂉"
"󰢞"
"󰂊"
"󰂋"
"󰂅"
];
default = [
"󰁺"
"󰁻"
"󰁼"
"󰁽"
"󰁾"
"󰁿"
"󰂀"
"󰂁"
"󰂂"
"󰁹"
];
};
format-full = "󰂅";
tooltip-format-discharging = "{power:>1.0f}W {capacity}%";
tooltip-format-charging = "{power:>1.0f}W {capacity}%";
interval = 5;
#on-click = "omarchy-menu power";
#on-click-right = ''notify-send -u low "$(omarchy-battery-status)"'';
states = {
warning = 20;
critical = 10;
};
};
"hyprland/workspaces" = {
on-click = "activate";
@ -352,11 +441,6 @@ in
on-click = "hyprctl switchxkblayout monsgeek-monsgeek-keyboard next";
};
"custom/power" = {
format = "";
on-click = "hyprlock & systemctl suspend";
};
"custom/menu" = {
format = "";
on-click = "rofi -show drun";
@ -408,6 +492,7 @@ in
clock = {
format = "{:%a %b %d %H:%M}";
tooltip-format = "{calendar}";
on-click = "for i in {1..10}; do dunstctl history-pop; done; sleep 5 && dunstctl close-all"; # show last 10 notifications for 5 seconds
};
idle_inhibitor = {
@ -422,8 +507,8 @@ in
format = "{icon}";
format-muted = "";
format-icons = {
headphone = "";
headset = "";
#headphone = "";
#headset = "";
default = [
""
""
@ -443,8 +528,79 @@ in
enable = true;
font = "${nix_font} 14";
plugins = [
pkgs.rofimoji
pkgs.rofi-calc
];
#theme = let
# inherit (config.lib.formats.rasi) mkLiteral;
#in {
# "*" = {
# background-color = mkLiteral "#1e1e2e";
# foreground-color = mkLiteral "#cdd6f4";
# border-color = mkLiteral "#89b4fa";
# font = "JetBrains Mono Nerd Font 12";
# padding = mkLiteral "0px";
# spacing = 0;
# };
# "#window" = {
# background-color = mkLiteral "@background-color";
# border = mkLiteral "2px";
# border-color = mkLiteral "@border-color";
# border-radius = mkLiteral "8px";
# width = mkLiteral "40%";
# location = mkLiteral "center";
# };
# "#mainbox" = {
# background-color = mkLiteral "transparent";
# padding = mkLiteral "12px";
# spacing = mkLiteral "8px";
# };
# "#inputbar" = {
# background-color = mkLiteral "#313244";
# border-radius = mkLiteral "6px";
# padding = mkLiteral "8px 12px";
# spacing = mkLiteral "8px";
# children = map mkLiteral [ "prompt" "entry" ];
# };
# "#prompt" = {
# background-color = mkLiteral "transparent";
# foreground-color = mkLiteral "@border-color";
# };
# "#entry" = {
# background-color = mkLiteral "transparent";
# foreground-color = mkLiteral "@foreground-color";
# placeholder = "Search...";
# placeholder-color = mkLiteral "#6c7086";
# };
# "#listview" = {
# background-color = mkLiteral "transparent";
# lines = 8;
# columns = 1;
# spacing = mkLiteral "4px";
# scrollbar = false;
# };
# "#element" = {
# background-color = mkLiteral "transparent";
# foreground-color = mkLiteral "@foreground-color";
# border-radius = mkLiteral "6px";
# padding = mkLiteral "8px 12px";
# };
# "#element.selected" = {
# background-color = mkLiteral "#89b4fa";
# foreground-color = mkLiteral "#1e1e2e";
# };
# "#element.alternate" = {
# background-color = mkLiteral "transparent";
# };
#};
};
programs.hyprlock = {
enable = true;
@ -496,12 +652,12 @@ in
listener = [
{
timeout = 300;
timeout = if (hostname == "macbook-air") then 120 else 300;
on-timeout = "loginctl lock-session & hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
{
timeout = 900;
timeout = if (hostname == "macbook-air") then 130 else 900;
on-timeout = "systemctl suspend";
on-resume = "hyprctl dispatch dpms on";
}
@ -509,7 +665,222 @@ in
};
};
xdg.configFile."hypr/scripts/media.sh" = {
xdg.configFile."hypr/scripts/battery-monitor.sh" = {
executable = true;
text = ''
BATTERY_THRESHOLD=35
NOTIFICATION_FLAG="/run/user/$UID/battery_notified"
BATTERY_LEVEL=$(upower -i $(upower -e | grep -i 'BAT') | awk '/percentage/ { print int($2); exit }')
BATTERY_STATE=$(upower -i $(upower -e | grep -i 'BAT') | grep -E "state" | awk '{print $2}')
send_notification() {
notify-send -u critical "󱐋 Time to recharge!" "Battery is down to $\{1}%" -i battery-caution -t 30000
}
if [[ -n $BATTERY_LEVEL && $BATTERY_LEVEL =~ ^[0-9]+$ ]]; then
if [[ $BATTERY_STATE == "discharging" ]] && (( BATTERY_LEVEL <= BATTERY_THRESHOLD )); then
if [[ ! -f $NOTIFICATION_FLAG ]]; then
send_notification $BATTERY_LEVEL
touch $NOTIFICATION_FLAG
fi
else
rm -f $NOTIFICATION_FLAG
fi
fi
'';
};
systemd.user.services.battery-monitor = {
Unit = {
Description = "Battery level monitor";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "${config.home.homeDirectory}/.config/hypr/scripts/battery-monitor.sh";
};
};
systemd.user.timers.battery-monitor = {
Unit.Description = "Run battery monitor periodically";
Timer = {
OnBootSec = "1min";
OnUnitActiveSec = "1min";
Unit = "battery-monitor.service";
};
Install.WantedBy = [ "timers.target" ];
};
xdg.configFile."hypr/scripts/osd.sh" = {
executable = true;
text = ''
# See README.md for usage instructions
volume_step=5
brightness_step="5%"
max_volume=100
notification_timeout=1000
download_album_art=true
show_album_art=true
show_music_in_volume_indicator=true
show_percentages=false
# wpctl outputs "Volume: 0.75", so we multiply by 100 to get an integer percentage
function get_volume {
wpctl get-volume @DEFAULT_SINK@ | awk '{printf "%d", $2 * 100}'
}
# wpctl appends "[MUTED]" to the output when muted
function get_mute {
wpctl get-volume @DEFAULT_SINK@ | grep -q '\[MUTED\]' && echo "yes" || echo "no"
}
# Uses regex to get brightness from brightnessctl
function get_brightness {
brightnessctl | grep -oP '\d+(?=%)' | head -n 1
}
# Returns a mute icon, a volume-low icon, or a volume-high icon, depending on the volume
function get_volume_icon {
volume=$(get_volume)
mute=$(get_mute)
if [ "$volume" -eq 0 ] || [ "$mute" == "yes" ]; then
volume_icon=" "
elif [ "$volume" -lt 50 ]; then
volume_icon=" "
else
volume_icon=" "
fi
}
# Always returns the same icon
function get_brightness_icon {
brightness_icon=" "
}
function get_album_art {
url=$(playerctl -f "{{mpris:artUrl}}" metadata)
if [[ $url == "file://"* ]]; then
album_art="$\{url/file:\/\//}"
elif [[ $url == "http://"* || $url == "https://"* ]] && [[ $download_album_art == "true" ]]; then
filename="$(echo $url | sed "s/.*\///")"
if [ ! -f "/tmp/$filename" ]; then
wget -O "/tmp/$filename" "$url"
fi
album_art="/tmp/$filename"
else
album_art=""
fi
}
# Displays a volume notification
function show_volume_notif {
volume=$(get_volume)
get_volume_icon
if [[ $show_percentages == "true" ]]; then
volume_label="$volume_icon $volume%"
else
volume_label="$volume_icon"
fi
if [[ $show_music_in_volume_indicator == "true" ]]; then
current_song=$(playerctl -f "{{title}} - {{artist}}" metadata)
if [[ $show_album_art == "true" ]]; then
get_album_art
fi
notify-send -t $notification_timeout -h string:x-dunst-stack-tag:volume_notif -h int:value:$volume -i "$album_art" "$volume_label" "$current_song"
else
notify-send -t $notification_timeout -h string:x-dunst-stack-tag:volume_notif -h int:value:$volume "$volume_label"
fi
}
# Displays a music notification
function show_music_notif {
song_title=$(playerctl -f "{{title}}" metadata)
song_artist=$(playerctl -f "{{artist}}" metadata)
#song_album=$(playerctl -f "{{album}}" metadata)
if [[ $show_album_art == "true" ]]; then
get_album_art
fi
#notify-send -t $notification_timeout -h string:x-dunst-stack-tag:music_notif -i "$album_art" "$song_title" "$song_artist - $song_album"
notify-send -t $notification_timeout -h string:x-dunst-stack-tag:music_notif -i "$album_art" "$song_title" "$song_artist"
}
# Displays a brightness notification
function show_brightness_notif {
brightness=$(get_brightness)
get_brightness_icon
if [[ $show_percentages == "true" ]]; then
brightness_label="$brightness_icon $brightness%"
else
brightness_label="$brightness_icon"
fi
notify-send -t $notification_timeout -h string:x-dunst-stack-tag:brightness_notif -h int:value:$brightness "$brightness_label"
}
# Main function - Takes user input, "volume_up", "volume_down", "brightness_up", or "brightness_down"
case $1 in
volume_up)
wpctl set-mute @DEFAULT_SINK@ 0
volume=$(get_volume)
if [ $(( "$volume" + "$volume_step" )) -gt $max_volume ]; then
wpctl set-volume @DEFAULT_SINK@ $(echo "$max_volume / 100" | bc -l)
else
wpctl set-volume @DEFAULT_SINK@ $(echo "$volume_step / 100" | bc -l)+
fi
show_volume_notif
;;
volume_down)
wpctl set-volume @DEFAULT_SINK@ $(echo "$volume_step / 100" | bc -l)-
show_volume_notif
;;
volume_mute)
wpctl set-mute @DEFAULT_SINK@ toggle
show_volume_notif
;;
brightness_up)
brightnessctl set +$brightness_step
show_brightness_notif
;;
brightness_down)
brightnessctl set $brightness_step-
show_brightness_notif
;;
next_track)
playerctl next
sleep 0.5 && show_music_notif
;;
prev_track)
playerctl previous
sleep 0.5 && show_music_notif
;;
play_pause)
playerctl play-pause
show_music_notif
;;
esac
'';
};
xdg.configFile."hypr/scripts/media.sh" = {
executable = true;
text = ''
# Define a unique ID to reuse for replacing notifications
@ -543,25 +914,13 @@ in
else
notify-send -r $NOTIF_ID "Now Playing" "$MSG" -i media-playback-start -t 5000
fi
'';
};
'';
};
xdg.configFile."hypr/scripts/screenshot.sh" = {
executable = true;
text = ''
MODE=$1
FILE=$(mktemp /tmp/screenshot-XXXXXX.png)
grim -g "$(slurp)" "$FILE" || exit 1
wl-copy < "$FILE"
ACTION=$(dunstify "Screenshot taken" "Copied to clipboard" \
--icon="$FILE" \
--action="open,Open in Satty" \
--timeout=5000)
[ "$ACTION" = "2" ] && satty --filename "$FILE"
FILE=$(mktemp /tmp/screenshot-XXXXXX.png)
case "$MODE" in
@ -595,8 +954,10 @@ in
wayland.windowManager.hyprland = {
enable = true;
#configType = "hyprlang";
plugins = [
pkgs.hyprlandPlugins.hyprbars
#pkgs.hyprlandPlugins.hyprspace
];
settings = {
# This is an example Hyprland config file for Nix.
@ -621,17 +982,19 @@ in
plugin = {
hyprbars = {
bar_height = nix_bar_height;
bar_height = if (hostname == "macbook-air") then 30 else nix_bar_height;
hyprbars-button = [
"rgb(ff605C), 16, 󰖭, hyprctl dispatch killactive"
"rgb(00CA4E), 16, 󰊔, hyprctl dispatch fullscreen 1"
"rgb(FFBD44), 16, , hyprctl dispatch togglefloating"
"rgb(ff605C), 15, 󰖭, hyprctl dispatch killactive"
"rgb(00CA4E), 15, 󰊔, hyprctl dispatch fullscreen 1"
"rgb(FFBD44), 15, , hyprctl dispatch togglefloating"
];
on_double_click = "hyprctl dispatch fullscreen 1";
icon_on_hover = true;
bar_color = nix_background;
"col.text" = nix_text;
bar_buttons_alignment = "right";
bar_text_font = nix_font;
bar_text_size = 9;
bar_buttons_alignment = "left";
};
};
@ -647,13 +1010,17 @@ in
"DP-2, 2560x1440@180,0x0,1,vrr,1,bitdepth,10"
"HDMI-A-1, 1920x1080@75,2560x0,1,vrr,1"
]
else if (hostname == "macbook-air") then
[
"eDP-1, 2560x1660@60, 0x0, 1.6"
]
else
[
",preferred,auto,auto"
];
###################
### MY PROGRAMS ###
### MY PROGRAMS ###0
###################
# See https://wiki.hypr.land/Configuring/Keywords/
@ -661,9 +1028,9 @@ in
# Set programs that you use
"$terminal" = "alacritty";
"$fileManager" = "dolphin";
"$fileManager" = "nautilus";
"$menu" = "rofi -show drun";
"$browser" = "brave";
"$browser" = "brave --ozone-platform=wayland --enable-features=TouchpadOverscrollHistoryNavigation";
#################
### AUTOSTART ###
@ -676,6 +1043,7 @@ in
"waybar"
"steam -silent"
"webcord --start-minimized"
"signal-desktop --start-in-tray"
#"[workspace 1 silent]$browser"
#"[workspace 3 silent]proton-mail"
@ -720,8 +1088,8 @@ in
# https://wiki.hypr.land/Configuring/Variables/#general
general = {
gaps_in = 10;
gaps_out = 20;
gaps_in = if (hostname == "macbook-air") then 5 else 10;
gaps_out = if (hostname == "macbook-air") then 10 else 20;
border_size = nix_border_size;
@ -789,14 +1157,13 @@ in
};
};
layerrule = [
#"blur, notifications"
#"ignorezero, notifications"
layer_rule = [
"blur, notifications"
"ignorezero, notifications"
# turn off anim for walker
#"noanim, walker"
]; # add blur to notifications
"noanim, rofi"
];
# https://wiki.hypr.land/Configuring/Variables/#animations
animations = {
@ -876,21 +1243,27 @@ in
accel_profile = "flat";
touchpad = {
scroll_factor = 1.0;
disable_while_typing = false;
natural_scroll = false;
natural_scroll = true;
tap-to-click = false;
clickfinger_behavior = true;
};
};
gestures = {
workspace_swipe_distance = 150;
workspace_swipe_touch = true;
};
# https://wiki.hypr.land/Configuring/Variables/#gestures
#gestures = {
# workspace_swipe = false;
#};
gesture = [ "3, horizontal, workspace" ];
# Example per-device config
# See https://wiki.hypr.land/Configuring/Keywords/#per-device-input-configs for more
device = {
name = "epic-mouse-v1";
sensitivity = -0.5;
name = "apple-mtp-multi-touch";
accel_profile = "";
sensitivity = -0.1;
};
###################
@ -903,20 +1276,23 @@ in
bind = [
# Example binds, see https://wiki.hypr.land/Configuring/Binds/ for more
"$mainMod, Return, exec, $terminal"
"$mainMod, Q, killactive,"
"$mainMod, C, killactive,"
"alt, F4, killactive,"
"$mainMod SHIFT, Q, exit,"
"$mainMod, E, exec, $fileManager"
"$mainMod, S, exec, hyprctl clients -j | jq -e '.[] | select(.class == \"signal\")' > /dev/null && hyprctl dispatch focuswindow class:signal || signal-desktop"
"$mainMod, D, exec, hyprctl clients -j | jq -e '.[] | select(.class == \"webcord\")' > /dev/null && hyprctl dispatch focuswindow class:webcord || webcord"
"$mainMod, V, togglefloating,"
"$mainMod, F, fullscreen, 3"
"$mainMod, M, fullscreen, 1"
"$mainMod, W, exec, $browser"
"$mainMod, space, exec, $menu"
#"$mainMod, P, pseudo," # dwindle
#"$mainMod SHIFT, L, exec, hyprlock& systemctl suspend" #idk
#"$mainMod, T, togglesplit," # dwindle
"$mainMod SHIFT, L, exec, hyprlock"
"$mainMod SHIFT, F, workspaceopt, allfloat"
"$mainMod SHIFT, H, exec, for i in {1..10}; do dunstctl history-pop; done; sleep 5 && dunstctl close-all" # show last 10 notifications for 5 seconds
#"$mainMod SHIFT, H, exec, for i in {1..10}; do dunstctl history-pop; done; sleep 5 && dunstctl close-all" # show last 10 notifications for 5 seconds
"$mainMod, G, togglegroup,"
"$mainMod SHIFT, S, exec, ~/.config/hypr/scripts/screenshot.sh region"
", PRINT, exec, ~/.config/hypr/scripts/screenshot.sh fullscreen"
@ -931,6 +1307,11 @@ in
"$mainMod, l, movefocus, r"
"$mainMod, k, movefocus, u"
"$mainMod, j, movefocus, d"
"$mainMod SHIFT, H, movewindow, l"
"$mainMod SHIFT, L, movewindow, r"
"$mainMod SHIFT, K, movewindow, u"
"$mainMod SHIFT, J, movewindow, d"
"$mainMod, Tab, cyclenext"
"$mainMod, Tab, bringactivetotop"
@ -968,6 +1349,7 @@ in
# Scroll through existing workspaces with mainMod + scroll
"$mainMod, mouse_down, workspace, e+1"
"$mainMod, mouse_up, workspace, e-1"
];
# Move/resize windows with mainMod + LMB/RMB and dragging
@ -978,20 +1360,22 @@ in
# Laptop multimedia keys for volume and LCD brightness
bindel = [
",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
",XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+"
",XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%-"
",XF86AudioRaiseVolume, exec, ~/.config/hypr/scripts/osd.sh volume_up"
",XF86AudioLowerVolume, exec, ~/.config/hypr/scripts/osd.sh volume_down"
",XF86AudioMute, exec, ~/.config/hypr/scripts/osd.sh volume_mute"
",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
",XF86MonBrightnessUp, exec, ~/.config/hypr/scripts/osd.sh brightness_up"
",XF86MonBrightnessDown, exec, ~/.config/hypr/scripts/osd.sh brightness_down"
#",Caps_Lock, exec, "
];
# Requires playerctl
bindl = [
", XF86AudioNext, exec, playerctl next& ~/.config/hypr/scripts/media.sh"
", XF86AudioPause, exec, playerctl play-pause& ~/.config/hypr/scripts/media.sh"
", XF86AudioPlay, exec, playerctl play-pause& ~/.config/hypr/scripts/media.sh"
", XF86AudioPrev, exec, playerctl previous& ~/.config/hypr/scripts/media.sh"
", XF86AudioNext, exec, playerctl next& ~/.config/hypr/scripts/osd.sh next_track"
", XF86AudioPause, exec, playerctl play-pause& ~/.config/hypr/scripts/osd.sh play_pause"
", XF86AudioPlay, exec, playerctl play-pause& ~/.config/hypr/scripts/osd.sh play_pause"
", XF86AudioPrev, exec, playerctl previous& ~/.config/hypr/scripts/osd.sh prev_track"
",switch:on:Lid Switch, exec, hyprlock & systemctl suspend"
];
##############################
@ -1001,74 +1385,80 @@ in
# See https://wiki.hypr.land/Configuring/Window-Rules/ for more
# See https://wiki.hypr.land/Configuring/Workspace-Rules/ for workspace rules
#windowrule = [
# # Example windowrule
# # "float,class:^(kitty)$,title:^(kitty)$"
# # Ignore maximize requests from apps. You'll probably like this.
# "suppressevent maximize, class:.*"
window_rule = [
# Example windowrule
# "float,class:^(kitty)$,title:^(kitty)$"
# Ignore maximize requests from apps. You'll probably like this.
"suppressevent maximize, class:.*"
# # Fix some dragging issues with XWayland
# "nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0"
# Fix some dragging issues with XWayland
"nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0"
# # make tuis accessed from waybar float in center
# "tag +floating-window, title:(bluetui|impala|wiremix)"
# "tag +floating-window, title:^(Open.*Files?|Open [F|f]older.*|Save.*Files?|Save.*As|Save|All Files|.*wants to [open|save].*|[C|c]hoose.*)"
# "float, class:(org.gnome.Calculator)"
# make tuis accessed from waybar float in center
"tag +floating-window, title:(bluetui|impala|wiremix|Signal.*|.*WebCord.*|Weather|Calendar)"
"tag +floating-window, title:^(Open.*Files?|Open [F|f]older.*|Save.*Files?|Save.*As|Save|All Files|.*wants to [open|save].*|[C|c]hoose.*)"
"tag +floating-window, class:(org.gnome.NautilusPreviewer)"
"float, class:(org.gnome.Calculator)"
# # send games to specific workspace
# "workspace name:games silent, class:$games"
# "noanim, class:$games"
# "noblur, class:$games"
# "noshadow, class:$games"
# "noborder, class:$games"
# "rounding 0, class:$games"
# "fullscreen, class:$games"
# "immediate, class:$games"
# fix scrolling speed in chromium based apps
"tag +chromium-based, class:(chrom.*|brave-browser|signal|WebCord|obsidian|electron)"
"scrolltouchpad 0.15, tag:chromium-based"
# # pip
# "tag +pip, title:(Picture.?in.?[Pp]icture)"
# "tag -default-opacity, tag:pip"
# "float, tag:pip"
# "pin, tag:pip"
# "size 600 338, tag:pip"
# "keepaspectratio, tag:pip"
# "bordersize 0, tag:pip"
# "opacity 1 1, tag:pip"
# "move (monitor_w-window_w-40) (monitor_h*0.04), tag:pip"
# send games to specific workspace
"workspace name:games silent, class:$games"
"noanim, class:$games"
"noblur, class:$games"
"noshadow, class:$games"
"noborder, class:$games"
"rounding 0, class:$games"
"fullscreen, class:$games"
"immediate, class:$games"
# # steam
# "float, class:^(steam)$"
# "center, class:^(steam)$, title:^(Steam)$"
# "tag -default-opacity, class:^(steam.*)$"
# "opacity 1 1, class:^(steam.*)$"
# "size 1100 700, class:^(steam)$, title:^(Steam)$"
# "size 460 800, class:^(steam)$, title:^(Friends List)$"
# "idleinhibit fullscreen, class:^(steam)$"
# pip
"tag +pip, title:(Picture.?in.?[Pp]icture)"
"tag -default-opacity, tag:pip"
"float, tag:pip"
"pin, tag:pip"
"size 600 338, tag:pip"
"keepaspectratio, tag:pip"
"bordersize 0, tag:pip"
"opacity 1 1, tag:pip"
"move (monitor_w-window_w-40) (monitor_h*0.04), tag:pip"
# # bitwarden
# "noscreenshare, class:^(Bitwarden)$"
# "tag +floating-window, class:^(Bitwarden)$"
# steam
"float, class:^(steam)$"
"center, class:^(steam)$, title:^(Steam)$"
"tag -default-opacity, class:^(steam.*)$"
"opacity 1 1, class:^(steam.*)$"
"size 1100 700, class:^(steam)$, title:^(Steam)$"
"size 460 800, class:^(steam)$, title:^(Friends List)$"
"idleinhibit fullscreen, class:^(steam)$"
# # Bitwarden Chrome Extension
# "noscreenshare, class:^(brave-nngceckbapebfimnlniiiahkandclblb-Default)$"
# "tag +floating-window, class:^(brave-nngceckbapebfimnlniiiahkandclblb-Default)$"
# bitwarden
"noscreenshare, class:^(Bitwarden)$"
"tag +floating-window, class:^(Bitwarden)$"
# # floating tag
# "float, tag:floating-window"
# "center, tag:floating-window"
# "size 875 600, tag:floating-window"
# Bitwarden Chrome Extension
"noscreenshare, class:^(brave-nngceckbapebfimnlniiiahkandclblb-Default)$"
"tag +floating-window, class:^(brave-nngceckbapebfimnlniiiahkandclblb-Default)$"
# # hyprbar
# "plugin:hyprbars:nobar, tag:^(?!floating-window$).*$"
#];
#"$games" =
# "^(steam_app_.*|lutris_game_class|minigalaxy|playnite_game_class|gamescope|chiaki|moonlight|com\.moonlight_stream\.Moonlight|.*[Ww]ine.*)$";
#workspace = [
# "name:1,monitor:DP-2"
# "name:games,monitor:DP-2"
# "name:4,monitor:HDMI-A-1"
#];
# floating tag
"float, tag:floating-window"
"center, tag:floating-window"
"size 875 600, tag:floating-window"
# hyprbar
"plugin:hyprbars:nobar, tag:^(?!floating-window$).*$"
];
"$games" =
"^(steam_app_.*|lutris_game_class|minigalaxy|playnite_game_class|gamescope|chiaki|moonlight|com\.moonlight_stream\.Moonlight|.*[Ww]ine.*)$";
workspace = [
"name:1,monitor:DP-2"
"name:games,monitor:DP-2"
"name:4,monitor:HDMI-A-1"
];
};
};

View File

@ -0,0 +1,39 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "usb_storage" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/mapper/vg-nixos";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/2ED7-130C";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}

View File

@ -0,0 +1,42 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{
config,
lib,
pkgs,
...
}:
{
boot.kernelParams = [
"hid_apple.swap_fn_leftctrl=1"
"hid_apple.swap_opt_cmd=1"
"appledrm.show_notch=1"
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
boot.initrd.luks.devices."encrypted".device =
"/dev/disk/by-uuid/ebf580bd-9d71-4a2a-b6ae-a0c7e9a11395";
networking.networkmanager.enable = true;
networking.networkmanager.wifi.backend = "iwd";
networking.wireless.iwd.enable = true;
# Specify path to peripheral firmware files.
#hardware.asahi.peripheralFirmwareDirectory = "./firmware";
# Or disable extraction and management of them completely.
hardware.asahi.extractPeripheralFirmware = true;
nix.settings = {
extra-substituters = [
"https://nixos-apple-silicon.cachix.org"
];
extra-trusted-public-keys = [
"nixos-apple-silicon.cachix.org-1:8psDu5SA5dAD7qA0zMy5UT292TxeEPzIz8VVEr2Js20="
];
};
system.stateVersion = "26.05"; # Did you read the comment?
}