formatted nix files using alejandra
This commit is contained in:
12
flake.nix
12
flake.nix
@@ -47,13 +47,14 @@
|
||||
# Map colors from yaml to attribute set
|
||||
# Extracting colors into a set here allows them to be propagated across the entire config, with or without stylix
|
||||
lib = nixpkgs.lib;
|
||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||
pkgs = import nixpkgs {system = "x86_64-linux";};
|
||||
scheme_path = "${pkgs.base16-schemes}/share/themes/${base16scheme}.yaml";
|
||||
scheme_string = builtins.readFile scheme_path;
|
||||
scheme_list = lib.splitString "\n" "${scheme_string}";
|
||||
colors = lib.filter (line: builtins.match "^ *base[0-9A-F]{2}: .*" line != null) scheme_list;
|
||||
scheme = lib.lists.foldl' (acc: line:
|
||||
let
|
||||
scheme =
|
||||
lib.lists.foldl' (
|
||||
acc: line: let
|
||||
splitLine = lib.splitString ": " line;
|
||||
key = builtins.elemAt splitLine 0;
|
||||
value = builtins.elemAt splitLine 1;
|
||||
@@ -62,8 +63,9 @@
|
||||
cleanValue_step2 = builtins.elemAt cleanValue_step1 0;
|
||||
cleanValue_final = builtins.substring 1 (builtins.stringLength cleanValue_step2 - 2) cleanValue_step2;
|
||||
in
|
||||
acc // { "${trimmedKey}" = cleanValue_final; }
|
||||
) {} colors;
|
||||
acc // {"${trimmedKey}" = cleanValue_final;}
|
||||
) {}
|
||||
colors;
|
||||
in {
|
||||
nixosConfigurations = {
|
||||
oganesson = nixpkgs.lib.nixosSystem {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{pkgs, username, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
system.stateVersion = "24.05";
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix = {
|
||||
@@ -22,7 +26,7 @@
|
||||
users.users."${username}" = {
|
||||
shell = pkgs.zsh;
|
||||
isNormalUser = true;
|
||||
extraGroup = [ "wheel" ];
|
||||
extraGroup = ["wheel"];
|
||||
initialPassword = "1111";
|
||||
};
|
||||
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
}: {
|
||||
fonts.fontconfig.enable = true;
|
||||
home.packages = with pkgs; [
|
||||
(nerdfonts.override { fonts = [
|
||||
(nerdfonts.override {
|
||||
fonts = [
|
||||
"JetBrainsMono"
|
||||
"CascadiaCode"
|
||||
"NerdFontsSymbolsOnly"
|
||||
]; })
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
gtk = {
|
||||
|
||||
@@ -2,17 +2,18 @@
|
||||
username,
|
||||
host,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
desktop = (host == "oganesson");
|
||||
screenshot_bind = if desktop then [ # My laptop does not have a printscreen button
|
||||
}: let
|
||||
desktop = host == "oganesson";
|
||||
screenshot_bind =
|
||||
if desktop
|
||||
then [
|
||||
# My laptop does not have a printscreen button
|
||||
"super, print, exec, grimblast copy area"
|
||||
] else [
|
||||
]
|
||||
else [
|
||||
"super, insert, exec, grimblast copy area"
|
||||
];
|
||||
in
|
||||
{
|
||||
in {
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
monitor =
|
||||
@@ -168,7 +169,8 @@ in
|
||||
"workspaces, 1, 4, easeOutCubic, fade" # styles: slide, slidevert, fade, slidefade, slidefadevert
|
||||
];
|
||||
|
||||
bind = [
|
||||
bind =
|
||||
[
|
||||
"super, up, exec, pactl set-sink-volume @default_sink@ +10%"
|
||||
"super, down, exec, pactl set-sink-volume @default_sink@ -10%"
|
||||
"super, t, exec, swaync-client -t -sw"
|
||||
@@ -207,7 +209,8 @@ in
|
||||
"super shift, 6, movetoworkspace, 6"
|
||||
"super, s, togglespecialworkspace, magic"
|
||||
"super shift, s, movetoworkspace, special:magic"
|
||||
] ++ screenshot_bind;
|
||||
]
|
||||
++ screenshot_bind;
|
||||
bindm = [
|
||||
"super, mouse:272, movewindow"
|
||||
"super, mouse:273, resizewindow"
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
inputs,
|
||||
host,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
imports =
|
||||
[(import ./hyprland.nix)]
|
||||
++ [(import ./config.nix)];
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
scheme,
|
||||
wallpaper,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
}: {
|
||||
stylix = {
|
||||
enable = true;
|
||||
autoEnable = true;
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
pkgs,
|
||||
host,
|
||||
...
|
||||
}:
|
||||
let
|
||||
desktop = (host == "oganesson");
|
||||
}: let
|
||||
desktop = host == "oganesson";
|
||||
extraFigletFonts = pkgs.fetchFromGitHub {
|
||||
owner = "xero";
|
||||
repo = "figlet-fonts";
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
{
|
||||
host,
|
||||
...
|
||||
}:
|
||||
{host, ...}:
|
||||
# Grocery list:
|
||||
# Clock
|
||||
# CPU/MEM meters
|
||||
@@ -11,7 +8,7 @@ host,
|
||||
# secondary monitor will have a vertical bar on the left side
|
||||
# Can contain more info with two bars
|
||||
let
|
||||
desktop = (host == "oganesson");
|
||||
desktop = host == "oganesson";
|
||||
workspaces = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
@@ -22,22 +19,26 @@ let
|
||||
"5" = "五";
|
||||
"6" = "六";
|
||||
};
|
||||
persistent-workspaces = if desktop then {
|
||||
"HDMI-A-1" = [ 1 2 3 ];
|
||||
"DP-1" = [ 4 5 6 ];
|
||||
} else {
|
||||
"eDP-1" = [ 1 2 3 4 ];
|
||||
persistent-workspaces =
|
||||
if desktop
|
||||
then {
|
||||
"HDMI-A-1" = [1 2 3];
|
||||
"DP-1" = [4 5 6];
|
||||
}
|
||||
else {
|
||||
"eDP-1" = [1 2 3 4];
|
||||
};
|
||||
};
|
||||
monitors = if desktop then [
|
||||
monitors =
|
||||
if desktop
|
||||
then [
|
||||
"DP-1"
|
||||
"HDMI-A-1"
|
||||
] else [
|
||||
]
|
||||
else [
|
||||
"eDP-1"
|
||||
];
|
||||
|
||||
in
|
||||
{
|
||||
in {
|
||||
programs.waybar.settings.mainBar = {
|
||||
layer = "bottom";
|
||||
output = builtins.elemAt monitors 0;
|
||||
@@ -45,7 +46,10 @@ in
|
||||
name = "mainBar";
|
||||
margin-left = 8;
|
||||
margin-top = 5;
|
||||
margin-right = if desktop then 8 else 5;
|
||||
margin-right =
|
||||
if desktop
|
||||
then 8
|
||||
else 5;
|
||||
mode = "dock";
|
||||
"gtk-layer-shell" = true;
|
||||
|
||||
@@ -81,7 +85,7 @@ in
|
||||
waves = false;
|
||||
noise_reduction = 0.77;
|
||||
input_delay = 2;
|
||||
format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ];
|
||||
format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"];
|
||||
};
|
||||
|
||||
"group/hardware" = {
|
||||
@@ -121,7 +125,15 @@ in
|
||||
rotate = 270;
|
||||
format = "{icon}";
|
||||
format-icons = [
|
||||
"" "" "" "" "" "" "" "" ""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
|
||||
@@ -130,7 +142,15 @@ in
|
||||
rotate = 270;
|
||||
format = "{icon}";
|
||||
format-icons = [
|
||||
"" "" "" "" "" "" "" "" ""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
max-length = 10;
|
||||
tooltip-format = "RAM: {used:0.1f} GB / {total:0.1f} GB";
|
||||
@@ -141,7 +161,15 @@ in
|
||||
rotate = 270;
|
||||
format = "{icon}";
|
||||
format-icons = [
|
||||
"" "" "" "" "" "" "" "" ""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
tooltip-format = "CPU: {usage:0.1f}%";
|
||||
};
|
||||
@@ -182,15 +210,16 @@ in
|
||||
format = "{:%I:%M %p}";
|
||||
tooltip = false;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
# ------------------------------------------
|
||||
# ------------------------------------------
|
||||
|
||||
programs.waybar.settings.sideBar = {
|
||||
layer = "bottom";
|
||||
output = if desktop then builtins.elemAt monitors 1 else builtins.elemAt monitors 0;
|
||||
output =
|
||||
if desktop
|
||||
then builtins.elemAt monitors 1
|
||||
else builtins.elemAt monitors 0;
|
||||
position = "right";
|
||||
margin-top = 8;
|
||||
margin-right = 5;
|
||||
@@ -199,9 +228,12 @@ in
|
||||
mode = "dock";
|
||||
"gtk-layer-shell" = true;
|
||||
|
||||
modules-left = if desktop then [
|
||||
modules-left =
|
||||
if desktop
|
||||
then [
|
||||
"hyprland/workspaces"
|
||||
] else [
|
||||
]
|
||||
else [
|
||||
"group/brightness"
|
||||
"battery"
|
||||
];
|
||||
@@ -257,7 +289,15 @@ in
|
||||
tooltip-format-charging = "{capacity}%\nTil full: {time}";
|
||||
format = "{icon}";
|
||||
format-icons = [
|
||||
"" "" "" "" "" "" "" "" ""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
format-charging = "";
|
||||
};
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
{
|
||||
scheme,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
{scheme, ...}: let
|
||||
bg = {
|
||||
darkester = scheme.base00;
|
||||
darkest = scheme.base01;
|
||||
@@ -26,8 +21,7 @@ let
|
||||
color6 = scheme.base0E;
|
||||
color7 = scheme.base0F;
|
||||
};
|
||||
in
|
||||
{
|
||||
in {
|
||||
programs.waybar.style = ''
|
||||
* {
|
||||
border: none;
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
{ self, ...}:
|
||||
|
||||
{
|
||||
{self, ...}: {
|
||||
home.file.".config/neofetch/config.conf".text = ''
|
||||
username=$(whoami)
|
||||
name_length=''${#username}
|
||||
total_width=40
|
||||
side_length=$(( (total_width - name_length - 2) / 2 ))
|
||||
username=$(whoami)
|
||||
name_length=''${#username}
|
||||
total_width=40
|
||||
side_length=$(( (total_width - name_length - 2) / 2 ))
|
||||
|
||||
top_line=$(printf "─%.0s" $(seq 1 $side_length))
|
||||
top_line="$top_line $username "
|
||||
top_line+=$(printf "─%.0s" $(seq 1 $side_length))
|
||||
top_line=$(printf "─%.0s" $(seq 1 $side_length))
|
||||
top_line="$top_line $username "
|
||||
top_line+=$(printf "─%.0s" $(seq 1 $side_length))
|
||||
|
||||
if (( (total_width - name_length) % 2 != 0 )); then
|
||||
if (( (total_width - name_length) % 2 != 0 )); then
|
||||
top_line+="─"
|
||||
fi
|
||||
fi
|
||||
|
||||
print_info() {
|
||||
print_info() {
|
||||
prin "┌$top_line┐"
|
||||
info " " distro
|
||||
info " " kernel
|
||||
@@ -26,86 +24,86 @@ print_info() {
|
||||
info " " packages
|
||||
prin "└────────────────────────────────────────┘"
|
||||
info cols
|
||||
prin "\n \n \n \n \n ''${cl3} \n \n ''${cl5} \n \n ''${cl2} \n \n ''${cl6} \n \n ''${cl4} \n \n ''${cl1} \n \n ''${cl7} \n \n ''${cl0}"
|
||||
}
|
||||
prin "\n \n \n \n \n ''${cl3} \n \n ''${cl5} \n \n ''${cl2} \n \n ''${cl6} \n \n ''${cl4} \n \n ''${cl1} \n \n ''${cl7} \n \n ''${cl0}"
|
||||
}
|
||||
|
||||
kernel_shorthand="on"
|
||||
distro_shorthand="on"
|
||||
os_arch="off"
|
||||
uptime_shorthand="on"
|
||||
memory_percent="on"
|
||||
package_managers="off"
|
||||
shell_path="off"
|
||||
shell_version="on"
|
||||
speed_type="bios_limit"
|
||||
speed_shorthand="on"
|
||||
gtk_shorthand="on"
|
||||
gtk2="on"
|
||||
gtk3="on"
|
||||
colors=(distro)
|
||||
bold="on"
|
||||
underline_enabled="on"
|
||||
underline_char="-"
|
||||
separator=" "
|
||||
color_blocks="off"
|
||||
block_range=(0 15) # Colorblocks
|
||||
kernel_shorthand="on"
|
||||
distro_shorthand="on"
|
||||
os_arch="off"
|
||||
uptime_shorthand="on"
|
||||
memory_percent="on"
|
||||
package_managers="off"
|
||||
shell_path="off"
|
||||
shell_version="on"
|
||||
speed_type="bios_limit"
|
||||
speed_shorthand="on"
|
||||
gtk_shorthand="on"
|
||||
gtk2="on"
|
||||
gtk3="on"
|
||||
colors=(distro)
|
||||
bold="on"
|
||||
underline_enabled="on"
|
||||
underline_char="-"
|
||||
separator=" "
|
||||
color_blocks="off"
|
||||
block_range=(0 15) # Colorblocks
|
||||
|
||||
# Colors for custom colorblocks
|
||||
magenta="\033[1;35m"
|
||||
green="\033[1;32m"
|
||||
white="\033[1;37m"
|
||||
blue="\033[1;34m"
|
||||
red="\033[1;31m"
|
||||
black="\033[1;40;30m"
|
||||
yellow="\033[1;33m"
|
||||
cyan="\033[1;36m"
|
||||
reset="\033[0m"
|
||||
bgyellow="\033[1;43;33m"
|
||||
bgwhite="\033[1;47;37m"
|
||||
cl0="''${reset}"
|
||||
cl1="''${magenta}"
|
||||
cl2="''${green}"
|
||||
cl3="''${white}"
|
||||
cl4="''${blue}"
|
||||
cl5="''${red}"
|
||||
cl6="''${yellow}"
|
||||
cl7="''${cyan}"
|
||||
cl8="''${black}"
|
||||
cl9="''${bgyellow}"
|
||||
cl10="''${bgwhite}"
|
||||
# Colors for custom colorblocks
|
||||
magenta="\033[1;35m"
|
||||
green="\033[1;32m"
|
||||
white="\033[1;37m"
|
||||
blue="\033[1;34m"
|
||||
red="\033[1;31m"
|
||||
black="\033[1;40;30m"
|
||||
yellow="\033[1;33m"
|
||||
cyan="\033[1;36m"
|
||||
reset="\033[0m"
|
||||
bgyellow="\033[1;43;33m"
|
||||
bgwhite="\033[1;47;37m"
|
||||
cl0="''${reset}"
|
||||
cl1="''${magenta}"
|
||||
cl2="''${green}"
|
||||
cl3="''${white}"
|
||||
cl4="''${blue}"
|
||||
cl5="''${red}"
|
||||
cl6="''${yellow}"
|
||||
cl7="''${cyan}"
|
||||
cl8="''${black}"
|
||||
cl9="''${bgyellow}"
|
||||
cl10="''${bgwhite}"
|
||||
|
||||
block_width=4
|
||||
block_height=1
|
||||
block_width=4
|
||||
block_height=1
|
||||
|
||||
bar_char_elapsed="-"
|
||||
bar_char_total="="
|
||||
bar_border="on"
|
||||
bar_length=15
|
||||
bar_color_elapsed="distro"
|
||||
bar_color_total="distro"
|
||||
bar_char_elapsed="-"
|
||||
bar_char_total="="
|
||||
bar_border="on"
|
||||
bar_length=15
|
||||
bar_color_elapsed="distro"
|
||||
bar_color_total="distro"
|
||||
|
||||
cpu_display="on"
|
||||
memory_display="on"
|
||||
battery_display="on"
|
||||
disk_display="on"
|
||||
cpu_display="on"
|
||||
memory_display="on"
|
||||
battery_display="on"
|
||||
disk_display="on"
|
||||
|
||||
image_backend="kitty"
|
||||
image_source="${self}/assets/images/nixos-logo.png"
|
||||
image_size="250px"
|
||||
image_loop="off"
|
||||
image_backend="kitty"
|
||||
image_source="${self}/assets/images/nixos-logo.png"
|
||||
image_size="250px"
|
||||
image_loop="off"
|
||||
|
||||
aascii_distro="auto"
|
||||
ascii_colors=(distro)
|
||||
ascii_bold="on"
|
||||
aascii_distro="auto"
|
||||
ascii_colors=(distro)
|
||||
ascii_bold="on"
|
||||
|
||||
crop_mode="normal"
|
||||
crop_offset="center"
|
||||
crop_mode="normal"
|
||||
crop_offset="center"
|
||||
|
||||
gap=2
|
||||
gap=2
|
||||
|
||||
yoffset=0
|
||||
xoffset=0
|
||||
yoffset=0
|
||||
xoffset=0
|
||||
|
||||
stdout="off"
|
||||
stdout="off"
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
home-manager,
|
||||
...
|
||||
}: let
|
||||
desktop = (host == "onagesson");
|
||||
desktop = host == "onagesson";
|
||||
desktop_modules =
|
||||
if desktop
|
||||
then [(import ./gaming)]
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
{pkgs, scheme, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
scheme,
|
||||
...
|
||||
}: {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
|
||||
|
||||
settings = {
|
||||
confirm_os_window_close = 0;
|
||||
window_padding_width = 4;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "toolbelt" ''
|
||||
hostname=$(cat /etc/hostname)
|
||||
hostname=$(cat /etc/hostname)
|
||||
|
||||
cliphistory() {
|
||||
cliphistory() {
|
||||
selection=$(cliphist list | fzf --preview="
|
||||
index=\$(echo {} | awk '{print \$1}'); \
|
||||
mime=\$(cliphist decode \$index | file -i -); \
|
||||
@@ -14,8 +13,8 @@ cliphistory() {
|
||||
fi" --prompt="> " | awk '{print $1}')
|
||||
[ -z "$selection" ] && return 1
|
||||
cliphist decode "$selection" | wl-copy
|
||||
}
|
||||
btop_cmd() {
|
||||
}
|
||||
btop_cmd() {
|
||||
if [ "$hostname" = 'oganesson' ]; then
|
||||
hyprctl dispatch resizeactive 20% 140% &&
|
||||
moveonscreen --center &&
|
||||
@@ -29,48 +28,48 @@ btop_cmd() {
|
||||
hyprctl dispatch resizeactive exact 40% 25% &&
|
||||
moveonscreen
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
running=true
|
||||
running=true
|
||||
|
||||
declare -A commands=(
|
||||
declare -A commands=(
|
||||
["Change Wallpaper"]="moveonscreen --center && if chpaper; then running=false; else moveonscreen; fi"
|
||||
["Change System Color Scheme"]="hyprctl dispatch resizeactive 10% 80% && moveonscreen --center && if chscheme; then running=false; else hyprctl dispatch resizeactive exact 40% 25% && moveonscreen; fi"
|
||||
["Open System Monitor"]="hyprctl dispatch resizeactive 20% 140% && moveonscreen --center && btop_cmd && hyprctl dispatch resizeactive exact 40% 25% && moveonscreen"
|
||||
["Open Volume Controls"]="hyprctl dispatch resizeactive 10% 80% && moveonscreen --center && alsamixer && hyprctl dispatch resizeactive exact 40% 25% && moveonscreen"
|
||||
["Open Keyring"]="hyprctl dispatch resizeactive -300 0 && moveonscreen && if keyring; then running=false; else hyprctl dispatch resizeactive exact 40% 25% && moveonscreen; fi"
|
||||
["View Clipboard History"]="hyprctl dispatch resizeactive 45% 120% && moveonscreen --center && if cliphistory;then running=false; else hyprctl dispatch resizeactive exact 40% 25% && moveonscreen; fi"
|
||||
)
|
||||
)
|
||||
|
||||
ordered_commands=(
|
||||
ordered_commands=(
|
||||
"Open Keyring"
|
||||
"Open System Monitor"
|
||||
"Open Volume Controls"
|
||||
"Change Wallpaper"
|
||||
"Change System Color Scheme"
|
||||
"View Clipboard History"
|
||||
)
|
||||
)
|
||||
|
||||
# Use fzf to select a command with preview
|
||||
while $running; do
|
||||
selected_command=$(printf "%s\n" "''${ordered_commands[@]}" | fzf --preview="
|
||||
cleaned_key=\$(echo {} | tr -d \"'\"); \
|
||||
echo \"Cleaned key: \$cleaned_key\"; \
|
||||
declare -A descriptions=(
|
||||
# Use fzf to select a command with preview
|
||||
while $running; do
|
||||
selected_command=$(printf "%s\n" "''${ordered_commands[@]}" | fzf --preview="
|
||||
cleaned_key=\$(echo {} | tr -d \"'\"); \
|
||||
echo \"Cleaned key: \$cleaned_key\"; \
|
||||
declare -A descriptions=(
|
||||
[\"Change Wallpaper\"]=\"Choose a wallpaper to switch to from the assets/wallpapers folder in the system flake directory. Requires rebuilding the system and restarting hyprpaper.\"
|
||||
[\"Change System Color Scheme\"]=\"Changes the base16 color scheme used by stylix to color system applications.\"
|
||||
[\"Open System Monitor\"]=\"Opens a btop window.\"
|
||||
[\"Open Volume Controls\"]=\"Opens alsamixer.\"
|
||||
[\"Open Keyring\"]=\"Opens a fuzzy finder with all of the paths held in ~/.password-store. Selecting one uses pass to copy that password to the clipboard. Password is cleared from clipboard history after 45 seconds.\"
|
||||
[\"View Clipboard History\"]=\"Opens clipboard history. Selecting an item copies it to the clipboard.\"
|
||||
); \
|
||||
if [[ -v descriptions[\$cleaned_key] ]]; then \
|
||||
); \
|
||||
if [[ -v descriptions[\$cleaned_key] ]]; then \
|
||||
clear; \
|
||||
echo \''${descriptions[\$cleaned_key]} | fmt -w 28; \
|
||||
else \
|
||||
else \
|
||||
clear; \
|
||||
echo \"No description available\"; \
|
||||
fi" --prompt="> ")
|
||||
fi" --prompt="> ")
|
||||
|
||||
|
||||
#Execute the selected command if selection is not empty
|
||||
@@ -79,5 +78,5 @@ fi" --prompt="> ")
|
||||
else
|
||||
running=false
|
||||
fi
|
||||
done
|
||||
done
|
||||
''
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
{
|
||||
pkgs,
|
||||
}:
|
||||
|
||||
{pkgs}:
|
||||
pkgs.writeShellScriptBin "viconf" ''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
@@ -41,15 +41,15 @@
|
||||
self = self;
|
||||
pkgs = pkgs;
|
||||
};
|
||||
moveonscreen = import ./wm-controls/moveonscreen.nix { pkgs = pkgs; };
|
||||
toolbelt = import ./commands/toolbelt.nix { pkgs = pkgs; };
|
||||
moveonscreen = import ./wm-controls/moveonscreen.nix {pkgs = pkgs;};
|
||||
toolbelt = import ./commands/toolbelt.nix {pkgs = pkgs;};
|
||||
viconf = import ./commands/viconf.nix {
|
||||
pkgs = pkgs;
|
||||
};
|
||||
chscheme = import ./wm-controls/chscheme.nix {
|
||||
pkgs = pkgs;
|
||||
};
|
||||
chpaper = import ./wm-controls/chpaper.nix { pkgs = pkgs; };
|
||||
chpaper = import ./wm-controls/chpaper.nix {pkgs = pkgs;};
|
||||
in {
|
||||
home.packages = [
|
||||
chpaper
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{ pkgs }:
|
||||
|
||||
{pkgs}:
|
||||
pkgs.writeShellScriptBin "chpaper" ''
|
||||
paper="$\{self}/assets/wallpapers/$(find "$FLAKEPATH"/assets/wallpapers -exec basename {} \; | rg "\.\w+$" | fzf --preview "chafa -s 30x40 $FLAKEPATH/assets/wallpapers/{}")"
|
||||
[ "$paper" = "$\{self}/assets/wallpapers/" ] && echo "Cancelling wallpaper change" && exit 1
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
{
|
||||
pkgs,
|
||||
}:
|
||||
{pkgs}:
|
||||
pkgs.writeShellScriptBin "chscheme" ''
|
||||
selected_scheme=$(/usr/bin/env ls "$(nix-build '<nixpkgs>' -A base16-schemes)"/share/themes | \
|
||||
selected_scheme=$(/usr/bin/env ls "$(nix-build '<nixpkgs>' -A base16-schemes)"/share/themes | \
|
||||
sed 's/\.yaml//g' | \
|
||||
fzf --preview 'cat $(nix-build "<nixpkgs>" -A base16-schemes)/share/themes/{}.yaml | \
|
||||
while IFS=": " read -r key value; do \
|
||||
@@ -15,19 +13,19 @@ selected_scheme=$(/usr/bin/env ls "$(nix-build '<nixpkgs>' -A base16-schemes)"/s
|
||||
fi; \
|
||||
done')
|
||||
|
||||
if [[ -z "$selected_scheme" ]]; then
|
||||
if [[ -z "$selected_scheme" ]]; then
|
||||
echo "Aborting color scheme change."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$selected_scheme" | xargs -I {} sed -i '/base16scheme\s*=\s*"/s/"[^"]*"/"{}"/' "$FLAKEPATH"/flake.nix
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$selected_scheme" | xargs -I {} sed -i '/base16scheme\s*=\s*"/s/"[^"]*"/"{}"/' "$FLAKEPATH"/flake.nix
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to change color scheme."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Successfully changed system color scheme. Rebuild now?"
|
||||
select choice in "Yes" "No"; do
|
||||
echo "Successfully changed system color scheme. Rebuild now?"
|
||||
select choice in "Yes" "No"; do
|
||||
case $choice in
|
||||
"Yes")
|
||||
rebuild
|
||||
@@ -38,5 +36,5 @@ select choice in "Yes" "No"; do
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
''
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
{ pkgs }:
|
||||
|
||||
{pkgs}:
|
||||
pkgs.writeShellScriptBin "moveonscreen" ''
|
||||
center_window=false
|
||||
if [[ $1 == "--center" ]]; then
|
||||
center_window=false
|
||||
if [[ $1 == "--center" ]]; then
|
||||
center_window=true
|
||||
fi
|
||||
fi
|
||||
|
||||
cursor_pos=$(hyprctl cursorpos | sed 's/,//')
|
||||
cursor_x=$(echo "$cursor_pos" | awk '{print $1}')
|
||||
cursor_y=$(echo "$cursor_pos" | awk '{print $2}')
|
||||
cursor_pos=$(hyprctl cursorpos | sed 's/,//')
|
||||
cursor_x=$(echo "$cursor_pos" | awk '{print $1}')
|
||||
cursor_y=$(echo "$cursor_pos" | awk '{print $2}')
|
||||
|
||||
|
||||
window_info=$(hyprctl activewindow -j)
|
||||
window_width=$(echo "$window_info" | jq ".size[0]")
|
||||
window_height=$(echo "$window_info" | jq ".size[1]")
|
||||
window_info=$(hyprctl activewindow -j)
|
||||
window_width=$(echo "$window_info" | jq ".size[0]")
|
||||
window_height=$(echo "$window_info" | jq ".size[1]")
|
||||
|
||||
|
||||
if [ "$center_window" = true ]; then
|
||||
if [ "$center_window" = true ]; then
|
||||
cursor_x=$((cursor_x - window_width / 2))
|
||||
cursor_y=$((cursor_y - window_height / 2))
|
||||
|
||||
@@ -26,17 +25,17 @@ if [ "$center_window" = true ]; then
|
||||
if (( cursor_y < 54 )); then
|
||||
cursor_y=54
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
monitors=$(hyprctl monitors -j)
|
||||
monitors=$(hyprctl monitors -j)
|
||||
|
||||
monitor_x_min=0
|
||||
monitor_x_max=0
|
||||
monitor_y_min=0
|
||||
monitor_y_max=0
|
||||
focused_monitor=-1
|
||||
monitor_x_min=0
|
||||
monitor_x_max=0
|
||||
monitor_y_min=0
|
||||
monitor_y_max=0
|
||||
focused_monitor=-1
|
||||
|
||||
for ((i = 0; i < $(echo "$monitors" | jq 'length'); i++)); do
|
||||
for ((i = 0; i < $(echo "$monitors" | jq 'length'); i++)); do
|
||||
mon_x=$(echo "$monitors" | jq ".[$i].x")
|
||||
mon_y=$(echo "$monitors" | jq ".[$i].y")
|
||||
mon_width=$(echo "$monitors" | jq ".[$i].width")
|
||||
@@ -51,27 +50,27 @@ for ((i = 0; i < $(echo "$monitors" | jq 'length'); i++)); do
|
||||
focused_monitor=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if [ "$focused_monitor" -eq -1 ]; then
|
||||
if [ "$focused_monitor" -eq -1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if (( cursor_x < monitor_x_min )); then
|
||||
if (( cursor_x < monitor_x_min )); then
|
||||
adjusted_x=$monitor_x_min
|
||||
elif (( cursor_x + window_width > monitor_x_max )); then
|
||||
elif (( cursor_x + window_width > monitor_x_max )); then
|
||||
adjusted_x=$((monitor_x_max - window_width))
|
||||
else
|
||||
else
|
||||
adjusted_x=$cursor_x
|
||||
fi
|
||||
fi
|
||||
|
||||
if (( cursor_y < monitor_y_min )); then
|
||||
if (( cursor_y < monitor_y_min )); then
|
||||
adjusted_y=$monitor_y_min
|
||||
elif (( cursor_y + window_height > monitor_y_max )); then
|
||||
elif (( cursor_y + window_height > monitor_y_max )); then
|
||||
adjusted_y=$((monitor_y_max - window_height))
|
||||
else
|
||||
else
|
||||
adjusted_y=$cursor_y
|
||||
fi
|
||||
fi
|
||||
|
||||
hyprctl dispatch moveactive exact "$adjusted_x $adjusted_y" > /dev/null 2>&1
|
||||
hyprctl dispatch moveactive exact "$adjusted_x $adjusted_y" > /dev/null 2>&1
|
||||
''
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
{config,inputs,scheme,wallpaper,username,...}:
|
||||
|
||||
{}
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
scheme,
|
||||
wallpaper,
|
||||
username,
|
||||
...
|
||||
}: {}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{ config, pkgs, username, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
systemd.user.tmpfiles.users."${username}".rules = [
|
||||
"d /home/${username}/media 0770 ${username} users -"
|
||||
"d /home/${username}/backup 0770 ${username} users -"
|
||||
@@ -10,6 +13,4 @@
|
||||
"d /home/${username}/inbox 0770 ${username} users -"
|
||||
"d /home/${username}/outbox 0770 ${username} users -"
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -14,4 +14,3 @@
|
||||
../home/home-manager.nix
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
{...}: {
|
||||
environment.etc."issue".text = ''
|
||||
|
||||
\e[38;5;27m▓▓▓▓ \e[38;5;81m▒▒▒▒ ▒▒▒▒
|
||||
@@ -27,5 +25,5 @@
|
||||
|
||||
Run '\e[1;35mnixos-help\e[0m' for the NixOS manual.
|
||||
Run '\e[1;35mHyprland\e[0m' to enter the desktop environment.
|
||||
'';
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
environment.systemPackages = [(
|
||||
environment.systemPackages = [
|
||||
(
|
||||
pkgs.catppuccin-sddm.override {
|
||||
flavor = "mocha";
|
||||
font = "JetBrains Mono Nerd Font";
|
||||
@@ -12,7 +13,8 @@
|
||||
loginBackground = true;
|
||||
background = "${self}/assets/wallpapers/dark-waves.jpg";
|
||||
}
|
||||
)];
|
||||
)
|
||||
];
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
scheme,
|
||||
wallpaper,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
}: {
|
||||
stylix = {
|
||||
enable = true;
|
||||
base16Scheme = scheme;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
{
|
||||
inputs,
|
||||
nixpkgs,
|
||||
@@ -10,7 +9,6 @@
|
||||
...
|
||||
}: {
|
||||
imports =
|
||||
[( import ./bootloader.nix )]
|
||||
++ [( import ./network.nix )];
|
||||
[(import ./bootloader.nix)]
|
||||
++ [(import ./network.nix)];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
{host, ...}:
|
||||
let
|
||||
desktop = (host == "oganesson");
|
||||
in
|
||||
{
|
||||
{host, ...}: let
|
||||
desktop = host == "oganesson";
|
||||
in {
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
hostName =
|
||||
|
||||
@@ -6,14 +6,13 @@
|
||||
username,
|
||||
host,
|
||||
...
|
||||
}:
|
||||
let
|
||||
desktop = (host == "oganesson");
|
||||
desktop_modules = if desktop then
|
||||
[(import ./virtualization.nix)] ++ [(import ./gaming)]
|
||||
}: let
|
||||
desktop = host == "oganesson";
|
||||
desktop_modules =
|
||||
if desktop
|
||||
then [(import ./virtualization.nix)] ++ [(import ./gaming)]
|
||||
else [];
|
||||
in
|
||||
{
|
||||
in {
|
||||
imports =
|
||||
[(import ./packages.nix)]
|
||||
++ [(import ./programs.nix)]
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
{...}: {
|
||||
imports =
|
||||
[(import ./steam.nix)]
|
||||
++ [(import ./gaming_pkgs.nix)];
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
snes9x-gtk
|
||||
];
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{ scheme, config, ... }:
|
||||
|
||||
{
|
||||
scheme,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
programs.nixvim = {
|
||||
colorschemes.base16 = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }: {
|
||||
{pkgs, ...}: {
|
||||
programs.nixvim = {
|
||||
extraPlugins = [
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{pkgs, ...}: {
|
||||
{...}: {
|
||||
services = {
|
||||
pipewire = {
|
||||
enable = true;
|
||||
@@ -11,6 +11,9 @@
|
||||
dbus.enable = true;
|
||||
mullvad-vpn.enable = true;
|
||||
blueman.enable = true;
|
||||
openssh.enable = true;
|
||||
openssh = {
|
||||
enable = true;
|
||||
allowSFTP = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user