Merge branch 'laptop'

This commit is contained in:
Emile Clark-Boman 2025-08-31 15:17:53 +10:00
commit 484a8df77b
14 changed files with 550 additions and 22 deletions

View file

@ -57,7 +57,7 @@
# i be on my puter fr
myputer = nixpkgs.lib.nixosSystem {
# nix passes these to every single module
specialArgs = {inherit inputs;};
specialArgs = {inherit inputs pkgs-unstable;};
modules = [
./hosts/myputer
@ -67,7 +67,7 @@
# my laptop 0w0
lolcathost = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
specialArgs = {inherit inputs pkgs-unstable;};
modules = [
./hosts/lolcathost

View file

@ -4,6 +4,7 @@
lib,
config,
pkgs,
pkgs-unstable,
...
}: {
imports = [
@ -15,11 +16,12 @@
../modules/btop.nix
../modules/term/ghostty.nix
../modules/term/foot.nix
# ../modules/term/rio.nix
../modules/firefox.nix
#../modules/hypr/hypridle.nix
../modules/hypr/hyprlock.nix
#../modules/wm/hypr/hypridle.nix
../modules/wm/hypr/hyprlock.nix
../modules/kanshi.nix
../modules/ags
];

View file

@ -131,6 +131,8 @@
}
{
name = "c";
file-types = ["c" "h"]; # use .hpp for C++
auto-format = false;
formatter.command = "${pkgs.clang-tools}/bin/clang-format";
language-servers = ["clangd"];
}

View file

@ -45,8 +45,19 @@
end
set -g fish_greeting (rand_greet)
'';
shellAliases = {
brip = "batgrep"; # bat + ripgrep
man = "batman"; # bat + man
ls = "eza --color=auto";
l = "eza -Alh --color=auto --icons=auto";
ll = "eza -lh --color=auto --icons=auto";
li = "eza --color=auto --git-ignore";
};
plugins = [
{
name = "grc";

327
homes/modules/term/foot.nix Normal file
View file

@ -0,0 +1,327 @@
{pkgs-unstable, ...}: {
programs.foot = {
enable = true;
package = pkgs-unstable.foot;
server.enable = true;
settings = let
none = "\"\"";
in {
main = {
term = "foot"; # set $TERM
login-shell = "no";
title = "foot";
locked-title = "no";
# font = "GeistMono Nerd Font:size=12";
# font = "Mononoki Nerd Font Mono:size=12";
# font = "0xProto Nerd Font Mono:size=12";
font = "JetBrainsMonoNL Nerd Font:size=12";
# font-bold = "";
# font-italice = "";
# font-bold-italice = "";
# font-size-adjustment = 0.5;
# line-height = ...;
# letter-spacing = 0;
# horizontal-letter-offset = 0;
# vertical-letter-offset = 0;
# underline-offset = ...;
# underline-thickness = ...;
# strikeout-thickness = ...;
box-drawings-uses-font-glyphs = "no";
dpi-aware = "no";
gamma-correct-blending = "no";
initial-color-theme = "1";
# initial-window-size-pixels = "700x500"; # pixel COLSxROWS
initial-window-size-chars = "90x26"; # char COLSxROWS
initial-window-mode = "windowed";
pad = "32x32 center-when-maximized-and-fullscreen";
resize-by-cells = "yes";
resize-keep-grid = "yes";
resize-delay-ms = "100";
bold-text-in-bright = "no";
word-delimiters = ",`|:\"'()[]{}<>";
selection-target = "primary";
# workers = ...; # number of logical CPUs
};
# environment = {
# name = "value";
# }
security = {
osc52 = "enabled";
};
bell = {
system = "no";
urgent = "no";
notify = "no";
visual = "no";
# command = ...;
# command-focused = "no";
};
desktop-notifications = {
command = "notify-send --wait --app-name \${app-id} --icon \${app-id} --category \${category} --urgency \${urgency} --expire-time \${expire-time} --hint STRING:image-path:\${icon} --hint BOOLEAN:suppress-sound:\${muted} --hint STRING:sound-name:\${sound-name} --replace-id \${replace-id} \${action-argument} --print-id -- \${title} \${body}";
command-action-argument = "--action \${action-name=\${action-label}}";
close = none;
inhibit-when-focused = "no";
};
scrollback = {
lines = 1000;
multiplier = 1.0;
indicator-position = "relative";
indicator-format = none;
};
url = {
launch = "xdg-open \${url}";
label-letters = "sadfjklewcmpgh";
osc8-underline = "url-mode";
regex = "(((https?://|mailto:|ftp://|file:|ssh:|ssh://|git://|tel:|magnet:|ipfs://|ipns://|gemini://|gopher://|news:)|www\\.)([0-9a-zA-Z:/?#@!$&*+,;=.~_%^\\-]+|\\([]\\[\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\)|\\[[\\(\\)\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\]|\"[]\\[\\(\\)0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\"|'[]\\[\\(\\)0-9a-zA-Z:/?#@!$&*+,;=.~_%^\\-]*')+([0-9a-zA-Z/#@$&*+=~_%^\\-]|\\([]\\[\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\)|\\[[\\(\\)\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\]|\"[]\\[\\(\\)0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\"|'[]\\[\\(\\)0-9a-zA-Z:/?#@!$&*+,;=.~_%^\\-]*'))";
};
# "regex:your-fancy-name" = {
# regex = ...;
# launch = "[path to script/application] \${match}"
# };
#
# key-bindings = {
# regex-launch = "[your-fancy-name] Control+Shift+q";
# regex-copy = "[your-fancy-name] Control+Alt+shift+q";
# };
cursor = {
style = "block";
blink = "no";
# blink-rate = 500;
beam-thickness = 1.0;
# underline-thickness = ...;
};
mouse = {
hide-when-typing = "yes";
alternate-scroll-mode = "yes";
};
touch = {
long-press-delay = 400;
};
# Theme: Dracula
# REF: https://github.com/dracula/foot
colors = {
alpha = 1.0;
alpha-mode = "default"; # default/matching/all
background = "282a36";
foreground = "f8f8f2";
## Normal/regular colors (color palette 0-7)
regular0 = "21222c"; # black
regular1 = "ff5555"; # red
regular2 = "50fa7b"; # green
regular3 = "f1fa8c"; # yellow
regular4 = "bd93f9"; # blue
regular5 = "ff79c6"; # magenta
regular6 = "8be9fd"; # cyan
regular7 = "f8f8f2"; # white
## Bright colors (color palette 8-15)
bright0 = "6272a4"; # bright black
bright1 = "ff6e6e"; # bright red
bright2 = "69ff94"; # bright green
bright3 = "ffffa5"; # bright yellow
bright4 = "d6acff"; # bright blue
bright5 = "ff92df"; # bright magenta
bright6 = "a4ffff"; # bright cyan
bright7 = "ffffff"; # bright white
## Misc colors
selection-foreground = "ffffff";
selection-background = "44475a";
# jump-labels=<regular0> <regular3> # black-on-yellow
# scrollback-indicator=<regular0> <bright4> # black-on-bright-blue
# search-box-no-match=<regular0> <regular1> # black-on-red
# search-box-match=<regular0> <regular3> # black-on-yellow
urls = "8be9fd";
flash = "7f7f00";
flash-alpha = 0.5;
};
# Alternative colour palette (see `man 5 foot.ini`)
colors2 = {
alpha = 1.0;
alpha-mode = "default";
background = "191724";
foreground = "e0def4";
regular0 = "26233a"; # black (Overlay)
regular1 = "eb6f92"; # red (Love)
regular2 = "9ccfd8"; # green (Foam)
regular3 = "f6c177"; # yellow (Gold)
regular4 = "31748f"; # blue (Pine)
regular5 = "c4a7e7"; # magenta (Iris)
regular6 = "ebbcba"; # cyan (Rose)
regular7 = "e0def4"; # white (Text)
bright0 = "47435d"; # bright black (lighter Overlay)
bright1 = "ff98ba"; # bright red (lighter Love)
bright2 = "c5f9ff"; # bright green (lighter Foam)
bright3 = "ffeb9e"; # bright yellow (lighter Gold)
bright4 = "5b9ab7"; # bright blue (lighter Pine)
bright5 = "eed0ff"; # bright magenta (lighter Iris)
bright6 = "ffe5e3"; # bright cyan (lighter Rose)
bright7 = "fefcff"; # bright white (lighter Text)
selection-foreground = "ffffff";
selection-background = "393553";
urls = "ebbcba"; # Rose
flash = "f6c177"; # yellow (Gold)
flash-alpha = 0.5;
cursor = "191724 e0def4";
};
# csd = {
# preferred = "server";
# size = 26;
# font = ...;
# color = ...; # foreground color
# hide-when-maximized = "no";
# border-width = 0;
# border-color = ...;
# button-width = 26;
# button-color = ...; # background color
# button-minimize-color = ...;
# button-maximize-color = ...;
# button-close-color = ...;
# };
key-bindings = {
scrollback-up-page = "Shift+Page_Up Shift+KP_Page_Up";
# scrollback-up-half-page = "none";
# scrollback-up-line = "none";
scrollback-down-page = "Shift+Page_Down Shift+KP_Page_Down";
# scrollback-down-half-page = "none";
# scrollback-down-line = "none";
# scrollback-home = "none";
# scrollback-end = "none";
clipboard-copy = "Control+Shift+c XF86Copy";
clipboard-paste = "Control+Shift+v XF86Paste";
primary-paste = "Shift+Insert";
search-start = "Control+Shift+r";
font-increase = "Control+plus Control+equal Control+KP_Add";
font-decrease = "Control+minus Control+KP_Subtract";
font-reset = "Control+0 Control+KP_0";
spawn-terminal = "Control+Shift+n";
# minimize = "none";
# maximize = "none";
# fullscreen = "none";
pipe-visible = "[sh -c \"xurls | fuzzel | xargs -r firefox\"] none";
pipe-scrollback = "[sh -c \"xurls | fuzzel | xargs -r firefox\"] none";
pipe-selected = "[xargs -r firefox] none";
pipe-command-output = "[wl-copy] none";
show-urls-launch = "Control+Shift+o";
# show-urls-copy = "none";
# show-urls-persistent = "none";
prompt-prev = "Control+Shift+z";
prompt-next = "Control+Shift+x";
unicode-input = "Control+Shift+u";
# color-theme-switch-1 = "none";
# color-theme-switch-2 = "none";
color-theme-toggle = "Control+Alt+p";
# noop = "none";
# quit = "none";
};
search-bindings = {
cancel = "Control+g Control+c Escape";
commit = "Return KP_Enter";
find-prev = "Control+r";
find-next = "Control+s";
cursor-left = "Left Control+b";
cursor-left-word = "Control+Left Mod1+b";
cursor-right = "Right Control+f";
cursor-right-word = "Control+Right Mod1+f";
cursor-home = "Home Control+a";
cursor-end = "End Control+e";
delete-prev = "BackSpace";
delete-prev-word = "Mod1+BackSpace Control+BackSpace";
delete-next = "Delete";
delete-next-word = "Mod1+d Control+Delete";
delete-to-start = "Control+u";
delete-to-end = "Control+k";
extend-char = "Shift+Right";
extend-to-word-boundary = "Control+w Control+Shift+Right";
extend-to-next-whitespace = "Control+Shift+w";
extend-line-down = "Shift+Down";
extend-backward-char = "Shift+Left";
extend-backward-to-word-boundary = "Control+Shift+Left";
# extend-backward-to-next-whitespace = "none";
extend-line-up = "Shift+Up";
clipboard-paste = "Control+v Control+Shift+v Control+y XF86Paste";
primary-paste = "Shift+Insert";
# unicode-input = "none";
scrollback-up-page = "Shift+Page_Up Shift+KP_Page_Up";
# scrollback-up-half-page = "none";
# scrollback-up-line = "none";
scrollback-down-page = "Shift+Page_Down Shift+KP_Page_Down";
# scrollback-down-half-page = "none";
# scrollback-down-line = "none";
# scrollback-home = "none";
# scrollback-end = "none";
};
url-bindings = {
cancel = "Control+g Control+c Control+d Escape";
toggle-url-visible = "t";
};
text-bindings = {
"\\x03" = "Mod4+c"; # map Super+c -> Control+c
};
mouse-bindings = {
scrollback-up-mouse = "BTN_WHEEL_BACK";
scrollback-down-mouse = "BTN_WHEEL_FORWARD";
font-increase = "Control+BTN_WHEEL_BACK";
font-decrease = "Control+BTN_WHEEL_FORWARD";
selection-override-modifiers = "Shift";
primary-paste = "BTN_MIDDLE";
select-begin = "BTN_LEFT";
select-begin-block = "Control+BTN_LEFT";
select-extend = "BTN_RIGHT";
select-extend-character-wise = "Control+BTN_RIGHT";
select-word = "BTN_LEFT-2";
select-word-whitespace = "Control+BTN_LEFT-2";
select-quote = "BTN_LEFT-3";
select-row = "BTN_LEFT-4";
};
};
};
}

View file

@ -1,19 +1,24 @@
{
lib,
pkgs,
pkgs-unstable,
inputs,
config,
...
}: let
home-manager = builtins.fetchTarball {
url = "https://github.com/nix-community/home-manager/archive/release-25.05.tar.gz";
sha256 = "1kk5qzfb87mkgy6vzm7x8z8akxr3k8k7839yjdy48z034pvidhsr";
sha256 = "1y919cqrlmq0k44rgnacaq4zq37jj4rdh6f2swp6y2jiz28xb0iq";
};
in {
imports = [
./hardware-configuration.nix
(import "${home-manager}/nixos")
../modules/wm/hyprland.nix
# ../modules/wm/river.nix
../modules/wm/crywl.nix
../modules/steam.nix
../modules/obsidian.nix
@ -116,6 +121,12 @@ in {
);
};
dbus = {
# NOTE: programs.uwsm.enable sets implementation to dbus-broker,
# NOTE: however this seems to break dbus
implementation = lib.mkForce "dbus";
};
# Multimedia Framework
# With backwards compatability for alsa/pulseaudio/jack
pipewire = {
@ -180,7 +191,7 @@ in {
home-manager = {
users.me = import ../../homes/me;
#extraSpecialArgs = {inherit inputs pkgs;};
extraSpecialArgs = {inherit inputs pkgs pkgs-unstable;};
sharedModules = [
inputs.ags.homeManagerModules.default
];
@ -198,6 +209,7 @@ in {
# ---- SYSTEM PACKAGES -----
environment.systemPackages = with pkgs; [
# User Environment
# crywl
swww
helvum
easyeffects
@ -214,18 +226,19 @@ in {
# Shell
bash
zsh
fish
shellcheck
grc # colorise command outputs
# Systems Emulation
qemu # Fellice Bellard's Quick Emulator
# Make
# GNU Utils
gnumake
binutils
# C Family
gcc
clang
clang-tools
# Rust
cargo
rustc
@ -303,13 +316,13 @@ in {
];
programs = {
hyprland = {
crywl = {
enable = true;
withUWSM = true; # Universal Wayland Session Manager
xwayland.enable = true;
xwayland.enable = false;
defaultSession = false;
useUnmodifiedDWL = false;
};
zsh.enable = true;
fish.enable = true;
nix-ld.enable = true;
@ -318,6 +331,7 @@ in {
# cause it isn't POSIX compliant, so instead Bash is my login and
# will just exec fish (^-^)
bash = {
blesh.enable = false; # ble.sh replacement for GNU readline
completion.enable = true;
interactiveShellInit = ''
@ -375,10 +389,26 @@ in {
};
};
documentation = {
enable = true;
doc.enable = true; # install /share/doc packages
man.enable = true; # install manpages
info.enable = true; # install GNU info
dev.enable = true; # install docs intended for developers
nixos = {
enable = true; # install NixOS documentation (ie man -k nix, & nixos-help)
options.splitBuild = true;
# includeAllModules = true;
};
};
virtualisation.docker.enable = true;
hardware = {
graphics.enable = true;
graphics = {
enable = true;
enable32Bit = true;
};
# opengl = {
# enable = true;

116
hosts/modules/wm/crywl.nix Normal file
View file

@ -0,0 +1,116 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.programs.crywl;
in {
options.programs.crywl = with lib; {
enable = mkEnableOption "CryWL";
xwayland.enable = mkEnableOption "XWayland";
defaultSession = mkEnableOption "CryWL as the default login session";
# currently DWL 0.7 (also beware I'll barely ever update the original DWL refs)
useUnmodifiedDWL = mkOption {
type = types.bool;
default = false;
description = "Whether to use unmodified DWL source code (latest stable release)";
};
};
config = lib.mkIf cfg.enable (let
xwaylandEnabled = cfg.xwayland.enable;
defaultSession = cfg.defaultSession;
useUnmodifiedDWL = cfg.useUnmodifiedDWL;
in {
services.displayManager = {
sessionPackages = [
pkgs.crywl
];
defaultSession = lib.mkIf defaultSession "crywl";
};
environment.systemPackages = [
pkgs.crywl
];
nixpkgs.overlays = [
(self: super: {
crywl = super.dwl.overrideAttrs (oldAttrs: rec {
pname = "crywl";
version = "0.1-unstable";
src = let
dwl_0_70 = {
rev = "74e45c4014ae7048ecbb76eb6f54034b8b479480";
hash = "sha256-7SoCITrbMrlfL4Z4hVyPpjB9RrrjLXHP9C5t1DVXBBA=";
};
crywl_unstable = {
rev = "dc1260d3cfd14e8e5b243ec1d3d56e4b08c8c517";
hash = "sha256-61R+xBYMzeEn93gLofcj8Y3VbJqW6g7GzCTujpAco90=";
};
in
pkgs.fetchFromGitea ({
domain = "forge.imbored.dev";
owner = "emileclarkb";
repo = pname;
}
// (
if useUnmodifiedDWL
then dwl_0_70
else crywl_unstable
));
buildInputs = with pkgs;
[
libinput
xorg.libxcb
libxkbcommon
pixman
wayland
wayland-protocols
wlroots_0_19
]
++ lib.optionals xwaylandEnabled [
xorg.libX11
xorg.xcbutilwm
xwayland
];
makeFlags =
[
"PKG_CONFIG=${pkgs.stdenv.cc.targetPrefix}pkg-config"
"WAYLAND_SCANNER=wayland-scanner"
"PREFIX=$(out)"
"MANDIR=$(man)/share/man"
]
++ lib.optionals xwaylandEnabled [
''XWAYLAND="-DXWAYLAND"''
''XLIBS="xcb xcb-icccm.pc"''
];
# Ensure `crywl.desktop` entry is registered
passthru = {
providedSessions = [pname];
tests.version = pkgs.testers.testVersion {
package = oldAttrs.finalPackage;
# `dwl -v` emits its version string to stderr and returns 1
command = "crywl -v 2>&1; return 0";
};
};
meta = {
homepage = "https://forge.imbored.dev/emileclarkb/crywl";
description = "Personal fork of DWL";
license = lib.licenses.gpl3Only;
maintainers = [lib.maintainers.emileclarkb];
inherit (pkgs.wayland.meta) platforms;
mainProgram = "crywl";
};
});
})
];
});
}

View file

@ -0,0 +1,9 @@
{...}: {
programs = {
hyprland = {
enable = true;
withUWSM = true; # Universal Wayland Session Manager
xwayland.enable = true;
};
};
}

View file

@ -0,0 +1,5 @@
{...}: {
programs = {
river.enable = true;
};
}

View file

@ -14,6 +14,8 @@ in {
./hardware-configuration.nix
(import "${home-manager}/nixos")
../modules/wm/hyprland.nix
../modules/steam.nix
../modules/obsidian.nix
@ -110,7 +112,7 @@ in {
defaultSession =
"hyprland"
+ (
if config.programs.hyprland.withUWSM == true
if config.programs.hyprland.withUWSM
then "-uwsm"
else null
);
@ -223,19 +225,21 @@ in {
# Shell
bash
zsh
fish
shellcheck
grc # colorise command outputs
# Systems Programming & Compilation
qemu # Fellice Bellard's Quick Emulator
# GNU Utils
gnumake
binutils
strace
ltrace
# C Family
gcc
clang
clang-tools
# Rust
cargo
rustc
@ -328,12 +332,6 @@ in {
#};
programs = {
hyprland = {
enable = true;
withUWSM = true; # Universal Wayland Session Manager
xwayland.enable = true;
};
zsh.enable = true;
fish.enable = true;
@ -419,10 +417,26 @@ in {
};
};
documentation = {
enable = true;
doc.enable = true; # install /share/doc packages
man.enable = true; # install manpages
info.enable = true; # install GNU info
dev.enable = true; # install docs intended for developers
nixos = {
enable = true; # install NixOS documentation (ie man -k nix, & nixos-help)
options.splitBuild = true;
# includeAllModules = true;
};
};
virtualisation.docker.enable = true;
hardware = {
graphics.enable = true;
graphics = {
enable = true;
enable32Bit = true;
};
# opengl = {
# enable = true;

12
scripts/fontgrep Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
function fontgrep {
fc-list \
| grep $@ \
| awk '{$1=""; print substr($0, 2, length($0)-1) }' \
| grep -oE '^\s*[^,]+' \
| sort \
| uniq
}
fontgrep $@