diff --git a/.scripts/cleanup-boot.sh b/.scripts/cleanup-boot.sh deleted file mode 100755 index 0680b4f6..00000000 --- a/.scripts/cleanup-boot.sh +++ /dev/null @@ -1,154 +0,0 @@ -#!/usr/bin/env bash - -# Script to clean up old initrd and kernel files in /boot/EFI/nixos -# Make sure it's added to flake.nix, then run: -# "nix build .#packages.x86_64-linux.cleanup-boot". - -# Exit on any error, undefined variable, or pipeline failure -set -euo pipefail - -# Default number of kernel and initrd files to keep -KEEP_KERNEL=4 -KEEP_INITRD=6 - -# Log file for cleanup actions -LOG_FILE="/var/log/cleanup-boot.log" - -# Dry run flag -DRY_RUN=false - -# Function to display usage information -usage() { - echo "Usage: $0 [--dry-run] [--keep-kernel N] [--keep-initrd N] [--help]" - echo - echo "Options:" - echo " --dry-run Perform a trial run with no changes made." - echo " --keep-kernel N Keep the latest N kernel files (default: 4)." - echo " --keep-initrd N Keep the latest N initrd files (default: 6)." - echo " --help, -h Show this help message." - exit 1 -} - -# Parse command-line arguments -while [[ "$#" -gt 0 ]]; do - case "$1" in - --dry-run) - DRY_RUN=true - ;; - --keep-kernel) - if [[ -n "${2:-}" && "$2" =~ ^[1-9][0-9]*$ ]]; then - KEEP_KERNEL="$2" - shift - else - echo "Error: --keep-kernel requires a positive integer." - usage - fi - ;; - --keep-initrd) - if [[ -n "${2:-}" && "$2" =~ ^[1-9][0-9]*$ ]]; then - KEEP_INITRD="$2" - shift - else - echo "Error: --keep-initrd requires a positive integer." - usage - fi - ;; - --help | -h) - usage - ;; - *) - echo "Unknown option: $1" - usage - ;; - esac - shift -done - -# Check for root privileges -if [ "$EUID" -ne 0 ]; then - echo "Error: Please run as root." - exit 1 -fi - -# Check if log file is writable -if ! touch "$LOG_FILE" &>/dev/null; then - echo "Error: Cannot write to log file $LOG_FILE" - exit 1 -fi - -# Function to log messages with timestamps -log() { - local message - message="$(date '+%Y-%m-%d %H:%M:%S') - $1" - echo "$message" | tee -a "$LOG_FILE" - logger -t cleanup-boot "$message" -} - -log "Starting cleanup script. Keeping $KEEP_KERNEL kernel files and $KEEP_INITRD initrd files." - -# Collect all .efi files in /boot/EFI/nixos -mapfile -d '' -t efi_files < <(find /boot/EFI/nixos -type f -name '*.efi' -print0) - -# Initialize arrays for kernel and initrd files -kernel_files=() -initrd_files=() - -# Parse filenames and collect kernel and initrd files based on patterns -for file in "${efi_files[@]}"; do - basename=$(basename "$file") - - # Pattern: -linux--bzImage.efi (kernel) - if [[ "$basename" =~ ^(.*)-linux-([0-9]+\.[0-9]+(\.[0-9]+)?)\-bzImage\.efi$ ]]; then - kernel_files+=("$file") - - # Pattern: -initrd-linux--initrd.efi (initrd) - elif [[ "$basename" =~ ^(.*)-initrd-linux-([0-9]+\.[0-9]+(\.[0-9]+)?)\-initrd\.efi$ ]]; then - initrd_files+=("$file") - - # Pattern: kernel--.efi (kernel) - elif [[ "$basename" =~ ^kernel-([0-9]+\.[0-9]+(\.[0-9]+)?)\-([a-zA-Z0-9\-]+)\.efi$ ]]; then - kernel_files+=("$file") - - # Pattern: initrd--.efi (initrd) - elif [[ "$basename" =~ ^initrd-([0-9]+\.[0-9]+(\.[0-9]+)?)\-([a-zA-Z0-9\-]+)\.efi$ ]]; then - initrd_files+=("$file") - - else - log "Warning: Unrecognized filename format: $basename" - continue - fi -done - -# Function to process and delete old files -process_files() { - local -n files=$1 # Pass array by reference - local keep_count=$2 - local file_type=$3 - - log "Processing $file_type files..." - - if [ "${#files[@]}" -gt "$keep_count" ]; then - # Sort files by modification time (newest first) - sorted_files=$(for f in "${files[@]}"; do echo "$(stat -c '%Y' "$f"):$f"; done | sort -rn -k1,1) - - # Collect files to delete (older than the top N) - mapfile -t files_to_delete < <(echo "$sorted_files" | tail -n +"$((keep_count + 1))" | cut -d: -f2) - - for file in "${files_to_delete[@]}"; do - log "Deleting $file" - if [ "$DRY_RUN" = false ]; then - rm -f -- "$file" - else - log "Dry run - would delete: $file" - fi - done - else - log "No $file_type files to delete. Current count: ${#files[@]}" - fi -} - -# Process kernel and initrd files -process_files kernel_files "$KEEP_KERNEL" "kernel" -process_files initrd_files "$KEEP_INITRD" "initrd" - -log "Cleanup script completed." diff --git a/README.md b/README.md index 881d00a4..c4fda9b2 100644 --- a/README.md +++ b/README.md @@ -5,18 +5,18 @@ My NixOS daily driver. Built primarily for use with prominent tools and apps: - [Chaotic's Nyx](https://www.nyx.chaotic.cx/) **CachyOS kernel and mesa-git - things** -- [nh](https://github.com/viperML/nh) **A pretty cool "nix helper"** -- [agenix](https://github.com/ryantm/agenix) **Age-based encryption** -- [kanata](https://github.com/jtroo/kanata) **Keyboard mapping, good stuff** + things.** +- [nh](https://github.com/viperML/nh) **A pretty cool "nix helper".** +- [agenix](https://github.com/ryantm/agenix) **Age based encryption.** +- [kanata](https://github.com/jtroo/kanata) **Keyboard mapping, good stuff.** - [waybar](https://github.com/Alexays/Waybar) **It's a wayland bar!** -- [zen-browser](https://github.com/zen-browser/desktop) **Alpha stage, - firefox-based browser** +- [zen-browser](https://github.com/zen-browser/desktop) **Alpha stage, firefox + based browser.** - [helix](https://github.com/helix-editor/helix) **Very quick editor, might - switch to permanently!** + switch permanently!** - [tuirun](https://git.sr.ht/~canasta/tuirun) **Anyrun's applications plugin but - with tui. WIP, will add more documentation** -- [mako](https://github.com/emersion/mako) **Lightweight notifications** + with tui. WIP, will add more documentation.** +- [mako](https://github.com/emersion/mako) **Lightweight notifications.** ## Structure diff --git a/flake.lock b/flake.lock index 70c83d8d..b92286c1 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1730444665, - "narHash": "sha256-i3FxeHjsHw4AePx3AWVVywy92EEobx/ZER4ignWxNrE=", + "lastModified": 1731092955, + "narHash": "sha256-L1hLXf4IDZ0KoXbFiSNNZJ7IrReEr/J+CLt6Rl4Ea3M=", "owner": "anyrun-org", "repo": "anyrun", - "rev": "b3b4f2253d43af3311b3d3fc86973fc3e9559c33", + "rev": "d2017f224b2bfd7e33573c7070e7c3e2960c7dcc", "type": "github" }, "original": { @@ -154,11 +154,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1731047492, - "narHash": "sha256-F4h8YtTzPWv0/1Z6fc8fMSqKpn7YhOjlgp66cr15tEo=", + "lastModified": 1731220256, + "narHash": "sha256-7BWlJbGZ6rXtKOfgZYDQerygXco1YyYzXciuLN0UPP4=", "owner": "nix-community", "repo": "fenix", - "rev": "da6332e801fbb0418f80f20cefa947c5fe5c18c9", + "rev": "61c51d848301cefc1535856f9e68ad6e01a5c970", "type": "github" }, "original": { @@ -269,11 +269,11 @@ ] }, "locked": { - "lastModified": 1726153070, - "narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=", + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", "type": "github" }, "original": { @@ -532,11 +532,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1730969692, - "narHash": "sha256-4Ly9zkqnRB6qLjMeddfUyd4iRLvq+RDspBWABS8DGN4=", + "lastModified": 1731172465, + "narHash": "sha256-2O4cE+H3Q6AOiyY+qVXhXKjHBjdld+CUuGAd9rXJFRk=", "owner": "hyprwm", "repo": "hyprland", - "rev": "e58e97b0a38b8ccc87a4304c9e4e2b37c9966875", + "rev": "a8ff3a452c1c445d24bdd9e7e4fcd66c8ef2a147", "type": "github" }, "original": { @@ -640,11 +640,11 @@ ] }, "locked": { - "lastModified": 1730911842, - "narHash": "sha256-stAVRv13iACAIJ6mheJOwZXWD24YDupyshaUDovVNi4=", + "lastModified": 1731171284, + "narHash": "sha256-pwO3OCxIbLKm6NqpXeOGlO+CSOPQpcMCSJDXEctr7B8=", "owner": "hyprwm", "repo": "hyprlock", - "rev": "4fc133c96fa1ad2968cad44f8e9e9e923cd0381a", + "rev": "6c3c444136d6f87d3cd9610b12e45e4c2130ef3a", "type": "github" }, "original": { @@ -728,11 +728,11 @@ ] }, "locked": { - "lastModified": 1730968903, - "narHash": "sha256-zFvzLXcSm0Ia4XI1SE4FQ9KE63hlGrRWhLtwMolWuR8=", + "lastModified": 1731163338, + "narHash": "sha256-Qflei0JBeqQ0c8jxA8e982xAxJvfMwfx4Aci2eJi84s=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "3ce0cde8709cdacbfba471f8e828433b58a561e9", + "rev": "60d3dece30f98e8ad85131829c8529950630d6bc", "type": "github" }, "original": { @@ -865,11 +865,11 @@ "umu": "umu" }, "locked": { - "lastModified": 1730770711, - "narHash": "sha256-UHm56cW/04efHY4NgboGFOXliGQCqRRY+l1HM7c8/Ms=", + "lastModified": 1731202990, + "narHash": "sha256-Ac3ff4w9+xePGX6TF90zEVyhdHJkhg58pUafvoAjVEY=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "0c25376479d11073346ed22de8571805543ede71", + "rev": "faf26ec552997488d75a0fdb07783c0c2edd3d5f", "type": "github" }, "original": { @@ -1139,11 +1139,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1730989300, - "narHash": "sha256-ZWSta9893f/uF5PoRFn/BSUAxF4dKW+TIbdA6rZoGBg=", + "lastModified": 1731056261, + "narHash": "sha256-TPeXChHVcaCBAoE349K7OZH4We5/2ys1GgG4IiwjwOs=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "1042a8c22c348491a4bade4f664430b03d6f5b5c", + "rev": "dd9cd22514cb1001a0a2374b36a85eb75245f27b", "type": "github" }, "original": { @@ -1294,11 +1294,11 @@ "systems": "systems_6" }, "locked": { - "lastModified": 1730305454, - "narHash": "sha256-7Mn9t5KXf+0kAUjFSyvWORHS9Al+o6WEf95cfpy6vzg=", + "lastModified": 1731161138, + "narHash": "sha256-f4YDB4EG7iklRF8V/3JOmkMgdwe60KAL/lkep9euafs=", "ref": "refs/heads/main", - "rev": "5f682796104b4849063a12abfc54558c8ba62e25", - "revCount": 28, + "rev": "4ffa291623ca82014132fdbdef109dbda67cd267", + "revCount": 30, "type": "git", "url": "https://git.sr.ht/~canasta/tuirun" }, @@ -1380,11 +1380,11 @@ ] }, "locked": { - "lastModified": 1730441165, - "narHash": "sha256-lXLgi09KvDfxuu2eyCFh8J/pjENoF6LKQWlJD5WKm3k=", + "lastModified": 1731197688, + "narHash": "sha256-CyUMgW3H72G4zKFjG0NsAwEt8LSSv2ym5qGSUJ6Sn/E=", "ref": "refs/heads/main", - "rev": "c31396e77f54b2d9f5bbcd5aab4b15245068e51c", - "revCount": 53, + "rev": "67b8c5c90f14ed77371426fdfff8e91f207c0ef9", + "revCount": 54, "type": "git", "url": "https://git.sr.ht/~canasta/zen-browser-flake" }, diff --git a/modules/default.nix b/modules/default.nix index 54a426c5..ac6b165a 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -20,6 +20,7 @@ ./home/programs/neovim ./home/programs/rofi ./home/programs/ssh + ./home/programs/thunar ./home/programs/tuirun ./home/programs/vscode ./home/programs/waybar diff --git a/modules/home/programs/hyprlock/default.nix b/modules/home/programs/hyprlock/default.nix index 171812c2..437cf55b 100644 --- a/modules/home/programs/hyprlock/default.nix +++ b/modules/home/programs/hyprlock/default.nix @@ -30,7 +30,7 @@ in { background = [ { monitor = ""; - path = "~/media/images/l_int06_big.jpg"; + path = "~/media/images/l_ash09_big.jpg"; } ]; input-field = [ diff --git a/modules/home/programs/misc/default.nix b/modules/home/programs/misc/default.nix index a787dd06..b6d2fc12 100644 --- a/modules/home/programs/misc/default.nix +++ b/modules/home/programs/misc/default.nix @@ -31,8 +31,6 @@ in { home.packages = with pkgs; [ # misc.gui # virt-manager - xfce.thunar - file-roller # archiver gnome-calculator keepassxc # networkmanagerapplet # tray icon for NetworkManager @@ -63,8 +61,6 @@ in { wireguard-tools wl-clipboard wpa_supplicant - xfce.thunar-archive-plugin - xfce.thunar-volman unzip zip gnutar diff --git a/modules/home/programs/thunar/default.nix b/modules/home/programs/thunar/default.nix new file mode 100644 index 00000000..15fd46e7 --- /dev/null +++ b/modules/home/programs/thunar/default.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.programs.thunar; +in { + options = { + home.programs.thunar.enable = mkEnableOption "Enables thunar file manager"; + }; + config = mkIf cfg.enable { + programs.thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-volman + ]; + }; + programs.xfconf.enable = true; + services.tumbler.enable = true; + + environment.systemPackages = [pkgs.file-roller]; + }; +} diff --git a/modules/nixos/services/greetd/default.nix b/modules/nixos/services/greetd/default.nix index cbaea2d0..db548dce 100644 --- a/modules/nixos/services/greetd/default.nix +++ b/modules/nixos/services/greetd/default.nix @@ -45,7 +45,7 @@ in { }) { default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet -r --remember-session --asterisks"; + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --window-padding 1 --time --time-format '%R - %F' -r --remember-session --asterisks"; user = cfg.user; }; } diff --git a/.scripts/bin/calcurse-toggle.sh b/scripts/bin/calcurse-toggle.sh similarity index 100% rename from .scripts/bin/calcurse-toggle.sh rename to scripts/bin/calcurse-toggle.sh diff --git a/.scripts/bin/calsync.sh b/scripts/bin/calsync.sh similarity index 100% rename from .scripts/bin/calsync.sh rename to scripts/bin/calsync.sh diff --git a/.scripts/bin/extract.sh b/scripts/bin/extract.sh similarity index 100% rename from .scripts/bin/extract.sh rename to scripts/bin/extract.sh diff --git a/.scripts/bin/mako-toggle.sh b/scripts/bin/mako-toggle.sh similarity index 100% rename from .scripts/bin/mako-toggle.sh rename to scripts/bin/mako-toggle.sh diff --git a/.scripts/bin/mako.sh b/scripts/bin/mako.sh similarity index 100% rename from .scripts/bin/mako.sh rename to scripts/bin/mako.sh diff --git a/.scripts/bin/pavucontrol-toggle.sh b/scripts/bin/pavucontrol-toggle.sh similarity index 100% rename from .scripts/bin/pavucontrol-toggle.sh rename to scripts/bin/pavucontrol-toggle.sh diff --git a/.scripts/bin/rangerscript.sh b/scripts/bin/rangerscript.sh similarity index 100% rename from .scripts/bin/rangerscript.sh rename to scripts/bin/rangerscript.sh diff --git a/.scripts/bin/tuirun-debug.sh b/scripts/bin/tuirun-debug.sh similarity index 100% rename from .scripts/bin/tuirun-debug.sh rename to scripts/bin/tuirun-debug.sh diff --git a/.scripts/bin/tuirun-toggle.sh b/scripts/bin/tuirun-toggle.sh similarity index 100% rename from .scripts/bin/tuirun-toggle.sh rename to scripts/bin/tuirun-toggle.sh diff --git a/.scripts/bin/volume-control.sh b/scripts/bin/volume-control.sh similarity index 100% rename from .scripts/bin/volume-control.sh rename to scripts/bin/volume-control.sh diff --git a/.scripts/default.nix b/scripts/default.nix similarity index 100% rename from .scripts/default.nix rename to scripts/default.nix diff --git a/users/cnst/modules.nix b/users/cnst/modules.nix index 0fc81f9c..9042cf6f 100644 --- a/users/cnst/modules.nix +++ b/users/cnst/modules.nix @@ -74,6 +74,9 @@ ssh = { enable = true; }; + thunar = { + enable = true; + }; tuirun = { enable = true; }; diff --git a/users/default.nix b/users/default.nix index a0a8dc3d..00aaeb13 100644 --- a/users/default.nix +++ b/users/default.nix @@ -7,7 +7,7 @@ sharedImports = [ # ./etc - "${self}/.scripts" + "${self}/scripts" self.nixosModules.home self.nixosModules.options ]; diff --git a/users/toothpick/modules.nix b/users/toothpick/modules.nix index cfe80f51..913f6a24 100644 --- a/users/toothpick/modules.nix +++ b/users/toothpick/modules.nix @@ -65,6 +65,9 @@ ssh = { enable = true; }; + thunar = { + enable = true; + }; tuirun = { enable = true; };