Frame12: remove some gui apps (flatpak), update deprecations, update niri configs
This commit is contained in:
parent
b22d24f619
commit
31df81b867
@ -5,7 +5,6 @@
|
||||
email = "n8r@tuta.io";
|
||||
hostName = "frame12";
|
||||
desktop = "niri";
|
||||
gaming = true;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
@ -18,7 +17,6 @@
|
||||
userName = userName;
|
||||
hostName = hostName;
|
||||
de = desktop;
|
||||
installGaming = gaming;
|
||||
};
|
||||
|
||||
# Limit the number of generations to keep
|
||||
@ -37,4 +35,4 @@
|
||||
# Refer to the following link for more details:
|
||||
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
|
||||
nix.settings.auto-optimise-store = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,17 +19,11 @@ in
|
||||
type = lib.types.str;
|
||||
description = "Hostname for system";
|
||||
};
|
||||
installGaming = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to install gaming software or not";
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
modules/user/main_user.nix
|
||||
modules/niri/niri_conf.nix
|
||||
modules/niri/auto-rotation.nix
|
||||
../shared/modules/system/power_manager.nix
|
||||
];
|
||||
|
||||
@ -112,12 +106,6 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
niri-auto-rotation = {
|
||||
enable = true;
|
||||
user = deskCfg.userName;
|
||||
monitor = "eDP-1";
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
cryptsetup
|
||||
cage
|
||||
|
||||
41
frame12/dotfiles/ghostty/config
Normal file
41
frame12/dotfiles/ghostty/config
Normal file
@ -0,0 +1,41 @@
|
||||
font-size = 11
|
||||
font-family = "Monaspace Xenon Var"
|
||||
font-family-bold = "Monaspace Argon Var"
|
||||
font-family-italic = "Monaspace Radon Var"
|
||||
font-family-bold-italic = "Monaspace Krypton Var"
|
||||
|
||||
font-variation = wght=400
|
||||
font-variation = wdth=100
|
||||
font-variation = slnt=-2
|
||||
|
||||
font-variation-bold = wght=600
|
||||
font-variation-bold = wdth=100
|
||||
|
||||
font-variation-italic = wght=400
|
||||
font-variation-italic = wdth=100
|
||||
font-variation-italic = slnt=-10
|
||||
|
||||
font-variation-bold-italic = wght=700
|
||||
font-variation-bold-italic = wdth=100
|
||||
font-variation-bold-italic = slnt=-3
|
||||
|
||||
# Liguratures
|
||||
font-feature = +ss01, +ss02, +ss03, +ss04, +ss05, +ss06, +ss07, +ss08, +ss09, +ss10
|
||||
# Enables texture healing
|
||||
font-feature = +calt
|
||||
font-feature = +liga
|
||||
|
||||
###
|
||||
# Keybinds
|
||||
###
|
||||
|
||||
keybind = ctrl+shift+plus=increase_font_size:1
|
||||
# keybind = ctrl+minus=decrease_font_size:1
|
||||
|
||||
###
|
||||
# Misc
|
||||
###
|
||||
|
||||
window-padding-x = 4
|
||||
window-padding-y = 4
|
||||
keybind = shift+enter=text:\n
|
||||
@ -1,13 +1,41 @@
|
||||
// Example config for Niri.
|
||||
//
|
||||
// See `man 5 niri` for the complete list of options.
|
||||
// MISCELLANEOUS
|
||||
//
|
||||
|
||||
// gui startup
|
||||
spawn-at-startup "waybar"
|
||||
spawn-at-startup "keepassxc"
|
||||
spawn-at-startup "flatpak" "run" "org.signal.Signal"
|
||||
// shell startup
|
||||
spawn-at-startup "swayosd-server" // volume and brightness display
|
||||
spawn-sh-at-startup "kanshi"
|
||||
spawn-sh-at-startup "sleep 5 && nm-applet --indicator"
|
||||
spawn-sh-at-startup "sleep 5 && syncthingtray --wait"
|
||||
spawn-sh-at-startup "sleep 5 && swaync"
|
||||
|
||||
screenshot-path null // save screenshots just to clipboard
|
||||
prefer-no-csd // (Client Side Decorations) ask clients to not add their own decorations
|
||||
|
||||
hotkey-overlay {
|
||||
skip-at-startup
|
||||
}
|
||||
|
||||
//
|
||||
// OUTPUTS
|
||||
//
|
||||
output "eDP-1"{
|
||||
scale 1.0
|
||||
variable-refresh-rate
|
||||
transform "normal"
|
||||
}
|
||||
|
||||
workspace "net"
|
||||
workspace "term"
|
||||
workspace "scratch"
|
||||
|
||||
//
|
||||
// INPUTS
|
||||
//
|
||||
input {
|
||||
keyboard {
|
||||
xkb {
|
||||
@ -45,21 +73,19 @@ input {
|
||||
}
|
||||
|
||||
disable-power-key-handling
|
||||
warp-mouse-to-focus mode="center-xy"
|
||||
focus-follows-mouse
|
||||
}
|
||||
|
||||
output "eDP-1" {
|
||||
scale 1.0
|
||||
transform "normal"
|
||||
position x=0 y=0
|
||||
}
|
||||
|
||||
//
|
||||
// LAYOUT
|
||||
//
|
||||
layout {
|
||||
gaps 16
|
||||
|
||||
center-focused-column "never"
|
||||
gaps 2
|
||||
|
||||
center-focused-column "on-overflow"
|
||||
always-center-single-column
|
||||
default-column-display "tabbed"
|
||||
default-column-display "normal"
|
||||
|
||||
tab-indicator {
|
||||
hide-when-single-tab
|
||||
@ -70,74 +96,132 @@ layout {
|
||||
proportion 0.5
|
||||
proportion 0.66667
|
||||
}
|
||||
|
||||
|
||||
default-column-width {
|
||||
proportion 0.5;
|
||||
}
|
||||
|
||||
|
||||
focus-ring {
|
||||
width 4
|
||||
active-color "#8aadf4"
|
||||
inactive-color "#494d64"
|
||||
width 0
|
||||
}
|
||||
|
||||
|
||||
border {
|
||||
width 2
|
||||
active-color "#8aadf4"
|
||||
inactive-color "#494d64"
|
||||
active-gradient from="#eaa4a8" to="#cbeaa6" angle=45 in="oklch longer hue" relative-to="workspace-view"
|
||||
inactive-gradient from="#886D59" to="#517B65" angle=45 in="oklch longer hue" relative-to="workspace-view"
|
||||
}
|
||||
|
||||
shadow {
|
||||
softness 30
|
||||
spread 5
|
||||
offset x=0 y=5
|
||||
offset x=8 y=8
|
||||
draw-behind-window true
|
||||
color "#00000070"
|
||||
color "#00444444"
|
||||
}
|
||||
|
||||
|
||||
struts {
|
||||
left 64
|
||||
right 64
|
||||
top 64
|
||||
bottom 64
|
||||
left 10
|
||||
right 10
|
||||
top 10
|
||||
bottom 10
|
||||
}
|
||||
}
|
||||
|
||||
prefer-no-csd
|
||||
|
||||
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
|
||||
//
|
||||
// WINDOW RULES
|
||||
//
|
||||
|
||||
hotkey-overlay {
|
||||
skip-at-startup
|
||||
// All windows - corner radius, opacity
|
||||
window-rule {
|
||||
geometry-corner-radius 14 14 0 14
|
||||
clip-to-geometry true
|
||||
}
|
||||
|
||||
environment {
|
||||
QT_QPA_PLATFORM "wayland"
|
||||
DISPLAY ":0"
|
||||
window-rule {
|
||||
match is-active=true
|
||||
opacity 0.99
|
||||
}
|
||||
|
||||
window-rule {
|
||||
match is-floating=true
|
||||
opacity 0.92
|
||||
}
|
||||
|
||||
// Term windows
|
||||
window-rule {
|
||||
match app-id="com.mitchellh.ghostty"
|
||||
|
||||
default-column-width { proportion 0.5; }
|
||||
open-on-workspace "term"
|
||||
}
|
||||
|
||||
// Net windows
|
||||
window-rule {
|
||||
match app-id="firefox"
|
||||
default-column-width { proportion 0.75; }
|
||||
|
||||
default-column-width { proportion 1.0; }
|
||||
open-on-workspace "net"
|
||||
}
|
||||
|
||||
// Scratch windows (exclude unlock dialog so it can open on net)
|
||||
window-rule {
|
||||
match at-startup=true app-id="org.keepassxc.KeePassXC"
|
||||
open-on-workspace "9"
|
||||
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
|
||||
match app-id=r#"^org\.signal\.Signal$"#
|
||||
exclude app-id=r#"^org\.keepassxc\.KeePassXC$"# title="^Unlock Database - KeePassXC$"
|
||||
|
||||
block-out-from "screencast"
|
||||
open-on-workspace "scratch"
|
||||
}
|
||||
|
||||
spawn-at-startup "waybar"
|
||||
spawn-at-startup "swaybg" "-i" "/home/nate/.config/niri/bg.png"
|
||||
spawn-at-startup "nm-applet" "--indicator"
|
||||
spawn-at-startup "swaync"
|
||||
spawn-at-startup "keepassxc"
|
||||
spawn-at-startup "sh" "-c" "sleep 5 && syncthingtray --wait"
|
||||
spawn-at-startup "flatpak" "run" "org.signal.Signal"
|
||||
// Keepass unlock dialog on Net workspace
|
||||
window-rule {
|
||||
match app-id=r#"^org\.keepassxc\.KeePassXC$"# title="^Unlock Database - KeePassXC$"
|
||||
|
||||
open-floating true
|
||||
open-focused true
|
||||
open-on-workspace "net"
|
||||
}
|
||||
|
||||
// File browser
|
||||
window-rule {
|
||||
match app-id="org.gnome.Nautilus"
|
||||
|
||||
open-floating true
|
||||
}
|
||||
|
||||
// Bright border on screen-shared windows
|
||||
window-rule {
|
||||
match is-window-cast-target=true
|
||||
|
||||
focus-ring {
|
||||
active-color "#f38ba8"
|
||||
inactive-color "#7d0d2d"
|
||||
}
|
||||
|
||||
border {
|
||||
inactive-color "#7d0d2d"
|
||||
}
|
||||
|
||||
shadow {
|
||||
color "#7d0d2d70"
|
||||
}
|
||||
|
||||
tab-indicator {
|
||||
active-color "#f38ba8"
|
||||
inactive-color "#7d0d2d"
|
||||
}
|
||||
}
|
||||
|
||||
// Block out notifications from screencasts.
|
||||
layer-rule {
|
||||
match namespace="^notifications$"
|
||||
|
||||
block-out-from "screencast"
|
||||
}
|
||||
|
||||
//
|
||||
// BINDS
|
||||
//
|
||||
|
||||
binds {
|
||||
Mod+Shift+Slash { show-hotkey-overlay; }
|
||||
@ -218,20 +302,21 @@ binds {
|
||||
|
||||
Mod+Shift+Page_Down { move-workspace-down; }
|
||||
Mod+Shift+Page_Up { move-workspace-up; }
|
||||
|
||||
Mod+1 { focus-workspace 1; }
|
||||
Mod+2 { focus-workspace 2; }
|
||||
Mod+3 { focus-workspace 3; }
|
||||
|
||||
Mod+Minus { focus-workspace "scratch"; }
|
||||
Mod+1 { focus-workspace "term"; }
|
||||
Mod+2 { focus-workspace "net"; }
|
||||
Mod+3 { focus-workspace "chat"; }
|
||||
Mod+4 { focus-workspace 4; }
|
||||
Mod+5 { focus-workspace 5; }
|
||||
Mod+6 { focus-workspace 6; }
|
||||
Mod+7 { focus-workspace 7; }
|
||||
Mod+8 { focus-workspace 8; }
|
||||
Mod+9 { focus-workspace 9; }
|
||||
Mod+Minus { focus-workspace "scratch"; }
|
||||
Mod+Shift+1 { move-column-to-workspace 1; }
|
||||
Mod+Shift+2 { move-column-to-workspace 2; }
|
||||
Mod+Shift+3 { move-column-to-workspace 3; }
|
||||
Mod+Shift+Minus { move-column-to-workspace "scratch"; }
|
||||
Mod+Shift+1 { move-column-to-workspace "term"; }
|
||||
Mod+Shift+2 { move-column-to-workspace "net"; }
|
||||
Mod+Shift+3 { move-column-to-workspace "chat"; }
|
||||
Mod+Shift+4 { move-column-to-workspace 4; }
|
||||
Mod+Shift+5 { move-column-to-workspace 5; }
|
||||
Mod+Shift+6 { move-column-to-workspace 6; }
|
||||
@ -247,10 +332,11 @@ binds {
|
||||
// Fullscreen - consistent with sway/hyprland
|
||||
Mod+F { fullscreen-window; }
|
||||
Mod+Shift+F { maximize-column; }
|
||||
|
||||
// Floating toggle - consistent with sway/hyprland (niri doesn't have floating, using maximize instead)
|
||||
Mod+Space { maximize-column; }
|
||||
|
||||
|
||||
// Floating toggle
|
||||
Mod+Space { toggle-window-floating; }
|
||||
Mod+Shift+Space { switch-focus-between-floating-and-tiling; }
|
||||
|
||||
Mod+C { center-column; }
|
||||
|
||||
Mod+bracketleft { set-column-width "-10%"; }
|
||||
@ -258,8 +344,15 @@ binds {
|
||||
|
||||
Mod+Shift+bracketleft { set-window-height "-10%"; }
|
||||
Mod+Shift+bracketright { set-window-height "+10%"; }
|
||||
|
||||
// Screenshots - consistent with sway/hyprland
|
||||
|
||||
//
|
||||
// Utilities
|
||||
//
|
||||
|
||||
// Notifications
|
||||
Mod+Shift+C { spawn-sh "swaync-client --toggle-panel"; }
|
||||
|
||||
// Screenshots - consistent with sway/hyprland
|
||||
Mod+P { screenshot; }
|
||||
Mod+Shift+P { screenshot-screen; }
|
||||
|
||||
@ -268,11 +361,14 @@ binds {
|
||||
Ctrl+Print { screenshot-screen; }
|
||||
Alt+Print { screenshot-window; }
|
||||
|
||||
// Volume control
|
||||
XF86AudioRaiseVolume { spawn "pactl" "set-sink-volume" "@DEFAULT_SINK@" "+5%"; }
|
||||
XF86AudioLowerVolume { spawn "pactl" "set-sink-volume" "@DEFAULT_SINK@" "-5%"; }
|
||||
XF86AudioMute { spawn "pactl" "set-sink-mute" "@DEFAULT_SINK@" "toggle"; }
|
||||
XF86AudioMicMute { spawn "pactl" "set-source-mute" "@DEFAULT_SOURCE@" "toggle"; }
|
||||
// Volume control (via swayosd)
|
||||
XF86AudioRaiseVolume allow-when-locked=true { spawn "swayosd-client" "--output-volume" "raise"; }
|
||||
XF86AudioLowerVolume allow-when-locked=true { spawn "swayosd-client" "--output-volume" "lower"; }
|
||||
XF86AudioMute allow-when-locked=true { spawn "swayosd-client" "--output-volume" "mute-toggle"; }
|
||||
XF86AudioMicMute allow-when-locked=true { spawn "swayosd-client" "--input-volume" "mute-toggle"; }
|
||||
|
||||
// Caps Lock indicator (via swayosd)
|
||||
Caps_Lock { spawn "swayosd-client" "--caps-lock"; }
|
||||
|
||||
// Media control
|
||||
XF86AudioPlay { spawn "playerctl" "play-pause"; }
|
||||
@ -281,9 +377,15 @@ binds {
|
||||
XF86AudioPrev { spawn "playerctl" "previous"; }
|
||||
XF86AudioStop { spawn "playerctl" "stop"; }
|
||||
|
||||
// Brightness control
|
||||
XF86MonBrightnessUp { spawn "brightnessctl" "set" "+5%"; }
|
||||
XF86MonBrightnessDown { spawn "brightnessctl" "set" "5%-"; }
|
||||
// Brightness control (via swayosd)
|
||||
XF86MonBrightnessUp { spawn "swayosd-client" "--brightness" "raise"; }
|
||||
XF86MonBrightnessDown { spawn "swayosd-client" "--brightness" "lower"; }
|
||||
|
||||
// Screen rotation
|
||||
Mod+Alt+Up { spawn "niri" "msg" "output" "eDP-1" "transform" "normal"; }
|
||||
Mod+Alt+Right { spawn "niri" "msg" "output" "eDP-1" "transform" "90"; }
|
||||
Mod+Alt+Down { spawn "niri" "msg" "output" "eDP-1" "transform" "180"; }
|
||||
Mod+Alt+Left { spawn "niri" "msg" "output" "eDP-1" "transform" "270"; }
|
||||
|
||||
Mod+Shift+Q { quit; }
|
||||
Mod+Shift+Ctrl+P { power-off-monitors; }
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// Global
|
||||
// Global
|
||||
{
|
||||
"layer": "bottom",
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
"margin-top": 3,
|
||||
"margin-left": 3,
|
||||
|
||||
@ -8,50 +8,32 @@
|
||||
{
|
||||
imports = [
|
||||
../../../shared/modules/apps/firefox/firefox.nix
|
||||
../niri/niri_home.nix
|
||||
];
|
||||
|
||||
|
||||
home.username = userName;
|
||||
home.homeDirectory = "/home/${userName}";
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
home.stateVersion = "25.05"; # Please read the comment before changing.
|
||||
|
||||
# The home.packages option allows you to install Nix packages into your
|
||||
# environment.
|
||||
firefoxApp.enable = true;
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
# Niri configuration will go in dotfiles
|
||||
# Optional, hint Electron apps to use Wayland:
|
||||
home.packages = with pkgs; [
|
||||
### ---
|
||||
### niri packages
|
||||
swaybg
|
||||
swaylock-effects
|
||||
wofi
|
||||
wl-clipboard # System clipboard
|
||||
waybar
|
||||
networkmanagerapplet
|
||||
libnotify
|
||||
swaynotificationcenter
|
||||
syncthingtray
|
||||
lynx
|
||||
qutebrowser
|
||||
brightnessctl
|
||||
### ---
|
||||
# Enable niri home configuration
|
||||
nirihome = {
|
||||
enable = true;
|
||||
homePackages = [ ];
|
||||
};
|
||||
|
||||
chromium
|
||||
# Additional user packages
|
||||
home.packages = with pkgs; [
|
||||
#
|
||||
# Dev Tools
|
||||
#
|
||||
helix
|
||||
ghostty
|
||||
docker
|
||||
docker-compose
|
||||
jq
|
||||
python310
|
||||
python3
|
||||
unstable.claude-code
|
||||
unstable.opencode
|
||||
nodejs_24
|
||||
@ -60,22 +42,16 @@
|
||||
nodePackages_latest.bash-language-server
|
||||
openscad-lsp
|
||||
vscode-langservers-extracted # provides eslint, markdown, json, css, and html lsp
|
||||
# python311Packages.python-lsp-server
|
||||
python313Packages.python-lsp-server
|
||||
### Misc
|
||||
usbutils
|
||||
openscad
|
||||
|
||||
#
|
||||
# Gaming
|
||||
#
|
||||
webcord
|
||||
|
||||
#
|
||||
# Unix tools
|
||||
#
|
||||
bat
|
||||
duf
|
||||
du-dust
|
||||
dust
|
||||
fd
|
||||
fzf
|
||||
lsd
|
||||
@ -85,7 +61,6 @@
|
||||
htop
|
||||
neofetch
|
||||
unzip
|
||||
llpp
|
||||
nmap
|
||||
gnupg
|
||||
pinentry-tty
|
||||
@ -95,18 +70,9 @@
|
||||
#
|
||||
imv
|
||||
mpv
|
||||
gimp
|
||||
ffmpeg
|
||||
tenacity
|
||||
yt-dlp
|
||||
|
||||
#
|
||||
# Communication
|
||||
#
|
||||
mumble
|
||||
slack
|
||||
unstable.signal-desktop
|
||||
|
||||
#
|
||||
# Other
|
||||
#
|
||||
@ -189,9 +155,9 @@
|
||||
# Git setup
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userEmail = email;
|
||||
userName = fullName;
|
||||
extraConfig = {
|
||||
settings = {
|
||||
user.name = fullName;
|
||||
user.email = email;
|
||||
include = { path = "${config.xdg.configHome}/macchiato.gitconfig"; };
|
||||
init = { defaultBranch = "main"; };
|
||||
pull = { ff = "only"; };
|
||||
@ -199,7 +165,6 @@
|
||||
push = { autoSetupRemote="true"; };
|
||||
delta = { features = "Catppuccin Macchiato"; };
|
||||
};
|
||||
delta.enable = true;
|
||||
};
|
||||
|
||||
programs = {
|
||||
@ -210,6 +175,10 @@
|
||||
};
|
||||
|
||||
bash.enable = true; # see note on other shells below
|
||||
delta = {
|
||||
enable = true;
|
||||
enableGitIntegration = true;
|
||||
};
|
||||
};
|
||||
|
||||
# enable saving ssh secrets (needed for go mod installing private packages)
|
||||
@ -221,10 +190,13 @@
|
||||
enable = true;
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [ "git" "ssh-agent" ];
|
||||
plugins = [ "git" ];
|
||||
theme = "half-life";
|
||||
};
|
||||
initContent = ''
|
||||
# integrate ssh-agent from gnome keyring
|
||||
export SSH_AUTH_SOCK=/run/user/$UID/gcr/ssh
|
||||
|
||||
eval "$(direnv hook zsh)"
|
||||
|
||||
yt-audio() {
|
||||
@ -287,4 +259,10 @@
|
||||
|
||||
# Enable bluetooth headphone controls
|
||||
services.mpris-proxy.enable = true;
|
||||
|
||||
# SwayOSD - on-screen display for volume, brightness, caps lock
|
||||
services.swayosd = {
|
||||
enable = true;
|
||||
topMargin = 0.9;
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,142 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.niri-auto-rotation;
|
||||
|
||||
rotationScript = pkgs.writeScriptBin "niri-auto-rotate" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
NIRI_CONFIG="$HOME/nixos/frame12/linked-dotfiles/niri/config.kdl"
|
||||
MONITOR="eDP-1"
|
||||
|
||||
# Find the accelerometer device (cros-ec-accel)
|
||||
ACCEL_DEVICE=""
|
||||
for device in /sys/bus/iio/devices/iio:device*; do
|
||||
if [ -f "$device/name" ] && ${pkgs.gnugrep}/bin/grep -q "cros-ec-accel" "$device/name"; then
|
||||
ACCEL_DEVICE="$device"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$ACCEL_DEVICE" ]; then
|
||||
echo "No accelerometer found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Using accelerometer: $ACCEL_DEVICE"
|
||||
|
||||
LAST_ORIENTATION=""
|
||||
|
||||
while true; do
|
||||
# Read accelerometer values
|
||||
if [ -f "$ACCEL_DEVICE/in_accel_x_raw" ]; then
|
||||
X=$(${pkgs.coreutils}/bin/cat "$ACCEL_DEVICE/in_accel_x_raw")
|
||||
Y=$(${pkgs.coreutils}/bin/cat "$ACCEL_DEVICE/in_accel_y_raw")
|
||||
Z=$(${pkgs.coreutils}/bin/cat "$ACCEL_DEVICE/in_accel_z_raw")
|
||||
|
||||
# Determine orientation based on accelerometer values
|
||||
# Assuming standard orientation when lid/base orientation
|
||||
ABS_X=''${X#-}
|
||||
ABS_Y=''${Y#-}
|
||||
ABS_Z=''${Z#-}
|
||||
|
||||
ORIENTATION="normal"
|
||||
|
||||
# Simple orientation detection based on which axis has highest absolute value
|
||||
if [ "$ABS_Z" -gt 16000 ]; then
|
||||
# Device is flat
|
||||
if [ "$Z" -lt 0 ]; then
|
||||
ORIENTATION="normal"
|
||||
else
|
||||
ORIENTATION="bottom-up"
|
||||
fi
|
||||
elif [ "$ABS_Y" -gt "$ABS_X" ] && [ "$ABS_Y" -gt 9000 ]; then
|
||||
# Y axis dominant
|
||||
if [ "$Y" -gt 0 ]; then
|
||||
ORIENTATION="normal"
|
||||
else
|
||||
ORIENTATION="bottom-up"
|
||||
fi
|
||||
elif [ "$ABS_X" -gt 9000 ]; then
|
||||
# X axis dominant
|
||||
if [ "$X" -gt 0 ]; then
|
||||
ORIENTATION="right-up"
|
||||
else
|
||||
ORIENTATION="left-up"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Only update if orientation changed
|
||||
if [ "$ORIENTATION" != "$LAST_ORIENTATION" ]; then
|
||||
echo "Orientation changed: $LAST_ORIENTATION -> $ORIENTATION (X=$X, Y=$Y, Z=$Z)"
|
||||
LAST_ORIENTATION="$ORIENTATION"
|
||||
|
||||
case "$ORIENTATION" in
|
||||
"normal")
|
||||
${pkgs.gnused}/bin/sed -i 's/transform ".*"/transform "normal"/' "$NIRI_CONFIG"
|
||||
;;
|
||||
"left-up")
|
||||
${pkgs.gnused}/bin/sed -i 's/transform ".*"/transform "90"/' "$NIRI_CONFIG"
|
||||
;;
|
||||
"right-up")
|
||||
${pkgs.gnused}/bin/sed -i 's/transform ".*"/transform "270"/' "$NIRI_CONFIG"
|
||||
;;
|
||||
"bottom-up")
|
||||
${pkgs.gnused}/bin/sed -i 's/transform ".*"/transform "180"/' "$NIRI_CONFIG"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
${pkgs.coreutils}/bin/sleep 0.5
|
||||
done
|
||||
'';
|
||||
|
||||
in
|
||||
{
|
||||
options.niri-auto-rotation = {
|
||||
enable = lib.mkEnableOption "Enable automatic screen rotation for Niri using accelerometer";
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "User to run the auto-rotation service for";
|
||||
};
|
||||
|
||||
monitor = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "eDP-1";
|
||||
description = "Monitor name to rotate";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Enable IIO sensor support
|
||||
hardware.sensor.iio.enable = true;
|
||||
|
||||
# Add custom udev rule for Framework 12 accelerometer
|
||||
services.udev.extraRules = ''
|
||||
# Framework 12 accelerometer fix - ensure cros-ec-accel is recognized
|
||||
SUBSYSTEM=="iio", KERNEL=="iio:device*", ATTR{name}=="cros-ec-accel", ENV{IIO_SENSOR_PROXY_TYPE}="accel"
|
||||
'';
|
||||
|
||||
# Install required packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
iio-sensor-proxy
|
||||
rotationScript
|
||||
];
|
||||
|
||||
# Create systemd user service for the rotation daemon
|
||||
systemd.user.services.niri-auto-rotate = {
|
||||
description = "Niri automatic screen rotation";
|
||||
after = [ "graphical-session.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${rotationScript}/bin/niri-auto-rotate";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -52,40 +52,49 @@
|
||||
environment.systemPackages = with pkgs; lib.lists.flatten [
|
||||
[
|
||||
bash
|
||||
ghostty
|
||||
egl-wayland
|
||||
foot
|
||||
git
|
||||
glib # gsettings
|
||||
grim
|
||||
kanshi
|
||||
libnotify
|
||||
lxqt.lxqt-policykit
|
||||
man-pages
|
||||
man-pages-posix
|
||||
nautilus
|
||||
networkmanagerapplet
|
||||
pavucontrol
|
||||
slurp
|
||||
syncthingtray
|
||||
swaylock
|
||||
wl-clipboard
|
||||
swayosd
|
||||
syncthingtray
|
||||
unstable.ghostty
|
||||
unstable.xwayland-satellite
|
||||
waybar
|
||||
wdisplays
|
||||
wl-clipboard
|
||||
wofi
|
||||
xdg-utils
|
||||
zsh
|
||||
lxqt.lxqt-policykit
|
||||
unstable.xwayland-satellite
|
||||
# Fonts
|
||||
]
|
||||
config.niriwm.systemPackages
|
||||
];
|
||||
environment.variables.QT_STYLE_OVERRIDE = "kvantum";
|
||||
environment.sessionVariables = {
|
||||
# use wayland
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
T_QPA_PLATFORM = "wayland";
|
||||
GDK_BACKEND = "wayland";
|
||||
WLR_NO_HARDWARE_CURSORS = "1";
|
||||
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
|
||||
# adds additional man pages
|
||||
documentation.dev.enable = true;
|
||||
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
gamescopeSession.enable = true;
|
||||
};
|
||||
programs.gamemode = {
|
||||
enable = true;
|
||||
settings = {
|
||||
@ -97,7 +106,11 @@
|
||||
};
|
||||
};
|
||||
programs.kdeconnect.enable = true;
|
||||
# programs.kdeconnect.package = pkgs.gnomeExtensions.gsconnect;
|
||||
programs.niri.enable = true;
|
||||
programs.regreet.enable = true;
|
||||
programs.xfconf.enable = true;
|
||||
programs.zsh.enable = true;
|
||||
programs.ssh.startAgent = false; # Using GNOME Keyring's gcr-ssh-agent instead
|
||||
|
||||
# For nautilus
|
||||
services.gnome.sushi.enable = true;
|
||||
@ -105,7 +118,6 @@
|
||||
enable = true;
|
||||
terminal = "ghostty";
|
||||
};
|
||||
programs.xfconf.enable = true;
|
||||
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
@ -115,8 +127,6 @@
|
||||
};
|
||||
systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder
|
||||
|
||||
programs.zsh.enable = true;
|
||||
|
||||
# Set zsh as the default shell system-wide
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
environment.shells = with pkgs; [ zsh bash ];
|
||||
@ -124,18 +134,27 @@
|
||||
###
|
||||
## Services
|
||||
###
|
||||
virtualisation.docker.enable = true;
|
||||
services.blueman.enable = true;
|
||||
services.gvfs.enable = true; # thunar mount, trash, etc
|
||||
services.gvfs.enable = true; # file manager mount, trash, etc
|
||||
services.tumbler.enable = true; # thunar thumbnails
|
||||
services.openssh.enable = true;
|
||||
services.dbus.enable = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
services.flatpak.enable = true;
|
||||
services.usbmuxd.enable = false;
|
||||
|
||||
# For yubioath desktop
|
||||
services.pcscd.enable = true;
|
||||
|
||||
# Printing
|
||||
services.printing = {
|
||||
enable = true;
|
||||
browsing = true;
|
||||
drivers = [ pkgs.brlaser ];
|
||||
};
|
||||
|
||||
# Audio - Modern PipeWire setup for Framework laptop
|
||||
# Disable PulseAudio in favor of PipeWire
|
||||
services.flatpak.enable = true;
|
||||
services.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
@ -167,15 +186,43 @@
|
||||
# Necessary for home-manager niri setup
|
||||
security.polkit.enable = true;
|
||||
|
||||
# Keyring setup
|
||||
security.pam.services.greetd.enableGnomeKeyring = true;
|
||||
security.pam.services.login.enableGnomeKeyring = true;
|
||||
|
||||
hardware.bluetooth = {
|
||||
enable = true; # enables support for Bluetooth
|
||||
enable = true;
|
||||
powerOnBoot = true; # powers up the default Bluetooth controller on boot
|
||||
settings = {
|
||||
settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
Experimental = true;
|
||||
Name = "Nate-Frame";
|
||||
ControllerMode = "dual";
|
||||
FastConnectable = "true";
|
||||
Experimental = "true";
|
||||
};
|
||||
Policy = { AutoEnable = "true"; };
|
||||
LE = { EnableAdvMonInterleaveScan = 1; };
|
||||
};
|
||||
};
|
||||
|
||||
#
|
||||
# Hardware scanning support
|
||||
#
|
||||
hardware.sane = {
|
||||
enable = true;
|
||||
brscan5.enable = true;
|
||||
};
|
||||
|
||||
#
|
||||
# udev rules
|
||||
#
|
||||
services.udev.extraRules = ''
|
||||
# For betaflight configurator
|
||||
# DFU (Internal bootloader for STM32 and AT32 MCUs)
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
|
||||
# For ddcutil monitor controls
|
||||
KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
64
frame12/modules/niri/niri_home.nix
Normal file
64
frame12/modules/niri/niri_home.nix
Normal file
@ -0,0 +1,64 @@
|
||||
{ inputs, lib, config, pkgs, ... }:
|
||||
{
|
||||
options.nirihome = {
|
||||
enable = lib.mkEnableOption "Enable niri home config";
|
||||
homePackages = lib.mkOption {
|
||||
default = [];
|
||||
description = "Add any additional packages desired. Merged with niri defaults.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.nirihome.enable {
|
||||
# Note: We don't use wayland.windowManager.niri in home-manager
|
||||
# because we manage the niri config through dotfiles.
|
||||
# The system-level module enables niri via programs.niri.enable
|
||||
|
||||
# Import systemd variables for niri
|
||||
systemd.user.sessionVariables = {
|
||||
WAYLAND_DISPLAY = "wayland-1";
|
||||
XDG_CURRENT_DESKTOP = "niri";
|
||||
};
|
||||
|
||||
home.pointerCursor = {
|
||||
gtk.enable = true;
|
||||
x11.enable = true;
|
||||
name = "Bibata-Modern-Classic";
|
||||
package = pkgs.bibata-cursors;
|
||||
size = 32;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; lib.lists.flatten [
|
||||
[
|
||||
### niri packages
|
||||
swaybg
|
||||
swaylock-effects
|
||||
waybar
|
||||
wofi
|
||||
# Etc
|
||||
gopsuinfo # For system stats in panel
|
||||
wl-clipboard # System clipboard
|
||||
brightnessctl
|
||||
wev
|
||||
wdisplays
|
||||
# Notifs
|
||||
libnotify
|
||||
swaynotificationcenter
|
||||
# Tray Applets
|
||||
networkmanagerapplet
|
||||
pavucontrol
|
||||
syncthingtray
|
||||
tailscale-systray
|
||||
# include portals here for flatpak
|
||||
xdg-desktop-portal-gnome
|
||||
xdg-desktop-portal-gtk
|
||||
]
|
||||
config.nirihome.homePackages
|
||||
];
|
||||
programs.cava = {
|
||||
enable = true;
|
||||
settings = {
|
||||
smoothing.noise_reduction = 55;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -68,6 +68,8 @@ input {
|
||||
accel-profile "adaptive"
|
||||
}
|
||||
|
||||
warp-mouse-to-focus mode="center-xy"
|
||||
focus-follows-mouse
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Loading…
Reference in New Issue
Block a user