Compare commits

...

3 Commits

Author SHA1 Message Date
28e9c221ad [nix] Adds GC 2025-04-25 15:24:33 -07:00
59ae2bd981 [vega;hyprland] Set up only one-monitor workspaces 2025-04-25 15:18:58 -07:00
5b8cc6eb8d [eww] Filters out empty workspaces, again. 2025-04-25 15:16:45 -07:00
7 changed files with 34 additions and 18 deletions

View File

@@ -18,17 +18,15 @@ list_workspaces() {
# 1. Select only workspaces on the current monitor. # 1. Select only workspaces on the current monitor.
# 2. Remove duplicates (might be a bug with split-monitor-workspaces # 2. Remove duplicates (might be a bug with split-monitor-workspaces
# 3. Create the output structure # 3. Create the output structure
# 4. Select interesting entries, ones that are focused, active or have windows
# 5. Sort # 5. Sort
hyprctl workspaces -j | jq --compact-output --monochrome-output " hyprctl workspaces -j | jq --compact-output --monochrome-output "
map( select( .monitor | contains(\"${monitor}\") ) ) | map( select( .monitor | contains(\"${monitor}\") ) ) |
reduce .[] as \$item ( []; if any( .[]; .id == \$item.id ) then . else . + [\$item] end ) | reduce .[] as \$item ( []; if any( .[]; .id == \$item.id ) then . else . + [\$item] end ) |
map( { id: .id, name, active: (.id == ${active}), focused: (.id == ${focused}), has_windows: (.lastwindowtitle != \"\") } ) | map( { id: .id, name, active: (.id == ${active}), focused: (.id == ${focused}), has_windows: (.lastwindowtitle != \"\") } ) |
map( select (.active or .focused or .has_windows)) |
sort_by(.id) sort_by(.id)
" "
# Other lines that may be useful in the future
# - Select interesting entries, ones that are focused, active or have windows
# map( select (.active or .focused or .has_windows))
} }
monitor=$1 monitor=$1

8
system/features/gc.nix Normal file
View File

@@ -0,0 +1,8 @@
{ ... }: {
# Automatic
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
}

View File

@@ -4,6 +4,7 @@
./configuration.nix ./configuration.nix
./hardware-configuration.nix ./hardware-configuration.nix
../../authorized-keys.nix ../../authorized-keys.nix
../../features/gc.nix
../../features/gui.nix ../../features/gui.nix
]; ];

View File

@@ -5,6 +5,7 @@
./hardware-configuration.nix ./hardware-configuration.nix
../../authorized-keys.nix ../../authorized-keys.nix
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
../../features/gc.nix
]; ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;

View File

@@ -1,12 +1,4 @@
# Edit this configuration file to define what should be installed on { pkgs, ... }:
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{
pkgs,
...
}:
{ {
networking.hostName = "vega"; # Define your hostname. networking.hostName = "vega"; # Define your hostname.

View File

@@ -4,6 +4,7 @@
./configuration.nix ./configuration.nix
./hardware-configuration.nix ./hardware-configuration.nix
../../authorized-keys.nix ../../authorized-keys.nix
../../features/gc.nix
../../features/gui.nix ../../features/gui.nix
]; ];

View File

@@ -22,9 +22,24 @@
userEmail = "periodic@blazestar.net"; userEmail = "periodic@blazestar.net";
}; };
# Set up eww here because it's based on the monitor configuration wayland.windowManager.hyprland.settings = {
# Eww is idempotent, so it's fine to just run it on every reload to make sure things are open # Set up eww here because it's based on the monitor configuration
wayland.windowManager.hyprland.settings.exec = [ # Eww is idempotent, so it's fine to just run it on every reload to make sure things are open
"eww daemon && eww open-many vertical-statusbar" exec = [
]; "eww daemon && eww open-many vertical-statusbar"
];
# Set up workspaces for this system
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
workspace = [
"1, defaultName:1"
"2, defaultName:2"
"3, defaultName:3"
"4, defaultName:4"
"5, defaultName:5"
"6, defaultName:6"
"7, defaultName:7"
"8, defaultName:8"
"9, defaultName:9"
];
};
} }