mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
Formated with alejandra
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
url = "github:nix-community/home-manager/release-25.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
caelestia-shell = { # based on quickshell. See https://github.com/caelestia-dots/shell
|
||||
caelestia-shell = {
|
||||
# based on quickshell. See https://github.com/caelestia-dots/shell
|
||||
url = "github:caelestia-dots/shell";
|
||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
|
||||
@@ -8,10 +8,7 @@
|
||||
libs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
|
||||
{
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
@@ -23,8 +20,7 @@
|
||||
../../modules/nixos/udevsimple.nix
|
||||
];
|
||||
|
||||
|
||||
programs.nix-ld.enable=true; #Run unpatched dynamic binaries on NixOS. For example lets run ./a.out from gcc
|
||||
programs.nix-ld.enable = true; #Run unpatched dynamic binaries on NixOS. For example lets run ./a.out from gcc
|
||||
|
||||
documentation.man.generateCaches = true; # used for the man script
|
||||
|
||||
@@ -83,12 +79,13 @@
|
||||
# zsh dont want to work if it is not initialzed here.
|
||||
programs.zsh.enable = true;
|
||||
|
||||
security.wrappers.gsr-kms-server = { # to remove the password prompt when using gpu-screen-recorder
|
||||
security.wrappers.gsr-kms-server = {
|
||||
# to remove the password prompt when using gpu-screen-recorder
|
||||
owner = "root";
|
||||
group = "root";
|
||||
capabilities = "cap_sys_admin+ep";
|
||||
source = "${pkgs.gpu-screen-recorder}/bin/gsr-kms-server";
|
||||
};
|
||||
};
|
||||
|
||||
# Enable the GNOME Desktop Environment.
|
||||
# services.displayManager.gdm.enable = true;
|
||||
@@ -160,7 +157,6 @@
|
||||
options = "--delete-older-than 7d"; # every week delete generations older than a month
|
||||
};
|
||||
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true; # Nonfree packages: Obsidian
|
||||
|
||||
@@ -221,9 +217,10 @@
|
||||
framework-tool
|
||||
framework-tool-tui
|
||||
krita # image edition
|
||||
yt-dlp# some youtube downloader
|
||||
yt-dlp # some youtube downloader
|
||||
vlc
|
||||
(pkgs-unstable.python314.withPackages (ps: with ps; [
|
||||
(pkgs-unstable.python314.withPackages (ps:
|
||||
with ps; [
|
||||
matplotlib
|
||||
networkx
|
||||
scipy
|
||||
@@ -234,7 +231,8 @@
|
||||
# utils for dev
|
||||
pkg-config
|
||||
gdb
|
||||
raylib glfw # raylib and some dependecies
|
||||
raylib
|
||||
glfw # raylib and some dependecies
|
||||
rembg # background remover
|
||||
#some nix tools
|
||||
manix
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#../../modules/home-manager/quickshell.nix # used for widgets, waybar and notifications # i migrated to caelestia-shell
|
||||
inputs.caelestia-shell.homeManagerModules.default
|
||||
../../modules/home-manager/caelestia.nix # caelestia shell is based on quickshell
|
||||
#../../modules/home-manager/oh-my-posh.nix # zsh customizer
|
||||
#../../modules/home-manager/oh-my-posh.nix # zsh customizer
|
||||
../../modules/home-manager/oh-my-zsh.nix # another zsh customizer
|
||||
#../../modules/home-manager/hypridle.nix
|
||||
#../../modules/home-manager/swaylock.nix
|
||||
@@ -88,11 +88,12 @@
|
||||
#(pkgs.callPackage ../../modules/scripts/QSsysinfo.nix {})
|
||||
#(pkgs.callPackage ../../modules/scripts/QSnotifycache.nix {})
|
||||
#(pkgs.callPackage ../../modules/scripts/QSnotifyhistory.nix {})
|
||||
#pkgs
|
||||
#pkgs
|
||||
pkgs.gruvbox-gtk-theme
|
||||
pkgs.biber
|
||||
(pkgs.texliveMedium.withPackages (
|
||||
ps: with ps; [
|
||||
ps:
|
||||
with ps; [
|
||||
# these few pkgs are used in the CV template
|
||||
titlesec # allows creating custom \section
|
||||
marvosym # some symboles
|
||||
@@ -125,7 +126,8 @@
|
||||
footmisc
|
||||
#(setq org-latex-compiler "lualatex")
|
||||
#(setq org-preview-latex-default-process 'dvisvgm)
|
||||
]))
|
||||
]
|
||||
))
|
||||
# # It is sometimes useful to fine-tune packages, for example, by applying
|
||||
# # overrides. You can do that directly here, just don't forget the
|
||||
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
pkgs-unstable,
|
||||
caelestia-shell,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
sisyphe = ../../assets/sisyphe.gif;
|
||||
pepe-music = ../../assets/pepe-music.gif;
|
||||
in {
|
||||
|
||||
home.file.".face" = { # this is were caelestia will search for profiles pictures
|
||||
home.file.".face" = {
|
||||
# this is were caelestia will search for profiles pictures
|
||||
source = ../../assets/sisyphePFP.png;
|
||||
};
|
||||
# set profile picture in ~/.face
|
||||
@@ -21,7 +20,8 @@ in {
|
||||
target = "graphical-session.target";
|
||||
environment = [];
|
||||
};
|
||||
settings = { # default config https://github.com/caelestia-dots/shell?tab=readme-ov-file#example-configuration
|
||||
settings = {
|
||||
# default config https://github.com/caelestia-dots/shell?tab=readme-ov-file#example-configuration
|
||||
appearance = {
|
||||
mediaGifSpeedAdjustment = 500;
|
||||
sessionGifSpeed = 0.7;
|
||||
@@ -30,7 +30,8 @@ in {
|
||||
scale = 1;
|
||||
};
|
||||
};
|
||||
/*font = {
|
||||
/*
|
||||
font = {
|
||||
family = {
|
||||
clock = "Rubik"; # (TODO figure out those fonts)
|
||||
material = "Material Symboles Rounded";
|
||||
@@ -40,7 +41,8 @@ in {
|
||||
size = {
|
||||
scale = 1;
|
||||
};
|
||||
};*/
|
||||
};
|
||||
*/
|
||||
padding = {
|
||||
scale = 1;
|
||||
};
|
||||
@@ -59,10 +61,10 @@ in {
|
||||
general = {
|
||||
logo = "caelestia";
|
||||
apps = {
|
||||
terminal = [ "kitty" ]; # default foot
|
||||
audio = [ "pavucontrol" ];
|
||||
playback = [ "mpv" ]; # what's that?
|
||||
explorer = [ "nautilus" ]; # default thunar
|
||||
terminal = ["kitty"]; # default foot
|
||||
audio = ["pavucontrol"];
|
||||
playback = ["mpv"]; # what's that?
|
||||
explorer = ["nautilus"]; # default thunar
|
||||
};
|
||||
battery = {
|
||||
wanLevels = [
|
||||
@@ -103,7 +105,7 @@ in {
|
||||
}
|
||||
{
|
||||
timeout = 600;
|
||||
idleAction = [ "systemctl" "suspend-then-hibernate" ];
|
||||
idleAction = ["systemctl" "suspend-then-hibernate"];
|
||||
}
|
||||
];
|
||||
};
|
||||
@@ -235,7 +237,7 @@ in {
|
||||
}
|
||||
];
|
||||
};
|
||||
excludedScreens = [ "" ]; # default says "" those this work?
|
||||
excludedScreens = [""]; # default says "" those this work?
|
||||
};
|
||||
border = {
|
||||
rounding = 25;
|
||||
@@ -254,7 +256,7 @@ in {
|
||||
name = "Calculator";
|
||||
icon = "calculate";
|
||||
description = "Do simple math equations (powered by Qalc)";
|
||||
command = [ "autocomplete" "calc" ];
|
||||
command = ["autocomplete" "calc"];
|
||||
enabled = false; # default true
|
||||
dangerous = false;
|
||||
}
|
||||
@@ -262,7 +264,7 @@ in {
|
||||
name = "Scheme";
|
||||
icon = "palette";
|
||||
description = "Change the current colour scheme";
|
||||
command = [ "autocomplete" "scheme" ];
|
||||
command = ["autocomplete" "scheme"];
|
||||
enabled = false; # default true
|
||||
dangerous = false;
|
||||
}
|
||||
@@ -270,7 +272,7 @@ in {
|
||||
name = "Wallpaper";
|
||||
icon = "image";
|
||||
description = "Change the current wallpaper";
|
||||
command = [ "autocomplete" "wallpaper" ];
|
||||
command = ["autocomplete" "wallpaper"];
|
||||
enabled = false; # default true
|
||||
dangerous = false;
|
||||
}
|
||||
@@ -278,7 +280,7 @@ in {
|
||||
name = "Variant"; # to remove
|
||||
icon = "colors";
|
||||
description = "Change the current scheme variant";
|
||||
command = [ "autocomplete" "variant" ];
|
||||
command = ["autocomplete" "variant"];
|
||||
enabled = true;
|
||||
dangerous = false;
|
||||
}
|
||||
@@ -286,7 +288,7 @@ in {
|
||||
name = "Transparency";
|
||||
icon = "opacity";
|
||||
description = "Change shell transparency";
|
||||
command = [ "autocomplete" "transparency" ];
|
||||
command = ["autocomplete" "transparency"];
|
||||
enabled = false;
|
||||
dangerous = false;
|
||||
}
|
||||
@@ -294,7 +296,7 @@ in {
|
||||
name = "Random";
|
||||
icon = "casino";
|
||||
description = "Switch to a random wallpaper";
|
||||
command = [ "caelestia" "wallpaper" "-r" ];
|
||||
command = ["caelestia" "wallpaper" "-r"];
|
||||
enabled = false; # default true
|
||||
dangerous = false;
|
||||
}
|
||||
@@ -302,7 +304,7 @@ in {
|
||||
name = "Light";
|
||||
icon = "light_mode";
|
||||
description = "Change the scheme to light mode";
|
||||
command = [ "setMode" "light" ];
|
||||
command = ["setMode" "light"];
|
||||
enabled = false; # default true
|
||||
dangerous = false;
|
||||
}
|
||||
@@ -310,7 +312,7 @@ in {
|
||||
name = "Dark";
|
||||
icon = "dark_mode";
|
||||
description = "Change the scheme to dark mode";
|
||||
command = [ "setMode" "dark" ];
|
||||
command = ["setMode" "dark"];
|
||||
enabled = false; # default true
|
||||
dangerous = false;
|
||||
}
|
||||
@@ -318,7 +320,7 @@ in {
|
||||
name = "Shutdown";
|
||||
icon = "power_settings_new";
|
||||
description = "Shutdown the system";
|
||||
command = [ "systemctl" "poweroff" ];
|
||||
command = ["systemctl" "poweroff"];
|
||||
enabled = true;
|
||||
dangerous = true;
|
||||
}
|
||||
@@ -326,7 +328,7 @@ in {
|
||||
name = "Reboot";
|
||||
icon = "cached";
|
||||
description = "Reboot the system";
|
||||
command = [ "systemctl" "reboot" ];
|
||||
command = ["systemctl" "reboot"];
|
||||
enabled = true;
|
||||
dangerous = true;
|
||||
}
|
||||
@@ -334,7 +336,7 @@ in {
|
||||
name = "Lock"; # does this work with ly?
|
||||
icon = "lock";
|
||||
description = "Log out of the current session";
|
||||
command = [ "loginctl" "terminate-user" "" ];
|
||||
command = ["loginctl" "terminate-user" ""];
|
||||
enabled = true;
|
||||
dangerous = true;
|
||||
}
|
||||
@@ -342,7 +344,7 @@ in {
|
||||
name = "Sleep";
|
||||
icon = "bedtime";
|
||||
description = "Suspend then hibernate";
|
||||
command = [ "systemctl" "suspend-then-hibernate" ];
|
||||
command = ["systemctl" "suspend-then-hibernate"];
|
||||
enabled = true;
|
||||
dangerous = false;
|
||||
}
|
||||
@@ -350,7 +352,7 @@ in {
|
||||
name = "Settings";
|
||||
icon = "settings";
|
||||
description = "Configure the shell";
|
||||
command = [ "caelestia" "shell" "controlCenter" "open" ];
|
||||
command = ["caelestia" "shell" "controlCenter" "open"];
|
||||
enabled = false; # default true
|
||||
dangerous = false;
|
||||
}
|
||||
@@ -361,7 +363,8 @@ in {
|
||||
maxShown = 7;
|
||||
maxWallpapers = 9;
|
||||
specialPrefix = "@";
|
||||
useFuzzy = { # should try
|
||||
useFuzzy = {
|
||||
# should try
|
||||
apps = false;
|
||||
actions = false;
|
||||
schemes = false;
|
||||
@@ -384,7 +387,8 @@ in {
|
||||
openeExpanded = false;
|
||||
expire = true;
|
||||
};
|
||||
osd = { # thats the slider for brightness and sound
|
||||
osd = {
|
||||
# thats the slider for brightness and sound
|
||||
enabled = true;
|
||||
enableBrightness = true;
|
||||
enableMicrophone = false;
|
||||
@@ -423,10 +427,10 @@ in {
|
||||
reboot = "cached";
|
||||
};
|
||||
commands = {
|
||||
logout = [ "loginctl" "terminate-user" ];
|
||||
shutdown = [ "systemctl" "poweroff" ];
|
||||
hibernate = [ "systemctl" "hibernate" ];
|
||||
reboot = [ "systemctl" "reboot" ];
|
||||
logout = ["loginctl" "terminate-user"];
|
||||
shutdown = ["systemctl" "poweroff"];
|
||||
hibernate = ["systemctl" "hibernate"];
|
||||
reboot = ["systemctl" "reboot"];
|
||||
};
|
||||
};
|
||||
sidebar = {
|
||||
@@ -495,7 +499,8 @@ in {
|
||||
}
|
||||
];
|
||||
};
|
||||
cli = { # default config https://github.com/caelestia-dots/cli?tab=readme-ov-file#configuring
|
||||
cli = {
|
||||
# default config https://github.com/caelestia-dots/cli?tab=readme-ov-file#configuring
|
||||
enable = true; # Also add caelestia-cli to path
|
||||
settings = {
|
||||
record = {
|
||||
@@ -546,7 +551,7 @@ in {
|
||||
initialTitle = "Spotify Free";
|
||||
}
|
||||
];
|
||||
command = [ "spicetify" "watch" "-s" ];
|
||||
command = ["spicetify" "watch" "-s"];
|
||||
move = true;
|
||||
};
|
||||
feishin = {
|
||||
@@ -571,7 +576,7 @@ in {
|
||||
};
|
||||
}
|
||||
];
|
||||
command = [ "foot" "-a" "btop" "-T" "btop" "fish" "-C" "exec btop" ]; # maybe switch to btm and kitty?
|
||||
command = ["foot" "-a" "btop" "-T" "btop" "fish" "-C" "exec btop"]; # maybe switch to btm and kitty?
|
||||
};
|
||||
};
|
||||
todo = {
|
||||
@@ -582,12 +587,12 @@ in {
|
||||
class = "Todoist";
|
||||
}
|
||||
];
|
||||
command = [ "todoist" ];
|
||||
command = ["todoist"];
|
||||
move = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
{ config, pkgs, ... }: # ls replacement
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
# ls replacement
|
||||
# see ./zsh.nix for the alias (usefull to se default flags)
|
||||
|
||||
{
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
theme = { # from https://github.com/eza-community/eza-themes/blob/main/themes/gruvbox-dark.yml
|
||||
theme = {
|
||||
# from https://github.com/eza-community/eza-themes/blob/main/themes/gruvbox-dark.yml
|
||||
colourful = true;
|
||||
|
||||
filekinds= {
|
||||
filekinds = {
|
||||
normal = {foreground = "#ebdbb2";};
|
||||
directory = {foreground = "#83a598";};
|
||||
symlink = {foreground = "#8ec07c";};
|
||||
@@ -16,97 +21,97 @@
|
||||
block_device = {foreground = "#fb4934";};
|
||||
char_device = {foreground = "#fb4934";};
|
||||
socket = {foreground = "#665c54";};
|
||||
special= {foreground= "#d3869b";};
|
||||
executable= {foreground= "#b8bb26";};
|
||||
mount_point= {foreground= "#fe8019";};
|
||||
special = {foreground = "#d3869b";};
|
||||
executable = {foreground = "#b8bb26";};
|
||||
mount_point = {foreground = "#fe8019";};
|
||||
};
|
||||
perms = {
|
||||
user_read= {foreground= "#ebdbb2";};
|
||||
user_write= {foreground= "#fabd2f";};
|
||||
user_execute_file= {foreground= "#b8bb26";};
|
||||
user_execute_other= {foreground= "#b8bb26";};
|
||||
group_read= {foreground= "#ebdbb2";};
|
||||
group_write= {foreground= "#fabd2f";};
|
||||
group_execute= {foreground= "#b8bb26";};
|
||||
other_read= {foreground= "#bdae93";};
|
||||
other_write= {foreground= "#fabd2f";};
|
||||
other_execute= {foreground= "#b8bb26";};
|
||||
special_user_file= {foreground= "#d3869b";};
|
||||
special_other= {foreground= "#928374";};
|
||||
attribute= {foreground= "#bdae93";};
|
||||
user_read = {foreground = "#ebdbb2";};
|
||||
user_write = {foreground = "#fabd2f";};
|
||||
user_execute_file = {foreground = "#b8bb26";};
|
||||
user_execute_other = {foreground = "#b8bb26";};
|
||||
group_read = {foreground = "#ebdbb2";};
|
||||
group_write = {foreground = "#fabd2f";};
|
||||
group_execute = {foreground = "#b8bb26";};
|
||||
other_read = {foreground = "#bdae93";};
|
||||
other_write = {foreground = "#fabd2f";};
|
||||
other_execute = {foreground = "#b8bb26";};
|
||||
special_user_file = {foreground = "#d3869b";};
|
||||
special_other = {foreground = "#928374";};
|
||||
attribute = {foreground = "#bdae93";};
|
||||
};
|
||||
size= {
|
||||
major= {foreground= "#bdae93";};
|
||||
minor= {foreground= "#8ec07c";};
|
||||
number_byte= {foreground= "#ebdbb2";};
|
||||
number_kilo= {foreground= "#ebdbb2";};
|
||||
number_mega= {foreground= "#83a598";};
|
||||
number_giga= {foreground= "#d3869b";};
|
||||
number_huge= {foreground= "#d3869b";};
|
||||
unit_byte= {foreground= "#bdae93";};
|
||||
unit_kilo= {foreground= "#83a598";};
|
||||
unit_mega= {foreground= "#d3869b";};
|
||||
unit_giga= {foreground= "#d3869b";};
|
||||
unit_huge= {foreground= "#fe8019";};
|
||||
size = {
|
||||
major = {foreground = "#bdae93";};
|
||||
minor = {foreground = "#8ec07c";};
|
||||
number_byte = {foreground = "#ebdbb2";};
|
||||
number_kilo = {foreground = "#ebdbb2";};
|
||||
number_mega = {foreground = "#83a598";};
|
||||
number_giga = {foreground = "#d3869b";};
|
||||
number_huge = {foreground = "#d3869b";};
|
||||
unit_byte = {foreground = "#bdae93";};
|
||||
unit_kilo = {foreground = "#83a598";};
|
||||
unit_mega = {foreground = "#d3869b";};
|
||||
unit_giga = {foreground = "#d3869b";};
|
||||
unit_huge = {foreground = "#fe8019";};
|
||||
};
|
||||
users= {
|
||||
user_you= {foreground= "#ebdbb2";};
|
||||
user_root= {foreground= "#fb4934";};
|
||||
user_other= {foreground= "#d3869b";};
|
||||
group_yours= {foreground= "#ebdbb2";};
|
||||
group_other= {foreground= "#928374";};
|
||||
group_root= {foreground= "#fb4934";};
|
||||
users = {
|
||||
user_you = {foreground = "#ebdbb2";};
|
||||
user_root = {foreground = "#fb4934";};
|
||||
user_other = {foreground = "#d3869b";};
|
||||
group_yours = {foreground = "#ebdbb2";};
|
||||
group_other = {foreground = "#928374";};
|
||||
group_root = {foreground = "#fb4934";};
|
||||
};
|
||||
links= {
|
||||
normal= {foreground= "#8ec07c";};
|
||||
multi_link_file= {foreground= "#fe8019";};
|
||||
links = {
|
||||
normal = {foreground = "#8ec07c";};
|
||||
multi_link_file = {foreground = "#fe8019";};
|
||||
};
|
||||
git= {
|
||||
new= {foreground= "#b8bb26";};
|
||||
modified= {foreground= "#fabd2f";};
|
||||
deleted= {foreground= "#fb4934";};
|
||||
renamed= {foreground= "#8ec07c";};
|
||||
typechange= {foreground= "#d3869b";};
|
||||
ignored= {foreground= "#928374";};
|
||||
conflicted= {foreground= "#cc241d";};
|
||||
git = {
|
||||
new = {foreground = "#b8bb26";};
|
||||
modified = {foreground = "#fabd2f";};
|
||||
deleted = {foreground = "#fb4934";};
|
||||
renamed = {foreground = "#8ec07c";};
|
||||
typechange = {foreground = "#d3869b";};
|
||||
ignored = {foreground = "#928374";};
|
||||
conflicted = {foreground = "#cc241d";};
|
||||
};
|
||||
git_repo= {
|
||||
branch_main= {foreground= "#ebdbb2";};
|
||||
branch_other= {foreground= "#d3869b";};
|
||||
git_clean= {foreground= "#b8bb26";};
|
||||
git_dirty= {foreground= "#fb4934";};
|
||||
git_repo = {
|
||||
branch_main = {foreground = "#ebdbb2";};
|
||||
branch_other = {foreground = "#d3869b";};
|
||||
git_clean = {foreground = "#b8bb26";};
|
||||
git_dirty = {foreground = "#fb4934";};
|
||||
};
|
||||
security_context= {
|
||||
colon= {foreground= "#928374";};
|
||||
user= {foreground= "#ebdbb2";};
|
||||
role= {foreground= "#d3869b";};
|
||||
typ= {foreground= "#665c54";};
|
||||
range= {foreground= "#d3869b";};
|
||||
security_context = {
|
||||
colon = {foreground = "#928374";};
|
||||
user = {foreground = "#ebdbb2";};
|
||||
role = {foreground = "#d3869b";};
|
||||
typ = {foreground = "#665c54";};
|
||||
range = {foreground = "#d3869b";};
|
||||
};
|
||||
file_type= {
|
||||
image= {foreground= "#fabd2f";};
|
||||
video= {foreground= "#fb4934";};
|
||||
music= {foreground= "#b8bb26";};
|
||||
lossless= {foreground= "#8ec07c";};
|
||||
crypto= {foreground= "#928374";};
|
||||
document= {foreground= "#ebdbb2";};
|
||||
compressed= {foreground= "#d3869b";};
|
||||
temp= {foreground= "#cc241d";};
|
||||
compiled= {foreground= "#83a598";};
|
||||
build= {foreground= "#928374";};
|
||||
source= {foreground= "#83a598";};
|
||||
punctuation= {foreground= "#928374";};
|
||||
date= {foreground= "#fabd2f";};
|
||||
inode= {foreground= "#bdae93";};
|
||||
blocks= {foreground= "#a89984";};
|
||||
header= {foreground= "#ebdbb2";};
|
||||
octal= {foreground= "#8ec07c";};
|
||||
flags= {foreground= "#d3869b";};
|
||||
file_type = {
|
||||
image = {foreground = "#fabd2f";};
|
||||
video = {foreground = "#fb4934";};
|
||||
music = {foreground = "#b8bb26";};
|
||||
lossless = {foreground = "#8ec07c";};
|
||||
crypto = {foreground = "#928374";};
|
||||
document = {foreground = "#ebdbb2";};
|
||||
compressed = {foreground = "#d3869b";};
|
||||
temp = {foreground = "#cc241d";};
|
||||
compiled = {foreground = "#83a598";};
|
||||
build = {foreground = "#928374";};
|
||||
source = {foreground = "#83a598";};
|
||||
punctuation = {foreground = "#928374";};
|
||||
date = {foreground = "#fabd2f";};
|
||||
inode = {foreground = "#bdae93";};
|
||||
blocks = {foreground = "#a89984";};
|
||||
header = {foreground = "#ebdbb2";};
|
||||
octal = {foreground = "#8ec07c";};
|
||||
flags = {foreground = "#d3869b";};
|
||||
|
||||
symlink_path= {foreground= "#8ec07c";};
|
||||
control_char= {foreground= "#83a598";};
|
||||
broken_symlink= {foreground= "#fb4934";};
|
||||
broken_path_overlay= {foreground= "#928374";};
|
||||
symlink_path = {foreground = "#8ec07c";};
|
||||
control_char = {foreground = "#83a598";};
|
||||
broken_symlink = {foreground = "#fb4934";};
|
||||
broken_path_overlay = {foreground = "#928374";};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -149,13 +149,15 @@ in {
|
||||
"Ctrl+Alt, 7, exec, caelestia shell gameMode toggle"
|
||||
# reloads the autostart programs # pos 3 1
|
||||
# we passed to caelestia-shell and stoped using that
|
||||
/*"Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=16 -e sh -c 'custom-weather'"
|
||||
/*
|
||||
"Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=16 -e sh -c 'custom-weather'"
|
||||
"Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=11 -e sh -c 'custom-cowsay'"
|
||||
"Ctrl+$mod, 4, exec, kitty -e 'custom-launch'"
|
||||
"Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=5 -e btm --theme gruvbox --disable-click --disable_advanced_kill --enable_cache_memory -g -R -T "
|
||||
"Ctrl+$mod, 4, exec, sleep 1 && kitty -o font_size=1 -e sh -c 'cmatrix -br'"
|
||||
#"Ctrl+Alt, 1, exec, swaync-client -t" # pos 4 1 notification center
|
||||
"Ctrl+Alt, 1, exec, qs ipc call notifications toggle" */
|
||||
"Ctrl+Alt, 1, exec, qs ipc call notifications toggle"
|
||||
*/
|
||||
"Ctrl+Alt, 1, exec, caelestia shell drawers toggle sidebar"
|
||||
"Ctrl+$mod, 4, exec, caelestia shell notifs toggleDnd"
|
||||
"Ctrl+$mod, 3, exec, pavucontrol" # pos 1 2 audiocontrol
|
||||
@@ -220,7 +222,8 @@ in {
|
||||
#"custom-obsidianbackup" # backups the obsidian notes to kdrive and to a timed hidden dir (~/.Notes.backup/)
|
||||
#"QS-notifycache" # builds the cache that will be used for the notification history
|
||||
"sleep 2 & caelestia-shell" #works better if it sleeps a bit before
|
||||
/* We stopped using that ######################### maybe we should desactivate those scripts
|
||||
/*
|
||||
We stopped using that ######################### maybe we should desactivate those scripts
|
||||
# login autostart
|
||||
#######################
|
||||
"[workspace 1 silent] sleep 1 && kitty -o font_size=16 -e sh -c 'custom-weather'"
|
||||
@@ -229,7 +232,8 @@ in {
|
||||
"[workspace 1 silent] sleep 1 && kitty -o font_size=5 -e btm --theme gruvbox --disable-click --disable_advanced_kill --enable_cache_memory -g -R -T "
|
||||
"[workspace 1 silent] sleep 1 && kitty -o font_size=1 -e sh -c 'cmatrix -br'"
|
||||
######################
|
||||
######################*/
|
||||
######################
|
||||
*/
|
||||
];
|
||||
|
||||
# gestures (also keybindings)
|
||||
|
||||
@@ -11,61 +11,62 @@
|
||||
## old condfig
|
||||
extraConfig = ''
|
||||
font_size 14
|
||||
bold_font auto
|
||||
italic_font auto
|
||||
bold_italic_font auto
|
||||
bold_font auto
|
||||
italic_font auto
|
||||
bold_italic_font auto
|
||||
|
||||
window_padding_width 25
|
||||
window_padding_width 25
|
||||
|
||||
# --- Core ---
|
||||
foreground #ece0d9
|
||||
background #18120e
|
||||
# --- Core ---
|
||||
foreground #ece0d9
|
||||
background #18120e
|
||||
|
||||
selection_foreground #18120e
|
||||
selection_background #ece0d9
|
||||
selection_foreground #18120e
|
||||
selection_background #ece0d9
|
||||
|
||||
cursor #ffb878
|
||||
cursor_text_color #18120e
|
||||
cursor #ffb878
|
||||
cursor_text_color #18120e
|
||||
|
||||
# --- Tabs ---
|
||||
active_tab_foreground #18120e
|
||||
active_tab_background #5c412a
|
||||
inactive_tab_foreground #d6c3b5
|
||||
inactive_tab_background #241e1a
|
||||
# --- Tabs ---
|
||||
active_tab_foreground #18120e
|
||||
active_tab_background #5c412a
|
||||
inactive_tab_foreground #d6c3b5
|
||||
inactive_tab_background #241e1a
|
||||
|
||||
# --- Black / Gray ---
|
||||
color0 #353433
|
||||
color8 #b29f91
|
||||
# --- Black / Gray ---
|
||||
color0 #353433
|
||||
color8 #b29f91
|
||||
|
||||
# --- Red ---
|
||||
color1 #e17300
|
||||
color9 #ff8a20
|
||||
# --- Red ---
|
||||
color1 #e17300
|
||||
color9 #ff8a20
|
||||
|
||||
# --- Green ---
|
||||
color2 #ffc071
|
||||
color10 #ffd6a8
|
||||
# --- Green ---
|
||||
color2 #ffc071
|
||||
color10 #ffd6a8
|
||||
|
||||
# --- Yellow ---
|
||||
color3 #ffe0c6
|
||||
color11 #fff2e8
|
||||
# --- Yellow ---
|
||||
color3 #ffe0c6
|
||||
color11 #fff2e8
|
||||
|
||||
# --- Blue ---
|
||||
color4 #b9ab66
|
||||
color12 #d7be91
|
||||
# --- Blue ---
|
||||
color4 #b9ab66
|
||||
color12 #d7be91
|
||||
|
||||
# --- Magenta ---
|
||||
color5 #ed9562
|
||||
color13 #fcad7e
|
||||
# --- Magenta ---
|
||||
color5 #ed9562
|
||||
color13 #fcad7e
|
||||
|
||||
# --- Cyan ---
|
||||
color6 #f4c16d
|
||||
color14 #ffd497
|
||||
# --- Cyan ---
|
||||
color6 #f4c16d
|
||||
color14 #ffd497
|
||||
|
||||
# --- White ---
|
||||
color7 #ebd4c1
|
||||
color15 #FFFFFF
|
||||
# --- White ---
|
||||
color7 #ebd4c1
|
||||
color15 #FFFFFF
|
||||
'';
|
||||
/*extraConfig = ''
|
||||
/*
|
||||
extraConfig = ''
|
||||
# font nerd-fonts._0xproto # this key dont work and causes errors
|
||||
font_size 14
|
||||
bold_font auto
|
||||
@@ -118,6 +119,7 @@ color15 #FFFFFF
|
||||
# white
|
||||
color7 #FFF0CC
|
||||
color15 #F0DBAA
|
||||
'';*/
|
||||
'';
|
||||
*/
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
vimAlias = false;
|
||||
@@ -79,28 +78,28 @@
|
||||
vim.g.maplocalleader = ' '
|
||||
vim.keymap.set({'n', 'v'}, '<Space>', '<Nop>', { desc = 'Leader key, disable default behavior' })
|
||||
vim.keymap.set('n', 'q', '<Nop>', { desc = 'Disable macro recording' })
|
||||
vim.keymap.set('n', 'gg', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gG', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g0', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g^', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g$', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gj', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gk', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g~', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gu', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gU', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g=', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gq', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g@', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g?', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gC', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gD', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gx', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gr', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g[', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g]', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g;', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g,', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gg', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gG', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g0', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g^', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g$', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gj', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gk', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g~', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gu', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gU', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g=', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gq', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g@', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g?', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gC', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gD', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gx', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'gr', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g[', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g]', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g;', '<Nop>', { desc = 'Disable g motion' })
|
||||
vim.keymap.set('n', 'g,', '<Nop>', { desc = 'Disable g motion' })
|
||||
-- =========================
|
||||
-- GENERAL OPTIONS
|
||||
-- =========================
|
||||
@@ -212,7 +211,7 @@ vim.keymap.set('n', 'g,', '<Nop>', { desc = 'Disable g motion' })
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = { enable = true },
|
||||
})
|
||||
})
|
||||
-- =========================
|
||||
-- NVIM-TREE
|
||||
-- =========================
|
||||
@@ -244,10 +243,10 @@ vim.keymap.set('n', 'g,', '<Nop>', { desc = 'Disable g motion' })
|
||||
cmp.setup.cmdline({ '/', '?' }, { mapping = cmp.mapping.preset.cmdline(), sources = { { name = 'buffer' } } })
|
||||
cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } }), matching = { disallow_symbol_nonprefix_matching = false } })
|
||||
|
||||
-- =========================
|
||||
-- LSP CONFIGURATION
|
||||
-- =========================
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
-- =========================
|
||||
-- LSP CONFIGURATION
|
||||
-- =========================
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
-- Diagnostics
|
||||
vim.keymap.set("n", "<leader>e1", function() vim.diagnostic.jump({ prev=true, count = 1 }) end, { desc = "Previous diagnostic" })
|
||||
@@ -281,8 +280,8 @@ local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
vim.keymap.set("n", "<leader>g4", vim.lsp.buf.implementation, { desc = "Go to implementation" })
|
||||
vim.keymap.set("n", "<leader>g5", vim.lsp.buf.references, { desc = "Show references" })
|
||||
|
||||
-- LSP server setup
|
||||
vim.lsp.config("lua_ls", { cmd = { "lua-language-server" }, filetypes = { "lua" }, root_dir = vim.fs.dirname, on_attach = on_attach })
|
||||
-- LSP server setup
|
||||
vim.lsp.config("lua_ls", { cmd = { "lua-language-server" }, filetypes = { "lua" }, root_dir = vim.fs.dirname, on_attach = on_attach })
|
||||
vim.lsp.config("clangd", {
|
||||
cmd = { "clangd" },
|
||||
filetypes = { "c","cpp","objc","objcpp" },
|
||||
@@ -298,7 +297,7 @@ vim.lsp.config("lua_ls", { cmd = { "lua-language-server" }, filetypes = { "lua"
|
||||
filetyypes = { "nix" },
|
||||
on_attach = on_attach,
|
||||
})
|
||||
vim.lsp.config("pylsp", {
|
||||
vim.lsp.config("pylsp", {
|
||||
cmd = { "pylsp" },
|
||||
filetypes = { "python" },
|
||||
on_attach = on_attach,
|
||||
@@ -310,10 +309,10 @@ vim.lsp.config("pylsp", {
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
vim.lsp.config("texlab", { cmd = { "texlab" }, filetypes = { "tex" }, on_attach = on_attach })
|
||||
})
|
||||
vim.lsp.config("texlab", { cmd = { "texlab" }, filetypes = { "tex" }, on_attach = on_attach })
|
||||
|
||||
vim.lsp.enable({ "lua_ls", "clangd", "pylsp", "texlab", "nixd"})
|
||||
vim.lsp.enable({ "lua_ls", "clangd", "pylsp", "texlab", "nixd"})
|
||||
-- =========================
|
||||
-- DASHBOARD
|
||||
-- =========================
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.obsidian = {
|
||||
enable = true;
|
||||
|
||||
vaults = {
|
||||
miscellanious = { enable = true; target = "/Documents/Notes/miscellanious"; };
|
||||
work = { enable = true; target = "/Documents/Notes/work"; };
|
||||
miscellanious = {
|
||||
enable = true;
|
||||
target = "/Documents/Notes/miscellanious";
|
||||
};
|
||||
work = {
|
||||
enable = true;
|
||||
target = "/Documents/Notes/work";
|
||||
};
|
||||
};
|
||||
|
||||
defaultSettings = {
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
# pulled from https://codeberg.org/zacoons/rivendell-hyprdots
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
qt.enable =true;
|
||||
qt.enable = true;
|
||||
programs.quickshell = {
|
||||
systemd.enable = true;
|
||||
enable = true;
|
||||
};
|
||||
home.file.".config/quickshell" = {
|
||||
home.file.".config/quickshell" = {
|
||||
source = ../../other/quickshell;
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
+33
-33
@@ -3,13 +3,13 @@
|
||||
# https://chatgpt.com/c/69da11b3-ba24-8331-b7b0-a58a72e69d42
|
||||
# at your risk and perils
|
||||
# click on the icon to get a notification with state, percentage and wattage
|
||||
{ lib
|
||||
, stdenv
|
||||
, qt6
|
||||
, pkg-config
|
||||
, pkgs
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
qt6,
|
||||
pkg-config,
|
||||
pkgs,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "qtbatticon";
|
||||
version = "1.0";
|
||||
@@ -17,43 +17,43 @@ stdenv.mkDerivation {
|
||||
src = pkgs.writeTextFile {
|
||||
name = "qtbatticon.cpp";
|
||||
text = ''
|
||||
#include <QApplication>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QTimer>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QIcon>
|
||||
#include <QString>
|
||||
#include <QDebug>
|
||||
#include <cstdlib>
|
||||
#include <QApplication>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QTimer>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QIcon>
|
||||
#include <QString>
|
||||
#include <QDebug>
|
||||
#include <cstdlib>
|
||||
|
||||
QString readFile(const QString &path) {
|
||||
QString readFile(const QString &path) {
|
||||
QFile f(path);
|
||||
if (!f.open(QIODevice::ReadOnly)) return "";
|
||||
QTextStream in(&f);
|
||||
return in.readAll().trimmed();
|
||||
}
|
||||
}
|
||||
|
||||
int readInt(const QString &path) {
|
||||
int readInt(const QString &path) {
|
||||
return readFile(path).toInt();
|
||||
}
|
||||
}
|
||||
|
||||
double readDouble(const QString &path) {
|
||||
double readDouble(const QString &path) {
|
||||
QFile f(path);
|
||||
if (!f.open(QIODevice::ReadOnly)) return 0;
|
||||
QTextStream in(&f);
|
||||
return in.readAll().trimmed().toDouble();
|
||||
}
|
||||
}
|
||||
|
||||
int toStep(int capacity) {
|
||||
int toStep(int capacity) {
|
||||
return (capacity / 10) * 10;
|
||||
}
|
||||
}
|
||||
|
||||
QString pad3(int n) {
|
||||
QString pad3(int n) {
|
||||
return QString("%1").arg(n, 3, 10, QChar('0'));
|
||||
}
|
||||
}
|
||||
|
||||
double getPowerW(const QString &batPath) {
|
||||
double getPowerW(const QString &batPath) {
|
||||
double current_uA = readDouble(batPath + "/current_now");
|
||||
double voltage_uV = readDouble(batPath + "/voltage_now");
|
||||
|
||||
@@ -61,9 +61,9 @@ double getPowerW(const QString &batPath) {
|
||||
return (current_uA * voltage_uV) / 1e12;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
QIcon batteryIcon(int capacity, bool charging) {
|
||||
QIcon batteryIcon(int capacity, bool charging) {
|
||||
int step = toStep(capacity);
|
||||
QString num = pad3(step);
|
||||
|
||||
@@ -84,14 +84,14 @@ QIcon batteryIcon(int capacity, bool charging) {
|
||||
}
|
||||
|
||||
return icon;
|
||||
}
|
||||
}
|
||||
|
||||
void sendNotification(const QString &title, const QString &body) {
|
||||
void sendNotification(const QString &title, const QString &body) {
|
||||
QString cmd = "notify-send \"" + title + "\" \"" + body + "\"";
|
||||
system(cmd.toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int main(int argc, char *argv[]) {
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QString batPath = "/sys/class/power_supply/BAT1";
|
||||
@@ -147,7 +147,7 @@ int main(int argc, char *argv[]) {
|
||||
timer.start(5000);
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
# creates and maintains cache file for the notification history
|
||||
{
|
||||
writeShellApplication,
|
||||
...
|
||||
}:
|
||||
{writeShellApplication, ...}:
|
||||
writeShellApplication {
|
||||
name = "QS-notifycache";
|
||||
runtimeInputs = [
|
||||
];
|
||||
text = ''
|
||||
CACHE="$HOME/.cache/notify_history"
|
||||
# Create or erase existing cache
|
||||
mkdir -p "$(dirname "$CACHE")"
|
||||
: > "$CACHE" # truncate file
|
||||
echo "Notification history initialized at $(date)" >> "$CACHE"
|
||||
CACHE="$HOME/.cache/notify_history"
|
||||
# Create or erase existing cache
|
||||
mkdir -p "$(dirname "$CACHE")"
|
||||
: > "$CACHE" # truncate file
|
||||
echo "Notification history initialized at $(date)" >> "$CACHE"
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
{
|
||||
writeShellApplication,
|
||||
...
|
||||
}:
|
||||
{writeShellApplication, ...}:
|
||||
writeShellApplication {
|
||||
name = "QS-notifyhistory";
|
||||
runtimeInputs = [
|
||||
|
||||
@@ -1,80 +1,80 @@
|
||||
{
|
||||
writeShellApplication,
|
||||
ripgrep,
|
||||
gawkInteractive,
|
||||
iproute2,
|
||||
coreutils,
|
||||
procps,
|
||||
upower,
|
||||
...
|
||||
writeShellApplication,
|
||||
ripgrep,
|
||||
gawkInteractive,
|
||||
iproute2,
|
||||
coreutils,
|
||||
procps,
|
||||
upower,
|
||||
...
|
||||
}:
|
||||
writeShellApplication {
|
||||
name = "QS-sysinfo";
|
||||
runtimeInputs = [
|
||||
name = "QS-sysinfo";
|
||||
runtimeInputs = [
|
||||
ripgrep
|
||||
gawkInteractive
|
||||
iproute2
|
||||
coreutils
|
||||
procps
|
||||
upower
|
||||
];
|
||||
text = ''
|
||||
# Pad CPU, MEM, DISK to 2 chars (right-aligned)
|
||||
];
|
||||
text = ''
|
||||
# Pad CPU, MEM, DISK to 2 chars (right-aligned)
|
||||
|
||||
cpu=$(awk '/^cpu /{printf("%.0f", ($2+$4)*100/($2+$4+$5))}' /proc/stat)
|
||||
cpu=$(printf "%2s" "$cpu")
|
||||
cpu=$(awk '/^cpu /{printf("%.0f", ($2+$4)*100/($2+$4+$5))}' /proc/stat)
|
||||
cpu=$(printf "%2s" "$cpu")
|
||||
|
||||
sum=0
|
||||
count=0
|
||||
sum=0
|
||||
count=0
|
||||
|
||||
for f in /sys/class/hwmon/hwmon*/temp*_input; do
|
||||
for f in /sys/class/hwmon/hwmon*/temp*_input; do
|
||||
if [ -r "$f" ]; then
|
||||
val=$(cat "$f" 2>/dev/null) || continue
|
||||
sum=$((sum + val))
|
||||
count=$((count + 1))
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
temp=$(( sum / count / 1000 ))
|
||||
temp=$(( sum / count / 1000 ))
|
||||
|
||||
sum=0
|
||||
count=0
|
||||
sum=0
|
||||
count=0
|
||||
|
||||
for f in /sys/class/hwmon/hwmon*/fan*_input; do
|
||||
for f in /sys/class/hwmon/hwmon*/fan*_input; do
|
||||
if [ -r "$f" ]; then
|
||||
val=$(cat "$f" 2>/dev/null) || continue
|
||||
sum=$((sum + val))
|
||||
count=$((count + 1))
|
||||
fi
|
||||
done
|
||||
fan=$(( sum / count ))
|
||||
fan=$(printf "%4s" "$fan")
|
||||
done
|
||||
fan=$(( sum / count ))
|
||||
fan=$(printf "%4s" "$fan")
|
||||
|
||||
mem=$(free | awk '/Mem:/ {printf("%.0f",$3/$2*100)}')
|
||||
mem=$(printf "%2s" "$mem")
|
||||
mem=$(free | awk '/Mem:/ {printf("%.0f",$3/$2*100)}')
|
||||
mem=$(printf "%2s" "$mem")
|
||||
|
||||
disk=$(df / | awk 'NR==2 {gsub("%",""); print $5}')
|
||||
disk=$(printf "%2s" "$disk")
|
||||
disk=$(df / | awk 'NR==2 {gsub("%",""); print $5}')
|
||||
disk=$(printf "%2s" "$disk")
|
||||
|
||||
# Pad POWER to 5 chars (XX.XX)
|
||||
power=$(upower -b | awk -F: '/energy-rate/ {gsub(/^[ \t]+/, "", $2); split($2,a," "); printf("%.2f", a[1])}')
|
||||
power=$(printf "%5s" "$power")
|
||||
# Pad POWER to 5 chars (XX.XX)
|
||||
power=$(upower -b | awk -F: '/energy-rate/ {gsub(/^[ \t]+/, "", $2); split($2,a," "); printf("%.2f", a[1])}')
|
||||
power=$(printf "%5s" "$power")
|
||||
|
||||
# network calculations
|
||||
iface=$(ip route get 1.1.1.1 | awk '{print $5; exit}')
|
||||
# network calculations
|
||||
iface=$(ip route get 1.1.1.1 | awk '{print $5; exit}')
|
||||
|
||||
rx1=$(cat "/sys/class/net/$iface/statistics/rx_bytes")
|
||||
tx1=$(cat "/sys/class/net/$iface/statistics/tx_bytes")
|
||||
rx1=$(cat "/sys/class/net/$iface/statistics/rx_bytes")
|
||||
tx1=$(cat "/sys/class/net/$iface/statistics/tx_bytes")
|
||||
|
||||
sleep 1
|
||||
sleep 1
|
||||
|
||||
rx2=$(cat "/sys/class/net/$iface/statistics/rx_bytes")
|
||||
tx2=$(cat "/sys/class/net/$iface/statistics/tx_bytes")
|
||||
rx2=$(cat "/sys/class/net/$iface/statistics/rx_bytes")
|
||||
tx2=$(cat "/sys/class/net/$iface/statistics/tx_bytes")
|
||||
|
||||
down_speed=$(( (rx2 - rx1) / 1024 ))
|
||||
up_speed=$(( (tx2 - tx1) / 1024 ))
|
||||
down_speed=$(( (rx2 - rx1) / 1024 ))
|
||||
up_speed=$(( (tx2 - tx1) / 1024 ))
|
||||
|
||||
# Output JSON
|
||||
echo "{\"cpu\":\"$cpu\",\"temp\":\"$temp\",\"fan\":\"$fan\",\"mem\":\"$mem\",\"disk\":\"$disk\",\"power\":\"$power\",\"down\":\"$down_speed\",\"up\":\"$up_speed\"}"
|
||||
'';
|
||||
# Output JSON
|
||||
echo "{\"cpu\":\"$cpu\",\"temp\":\"$temp\",\"fan\":\"$fan\",\"mem\":\"$mem\",\"disk\":\"$disk\",\"power\":\"$power\",\"down\":\"$down_speed\",\"up\":\"$up_speed\"}"
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# taken and adapted https://github.com/miniMinn24/Battery_Notify with MIT License
|
||||
{
|
||||
writeShellApplication,
|
||||
mplayer,
|
||||
brightnessctl,
|
||||
...
|
||||
writeShellApplication,
|
||||
mplayer,
|
||||
brightnessctl,
|
||||
...
|
||||
}: let
|
||||
NotifySound = ../../assets/battery_notify.mp3;
|
||||
NotifySound = ../../assets/battery_notify.mp3;
|
||||
in
|
||||
writeShellApplication {
|
||||
writeShellApplication {
|
||||
name = "custom-batterywarning";
|
||||
runtimeInputs = [
|
||||
mplayer
|
||||
@@ -45,4 +45,4 @@ writeShellApplication {
|
||||
fi
|
||||
done
|
||||
'';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
rsync,
|
||||
...
|
||||
}:
|
||||
|
||||
writeShellApplication {
|
||||
name = "custom-obsidianbackup";
|
||||
runtimeInputs = [
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
ripgrep,
|
||||
...
|
||||
}:
|
||||
|
||||
writeShellApplication {
|
||||
name = "custom-obsidianvaults";
|
||||
runtimeInputs = [
|
||||
|
||||
+57
-57
@@ -10,25 +10,25 @@ writeShellApplication {
|
||||
nix
|
||||
];
|
||||
text = ''
|
||||
set -euo pipefail
|
||||
set -euo pipefail
|
||||
|
||||
## Defaults
|
||||
keepGensDef=30; keepDaysDef=7
|
||||
keepGens=$keepGensDef; keepDays=$keepDaysDef
|
||||
## Defaults
|
||||
keepGensDef=30; keepDaysDef=7
|
||||
keepGens=$keepGensDef; keepDays=$keepDaysDef
|
||||
|
||||
## Usage
|
||||
usage () {
|
||||
## Usage
|
||||
usage () {
|
||||
printf "Usage:\n\t ./trim-generations.sh <keep-generations> <keep-days> <profile> \n\n
|
||||
(defaults are: Keep-Gens=%d Keep-Days=%d Profile=user)\n\n" "$keepGensDef" "$keepDaysDef"
|
||||
(defaults are: Keep-Gens=%d Keep-Days=%d Profile=user)\n\n" "$keepGensDef" "$keepDaysDef"
|
||||
printf "If you enter any parameters, you must enter all three, or none to use defaults.\n"
|
||||
printf "Example:\n\t trim-generations.sh 15 10 home-manager\n"
|
||||
printf " this will work on the home-manager profile and keep all generations from the\n"
|
||||
printf "last 10 days, and keep at least 15 generations no matter how old.\n"
|
||||
printf "\nProfiles available are:\tuser, home-manager, channels, system (root)\n"
|
||||
printf "\n-h or --help prints this help text."
|
||||
}
|
||||
}
|
||||
|
||||
if [ $# -eq 1 ]; then # if help requested
|
||||
if [ $# -eq 1 ]; then # if help requested
|
||||
if [ "$1" = "-h" ]; then
|
||||
usage
|
||||
exit 1;
|
||||
@@ -56,12 +56,12 @@ if [ $# -eq 1 ]; then # if help requested
|
||||
exit 7;
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
## Handle parameters (and change if root)
|
||||
if [[ $EUID -ne 0 ]]; then # if not root
|
||||
## Handle parameters (and change if root)
|
||||
if [[ $EUID -ne 0 ]]; then # if not root
|
||||
profile=$(readlink /home/"$USER"/.nix-profile)
|
||||
else
|
||||
else
|
||||
if [ -d /nix/var/nix/profiles/system ]; then # maybe this or the other
|
||||
profile="/nix/var/nix/profiles/system"
|
||||
elif [ -d /nix/var/nix/profiles/default ]; then
|
||||
@@ -70,18 +70,18 @@ else
|
||||
echo "Cant find profile for root. Exiting"
|
||||
exit 8
|
||||
fi
|
||||
fi
|
||||
if (( $# < 1 )); then
|
||||
fi
|
||||
if (( $# < 1 )); then
|
||||
printf "Keeping default: %d generations OR %d days, whichever is more\n" "$keepGensDef" "$keepDaysDef"
|
||||
elif [[ $# -le 2 ]]; then
|
||||
elif [[ $# -le 2 ]]; then
|
||||
printf "\nError: Not enough arguments.\n\n" >&2
|
||||
usage
|
||||
exit 1
|
||||
elif (( $# > 4)); then
|
||||
elif (( $# > 4)); then
|
||||
printf "\nError: Too many arguments.\n\n" >&2
|
||||
usage
|
||||
exit 2
|
||||
else
|
||||
else
|
||||
if [ "$1" -lt 1 ]; then
|
||||
printf "using Gen numbers less than 1 not recommended. Setting to min=1\n"
|
||||
read -r -p "is that ok? (y/n): " answer
|
||||
@@ -151,12 +151,12 @@ else
|
||||
printf "OK! \t Keep Gens = %s \t Keep Days = %s \n\n" "$keepGens" "$keepDays"
|
||||
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
printf "Operating on profile: %s \t \n\n" "$profile"
|
||||
printf "Operating on profile: %s \t \n\n" "$profile"
|
||||
|
||||
## Runs at the end, to decide whether to delete profiles that match chosen parameters.
|
||||
choose () {
|
||||
## Runs at the end, to decide whether to delete profiles that match chosen parameters.
|
||||
choose () {
|
||||
local default="$1"
|
||||
local prompt="$2"
|
||||
local answer
|
||||
@@ -176,38 +176,38 @@ choose () {
|
||||
exit 7;
|
||||
;;
|
||||
esac
|
||||
} # end of function choose
|
||||
} # end of function choose
|
||||
|
||||
# printf "profile = %s \n\n" "$profile"
|
||||
## Query nix-env for generations list
|
||||
#IFS=$'\n' nixGens=( $(nix-env --list-generations -p "$profile" | sed 's:^\s*::; s:\s*$::' | tr '\t' ' ' | tr -s ' ') )
|
||||
# gave errors replaced by:
|
||||
mapfile -t nixGens < <(
|
||||
# printf "profile = %s \n\n" "$profile"
|
||||
## Query nix-env for generations list
|
||||
#IFS=$'\n' nixGens=( $(nix-env --list-generations -p "$profile" | sed 's:^\s*::; s:\s*$::' | tr '\t' ' ' | tr -s ' ') )
|
||||
# gave errors replaced by:
|
||||
mapfile -t nixGens < <(
|
||||
nix-env --list-generations -p "$profile" |
|
||||
sed 's:^\s*::; s:\s*$::' |
|
||||
tr '\t' ' ' |
|
||||
tr -s ' '
|
||||
)
|
||||
timeNow=$(date +%s)
|
||||
)
|
||||
timeNow=$(date +%s)
|
||||
|
||||
## Get info on oldest generation
|
||||
IFS=' ' read -r -a oldestGenArr <<< "''${nixGens[0]}"
|
||||
oldestGen=''${oldestGenArr[0]}
|
||||
oldestDate=''${oldestGenArr[1]}
|
||||
printf "%-30s %s\n" "oldest generation:" "$oldestGen"
|
||||
#oldestDate=''${nixGens[0]:3:19}
|
||||
printf "%-30s %s\n" "oldest generation created:" "$oldestDate"
|
||||
oldestTime=$(date -d "$oldestDate" +%s)
|
||||
oldestElapsedSecs=$((timeNow-oldestTime))
|
||||
oldestElapsedMins=$((oldestElapsedSecs/60))
|
||||
oldestElapsedHours=$((oldestElapsedMins/60))
|
||||
oldestElapsedDays=$((oldestElapsedHours/24))
|
||||
printf "%-30s %s\n" "minutes before now:" "$oldestElapsedMins"
|
||||
printf "%-30s %s\n" "hours before now:" "$oldestElapsedHours"
|
||||
printf "%-30s %s\n\n" "days before now:" "$oldestElapsedDays"
|
||||
## Get info on oldest generation
|
||||
IFS=' ' read -r -a oldestGenArr <<< "''${nixGens[0]}"
|
||||
oldestGen=''${oldestGenArr[0]}
|
||||
oldestDate=''${oldestGenArr[1]}
|
||||
printf "%-30s %s\n" "oldest generation:" "$oldestGen"
|
||||
#oldestDate=''${nixGens[0]:3:19}
|
||||
printf "%-30s %s\n" "oldest generation created:" "$oldestDate"
|
||||
oldestTime=$(date -d "$oldestDate" +%s)
|
||||
oldestElapsedSecs=$((timeNow-oldestTime))
|
||||
oldestElapsedMins=$((oldestElapsedSecs/60))
|
||||
oldestElapsedHours=$((oldestElapsedMins/60))
|
||||
oldestElapsedDays=$((oldestElapsedHours/24))
|
||||
printf "%-30s %s\n" "minutes before now:" "$oldestElapsedMins"
|
||||
printf "%-30s %s\n" "hours before now:" "$oldestElapsedHours"
|
||||
printf "%-30s %s\n\n" "days before now:" "$oldestElapsedDays"
|
||||
|
||||
## Get info on current generation
|
||||
for i in "''${nixGens[@]}"; do
|
||||
## Get info on current generation
|
||||
for i in "''${nixGens[@]}"; do
|
||||
IFS=' ' read -r -a iGenArr <<< "$i"
|
||||
genNumber=''${iGenArr[0]}
|
||||
genDate=''${iGenArr[1]}
|
||||
@@ -225,21 +225,21 @@ for i in "''${nixGens[@]}"; do
|
||||
printf "%-30s %s\n" "hours before now:" "$currentElapsedHours"
|
||||
printf "%-30s %s\n\n" "days before now:" "$currentElapsedDays"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
## Compare oldest and current generations
|
||||
timeBetweenOldestAndCurrent=$((currentTime-oldestTime))
|
||||
elapsedDays=$((timeBetweenOldestAndCurrent/60/60/24))
|
||||
generationsDiff=$((currentGen-oldestGen))
|
||||
## Compare oldest and current generations
|
||||
timeBetweenOldestAndCurrent=$((currentTime-oldestTime))
|
||||
elapsedDays=$((timeBetweenOldestAndCurrent/60/60/24))
|
||||
generationsDiff=$((currentGen-oldestGen))
|
||||
|
||||
## Figure out what we should do, based on generations and options
|
||||
if [[ elapsedDays -le keepDays ]]; then
|
||||
## Figure out what we should do, based on generations and options
|
||||
if [[ elapsedDays -le keepDays ]]; then
|
||||
printf "All generations are no more than %s days older than current generation. \nOldest gen days difference from current gen: %s \n\n\tNothing to do!\n" "$keepDays" "$elapsedDays"
|
||||
exit 4;
|
||||
elif [[ generationsDiff -lt keepGens ]]; then
|
||||
elif [[ generationsDiff -lt keepGens ]]; then
|
||||
printf "Oldest generation (%d) is only %d generations behind current (%d). \n\n\t Nothing to do!\n" "$oldestGen" "$generationsDiff" "$currentGen"
|
||||
exit 5;
|
||||
else
|
||||
else
|
||||
printf "\tSomething to do...\n"
|
||||
declare -a gens
|
||||
for i in "''${nixGens[@]}"; do
|
||||
@@ -260,7 +260,7 @@ else
|
||||
done
|
||||
printf "\n"
|
||||
choose "y" "Do you want to delete these? [Y/n]: "
|
||||
fi
|
||||
fi
|
||||
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user