This commit is contained in:
Lucy von Overheidt 2025-09-09 18:03:42 +02:00
commit 0df1237eb2
19 changed files with 1921 additions and 0 deletions

49
modules/alacritty.nix Normal file
View file

@ -0,0 +1,49 @@
{ ... }: {
programs.alacritty.enable = true;
programs.alacritty.settings = {
window.opacity = 0.8;
colors.bright = {
black = "#444b6a";
blue = "#7da6ff";
cyan = "#0db9d7";
green = "#b9f27c";
magenta = "#bb9af7";
red = "#ff7a93";
white = "#acb0d0";
yellow = "#ff9e64";
};
colors.normal = {
black = "#32344a";
blue = "#7aa2f7";
cyan = "#449dab";
green = "#9ece6a";
magenta = "#ad8ee6";
red = "#f7768e";
white = "#787c99";
yellow = "#e0af68";
};
colors.primary = {
background = "#1a1b26";
foreground = "#a9b1d6";
};
font = {
normal = {
family = "Iosevka";
style = "Regular";
};
bold = {
family = "Iosevka";
style = "Bold";
};
italic = {
family = "Iosevka";
style = "Italic";
};
bold_italic = {
family = "Iosevka";
style = "Bold Italic";
};
size = 18.0; # Adjust the font size as needed
};
};
}

7
modules/fonts.nix Normal file
View file

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
fonts.packages = with pkgs; [
iosevka
comic-mono
];
}

27
modules/gammastep.nix Normal file
View file

@ -0,0 +1,27 @@
{ pkgs, ... }:
{
services.gammastep = {
enable = true;
package = pkgs.gammastep.override {
withRandr = false;
withDrm = false;
withVidmode = false;
withAppIndicator = false;
};
latitude = "-34.58";
longitude = "-58.64";
provider = "manual";
temperature = {
day = 5500;
night = 3500;
};
settings = {
general = {
brightness-day = 1.0;
brightness-night = 0.5;
adjustment-method = "wayland";
};
};
};
}

30
modules/helix.nix Normal file
View file

@ -0,0 +1,30 @@
{ lib, pkgs, ... }: {
programs.helix = {
enable = true;
settings = {
theme = "autumn_night_transparent";
editor.cursor-shape = {
normal = "block";
insert = "bar";
select = "underline";
};
};
languages = {
language = [{
name = "nix";
auto-format = true;
formatter.command = "${pkgs.nixfmt}/bin/nixfmt";
language-servers = [ "nixd" ];
}];
language-server.nixd = { command = lib.getExe pkgs.nixd; };
};
themes = {
autumn_night_transparent = {
"inherits" = "autumn_night";
"ui.background" = { };
};
};
extraPackages = with pkgs; [ nil rust-analyzer gopls ];
};
}

164
modules/home.nix Normal file
View file

@ -0,0 +1,164 @@
{
config,
pkgs,
inputs,
...
}:
{
imports = [
./helix.nix
./alacritty.nix
./nushell.nix
./waybar.nix
./niri
./quickshell.nix
./gammastep.nix
./hypridle.nix
];
# TODO please change the username & home directory to your own
home.username = "lucy";
home.homeDirectory = "/home/${config.home.username}";
# link the configuration file in current directory to the specified location in home directory
# home.file.".config/i3/wallpaper.jpg".source = ./wallpaper.jpg;
# link all files in `./scripts` to `~/.config/i3/scripts`
# home.file.".config/i3/scripts" = {
# source = ./scripts;
# recursive = true; # link recursively
# executable = true; # make all files executable
# };
# encode the file content in nix configuration file directly
# home.file.".xxx".text = ''
# xxx
# '';
manual = {
html.enable = false;
json.enable = false;
manpages.enable = false;
};
programs.nix-index = {
enable = true;
};
/*
stylix = {
enable = true;
polarity = "dark";
opacity = {
popups = 1.0;
terminal = 1.0;
};
fonts = {
serif = config.stylix.fonts.sansSerif;
sansSerif = {
package = pkgs.adwaita-fonts;
name = "Adwaita Sans";
};
monospace = {
package = pkgs.nerd-fonts.geist-mono;
name = "Geist Nerd Font Mono";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
};
};
*/
# set cursor size and dpi for 4k monitor
# Packages that should be installed to the user profile.
home.packages = with pkgs; [
# here is some command line tools I use frequently
# feel free to add your own or remove some of them
aerc
hyfetch
nnn # terminal file manager
prismlauncher
# archives
zip
xz
unzip
p7zip
# utils
ripgrep # recursively searches directories for a regex pattern
jq # A lightweight and flexible command-line JSON processor
yq-go # yaml processor https://github.com/mikefarah/yq
eza # A modern replacement for ls
fzf # A command-line fuzzy finder
# networking tools
mtr # A network diagnostic tool
iperf3
dnsutils # `dig` + `nslookup`
ldns # replacement of `dig`, it provide the command `drill`
aria2 # A lightweight multi-protocol & multi-source command-line download utility
socat # replacement of openbsd-netcat
nmap # A utility for network discovery and security auditing
ipcalc # it is a calculator for the IPv4/v6 addresses
# misc
cowsay
file
which
tree
gnused
gnutar
gawk
zstd
gnupg
# nix related
#
# it provides the command `nom` works just like `nix`
# with more details log output
nix-output-monitor
# productivity
hugo # static site generator
glow # markdown previewer in terminal
btop # replacement of htop/nmon
iotop # io monitoring
iftop # network monitoring
# system call monitoring
strace # system call monitoring
ltrace # library call monitoring
lsof # list open files
# system tools
sysstat
lm_sensors # for `sensors` command
ethtool
pciutils # lspci
usbutils # lsusb
tcsh
fuzzel
seatd
jaq
];
# basic configuration of git, please change to your own
programs.git = {
enable = true;
userName = "Lucy von Overheidt";
userEmail = "git@lucy.giving";
};
home.stateVersion = "24.11";
programs.home-manager.enable = true;
}

44
modules/hypridle.nix Normal file
View file

@ -0,0 +1,44 @@
{
pkgs,
lib,
config,
...
}:
let
lock = "${pkgs.systemd}/bin/loginctl lock-session";
brillo = lib.getExe pkgs.brillo;
# timeout after which DPMS kicks in
timeout = 300;
in
{
# screen idle
services.hypridle = {
enable = true;
settings = {
general.lock_cmd = lib.getExe config.programs.hyprlock.package;
listener = [
{
timeout = timeout - 10;
# save the current brightness and dim the screen over a period of
# 500 ms
on-timeout = "${brillo} -O; ${brillo} -u 500000 -S 10";
# brighten the screen over a period of 250ms to the saved value
on-resume = "${brillo} -I -u 250000";
}
{
inherit timeout;
}
{
timeout = timeout + 10;
on-timeout = lock;
}
];
};
};
systemd.user.services.hypridle.Unit.After = lib.mkForce "graphical-session.target";
}

144
modules/niri/binds.nix Normal file
View file

@ -0,0 +1,144 @@
{ config, pkgs, ... }:
let
lib = pkgs.lib;
qs = "${pkgs.quickshell}/bin/qs";
# Niri built-in actions
inherit (config.lib.niri.actions)
spawn
close-window
maximize-column
screenshot-window
screenshot
focus-column-left
focus-column-right
focus-workspace-up
focus-workspace-down
;
# Helper to call QuickShell
qsCall =
args:
spawn (
[
qs
"-c"
"DankMaterialShell"
"ipc"
"call"
]
++ args
);
# Generate workspace focus binds (Mod+1 to Mod+9)
wsBinds = builtins.listToAttrs (
builtins.genList (i: {
name = "Mod+${toString (i + 1)}";
value.action.focus-workspace = i + 1;
}) 9
);
in
{
programs.niri.settings.binds = lib.mkMerge [
# --- Static Keybindings ---
{
# --- Media Keys ---
# --- Audio / Brightness ---
"XF86AudioMute" = {
allow-when-locked = true;
action = qsCall [
"audio"
"mute"
];
};
"XF86AudioMicMute" = {
allow-when-locked = true;
action = qsCall [
"audio"
"micmute"
];
};
"XF86AudioRaiseVolume" = {
allow-when-locked = true;
action = qsCall [
"audio"
"increment"
"5"
];
};
"XF86AudioLowerVolume" = {
allow-when-locked = true;
action = qsCall [
"audio"
"decrement"
"5"
];
};
"XF86MonBrightnessUp" = {
allow-when-locked = true;
action = qsCall [
"brightness"
"increment"
"5"
"amdgpu_bl1"
];
};
"XF86MonBrightnessDown" = {
allow-when-locked = true;
action = qsCall [
"brightness"
"decrement"
"5"
"amdgpu_bl1"
];
};
# --- System Actions ---
"Ctrl+Alt+L".action = qsCall [
"lock"
"lock"
];
"Mod+V".action = qsCall [
"clipboard"
"toggle"
];
"Mod+U".action = qsCall [
"settings"
"toggle"
];
"Mod+M".action = qsCall [
"processlist"
"toggle"
];
# --- Screenshots ---
"Print".action.screenshot-screen = {
write-to-disk = true;
};
"Mod+Shift+Alt+S".action = screenshot-window;
"Mod+Shift+S".action.screenshot = {
show-pointer = false;
};
# --- Launchers ---
"Mod+D".action = spawn (lib.getExe pkgs.fuzzel);
"Mod+Return".action = spawn (lib.getExe pkgs.alacritty);
# --- Window / Layout ---
"Mod+W".action = close-window;
"Mod+F".action = maximize-column;
# --- Navigation ---
"Mod+Left".action = focus-column-left;
"Mod+Right".action = focus-column-right;
"Mod+Down".action = focus-workspace-down;
"Mod+Up".action = focus-workspace-up;
}
# --- Dynamic Workspace Binds ---
wsBinds
];
}

8
modules/niri/default.nix Normal file
View file

@ -0,0 +1,8 @@
{ inputs, pkgs, ... }:
{
imports = [
./settings.nix
./binds.nix
./rules.nix
];
}

249
modules/niri/rules.nix Normal file
View file

@ -0,0 +1,249 @@
_:
let
windowRules = [
{
geometry-corner-radius =
let
radius = 12.0;
in
{
bottom-left = radius;
bottom-right = radius;
top-left = radius;
top-right = radius;
};
clip-to-geometry = true;
draw-border-with-background = false;
}
{
matches = [
{ is-floating = true; }
];
shadow.enable = true;
}
{
matches = [
{
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";
};
}
{
matches = [{ app-id = "org.telegram.desktop"; }];
block-out-from = "screencast";
}
{
matches = [{ app-id = "app.drey.PaperPlane"; }];
block-out-from = "screencast";
}
{
matches = [
{ app-id = "zen"; }
{ app-id = "firefox"; }
{ app-id = "chromium-browser"; }
{ app-id = "xdg-desktop-portal-gtk"; }
];
scroll-factor = 0.5;
}
{
matches = [
{ app-id = "zen"; }
{ app-id = "firefox"; }
{ app-id = "chromium-browser"; }
{ app-id = "edge"; }
];
open-maximized = true;
}
{
matches = [
{
app-id = "firefox";
title = "Picture-in-Picture";
}
];
open-floating = true;
default-floating-position = {
x = 32;
y = 32;
relative-to = "bottom-right";
};
default-column-width = {
fixed = 480;
};
default-window-height = {
fixed = 270;
};
}
{
matches = [
{
app-id = "zen";
title = "Picture-in-Picture";
}
];
open-floating = true;
default-floating-position = {
x = 32;
y = 32;
relative-to = "bottom-right";
};
default-column-width = {
fixed = 480;
};
default-window-height = {
fixed = 270;
};
}
{
matches = [{ title = "Picture in picture"; }];
open-floating = true;
default-floating-position = {
x = 32;
y = 32;
relative-to = "bottom-right";
};
}
{
matches = [{ title = "Discord Popout"; }];
open-floating = true;
default-floating-position = {
x = 32;
y = 32;
relative-to = "bottom-right";
};
}
{
matches = [{ app-id = "pavucontrol"; }];
open-floating = true;
}
{
matches = [{ app-id = "pavucontrol-qt"; }];
open-floating = true;
}
{
matches = [{ app-id = "com.saivert.pwvucontrol"; }];
open-floating = true;
}
{
matches = [{ app-id = "io.github.fsobolev.Cavalier"; }];
open-floating = true;
}
{
matches = [{ app-id = "dialog"; }];
open-floating = true;
}
{
matches = [{ app-id = "popup"; }];
open-floating = true;
}
{
matches = [{ app-id = "task_dialog"; }];
open-floating = true;
}
{
matches = [{ app-id = "gcr-prompter"; }];
open-floating = true;
}
{
matches = [{ app-id = "file-roller"; }];
open-floating = true;
}
{
matches = [{ app-id = "org.gnome.FileRoller"; }];
open-floating = true;
}
{
matches = [{ app-id = "nm-connection-editor"; }];
open-floating = true;
}
{
matches = [{ app-id = "blueman-manager"; }];
open-floating = true;
}
{
matches = [{ app-id = "xdg-desktop-portal-gtk"; }];
open-floating = true;
}
{
matches = [{ app-id = "org.kde.polkit-kde-authentication-agent-1"; }];
open-floating = true;
}
{
matches = [{ app-id = "pinentry"; }];
open-floating = true;
}
{
matches = [{ title = "Progress"; }];
open-floating = true;
}
{
matches = [{ title = "File Operations"; }];
open-floating = true;
}
{
matches = [{ title = "Copying"; }];
open-floating = true;
}
{
matches = [{ title = "Moving"; }];
open-floating = true;
}
{
matches = [{ title = "Properties"; }];
open-floating = true;
}
{
matches = [{ title = "Downloads"; }];
open-floating = true;
}
{
matches = [{ title = "file progress"; }];
open-floating = true;
}
{
matches = [{ title = "Confirm"; }];
open-floating = true;
}
{
matches = [{ title = "Authentication Required"; }];
open-floating = true;
}
{
matches = [{ title = "Notice"; }];
open-floating = true;
}
{
matches = [{ title = "Warning"; }];
open-floating = true;
}
{
matches = [{ title = "Error"; }];
open-floating = true;
}
];
in
{
programs.niri.settings = {
window-rules = windowRules;
layer-rules = [
{
matches = [{ namespace = "^swww$"; }];
place-within-backdrop = true;
}
];
};
}

135
modules/niri/settings.nix Normal file
View file

@ -0,0 +1,135 @@
{ config
, lib
, pkgs
, ...
}:
let
makeCommand = command: {
command = [ command ];
};
qs = "${pkgs.quickshell}/bin/qs";
wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste";
in
{
programs.niri.settings = {
environment = {
CLUTTER_BACKEND = "wayland";
DISPLAY = ":0";
GDK_BACKEND = "wayland,x11";
MOZ_ENABLE_WAYLAND = "1";
NIXOS_OZONE_WL = "1";
QT_QPA_PLATFORM = "wayland;xcb";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
SDL_VIDEODRIVER = "wayland";
};
spawn-at-startup = [
(makeCommand "${lib.getExe pkgs.hyprlock}")
(makeCommand "${pkgs.swww}/bin/swww-daemon")
{
command = [
"${wl-paste}"
"--watch"
"cliphist"
"store"
];
}
{
command = [
"${wl-paste}"
"--type text"
"--watch"
"cliphist"
"store"
];
}
{
command = [
"${qs}"
"-c"
"DankMaterialShell"
];
}
];
input = {
touchpad = {
click-method = "button-areas";
dwt = true;
dwtp = true;
natural-scroll = true;
scroll-method = "two-finger";
tap = true;
tap-button-map = "left-right-middle";
middle-emulation = true;
accel-profile = "adaptive";
};
focus-follows-mouse = {
enable = true;
max-scroll-amount = "90%";
};
warp-mouse-to-focus.enable = true;
workspace-auto-back-and-forth = true;
};
outputs = {
"eDP-1" = {
scale = 1.0;
position = {
x = 0;
y = 0;
};
};
};
overview = {
workspace-shadow.enable = false;
backdrop-color = "transparent";
};
gestures = {
hot-corners.enable = true;
};
layout = {
focus-ring.enable = false;
border = {
enable = true;
width = 2;
#active.color = "#${base0D}";
#inactive.color = "#${base07}";
};
shadow = {
enable = false;
};
preset-column-widths = [
{ proportion = 0.25; }
{ proportion = 0.5; }
{ proportion = 0.75; }
{ proportion = 1.0; }
];
default-column-width = {
proportion = 0.5;
};
gaps = 6;
struts = {
left = 0;
right = 0;
top = 0;
bottom = 0;
};
tab-indicator = {
hide-when-single-tab = true;
place-within-column = true;
position = "left";
corner-radius = 20.0;
gap = -12.0;
gaps-between-tabs = 10.0;
width = 4.0;
length.total-proportion = 0.1;
};
};
prefer-no-csd = true;
hotkey-overlay.skip-at-startup = true;
};
}

8
modules/nix.nix Normal file
View file

@ -0,0 +1,8 @@
{ ... }: {
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
substituters = [ "https://nix-gaming.cachix.org" ];
trusted-public-keys = [ "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" ];
};
}

113
modules/nushell.nix Normal file
View file

@ -0,0 +1,113 @@
{ lib, pkgs, ... }: {
programs = {
nushell = {
enable = true;
# The config.nu can be anywhere you want if you like to edit your Nushell with Nu
#configFile.source = ./.../config.nu;
# for editing directly to config.nu
extraConfig = ''
# Common ls aliases and sort them by type and then name
# Inspired by https://github.com/nushell/nushell/issues/7190
def lla [...args] { ls -la ...(if $args == [] {["."]} else {$args}) | sort-by type name -i }
def la [...args] { ls -a ...(if $args == [] {["."]} else {$args}) | sort-by type name -i }
def ll [...args] { ls -l ...(if $args == [] {["."]} else {$args}) | sort-by type name -i }
def l [...args] { ls ...(if $args == [] {["."]} else {$args}) | sort-by type name -i }
# Completions
# mainly pieced together from https://www.nushell.sh/cookbook/external_completers.html
# carapce completions https://www.nushell.sh/cookbook/external_completers.html#carapace-completer
# + fix https://www.nushell.sh/cookbook/external_completers.html#err-unknown-shorthand-flag-using-carapace
# enable the package and integration bellow
let carapace_completer = {|spans: list<string>|
carapace $spans.0 nushell ...$spans
| from json
| if ($in | default [] | where value == $"($spans | last)ERR" | is-empty) { $in } else { null }
}
# some completions are only available through a bridge
# eg. tailscale
# https://carapace-sh.github.io/carapace-bin/setup.html#nushell
$env.CARAPACE_BRIDGES = 'zsh,fish,bash,inshellisense'
# fish completions https://www.nushell.sh/cookbook/external_completers.html#fish-completer
let fish_completer = {|spans|
${
lib.getExe pkgs.fish
} --command $'complete "--do-complete=($spans | str join " ")"'
| $"value(char tab)description(char newline)" + $in
| from tsv --flexible --no-infer
}
# zoxide completions https://www.nushell.sh/cookbook/external_completers.html#zoxide-completer
let zoxide_completer = {|spans|
$spans | skip 1 | zoxide query -l ...$in | lines | where {|x| $x != $env.PWD}
}
# multiple completions
# the default will be carapace, but you can also switch to fish
# https://www.nushell.sh/cookbook/external_completers.html#alias-completions
let multiple_completers = {|spans|
## alias fixer start https://www.nushell.sh/cookbook/external_completers.html#alias-completions
let expanded_alias = scope aliases
| where name == $spans.0
| get -i 0.expansion
let spans = if $expanded_alias != null {
$spans
| skip 1
| prepend ($expanded_alias | split row ' ' | take 1)
} else {
$spans
}
## alias fixer end
match $spans.0 {
__zoxide_z | __zoxide_zi => $zoxide_completer
_ => $carapace_completer
} | do $in $spans
}
$env.config = {
show_banner: false,
completions: {
case_sensitive: false # case-sensitive completions
quick: true # set to false to prevent auto-selecting completions
partial: true # set to false to prevent partial filling of the prompt
algorithm: "fuzzy" # prefix or fuzzy
external: {
# set to false to prevent nushell looking into $env.PATH to find more suggestions
enable: true
# set to lower can improve completion performance at the cost of omitting some options
max_results: 100
completer: $multiple_completers
}
}
}
$env.PATH = ($env.PATH |
split row (char esep) |
prepend /home/myuser/.apps |
append /usr/bin/env
)
'';
shellAliases = {
fg = "job unfreeze";
nano = "hx";
vi = "hx";
nvim = "hx";
vim = "hx";
devenv-init = "nix flake init --template github:cachix/devenv";
devenv-enter = "nix develop --impure";
rust-init = "nix flake init --template templates#rust";
c-init = "nix flake init --template templates#c-hello";
go-hello = "nix flake init --template templates#go-hello";
haskell-hello = "nix flake init --template templates#haskell-hello";
neofetch = "hyfetch";
};
};
carapace.enable = true;
carapace.enableNushellIntegration = true;
starship = { enable = true; };
};
}

37
modules/quickshell.nix Normal file
View file

@ -0,0 +1,37 @@
{
pkgs,
inputs,
lib,
...
}:
let
quickshell = inputs.quickshell.packages.${pkgs.system}.default;
in
{
home.packages =
with pkgs;
[
quickshell
]
++ [
inputs.mynixpkgs.packages.${pkgs.system}.dgop
accountsservice
brightnessctl
cava
cliphist
ddcutil
kdePackages.qt6ct
khal
material-symbols
matugen
swww
wl-clipboard
glib
];
home.sessionVariables.QML2_IMPORT_PATH = lib.concatStringsSep ":" [
"${quickshell}/lib/qt-6/qml"
"${pkgs.kdePackages.qtdeclarative}/lib/qt-6/qml"
"${pkgs.kdePackages.kirigami.unwrapped}/lib/qt-6/qml"
];
}

4
modules/waybar.nix Normal file
View file

@ -0,0 +1,4 @@
{ ... }:
{
programs.waybar.enable = true;
}