Quickshell initial config

This commit is contained in:
xbazzi 2025-08-09 12:02:06 -06:00
parent 303f1e0710
commit 4948d71006
40 changed files with 1156 additions and 667 deletions

View File

@ -1,28 +1,38 @@
# Run with `nix-shell cuda-fhs.nix` # Run with `nix-shell cuda-fhs.nix`
{ pkgs ? import <nixpkgs> {} }: {
pkgs ? import <nixpkgs> { },
}:
(pkgs.buildFHSUserEnv { (pkgs.buildFHSUserEnv {
name = "cuda-env"; name = "cuda-env";
targetPkgs = pkgs: with pkgs; [ targetPkgs =
git pkgs: with pkgs; [
gitRepo git
gnupg gitRepo
autoconf gnupg
curl autoconf
procps curl
gnumake procps
util-linux gnumake
m4 util-linux
gperf m4
unzip gperf
cudaPackages_12.cudatoolkit unzip
linuxPackages.nvidia_x11 cudaPackages_12.cudatoolkit
libGLU libGL linuxPackages.nvidia_x11
xorg.libXi xorg.libXmu freeglut libGLU
xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib libGL
ncurses5 xorg.libXi
stdenv.cc xorg.libXmu
binutils freeglut
]; xorg.libXext
xorg.libX11
xorg.libXv
xorg.libXrandr
zlib
ncurses5
stdenv.cc
binutils
];
multiPkgs = pkgs: with pkgs; [ zlib ]; multiPkgs = pkgs: with pkgs; [ zlib ];
runScript = "bash"; runScript = "bash";
profile = '' profile = ''
@ -31,4 +41,4 @@
export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib" export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib"
export EXTRA_CCFLAGS="-I/usr/include" export EXTRA_CCFLAGS="-I/usr/include"
''; '';
}).env }).env

View File

@ -43,12 +43,18 @@
# nixvim = { # nixvim = {
# url = "github:xbazzi/nixvim-config"; # url = "github:xbazzi/nixvim-config";
# }; # };
}; };
outputs = { nixpkgs, lanzaboote, ... }@inputs: outputs =
{ nixpkgs, lanzaboote, ... }@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { system = "x86_64-linux"; config = { allowUnfree = true; }; }; pkgs = import nixpkgs {
system = "x86_64-linux";
config = {
allowUnfree = true;
};
};
# configModule = { # configModule = {
# # Add any custom options (and do feel free to upstream them!) # # Add any custom options (and do feel free to upstream them!)
# # options = { ... }; # # options = { ... };
@ -62,12 +68,13 @@
in in
{ {
devShells.${system}.default = pkgs.mkShell { devShells.${system}.default = pkgs.mkShell {
buildInputs = [ buildInputs = [
pkgs.neovim pkgs.vim pkgs.neovim
pkgs.vim
]; ];
shellHook = '' shellHook = ''
echo "hello" echo "hello"
''; '';
}; };
nixosConfigurations = { nixosConfigurations = {
@ -96,24 +103,27 @@
# ]; # ];
# } # }
({ pkgs, lib, ... }: { (
{ pkgs, lib, ... }:
{
environment.systemPackages = [ environment.systemPackages = [
# For debugging and troubleshooting Secure Boot. # For debugging and troubleshooting Secure Boot.
pkgs.sbctl pkgs.sbctl
]; ];
# Lanzaboote currently replaces the systemd-boot module. # Lanzaboote currently replaces the systemd-boot module.
# This setting is usually set to true in configuration.nix # This setting is usually set to true in configuration.nix
# generated at installation time. So we force it to false # generated at installation time. So we force it to false
# for now. # for now.
boot.loader.systemd-boot.enable = lib.mkForce false; boot.loader.systemd-boot.enable = lib.mkForce false;
boot.lanzaboote = { boot.lanzaboote = {
enable = true; enable = true;
pkiBundle = "/var/lib/sbctl"; pkiBundle = "/var/lib/sbctl";
}; };
}) }
)
]; ];
}; };
}; };
@ -131,7 +141,7 @@
home-manager.users.xbazzi = { home-manager.users.xbazzi = {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
#home.packages = [ #home.packages = [
#]; #];
}; };
#home-manager.extraSpecialArgs #home-manager.extraSpecialArgs

View File

@ -1,17 +1,18 @@
{ {
programs.bash = { programs.bash = {
enable = true; enable = true;
shellAliases = shellAliases =
let let
flakePath = "~/nixos-config"; flakePath = "~/nixos-config";
in { in
la = "ls -lath"; {
lr = "ls -ltr"; la = "ls -lath";
rebuild = "sudo nixos-rebuild switch --flake ${flakePath}"; lr = "ls -ltr";
hms = "home-manager switch --flake ${flakePath}"; rebuild = "sudo nixos-rebuild switch --flake ${flakePath}";
vi = "vim"; hms = "home-manager switch --flake ${flakePath}";
#config = "nvim ~/nix/configuration.nix"; vi = "vim";
#homecfg = "nvim ~/nix/home.nix"; #config = "nvim ~/nix/configuration.nix";
}; #homecfg = "nvim ~/nix/home.nix";
}; };
};
} }

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
{ {
dconf = { dconf = {

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
{ {
imports = [ imports = [
@ -10,8 +16,10 @@
#./vscode.nix #./vscode.nix
./packages.nix ./packages.nix
./hyprlock.nix ./hyprlock.nix
./waybar.nix # ./waybar.nix
# ./dconf.nix # ./dconf.nix
./quickshell.nix
./hyprpaper.nix
./git.nix ./git.nix
./hyprland.nix ./hyprland.nix
./zsh.nix ./zsh.nix
@ -19,4 +27,4 @@
./kitty.nix ./kitty.nix
./neovim.nix ./neovim.nix
]; ];
} }

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
{ {
programs.git = { programs.git = {

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
{ {
gtk = { gtk = {
@ -48,4 +54,4 @@
# QT_STYLE_OVERRIDE = "Tokyonight-Dark-B"; # QT_STYLE_OVERRIDE = "Tokyonight-Dark-B";
# }; # };
} }

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
{ {
home.username = "xbazzi"; home.username = "xbazzi";

View File

@ -1,30 +1,36 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
{ {
programs.hypridle = { programs.hypridle = {
enable = true; enable = true;
settings = { settings = {
general = { general = {
lock_cmd = "hyprctl dispatch exec 'hyprlock --immediate'"; lock_cmd = "hyprctl dispatch exec 'hyprlock --immediate'";
before_sleep_cmd = "hyprctl dispatch exec 'hyprlock --immediate'"; before_sleep_cmd = "hyprctl dispatch exec 'hyprlock --immediate'";
after_sleep_cmd = "notify-send '💡 Welcome back, badman!'"; after_sleep_cmd = "notify-send '💡 Welcome back, badman!'";
}; };
listener = [ listener = [
{ {
timeout = 270; # 4.5 min — warn before lock timeout = 270; # 4.5 min — warn before lock
on-timeout = "notify-send '🔒 Locking in 30s...'"; on-timeout = "notify-send '🔒 Locking in 30s...'";
} }
{ {
timeout = 300; # 5 min — lock screen timeout = 300; # 5 min — lock screen
on-timeout = "hyprctl dispatch exec 'hypelock --immediate'"; on-timeout = "hyprctl dispatch exec 'hypelock --immediate'";
} }
{ {
timeout = 900; # 15 min — suspend timeout = 900; # 15 min — suspend
on-timeout = "systemctl suspend"; on-timeout = "systemctl suspend";
} }
]; ];
};
}; };
};
} }

View File

@ -1,4 +1,9 @@
{ config, pkgs, inputs, ... }: {
config,
pkgs,
inputs,
...
}:
{ {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
@ -12,146 +17,176 @@
# "DP-3,addreserved,30,0,0,0" # "DP-3,addreserved,30,0,0,0"
]; ];
bind = # Mouse stuff (Ew... I know)
[ bindm = [
# "$mod, k, exec, kitty" # Left click move
"$mod, h, movefocus, l" "$mod, mouse:272, movewindow"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
"$mod, q, killactive"
"$mod, 0, layoutmsg, rollnext" # Left click resize
"ALT, mouse:272, resizewindow"
# "ALT CTRL, mouse:272, resizewindow 1"
];
binde = [
"$mod CTRL, h, resizeactive, -30 0"
"$mod CTRL, l, resizeactive, 30 0"
"$mod CTRL, j, resizeactive, 0 30"
"$mod CTRL, k, resizeactive, 0 -30"
];
"$mod, f, fullscreen, 0" bind = [
"$mod, d, exec, wofi --show drun" "$mod, h, movefocus, l"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
"$mod SHIFT, q, killactive"
"$mod, t, exec, kitty --single-instance" "$mod, 0, layoutmsg, rollnext"
"$mod, c, exec, code" "$mod SHIFT, n, layoutmsg, cycleprev"
"$mod SHIFT, l, movewindow, mon:-1" "$mod SHIFT, p, layoutmsg, cyclenext"
"$mod SHIFT, h, movewindow, mon:+1"
", Print, exec, grimblast copy area" "$mod, f, fullscreen, 0"
"$mod, e, exec, thunderbird" "$mod, d, exec, wofi --show drun"
"$mod, r, exec, kitty -- zsh -c 'exec yazi; exec zsh'"
"$mod, b, exec, kitty -- zsh -c 'btop; exec zsh'"
"$mod SHIFT, n, exec, kitty --start-as=normal -- zsh -ic 'code ~/nixos-config && exit'"
"$mod, i, exec, brave" "$mod, t, exec, kitty --single-instance"
"$mod, u, exec, kitty --start-as=normal -- zsh -ic 'home'"
"$mod, y, exec, kitty --start-as=normal -- zsh -ic 'repos'"
"$mod, s, togglespecialworkspace, special1" "$mod, c, exec, code"
"$mod, v, togglespecialworkspace, special2" "$mod SHIFT, l, movewindow, mon:-1"
"$mod SHIFT, h, movewindow, mon:+1"
"$mod, p, swapwindow, l"
# Mouse stuff (Ew... I know)
# "$mod, mouse:272, movewindow"
# "$mod, mouse:273, resizewindow"
# "ALT, mouse:272, resizewindow"
# Log out ", Print, exec, grimblast copy area"
# "$mod, -, exec, hyprctl dispatch exit"
"$mod SHIFT ALT, x, exec, hyprctl dispatch exit"
"$mod ALT, L, exec, hyprlock --immediate" "$mod, e, exec, thunderbird"
"$mod, r, exec, kitty -- zsh -c 'exec yazi; exec zsh'"
"$mod, b, exec, kitty -- zsh -c 'btop; exec zsh'"
"$mod CTRL, n, exec, kitty --start-as=normal -- zsh -ic 'code ~/nixos-config && exit'"
# Shift+Print → select area and copy "$mod, i, exec, brave"
"SHIFT, Print, exec, grimblast copy area" "$mod, u, exec, kitty --start-as=normal -- zsh -ic 'home'"
"$mod, y, exec, kitty --start-as=normal -- zsh -ic 'repos'"
# Ctrl+Print → select window and copy "$mod, s, togglespecialworkspace, special1"
"CTRL, Print, exec, grimblast copy active" # "$mod, v, togglespecialworkspace, special2"
]
++ (
# workspaces
# binds $mod + [shift +] {1..9} to [move to] workspace {1..9}
builtins.concatLists (builtins.genList (i:
let ws = i + 1;
in [
"$mod, code:1${toString i}, workspace, ${toString ws}"
"$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}"
]
)
9)
);
general = { "$mod, p, layoutmsg, swapwithmaster"
layout = "master";
"$mod, v, togglefloating, active"
# Log out
# "$mod, -, exec, hyprctl dispatch exit"
"$mod SHIFT ALT, x, exec, hyprctl dispatch exit"
"$mod ALT, L, exec, hyprlock --immediate"
# Shift+Print → select area and copy
"SHIFT, Print, exec, grimblast copy area"
# Ctrl+Print → select window and copy
"CTRL, Print, exec, grimblast copy active"
]
++ (
# workspaces
# binds $mod + [shift +] {1..9} to [move to] workspace {1..9}
builtins.concatLists (
builtins.genList (
i:
let
ws = i + 1;
in
[
"$mod, code:1${toString i}, workspace, ${toString ws}"
"$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}"
]
) 9
)
);
general = {
layout = "master";
};
windowrulev2 = [
"opacity 0.85, class:^(Code)$"
"opacity 0.85, class:^(kitty)$"
];
# layerrule = [
# "ignorealpha 0.1, title:^(Blur)$"
# ];
decoration = {
# active_opacity = 1.0;
# inactive_opacity = 1.0;
# rounding = 5;
blur = {
enabled = true;
size = 5;
passes = 2;
brightness = 1;
contrast = 1.0;
ignore_opacity = false;
noise = 0;
new_optimizations = true;
# xray = true;
}; };
blurls = "^(popup|menu)$";
decoration = {
active_opacity = 1.0;
inactive_opacity = 1.0;
rounding = 5;
blur = { shadow = {
enabled = true;
size = 3;
passes = 2;
brightness = 1;
contrast = 1.4;
ignore_opacity = true;
noise = 0;
new_optimizations = true;
xray = true;
};
shadow = {
enabled = true;
ignore_window = true;
offset = "0 2";
range = 20;
render_power = 3;
color = "rgba(00000055)";
};
};
animations = {
enabled = true; enabled = true;
bezier = [ ignore_window = true;
"fluent_decel, 0, 0.2, 0.4, 1" offset = "0 2";
"easeOutCirc, 0, 0.55, 0.45, 1" range = 20;
"easeOutCubic, 0.33, 1, 0.68, 1" render_power = 3;
"fade_curve, 0, 0.55, 0.45, 1" color = "rgba(00000055)";
];
animation = [
# name, enable, speed, curve, style
# Windows
"windowsIn, 0, 4, easeOutCubic, popin 20%" # window open
"windowsOut, 0, 4, fluent_decel, popin 80%" # window close.
"windowsMove, 1, 2, fluent_decel, slide" # everything in between, moving, dragging, resizing.
# Fade
"fadeIn, 1, 3, fade_curve" # fade in (open) -> layers and windows
"fadeOut, 1, 3, fade_curve" # fade out (close) -> layers and windows
"fadeSwitch, 0, 1, easeOutCirc" # fade on changing activewindow and its opacity
"fadeShadow, 1, 10, easeOutCirc" # fade on changing activewindow for shadows
"fadeDim, 1, 4, fluent_decel" # the easing of the dimming of inactive windows
# "border, 1, 2.7, easeOutCirc" # for animating the border's color switch speed
# "borderangle, 1, 30, fluent_decel, once" # for animating the border's gradient angle - styles: once (default), loop
"workspaces, 1, 4, easeOutCubic, fade" # styles: slide, slidevert, fade, slidefade, slidefadevert
];
}; };
};
animations = {
enabled = true;
bezier = [
"fluent_decel, 0, 0.2, 0.4, 1"
"easeOutCirc, 0, 0.55, 0.45, 1"
"easeOutCubic, 0.33, 1, 0.68, 1"
"fade_curve, 0, 0.55, 0.45, 1"
];
animation = [
# name, enable, speed, curve, style
# Windows
"windowsIn, 0, 4, easeOutCubic, popin 20%" # window open
"windowsOut, 0, 4, fluent_decel, popin 80%" # window close.
"windowsMove, 1, 2, fluent_decel, slide" # everything in between, moving, dragging, resizing.
# Fade
"fadeIn, 1, 3, fade_curve" # fade in (open) -> layers and windows
"fadeOut, 1, 3, fade_curve" # fade out (close) -> layers and windows
"fadeSwitch, 0, 1, easeOutCirc" # fade on changing activewindow and its opacity
"fadeShadow, 1, 10, easeOutCirc" # fade on changing activewindow for shadows
"fadeDim, 1, 4, fluent_decel" # the easing of the dimming of inactive windows
# "border, 1, 2.7, easeOutCirc" # for animating the border's color switch speed
# "borderangle, 1, 30, fluent_decel, once" # for animating the border's gradient angle - styles: once (default), loop
"workspaces, 1, 4, easeOutCubic, fade" # styles: slide, slidevert, fade, slidefade, slidefadevert
];
};
exec-once = [ exec-once = [
"sleep 2 && waybar &" # "sleep 2 && waybar &"
"hypridle &" "hypridle &"
# "waybar &" # "waybar &"
"eval $(gnome-keyring-daemon --start --components=secrets,ssh,gpg)" "eval $(gnome-keyring-daemon --start --components=secrets,ssh,gpg)"
# "hash dbus-update-activation-environment 2>/dev/null" # "hash dbus-update-activation-environment 2>/dev/null"
"dbus-update-activation-environment --all --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" # "dbus-update-activation-environment --all --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"nm-applet &" # "nm-applet &"
"poweralertd &" # "poweralertd &"
# "wl-clip-persist --clipboard both &" # "wl-clip-persist --clipboard both &"
# "wl-paste --watch cliphist store &" # "wl-paste --watch cliphist store &"
# "waybar &" # "waybar &"
@ -167,4 +202,4 @@
]; ];
}; };
}; };
} }

View File

@ -1,4 +1,4 @@
{ inputs, pkgs, ... }: { inputs, pkgs, ... }:
{ {
programs.hyprlock = { programs.hyprlock = {
@ -73,7 +73,7 @@
color = "rgba(235, 219, 178, 1)"; color = "rgba(235, 219, 178, 1)";
font_size = 15; font_size = 15;
font_family = "Maple Mono Bold"; font_family = "Maple Mono Bold";
# position = "0, ${if host == "laptop" then "131" else "281"}"; # position = "0, ${if host == "laptop" then "131" else "281"}";
position = "0, 281"; position = "0, 281";
halign = "center"; halign = "center";
valign = "bottom"; valign = "bottom";
@ -105,4 +105,4 @@
]; ];
}; };
}; };
} }

25
home/hyprpaper.nix Normal file
View File

@ -0,0 +1,25 @@
{
pkgs,
# inputs,
...
}:
{
home.packages = [
pkgs.hyprpaper
];
services.hyprpaper = {
enable = true;
settings = {
ipc = "on";
splash = false;
preload = [
"/home/xbazzi/Pictures/wallpapers/Fantasy-Landscape2.png"
];
wallpaper = [
",/home/xbazzi/Pictures/wallpapers/Fantasy-Landscape2.png"
];
};
};
}

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
{ {
programs.kitty = lib.mkForce { programs.kitty = lib.mkForce {
@ -10,8 +16,8 @@
enable_audio_bell = false; enable_audio_bell = false;
mouse_hide_wait = "-1.0"; mouse_hide_wait = "-1.0";
window_padding_width = 5; window_padding_width = 5;
background_opacity = "0.95"; # background_opacity = "0.95";
background_blur = 5; # background_blur = 5;
background = "#17041c"; background = "#17041c";
hide_window_decorations = true; hide_window_decorations = true;
# themeFile = "Alucard"; # themeFile = "Alucard";
@ -37,8 +43,8 @@
"U+F300-U+F313" "U+F300-U+F313"
"U+E5FA-U+E62B" "U+E5FA-U+E62B"
]; ];
in in
(builtins.concatStringsSep "," mappings) + " Symbols Nerd Font"; (builtins.concatStringsSep "," mappings) + " Symbols Nerd Font";
}; };
}; };
} }

View File

@ -1,28 +1,34 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
{ {
programs.neovim ={ programs.neovim = {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
#extraConfig = /home/nixxer/.config/nvim-javi/init.lua; #extraConfig = /home/nixxer/.config/nvim-javi/init.lua;
# extraConfig = '' # extraConfig = ''
# set background=dark # set background=dark
# set shiftwidth=4 # set shiftwidth=4
# set showmatch # set showmatch
# set ignorecase # set ignorecase
# set smartcase # set smartcase
# set incsearch # set incsearch
# set hlsearch # set hlsearch
# set expandtab # set expandtab
# set rnu nu # set rnu nu
# set tabstop=4 # set tabstop=4
# set mouse=a # set mouse=a
# set laststatus=2 # set laststatus=2
# set nobackup # set nobackup
# set noswapfile # set noswapfile
# set undofile # set undofile
# let undodir=stdpath('data') .. '/undodir' # let undodir=stdpath('data') .. '/undodir'
# set clipboard=unnamedplus # set clipboard=unnamedplus
# ''; # '';
}; };
} }

View File

@ -1,4 +1,4 @@
{ inputs, pkgs, ... }: { inputs, pkgs, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -6,14 +6,14 @@
tmux tmux
# gnomeExtensions.appindicator # gnomeExtensions.appindicator
wofi wofi
waybar # waybar
# eww # eww
# gnome-keyring # gnome-keyring
libsecret libsecret
grim # for screenshots grim # for screenshots
slurp # for selecting area slurp # for selecting area
grimblast # easier syntax for grim+slurp grimblast # easier syntax for grim+slurp
wl-clipboard # copy screenshot to clipboard wl-clipboard # copy screenshot to clipboard
hypridle hypridle
hyprlock hyprlock
# (pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) # (pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; })

64
home/quickshell.nix Normal file
View File

@ -0,0 +1,64 @@
{ pkgs, ... }:
{
home.packages = [ pkgs.quickshell ];
# start it when Hyprland starts
wayland.windowManager.hyprland.settings.exec-once = [
"quickshell -c default"
];
# write the Quickshell config
xdg.configFile."quickshell/default/shell.qml".text = ''
import Quickshell
import Quickshell.Io
import QtQuick
// one window per screen
Variants {
model: Quickshell.screens
delegate: Component {
PanelWindow {
required property var modelData
screen: modelData
// top bar, full width
anchors.top: true
anchors.left: true
anchors.right: true
implicitHeight: 30 // tweak height if yuh want
Rectangle {
anchors.fill: parent
color: "#1a1a1a"
opacity: 0.92
}
// center clock
Text {
id: clock
anchors.centerIn: parent
font.pixelSize: 13
color: "#e6e6e6"
}
// update clock every second using `date`
Process {
id: dateProc
command: [ "date", "+%a %b %d %H:%M:%S" ]
running: true
stdout: StdioCollector {
onStreamFinished: clock.text = this.text.trim()
}
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: dateProc.running = true
}
}
}
}
'';
}

169
home/quickshell.nix.nope Normal file
View File

@ -0,0 +1,169 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
quickshell jq playerctl pamixer networkmanager # nmcli
coreutils gnugrep gawk
];
wayland.windowManager.hyprland.settings.exec-once = [
"quickshell -c default"
];
xdg.configFile."quickshell/default/shell.qml".text = ''
import Quickshell
import QtQuick
import QtQuick.Layouts
// ===== Helpers =====
function run(cmd) {
const p = Qt.createQmlObject('import Quickshell; Process { }', root);
p.command = cmd; p.running = true; return p;
}
function pipe(cmdArr, cb) {
const p = Qt.createQmlObject('import Quickshell; Process { stdout: StdioCollector{} }', root);
p.command = cmdArr; p.running = true;
p.stdout.onStreamFinished.connect(function() { cb(p.stdout.text.trim()); });
}
// ===== Window per monitor =====
Variants {
id: root
model: Quickshell.screens
delegate: Component {
PanelWindow {
required property var modelData
screen: modelData
anchors.top: true; anchors.left: true; anchors.right: true
implicitHeight: 30
layer: "top"
exclusiveZone: implicitHeight
Rectangle { anchors.fill: parent; color: "#121212"; opacity: 0.95; radius: 0 }
// ===== Layout =====
RowLayout {
anchors.fill: parent
anchors.margins: 8
spacing: 12
// ---- LEFT: Workspaces ----
Row {
id: wsRow
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
property int activeWs: 1
Repeater {
model: 10
delegate: Rectangle {
property int idx: index + 1
height: 18; width: 22; radius: 5
color: (wsRow.activeWs === idx) ? "#2e7d32" : "#1f1f1f"
border.width: 1
border.color: (wsRow.activeWs === idx) ? "#4caf50" : "#333333"
Text {
anchors.centerIn: parent
text: idx; color: "#eaeaea"; font.pixelSize: 11
}
MouseArea {
anchors.fill: parent
onClicked: run(["hyprctl","dispatch","workspace", String(idx)])
}
}
}
// active workspace poll
Timer {
interval: 500; running: true; repeat: true
onTriggered: pipe(["bash","-lc","hyprctl activeworkspace -j | jq -r .id"], function(t){
if (t !== "" && !isNaN(parseInt(t))) wsRow.activeWs = parseInt(t)
})
}
}
// ---- CENTER: Active window title ----
Item { Layout.fillWidth: true }
Text {
id: titleText
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
elide: Text.ElideRight; horizontalAlignment: Text.AlignHCenter
font.pixelSize: 12; color: "#dcdcdc"; text: "—"
width: parent.width * 0.40
}
Timer {
interval: 500; running: true; repeat: true
onTriggered: pipe(["bash","-lc","hyprctl activewindow -j | jq -r .title"], function(t){
titleText.text = (t && t !== "null") ? t : "—"
})
}
Item { Layout.fillWidth: true }
// ---- RIGHT: Media / Volume / Net / Battery / Clock ----
Row {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
spacing: 10
// Media (playerctl)
Text {
id: media
font.pixelSize: 12; color: "#c0c0c0"; text: ""
width: 220; elide: Text.ElideRight
}
Timer {
interval: 1000; running: true; repeat: true
onTriggered: pipe(["bash","-lc",
"playerctl metadata --format '{{status}} {{artist}} - {{title}}' 2>/dev/null || true"
], function(t){ media.text = t })
}
// Volume (pamixer)
Text {
id: vol; font.pixelSize: 12; color: "#e0e0e0"; text: ""
MouseArea { anchors.fill: parent; onWheel: (wheel.angleDelta.y>0)
? run(["pamixer","-i","3"]) : run(["pamixer","-d","3"]) }
onPressed: run(["pamixer","-t"])
}
Timer {
interval: 800; running: true; repeat: true
onTriggered: pipe(["bash","-lc",
"if pamixer --get-mute; then echo ' Mute'; else echo \" $(pamixer --get-volume)%\"; fi"
], function(t){ vol.text = t })
}
// Network (nmcli)
Text {
id: net; font.pixelSize: 12; color: "#b0b0b0"; text: ""
MouseArea { anchors.fill: parent; onClicked: run(["nm-connection-editor"]) }
}
Timer {
interval: 2500; running: true; repeat: true
onTriggered: pipe(["bash","-lc",
"nmcli -t -f NAME,TYPE,DEVICE,STATE connection show --active | awk -F: 'NR==1{print $1\" (\"$2\")\"}' || true"
], function(t){ net.text = t || "offline" })
}
// Battery (upower/sysfs)
Text { id: bat; font.pixelSize: 12; color: "#b0e08a"; text: "" }
Timer {
interval: 3000; running: true; repeat: true
onTriggered: pipe(["bash","-lc",
"cap=$(cat /sys/class/power_supply/BAT*/capacity 2>/dev/null | head -n1); " +
"stat=$(cat /sys/class/power_supply/BAT*/status 2>/dev/null | head -n1); " +
"if [ -n \"$cap\" ]; then echo \"$stat $cap%\"; fi"
], function(t){ bat.text = t || "" })
}
// Clock
Text {
id: clock; font.pixelSize: 12; color: "#eeeeee"
}
Timer {
interval: 1000; running: true; repeat: true
onTriggered: pipe(["date","+%a %b %d %H:%M:%S"], function(t){ clock.text = t })
}
}
}
}
}
}
'';
}

View File

@ -1,24 +1,30 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
{ {
programs.starship = { programs.starship = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
settings = pkgs.lib.importTOML ./xbazzi_starship.toml; settings = pkgs.lib.importTOML ./xbazzi_starship.toml;
# username = { # username = {
# style_user = "blue bold"; # style_user = "blue bold";
# style_root = "red bold"; # style_root = "red bold";
# format = "[$user]($style) "; # format = "[$user]($style) ";
# disabled = false; # disabled = false;
# show_always = true; # show_always = true;
# }; # };
# hostname = { # hostname = {
# ssh_only = false; # ssh_only = false;
# ssh_symbol = "🌐 "; # ssh_symbol = "🌐 ";
# format = "on [$hostname](bold red) "; # format = "on [$hostname](bold red) ";
# trim_at = ".local"; # trim_at = ".local";
# disabled = false; # disabled = false;
# }; # };
}; };
# home.sessionVariables = { # home.sessionVariables = {
# STARSHIP_CONFIG = "/home/xbazzi/.config/starship.toml"; # STARSHIP_CONFIG = "/home/xbazzi/.config/starship.toml";

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
{ {
# Home Manager can also manage your environment variables through # Home Manager can also manage your environment variables through

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
{ {
programs.vim = { programs.vim = {

View File

@ -1,32 +1,32 @@
{ pkgs, ... }: { pkgs, ... }:
{ # {
programs.waybar = { # programs.waybar = {
enable = true; # enable = true;
# settings = [ # # settings = [
# { # # {
# main.modules-right = ["clock"]; # # main.modules-right = ["clock"];
# layer = "top"; # # layer = "top";
# position = "top"; # # position = "top";
# modules-left = [ "hyprland/workspaces" "clock" ]; # # modules-left = [ "hyprland/workspaces" "clock" ];
# modules-center = [ "window" ]; # # modules-center = [ "window" ];
# modules-right = [ "battery" "pulseaudio" "network" ]; # # modules-right = [ "battery" "pulseaudio" "network" ];
# } # # }
# ]; # # ];
# style = '' # # style = ''
# * { # # * {
# font-family: "JetBrainsMono Nerd Font", monospace; # # font-family: "JetBrainsMono Nerd Font", monospace;
# font-size: 12px; # # font-size: 12px;
# } # # }
# #workspaces button.active { # # #workspaces button.active {
# background-color: #ff5555; # # background-color: #ff5555;
# } # # }
# ''; # # '';
# settings = [ ./waybar/config.jsonc ]; # # settings = [ ./waybar/config.jsonc ];
settings = [ # settings = [
(builtins.fromJSON (builtins.readFile ./waybar/config.json)) # (builtins.fromJSON (builtins.readFile ./waybar/config.json))
]; # ];
style = ./waybar/style.css; # style = ./waybar/style.css;
}; # };
} # }

View File

@ -27,10 +27,10 @@ window#waybar {
background: rgba(94, 129, 172, 0.5); background: rgba(94, 129, 172, 0.5);
} }
#clock, #cpu, #memory, #temperature, #pulseaudio, #network, #custom-windowtitle { /* #clock, #cpu, #memory, #temperature, #pulseaudio, #network, #custom-windowtitle {
padding: 0 8px; padding: 0 8px;
color: #eceff4; color: #eceff4;
} } */
#tray { #tray {
padding-left: 6px; padding-left: 6px;

View File

@ -1,6 +1,10 @@
{
inputs,
{ inputs, pkgs, lib, config, ... }: pkgs,
lib,
config,
...
}:
{ {
programs.zsh = { programs.zsh = {
@ -58,23 +62,27 @@
ansible-vault edit "$FINAL_PATH" \ ansible-vault edit "$FINAL_PATH" \
--vault-password-file "$HOME/.ansible-vault-key" --vault-password-file "$HOME/.ansible-vault-key"
} }
''; '';
history.size = 10000; history.size = 10000;
history.ignoreAllDups = true; history.ignoreAllDups = true;
history.path = "$HOME/.zsh_history"; history.path = "$HOME/.zsh_history";
history.ignorePatterns = ["rm *" "pkill *" "cp *"]; history.ignorePatterns = [
"rm *"
"pkill *"
"cp *"
];
shellAliases = shellAliases =
let let
flakePath = "~/nixos-config"; flakePath = "~/nixos-config";
in in
{ {
# la="eza -s modified -r -lh"; # la="eza -s modified -r -lh";
cb="cmake -B build -S . && cmake --build build -j$(nproc)"; cb = "cmake -B build -S . && cmake --build build -j$(nproc)";
la="eza -s modified -lhr --icons --git"; la = "eza -s modified -lhr --icons --git";
ls="eza -lh --group-directories-first --icons --git"; ls = "eza -lh --group-directories-first --icons --git";
clipboard="xclip -selection clipboard"; clipboard = "xclip -selection clipboard";
ll = "\\ls -lath"; ll = "\\ls -lath";
update = "sudo nixos-rebuild switch"; update = "sudo nixos-rebuild switch";
# la = "ls -lAth"; # la = "ls -lAth";

View File

@ -6,134 +6,177 @@ let
# The fetchers. fetch_<type> fetches specs of type <type>. # The fetchers. fetch_<type> fetches specs of type <type>.
# #
fetch_file = pkgs: name: spec: fetch_file =
pkgs: name: spec:
let let
name' = sanitizeName name + "-src"; name' = sanitizeName name + "-src";
in in
if spec.builtin or true then if spec.builtin or true then
builtins_fetchurl { inherit (spec) url sha256; name = name'; } builtins_fetchurl {
inherit (spec) url sha256;
name = name';
}
else else
pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; pkgs.fetchurl {
inherit (spec) url sha256;
name = name';
};
fetch_tarball = pkgs: name: spec: fetch_tarball =
pkgs: name: spec:
let let
name' = sanitizeName name + "-src"; name' = sanitizeName name + "-src";
in in
if spec.builtin or true then if spec.builtin or true then
builtins_fetchTarball { name = name'; inherit (spec) url sha256; } builtins_fetchTarball {
name = name';
inherit (spec) url sha256;
}
else else
pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; pkgs.fetchzip {
name = name';
inherit (spec) url sha256;
};
fetch_git = name: spec: fetch_git =
name: spec:
let let
ref = ref =
spec.ref or ( spec.ref or (
if spec ? branch then "refs/heads/${spec.branch}" else if spec ? branch then
if spec ? tag then "refs/tags/${spec.tag}" else "refs/heads/${spec.branch}"
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!" else if spec ? tag then
"refs/tags/${spec.tag}"
else
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"
); );
submodules = spec.submodules or false; submodules = spec.submodules or false;
submoduleArg = submoduleArg =
let let
nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0;
emptyArgWithWarning = emptyArgWithWarning =
if submodules if submodules then
then builtins.trace (
builtins.trace "The niv input \"${name}\" uses submodules "
( + "but your nix's (${builtins.nixVersion}) builtins.fetchGit "
"The niv input \"${name}\" uses submodules " + "does not support them"
+ "but your nix's (${builtins.nixVersion}) builtins.fetchGit " ) { }
+ "does not support them" else
) { };
{ }
else { };
in in
if nixSupportsSubmodules if nixSupportsSubmodules then { inherit submodules; } else emptyArgWithWarning;
then { inherit submodules; }
else emptyArgWithWarning;
in in
builtins.fetchGit builtins.fetchGit (
({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); {
url = spec.repo;
inherit (spec) rev;
inherit ref;
}
// submoduleArg
);
fetch_local = spec: spec.path; fetch_local = spec: spec.path;
fetch_builtin-tarball = name: throw fetch_builtin-tarball =
''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. name:
$ niv modify ${name} -a type=tarball -a builtin=true''; throw ''
[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
$ niv modify ${name} -a type=tarball -a builtin=true'';
fetch_builtin-url = name: throw fetch_builtin-url =
''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. name:
$ niv modify ${name} -a type=file -a builtin=true''; throw ''
[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
$ niv modify ${name} -a type=file -a builtin=true'';
# #
# Various helpers # Various helpers
# #
# https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695
sanitizeName = name: sanitizeName =
( name:
concatMapStrings (s: if builtins.isList s then "-" else s) (concatMapStrings (s: if builtins.isList s then "-" else s) (
( builtins.split "[^[:alnum:]+._?=-]+" ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
builtins.split "[^[:alnum:]+._?=-]+" ));
((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
)
);
# The set of packages used when specs are fetched using non-builtins. # The set of packages used when specs are fetched using non-builtins.
mkPkgs = sources: system: mkPkgs =
sources: system:
let let
sourcesNixpkgs = sourcesNixpkgs = import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; inherit system;
};
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
hasThisAsNixpkgsPath = <nixpkgs> == ./.; hasThisAsNixpkgsPath = <nixpkgs> == ./.;
in in
if builtins.hasAttr "nixpkgs" sources if builtins.hasAttr "nixpkgs" sources then
then sourcesNixpkgs sourcesNixpkgs
else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then else if hasNixpkgsPath && !hasThisAsNixpkgsPath then
import <nixpkgs> { } import <nixpkgs> { }
else else
abort abort ''
'' Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or add a package called "nixpkgs" to your sources.json.
add a package called "nixpkgs" to your sources.json. '';
'';
# The actual fetching function. # The actual fetching function.
fetch = pkgs: name: spec: fetch =
pkgs: name: spec:
if ! builtins.hasAttr "type" spec then if !builtins.hasAttr "type" spec then
abort "ERROR: niv spec ${name} does not have a 'type' attribute" abort "ERROR: niv spec ${name} does not have a 'type' attribute"
else if spec.type == "file" then fetch_file pkgs name spec else if spec.type == "file" then
else if spec.type == "tarball" then fetch_tarball pkgs name spec fetch_file pkgs name spec
else if spec.type == "git" then fetch_git name spec else if spec.type == "tarball" then
else if spec.type == "local" then fetch_local spec fetch_tarball pkgs name spec
else if spec.type == "builtin-tarball" then fetch_builtin-tarball name else if spec.type == "git" then
else if spec.type == "builtin-url" then fetch_builtin-url name fetch_git name spec
else if spec.type == "local" then
fetch_local spec
else if spec.type == "builtin-tarball" then
fetch_builtin-tarball name
else if spec.type == "builtin-url" then
fetch_builtin-url name
else else
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
# If the environment variable NIV_OVERRIDE_${name} is set, then use # If the environment variable NIV_OVERRIDE_${name} is set, then use
# the path directly as opposed to the fetched source. # the path directly as opposed to the fetched source.
replace = name: drv: replace =
name: drv:
let let
saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name; saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name;
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
in in
if ersatz == "" then drv else if ersatz == "" then
# this turns the string into an actual Nix path (for both absolute and drv
# relative paths) else
if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; # this turns the string into an actual Nix path (for both absolute and
# relative paths)
if builtins.substring 0 1 ersatz == "/" then
/. + ersatz
else
/. + builtins.getEnv "PWD" + "/${ersatz}";
# Ports of functions for older nix versions # Ports of functions for older nix versions
# a Nix version of mapAttrs if the built-in doesn't exist # a Nix version of mapAttrs if the built-in doesn't exist
mapAttrs = builtins.mapAttrs or ( mapAttrs =
f: set: with builtins; builtins.mapAttrs or (
listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) f: set:
); with builtins;
listToAttrs (
map (attr: {
name = attr;
value = f attr set.${attr};
}) (attrNames set)
)
);
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
range = first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1); range =
first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1);
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
@ -147,7 +190,12 @@ let
optionalAttrs = cond: as: if cond then as else { }; optionalAttrs = cond: as: if cond then as else { };
# fetchTarball version that is compatible between all the versions of Nix # fetchTarball version that is compatible between all the versions of Nix
builtins_fetchTarball = { url, name ? null, sha256 }@attrs: builtins_fetchTarball =
{
url,
name ? null,
sha256,
}@attrs:
let let
inherit (builtins) lessThan nixVersion fetchTarball; inherit (builtins) lessThan nixVersion fetchTarball;
in in
@ -157,7 +205,12 @@ let
fetchTarball attrs; fetchTarball attrs;
# fetchurl version that is compatible between all the versions of Nix # fetchurl version that is compatible between all the versions of Nix
builtins_fetchurl = { url, name ? null, sha256 }@attrs: builtins_fetchurl =
{
url,
name ? null,
sha256,
}@attrs:
let let
inherit (builtins) lessThan nixVersion fetchurl; inherit (builtins) lessThan nixVersion fetchurl;
in in
@ -167,26 +220,25 @@ let
fetchurl attrs; fetchurl attrs;
# Create the final "sources" from the config # Create the final "sources" from the config
mkSources = config: mkSources =
mapAttrs config:
( mapAttrs (
name: spec: name: spec:
if builtins.hasAttr "outPath" spec if builtins.hasAttr "outPath" spec then
then abort "The values in sources.json should not have an 'outPath' attribute"
abort else
"The values in sources.json should not have an 'outPath' attribute" spec // { outPath = replace name (fetch config.pkgs name spec); }
else ) config.sources;
spec // { outPath = replace name (fetch config.pkgs name spec); }
)
config.sources;
# The "config" used by the fetchers # The "config" used by the fetchers
mkConfig = mkConfig =
{ sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null {
, sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile) sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null,
, system ? builtins.currentSystem sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile),
, pkgs ? mkPkgs sources system system ? builtins.currentSystem,
}: rec { pkgs ? mkPkgs sources system,
}:
rec {
# The sources, i.e. the attribute set of spec name to spec # The sources, i.e. the attribute set of spec name to spec
inherit sources; inherit sources;

View File

@ -1,4 +1,3 @@
# WARN: this file will get overwritten by $ cachix use <name> # WARN: this file will get overwritten by $ cachix use <name>
{ pkgs, lib, ... }: { pkgs, lib, ... }:
@ -7,7 +6,8 @@ let
toImport = name: value: folder + ("/" + name); toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
in { in
{
inherit imports; inherit imports;
nix.settings.substituters = ["https://cache.nixos.org/"]; nix.settings.substituters = [ "https://cache.nixos.org/" ];
} }

View File

@ -1,4 +1,3 @@
{ {
nix = { nix = {
settings = { settings = {

View File

@ -5,12 +5,14 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = imports = [
[ ./hardware-configuration.nix
./hardware-configuration.nix ];
];
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# OpenRGB # OpenRGB
services.hardware.openrgb.enable = true; services.hardware.openrgb.enable = true;
@ -18,8 +20,8 @@
# Hyprland # Hyprland
programs.hyprland.enable = true; programs.hyprland.enable = true;
programs.hyprlock.enable = true; programs.hyprlock.enable = true;
programs.waybar.enable = true; # programs.waybar.enable = true;
security.pam.services.hyprlock = {}; security.pam.services.hyprlock = { };
services.gnome.gnome-keyring.enable = true; services.gnome.gnome-keyring.enable = true;
security.pam.services.hyprlock.enableGnomeKeyring = true; security.pam.services.hyprlock.enableGnomeKeyring = true;
services.greetd.enable = true; services.greetd.enable = true;
@ -27,23 +29,26 @@
default_session = { default_session = {
# GUI greeter # GUI greeter
#command = "${pkgs.greetd.gtkgreet}/bin/gtkgreet -c hyprland"; #command = "${pkgs.greetd.gtkgreet}/bin/gtkgreet -c hyprland";
command = "${pkgs.greetd.gtkgreet}/bin/gtkgreet -c 'Hyprland'"; # command = "${pkgs.greetd.gtkgreet}/bin/gtkgreet -c 'Hyprland'";
# TUI greeter # TUI greeter
# command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember \ command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember \
# --cmd 'dbus-run-session ${pkgs.hyprland}/bin/Hyprland'"; --cmd 'dbus-run-session ${pkgs.hyprland}/bin/Hyprland'";
# user = "greeter"; user = "greeter";
}; };
}; };
nix.settings = { nix.settings = {
substituters = ["https://hyprland.cachix.org"]; substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
}; };
xdg.portal = { xdg.portal = {
enable = true; enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-hyprland ]; extraPortals = with pkgs; [
xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
];
}; };
# Bootloader. # Bootloader.
@ -53,7 +58,7 @@
boot.loader.efi.efiSysMountPoint = "/boot"; boot.loader.efi.efiSysMountPoint = "/boot";
# systemd # systemd
systemd.network.wait-online.timeout = 10; systemd.network.wait-online.timeout = 5;
# Set your time zone. # Set your time zone.
time.timeZone = "America/Denver"; time.timeZone = "America/Denver";
@ -128,9 +133,9 @@
users.users.xbazzi = { users.users.xbazzi = {
isNormalUser = true; isNormalUser = true;
description = "Xander Bazzi"; description = "Xander Bazzi";
extraGroups = [ extraGroups = [
"docker" "docker"
"networkmanager" "networkmanager"
"wheel" "wheel"
"wireshark" "wireshark"
]; ];

View File

@ -1,22 +1,21 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = imports = [
[ ./configuration.nix
./configuration.nix ./fonts.nix
./fonts.nix ./ssh.nix
./ssh.nix # ./openrgb.nix
# ./openrgb.nix # ./stylix.nix
# ./stylix.nix # ./gnome.nix
# ./gnome.nix # ./lanzaboote.nix
# ./lanzaboote.nix ./yazi.nix
./yazi.nix ./nvidia.nix
./nvidia.nix ./network.nix
./network.nix ./nfs.nix
./nfs.nix ./packages.nix
./packages.nix ./services.nix
./services.nix ./vscode.nix
./vscode.nix ./cachix.nix
./cachix.nix ];
];
} }

View File

@ -1,19 +1,22 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
fonts.packages = with pkgs; [ fonts.packages =
nerd-fonts.fira-code with pkgs;
nerd-fonts.sauce-code-pro [
# nerd-fonts._Oxproto nerd-fonts.fira-code
nerd-fonts.space-mono nerd-fonts.sauce-code-pro
nerd-fonts.droid-sans-mono # nerd-fonts._Oxproto
noto-fonts-cjk-sans nerd-fonts.space-mono
noto-fonts-emoji nerd-fonts.droid-sans-mono
liberation_ttf noto-fonts-cjk-sans
fira-code-symbols noto-fonts-emoji
mplus-outline-fonts.githubRelease liberation_ttf
dina-font fira-code-symbols
proggyfonts mplus-outline-fonts.githubRelease
monaspace dina-font
] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts); proggyfonts
} monaspace
]
++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts);
}

View File

@ -8,22 +8,23 @@
# services.xserver.displayManager.gdm.enable = true; # services.xserver.displayManager.gdm.enable = true;
# services.xserver.desktopManager.gnome.enable = true; # services.xserver.desktopManager.gnome.enable = true;
environment.systemPackages = (with pkgs.gnomeExtensions; [ environment.systemPackages =
blur-my-shell (with pkgs.gnomeExtensions; [
pop-shell blur-my-shell
tactile pop-shell
pop-shell tactile
space-bar pop-shell
undecorate space-bar
pastafarian-holy-days undecorate
just-perfection pastafarian-holy-days
appindicator just-perfection
]) ++ (with pkgs; [ appindicator
#vimix-cursors ])
# breeze-icons ++ (with pkgs; [
tokyonight-gtk-theme #vimix-cursors
# gnome-tweaks # breeze-icons
# adwaita-icon-theme tokyonight-gtk-theme
]); # gnome-tweaks
# adwaita-icon-theme
]);
} }

View File

@ -1,32 +1,50 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/d1210185-1181-47af-bebc-1b07ce66ad82"; device = "/dev/disk/by-uuid/d1210185-1181-47af-bebc-1b07ce66ad82";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/F253-5DFF"; device = "/dev/disk/by-uuid/F253-5DFF";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ]; options = [
}; "fmask=0077"
"dmask=0077"
];
};
swapDevices = [{ swapDevices = [
{
device = "/dev/disk/by-uuid/e2e8a734-702b-43a7-b645-cf239309b070"; device = "/dev/disk/by-uuid/e2e8a734-702b-43a7-b645-cf239309b070";
}]; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@ -1,7 +1,7 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
sources = import ./nix/sources.nix; sources = import ./nix/sources.nix;
lanzaboote = import sources.lanzaboote; lanzaboote = import sources.lanzaboote;
in in
{ {
imports = [ lanzaboote.nixosModules.lanzaboote ]; imports = [ lanzaboote.nixosModules.lanzaboote ];
@ -16,4 +16,4 @@ in
enable = true; enable = true;
pkiBundle = "/var/lib/sbctl"; pkiBundle = "/var/lib/sbctl";
}; };
} }

View File

@ -1,21 +1,28 @@
{ inputs, config, pkgs, ... }: {
inputs,
config,
pkgs,
...
}:
{ {
# Enable networking # Enable networking
# networking.networkmanager.enable = true; # networking.networkmanager.enable = true;
# systemd.services."NetworkManager-wait-online" = { # systemd.services."NetworkManager-wait-online" = {
# serviceConfig.TimeoutStartSec = "20s"; # serviceConfig.TimeoutStartSec = "20s";
# }; # };
networking = { networking = {
useDHCP = false;
hostName = "nixos"; hostName = "nixos";
wireless.enable = false; wireless.enable = false;
interfaces.enp6s0f0 = { interfaces.enp6s0f0 = {
ipv4.addresses = [{ ipv4.addresses = [
address = "10.29.90.100"; {
prefixLength = 22; address = "10.29.90.100";
}]; prefixLength = 22;
}
];
mtu = 9000; mtu = 9000;
}; };
defaultGateway = { defaultGateway = {

View File

@ -40,6 +40,6 @@
"noauto" "noauto"
"rw" "rw"
"vers=4" "vers=4"
]; ];
}; };
} }

View File

@ -1,4 +1,9 @@
{ inputs, config, pkgs, ... }: {
inputs,
config,
pkgs,
...
}:
{ {
# NVIDIA stuff # NVIDIA stuff

View File

@ -1,33 +1,34 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ }
{ # {
# OpenRGB # OpenRGB
services.hardware.openrgb.enable = true; # services.hardware.openrgb.enable = true;
# NO RGB # # NO RGB
let # let
no-rgb = pkgs.writeScriptBin "no-rgb" '' # no-rgb = pkgs.writeScriptBin "no-rgb" ''
#!/bin/sh # #!/bin/sh
NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --noautoconnect --list-devices | grep -E '^[0-9]+: ' | wc -l) # NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --noautoconnect --list-devices | grep -E '^[0-9]+: ' | wc -l)
for i in $(seq 0 $(($NUM_DEVICES - 1))); do # for i in $(seq 0 $(($NUM_DEVICES - 1))); do
${pkgs.openrgb}/bin/openrgb --noautoconnect --device $i --mode static --color 000000 # ${pkgs.openrgb}/bin/openrgb --noautoconnect --device $i --mode static --color 000000
done # done
''; # '';
in { # in {
config = { # config = {
services.udev.packages = [ pkgs.openrgb ]; # services.udev.packages = [ pkgs.openrgb ];
boot.kernelModules = [ "i2c-dev" ]; # boot.kernelModules = [ "i2c-dev" ];
hardware.i2c.enable = true; # hardware.i2c.enable = true;
systemd.services.no-rgb = { # systemd.services.no-rgb = {
description = "no-rgb"; # description = "no-rgb";
serviceConfig = { # serviceConfig = {
ExecStart = "${no-rgb}/bin/no-rgb"; # ExecStart = "${no-rgb}/bin/no-rgb";
Type = "oneshot"; # Type = "oneshot";
}; # };
wantedBy = [ "multi-user.target" ]; # wantedBy = [ "multi-user.target" ];
}; # };
}; # };
} # }
} # }

View File

@ -5,7 +5,7 @@
ansible ansible
niv niv
sbctl sbctl
vim vim
wget wget
xournalpp xournalpp
obsidian obsidian
@ -53,6 +53,7 @@
# firefox # firefox
direnv direnv
jq jq
nixfmt
# Hyprland Ecosystem # Hyprland Ecosystem
hyprpaper hyprpaper
@ -73,7 +74,7 @@
# Allow unfree packages # Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# Install Steam # Install Steam
programs.steam = { programs.steam = {
enable = true; enable = true;

View File

@ -1,6 +1,5 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
services.openssh = { services.openssh = {

View File

@ -1,96 +1,96 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
programs.ssh.extraConfig = '' programs.ssh.extraConfig = ''
Host fw-mgmt Host fw-mgmt
HostName fw-mgmt HostName fw-mgmt
ForwardAgent yes ForwardAgent yes
User xbazzi User xbazzi
Port 22 Port 22
PubkeyAuthentication yes PubkeyAuthentication yes
IdentityFile ~/.ssh/lan_id_ed25519 IdentityFile ~/.ssh/lan_id_ed25519
IdentitiesOnly yes IdentitiesOnly yes
Host db1-mgmt Host db1-mgmt
HostName db1-mgmt HostName db1-mgmt
ForwardAgent yes ForwardAgent yes
User xbazzi User xbazzi
Port 22 Port 22
PubkeyAuthentication yes PubkeyAuthentication yes
IdentityFile ~/.ssh/lan_id_ed25519 IdentityFile ~/.ssh/lan_id_ed25519
IdentitiesOnly yes IdentitiesOnly yes
Host gitgud.foo Host gitgud.foo
HostName prod1.lan.xbazzi.com HostName prod1.lan.xbazzi.com
User git User git
Port 2222 Port 2222
PubkeyAuthentication yes PubkeyAuthentication yes
ForwardAgent yes ForwardAgent yes
IdentitiesOnly yes IdentitiesOnly yes
IdentityFile ~/.ssh/gt_id_ed25519 IdentityFile ~/.ssh/gt_id_ed25519
Host prod1 Host prod1
HostName prod1 HostName prod1
ForwardAgent yes ForwardAgent yes
Port 22222 Port 22222
User xbazzi User xbazzi
PubkeyAuthentication yes PubkeyAuthentication yes
IdentityFile ~/.ssh/lan_id_ed25519 IdentityFile ~/.ssh/lan_id_ed25519
IdentitiesOnly yes IdentitiesOnly yes
Host prod3-mgmt Host prod3-mgmt
HostName prod3-mgmt HostName prod3-mgmt
ForwardAgent yes ForwardAgent yes
Port 22 Port 22
User xbazzi User xbazzi
PubkeyAuthentication yes PubkeyAuthentication yes
IdentityFile ~/.ssh/lan_id_ed25519 IdentityFile ~/.ssh/lan_id_ed25519
IdentitiesOnly yes IdentitiesOnly yes
Host prod2-mgmt Host prod2-mgmt
HostName prod2-mgmt HostName prod2-mgmt
ForwardAgent yes ForwardAgent yes
Port 22 Port 22
User xbazzi User xbazzi
PubkeyAuthentication yes PubkeyAuthentication yes
IdentityFile ~/.ssh/lan_id_ed25519 IdentityFile ~/.ssh/lan_id_ed25519
IdentitiesOnly yes IdentitiesOnly yes
Host prod2 Host prod2
HostName prod2 HostName prod2
ForwardAgent yes ForwardAgent yes
Port 22 Port 22
User xbazzi User xbazzi
PubkeyAuthentication yes PubkeyAuthentication yes
IdentityFile ~/.ssh/lan_id_ed25519 IdentityFile ~/.ssh/lan_id_ed25519
IdentitiesOnly yes IdentitiesOnly yes
Host nas-mgmt Host nas-mgmt
HostName nas-mgmt HostName nas-mgmt
ForwardAgent yes ForwardAgent yes
User xbazzi User xbazzi
IdentityFile ~/.ssh/lan_id_ed25519 IdentityFile ~/.ssh/lan_id_ed25519
IdentitiesOnly yes IdentitiesOnly yes
Host nas Host nas
HostName nas HostName nas
ForwardAgent yes ForwardAgent yes
User xbazzi User xbazzi
IdentityFile ~/.ssh/lan_id_ed25519 IdentityFile ~/.ssh/lan_id_ed25519
IdentitiesOnly yes IdentitiesOnly yes
Host school Host school
HostName school HostName school
ForwardAgent yes ForwardAgent yes
User xbazzi User xbazzi
IdentityFile ~/.ssh/lan_id_ed25519 IdentityFile ~/.ssh/lan_id_ed25519
IdentitiesOnly yes IdentitiesOnly yes
Host ext1-mgmt Host ext1-mgmt
HostName ext1-mgmt HostName ext1-mgmt
ForwardAgent yes ForwardAgent yes
User xbazzi User xbazzi
IdentityFile ~/.ssh/lan_id_ed25519 IdentityFile ~/.ssh/lan_id_ed25519
IdentitiesOnly yes IdentitiesOnly yes
''; '';
} }

View File

@ -1,65 +1,74 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(vscode-with-extensions.override { (vscode-with-extensions.override {
vscodeExtensions = with vscode-extensions; [ vscodeExtensions =
redhat.vscode-yaml with vscode-extensions;
redhat.ansible [
bbenoist.nix redhat.vscode-yaml
ms-python.python redhat.ansible
ms-azuretools.vscode-docker ms-python.python
ms-vscode-remote.remote-ssh ms-azuretools.vscode-docker
golang.go ms-vscode-remote.remote-ssh
ms-vscode.cpptools golang.go
ms-vsliveshare.vsliveshare ms-vscode.cpptools
bbenoist.nix ms-vsliveshare.vsliveshare
ms-python.python ms-python.python
vscodevim.vim vscodevim.vim
enkia.tokyo-night enkia.tokyo-night
yzhang.markdown-all-in-one yzhang.markdown-all-in-one
vscode-icons-team.vscode-icons vscode-icons-team.vscode-icons
ms-vscode-remote.remote-containers ms-vscode-remote.remote-containers
bmewburn.vscode-intelephense-client bmewburn.vscode-intelephense-client
zxh404.vscode-proto3 jnoortheen.nix-ide
twxs.cmake zxh404.vscode-proto3
# arrterian.nix-env-selector twxs.cmake
mkhl.direnv # arrterian.nix-env-selector
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ # bbenoist.nix
{ mkhl.direnv
name = "remote-ssh-edit"; ]
publisher = "ms-vscode-remote"; ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
version = "0.47.2"; {
sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g"; name = "remote-ssh-edit";
} publisher = "ms-vscode-remote";
# { version = "0.47.2";
# name = "sukumo28.wav-preview"; sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g";
# publisher = "sukumo28"; }
# version = "2.6.0"; # {
# sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g"; # name = "sukumo28.wav-preview";
# } # publisher = "sukumo28";
# version = "2.6.0";
# { # sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g";
# name = "vsliveshare"; # }
# publisher = "ms-vsliveshare";
# version = "1.0.5948"; # replace with the latest version
# sha256 = "KOu9zF5l6MTLU8z/l4xBwRl2X3uIE15YgHEZJrKSHGY="; # replace with the calculated hash
# }
{
name = "glassit";
publisher = "s-nlf-fh";
version = "0.2.6";
#sha256 = "lcaomgk91hnjwqaw4i0fagtowr8kwv7zhvgcgkokkuy=";
sha256 = "LcAomgK91hnJWqAW4I0FAgTOwr8Kwv7ZhvGCgkokKuY=";
}
{
name = "vscode-postgres";
publisher = "ckolkman";
version = "1.4.3";
sha256 = "OCy2Nc35vmynoKxoUoTL2qyUoiByTMMPebEjySIZihQ=";
} # {
]; # name = "vsliveshare";
}) # publisher = "ms-vsliveshare";
]; # version = "1.0.5948"; # replace with the latest version
# sha256 = "KOu9zF5l6MTLU8z/l4xBwRl2X3uIE15YgHEZJrKSHGY="; # replace with the calculated hash
# }
{
name = "glassit";
publisher = "s-nlf-fh";
version = "0.2.6";
#sha256 = "lcaomgk91hnjwqaw4i0fagtowr8kwv7zhvgcgkokkuy=";
sha256 = "LcAomgK91hnJWqAW4I0FAgTOwr8Kwv7ZhvGCgkokKuY=";
}
{
name = "vscode-postgres";
publisher = "ckolkman";
version = "1.4.3";
sha256 = "OCy2Nc35vmynoKxoUoTL2qyUoiByTMMPebEjySIZihQ=";
}
];
})
];
} }