mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-13 02:40:46 +02:00
Auto: cleanup-2026-05-24T10-18-36Z
This commit is contained in:
@@ -23,28 +23,28 @@
|
||||
};
|
||||
import-tree.url = "github:vic/import-tree"; # imports ./modules recursively
|
||||
};
|
||||
outputs = inputs @ { flake-parts, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; }
|
||||
outputs = inputs @ {flake-parts, ...}:
|
||||
flake-parts.lib.mkFlake {inherit inputs;}
|
||||
({
|
||||
flake = let
|
||||
system = "x86_64-linux";
|
||||
unfreePkgs = [
|
||||
"hplip"
|
||||
"vivify.vim"
|
||||
"cheatsheet.nvim"
|
||||
];
|
||||
mkUnfreePredicate = pkg:
|
||||
builtins.elem (inputs.nixpkgs.lib.getName pkg) unfreePkgs;
|
||||
mkPkgs = nixpkgsInput:
|
||||
import nixpkgsInput {
|
||||
inherit system;
|
||||
config.allowUnfreePredicate = mkUnfreePredicate;
|
||||
flake = let
|
||||
system = "x86_64-linux";
|
||||
unfreePkgs = [
|
||||
"hplip"
|
||||
"vivify.vim"
|
||||
"cheatsheet.nvim"
|
||||
];
|
||||
mkUnfreePredicate = pkg:
|
||||
builtins.elem (inputs.nixpkgs.lib.getName pkg) unfreePkgs;
|
||||
mkPkgs = nixpkgsInput:
|
||||
import nixpkgsInput {
|
||||
inherit system;
|
||||
config.allowUnfreePredicate = mkUnfreePredicate;
|
||||
};
|
||||
pkgs = mkPkgs inputs.nixpkgs;
|
||||
pkgs-unstable = mkPkgs inputs.nixpkgs-unstable;
|
||||
in {
|
||||
inherit pkgs pkgs-unstable;
|
||||
};
|
||||
pkgs = mkPkgs inputs.nixpkgs;
|
||||
pkgs-unstable = mkPkgs inputs.nixpkgs-unstable;
|
||||
in {
|
||||
inherit pkgs pkgs-unstable;
|
||||
};
|
||||
}
|
||||
// (inputs.import-tree ./modules));
|
||||
}
|
||||
}
|
||||
// (inputs.import-tree ./modules));
|
||||
}
|
||||
|
||||
@@ -1,58 +1,58 @@
|
||||
{ ... }: {
|
||||
flake.nixosModules.anki = { pkgs, ... }: {
|
||||
_: {
|
||||
flake.nixosModules.anki = {pkgs, ...}: {
|
||||
environment.systemPackages = [
|
||||
(pkgs.anki.withAddons [
|
||||
(pkgs.ankiAddons.recolor.withConfig {
|
||||
config = {
|
||||
# we must specify all the colors or it crashes as this overwrite the whole colors set
|
||||
colors = {
|
||||
# ===== Foregrounds =====
|
||||
FG = ["Foreground" "#ebdbb2" "#ebdbb2" ""];
|
||||
FG_SUBTLE = ["Subtle FG" "#d5c4a1" "#d5c4a1" ""];
|
||||
FG_FAINT = ["Faint FG" "#a89984" "#a89984" ""];
|
||||
FG_DISABLED = ["Disabled FG" "#928374" "#928374" ""];
|
||||
(pkgs.anki.withAddons [
|
||||
(pkgs.ankiAddons.recolor.withConfig {
|
||||
config = {
|
||||
# we must specify all the colors or it crashes as this overwrite the whole colors set
|
||||
colors = {
|
||||
# ===== Foregrounds =====
|
||||
FG = ["Foreground" "#ebdbb2" "#ebdbb2" ""];
|
||||
FG_SUBTLE = ["Subtle FG" "#d5c4a1" "#d5c4a1" ""];
|
||||
FG_FAINT = ["Faint FG" "#a89984" "#a89984" ""];
|
||||
FG_DISABLED = ["Disabled FG" "#928374" "#928374" ""];
|
||||
|
||||
# ===== Main Background Layers =====
|
||||
BG = ["Background" "#1d2021" "#1d2021" ""];
|
||||
MAIN_BG = ["Main Background" "#1d2021" "#1d2021" ""];
|
||||
VIEW_BG = ["View Background" "#282828" "#282828" ""];
|
||||
EDITOR_BG = ["Editor Background" "#282828" "#282828" ""];
|
||||
CANVAS = ["Canvas" "#282828" "#282828" ""];
|
||||
CANVAS_ELEVATED = ["Elevated Canvas" "#32302f" "#32302f" ""];
|
||||
# ===== Main Background Layers =====
|
||||
BG = ["Background" "#1d2021" "#1d2021" ""];
|
||||
MAIN_BG = ["Main Background" "#1d2021" "#1d2021" ""];
|
||||
VIEW_BG = ["View Background" "#282828" "#282828" ""];
|
||||
EDITOR_BG = ["Editor Background" "#282828" "#282828" ""];
|
||||
CANVAS = ["Canvas" "#282828" "#282828" ""];
|
||||
CANVAS_ELEVATED = ["Elevated Canvas" "#32302f" "#32302f" ""];
|
||||
|
||||
# ===== Tables & Lists =====
|
||||
TABLE_BG = ["Table Background" "#282828" "#282828" ""];
|
||||
TABLE_ALT_BG = ["Table Alt Background" "#32302f" "#32302f" ""];
|
||||
HEADER_BG = ["Header Background" "#3c3836" "#3c3836" ""];
|
||||
SELECTED_BG = ["Selected Background" "#504945" "#504945" ""];
|
||||
# ===== Tables & Lists =====
|
||||
TABLE_BG = ["Table Background" "#282828" "#282828" ""];
|
||||
TABLE_ALT_BG = ["Table Alt Background" "#32302f" "#32302f" ""];
|
||||
HEADER_BG = ["Header Background" "#3c3836" "#3c3836" ""];
|
||||
SELECTED_BG = ["Selected Background" "#504945" "#504945" ""];
|
||||
|
||||
# ===== Borders =====
|
||||
BORDER = ["Border" "#504945" "#504945" ""];
|
||||
FAINT_BORDER = ["Faint Border" "#3c3836" "#3c3836" ""];
|
||||
# ===== Borders =====
|
||||
BORDER = ["Border" "#504945" "#504945" ""];
|
||||
FAINT_BORDER = ["Faint Border" "#3c3836" "#3c3836" ""];
|
||||
|
||||
# ===== Buttons =====
|
||||
BUTTON_GRADIENT_START = ["Button Start" "#3c3836" "#3c3836" ""];
|
||||
BUTTON_GRADIENT_END = ["Button End" "#3c3836" "#3c3836" ""];
|
||||
BUTTON_HOVER = ["Button Hover" "#665c54" "#665c54" ""];
|
||||
# ===== Buttons =====
|
||||
BUTTON_GRADIENT_START = ["Button Start" "#3c3836" "#3c3836" ""];
|
||||
BUTTON_GRADIENT_END = ["Button End" "#3c3836" "#3c3836" ""];
|
||||
BUTTON_HOVER = ["Button Hover" "#665c54" "#665c54" ""];
|
||||
|
||||
# ===== Accent & Links =====
|
||||
ACCENT = ["Accent" "#458588" "#458588" ""];
|
||||
LINK = ["Link" "#83a598" "#83a598" ""];
|
||||
LINK_HOVER = ["Link Hover" "#8ec07c" "#8ec07c" ""];
|
||||
# ===== Accent & Links =====
|
||||
ACCENT = ["Accent" "#458588" "#458588" ""];
|
||||
LINK = ["Link" "#83a598" "#83a598" ""];
|
||||
LINK_HOVER = ["Link Hover" "#8ec07c" "#8ec07c" ""];
|
||||
|
||||
# ===== Status =====
|
||||
WARNING = ["Warning" "#fe8019" "#fe8019" ""];
|
||||
ERROR = ["Error" "#fb4934" "#fb4934" ""];
|
||||
SUCCESS = ["Success" "#8ec07c" "#8ec07c" ""];
|
||||
};
|
||||
# ===== Status =====
|
||||
WARNING = ["Warning" "#fe8019" "#fe8019" ""];
|
||||
ERROR = ["Error" "#fb4934" "#fb4934" ""];
|
||||
SUCCESS = ["Success" "#8ec07c" "#8ec07c" ""];
|
||||
};
|
||||
# version = { major = 3; minor = 1; };
|
||||
# let nixpkgs handle the version
|
||||
})
|
||||
])
|
||||
];
|
||||
};
|
||||
# version = { major = 3; minor = 1; };
|
||||
# let nixpkgs handle the version
|
||||
})
|
||||
])
|
||||
];
|
||||
};
|
||||
flake.homeModules.anki = { ... }: {
|
||||
flake.homeModules.anki = _: {
|
||||
programs.anki = {
|
||||
# we enable system wide with nixpkgs because it offers some addon configuration. We just use this for some config
|
||||
#enable = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
# unused at the moment see ../hardware/battery.nix
|
||||
flake.homeModules.batsignal = { ... }: {
|
||||
flake.homeModules.batsignal = _: {
|
||||
services.batsignal.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
{ self, ...}: {
|
||||
flake.nixosModules.browsers = { pkgs, pkgs-unstable, ...}: {
|
||||
{self, ...}: {
|
||||
flake.nixosModules.browsers = {
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
chromium # used only to flash the firmware on my framework laptop 16 (keyboard.frame.work) as only chromium based browser support webHID.
|
||||
pkgs-unstable.tor-browser
|
||||
self.packages.${pkgs.system}.custom-librewolfprofiles
|
||||
];
|
||||
};
|
||||
flake.homeModules.librewolf = { ... }: {
|
||||
flake.homeModules.librewolf = _: {
|
||||
# adapted from https://github.com/contre95/dotfiles/blob/main/dotfiles/nixos/programs/librewolf.nix
|
||||
home.sessionVariables = {
|
||||
MOZ_ENABLE_WAYLAND = 1;
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
{ self, ... }: {
|
||||
flake.nixosModules.caelestia = { pkgs, ... }: {
|
||||
{self, ...}: {
|
||||
flake.nixosModules.caelestia = {pkgs, ...}: {
|
||||
qt.enable = true;
|
||||
# to resolve this https://wiki.nixos.org/wiki/Home_Manager#I_cannot_set_GNOME_or_Gtk_themes_via_Home_Manager
|
||||
programs.dconf.enable = true;
|
||||
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
self.packages.${pkgs.system}.qtbatticon
|
||||
kdePackages.qtdeclarative # provides qmlls and other things
|
||||
quickshell # we have it but adding it there solves "WARN qt.qpa.services: Failed to register with host portal QDBusError("org.freedesktop.portal.Error.Failed", "Could not register app ID: App info not found for 'org.quickshell'")"
|
||||
];
|
||||
};
|
||||
flake.homeModules.caelestia = { ... }: let
|
||||
flake.homeModules.caelestia = _: let
|
||||
sisyphe = ../../assets/sisyphe.gif;
|
||||
pepe-music = ../../assets/pepe-music.gif;
|
||||
in {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.eza = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.eza = _: {
|
||||
# ls replacement
|
||||
# see ./zsh.nix for the alias (usefull to se default flags)
|
||||
programs.eza = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.fastfetch = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.fastfetch = _: {
|
||||
# Adapted from https://github.com/dacrab/fastfetch-config/blob/main/config.jsonc
|
||||
programs.fastfetch = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.games = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
supertux # fuck mario
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.git = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.git = _: {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.homeModules.gtk = {pkgs, ...}: {
|
||||
# gtk config
|
||||
gtk.theme = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
# this was in my home-manager config, but looks like more
|
||||
flake.nixosModules.hypridle = { ... }: {
|
||||
flake.nixosModules.hypridle = _: {
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
{ self, ... }: {
|
||||
flake.nixosModules.hyprland = { pkgs, pkgs-unstable, ... }: {
|
||||
{self, ...}: {
|
||||
flake.nixosModules.hyprland = {
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
swww #wallpaper daemon
|
||||
gruvbox-gtk-theme
|
||||
@@ -31,10 +35,10 @@
|
||||
# removes uxterm
|
||||
services.xserver.excludePackages = [pkgs.xterm];
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
};
|
||||
flake.homeModules.hyprland-laptop = { ... }: {
|
||||
flake.homeModules.hyprland-laptop = _: {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
exec-once = [
|
||||
"qtbatticon" # custom battery tray
|
||||
|
||||
@@ -1,50 +1,51 @@
|
||||
{ ...}: { # for some reason perSystem can't expose pkgs-unstable so we need to expose it here
|
||||
# -----------------------------------------------------
|
||||
# Here are a bunch of scripts that interact with hyprland
|
||||
# Some are still used. Some are broken. Some are deprecated. But I do still keep them in case I want to go back to old tools
|
||||
# -----------------------------------------------------
|
||||
perSystem = { pkgs, ... }: let
|
||||
_: {
|
||||
# for some reason perSystem can't expose pkgs-unstable so we need to expose it here
|
||||
# -----------------------------------------------------
|
||||
# Here are a bunch of scripts that interact with hyprland
|
||||
# Some are still used. Some are broken. Some are deprecated. But I do still keep them in case I want to go back to old tools
|
||||
# -----------------------------------------------------
|
||||
perSystem = {pkgs, ...}: let
|
||||
wallpaper1 = ../../assets/wallpaper1.jpg;
|
||||
wallpaper2 = ../../assets/wallpaper2.jpg;
|
||||
wallpaper3 = ../../assets/wallpaper3.jpg;
|
||||
wallpaper4 = ../../assets/wallpaper4.jpg;
|
||||
wallpaper5 = ../../assets/wallpaper5.jpg;
|
||||
in {
|
||||
# kills the app, but when it's steam or custom-pomodoro
|
||||
packages.custom-dontkillsteam = pkgs.writeShellApplication {
|
||||
name = "custom-dontkillsteam";
|
||||
runtimeInputs = with pkgs; [
|
||||
hyprland
|
||||
jq
|
||||
];
|
||||
text = ''
|
||||
class=$(hyprctl activewindow -j | jq -r ".class")
|
||||
if [[ "$class" == "Steam" || "$class" == "custom-pomodoro" ]]; then
|
||||
hyprctl dispatch movetoworkspacesilent special
|
||||
else
|
||||
hyprctl dispatch killactive ""
|
||||
fi
|
||||
# kills the app, but when it's steam or custom-pomodoro
|
||||
packages.custom-dontkillsteam = pkgs.writeShellApplication {
|
||||
name = "custom-dontkillsteam";
|
||||
runtimeInputs = with pkgs; [
|
||||
hyprland
|
||||
jq
|
||||
];
|
||||
text = ''
|
||||
class=$(hyprctl activewindow -j | jq -r ".class")
|
||||
if [[ "$class" == "Steam" || "$class" == "custom-pomodoro" ]]; then
|
||||
hyprctl dispatch movetoworkspacesilent special
|
||||
else
|
||||
hyprctl dispatch killactive ""
|
||||
fi
|
||||
|
||||
'';
|
||||
};
|
||||
packages.custom-killall = pkgs.writeShellApplication {
|
||||
name = "custom-killall";
|
||||
runtimeInputs = [
|
||||
pkgs.hyprland # for some reason pkgs-unstable doesn't work here
|
||||
pkgs.jq
|
||||
];
|
||||
text = ''
|
||||
active_workspace_id=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
'';
|
||||
};
|
||||
packages.custom-killall = pkgs.writeShellApplication {
|
||||
name = "custom-killall";
|
||||
runtimeInputs = [
|
||||
pkgs.hyprland # for some reason pkgs-unstable doesn't work here
|
||||
pkgs.jq
|
||||
];
|
||||
text = ''
|
||||
active_workspace_id=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
|
||||
hyprctl clients -j |
|
||||
jq -r ".[]
|
||||
| select(.workspace.id==''${active_workspace_id})
|
||||
| select(.focusHistoryID!=0)
|
||||
| .pid" |
|
||||
xargs -r kill
|
||||
'';
|
||||
};
|
||||
packages.custom-wallpaper = pkgs.writeShellApplication {
|
||||
hyprctl clients -j |
|
||||
jq -r ".[]
|
||||
| select(.workspace.id==''${active_workspace_id})
|
||||
| select(.focusHistoryID!=0)
|
||||
| .pid" |
|
||||
xargs -r kill
|
||||
'';
|
||||
};
|
||||
packages.custom-wallpaper = pkgs.writeShellApplication {
|
||||
name = "custom-wallpaper";
|
||||
runtimeInputs = with pkgs; [
|
||||
socat
|
||||
@@ -80,18 +81,19 @@
|
||||
|
||||
socat -U - UNIX-CONNECT:"$XDG_RUNTIME_DIR"/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock | while read -r line; do handle "$line"; done
|
||||
'';
|
||||
};
|
||||
packages.custom-launch = pkgs.writeShellApplication {
|
||||
# used for the terminal autostart. Needs to get cleared and recall fastfetch so that the bar from oh-my-zsh get resized
|
||||
# unused
|
||||
name = "custom-launch";
|
||||
runtimeInputs = with pkgs; [
|
||||
zsh
|
||||
];
|
||||
text = ''
|
||||
sleep 2
|
||||
clear
|
||||
zsh
|
||||
'';
|
||||
};
|
||||
};
|
||||
packages.custom-launch = pkgs.writeShellApplication {
|
||||
# used for the terminal autostart. Needs to get cleared and recall fastfetch so that the bar from oh-my-zsh get resized
|
||||
# unused
|
||||
name = "custom-launch";
|
||||
runtimeInputs = with pkgs; [
|
||||
zsh
|
||||
];
|
||||
text = ''
|
||||
sleep 2
|
||||
clear
|
||||
zsh
|
||||
'';
|
||||
};
|
||||
};}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ self, ... }: {
|
||||
flake.nixosModules.kdrive = { pkgs-unstable, ... }: {
|
||||
{self, ...}: {
|
||||
flake.nixosModules.kdrive = {pkgs-unstable, ...}: {
|
||||
environment.systemPackages = with pkgs-unstable; [
|
||||
rclone
|
||||
self.packages.${pkgs.system}.custom-checkKdrive
|
||||
@@ -11,7 +11,7 @@
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
perSystem = { pkgs, ... }: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-checkKdrive = pkgs.writeShellApplication {
|
||||
name = "custom-checkKdrive";
|
||||
runtimeInputs = with pkgs; [
|
||||
@@ -47,23 +47,24 @@
|
||||
'';
|
||||
};
|
||||
packages.custom-mountkdrive = pkgs.writeShellApplication {
|
||||
name = "custom-mountkdrive";
|
||||
runtimeInputs = with pkgs; [
|
||||
rclone
|
||||
libnotify
|
||||
];
|
||||
text = ''
|
||||
REMOTE_NAME="kdrive"
|
||||
MOUNT_POINT="$HOME/kdrive"
|
||||
name = "custom-mountkdrive";
|
||||
runtimeInputs = with pkgs; [
|
||||
rclone
|
||||
libnotify
|
||||
];
|
||||
text = ''
|
||||
REMOTE_NAME="kdrive"
|
||||
MOUNT_POINT="$HOME/kdrive"
|
||||
|
||||
if rclone listremotes | rg "^''${REMOTE_NAME}:"; then
|
||||
echo "Mounting ''${REMOTE_NAME}..."
|
||||
rclone mount "''${REMOTE_NAME}:" "$MOUNT_POINT" --vfs-cache-mode writes --allow-non-empty &
|
||||
else
|
||||
notify-send "rclone mount failed" \
|
||||
"Remote ''${REMOTE_NAME} not found.\nConfigure rclone and create the dir ~/kdrive/ or comment out the exec line in hyprland.nix."
|
||||
echo "Remote ''${REMOTE_NAME} not found. Configure rclone or comment out the exec line in hyprland.nix."
|
||||
fi
|
||||
'';
|
||||
if rclone listremotes | rg "^''${REMOTE_NAME}:"; then
|
||||
echo "Mounting ''${REMOTE_NAME}..."
|
||||
rclone mount "''${REMOTE_NAME}:" "$MOUNT_POINT" --vfs-cache-mode writes --allow-non-empty &
|
||||
else
|
||||
notify-send "rclone mount failed" \
|
||||
"Remote ''${REMOTE_NAME} not found.\nConfigure rclone and create the dir ~/kdrive/ or comment out the exec line in hyprland.nix."
|
||||
echo "Remote ''${REMOTE_NAME} not found. Configure rclone or comment out the exec line in hyprland.nix."
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
};}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.kitty = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.kitty = _: {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
#font.name = nerd-fonts._0xproto;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.nixosModules.ly = { ... }: {
|
||||
_: {
|
||||
flake.nixosModules.ly = _: {
|
||||
# a minimal ly config as the big config (ly.nix) didnt worked
|
||||
services.displayManager.ly = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ inputs, ... }: {
|
||||
flake.hostModules.micro = { pkgs-unstable, ... }: {
|
||||
{inputs, ...}: {
|
||||
flake.hostModules.micro = {pkgs-unstable, ...}: {
|
||||
programs.micro = {
|
||||
enable = true;
|
||||
package = pkgs-unstable.micro-full;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.mullvad = {pkgs-unstable, ...}: {
|
||||
services.mullvad-vpn = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.homeModules.neovim = {pkgs-unstable, ...}: {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
# obsidian is unused -> see my project https://github.com/tomasriveral/NoteWrapper
|
||||
flake.homeModules.obsidian = { ... }: {
|
||||
flake.homeModules.obsidian = _: {
|
||||
programs.obsidian = {
|
||||
enable = true;
|
||||
|
||||
@@ -27,99 +27,100 @@
|
||||
};
|
||||
};
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-obsidianbackup = pkgs.writeShellApplication {
|
||||
name = "custom-obsidianbackup";
|
||||
runtimeInputs = with pkgs; [
|
||||
rclone
|
||||
libnotify
|
||||
rsync
|
||||
];
|
||||
text = ''
|
||||
#!/usr/bin/env bash
|
||||
packages.custom-obsidianbackup = pkgs.writeShellApplication {
|
||||
name = "custom-obsidianbackup";
|
||||
runtimeInputs = with pkgs; [
|
||||
rclone
|
||||
libnotify
|
||||
rsync
|
||||
];
|
||||
text = ''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SOURCE_DIR="$HOME/Documents/Notes"
|
||||
DEST_DIR="$HOME/kdrive/Notes"
|
||||
BACKUP_DIR="$HOME/.Notes.backup"
|
||||
SOURCE_DIR="$HOME/Documents/Notes"
|
||||
DEST_DIR="$HOME/kdrive/Notes"
|
||||
BACKUP_DIR="$HOME/.Notes.backup"
|
||||
|
||||
mkdir -p "$DEST_DIR"
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
mkdir -p "$DEST_DIR"
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
|
||||
while true; do
|
||||
# Timestamp for this run
|
||||
TIMESTAMP=$(date +%Y-%m-%d_%H-%M)
|
||||
TIMESTAMPED_BACKUP="$BACKUP_DIR/$TIMESTAMP"
|
||||
mkdir -p "$TIMESTAMPED_BACKUP"
|
||||
while true; do
|
||||
# Timestamp for this run
|
||||
TIMESTAMP=$(date +%Y-%m-%d_%H-%M)
|
||||
TIMESTAMPED_BACKUP="$BACKUP_DIR/$TIMESTAMP"
|
||||
mkdir -p "$TIMESTAMPED_BACKUP"
|
||||
|
||||
echo "[$(date)] Starting Obsidian backup..."
|
||||
echo "[$(date)] Starting Obsidian backup..."
|
||||
|
||||
# Check rclone mount
|
||||
status=$(rclone about kdrive: 2>&1 || true)
|
||||
if [[ "$status" =~ .*CRITICAL.* ]]; then
|
||||
echo "[$(date)] rclone failed:"
|
||||
echo "$status"
|
||||
notify-send -u critical "rclone failed" \
|
||||
"rclone might be broken or you need to deactivate this script in HomeManager."
|
||||
else
|
||||
# Run rsync with verbose debugging
|
||||
echo "[$(date)] Running rsync..."
|
||||
rsync -Lavh --progress --update --backup --backup-dir="$TIMESTAMPED_BACKUP" \
|
||||
--exclude='.obsidian/cache/**' \
|
||||
"$SOURCE_DIR/" "$DEST_DIR/"
|
||||
# Check rclone mount
|
||||
status=$(rclone about kdrive: 2>&1 || true)
|
||||
if [[ "$status" =~ .*CRITICAL.* ]]; then
|
||||
echo "[$(date)] rclone failed:"
|
||||
echo "$status"
|
||||
notify-send -u critical "rclone failed" \
|
||||
"rclone might be broken or you need to deactivate this script in HomeManager."
|
||||
else
|
||||
# Run rsync with verbose debugging
|
||||
echo "[$(date)] Running rsync..."
|
||||
rsync -Lavh --progress --update --backup --backup-dir="$TIMESTAMPED_BACKUP" \
|
||||
--exclude='.obsidian/cache/**' \
|
||||
"$SOURCE_DIR/" "$DEST_DIR/"
|
||||
|
||||
echo "[$(date)] Backup completed for this run."
|
||||
fi
|
||||
echo "[$(date)] Backup completed for this run."
|
||||
fi
|
||||
|
||||
# Safely remove backups older than 30 days
|
||||
if [[ -d "$BACKUP_DIR" && "$BACKUP_DIR" == "$HOME/.Notes.backup" ]]; then
|
||||
echo "[$(date)] Cleaning old backups..."
|
||||
find "$BACKUP_DIR/" -mindepth 1 -maxdepth 1 -type d -mtime +30 -exec rm -rf {} \;
|
||||
else
|
||||
echo "[$(date)] Backup directory not safe. Skipping cleanup."
|
||||
fi
|
||||
# Safely remove backups older than 30 days
|
||||
if [[ -d "$BACKUP_DIR" && "$BACKUP_DIR" == "$HOME/.Notes.backup" ]]; then
|
||||
echo "[$(date)] Cleaning old backups..."
|
||||
find "$BACKUP_DIR/" -mindepth 1 -maxdepth 1 -type d -mtime +30 -exec rm -rf {} \;
|
||||
else
|
||||
echo "[$(date)] Backup directory not safe. Skipping cleanup."
|
||||
fi
|
||||
|
||||
# Wait 1 hour
|
||||
echo "[$(date)] Sleeping for 1 hour..."
|
||||
sleep 3600
|
||||
done
|
||||
'';
|
||||
# Wait 1 hour
|
||||
echo "[$(date)] Sleeping for 1 hour..."
|
||||
sleep 3600
|
||||
done
|
||||
'';
|
||||
};
|
||||
# this might be broken after dendritic nix. As it searched for the obsidian.nix to get list of vaults
|
||||
packages.custom-obsidianbvaults = pkgs.writeShellApplication {
|
||||
name = "custom-obsidianvaults";
|
||||
runtimeInputs = with pkgs; [
|
||||
zsh
|
||||
fzf
|
||||
ripgrep
|
||||
];
|
||||
text = ''
|
||||
# Path to your obsidian.nix
|
||||
obsidian_nix="$HOME/nixos/modules/home-manager/obsidian.nix"
|
||||
|
||||
# Extract vault names without line numbers and colors
|
||||
mapfile -t vaults < <(rg -N --color=never -Po 'vaults\.\K[[:alnum:]_]+' "$obsidian_nix")
|
||||
|
||||
# Let user select a vault with fzf
|
||||
selected=$(printf "%s\n" "''${vaults[@]}" \
|
||||
| fzf --height 6 --reverse --prompt="Select Obsidian vault:")
|
||||
|
||||
# Exit if user cancels
|
||||
[[ -z "$selected" ]] && exit 0
|
||||
|
||||
# Remove any stray ANSI codes (optional)
|
||||
selected=$(echo "$selected" | sed -r 's/\x1B\[[0-9;]*[mK]//g')
|
||||
|
||||
# Find the target path of the selected vault
|
||||
vault_path=$(rg -N --color=never -A2 "vaults.$selected" "$obsidian_nix" \
|
||||
| rg 'target =' | sed -E 's/.*"([^"]+)".*/\1/')
|
||||
|
||||
# Expand ~ if present
|
||||
vault_path="''${vault_path/#\~/$HOME}"
|
||||
|
||||
# Launch Obsidian with the selected vault using URI
|
||||
[[ -n "$vault_path" ]] && setsid xdg-open "obsidian://open?vault=$selected" >/dev/null 2>&1 &
|
||||
# Exit the kitty terminal after selection
|
||||
pkill -f "kitty.*Select Obsidian vault"
|
||||
exit
|
||||
'';
|
||||
};
|
||||
};
|
||||
# this might be broken after dendritic nix. As it searched for the obsidian.nix to get list of vaults
|
||||
packages.custom-obsidianbvaults = pkgs.writeShellApplication {
|
||||
name = "custom-obsidianvaults";
|
||||
runtimeInputs = with pkgs; [
|
||||
zsh
|
||||
fzf
|
||||
ripgrep
|
||||
];
|
||||
text = ''
|
||||
# Path to your obsidian.nix
|
||||
obsidian_nix="$HOME/nixos/modules/home-manager/obsidian.nix"
|
||||
|
||||
# Extract vault names without line numbers and colors
|
||||
mapfile -t vaults < <(rg -N --color=never -Po 'vaults\.\K[[:alnum:]_]+' "$obsidian_nix")
|
||||
|
||||
# Let user select a vault with fzf
|
||||
selected=$(printf "%s\n" "''${vaults[@]}" \
|
||||
| fzf --height 6 --reverse --prompt="Select Obsidian vault:")
|
||||
|
||||
# Exit if user cancels
|
||||
[[ -z "$selected" ]] && exit 0
|
||||
|
||||
# Remove any stray ANSI codes (optional)
|
||||
selected=$(echo "$selected" | sed -r 's/\x1B\[[0-9;]*[mK]//g')
|
||||
|
||||
# Find the target path of the selected vault
|
||||
vault_path=$(rg -N --color=never -A2 "vaults.$selected" "$obsidian_nix" \
|
||||
| rg 'target =' | sed -E 's/.*"([^"]+)".*/\1/')
|
||||
|
||||
# Expand ~ if present
|
||||
vault_path="''${vault_path/#\~/$HOME}"
|
||||
|
||||
# Launch Obsidian with the selected vault using URI
|
||||
[[ -n "$vault_path" ]] && setsid xdg-open "obsidian://open?vault=$selected" >/dev/null 2>&1 &
|
||||
# Exit the kitty terminal after selection
|
||||
pkill -f "kitty.*Select Obsidian vault"
|
||||
exit
|
||||
'';
|
||||
};
|
||||
};}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.oh-my-posh = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.oh-my-posh = _: {
|
||||
programs.oh-my-posh = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
|
||||
+117
-117
@@ -1,123 +1,123 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.homeModules.quickshell = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.quickshell = _: {
|
||||
# pulled from https://codeberg.org/zacoons/rivendell-hyprdots
|
||||
# replaced by caelestia-shell
|
||||
qt.enable = true;
|
||||
programs.quickshell = {
|
||||
systemd.enable = true;
|
||||
enable = true;
|
||||
};
|
||||
home.file.".config/quickshell" = {
|
||||
source = ../../other/quickshell;
|
||||
recursive = true;
|
||||
};
|
||||
programs.quickshell = {
|
||||
systemd.enable = true;
|
||||
enable = true;
|
||||
};
|
||||
home.file.".config/quickshell" = {
|
||||
source = ../../other/quickshell;
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
perSystem = {pkgs, ...}: {
|
||||
# creates and maintains cache file for the notification history
|
||||
packages.QS-notifycache = pkgs.writeShellApplication {
|
||||
name = "QS-notifycache";
|
||||
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"
|
||||
'';
|
||||
# creates and maintains cache file for the notification history
|
||||
packages.QS-notifycache = pkgs.writeShellApplication {
|
||||
name = "QS-notifycache";
|
||||
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"
|
||||
'';
|
||||
};
|
||||
packages.QS-notifyhistory = pkgs.writeShellApplication {
|
||||
name = "QS-notifyhistory";
|
||||
text = ''
|
||||
app="$1"
|
||||
title="$2"
|
||||
body="$3"
|
||||
date="$(date +%T)"
|
||||
urgency="$4"
|
||||
|
||||
case "$urgency" in
|
||||
0) urgency_text="low";;
|
||||
1) urgency_text="normal";;
|
||||
2) urgency_text="critical";;
|
||||
*) urgency_text="unknown";;
|
||||
esac
|
||||
{
|
||||
echo "$app"
|
||||
echo "$title"
|
||||
echo "$body"
|
||||
echo "$date"
|
||||
echo "$urgency_text"
|
||||
|
||||
} >> "$HOME/.cache/notify_history"
|
||||
'';
|
||||
};
|
||||
packages.QS-sysinfo = pkgs.writeShellApplication {
|
||||
name = "QS-sysinfo";
|
||||
runtimeInputs = with pkgs; [
|
||||
ripgrep
|
||||
gawkInteractive
|
||||
iproute2
|
||||
coreutils
|
||||
procps
|
||||
upower
|
||||
];
|
||||
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")
|
||||
|
||||
sum=0
|
||||
count=0
|
||||
|
||||
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
|
||||
|
||||
temp=$(( sum / count / 1000 ))
|
||||
|
||||
sum=0
|
||||
count=0
|
||||
|
||||
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")
|
||||
|
||||
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")
|
||||
|
||||
# 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}')
|
||||
|
||||
rx1=$(cat "/sys/class/net/$iface/statistics/rx_bytes")
|
||||
tx1=$(cat "/sys/class/net/$iface/statistics/tx_bytes")
|
||||
|
||||
sleep 1
|
||||
|
||||
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 ))
|
||||
|
||||
# Output JSON
|
||||
echo "{\"cpu\":\"$cpu\",\"temp\":\"$temp\",\"fan\":\"$fan\",\"mem\":\"$mem\",\"disk\":\"$disk\",\"power\":\"$power\",\"down\":\"$down_speed\",\"up\":\"$up_speed\"}"
|
||||
'';
|
||||
};
|
||||
};
|
||||
packages.QS-notifyhistory = pkgs.writeShellApplication {
|
||||
name = "QS-notifyhistory";
|
||||
text = ''
|
||||
app="$1"
|
||||
title="$2"
|
||||
body="$3"
|
||||
date="$(date +%T)"
|
||||
urgency="$4"
|
||||
|
||||
case "$urgency" in
|
||||
0) urgency_text="low";;
|
||||
1) urgency_text="normal";;
|
||||
2) urgency_text="critical";;
|
||||
*) urgency_text="unknown";;
|
||||
esac
|
||||
{
|
||||
echo "$app"
|
||||
echo "$title"
|
||||
echo "$body"
|
||||
echo "$date"
|
||||
echo "$urgency_text"
|
||||
|
||||
} >> "$HOME/.cache/notify_history"
|
||||
'';
|
||||
};
|
||||
packages.QS-sysinfo = pkgs.writeShellApplication {
|
||||
name = "QS-sysinfo";
|
||||
runtimeInputs = with pkgs; [
|
||||
ripgrep
|
||||
gawkInteractive
|
||||
iproute2
|
||||
coreutils
|
||||
procps
|
||||
upower
|
||||
];
|
||||
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")
|
||||
|
||||
sum=0
|
||||
count=0
|
||||
|
||||
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
|
||||
|
||||
temp=$(( sum / count / 1000 ))
|
||||
|
||||
sum=0
|
||||
count=0
|
||||
|
||||
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")
|
||||
|
||||
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")
|
||||
|
||||
# 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}')
|
||||
|
||||
rx1=$(cat "/sys/class/net/$iface/statistics/rx_bytes")
|
||||
tx1=$(cat "/sys/class/net/$iface/statistics/tx_bytes")
|
||||
|
||||
sleep 1
|
||||
|
||||
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 ))
|
||||
|
||||
# Output JSON
|
||||
echo "{\"cpu\":\"$cpu\",\"temp\":\"$temp\",\"fan\":\"$fan\",\"mem\":\"$mem\",\"disk\":\"$disk\",\"power\":\"$power\",\"down\":\"$down_speed\",\"up\":\"$up_speed\"}"
|
||||
'';
|
||||
};
|
||||
};}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.ripgrep = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.ripgrep = _: {
|
||||
programs.ripgrep = {
|
||||
enable = true;
|
||||
arguments = [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.rofi = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.rofi = _: {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
theme = "gruvbox-dark-hard";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.sbb-tui = { pkgs-unstable, ... }: {
|
||||
home.packages = [
|
||||
pkgs-unstable.sbb-tui
|
||||
_: {
|
||||
flake.homeModules.sbb-tui = {pkgs-unstable, ...}: {
|
||||
home.packages = [
|
||||
pkgs-unstable.sbb-tui
|
||||
];
|
||||
home.file.".config/sbb-tui/config.yaml" = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.ssh = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.ssh = _: {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
enableDefaultConfig = false; # will be removed in the futur. Removes evaluation warning
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
# replaced by caelestia
|
||||
flake.homeModules.swaync = { ... }: {
|
||||
flake.homeModules.swaync = _: {
|
||||
services.swaync = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
flake.homeModules.swaylock = { ... }: {
|
||||
flake.homeModules.swaylock = _: {
|
||||
programs.swaylock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.thunderbird = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.thunderbird = _: {
|
||||
programs.thunderbird = {
|
||||
enable = true;
|
||||
profiles.tomasr = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.homeModules.vivify = {pkgs-unstable, ...}: {
|
||||
home.file.".config/vivify/config.json" = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.homeModules.waybar = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.waybar = _: {
|
||||
# replaced by caelestia
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
@@ -694,23 +693,24 @@
|
||||
'';
|
||||
};
|
||||
};
|
||||
perSystem = { pkgs, ... }: {
|
||||
packages.custom-weatherwaybar = pkgs.writeShellApplication {
|
||||
name = "custom-weatherwaybar";
|
||||
runtimeInputs = with pkgs; [
|
||||
curl
|
||||
];
|
||||
text = ''
|
||||
PATTERN="C"
|
||||
PATTERN2=" "
|
||||
TEXT1="''$(curl -s "https://wttr.in/?format=%c")"
|
||||
TEXT1=''${TEXT1/$PATTERN2/}
|
||||
TEXT2="''$(curl -s "https://wttr.in/?format=%t")"
|
||||
TEXT2=''${TEXT2/$PATTERN/}
|
||||
TEXT3="''$(curl -s "https://wttr.in/?format=%f")"
|
||||
TEXT3=''${TEXT3/$PATTERN/}
|
||||
printf '{"text":" %s\\n %s\\n %s", "tooltip": false, "class": "weather"}\\n' \
|
||||
"$TEXT1" "$TEXT2" "$TEXT3"
|
||||
'';
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-weatherwaybar = pkgs.writeShellApplication {
|
||||
name = "custom-weatherwaybar";
|
||||
runtimeInputs = with pkgs; [
|
||||
curl
|
||||
];
|
||||
text = ''
|
||||
PATTERN="C"
|
||||
PATTERN2=" "
|
||||
TEXT1="''$(curl -s "https://wttr.in/?format=%c")"
|
||||
TEXT1=''${TEXT1/$PATTERN2/}
|
||||
TEXT2="''$(curl -s "https://wttr.in/?format=%t")"
|
||||
TEXT2=''${TEXT2/$PATTERN/}
|
||||
TEXT3="''$(curl -s "https://wttr.in/?format=%f")"
|
||||
TEXT3=''${TEXT3/$PATTERN/}
|
||||
printf '{"text":" %s\\n %s\\n %s", "tooltip": false, "class": "weather"}\\n' \
|
||||
"$TEXT1" "$TEXT2" "$TEXT3"
|
||||
'';
|
||||
};
|
||||
};
|
||||
};}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
# replaced by wlogout
|
||||
flake.homeModules.wlogout = { ... }: let
|
||||
flake.homeModules.wlogout = _: let
|
||||
wallpaper = ../../assets/wallpaper1.jpg;
|
||||
lock = ../../assets/lock.png;
|
||||
lock-hover = ../../assets/lock-hover.png;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.zoxide = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.zoxide = _: {
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ self, ... }: {
|
||||
flake.homeModules.zsh-laptop = { ... }: {
|
||||
{self, ...}: {
|
||||
flake.homeModules.zsh-laptop = _: {
|
||||
programs.zsh = {
|
||||
shellAliases = {
|
||||
snrt = "git -C ~/nixos add -A && time sudo nixos-rebuild test --flake ~/nixos/#laptop && pkill shell || true && pkill caelestia-shell || true && caelestia-shell -n > /dev/null 2>&1 & disown";
|
||||
@@ -7,7 +7,7 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
flake.homeModules.zsh = {pkgs,...}: {
|
||||
flake.homeModules.zsh = {pkgs, ...}: {
|
||||
home.packages = [
|
||||
self.packages.${pkgs.system}.dejaManuallyDerived
|
||||
#pkgs-unstable.deja
|
||||
@@ -67,7 +67,7 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
flake.homeModules.oh-my-zsh = { ... }: {
|
||||
flake.homeModules.oh-my-zsh = _: {
|
||||
programs.zsh.oh-my-zsh = {
|
||||
enable = true;
|
||||
theme = "jonathan";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.battery-laptop = {
|
||||
lib,
|
||||
config,
|
||||
@@ -53,7 +53,7 @@
|
||||
};
|
||||
# };
|
||||
};
|
||||
perSystem = { pkgs, ... }: let
|
||||
perSystem = {pkgs, ...}: let
|
||||
NotifySound = ../../assets/battery_notify.mp3;
|
||||
in {
|
||||
packages.custom-batterynotify = pkgs.writeShellApplication {
|
||||
@@ -331,104 +331,105 @@
|
||||
install -m755 qtbatticon $out/bin/
|
||||
'';
|
||||
};
|
||||
# This was replaced by caelestia shell's Game Mode
|
||||
packages.custom-performance = pkgs.writeShellApplication {
|
||||
name = "custom-performance";
|
||||
runtimeInputs = with pkgs; [
|
||||
hyprland
|
||||
gawk
|
||||
libnotify
|
||||
];
|
||||
text = ''
|
||||
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
|
||||
if [ "$HYPRGAMEMODE" = 1 ] ; then
|
||||
hyprctl --batch "\
|
||||
keyword animations:enabled 0;\
|
||||
keyword animation borderangle,0; \
|
||||
keyword decoration:shadow:enabled 0;\
|
||||
keyword decoration:blur:enabled 0;\
|
||||
keyword decoration:fullscreen_opacity 1;\
|
||||
keyword general:gaps_in 0;\
|
||||
keyword general:gaps_out 0;\
|
||||
keyword general:border_size 1;\
|
||||
keyword decoration:rounding 0"
|
||||
notify-send -u critical -t 5000 "Performance mode [ON]"
|
||||
exit
|
||||
else
|
||||
notify-send -u critical -t 5000 "Performance mode [OFF]"
|
||||
hyprctl reload
|
||||
exit 0
|
||||
fi
|
||||
'';
|
||||
};
|
||||
# Old script that was used for the battery. Might not work.
|
||||
packages.custom-olddeprecatedbatterynotify = pkgs.writeShellApplication {
|
||||
name = "custom-olddeprecatedbatterynotify";
|
||||
|
||||
runtimeInputs = with pkgs; [
|
||||
libnotify # provides notify-send
|
||||
systemd # provides systemctl
|
||||
];
|
||||
|
||||
text = ''
|
||||
set -euo pipefail
|
||||
|
||||
LOW="''${BATTERY_LOW_THRESHOLD:-20}"
|
||||
CRITICAL="''${BATTERY_CRITICAL_THRESHOLD:-5}"
|
||||
FULL="''${BATTERY_FULL_THRESHOLD:-95}"
|
||||
INTERVAL="''${BATTERY_INTERVAL:-30}"
|
||||
ACTION="''${BATTERY_CRITICAL_ACTION:-systemctl suspend}"
|
||||
|
||||
notify() {
|
||||
notify-send -a "Battery" -u "$1" "$2" "$3"
|
||||
}
|
||||
|
||||
get_info() {
|
||||
total=0
|
||||
count=0
|
||||
|
||||
for bat in /sys/class/power_supply/BAT*; do
|
||||
[ -f "$bat/capacity" ] || continue
|
||||
capacity=$(<"$bat/capacity")
|
||||
status=$(<"$bat/status")
|
||||
total=$((total + capacity))
|
||||
count=$((count + 1))
|
||||
done
|
||||
|
||||
[ "$count" -gt 0 ] || exit 0
|
||||
percentage=$((total / count))
|
||||
}
|
||||
|
||||
last_state=""
|
||||
|
||||
while true; do
|
||||
get_info
|
||||
|
||||
if [[ "$status" == "Discharging" && "$percentage" -le "$CRITICAL" ]]; then
|
||||
notify critical "Battery Critically Low" "$percentage% — suspending."
|
||||
$ACTION
|
||||
|
||||
elif [[ "$status" == "Discharging" && "$percentage" -le "$LOW" ]]; then
|
||||
if [[ "$last_state" != "low" ]]; then
|
||||
notify normal "Battery Low" "$percentage% remaining."
|
||||
last_state="low"
|
||||
fi
|
||||
|
||||
elif [[ "$status" != "Discharging" && "$percentage" -ge "$FULL" ]]; then
|
||||
if [[ "$last_state" != "full" ]]; then
|
||||
notify normal "Battery Full" "$percentage% — unplug charger."
|
||||
last_state="full"
|
||||
fi
|
||||
|
||||
# This was replaced by caelestia shell's Game Mode
|
||||
packages.custom-performance = pkgs.writeShellApplication {
|
||||
name = "custom-performance";
|
||||
runtimeInputs = with pkgs; [
|
||||
hyprland
|
||||
gawk
|
||||
libnotify
|
||||
];
|
||||
text = ''
|
||||
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
|
||||
if [ "$HYPRGAMEMODE" = 1 ] ; then
|
||||
hyprctl --batch "\
|
||||
keyword animations:enabled 0;\
|
||||
keyword animation borderangle,0; \
|
||||
keyword decoration:shadow:enabled 0;\
|
||||
keyword decoration:blur:enabled 0;\
|
||||
keyword decoration:fullscreen_opacity 1;\
|
||||
keyword general:gaps_in 0;\
|
||||
keyword general:gaps_out 0;\
|
||||
keyword general:border_size 1;\
|
||||
keyword decoration:rounding 0"
|
||||
notify-send -u critical -t 5000 "Performance mode [ON]"
|
||||
exit
|
||||
else
|
||||
last_state=""
|
||||
notify-send -u critical -t 5000 "Performance mode [OFF]"
|
||||
hyprctl reload
|
||||
exit 0
|
||||
fi
|
||||
'';
|
||||
};
|
||||
# Old script that was used for the battery. Might not work.
|
||||
packages.custom-olddeprecatedbatterynotify = pkgs.writeShellApplication {
|
||||
name = "custom-olddeprecatedbatterynotify";
|
||||
|
||||
sleep "$INTERVAL"
|
||||
done
|
||||
'';
|
||||
};};
|
||||
flake.homeModules.cbatticon = { ... }: {
|
||||
runtimeInputs = with pkgs; [
|
||||
libnotify # provides notify-send
|
||||
systemd # provides systemctl
|
||||
];
|
||||
|
||||
text = ''
|
||||
set -euo pipefail
|
||||
|
||||
LOW="''${BATTERY_LOW_THRESHOLD:-20}"
|
||||
CRITICAL="''${BATTERY_CRITICAL_THRESHOLD:-5}"
|
||||
FULL="''${BATTERY_FULL_THRESHOLD:-95}"
|
||||
INTERVAL="''${BATTERY_INTERVAL:-30}"
|
||||
ACTION="''${BATTERY_CRITICAL_ACTION:-systemctl suspend}"
|
||||
|
||||
notify() {
|
||||
notify-send -a "Battery" -u "$1" "$2" "$3"
|
||||
}
|
||||
|
||||
get_info() {
|
||||
total=0
|
||||
count=0
|
||||
|
||||
for bat in /sys/class/power_supply/BAT*; do
|
||||
[ -f "$bat/capacity" ] || continue
|
||||
capacity=$(<"$bat/capacity")
|
||||
status=$(<"$bat/status")
|
||||
total=$((total + capacity))
|
||||
count=$((count + 1))
|
||||
done
|
||||
|
||||
[ "$count" -gt 0 ] || exit 0
|
||||
percentage=$((total / count))
|
||||
}
|
||||
|
||||
last_state=""
|
||||
|
||||
while true; do
|
||||
get_info
|
||||
|
||||
if [[ "$status" == "Discharging" && "$percentage" -le "$CRITICAL" ]]; then
|
||||
notify critical "Battery Critically Low" "$percentage% — suspending."
|
||||
$ACTION
|
||||
|
||||
elif [[ "$status" == "Discharging" && "$percentage" -le "$LOW" ]]; then
|
||||
if [[ "$last_state" != "low" ]]; then
|
||||
notify normal "Battery Low" "$percentage% remaining."
|
||||
last_state="low"
|
||||
fi
|
||||
|
||||
elif [[ "$status" != "Discharging" && "$percentage" -ge "$FULL" ]]; then
|
||||
if [[ "$last_state" != "full" ]]; then
|
||||
notify normal "Battery Full" "$percentage% — unplug charger."
|
||||
last_state="full"
|
||||
fi
|
||||
|
||||
else
|
||||
last_state=""
|
||||
fi
|
||||
|
||||
sleep "$INTERVAL"
|
||||
done
|
||||
'';
|
||||
};
|
||||
};
|
||||
flake.homeModules.cbatticon = _: {
|
||||
# don't works. some GTK error. I let it here if someday, someone is interest in this shit.
|
||||
# ChatGPT half baked a replacement that works on my system.
|
||||
# see qtbatticon
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ...}: {
|
||||
_: {
|
||||
flake.nixosModules.bluetooth = {pkgs, ...}: {
|
||||
hardware.bluetooth.enable = true;
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.bootloader-laptop = {
|
||||
inputs,
|
||||
pkgs,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{ ... }: {
|
||||
flake.nixosModules.disk = { pkgs, ... }: {
|
||||
_: {
|
||||
flake.nixosModules.disk = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
gnome-disk-utility
|
||||
udiskie
|
||||
];
|
||||
};
|
||||
flake.nixosModules.disk-laptop = { ... }: {
|
||||
flake.nixosModules.disk-laptop = _: {
|
||||
# i found swap necessary when running nixpkgs review
|
||||
swapDevices = [
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.hardware-configuration-laptop = {
|
||||
config,
|
||||
lib,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.hardwareUtils-laptop = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
# used for the framework 16 laptop
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.nixosModules.udev = { ... }: {
|
||||
_: {
|
||||
flake.nixosModules.udev = _: {
|
||||
# udev with only the necessary rules. See udev.nix to get all the rules
|
||||
services.udev.extraRules = ''
|
||||
# adapted from here https://wiki.nixos.org/wiki/Keychron_M6
|
||||
|
||||
+19
-17
@@ -1,16 +1,19 @@
|
||||
{ inputs, self, ...}: {
|
||||
{
|
||||
inputs,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
flake.nixosConfigurations.laptop = inputs.nixpkgs.lib.nixosSystem {
|
||||
#system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
inherit (self) pkgs-unstable;
|
||||
};
|
||||
modules = with self.nixosModules; [
|
||||
|
||||
# important do not remove
|
||||
home-manager-laptop
|
||||
laptop
|
||||
{ nixpkgs.pkgs = self.pkgs; }
|
||||
# keep this alphabetically organised
|
||||
{nixpkgs.pkgs = self.pkgs;}
|
||||
# keep this alphabetically organised
|
||||
anki
|
||||
audioAndMedia
|
||||
autoCleanup-laptop
|
||||
@@ -44,7 +47,7 @@
|
||||
user
|
||||
];
|
||||
};
|
||||
flake.homeModules.laptop = { ... }: {
|
||||
flake.homeModules.laptop = {...}: {
|
||||
imports = with self.homeModules; [
|
||||
inputs.caelestia-shell.homeManagerModules.default
|
||||
anki
|
||||
@@ -67,13 +70,13 @@
|
||||
ssh
|
||||
thunderbird
|
||||
tomasr
|
||||
vivify
|
||||
vivify
|
||||
zoxide
|
||||
zsh
|
||||
zsh-laptop
|
||||
];
|
||||
};
|
||||
flake.nixosModules.laptop = { ... }: {
|
||||
flake.nixosModules.laptop = _: {
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
@@ -81,25 +84,25 @@
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "25.11"; # Did you read the comment?
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
};
|
||||
flake.nixosModules.home-manager-laptop = { pkgs, ... }: {
|
||||
flake.nixosModules.home-manager-laptop = {pkgs, ...}: {
|
||||
imports = [
|
||||
inputs.home-manager.nixosModules.default # import official home-manager NixOS module
|
||||
];
|
||||
|
||||
# Warning. Git is used in case I break everything up. It already saved me once
|
||||
environment.systemPackages = [ pkgs.git ];
|
||||
environment.systemPackages = [pkgs.git];
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
extraSpecialArgs = {
|
||||
pkgs-unstable = self.pkgs-unstable;
|
||||
inherit self;
|
||||
inherit (self) pkgs-unstable;
|
||||
inherit self;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -108,8 +111,7 @@
|
||||
};
|
||||
home-manager.users.tomasr = self.homeModules.laptop;
|
||||
};
|
||||
flake.homeModules.tomasr = { ... }: {
|
||||
|
||||
flake.homeModules.tomasr = _: {
|
||||
home.username = "tomasr";
|
||||
home.homeDirectory = "/home/tomasr";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.IO = {pkgs, ...}: {
|
||||
# Configure keymap in X11
|
||||
services.xserver.xkb = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.homeModules.cursor = {pkgs, ...}: {
|
||||
home.pointerCursor = {
|
||||
hyprcursor.enable = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.homeModules.desktopEntries = { ... }: {
|
||||
_: {
|
||||
flake.homeModules.desktopEntries = _: {
|
||||
# for when the system lacks of a .desktop file
|
||||
home.file.".local/share/applications/org.quickshell.desktop" = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ ... }: {
|
||||
flake.nixosModules.fonts = { pkgs, ... }: {
|
||||
_: {
|
||||
flake.nixosModules.fonts = {pkgs, ...}: {
|
||||
# fonts
|
||||
fonts.packages = with pkgs; [
|
||||
nerd-fonts._0xproto
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.printer = {pkgs, ...}: {
|
||||
#https://wiki.nixos.org/wiki/Printing
|
||||
services.avahi = {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.user = {
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
services.dbus.enable = true;
|
||||
security.polkit.enable = true;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{ ... }: {
|
||||
perSystem = { pkgs, ... }: {
|
||||
packages.custom-bottom = pkgs.writeShellApplication {
|
||||
name = "custom-bottom";
|
||||
runtimeInputs = with pkgs; [
|
||||
kitty
|
||||
bottom
|
||||
];
|
||||
text = ''
|
||||
kitty --class "custom-bottom" -o font_size=10 --name "custom-bottom" -e btm --theme gruvbox --disable-click --disable_advanced_kill --enable_cache_memory -g -R -T
|
||||
'';
|
||||
_: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-bottom = pkgs.writeShellApplication {
|
||||
name = "custom-bottom";
|
||||
runtimeInputs = with pkgs; [
|
||||
kitty
|
||||
bottom
|
||||
];
|
||||
text = ''
|
||||
kitty --class "custom-bottom" -o font_size=10 --name "custom-bottom" -e btm --theme gruvbox --disable-click --disable_advanced_kill --enable_cache_memory -g -R -T
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,75 +1,74 @@
|
||||
{ ... }: {
|
||||
|
||||
perSystem = { pkgs, ... }: {
|
||||
packages.custom-colorpicker = pkgs.writeShellApplication {
|
||||
# useless. Just use hyprpicker
|
||||
name = "custom-colorpicker";
|
||||
runtimeInputs = with pkgs; [
|
||||
hyprpicker
|
||||
libnotify
|
||||
toybox
|
||||
wl-clipboard
|
||||
];
|
||||
text = ''
|
||||
check() {
|
||||
command -v "$1" 1>/dev/null
|
||||
}
|
||||
|
||||
notify() {
|
||||
check notify-send && {
|
||||
notify-send -a "Color Picker" "$@"
|
||||
return
|
||||
_: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-colorpicker = pkgs.writeShellApplication {
|
||||
# useless. Just use hyprpicker
|
||||
name = "custom-colorpicker";
|
||||
runtimeInputs = with pkgs; [
|
||||
hyprpicker
|
||||
libnotify
|
||||
toybox
|
||||
wl-clipboard
|
||||
];
|
||||
text = ''
|
||||
check() {
|
||||
command -v "$1" 1>/dev/null
|
||||
}
|
||||
echo "$@"
|
||||
}
|
||||
|
||||
loc="$HOME/.cache/colorpicker"
|
||||
[ -d "$loc" ] || mkdir -p "$loc"
|
||||
[ -f "$loc/colors" ] || touch "$loc/colors"
|
||||
notify() {
|
||||
check notify-send && {
|
||||
notify-send -a "Color Picker" "$@"
|
||||
return
|
||||
}
|
||||
echo "$@"
|
||||
}
|
||||
|
||||
limit=10
|
||||
loc="$HOME/.cache/colorpicker"
|
||||
[ -d "$loc" ] || mkdir -p "$loc"
|
||||
[ -f "$loc/colors" ] || touch "$loc/colors"
|
||||
|
||||
[[ $# -eq 1 && $1 = "-l" ]] && {
|
||||
cat "$loc/colors"
|
||||
exit
|
||||
}
|
||||
limit=10
|
||||
|
||||
[[ $# -eq 1 && $1 = "-j" ]] && {
|
||||
text="$(head -n 1 "$loc/colors")"
|
||||
[[ $# -eq 1 && $1 = "-l" ]] && {
|
||||
cat "$loc/colors"
|
||||
exit
|
||||
}
|
||||
|
||||
mapfile -t allcolors < <(tail -n +2 "$loc/colors")
|
||||
# allcolors=($(tail -n +2 "$loc/colors"))
|
||||
tooltip="<b> COLORS</b>\n\n"
|
||||
[[ $# -eq 1 && $1 = "-j" ]] && {
|
||||
text="$(head -n 1 "$loc/colors")"
|
||||
|
||||
tooltip+="-> <b>$text</b> <span color='$text'></span> \n"
|
||||
for i in "''${allcolors[@]}"; do
|
||||
tooltip+=" <b>$i</b> <span color='$i'></span> \n"
|
||||
done
|
||||
mapfile -t allcolors < <(tail -n +2 "$loc/colors")
|
||||
# allcolors=($(tail -n +2 "$loc/colors"))
|
||||
tooltip="<b> COLORS</b>\n\n"
|
||||
|
||||
cat <<EOF
|
||||
{ "text":"<span color='$text'></span>", "tooltip":"$tooltip"}
|
||||
EOF
|
||||
tooltip+="-> <b>$text</b> <span color='$text'></span> \n"
|
||||
for i in "''${allcolors[@]}"; do
|
||||
tooltip+=" <b>$i</b> <span color='$i'></span> \n"
|
||||
done
|
||||
|
||||
exit
|
||||
}
|
||||
cat <<EOF
|
||||
{ "text":"<span color='$text'></span>", "tooltip":"$tooltip"}
|
||||
EOF
|
||||
|
||||
check hyprpicker || {
|
||||
notify "hyprpicker is not installed"
|
||||
exit
|
||||
}
|
||||
killall -q hyprpicker
|
||||
color=$(hyprpicker)
|
||||
exit
|
||||
}
|
||||
|
||||
check wl-copy && {
|
||||
echo "$color" | sed -z 's/\n//g' | wl-copy
|
||||
}
|
||||
check hyprpicker || {
|
||||
notify "hyprpicker is not installed"
|
||||
exit
|
||||
}
|
||||
killall -q hyprpicker
|
||||
color=$(hyprpicker)
|
||||
|
||||
prevColors=$(head -n $((limit - 1)) "$loc/colors")
|
||||
echo "$color" >"$loc/colors"
|
||||
echo "$prevColors" >>"$loc/colors"
|
||||
sed -i '/^$/d' "$loc/colors"
|
||||
pkill -RTMIN+1 waybar
|
||||
'';
|
||||
check wl-copy && {
|
||||
echo "$color" | sed -z 's/\n//g' | wl-copy
|
||||
}
|
||||
|
||||
prevColors=$(head -n $((limit - 1)) "$loc/colors")
|
||||
echo "$color" >"$loc/colors"
|
||||
echo "$prevColors" >>"$loc/colors"
|
||||
sed -i '/^$/d' "$loc/colors"
|
||||
pkill -RTMIN+1 waybar
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,83 +1,84 @@
|
||||
{ ... }: {
|
||||
perSystem = { pkgs, ... }: {
|
||||
packages.custom-cowsay = pkgs.writeShellApplication {
|
||||
name = "custom-cowsay";
|
||||
runtimeInputs = with pkgs; [
|
||||
cowsay
|
||||
];
|
||||
text = ''
|
||||
_: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-cowsay = pkgs.writeShellApplication {
|
||||
name = "custom-cowsay";
|
||||
runtimeInputs = with pkgs; [
|
||||
cowsay
|
||||
];
|
||||
text = ''
|
||||
|
||||
cows=("actually" "alpaca" "bud-frogs" "daemon" "elephant-in-snake" "moofasa" "skeleton" "three-eyes" "supermilker" "tux" "vader" "www")
|
||||
declare -a sentences=(
|
||||
"Sharing knowledge is the most fundamental act of friendship. Because it is a way you can give something without loosing something. -Richard Stallman"
|
||||
"Free software' is a matter of liberty, not price. To understand the concept, you should think of 'free' as in 'free speech,' not as in 'free beer'. -Richard Stallman"
|
||||
"Programming is not a science. Programming is a craft. -Richard Stallman"
|
||||
"I did write some code in Java once, but that was the island in Indonesia. -Richard Stallman"
|
||||
"Facebook is not your friend, it is a surveillance engine. -Richard Stallman"
|
||||
"People said I should accept the world. Bullshit! I don't accept the world. -Richard Stallman"
|
||||
"You can use any editor you want, but remember that vi vi vi is the text editor of the beast. -Richard Stallman"
|
||||
"The idea of copyright did not exist in ancient times, when authors frequently copied other authors at length in works of non-fiction. This practice was useful, and is the only way many authors' works have survived even in part. -Richard Stallman"
|
||||
"Idiots can be defeated but they never admit it. -Richard Stallman"
|
||||
"Open source is a development methodology; free software is a social movement. -Richard Stallman"
|
||||
"People sometimes ask me if it is a sin in the Church of Emacs to use vi. Using a free version of vi is not a sin; it is a penance. So happy hacking. -Richard Stallman"
|
||||
"A computer is like air conditioning - it becomes useless when you open Windows -Linus Torvald"
|
||||
"Intelligence is the ability to avoid doing work, yet getting the work done. -Linus Torvald"
|
||||
"Software is like sex: It's better when it's free. -Linus Torvald"
|
||||
"All operating systems sucks, but Linux just sucks less -Linus Torvald"
|
||||
"I like offending people, because I think people who get offended should be offended. -Linus Torval"
|
||||
"Talk is cheap. Show me the code. -Linus Torval"
|
||||
"Most of the good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program. -Linus Torvald"
|
||||
"Bad programmers worry about the code. Good programmers worry about data structures and their relationships. -Linus Torvald"
|
||||
"If Microsoft ever does applications for Linux it means I've won. -Linus Torvald"
|
||||
"Avoiding complexity reduces bugs. -Linus Torvald"
|
||||
"Backups are for wimps. Real men upload their data to an FTP site and have everyone else mirror it. -Linus Torvald"
|
||||
"Nobody actually creates perfect code the first time around, except me. But there's only one of me. -Linus Torvald"
|
||||
"Microsoft isn't evil, they just make really crappy operating systems. -Linus Torvald"
|
||||
"When you say 'I wrote a program that crashed Windows,' people just stare at you blankly and say 'Hey, I got those with the system, for free.' -Linus Torval"
|
||||
"C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. -Linus Torvald"
|
||||
"If you think your users are idiots, only idiots will use it. -Linus Torvald"
|
||||
"My name is Linus, and I am your God. -Linus Torvald"
|
||||
"An infinite number of monkeys typing into GNU emacs would never make a good program. -Linus Torvald"
|
||||
"Object-oriented programming is an exceptionally bad idea which could only have originated in California. -Edgser Dijkstra"
|
||||
"If debugging is the process of removing software bugs, then programming must be the process of putting them in. -Edgser Dijkstra"
|
||||
"The art of programming is the art of organizing complexity. -Edgser Dijkstra"
|
||||
"Program testing can be used to show the presence of bugs, but never to show their absence! -Edgser Dijkstra"
|
||||
"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. -Edgser Dijkstra"
|
||||
"The effort of using machines to mimic the human mind has always struck me as rather silly. I would rather use them to mimic something better. -Edgser Dijkstra"
|
||||
"Computer science is no more about computers than astronomy is about telescopes. -Edgser Dijkstra"
|
||||
"Programming in Basic causes brain damage. -Edgser Dijkstra"
|
||||
"The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague. -Edgser Dijkstra"
|
||||
"If in physics there's something you don't understand, you can always hide behind the uncharted depths of nature. You can always blame God. You didn't make it so complex yourself. But if your program doesn't work, there is no one to hide behind. You cannot hide behind an obstinate nature. If it doesn't work, you've messed up. -Edgser Dijkstra"
|
||||
"Teaching COBOL ought to be regarded as a criminal act. -Edgser Dijkstra"
|
||||
"If you want more effective programmers, you will discover that they should not waste their time debugging, they should not introduce the bugs to start with. -Edgser Dijkstra"
|
||||
"If we wish to count lines of code, we should not regard them as 'lines produced' but as 'lines spent.' -Edgser Dijkstra"
|
||||
"In almost every computation a great variety of arrangements for the succession of the processes is possible, and various considerations must influence the selections amongst them for the purposes of a calculating engine. One essential object is to choose that arrangement which shall tend to reduce to a minimum the time necessary for completing the calculation. -Ada Lovelace"
|
||||
"I’m making an operating system myself, so I know what it’s like to be God. -Terry Davis"
|
||||
"I’m schizophrenic and so am I. -Terry Davis"
|
||||
"If I was a dog, I would bark. -Terry Davis"
|
||||
"Who has a better kernel? Debian? No. -Terry Davis"
|
||||
"Computers are fast, programmers keep it slow. -A random Reddit user"
|
||||
"Before software can be reusable it first has to be usable. -Ralph Johnson"
|
||||
"The best thing about a Boolean is that even if you are wrong, you're only off by a bit. -Anonymous"
|
||||
"It's not a bug, it's a feature. -Programmers"
|
||||
"NVIDIA, fuck you -Linus Torvald"
|
||||
)
|
||||
while true
|
||||
do
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
SIndex=$(( RANDOM % ''${#sentences[@]} ))
|
||||
index=$(( RANDOM % ''${#cows[@]} ))
|
||||
#cow="/usr/share/cowsay/cows/''${cows[index]}.cow"
|
||||
cowsay -f "''${cows[index]}" "''${sentences[SIndex]}"
|
||||
sleep 10
|
||||
clear
|
||||
done
|
||||
'';
|
||||
# reduce terminal size for actually
|
||||
cows=("actually" "alpaca" "bud-frogs" "daemon" "elephant-in-snake" "moofasa" "skeleton" "three-eyes" "supermilker" "tux" "vader" "www")
|
||||
declare -a sentences=(
|
||||
"Sharing knowledge is the most fundamental act of friendship. Because it is a way you can give something without loosing something. -Richard Stallman"
|
||||
"Free software' is a matter of liberty, not price. To understand the concept, you should think of 'free' as in 'free speech,' not as in 'free beer'. -Richard Stallman"
|
||||
"Programming is not a science. Programming is a craft. -Richard Stallman"
|
||||
"I did write some code in Java once, but that was the island in Indonesia. -Richard Stallman"
|
||||
"Facebook is not your friend, it is a surveillance engine. -Richard Stallman"
|
||||
"People said I should accept the world. Bullshit! I don't accept the world. -Richard Stallman"
|
||||
"You can use any editor you want, but remember that vi vi vi is the text editor of the beast. -Richard Stallman"
|
||||
"The idea of copyright did not exist in ancient times, when authors frequently copied other authors at length in works of non-fiction. This practice was useful, and is the only way many authors' works have survived even in part. -Richard Stallman"
|
||||
"Idiots can be defeated but they never admit it. -Richard Stallman"
|
||||
"Open source is a development methodology; free software is a social movement. -Richard Stallman"
|
||||
"People sometimes ask me if it is a sin in the Church of Emacs to use vi. Using a free version of vi is not a sin; it is a penance. So happy hacking. -Richard Stallman"
|
||||
"A computer is like air conditioning - it becomes useless when you open Windows -Linus Torvald"
|
||||
"Intelligence is the ability to avoid doing work, yet getting the work done. -Linus Torvald"
|
||||
"Software is like sex: It's better when it's free. -Linus Torvald"
|
||||
"All operating systems sucks, but Linux just sucks less -Linus Torvald"
|
||||
"I like offending people, because I think people who get offended should be offended. -Linus Torval"
|
||||
"Talk is cheap. Show me the code. -Linus Torval"
|
||||
"Most of the good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program. -Linus Torvald"
|
||||
"Bad programmers worry about the code. Good programmers worry about data structures and their relationships. -Linus Torvald"
|
||||
"If Microsoft ever does applications for Linux it means I've won. -Linus Torvald"
|
||||
"Avoiding complexity reduces bugs. -Linus Torvald"
|
||||
"Backups are for wimps. Real men upload their data to an FTP site and have everyone else mirror it. -Linus Torvald"
|
||||
"Nobody actually creates perfect code the first time around, except me. But there's only one of me. -Linus Torvald"
|
||||
"Microsoft isn't evil, they just make really crappy operating systems. -Linus Torvald"
|
||||
"When you say 'I wrote a program that crashed Windows,' people just stare at you blankly and say 'Hey, I got those with the system, for free.' -Linus Torval"
|
||||
"C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. -Linus Torvald"
|
||||
"If you think your users are idiots, only idiots will use it. -Linus Torvald"
|
||||
"My name is Linus, and I am your God. -Linus Torvald"
|
||||
"An infinite number of monkeys typing into GNU emacs would never make a good program. -Linus Torvald"
|
||||
"Object-oriented programming is an exceptionally bad idea which could only have originated in California. -Edgser Dijkstra"
|
||||
"If debugging is the process of removing software bugs, then programming must be the process of putting them in. -Edgser Dijkstra"
|
||||
"The art of programming is the art of organizing complexity. -Edgser Dijkstra"
|
||||
"Program testing can be used to show the presence of bugs, but never to show their absence! -Edgser Dijkstra"
|
||||
"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. -Edgser Dijkstra"
|
||||
"The effort of using machines to mimic the human mind has always struck me as rather silly. I would rather use them to mimic something better. -Edgser Dijkstra"
|
||||
"Computer science is no more about computers than astronomy is about telescopes. -Edgser Dijkstra"
|
||||
"Programming in Basic causes brain damage. -Edgser Dijkstra"
|
||||
"The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague. -Edgser Dijkstra"
|
||||
"If in physics there's something you don't understand, you can always hide behind the uncharted depths of nature. You can always blame God. You didn't make it so complex yourself. But if your program doesn't work, there is no one to hide behind. You cannot hide behind an obstinate nature. If it doesn't work, you've messed up. -Edgser Dijkstra"
|
||||
"Teaching COBOL ought to be regarded as a criminal act. -Edgser Dijkstra"
|
||||
"If you want more effective programmers, you will discover that they should not waste their time debugging, they should not introduce the bugs to start with. -Edgser Dijkstra"
|
||||
"If we wish to count lines of code, we should not regard them as 'lines produced' but as 'lines spent.' -Edgser Dijkstra"
|
||||
"In almost every computation a great variety of arrangements for the succession of the processes is possible, and various considerations must influence the selections amongst them for the purposes of a calculating engine. One essential object is to choose that arrangement which shall tend to reduce to a minimum the time necessary for completing the calculation. -Ada Lovelace"
|
||||
"I’m making an operating system myself, so I know what it’s like to be God. -Terry Davis"
|
||||
"I’m schizophrenic and so am I. -Terry Davis"
|
||||
"If I was a dog, I would bark. -Terry Davis"
|
||||
"Who has a better kernel? Debian? No. -Terry Davis"
|
||||
"Computers are fast, programmers keep it slow. -A random Reddit user"
|
||||
"Before software can be reusable it first has to be usable. -Ralph Johnson"
|
||||
"The best thing about a Boolean is that even if you are wrong, you're only off by a bit. -Anonymous"
|
||||
"It's not a bug, it's a feature. -Programmers"
|
||||
"NVIDIA, fuck you -Linus Torvald"
|
||||
)
|
||||
while true
|
||||
do
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
SIndex=$(( RANDOM % ''${#sentences[@]} ))
|
||||
index=$(( RANDOM % ''${#cows[@]} ))
|
||||
#cow="/usr/share/cowsay/cows/''${cows[index]}.cow"
|
||||
cowsay -f "''${cows[index]}" "''${sentences[SIndex]}"
|
||||
sleep 10
|
||||
clear
|
||||
done
|
||||
'';
|
||||
# reduce terminal size for actually
|
||||
};
|
||||
};
|
||||
};}
|
||||
}
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
{ ... }: {
|
||||
perSystem = { pkgs, ... }: {
|
||||
# fzf librewolf profile selector
|
||||
packages.custom-librewolfprofiles = pkgs.writeShellApplication {
|
||||
name = "custom-librewolfprofiles";
|
||||
runtimeInputs = with pkgs; [
|
||||
zsh
|
||||
fzf
|
||||
];
|
||||
text = ''
|
||||
# List of profiles
|
||||
profiles=("work" "other" "private window")
|
||||
_: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
# fzf librewolf profile selector
|
||||
packages.custom-librewolfprofiles = pkgs.writeShellApplication {
|
||||
name = "custom-librewolfprofiles";
|
||||
runtimeInputs = with pkgs; [
|
||||
zsh
|
||||
fzf
|
||||
];
|
||||
text = ''
|
||||
# List of profiles
|
||||
profiles=("work" "other" "private window")
|
||||
|
||||
# Use fzf to select
|
||||
selected=$(printf "%s\n" "''${profiles[@]}" | fzf --height 6 --reverse --prompt="Select LibreWolf profile:")
|
||||
# Use fzf to select
|
||||
selected=$(printf "%s\n" "''${profiles[@]}" | fzf --height 6 --reverse --prompt="Select LibreWolf profile:")
|
||||
|
||||
# If user cancels, exit
|
||||
[[ -z "$selected" ]] && exit 0
|
||||
# If user cancels, exit
|
||||
[[ -z "$selected" ]] && exit 0
|
||||
|
||||
# Launch LibreWolf detached, keeping environment
|
||||
if [[ "$selected" == "private window" ]]; then
|
||||
setsid librewolf --private-window --no-remote >/dev/null 2>&1 &
|
||||
pkill -f "kitty.*Select LibreWolf profile"
|
||||
else
|
||||
setsid librewolf -P "$selected" --no-remote >/dev/null 2>&1 &
|
||||
pkill -f "kitty.*Select LibreWolf profile"
|
||||
fi
|
||||
# Launch LibreWolf detached, keeping environment
|
||||
if [[ "$selected" == "private window" ]]; then
|
||||
setsid librewolf --private-window --no-remote >/dev/null 2>&1 &
|
||||
pkill -f "kitty.*Select LibreWolf profile"
|
||||
else
|
||||
setsid librewolf -P "$selected" --no-remote >/dev/null 2>&1 &
|
||||
pkill -f "kitty.*Select LibreWolf profile"
|
||||
fi
|
||||
|
||||
# Exit the kitty terminal after selection
|
||||
exit
|
||||
'';
|
||||
};
|
||||
# Exit the kitty terminal after selection
|
||||
exit
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,30 +1,31 @@
|
||||
{ ... }:
|
||||
{
|
||||
perSystem = { pkgs, ... }: {
|
||||
# counts how many syllabes in a string.
|
||||
# not perfect. Does not handle silents e in french
|
||||
# but that's what I use for writing poetry
|
||||
packages.custom-syllabes = pkgs.writers.writePython3Bin "custom-syllabes" {
|
||||
libraries = with pkgs; [
|
||||
python3Packages.pyphen
|
||||
];
|
||||
} ''
|
||||
import sys
|
||||
import pyphen
|
||||
_: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
# counts how many syllabes in a string.
|
||||
# not perfect. Does not handle silents e in french
|
||||
# but that's what I use for writing poetry
|
||||
packages.custom-syllabes =
|
||||
pkgs.writers.writePython3Bin "custom-syllabes" {
|
||||
libraries = with pkgs; [
|
||||
python3Packages.pyphen
|
||||
];
|
||||
} ''
|
||||
import sys
|
||||
import pyphen
|
||||
|
||||
dic = pyphen.Pyphen(lang="fr")
|
||||
dic = pyphen.Pyphen(lang="fr")
|
||||
|
||||
text = sys.stdin.read().strip()
|
||||
text = sys.stdin.read().strip()
|
||||
|
||||
chunks = []
|
||||
total = 0
|
||||
chunks = []
|
||||
total = 0
|
||||
|
||||
for w in text.split():
|
||||
hyphenated = dic.inserted(w)
|
||||
parts = hyphenated.split("-")
|
||||
chunks.append("/".join(parts))
|
||||
total += len(parts)
|
||||
for w in text.split():
|
||||
hyphenated = dic.inserted(w)
|
||||
parts = hyphenated.split("-")
|
||||
chunks.append("/".join(parts))
|
||||
total += len(parts)
|
||||
|
||||
print(f"{total} ({'/'.join(chunks)})")
|
||||
'';
|
||||
};}
|
||||
print(f"{total} ({'/'.join(chunks)})")
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
{ ... }:
|
||||
{
|
||||
perSystem = { pkgs, ...}: {
|
||||
packages.custom-tomato = pkgs.writeShellApplication {
|
||||
name = "custom-tomato";
|
||||
runtimeInputs = with pkgs; [
|
||||
kitty
|
||||
tomato-c
|
||||
];
|
||||
text = ''
|
||||
kitty --class "custom-pomodoro" --name "custom-pomodoro" -e tomato
|
||||
'';
|
||||
_: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-tomato = pkgs.writeShellApplication {
|
||||
name = "custom-tomato";
|
||||
runtimeInputs = with pkgs; [
|
||||
kitty
|
||||
tomato-c
|
||||
];
|
||||
text = ''
|
||||
kitty --class "custom-pomodoro" --name "custom-pomodoro" -e tomato
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
{ ... }:
|
||||
{
|
||||
perSystem = { pkgs, ... }: {
|
||||
packages.custom-weather = pkgs.writeShellApplication {
|
||||
name = "custom-weather";
|
||||
runtimeInputs = with pkgs; [
|
||||
curl
|
||||
];
|
||||
text = ''
|
||||
while true; do
|
||||
curl "https://wttr.in/?0&d&q&F&lang=fr"
|
||||
sleep 7200
|
||||
done
|
||||
'';
|
||||
_: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-weather = pkgs.writeShellApplication {
|
||||
name = "custom-weather";
|
||||
runtimeInputs = with pkgs; [
|
||||
curl
|
||||
];
|
||||
text = ''
|
||||
while true; do
|
||||
curl "https://wttr.in/?0&d&q&F&lang=fr"
|
||||
sleep 7200
|
||||
done
|
||||
'';
|
||||
};
|
||||
};
|
||||
};}
|
||||
}
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
{ self, ... }: {
|
||||
perSystem = { pkgs, ...}:
|
||||
let
|
||||
pkgs-unstable = self.pkgs-unstable;
|
||||
in
|
||||
{ # perSystem doesnt like pkgs-unstable we must input it globally
|
||||
packages.dejaManuallyDerived = pkgs-unstable.buildGoModule (finalAttrs: {
|
||||
pname = "deja";
|
||||
version = "0.2.6";
|
||||
__structuredAttrs = true;
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "Giammarco-Ferranti";
|
||||
repo = "deja";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-xxbClKhhSwo+jUjAZ2gS4yOS5sSI76dfPpDzA3qdV18=";
|
||||
};
|
||||
{self, ...}: {
|
||||
perSystem = {pkgs, ...}: let
|
||||
inherit (self) pkgs-unstable;
|
||||
in {
|
||||
# perSystem doesnt like pkgs-unstable we must input it globally
|
||||
packages.dejaManuallyDerived = pkgs-unstable.buildGoModule (finalAttrs: {
|
||||
pname = "deja";
|
||||
version = "0.2.6";
|
||||
__structuredAttrs = true;
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "Giammarco-Ferranti";
|
||||
repo = "deja";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-xxbClKhhSwo+jUjAZ2gS4yOS5sSI76dfPpDzA3qdV18=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-KmLdMK94cGOXMPJwWS6NgLB5OiNmJbszHdnLzauqJm8=";
|
||||
vendorHash = "sha256-KmLdMK94cGOXMPJwWS6NgLB5OiNmJbszHdnLzauqJm8=";
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X main.version=${finalAttrs.version}"
|
||||
];
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X main.version=${finalAttrs.version}"
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
doCheck = true;
|
||||
|
||||
nativeCheckInputs = [pkgs.versionCheckHook];
|
||||
nativeCheckInputs = [pkgs.versionCheckHook];
|
||||
|
||||
passthru.updateScript = pkgs.nix-update-script {};
|
||||
passthru.updateScript = pkgs.nix-update-script {};
|
||||
|
||||
meta = {
|
||||
description = "Predictive inline shell autosuggestions for zsh";
|
||||
homepage = "https://github.com/Giammarco-Ferranti/deja";
|
||||
license = pkgs.lib.licenses.mit;
|
||||
platforms = pkgs.lib.platforms.unix;
|
||||
maintainers = with pkgs.lib.maintainers; [tomasrivera];
|
||||
mainProgram = "deja";
|
||||
};
|
||||
});
|
||||
};}
|
||||
meta = {
|
||||
description = "Predictive inline shell autosuggestions for zsh";
|
||||
homepage = "https://github.com/Giammarco-Ferranti/deja";
|
||||
license = pkgs.lib.licenses.mit;
|
||||
platforms = pkgs.lib.platforms.unix;
|
||||
maintainers = with pkgs.lib.maintainers; [tomasrivera];
|
||||
mainProgram = "deja";
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,39 +1,44 @@
|
||||
{ ... }: {
|
||||
perSystem = { pkgs, pkgs-unstable, ... }: {
|
||||
packages.sbb-tuiManuallyDerived = pkgs-unstable.buildGoModule (finalAttrs: {
|
||||
pname = "sbb-tui";
|
||||
version = "1.14.2";
|
||||
__structuredAttrs = true;
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "Necrom4";
|
||||
repo = "sbb-tui";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = pkgs.lib.fakeHash;
|
||||
};
|
||||
_: {
|
||||
perSystem = {
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
packages.sbb-tuiManuallyDerived = pkgs-unstable.buildGoModule (finalAttrs: {
|
||||
pname = "sbb-tui";
|
||||
version = "1.14.2";
|
||||
__structuredAttrs = true;
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "Necrom4";
|
||||
repo = "sbb-tui";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = pkgs.lib.fakeHash;
|
||||
};
|
||||
|
||||
vendorHash = "sha256-K4DOu3rfSlKAa5JNKCzWWpnWZlXXxtN5Po7p1Spqe1w=";
|
||||
vendorHash = "sha256-K4DOu3rfSlKAa5JNKCzWWpnWZlXXxtN5Po7p1Spqe1w=";
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X main.version=${finalAttrs.version}"
|
||||
];
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X main.version=${finalAttrs.version}"
|
||||
];
|
||||
|
||||
allowGoReference = true;
|
||||
allowGoReference = true;
|
||||
|
||||
doCheck = true;
|
||||
doCheck = true;
|
||||
|
||||
nativeCheckInputs = [pkgs.versionCheckHook];
|
||||
nativeCheckInputs = [pkgs.versionCheckHook];
|
||||
|
||||
passthru.updateScript = pkgs.nix-update-script {};
|
||||
passthru.updateScript = pkgs.nix-update-script {};
|
||||
|
||||
meta = {
|
||||
description = "TUI client for Switzerland's public transport timetables, inspired by SBB/CFF/FFS app";
|
||||
homepage = "https://github.com/Necrom4/sbb-tui";
|
||||
license = pkgs.lib.licenses.mit;
|
||||
platforms = pkgs.lib.platforms.unix;
|
||||
maintainers = with pkgs.lib.maintainers; [tomasrivera];
|
||||
mainProgram = "sbb-tui";
|
||||
};
|
||||
});
|
||||
}; }
|
||||
meta = {
|
||||
description = "TUI client for Switzerland's public transport timetables, inspired by SBB/CFF/FFS app";
|
||||
homepage = "https://github.com/Necrom4/sbb-tui";
|
||||
license = pkgs.lib.licenses.mit;
|
||||
platforms = pkgs.lib.platforms.unix;
|
||||
maintainers = with pkgs.lib.maintainers; [tomasrivera];
|
||||
mainProgram = "sbb-tui";
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,78 +1,83 @@
|
||||
{ ... }: {
|
||||
perSystem = { pkgs, nodejs, ... }: {
|
||||
packages.vivifyManuallyDerived = pkgs.stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "vivify";
|
||||
version = "0.14.0";
|
||||
_: {
|
||||
perSystem = {
|
||||
pkgs,
|
||||
nodejs,
|
||||
...
|
||||
}: {
|
||||
packages.vivifyManuallyDerived = pkgs.stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "vivify";
|
||||
version = "0.14.0";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "jannis-baum";
|
||||
repo = "Vivify";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-CszMG+c0bNHfXWqcI3b4iGpeFJ+FmzHDzxflPS+wEe0=";
|
||||
};
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "jannis-baum";
|
||||
repo = "Vivify";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-CszMG+c0bNHfXWqcI3b4iGpeFJ+FmzHDzxflPS+wEe0=";
|
||||
};
|
||||
|
||||
yarnOfflineCache = pkgs.fetchYarnDeps {
|
||||
yarnLock = "${finalAttrs.src}/yarn.lock";
|
||||
hash = "sha256-svgEanFiBSQn0TdTuB0CnLR71lkANABEaDiKB+Vc0Rc=";
|
||||
};
|
||||
yarnOfflineCache = pkgs.fetchYarnDeps {
|
||||
yarnLock = "${finalAttrs.src}/yarn.lock";
|
||||
hash = "sha256-svgEanFiBSQn0TdTuB0CnLR71lkANABEaDiKB+Vc0Rc=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
yarn install
|
||||
yarn install
|
||||
|
||||
substituteInPlace node_modules/.bin/tsc \
|
||||
--replace-fail '/usr/bin/env node' '${pkgs.lib.getExe nodejs}'
|
||||
substituteInPlace node_modules/.bin/tsc \
|
||||
--replace-fail '/usr/bin/env node' '${pkgs.lib.getExe nodejs}'
|
||||
|
||||
substituteInPlace node_modules/.bin/webpack \
|
||||
--replace-fail '/usr/bin/env node' '${pkgs.lib.getExe nodejs}'
|
||||
substituteInPlace node_modules/.bin/webpack \
|
||||
--replace-fail '/usr/bin/env node' '${pkgs.lib.getExe nodejs}'
|
||||
|
||||
substituteInPlace node_modules/.bin/postject \
|
||||
--replace-fail '/usr/bin/env node' '${pkgs.lib.getExe nodejs}'
|
||||
substituteInPlace node_modules/.bin/postject \
|
||||
--replace-fail '/usr/bin/env node' '${pkgs.lib.getExe nodejs}'
|
||||
|
||||
make VIV_VERSION=${finalAttrs.version} linux
|
||||
make VIV_VERSION=${finalAttrs.version} linux
|
||||
|
||||
mkdir -p $out/bin
|
||||
install -Dm755 ./build/linux/viv $out/bin/viv
|
||||
install -Dm755 ./build/linux/vivify-server $out/bin/vivify-server
|
||||
mkdir -p $out/bin
|
||||
install -Dm755 ./build/linux/viv $out/bin/viv
|
||||
install -Dm755 ./build/linux/vivify-server $out/bin/vivify-server
|
||||
|
||||
wrapProgram $out/bin/viv \
|
||||
--prefix PATH : ${
|
||||
pkgs.lib.makeBinPath [
|
||||
pkgs.nodejs
|
||||
pkgs.file
|
||||
]
|
||||
}
|
||||
'';
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
yarnConfigHook
|
||||
npmHooks.npmInstallHook
|
||||
zip
|
||||
|
||||
nodejs
|
||||
file
|
||||
];
|
||||
|
||||
# Stripping 'unneeded symbols' causes vivify-server executable to break
|
||||
# (segmentation fault)
|
||||
dontStrip = true;
|
||||
|
||||
passthru.updateScript = pkgs.nix-update-script {};
|
||||
|
||||
meta = {
|
||||
description = "Live Markdown viewer";
|
||||
longDescription = ''
|
||||
Vivify brings your files to life in the browser!
|
||||
Vivify is primarily made to render Markdown and Jupyter Notebooks, but will also
|
||||
serve as a directory browser and let you view code files with syntax highlighting.
|
||||
wrapProgram $out/bin/viv \
|
||||
--prefix PATH : ${
|
||||
pkgs.lib.makeBinPath [
|
||||
pkgs.nodejs
|
||||
pkgs.file
|
||||
]
|
||||
}
|
||||
'';
|
||||
homepage = "https://github.com/jannis-baum/Vivify";
|
||||
changelog = "https://github.com/jannis-baum/Vivify/releases/tag/v${finalAttrs.src.tag}";
|
||||
license = pkgs.lib.licenses.gpl3;
|
||||
maintainers = with pkgs.lib.maintainers; [skohtv];
|
||||
platforms = pkgs.lib.platforms.linux;
|
||||
mainProgram = "viv";
|
||||
};
|
||||
});
|
||||
};}
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
yarnConfigHook
|
||||
npmHooks.npmInstallHook
|
||||
zip
|
||||
|
||||
nodejs
|
||||
file
|
||||
];
|
||||
|
||||
# Stripping 'unneeded symbols' causes vivify-server executable to break
|
||||
# (segmentation fault)
|
||||
dontStrip = true;
|
||||
|
||||
passthru.updateScript = pkgs.nix-update-script {};
|
||||
|
||||
meta = {
|
||||
description = "Live Markdown viewer";
|
||||
longDescription = ''
|
||||
Vivify brings your files to life in the browser!
|
||||
Vivify is primarily made to render Markdown and Jupyter Notebooks, but will also
|
||||
serve as a directory browser and let you view code files with syntax highlighting.
|
||||
'';
|
||||
homepage = "https://github.com/jannis-baum/Vivify";
|
||||
changelog = "https://github.com/jannis-baum/Vivify/releases/tag/v${finalAttrs.src.tag}";
|
||||
license = pkgs.lib.licenses.gpl3;
|
||||
maintainers = with pkgs.lib.maintainers; [skohtv];
|
||||
platforms = pkgs.lib.platforms.linux;
|
||||
mainProgram = "viv";
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# see https://www.vimjoyer.com/nix/dendritic-home-manager
|
||||
{ inputs, ... }: {
|
||||
{inputs, ...}: {
|
||||
imports = [
|
||||
# adds home-manager options to flake-parts
|
||||
inputs.home-manager.flakeModules.home-manager
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ self, ... }: {
|
||||
{self, ...}: {
|
||||
flake.nixosModules.audioAndMedia = {pkgs, ...}: {
|
||||
# Enable sound with pipewire.
|
||||
services.pulseaudio.enable = false;
|
||||
@@ -41,7 +41,7 @@
|
||||
source = "${pkgs.gpu-screen-recorder}/bin/gsr-kms-server";
|
||||
};
|
||||
};
|
||||
perSystem = { pkgs, ...}: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-changeAudioOutput = pkgs.writeShellApplication {
|
||||
name = "custom-changeAudioOutput";
|
||||
runtimeInputs = with pkgs; [
|
||||
@@ -56,5 +56,6 @@
|
||||
fi
|
||||
pkill -f "kitty.*Select audio output"
|
||||
'';
|
||||
};
|
||||
};
|
||||
};}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
{ self, ... }: {
|
||||
flake.nixosModules.autoCleanup-laptop = {pkgs, pkgs-unstable, ...}: {
|
||||
{self, ...}: {
|
||||
flake.nixosModules.autoCleanup-laptop = {
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
# Ensure your script is available system-wide
|
||||
environment.systemPackages = [
|
||||
self.packages.${pkgs.system}.custom-cleanNix-laptop
|
||||
@@ -45,7 +49,7 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
perSystem = { pkgs, ... }: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-cleanNix-laptop = pkgs.writeShellApplication {
|
||||
name = "custom-cleanNix";
|
||||
|
||||
@@ -116,4 +120,5 @@
|
||||
rm -f "$ERROR_FILE"
|
||||
'';
|
||||
};
|
||||
};}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ self, ... }: {
|
||||
{self, ...}: {
|
||||
flake.nixosModules.autoUpdate-laptop = {pkgs, ...}: {
|
||||
# Ensure your script is available system-wide
|
||||
environment.systemPackages = [
|
||||
@@ -106,4 +106,5 @@
|
||||
rm -f "$ERROR_FILE"
|
||||
'';
|
||||
};
|
||||
};}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ self, ...}: {
|
||||
flake.nixosModules.notifications = { pkgs, ... }: {
|
||||
{self, ...}: {
|
||||
flake.nixosModules.notifications = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
libnotify # Library that sends desktop notifications to a notification daemon
|
||||
socat # Utility for bidirectional data transfer between two independent data channels (used to communicate between hyprland and swww to change wallpapers dinamically)
|
||||
@@ -13,7 +13,7 @@
|
||||
self.packages.${pkgs.system}.custom-checkKdrive # check if kdrive is set up with rclone
|
||||
];
|
||||
};
|
||||
perSystem = { pkgs, ...}: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-checkMatrix = pkgs.writeShellApplication {
|
||||
name = "custom-checkMatrix";
|
||||
|
||||
@@ -32,30 +32,31 @@
|
||||
"You are not logged in as @totorile1:unredacted.org\nLog:\n$current"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
packages.custom-gitnotify = pkgs.writeShellApplication {
|
||||
name = "custom-gitnotify";
|
||||
runtimeInputs = with pkgs; [
|
||||
git
|
||||
libnotify
|
||||
];
|
||||
text = ''
|
||||
# Check if git is installed
|
||||
if ! command -v git >/dev/null 2>&1; then
|
||||
exit 0
|
||||
fi
|
||||
};
|
||||
packages.custom-gitnotify = pkgs.writeShellApplication {
|
||||
name = "custom-gitnotify";
|
||||
runtimeInputs = with pkgs; [
|
||||
git
|
||||
libnotify
|
||||
];
|
||||
text = ''
|
||||
# Check if git is installed
|
||||
if ! command -v git >/dev/null 2>&1; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
NAME=$(git config --global user.name)
|
||||
EMAIL=$(git config --global user.email)
|
||||
NAME=$(git config --global user.name)
|
||||
EMAIL=$(git config --global user.email)
|
||||
|
||||
if [[ -z "$NAME" || -z "$EMAIL" ]]; then
|
||||
notify-send \
|
||||
"Git not configured" \
|
||||
"Set your identity\n or remove this warning by removing the custom-gitnotify line in\n ~/nixos/modules/applications/hyprland.nix"
|
||||
matrix-commander-rs --verbose -m "Git not configured.<br>Set your identify or remove this warning by removing the custom-gitnotify in ~/nixos/modules/applications/hyprland.nix<br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
|
||||
--html \
|
||||
-r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU"
|
||||
fi
|
||||
'';
|
||||
if [[ -z "$NAME" || -z "$EMAIL" ]]; then
|
||||
notify-send \
|
||||
"Git not configured" \
|
||||
"Set your identity\n or remove this warning by removing the custom-gitnotify line in\n ~/nixos/modules/applications/hyprland.nix"
|
||||
matrix-commander-rs --verbose -m "Git not configured.<br>Set your identify or remove this warning by removing the custom-gitnotify in ~/nixos/modules/applications/hyprland.nix<br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
|
||||
--html \
|
||||
-r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
};}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.nixosModules.development = { pkgs, pkgs-unstable, ... }: {
|
||||
_: {
|
||||
flake.nixosModules.development = {
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
programs.nix-ld.enable = true; #Run unpatched dynamic binaries on NixOS. For example lets run ./a.out from gcc
|
||||
environment.systemPackages = with pkgs; [
|
||||
gcc
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{ self, ... }: let cacheTime = "10"; in {
|
||||
flake.nixosModules.documentation = { pkgs, ... }: {
|
||||
{self, ...}: let
|
||||
cacheTime = "10";
|
||||
in {
|
||||
flake.nixosModules.documentation = {pkgs, ...}: {
|
||||
# unfortunatly this adds a lot of computation when nix rebuilds
|
||||
documentation.man.generateCaches = true; # used for the man script
|
||||
|
||||
@@ -14,7 +16,7 @@
|
||||
self.packages.${pkgs.system}.custom-manix
|
||||
];
|
||||
};
|
||||
perSystem = { pkgs, ... }: {
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.custom-man = pkgs.writeShellApplication {
|
||||
name = "custom-man";
|
||||
runtimeInputs = with pkgs; [
|
||||
@@ -52,41 +54,42 @@
|
||||
| xargs man
|
||||
'';
|
||||
};
|
||||
packages.custom-manix = pkgs.writeShellApplication {
|
||||
name = "custom-manix";
|
||||
runtimeInputs = with pkgs; [
|
||||
manix
|
||||
ripgrep
|
||||
fzf
|
||||
];
|
||||
text = ''
|
||||
CACHE_DIR="''${XDG_CACHE_HOME:-$HOME/.cache}"
|
||||
CACHE_FILE="$CACHE_DIR/custom-manix-options.txt"
|
||||
mkdir -p "$CACHE_DIR"
|
||||
packages.custom-manix = pkgs.writeShellApplication {
|
||||
name = "custom-manix";
|
||||
runtimeInputs = with pkgs; [
|
||||
manix
|
||||
ripgrep
|
||||
fzf
|
||||
];
|
||||
text = ''
|
||||
CACHE_DIR="''${XDG_CACHE_HOME:-$HOME/.cache}"
|
||||
CACHE_FILE="$CACHE_DIR/custom-manix-options.txt"
|
||||
mkdir -p "$CACHE_DIR"
|
||||
|
||||
REGENERATE=0
|
||||
REGENERATE=0
|
||||
|
||||
# check if -r flag was passed
|
||||
if [ "''${1:-}" = "-r" ]; then
|
||||
REGENERATE=1
|
||||
fi
|
||||
# check if -r flag was passed
|
||||
if [ "''${1:-}" = "-r" ]; then
|
||||
REGENERATE=1
|
||||
fi
|
||||
|
||||
|
||||
# regenerate if file does not exist or is older than cacheTime days
|
||||
if [ ! -f "$CACHE_FILE" ] || [ "$(find "$CACHE_FILE" -mtime +${cacheTime} -print)" ]; then
|
||||
REGENERATE=1
|
||||
fi
|
||||
# regenerate if file does not exist or is older than cacheTime days
|
||||
if [ ! -f "$CACHE_FILE" ] || [ "$(find "$CACHE_FILE" -mtime +${cacheTime} -print)" ]; then
|
||||
REGENERATE=1
|
||||
fi
|
||||
|
||||
if [ $REGENERATE -eq 1 ]; then
|
||||
echo "(Re)building custom-manix cache..."
|
||||
mkdir -p "$(dirname "$CACHE_FILE")"
|
||||
manix "" | rg -N '^(?:\x1b\[[0-9;]*m)*# ' | sed 's/\x1b\[[0-9;]*m//g; s/^# //' | rg -Nv '^(<|.*https?://)' > "$CACHE_FILE"
|
||||
fi
|
||||
if [ $REGENERATE -eq 1 ]; then
|
||||
echo "(Re)building custom-manix cache..."
|
||||
mkdir -p "$(dirname "$CACHE_FILE")"
|
||||
manix "" | rg -N '^(?:\x1b\[[0-9;]*m)*# ' | sed 's/\x1b\[[0-9;]*m//g; s/^# //' | rg -Nv '^(<|.*https?://)' > "$CACHE_FILE"
|
||||
fi
|
||||
|
||||
# read from cache and pipe into fzf
|
||||
cat "$CACHE_FILE" \
|
||||
| fzf --preview "manix {}" \
|
||||
| xargs manix
|
||||
'';
|
||||
# read from cache and pipe into fzf
|
||||
cat "$CACHE_FILE" \
|
||||
| fzf --preview "manix {}" \
|
||||
| xargs manix
|
||||
'';
|
||||
};
|
||||
};
|
||||
};}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.latex = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
texlab
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.networking = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget
|
||||
|
||||
+247
-247
@@ -1,12 +1,11 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
flake.nixosModules.nixUtils-laptop = { ... }: {
|
||||
{inputs, ...}: {
|
||||
flake.nixosModules.nixUtils-laptop = _: {
|
||||
# nixpkgs-review crashed my laptop multiple times. We must reduce how much ressources it can take.
|
||||
# for reference, my laptop is a 12 core ryzen 7
|
||||
nix.settings.max-jobs = 6;
|
||||
nix.settings.cores = 6;
|
||||
};
|
||||
flake.nixosModules.nixUtils = { pkgs-unstable, ... }: {
|
||||
flake.nixosModules.nixUtils = {pkgs-unstable, ...}: {
|
||||
# Garbage collector of generations
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
@@ -35,267 +34,268 @@
|
||||
statix
|
||||
];
|
||||
};
|
||||
perSystem = { pkgs, ... }: {
|
||||
# https://gist.github.com/MaxwellDupre/3077cd229490cf93ecab08ef2a79c852
|
||||
# better garbage collector
|
||||
perSystem = {pkgs, ...}: {
|
||||
# https://gist.github.com/MaxwellDupre/3077cd229490cf93ecab08ef2a79c852
|
||||
# better garbage collector
|
||||
packages.custom-trimmer = pkgs.writeShellApplication {
|
||||
name = "custom-trimmer";
|
||||
runtimeInputs = with pkgs; [
|
||||
nix
|
||||
];
|
||||
text = ''
|
||||
set -euo pipefail
|
||||
name = "custom-trimmer";
|
||||
runtimeInputs = with pkgs; [
|
||||
nix
|
||||
];
|
||||
text = ''
|
||||
set -euo pipefail
|
||||
|
||||
## Defaults
|
||||
keepGensDef=30; keepDaysDef=7
|
||||
keepGens=$keepGensDef; keepDays=$keepDaysDef
|
||||
## Defaults
|
||||
keepGensDef=30; keepDaysDef=7
|
||||
keepGens=$keepGensDef; keepDays=$keepDaysDef
|
||||
|
||||
## 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"
|
||||
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."
|
||||
}
|
||||
## 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"
|
||||
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 [ "$1" = "-h" ]; then
|
||||
usage
|
||||
exit 1;
|
||||
fi
|
||||
if [ "$1" = "--help" ]; then
|
||||
usage
|
||||
exit 2;
|
||||
fi
|
||||
printf "Dont recognise your option exiting..\n\n"
|
||||
usage
|
||||
exit 3;
|
||||
if [ $# -eq 1 ]; then # if help requested
|
||||
if [ "$1" = "-h" ]; then
|
||||
usage
|
||||
exit 1;
|
||||
fi
|
||||
if [ "$1" = "--help" ]; then
|
||||
usage
|
||||
exit 2;
|
||||
fi
|
||||
printf "Dont recognise your option exiting..\n\n"
|
||||
usage
|
||||
exit 3;
|
||||
|
||||
elif [ $# -eq 0 ]; then # print the defaults
|
||||
printf "The current defaults are:\n Keep-Gens=%d Keep-Days=%d \n\n" "$keepGensDef" "$keepDaysDef"
|
||||
read -r -p "Keep these defaults? (y/n):" answer
|
||||
elif [ $# -eq 0 ]; then # print the defaults
|
||||
printf "The current defaults are:\n Keep-Gens=%d Keep-Days=%d \n\n" "$keepGensDef" "$keepDaysDef"
|
||||
read -r -p "Keep these defaults? (y/n):" answer
|
||||
|
||||
case "$answer" in
|
||||
[yY1] )
|
||||
printf "Using defaults..\n"
|
||||
;;
|
||||
[nN0] ) printf "ok, doing nothing, exiting..\n"
|
||||
exit 6;
|
||||
;;
|
||||
* ) printf "%b" "Doing nothing, exiting.."
|
||||
exit 7;
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case "$answer" in
|
||||
[yY1] )
|
||||
printf "Using defaults..\n"
|
||||
;;
|
||||
[nN0] ) printf "ok, doing nothing, exiting..\n"
|
||||
exit 6;
|
||||
;;
|
||||
* ) printf "%b" "Doing nothing, exiting.."
|
||||
exit 7;
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
## Handle parameters (and change if root)
|
||||
if [[ $EUID -ne 0 ]]; then # if not root
|
||||
profile=$(readlink /home/"$USER"/.nix-profile)
|
||||
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
|
||||
profile="/nix/var/nix/profiles/default"
|
||||
else
|
||||
echo "Cant find profile for root. Exiting"
|
||||
exit 8
|
||||
fi
|
||||
fi
|
||||
if (( $# < 1 )); then
|
||||
printf "Keeping default: %d generations OR %d days, whichever is more\n" "$keepGensDef" "$keepDaysDef"
|
||||
elif [[ $# -le 2 ]]; then
|
||||
printf "\nError: Not enough arguments.\n\n" >&2
|
||||
usage
|
||||
exit 1
|
||||
elif (( $# > 4)); then
|
||||
printf "\nError: Too many arguments.\n\n" >&2
|
||||
usage
|
||||
exit 2
|
||||
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
|
||||
printf "%s" "$answer"
|
||||
case "$answer" in
|
||||
[yY1] )
|
||||
printf "ok, continuing..\n"
|
||||
;;
|
||||
[nN0] )
|
||||
printf "ok, doing nothing, exiting..\n"
|
||||
exit 6;
|
||||
;;
|
||||
* )
|
||||
printf "%b" "Doing nothing, exiting.."
|
||||
exit 7;
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ "$2" -lt 0 ]; then
|
||||
printf "using negative days number not recommended. Setting to min=0\n"
|
||||
read -r -p "is that ok? (y/n): " answer
|
||||
## Handle parameters (and change if root)
|
||||
if [[ $EUID -ne 0 ]]; then # if not root
|
||||
profile=$(readlink /home/"$USER"/.nix-profile)
|
||||
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
|
||||
profile="/nix/var/nix/profiles/default"
|
||||
else
|
||||
echo "Cant find profile for root. Exiting"
|
||||
exit 8
|
||||
fi
|
||||
fi
|
||||
if (( $# < 1 )); then
|
||||
printf "Keeping default: %d generations OR %d days, whichever is more\n" "$keepGensDef" "$keepDaysDef"
|
||||
elif [[ $# -le 2 ]]; then
|
||||
printf "\nError: Not enough arguments.\n\n" >&2
|
||||
usage
|
||||
exit 1
|
||||
elif (( $# > 4)); then
|
||||
printf "\nError: Too many arguments.\n\n" >&2
|
||||
usage
|
||||
exit 2
|
||||
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
|
||||
printf "%s" "$answer"
|
||||
case "$answer" in
|
||||
[yY1] )
|
||||
printf "ok, continuing..\n"
|
||||
;;
|
||||
[nN0] )
|
||||
printf "ok, doing nothing, exiting..\n"
|
||||
exit 6;
|
||||
;;
|
||||
* )
|
||||
printf "%b" "Doing nothing, exiting.."
|
||||
exit 7;
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ "$2" -lt 0 ]; then
|
||||
printf "using negative days number not recommended. Setting to min=0\n"
|
||||
read -r -p "is that ok? (y/n): " answer
|
||||
|
||||
case "$answer" in
|
||||
[yY1] )
|
||||
printf "ok, continuing..\n"
|
||||
;;
|
||||
[nN0] )
|
||||
printf "ok, doing nothing, exiting..\n"
|
||||
exit 6;
|
||||
;;
|
||||
* )
|
||||
printf "%b" "Doing nothing, exiting.."
|
||||
exit 7;
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
keepGens=$1; keepDays=$2;
|
||||
(( keepGens < 1 )) && keepGens=1
|
||||
(( keepDays < 0 )) && keepDays=0
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
if [[ $3 == "user" ]] || [[ $3 == "default" ]]; then
|
||||
profile=$(readlink /home/"$USER"/.nix-profile)
|
||||
elif [[ $3 == "home-manager" ]]; then
|
||||
# home-manager defaults to $XDG_STATE_HOME; otherwise, use
|
||||
# `home-manager generations` and `nix-store --query --roots
|
||||
# /nix/store/...` to figure out what reference is keeping the old
|
||||
# generations alive.
|
||||
profile="''${XDG_STATE_HOME:-$HOME/.local/state}/nix/profiles/home-manager"
|
||||
elif [[ $3 == "channels" ]]; then
|
||||
profile="/nix/var/nix/profiles/per-user/$USER/channels"
|
||||
else
|
||||
printf "\nError: Do not understand your third argument. Should be one of: (user / home-manager/ channels)\n\n"
|
||||
usage
|
||||
exit 3
|
||||
fi
|
||||
else
|
||||
if [[ $3 == "system" ]]; then
|
||||
profile="/nix/var/nix/profiles/system"
|
||||
elif [[ $3 == "user" ]] || [[ $3 == "default" ]]; then
|
||||
profile="/nix/var/nix/profiles/default"
|
||||
else
|
||||
printf "\nError: Do not understand your third argument. Should be one of: (user / system)\n\n"
|
||||
usage
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
printf "OK! \t Keep Gens = %s \t Keep Days = %s \n\n" "$keepGens" "$keepDays"
|
||||
case "$answer" in
|
||||
[yY1] )
|
||||
printf "ok, continuing..\n"
|
||||
;;
|
||||
[nN0] )
|
||||
printf "ok, doing nothing, exiting..\n"
|
||||
exit 6;
|
||||
;;
|
||||
* )
|
||||
printf "%b" "Doing nothing, exiting.."
|
||||
exit 7;
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
keepGens=$1; keepDays=$2;
|
||||
(( keepGens < 1 )) && keepGens=1
|
||||
(( keepDays < 0 )) && keepDays=0
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
if [[ $3 == "user" ]] || [[ $3 == "default" ]]; then
|
||||
profile=$(readlink /home/"$USER"/.nix-profile)
|
||||
elif [[ $3 == "home-manager" ]]; then
|
||||
# home-manager defaults to $XDG_STATE_HOME; otherwise, use
|
||||
# `home-manager generations` and `nix-store --query --roots
|
||||
# /nix/store/...` to figure out what reference is keeping the old
|
||||
# generations alive.
|
||||
profile="''${XDG_STATE_HOME:-$HOME/.local/state}/nix/profiles/home-manager"
|
||||
elif [[ $3 == "channels" ]]; then
|
||||
profile="/nix/var/nix/profiles/per-user/$USER/channels"
|
||||
else
|
||||
printf "\nError: Do not understand your third argument. Should be one of: (user / home-manager/ channels)\n\n"
|
||||
usage
|
||||
exit 3
|
||||
fi
|
||||
else
|
||||
if [[ $3 == "system" ]]; then
|
||||
profile="/nix/var/nix/profiles/system"
|
||||
elif [[ $3 == "user" ]] || [[ $3 == "default" ]]; then
|
||||
profile="/nix/var/nix/profiles/default"
|
||||
else
|
||||
printf "\nError: Do not understand your third argument. Should be one of: (user / system)\n\n"
|
||||
usage
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
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 () {
|
||||
local default="$1"
|
||||
local prompt="$2"
|
||||
local answer
|
||||
## Runs at the end, to decide whether to delete profiles that match chosen parameters.
|
||||
choose () {
|
||||
local default="$1"
|
||||
local prompt="$2"
|
||||
local answer
|
||||
|
||||
read -r -p "$prompt" answer
|
||||
[ -z "$answer" ] && answer="$default"
|
||||
read -r -p "$prompt" answer
|
||||
[ -z "$answer" ] && answer="$default"
|
||||
|
||||
case "$answer" in
|
||||
[yY1] ) #printf "answered yes!\n"
|
||||
nix-env --delete-generations -p "$profile" "''${!gens[@]}"
|
||||
exit 0
|
||||
;;
|
||||
[nN0] ) printf "Ok doing nothing exiting..\n"
|
||||
exit 6;
|
||||
;;
|
||||
* ) printf "%b" "Unexpected answer '$answer'!" >&2
|
||||
exit 7;
|
||||
;;
|
||||
esac
|
||||
} # end of function choose
|
||||
case "$answer" in
|
||||
[yY1] ) #printf "answered yes!\n"
|
||||
nix-env --delete-generations -p "$profile" "''${!gens[@]}"
|
||||
exit 0
|
||||
;;
|
||||
[nN0] ) printf "Ok doing nothing exiting..\n"
|
||||
exit 6;
|
||||
;;
|
||||
* ) printf "%b" "Unexpected answer '$answer'!" >&2
|
||||
exit 7;
|
||||
;;
|
||||
esac
|
||||
} # 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 < <(
|
||||
nix-env --list-generations -p "$profile" |
|
||||
sed 's:^\s*::; s:\s*$::' |
|
||||
tr '\t' ' ' |
|
||||
tr -s ' '
|
||||
)
|
||||
timeNow=$(date +%s)
|
||||
# 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)
|
||||
|
||||
## 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
|
||||
IFS=' ' read -r -a iGenArr <<< "$i"
|
||||
genNumber=''${iGenArr[0]}
|
||||
genDate=''${iGenArr[1]}
|
||||
if [[ "$i" =~ current ]]; then
|
||||
currentGen=$genNumber
|
||||
printf "%-30s %s\n" "current generation:" "$currentGen"
|
||||
currentDate=$genDate
|
||||
printf "%-30s %s\n" "current generation created:" "$currentDate"
|
||||
currentTime=$(date -d "$currentDate" +%s)
|
||||
currentElapsedSecs=$((timeNow-currentTime))
|
||||
currentElapsedMins=$((currentElapsedSecs/60))
|
||||
currentElapsedHours=$((currentElapsedMins/60))
|
||||
currentElapsedDays=$((currentElapsedHours/24))
|
||||
printf "%-30s %s\n" "minutes before now:" "$currentElapsedMins"
|
||||
printf "%-30s %s\n" "hours before now:" "$currentElapsedHours"
|
||||
printf "%-30s %s\n\n" "days before now:" "$currentElapsedDays"
|
||||
fi
|
||||
done
|
||||
## Get info on current generation
|
||||
for i in "''${nixGens[@]}"; do
|
||||
IFS=' ' read -r -a iGenArr <<< "$i"
|
||||
genNumber=''${iGenArr[0]}
|
||||
genDate=''${iGenArr[1]}
|
||||
if [[ "$i" =~ current ]]; then
|
||||
currentGen=$genNumber
|
||||
printf "%-30s %s\n" "current generation:" "$currentGen"
|
||||
currentDate=$genDate
|
||||
printf "%-30s %s\n" "current generation created:" "$currentDate"
|
||||
currentTime=$(date -d "$currentDate" +%s)
|
||||
currentElapsedSecs=$((timeNow-currentTime))
|
||||
currentElapsedMins=$((currentElapsedSecs/60))
|
||||
currentElapsedHours=$((currentElapsedMins/60))
|
||||
currentElapsedDays=$((currentElapsedHours/24))
|
||||
printf "%-30s %s\n" "minutes before now:" "$currentElapsedMins"
|
||||
printf "%-30s %s\n" "hours before now:" "$currentElapsedHours"
|
||||
printf "%-30s %s\n\n" "days before now:" "$currentElapsedDays"
|
||||
fi
|
||||
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
|
||||
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
|
||||
printf "Oldest generation (%d) is only %d generations behind current (%d). \n\n\t Nothing to do!\n" "$oldestGen" "$generationsDiff" "$currentGen"
|
||||
exit 5;
|
||||
else
|
||||
printf "\tSomething to do...\n"
|
||||
declare -a gens
|
||||
for i in "''${nixGens[@]}"; do
|
||||
IFS=' ' read -r -a iGenArr <<< "$i"
|
||||
genNumber=''${iGenArr[0]}
|
||||
genDiff=$((currentGen-genNumber))
|
||||
genDate=''${iGenArr[1]}
|
||||
genTime=$(date -d "$genDate" +%s)
|
||||
elapsedSecs=$((timeNow-genTime))
|
||||
genDaysOld=$((elapsedSecs/60/60/24))
|
||||
if [[ genDaysOld -gt keepDays ]] && [[ genDiff -ge keepGens ]]; then
|
||||
gens["$genNumber"]="$genDate, $genDaysOld day(s) old"
|
||||
fi
|
||||
done
|
||||
printf "\nFound the following generation(s) to delete:\n"
|
||||
for K in "''${!gens[@]}"; do
|
||||
printf "generation %d \t ''${gens[$K]}\n" "$K"
|
||||
done
|
||||
printf "\n"
|
||||
choose "y" "Do you want to delete these? [Y/n]: "
|
||||
fi
|
||||
## 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
|
||||
printf "Oldest generation (%d) is only %d generations behind current (%d). \n\n\t Nothing to do!\n" "$oldestGen" "$generationsDiff" "$currentGen"
|
||||
exit 5;
|
||||
else
|
||||
printf "\tSomething to do...\n"
|
||||
declare -a gens
|
||||
for i in "''${nixGens[@]}"; do
|
||||
IFS=' ' read -r -a iGenArr <<< "$i"
|
||||
genNumber=''${iGenArr[0]}
|
||||
genDiff=$((currentGen-genNumber))
|
||||
genDate=''${iGenArr[1]}
|
||||
genTime=$(date -d "$genDate" +%s)
|
||||
elapsedSecs=$((timeNow-genTime))
|
||||
genDaysOld=$((elapsedSecs/60/60/24))
|
||||
if [[ genDaysOld -gt keepDays ]] && [[ genDiff -ge keepGens ]]; then
|
||||
gens["$genNumber"]="$genDate, $genDaysOld day(s) old"
|
||||
fi
|
||||
done
|
||||
printf "\nFound the following generation(s) to delete:\n"
|
||||
for K in "''${!gens[@]}"; do
|
||||
printf "generation %d \t ''${gens[$K]}\n" "$K"
|
||||
done
|
||||
printf "\n"
|
||||
choose "y" "Do you want to delete these? [Y/n]: "
|
||||
fi
|
||||
|
||||
'';
|
||||
'';
|
||||
};
|
||||
};
|
||||
};}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.office = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
libreoffice
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
_: {
|
||||
flake.nixosModules.ollama = {pkgs-unstable, ...}: {
|
||||
services.ollama = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,28 +1,29 @@
|
||||
{ self, ... }: {
|
||||
flake.nixosModules.otherUtils = # try to keep packages here at a minium. Preferably use a dedicated file
|
||||
{
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
gnome-calculator
|
||||
snapshot
|
||||
gnome-characters
|
||||
#tree # shows dir in tree # we use eza now
|
||||
brightnessctl # control brightness
|
||||
powertop
|
||||
fzf
|
||||
bottom # Cross-platform graphical process/system monitor with a customizable interface
|
||||
tomato-c # pomodoro timer
|
||||
#hyprshot
|
||||
mailcap
|
||||
fuzzel
|
||||
usbutils # used for lsusb
|
||||
self.packages.${pkgs.system}.custom-tomato
|
||||
self.packages.${pkgs.system}.custom-syllabes
|
||||
pkgs-unstable.bitwarden-desktop
|
||||
fluffychat # matrix client
|
||||
];
|
||||
};
|
||||
{self, ...}: {
|
||||
flake.nixosModules.otherUtils =
|
||||
# try to keep packages here at a minium. Preferably use a dedicated file
|
||||
{
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
gnome-calculator
|
||||
snapshot
|
||||
gnome-characters
|
||||
#tree # shows dir in tree # we use eza now
|
||||
brightnessctl # control brightness
|
||||
powertop
|
||||
fzf
|
||||
bottom # Cross-platform graphical process/system monitor with a customizable interface
|
||||
tomato-c # pomodoro timer
|
||||
#hyprshot
|
||||
mailcap
|
||||
fuzzel
|
||||
usbutils # used for lsusb
|
||||
self.packages.${pkgs.system}.custom-tomato
|
||||
self.packages.${pkgs.system}.custom-syllabes
|
||||
pkgs-unstable.bitwarden-desktop
|
||||
fluffychat # matrix client
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user