diff --git a/flake.lock b/flake.lock index 7a45075..a6272be 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,27 @@ { "nodes": { + "alejandra": { + "inputs": { + "fenix": "fenix", + "flakeCompat": "flakeCompat", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751513446, + "narHash": "sha256-pnRh5ysSgMSOQxvL82sNJRwD/CiSYWplrGRU2WLoNKQ=", + "owner": "kamadorueda", + "repo": "alejandra", + "rev": "c68bef57c1db3add865493d9cb741a14618bdc28", + "type": "github" + }, + "original": { + "owner": "kamadorueda", + "repo": "alejandra", + "type": "github" + } + }, "antigravity-nix": { "inputs": { "flake-utils": "flake-utils", @@ -89,6 +111,28 @@ "type": "github" } }, + "fenix": { + "inputs": { + "nixpkgs": [ + "alejandra", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1730615655, + "narHash": "sha256-2HBR3zLn57LXKNRtxBb+O+uDqHM4n0pz51rPayMl4cg=", + "owner": "nix-community", + "repo": "fenix", + "rev": "efeb50e2535b17ffd4a135e6e3e5fd60a525180c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "firefox-gnome-theme": { "flake": false, "locked": { @@ -220,6 +264,22 @@ "type": "github" } }, + "flakeCompat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "fromYaml": { "flake": false, "locked": { @@ -262,11 +322,11 @@ ] }, "locked": { - "lastModified": 1764866045, - "narHash": "sha256-0GsEtXV9OquDQ1VclQfP16cU5VZh7NEVIOjSH4UaJuM=", + "lastModified": 1765170903, + "narHash": "sha256-O8VTGey1xxiRW+Fpb+Ps9zU7ShmxUA1a7cMTcENCVNg=", "owner": "nix-community", "repo": "home-manager", - "rev": "f63d0fe9d81d36e5fc95497217a72e02b8b7bcab", + "rev": "20561be440a11ec57a89715480717baf19fe6343", "type": "github" }, "original": { @@ -358,11 +418,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1765064213, - "narHash": "sha256-tyWaUCIf/v0FaSE02V9Cxt9InuB2SPm4Wz++Q8P9POA=", + "lastModified": 1765170393, + "narHash": "sha256-rrIFbnlGNu/iljpuSHX5T4NOARZ8Fq3IBrwa0gv3gvE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9a9b8ba4a9b114c8b2c577bd53e6d35bfb8e0d96", + "rev": "87fa37f7bb685f6888fa6f1dcd8066184a38b755", "type": "github" }, "original": { @@ -435,11 +495,11 @@ ] }, "locked": { - "lastModified": 1765053872, - "narHash": "sha256-HXnApDWc4vlx6Mh9OJu0fYn5oqUQHva82qS54M3gnJw=", + "lastModified": 1765147737, + "narHash": "sha256-gB7SYd9o5QL5y+heFVl/lH1qsOlcBTFRqT3MU0dFOGc=", "owner": "noctalia-dev", "repo": "noctalia-shell", - "rev": "969bddd382b8014ca2e76d1a8f1159276775f813", + "rev": "f3b6c1d60bcdf8cc68d5177c7bc3d2332419bf4b", "type": "github" }, "original": { @@ -505,11 +565,11 @@ "systems": "systems_4" }, "locked": { - "lastModified": 1764904740, - "narHash": "sha256-TzqXUQlESmS5XGJ3tR1/xdoU0vySyp6YUUpmGF5F0kY=", + "lastModified": 1765119282, + "narHash": "sha256-iI0fuBBYJMnOprGD2L+rum2P8lHMcZ5n35hzdlpwayI=", "owner": "notashelf", "repo": "nvf", - "rev": "249cabe0c5392c384c82fa9d28d3f49fbeb04266", + "rev": "26c4a7e3c33e739d474ddaf52aa4c5f3d11922ba", "type": "github" }, "original": { @@ -520,6 +580,7 @@ }, "root": { "inputs": { + "alejandra": "alejandra", "antigravity-nix": "antigravity-nix", "home-manager": "home-manager", "nix-flatpak": "nix-flatpak", @@ -531,6 +592,23 @@ "zen-browser": "zen-browser" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1730555913, + "narHash": "sha256-KNHZUlqsEibg3YtfUyOFQSofP8hp1HKoY+laoesBxRM=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "f17a5bbfd0969ba2e63a74505a80e55ecb174ed9", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "stylix": { "inputs": { "base16": "base16", @@ -550,11 +628,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1764982414, - "narHash": "sha256-LqCQL0BVLQYtOIBfWSHkNbRoQ+nCeCdfj7/Ggmb4x3w=", + "lastModified": 1765065096, + "narHash": "sha256-abrrONk8vzRtY6fHEkjZOyRJpKHjPlFqMBE0+/DxfAU=", "owner": "danth", "repo": "stylix", - "rev": "b1c99fd9525bae86f20018e96d68176002ad18b0", + "rev": "84d9d55885d463d461234f3aac07b2389a2577d8", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e85cf9e..9e45345 100644 --- a/flake.nix +++ b/flake.nix @@ -32,46 +32,51 @@ url = "github:0xc000022070/zen-browser-flake/beta"; inputs.nixpkgs.follows = "nixpkgs"; }; + alejandra = { + url = "github:kamadorueda/alejandra"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = - { nixpkgs - , home-manager - , nixvim - , nix-flatpak - , ... - } @ inputs: - let - system = "x86_64-linux"; - host = "zaneyos-24-vm"; - profile = "vm"; - username = "dwilliams"; + outputs = { + nixpkgs, + home-manager, + nixvim, + nix-flatpak, + alejandra, + ... + } @ inputs: let + system = "x86_64-linux"; + host = "zaneyos-24-vm"; + profile = "vm"; + username = "dwilliams"; - # Deduplicate nixosConfigurations while preserving the top-level 'profile' - mkNixosConfig = gpuProfile: - nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs; - inherit username; - inherit host; - inherit profile; # keep using the let-bound profile for modules/scripts - }; - modules = [ - ./modules/core/overlays.nix - ./profiles/${gpuProfile} - nix-flatpak.nixosModules.nix-flatpak - ]; + # Deduplicate nixosConfigurations while preserving the top-level 'profile' + mkNixosConfig = gpuProfile: + nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs; + inherit username; + inherit host; + inherit profile; # keep using the let-bound profile for modules/scripts }; - in - { - nixosConfigurations = { - amd = mkNixosConfig "amd"; - nvidia = mkNixosConfig "nvidia"; - nvidia-laptop = mkNixosConfig "nvidia-laptop"; - amd-hybrid = mkNixosConfig "amd-hybrid"; - intel = mkNixosConfig "intel"; - vm = mkNixosConfig "vm"; + modules = [ + ./modules/core/overlays.nix + ./profiles/${gpuProfile} + nix-flatpak.nixosModules.nix-flatpak + ]; }; + in { + nixosConfigurations = { + amd = mkNixosConfig "amd"; + nvidia = mkNixosConfig "nvidia"; + nvidia-laptop = mkNixosConfig "nvidia-laptop"; + amd-hybrid = mkNixosConfig "amd-hybrid"; + intel = mkNixosConfig "intel"; + vm = mkNixosConfig "vm"; }; + + formatter.x86_64-linux = inputs.alejandra.packages.x86_64-linux.default; + }; } diff --git a/hosts/default/default.nix b/hosts/default/default.nix index 1ef7d77..6faad47 100644 --- a/hosts/default/default.nix +++ b/hosts/default/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { imports = [ ./hardware.nix ./host-packages.nix diff --git a/hosts/default/hardware.nix b/hosts/default/hardware.nix index a662432..54dab41 100644 --- a/hosts/default/hardware.nix +++ b/hosts/default/hardware.nix @@ -1,35 +1,36 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/dd005850-6230-40c4-9d70-8c8cf443658d"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/dd005850-6230-40c4-9d70-8c8cf443658d"; + fsType = "ext4"; + }; boot.initrd.luks.devices."luks-b7565781-148e-4c94-9c76-36c84dd93dc8".device = "/dev/disk/by-uuid/b7565781-148e-4c94-9c76-36c84dd93dc8"; - fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/C2A6-DF56"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/C2A6-DF56"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; - swapDevices = [ ]; + swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/hosts/nixstation/default.nix b/hosts/nixstation/default.nix index 1ef7d77..6faad47 100644 --- a/hosts/nixstation/default.nix +++ b/hosts/nixstation/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { imports = [ ./hardware.nix ./host-packages.nix diff --git a/hosts/nixstation/hardware.nix b/hosts/nixstation/hardware.nix index bff5110..3339e66 100644 --- a/hosts/nixstation/hardware.nix +++ b/hosts/nixstation/hardware.nix @@ -1,7 +1,8 @@ -{ config -, lib -, modulesPath -, ... +{ + config, + lib, + modulesPath, + ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") @@ -16,13 +17,13 @@ "usbhid" "sd_mod" ]; - kernelModules = [ ]; + kernelModules = []; luks.devices = { "luks-8941ac93-f043-46d1-b128-37d5e846303f".device = "/dev/disk/by-uuid/8941ac93-f043-46d1-b128-37d5e846303f"; }; }; - kernelModules = [ "kvm-intel" ]; - extraModulePackages = [ ]; + kernelModules = ["kvm-intel"]; + extraModulePackages = []; }; fileSystems = { "/" = { @@ -51,7 +52,7 @@ ]; }; }; - swapDevices = [ ]; + swapDevices = []; networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/hosts/nixstation/host-packages.nix b/hosts/nixstation/host-packages.nix index 0934757..60dbba4 100644 --- a/hosts/nixstation/host-packages.nix +++ b/hosts/nixstation/host-packages.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { environment.systemPackages = with pkgs; [ audacity discord diff --git a/hosts/zaneyos-24-vm/default.nix b/hosts/zaneyos-24-vm/default.nix index 1ef7d77..6faad47 100644 --- a/hosts/zaneyos-24-vm/default.nix +++ b/hosts/zaneyos-24-vm/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { imports = [ ./hardware.nix ./host-packages.nix diff --git a/hosts/zaneyos-24-vm/hardware.nix b/hosts/zaneyos-24-vm/hardware.nix index 5a99045..8434bb8 100644 --- a/hosts/zaneyos-24-vm/hardware.nix +++ b/hosts/zaneyos-24-vm/hardware.nix @@ -1,37 +1,41 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/e5fc1006-4d0b-41db-8c43-22b3cb8110c6"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/e5fc1006-4d0b-41db-8c43-22b3cb8110c6"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/9287-3738"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/9287-3738"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; - fileSystems."/mnt/nas" = - { device = "192.168.40.11:/volume1/DiskStation54TB"; - fsType = "nfs"; - }; + fileSystems."/mnt/nas" = { + device = "192.168.40.11:/volume1/DiskStation54TB"; + fsType = "nfs"; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/a6e9dd8b-6767-44f4-84fa-30d02d90d087"; } - ]; + swapDevices = [ + {device = "/dev/disk/by-uuid/a6e9dd8b-6767-44f4-84fa-30d02d90d087";} + ]; networking.useDHCP = lib.mkDefault true; # networking.interfaces.docker0.useDHCP = lib.mkDefault true; diff --git a/hosts/zaneyos-oem/default.nix b/hosts/zaneyos-oem/default.nix index 1ef7d77..6faad47 100644 --- a/hosts/zaneyos-oem/default.nix +++ b/hosts/zaneyos-oem/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { imports = [ ./hardware.nix ./host-packages.nix diff --git a/hosts/zaneyos-oem/hardware.nix b/hosts/zaneyos-oem/hardware.nix index 90746ff..a017b4c 100644 --- a/hosts/zaneyos-oem/hardware.nix +++ b/hosts/zaneyos-oem/hardware.nix @@ -1,20 +1,21 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config -, lib -, pkgs -, modulesPath -, ... +{ + config, + lib, + pkgs, + modulesPath, + ... }: { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; fileSystems."/" = { device = "/dev/disk/by-uuid/e5fc1006-4d0b-41db-8c43-22b3cb8110c6"; @@ -24,7 +25,7 @@ fileSystems."/boot" = { device = "/dev/disk/by-uuid/9287-3738"; fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; + options = ["fmask=0077" "dmask=0077"]; }; fileSystems."/mnt/nas" = { @@ -33,7 +34,7 @@ }; swapDevices = [ - { device = "/dev/disk/by-uuid/a6e9dd8b-6767-44f4-84fa-30d02d90d087"; } + {device = "/dev/disk/by-uuid/a6e9dd8b-6767-44f4-84fa-30d02d90d087";} ]; networking.useDHCP = lib.mkDefault true; diff --git a/modules/core/boot.nix b/modules/core/boot.nix index 61095d3..47011ff 100644 --- a/modules/core/boot.nix +++ b/modules/core/boot.nix @@ -1,11 +1,13 @@ -{ pkgs, config, ... }: - { + pkgs, + config, + ... +}: { boot = { kernelPackages = pkgs.linuxPackages_zen; - kernelModules = [ "v4l2loopback" ]; - extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; - kernel.sysctl = { "vm.max_map_count" = 2147483642; }; + kernelModules = ["v4l2loopback"]; + extraModulePackages = [config.boot.kernelPackages.v4l2loopback]; + kernel.sysctl = {"vm.max_map_count" = 2147483642;}; loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = true; # Appimage Support diff --git a/modules/core/cachix.nix b/modules/core/cachix.nix index 2465f0b..df7a1a6 100644 --- a/modules/core/cachix.nix +++ b/modules/core/cachix.nix @@ -1,5 +1,4 @@ -{ lib, ... }: -{ +{lib, ...}: { nix.settings = { substituters = lib.mkAfter [ "https://cache.nixos.org" diff --git a/modules/core/default.nix b/modules/core/default.nix index a203d1a..67fbf6f 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -2,12 +2,10 @@ inputs, host, ... -}: -let +}: let # Import the host-specific variables.nix vars = import ../../hosts/${host}/variables.nix; -in -{ +in { imports = [ ./boot.nix ./flatpak.nix @@ -20,7 +18,11 @@ in ./packages.nix ./printing.nix # Conditionally import the display manager module - (if vars.displayManager == "tui" then ./greetd.nix else ./sddm.nix) + ( + if vars.displayManager == "tui" + then ./greetd.nix + else ./sddm.nix + ) ./security.nix ./services.nix ./steam.nix diff --git a/modules/core/flatpak.nix b/modules/core/flatpak.nix index 9c8692c..e513739 100644 --- a/modules/core/flatpak.nix +++ b/modules/core/flatpak.nix @@ -1,8 +1,8 @@ -{ pkgs, ... }: { +{pkgs, ...}: { xdg.portal = { enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-hyprland ]; - configPackages = [ pkgs.hyprland ]; + extraPortals = [pkgs.xdg-desktop-portal-hyprland]; + configPackages = [pkgs.hyprland]; }; services = { flatpak = { diff --git a/modules/core/fonts.nix b/modules/core/fonts.nix index 7f278bd..4955f56 100644 --- a/modules/core/fonts.nix +++ b/modules/core/fonts.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { fonts = { packages = with pkgs; [ dejavu_fonts diff --git a/modules/core/greetd.nix b/modules/core/greetd.nix index 1cd2c47..cb59b68 100644 --- a/modules/core/greetd.nix +++ b/modules/core/greetd.nix @@ -1,6 +1,7 @@ -{ pkgs -, username -, ... +{ + pkgs, + username, + ... }: { services.greetd = { enable = true; diff --git a/modules/core/hardware.nix b/modules/core/hardware.nix index 5c6ec61..f34c74d 100644 --- a/modules/core/hardware.nix +++ b/modules/core/hardware.nix @@ -1,10 +1,9 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { hardware = { sane = { enable = true; - extraBackends = [ pkgs.sane-airscan ]; - disabledDefaultBackends = [ "escl" ]; + extraBackends = [pkgs.sane-airscan]; + disabledDefaultBackends = ["escl"]; }; logitech.wireless.enable = false; logitech.wireless.enableGraphical = false; diff --git a/modules/core/network.nix b/modules/core/network.nix index 132d9bc..325f7a0 100644 --- a/modules/core/network.nix +++ b/modules/core/network.nix @@ -1,17 +1,16 @@ -{ pkgs -, host -, options -, ... -}: -let - inherit (import ../../hosts/${host}/variables.nix) hostId; -in { + pkgs, + host, + options, + ... +}: let + inherit (import ../../hosts/${host}/variables.nix) hostId; +in { networking = { hostName = "${host}"; hostId = hostId; networkmanager.enable = true; - timeServers = options.networking.timeServers.default ++ [ "pool.ntp.org" ]; + timeServers = options.networking.timeServers.default ++ ["pool.ntp.org"]; firewall = { enable = true; allowedTCPPorts = [ @@ -29,5 +28,5 @@ in }; }; - environment.systemPackages = with pkgs; [ networkmanagerapplet ]; + environment.systemPackages = with pkgs; [networkmanagerapplet]; } diff --git a/modules/core/nfs.nix b/modules/core/nfs.nix index 7999158..adbcde8 100644 --- a/modules/core/nfs.nix +++ b/modules/core/nfs.nix @@ -1,8 +1,6 @@ -{ host, ... }: -let +{host, ...}: let inherit (import ../../hosts/${host}/variables.nix) enableNFS; -in -{ +in { services = { rpcbind.enable = enableNFS; nfs.server.enable = enableNFS; diff --git a/modules/core/nh.nix b/modules/core/nh.nix index ce9304b..4785056 100644 --- a/modules/core/nh.nix +++ b/modules/core/nh.nix @@ -1,6 +1,7 @@ -{ pkgs -, username -, ... +{ + pkgs, + username, + ... }: { programs.nh = { enable = true; diff --git a/modules/core/overlays.nix b/modules/core/overlays.nix index ee53195..c7de92a 100644 --- a/modules/core/overlays.nix +++ b/modules/core/overlays.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: { +{inputs, ...}: { nixpkgs.overlays = [ # Provide pkgs.google-antigravity via antigravity-nix overlay inputs.antigravity-nix.overlays.default diff --git a/modules/core/printing.nix b/modules/core/printing.nix index a6d5e1b..982126f 100644 --- a/modules/core/printing.nix +++ b/modules/core/printing.nix @@ -1,8 +1,6 @@ -{ host, ... }: -let +{host, ...}: let inherit (import ../../hosts/${host}/variables.nix) printEnable; -in -{ +in { services = { printing = { enable = printEnable; diff --git a/modules/core/quickshell.nix b/modules/core/quickshell.nix index 8ebcfb3..1eaee7c 100644 --- a/modules/core/quickshell.nix +++ b/modules/core/quickshell.nix @@ -1,31 +1,34 @@ -{ pkgs, inputs, ... }: -{ - environment.systemPackages = with pkgs; [ - quickshell - - # Qt6 related kits(for slove Qt5Compat problem) - qt6.qt5compat - qt6.qtbase - qt6.qtquick3d - qt6.qtwayland - qt6.qtdeclarative - qt6.qtsvg - - # alternate options - # libsForQt5.qt5compat - kdePackages.qt5compat - libsForQt5.qt5.qtgraphicaleffects - ]; - - # necessary environment variables - environment.variables = { - QML_IMPORT_PATH = "${pkgs.qt6.qt5compat}/lib/qt-6/qml:${pkgs.qt6.qtbase}/lib/qt-6/qml"; - QML2_IMPORT_PATH = "${pkgs.qt6.qt5compat}/lib/qt-6/qml:${pkgs.qt6.qtbase}/lib/qt-6/qml"; - }; - - # make sure the Qt application is working properly - environment.sessionVariables = { - QT_QPA_PLATFORM = "wayland;xcb"; - QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; - }; -} +{ + pkgs, + inputs, + ... +}: { + environment.systemPackages = with pkgs; [ + quickshell + + # Qt6 related kits(for slove Qt5Compat problem) + qt6.qt5compat + qt6.qtbase + qt6.qtquick3d + qt6.qtwayland + qt6.qtdeclarative + qt6.qtsvg + + # alternate options + # libsForQt5.qt5compat + kdePackages.qt5compat + libsForQt5.qt5.qtgraphicaleffects + ]; + + # necessary environment variables + environment.variables = { + QML_IMPORT_PATH = "${pkgs.qt6.qt5compat}/lib/qt-6/qml:${pkgs.qt6.qtbase}/lib/qt-6/qml"; + QML2_IMPORT_PATH = "${pkgs.qt6.qt5compat}/lib/qt-6/qml:${pkgs.qt6.qtbase}/lib/qt-6/qml"; + }; + + # make sure the Qt application is working properly + environment.sessionVariables = { + QT_QPA_PLATFORM = "wayland;xcb"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + }; +} diff --git a/modules/core/sddm.nix b/modules/core/sddm.nix index 2034987..c173803 100644 --- a/modules/core/sddm.nix +++ b/modules/core/sddm.nix @@ -65,7 +65,7 @@ in { services.displayManager = { sddm = { package = pkgs.kdePackages.sddm; - extraPackages = [ sddm-astronaut ]; + extraPackages = [sddm-astronaut]; enable = true; wayland.enable = true; theme = "sddm-astronaut-theme"; @@ -87,8 +87,8 @@ in { vars = import ../../hosts/${host}/variables.nix; keyboardLayout = vars.keyboardLayout or "us"; keyboardVariant = vars.keyboardVariant or ""; - in ({ XKB_DEFAULT_LAYOUT = keyboardLayout; } - // lib.optionalAttrs (keyboardVariant != "") { XKB_DEFAULT_VARIANT = keyboardVariant; }); + in ({XKB_DEFAULT_LAYOUT = keyboardLayout;} + // lib.optionalAttrs (keyboardVariant != "") {XKB_DEFAULT_VARIANT = keyboardVariant;}); - environment.systemPackages = [ sddm-astronaut ]; + environment.systemPackages = [sddm-astronaut]; } diff --git a/modules/core/services.nix b/modules/core/services.nix index 6705142..caf5798 100644 --- a/modules/core/services.nix +++ b/modules/core/services.nix @@ -1,4 +1,4 @@ -{ profile, ... }: { +{profile, ...}: { # Services to start services = { upower.enable = true; # noctalia shell battery @@ -13,7 +13,7 @@ PasswordAuthentication = true; #Users can SSH using kb and password KbdInteractiveAuthentication = true; }; - ports = [ 22 ]; + ports = [22]; }; blueman.enable = true; # Bluetooth Support tumbler.enable = true; # Image/video preview diff --git a/modules/core/starfish.nix b/modules/core/starfish.nix index 48564f1..bffc1aa 100644 --- a/modules/core/starfish.nix +++ b/modules/core/starfish.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { programs = { starship = { enable = false; diff --git a/modules/core/steam.nix b/modules/core/steam.nix index cb8a5a5..6fafcf7 100644 --- a/modules/core/steam.nix +++ b/modules/core/steam.nix @@ -1,11 +1,11 @@ -{ pkgs, ... }: { +{pkgs, ...}: { programs = { steam = { enable = true; remotePlay.openFirewall = true; dedicatedServer.openFirewall = false; gamescopeSession.enable = true; - extraCompatPackages = [ pkgs.proton-ge-bin ]; + extraCompatPackages = [pkgs.proton-ge-bin]; }; gamescope = { diff --git a/modules/core/stylix.nix b/modules/core/stylix.nix index 800d070..3ed5d35 100644 --- a/modules/core/stylix.nix +++ b/modules/core/stylix.nix @@ -1,11 +1,10 @@ -{ pkgs -, host -, ... -}: -let - inherit (import ../../hosts/${host}/variables.nix) stylixImage; -in { + pkgs, + host, + ... +}: let + inherit (import ../../hosts/${host}/variables.nix) stylixImage; +in { # Styling Options stylix = { enable = true; diff --git a/modules/core/syncthing.nix b/modules/core/syncthing.nix index b214716..b374c5c 100644 --- a/modules/core/syncthing.nix +++ b/modules/core/syncthing.nix @@ -1,4 +1,4 @@ -{ username, ... }: { +{username, ...}: { services.syncthing = { enable = false; user = "${username}"; diff --git a/modules/core/thunar.nix b/modules/core/thunar.nix index ea1229b..c7419e0 100644 --- a/modules/core/thunar.nix +++ b/modules/core/thunar.nix @@ -1,11 +1,10 @@ -{ host -, pkgs -, ... -}: -let - inherit (import ../../hosts/${host}/variables.nix) thunarEnable; -in { + host, + pkgs, + ... +}: let + inherit (import ../../hosts/${host}/variables.nix) thunarEnable; +in { programs = { thunar = { enable = thunarEnable; diff --git a/modules/core/user.nix b/modules/core/user.nix index df4372c..a292018 100644 --- a/modules/core/user.nix +++ b/modules/core/user.nix @@ -1,22 +1,21 @@ -{ pkgs -, inputs -, username -, host -, profile -, ... -}: -let - inherit (import ../../hosts/${host}/variables.nix) gitUsername; -in { - imports = [ inputs.home-manager.nixosModules.home-manager ]; + pkgs, + inputs, + username, + host, + profile, + ... +}: let + inherit (import ../../hosts/${host}/variables.nix) gitUsername; +in { + imports = [inputs.home-manager.nixosModules.home-manager]; home-manager = { useUserPackages = true; useGlobalPkgs = false; backupFileExtension = "backup"; - extraSpecialArgs = { inherit inputs username host profile pkgs; }; + extraSpecialArgs = {inherit inputs username host profile pkgs;}; users.${username} = { - imports = [ ./../home ]; + imports = [./../home]; home = { username = "${username}"; homeDirectory = "/home/${username}"; @@ -41,5 +40,5 @@ in shell = pkgs.zsh; ignoreShellProgramCheck = true; }; - nix.settings.allowed-users = [ "${username}" ]; + nix.settings.allowed-users = ["${username}"]; } diff --git a/modules/core/virtualisation.nix b/modules/core/virtualisation.nix index 09fd5dd..e7023e8 100644 --- a/modules/core/virtualisation.nix +++ b/modules/core/virtualisation.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { # Only enable either docker or podman -- Not both virtualisation = { docker = { diff --git a/modules/core/xserver.nix b/modules/core/xserver.nix index 0086f03..98f88e7 100644 --- a/modules/core/xserver.nix +++ b/modules/core/xserver.nix @@ -1,28 +1,40 @@ -{ host, ... }: -let +{host, ...}: let vars = import ../../hosts/${host}/variables.nix; keyboardLayout = vars.keyboardLayout or "us"; keyboardVariant = vars.keyboardVariant or ""; # Treat only known US-based variants as implying layout = "us". - usVariants = [ "dvorak" "colemak" "workman" "intl" "us-intl" "altgr-intl" ]; - normalizeUSVariant = v: if v == "us-intl" then "intl" else v; + usVariants = ["dvorak" "colemak" "workman" "intl" "us-intl" "altgr-intl"]; + normalizeUSVariant = v: + if v == "us-intl" + then "intl" + else v; # If layout itself is a US variant (e.g., "dvorak", "us-intl"), normalize it - layoutFromLayout = if builtins.elem keyboardLayout usVariants then "us" else keyboardLayout; - variantFromLayout = if builtins.elem keyboardLayout usVariants then normalizeUSVariant keyboardLayout else ""; + layoutFromLayout = + if builtins.elem keyboardLayout usVariants + then "us" + else keyboardLayout; + variantFromLayout = + if builtins.elem keyboardLayout usVariants + then normalizeUSVariant keyboardLayout + else ""; # If the provided variant is a US variant, force layout to us; otherwise keep layout - layoutFromVariant = if builtins.elem keyboardVariant usVariants then "us" else layoutFromLayout; + layoutFromVariant = + if builtins.elem keyboardVariant usVariants + then "us" + else layoutFromLayout; variantFinal = - if builtins.elem keyboardVariant usVariants then normalizeUSVariant keyboardVariant - else if variantFromLayout != "" then variantFromLayout + if builtins.elem keyboardVariant usVariants + then normalizeUSVariant keyboardVariant + else if variantFromLayout != "" + then variantFromLayout else keyboardVariant; xkbLayout = layoutFromVariant; xkbVariant = variantFinal; -in -{ +in { services.xserver = { enable = false; xkb = { diff --git a/modules/drivers/amd-drivers.nix b/modules/drivers/amd-drivers.nix index b0a51dd..e745302 100644 --- a/modules/drivers/amd-drivers.nix +++ b/modules/drivers/amd-drivers.nix @@ -1,19 +1,18 @@ -{ lib -, pkgs -, config -, ... -}: -with lib; -let - cfg = config.drivers.amdgpu; -in { + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.drivers.amdgpu; +in { options.drivers.amdgpu = { enable = mkEnableOption "Enable AMD Drivers"; }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = [ "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ]; - services.xserver.videoDrivers = [ "amdgpu" ]; + systemd.tmpfiles.rules = ["L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"]; + services.xserver.videoDrivers = ["amdgpu"]; }; } diff --git a/modules/drivers/default.nix b/modules/drivers/default.nix index b966b93..fef514c 100644 --- a/modules/drivers/default.nix +++ b/modules/drivers/default.nix @@ -1,6 +1,4 @@ -{ ... -}: -{ +{...}: { imports = [ ./amd-drivers.nix ./intel-drivers.nix diff --git a/modules/drivers/intel-drivers.nix b/modules/drivers/intel-drivers.nix index 337e4f6..7357fda 100644 --- a/modules/drivers/intel-drivers.nix +++ b/modules/drivers/intel-drivers.nix @@ -1,12 +1,12 @@ -{ lib -, pkgs -, config -, ... +{ + lib, + pkgs, + config, + ... }: with lib; let cfg = config.drivers.intel; -in -{ +in { options.drivers.intel = { enable = mkEnableOption "Enable Intel Graphics Drivers"; }; diff --git a/modules/drivers/local-hardware-clock.nix b/modules/drivers/local-hardware-clock.nix index cf4e73f..1ebc431 100644 --- a/modules/drivers/local-hardware-clock.nix +++ b/modules/drivers/local-hardware-clock.nix @@ -1,16 +1,15 @@ -{ lib -, pkgs -, config -, ... -}: -with lib; -let - cfg = config.local.hardware-clock; -in { + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.local.hardware-clock; +in { options.local.hardware-clock = { enable = mkEnableOption "Change Hardware Clock To Local Time"; }; - config = mkIf cfg.enable { time.hardwareClockInLocalTime = true; }; + config = mkIf cfg.enable {time.hardwareClockInLocalTime = true;}; } diff --git a/modules/drivers/nvidia-amd-hybrid.nix b/modules/drivers/nvidia-amd-hybrid.nix index b81b10d..fdaea86 100644 --- a/modules/drivers/nvidia-amd-hybrid.nix +++ b/modules/drivers/nvidia-amd-hybrid.nix @@ -1,9 +1,12 @@ -{ config, lib, pkgs, ... }: - +{ + config, + lib, + pkgs, + ... +}: with lib; let cfg = config.drivers.nvidia-amd-hybrid; -in -{ +in { options.drivers.nvidia-amd-hybrid = { enable = mkEnableOption "Enable AMD iGPU + NVIDIA dGPU (Prime offload)"; # AMD iGPU Bus ID (e.g., PCI:5:0:0). Expose as option for future host wiring. @@ -24,7 +27,7 @@ in # Enforce kernel 6.12 when this hybrid config is selected boot.kernelPackages = lib.mkForce pkgs.linuxPackages_6_12; - services.xserver.videoDrivers = [ "nvidia" ]; + services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { modesetting.enable = true; diff --git a/modules/drivers/nvidia-drivers.nix b/modules/drivers/nvidia-drivers.nix index 2c30be9..0d395fc 100644 --- a/modules/drivers/nvidia-drivers.nix +++ b/modules/drivers/nvidia-drivers.nix @@ -1,19 +1,18 @@ -{ lib -, pkgs -, config -, ... -}: -with lib; -let - cfg = config.drivers.nvidia; -in { + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.drivers.nvidia; +in { options.drivers.nvidia = { enable = mkEnableOption "Enable Nvidia Drivers"; }; config = mkIf cfg.enable { - services.xserver.videoDrivers = [ "nvidia" ]; + services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { # Modesetting is required. modesetting.enable = true; diff --git a/modules/drivers/nvidia-prime-drivers.nix b/modules/drivers/nvidia-prime-drivers.nix index 147df1a..559a35e 100644 --- a/modules/drivers/nvidia-prime-drivers.nix +++ b/modules/drivers/nvidia-prime-drivers.nix @@ -1,13 +1,12 @@ -{ lib -, pkgs -, config -, ... -}: -with lib; -let - cfg = config.drivers.nvidia-prime; -in { + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.drivers.nvidia-prime; +in { options.drivers.nvidia-prime = { enable = mkEnableOption "Enable Nvidia Prime Hybrid GPU Offload"; intelBusID = mkOption { diff --git a/modules/drivers/vm-guest-services.nix b/modules/drivers/vm-guest-services.nix index 778bcf3..3c2895d 100644 --- a/modules/drivers/vm-guest-services.nix +++ b/modules/drivers/vm-guest-services.nix @@ -1,13 +1,12 @@ -{ lib -, pkgs -, config -, ... -}: -with lib; -let - cfg = config.vm.guest-services; -in { + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.vm.guest-services; +in { options.vm.guest-services = { enable = mkEnableOption "Enable Virtual Machine Guest Services"; }; @@ -15,6 +14,6 @@ in config = mkIf cfg.enable { services.qemuGuest.enable = true; services.spice-vdagentd.enable = true; - services.spice-webdavd.enable = false; #Causes build failure davsfs2 unsupported neon version 9-12-25 + services.spice-webdavd.enable = false; #Causes build failure davsfs2 unsupported neon version 9-12-25 }; } diff --git a/modules/home/bash.nix b/modules/home/bash.nix index 0712618..ba4de54 100644 --- a/modules/home/bash.nix +++ b/modules/home/bash.nix @@ -1,4 +1,4 @@ -{ profile, ... }: { +{profile, ...}: { programs.bash = { enable = false; enableCompletion = true; diff --git a/modules/home/bashrc-personal.nix b/modules/home/bashrc-personal.nix index 386597b..6b5e732 100644 --- a/modules/home/bashrc-personal.nix +++ b/modules/home/bashrc-personal.nix @@ -1,20 +1,20 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ bash ]; +{pkgs, ...}: { + home.packages = with pkgs; [bash]; home.file."./.bashrc-personal".text = '' - # This file allows you to define your own aliases, functions, etc - # below are just some examples of what you can use this file for - - #!/usr/bin/env bash - # Set defaults - # - #export EDITOR="nvim" - #export VISUAL="nvim" - - #alias c="clear" - #eval "$(zoxide init bash)" - #eval "$(oh-my-posh init bash --config $HOME/.config/powerlevel10k_rainbow.omp.json)" + # This file allows you to define your own aliases, functions, etc + # below are just some examples of what you can use this file for + + #!/usr/bin/env bash + # Set defaults + # + #export EDITOR="nvim" + #export VISUAL="nvim" + + #alias c="clear" + #eval "$(zoxide init bash)" + #eval "$(oh-my-posh init bash --config $HOME/.config/powerlevel10k_rainbow.omp.json)" ''; } diff --git a/modules/home/cli/bat.nix b/modules/home/cli/bat.nix index d63242a..898b65a 100644 --- a/modules/home/cli/bat.nix +++ b/modules/home/cli/bat.nix @@ -1,6 +1,7 @@ -{ pkgs -, lib -, ... +{ + pkgs, + lib, + ... }: { programs.bat = { enable = true; diff --git a/modules/home/cli/bottom.nix b/modules/home/cli/bottom.nix index 3b24f84..63814fc 100644 --- a/modules/home/cli/bottom.nix +++ b/modules/home/cli/bottom.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { programs.bottom = { enable = true; settings = { @@ -9,14 +9,14 @@ { ratio = 2; child = [ - { type = "cpu"; } - { type = "temp"; } + {type = "cpu";} + {type = "temp";} ]; } { ratio = 2; child = [ - { type = "network"; } + {type = "network";} ]; } { diff --git a/modules/home/cli/btop.nix b/modules/home/cli/btop.nix index 0f20db1..845d758 100644 --- a/modules/home/cli/btop.nix +++ b/modules/home/cli/btop.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { programs.btop = { enable = true; package = pkgs.btop.override { diff --git a/modules/home/cli/cava.nix b/modules/home/cli/cava.nix index e3c23cd..31a700f 100644 --- a/modules/home/cli/cava.nix +++ b/modules/home/cli/cava.nix @@ -1,4 +1,4 @@ -{ config, ... }: { +{config, ...}: { programs.cava = { enable = true; settings = { diff --git a/modules/home/cli/fzf.nix b/modules/home/cli/fzf.nix index 0100ad8..030b44c 100644 --- a/modules/home/cli/fzf.nix +++ b/modules/home/cli/fzf.nix @@ -1,14 +1,13 @@ # Fzf is a general-purpose command-line fuzzy finder. -{ config -, lib -, ... -}: -let +{ + config, + lib, + ... +}: let accent = "#" + config.lib.stylix.colors.base0D; foreground = "#" + config.lib.stylix.colors.base05; muted = "#" + config.lib.stylix.colors.base03; -in -{ +in { programs.fzf = { enable = true; enableZshIntegration = true; diff --git a/modules/home/cli/gh.nix b/modules/home/cli/gh.nix index 0df8cc3..dce545b 100644 --- a/modules/home/cli/gh.nix +++ b/modules/home/cli/gh.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +{...}: { programs = { gh.enable = true; }; diff --git a/modules/home/cli/git.nix b/modules/home/cli/git.nix index 4d24e00..5a509ad 100644 --- a/modules/home/cli/git.nix +++ b/modules/home/cli/git.nix @@ -1,8 +1,6 @@ -{ host, ... }: -let +{host, ...}: let inherit (import ../../../hosts/${host}/variables.nix) gitUsername gitEmail; -in -{ +in { programs.git = { enable = true; diff --git a/modules/home/cli/htop.nix b/modules/home/cli/htop.nix index 263697b..bdc77b4 100644 --- a/modules/home/cli/htop.nix +++ b/modules/home/cli/htop.nix @@ -1,4 +1,4 @@ -{ config, ... }: { +{config, ...}: { programs.htop = { enable = true; settings = @@ -25,18 +25,18 @@ highlight_threads = 1; } // (with config.lib.htop; - leftMeters [ - (bar "AllCPUs2") - (bar "Memory") - (bar "Swap") - (text "Zram") - ]) + leftMeters [ + (bar "AllCPUs2") + (bar "Memory") + (bar "Swap") + (text "Zram") + ]) // (with config.lib.htop; - rightMeters [ - (text "Tasks") - (text "LoadAverage") - (text "Uptime") - (text "Systemd") - ]); + rightMeters [ + (text "Tasks") + (text "LoadAverage") + (text "Uptime") + (text "Systemd") + ]); }; } diff --git a/modules/home/cli/lazygit.nix b/modules/home/cli/lazygit.nix index 298c74d..942567d 100644 --- a/modules/home/cli/lazygit.nix +++ b/modules/home/cli/lazygit.nix @@ -1,10 +1,12 @@ # Lazygit is a simple terminal UI for git commands. -{ config, lib, ... }: -let +{ + config, + lib, + ... +}: let accent = "#${config.lib.stylix.colors.base0D}"; muted = "#${config.lib.stylix.colors.base03}"; -in -{ +in { programs.lazygit = { enable = true; settings = lib.mkForce { @@ -18,8 +20,8 @@ in }; gui = { theme = { - activeBorderColor = [ accent "bold" ]; - inactiveBorderColor = [ muted ]; + activeBorderColor = [accent "bold"]; + inactiveBorderColor = [muted]; }; showListFooter = false; showRandomTip = false; diff --git a/modules/home/editors/antigravity.nix b/modules/home/editors/antigravity.nix index 8d07ff4..c5dc963 100644 --- a/modules/home/editors/antigravity.nix +++ b/modules/home/editors/antigravity.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { # Google Antigravity IDE helper, exposed via antigravity-nix overlay as pkgs.google-antigravity home.packages = with pkgs; [ google-antigravity diff --git a/modules/home/editors/doom-emacs-install.nix b/modules/home/editors/doom-emacs-install.nix index dc45b0f..cdc48fa 100644 --- a/modules/home/editors/doom-emacs-install.nix +++ b/modules/home/editors/doom-emacs-install.nix @@ -1,12 +1,9 @@ -{ pkgs, ... }: - -let +{pkgs, ...}: let doom-icon = pkgs.fetchurl { url = "https://raw.githubusercontent.com/jeetelongname/doom-banners/master/splashes/doom/doom-emacs-color2.svg"; sha256 = "1xxi5ra1z8njsqaqiaq96wyn1sc967l42kvjzbji1zrjj8za6bgq"; }; -in -{ +in { # 1. Create a script to install Doom Emacs home.packages = [ (pkgs.writeShellScriptBin "get-doom" '' @@ -73,6 +70,6 @@ in icon = doom-icon; terminal = false; type = "Application"; - categories = [ "Development" "TextEditor" ]; + categories = ["Development" "TextEditor"]; }; } diff --git a/modules/home/editors/doom-emacs.nix b/modules/home/editors/doom-emacs.nix index ca1f248..8559a3f 100644 --- a/modules/home/editors/doom-emacs.nix +++ b/modules/home/editors/doom-emacs.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { home.packages = with pkgs; [ emacs-pgtk git diff --git a/modules/home/editors/evil-helix.nix b/modules/home/editors/evil-helix.nix index 911cca7..67c447c 100644 --- a/modules/home/editors/evil-helix.nix +++ b/modules/home/editors/evil-helix.nix @@ -1,8 +1,6 @@ -{ pkgs, ... }: -let +{pkgs, ...}: let enableEvilHelix = true; # Set to true to enable the configuration -in -{ +in { home.packages = with pkgs; ( if enableEvilHelix then [ @@ -25,7 +23,7 @@ in docker-language-server typescript-language-server ] - else [ ] + else [] ); home.file.".config/helix/languages.toml".text = diff --git a/modules/home/editors/nvf.nix b/modules/home/editors/nvf.nix index 5ff7bd5..1c97a12 100644 --- a/modules/home/editors/nvf.nix +++ b/modules/home/editors/nvf.nix @@ -1,8 +1,9 @@ -{ inputs -, config -, ... +{ + inputs, + config, + ... }: { - imports = [ inputs.nvf.homeManagerModules.default ]; + imports = [inputs.nvf.homeManagerModules.default]; programs.nvf = { enable = true; @@ -50,55 +51,55 @@ keymaps = [ { key = "jk"; - mode = [ "i" ]; + mode = ["i"]; action = ""; desc = "Exit insert mode"; } { key = "nh"; - mode = [ "n" ]; + mode = ["n"]; action = ":nohl"; desc = "Clear search highlights"; } { key = "ff"; - mode = [ "n" ]; + mode = ["n"]; action = "Telescope find_files"; desc = "Search files by name"; } { key = "lg"; - mode = [ "n" ]; + mode = ["n"]; action = "Telescope live_grep"; desc = "Search files by contents"; } { key = "fe"; - mode = [ "n" ]; + mode = ["n"]; action = "Neotree toggle"; desc = "File browser toggle"; } { key = ""; - mode = [ "i" ]; + mode = ["i"]; action = ""; desc = "Move left in insert mode"; } { key = ""; - mode = [ "i" ]; + mode = ["i"]; action = ""; desc = "Move down in insert mode"; } { key = ""; - mode = [ "i" ]; + mode = ["i"]; action = ""; desc = "Move up in insert mode"; } { key = ""; - mode = [ "i" ]; + mode = ["i"]; action = ""; desc = "Move right in insert mode"; } @@ -108,7 +109,7 @@ spellcheck = { enable = true; - languages = [ "en" ]; + languages = ["en"]; programmingWordlist.enable = true; }; @@ -223,7 +224,7 @@ comments = { comment-nvim.enable = true; }; - + luaConfigPost = '' -- Nix LSP (nil) configuration for auto-eval-inputs local lspconfig = require('lspconfig') @@ -236,7 +237,7 @@ }, }, }) - + -- Auto-update programming wordlist on first startup vim.api.nvim_create_autocmd("VimEnter", { callback = function() @@ -258,7 +259,7 @@ dirtytalkUpdate = '' # Create the spell directory if it doesn't exist mkdir -p "$HOME/.local/share/nvim/site/spell" - + # Try to run DirtytalkUpdate in headless mode with better error handling if ! ${config.programs.nvf.finalPackage}/bin/nvim --headless -c "DirtytalkUpdate" -c "qa!" 2>/dev/null; then echo "Note: DirtytalkUpdate will run automatically on first Neovim startup" diff --git a/modules/home/emoji.nix b/modules/home/emoji.nix index f53d31b..2eb5988 100644 --- a/modules/home/emoji.nix +++ b/modules/home/emoji.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { home.file.".config/.emoji".text = '' 😀 grinning face face smile happy joy :D grin 😃 grinning face with big eyes face happy joy haha :D :) smile funny diff --git a/modules/home/gtk.nix b/modules/home/gtk.nix index f433efa..cec72b3 100644 --- a/modules/home/gtk.nix +++ b/modules/home/gtk.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { gtk = { iconTheme = { name = "Papirus-Dark"; diff --git a/modules/home/hyprland/animations-def.nix b/modules/home/hyprland/animations-def.nix index dbbaea5..e7fbe6e 100644 --- a/modules/home/hyprland/animations-def.nix +++ b/modules/home/hyprland/animations-def.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { wayland.windowManager.hyprland.settings = { animations = { enabled = true; diff --git a/modules/home/hyprland/animations-dynamic.nix b/modules/home/hyprland/animations-dynamic.nix index eb96614..8977f7e 100644 --- a/modules/home/hyprland/animations-dynamic.nix +++ b/modules/home/hyprland/animations-dynamic.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { wayland.windowManager.hyprland.settings = { # name "Dynamic" # credit https://github.com/mylinuxforwork/dotfiles diff --git a/modules/home/hyprland/animations-end4.nix b/modules/home/hyprland/animations-end4.nix index fd8fbce..18369a8 100644 --- a/modules/home/hyprland/animations-end4.nix +++ b/modules/home/hyprland/animations-end4.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { wayland.windowManager.hyprland.settings = { # Name: END-4 # Credit: END-4 project https://github.com/end-4/dots-hyprland diff --git a/modules/home/hyprland/animations-moving.nix b/modules/home/hyprland/animations-moving.nix index 59d8c77..c162b5f 100644 --- a/modules/home/hyprland/animations-moving.nix +++ b/modules/home/hyprland/animations-moving.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { wayland.windowManager.hyprland.settings = { # name "moving" # credit https://github.com/mylinuxforwork/dotfiles diff --git a/modules/home/hyprland/default.nix b/modules/home/hyprland/default.nix index 25234de..ab286ca 100644 --- a/modules/home/hyprland/default.nix +++ b/modules/home/hyprland/default.nix @@ -1,8 +1,6 @@ -{ host, ... }: -let +{host, ...}: let inherit (import ../../../hosts/${host}/variables.nix) animChoice; -in -{ +in { imports = [ animChoice ./binds.nix diff --git a/modules/home/hyprland/env.nix b/modules/home/hyprland/env.nix index 134cc58..ee61625 100644 --- a/modules/home/hyprland/env.nix +++ b/modules/home/hyprland/env.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { wayland.windowManager.hyprland = { settings = { env = [ diff --git a/modules/home/hyprland/hypridle.nix b/modules/home/hyprland/hypridle.nix index 21fbf57..3762aac 100644 --- a/modules/home/hyprland/hypridle.nix +++ b/modules/home/hyprland/hypridle.nix @@ -1,6 +1,4 @@ -{ ... }: - -{ +{...}: { services = { hypridle = { enable = true; diff --git a/modules/home/hyprland/hyprland.nix b/modules/home/hyprland/hyprland.nix index 0635b13..ce1027f 100644 --- a/modules/home/hyprland/hyprland.nix +++ b/modules/home/hyprland/hyprland.nix @@ -4,8 +4,7 @@ pkgs, lib, ... -}: -let +}: let vars = import ../../../hosts/${host}/variables.nix; extraMonitorSettings = vars.extraMonitorSettings or ""; keyboardLayout = vars.keyboardLayout or "us"; @@ -13,24 +12,37 @@ let stylixImage = vars.stylixImage or null; # Treat only known US-based variants as implying layout = "us". - usVariants = [ "dvorak" "colemak" "workman" "intl" "us-intl" "altgr-intl" ]; - normalizeUSVariant = v: if v == "us-intl" then "intl" else v; + usVariants = ["dvorak" "colemak" "workman" "intl" "us-intl" "altgr-intl"]; + normalizeUSVariant = v: + if v == "us-intl" + then "intl" + else v; # If layout itself is a US variant (e.g., "dvorak", "us-intl"), normalize it - layoutFromLayout = if builtins.elem keyboardLayout usVariants then "us" else keyboardLayout; - variantFromLayout = if builtins.elem keyboardLayout usVariants then normalizeUSVariant keyboardLayout else ""; + layoutFromLayout = + if builtins.elem keyboardLayout usVariants + then "us" + else keyboardLayout; + variantFromLayout = + if builtins.elem keyboardLayout usVariants + then normalizeUSVariant keyboardLayout + else ""; # If the provided variant is a US variant, force layout to us; otherwise keep layout - layoutFromVariant = if builtins.elem keyboardVariant usVariants then "us" else layoutFromLayout; + layoutFromVariant = + if builtins.elem keyboardVariant usVariants + then "us" + else layoutFromLayout; variantFinal = - if builtins.elem keyboardVariant usVariants then normalizeUSVariant keyboardVariant - else if variantFromLayout != "" then variantFromLayout + if builtins.elem keyboardVariant usVariants + then normalizeUSVariant keyboardVariant + else if variantFromLayout != "" + then variantFromLayout else keyboardVariant; hyprKbLayout = layoutFromVariant; hyprKbVariant = variantFinal; -in -{ +in { home.packages = with pkgs; [ swww grim @@ -61,32 +73,34 @@ in systemd = { enable = true; enableXdgAutostart = true; - variables = [ "--all" ]; + variables = ["--all"]; }; xwayland = { enable = true; }; settings = { - input = ({ - kb_layout = hyprKbLayout; - kb_options = [ - "grp:alt_caps_toggle" - "caps:super" - ]; - numlock_by_default = true; - repeat_delay = 300; - follow_mouse = 1; - float_switch_override_focus = 0; - sensitivity = 0; - touchpad = { - natural_scroll = true; - disable_while_typing = true; - scroll_factor = 0.8; - }; - } // lib.optionalAttrs (hyprKbVariant != "") { kb_variant = hyprKbVariant; }); + input = + { + kb_layout = hyprKbLayout; + kb_options = [ + "grp:alt_caps_toggle" + "caps:super" + ]; + numlock_by_default = true; + repeat_delay = 300; + follow_mouse = 1; + float_switch_override_focus = 0; + sensitivity = 0; + touchpad = { + natural_scroll = true; + disable_while_typing = true; + scroll_factor = 0.8; + }; + } + // lib.optionalAttrs (hyprKbVariant != "") {kb_variant = hyprKbVariant;}; gestures = { - gesture = [ "3, horizontal, workspace" ]; + gesture = ["3, horizontal, workspace"]; workspace_swipe_distance = 500; workspace_swipe_invert = true; workspace_swipe_min_speed_to_force = 30; @@ -102,8 +116,7 @@ in gaps_out = 8; border_size = 2; resize_on_border = true; - "col.active_border" = - "rgb(${config.lib.stylix.colors.base08}) rgb(${config.lib.stylix.colors.base0C}) 45deg"; + "col.active_border" = "rgb(${config.lib.stylix.colors.base08}) rgb(${config.lib.stylix.colors.base0C}) 45deg"; "col.inactive_border" = "rgb(${config.lib.stylix.colors.base01})"; }; @@ -183,9 +196,7 @@ in extraConfig = " monitor=,preferred,auto,auto monitor=Virtual-1,1920x1080@60,auto,1 - ${ - extraMonitorSettings - } + ${extraMonitorSettings} # To enable blur on waybar uncomment the line below # Thanks to SchotjeChrisman #layerrule = blur,waybar diff --git a/modules/home/hyprland/hyprlock.nix b/modules/home/hyprland/hyprlock.nix index d2c22b9..513a34a 100644 --- a/modules/home/hyprland/hyprlock.nix +++ b/modules/home/hyprland/hyprlock.nix @@ -1,4 +1,4 @@ -{ username, ... }: { +{username, ...}: { programs.hyprlock = { enable = true; settings = { diff --git a/modules/home/hyprland/pyprland.nix b/modules/home/hyprland/pyprland.nix index 490b1c4..0bffe11 100644 --- a/modules/home/hyprland/pyprland.nix +++ b/modules/home/hyprland/pyprland.nix @@ -1,5 +1,5 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ pyprland ]; +{pkgs, ...}: { + home.packages = with pkgs; [pyprland]; home.file.".config/hypr/pyprland.toml".text = '' [pyprland] diff --git a/modules/home/noctalia.nix b/modules/home/noctalia.nix index a3ec97d..17133a9 100644 --- a/modules/home/noctalia.nix +++ b/modules/home/noctalia.nix @@ -1,10 +1,14 @@ -{ config, pkgs, inputs, lib, ... }: -let +{ + config, + pkgs, + inputs, + lib, + ... +}: let system = pkgs.stdenv.hostPlatform.system; noctaliaPath = inputs.noctalia.packages.${system}.default; configDir = "${noctaliaPath}/share/noctalia-shell"; -in -{ +in { # Install the Noctalia package for this user (CLI, assets, etc.) home.packages = [ noctaliaPath @@ -12,7 +16,7 @@ in # Seed the Noctalia QuickShell shell code into ~/.config/quickshell/noctalia-shell # once, then leave it writable so the GUI and the user can tweak it. - home.activation.seedNoctaliaShellCode = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + home.activation.seedNoctaliaShellCode = lib.hm.dag.entryAfter ["writeBoundary"] '' set -eu DEST="$HOME/.config/quickshell/noctalia-shell" SRC="${configDir}" diff --git a/modules/home/obs-studio.nix b/modules/home/obs-studio.nix index d0b610c..05d8469 100644 --- a/modules/home/obs-studio.nix +++ b/modules/home/obs-studio.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { programs.obs-studio = { enable = true; #enableVirtualCamera = true; diff --git a/modules/home/overview.nix b/modules/home/overview.nix index 09f32b7..6ecfeaa 100644 --- a/modules/home/overview.nix +++ b/modules/home/overview.nix @@ -1,8 +1,10 @@ -{ config, lib, ... }: -let - overviewSource = ./overview; -in { + config, + lib, + ... +}: let + overviewSource = ./overview; +in { # Quickshell-overview is a Qt6 QML app for Hyprland workspace overview # It shows all workspaces with live window previews, drag-and-drop support # Toggled via: SUPER + TAB (bound in hyprland/binds.nix) @@ -10,11 +12,11 @@ in # Seed the Quickshell overview code into ~/.config/quickshell/overview # Copy (not symlink) so QML module resolution works and users can edit files - home.activation.seedOverviewCode = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + home.activation.seedOverviewCode = lib.hm.dag.entryAfter ["writeBoundary"] '' set -eu DEST="$HOME/.config/quickshell/overview" SRC="${overviewSource}" - + if [ ! -d "$DEST" ]; then mkdir -p "$HOME/.config/quickshell" cp -R "$SRC" "$DEST" diff --git a/modules/home/qt.nix b/modules/home/qt.nix index b8df345..2674038 100644 --- a/modules/home/qt.nix +++ b/modules/home/qt.nix @@ -1,4 +1,4 @@ -{ lib, ... }: { +{lib, ...}: { qt = { enable = true; platformTheme.name = lib.mkForce "qtct"; diff --git a/modules/home/rofi/config-long.nix b/modules/home/rofi/config-long.nix index e8e9773..d947a47 100644 --- a/modules/home/rofi/config-long.nix +++ b/modules/home/rofi/config-long.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { home.file.".config/rofi/config-long.rasi".text = '' @import "~/.config/rofi/config.rasi" window { diff --git a/modules/home/rofi/default.nix b/modules/home/rofi/default.nix index 1b6ae5f..6493e45 100644 --- a/modules/home/rofi/default.nix +++ b/modules/home/rofi/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { imports = [ ./config-long.nix ./rofi.nix diff --git a/modules/home/rofi/rofi.nix b/modules/home/rofi/rofi.nix index 71deb21..f8c881b 100644 --- a/modules/home/rofi/rofi.nix +++ b/modules/home/rofi/rofi.nix @@ -1,6 +1,7 @@ -{ pkgs -, config -, ... +{ + pkgs, + config, + ... }: { programs = { rofi = { @@ -16,193 +17,191 @@ display-run = " Run"; display-filebrowser = " File"; }; - theme = - let - inherit (config.lib.formats.rasi) mkLiteral; - in - { - "*" = { - bg = mkLiteral "#${config.stylix.base16Scheme.base00}"; - bg-alt = mkLiteral "#${config.stylix.base16Scheme.base09}"; - foreground = mkLiteral "#${config.stylix.base16Scheme.base01}"; - selected = mkLiteral "#${config.stylix.base16Scheme.base08}"; - active = mkLiteral "#${config.stylix.base16Scheme.base0B}"; - text-selected = mkLiteral "#${config.stylix.base16Scheme.base00}"; - text-color = mkLiteral "#${config.stylix.base16Scheme.base05}"; - border-color = mkLiteral "#${config.stylix.base16Scheme.base0F}"; - urgent = mkLiteral "#${config.stylix.base16Scheme.base0E}"; - }; - "window" = { - transparency = "real"; - width = mkLiteral "1000px"; - location = mkLiteral "center"; - anchor = mkLiteral "center"; - fullscreen = false; - x-offset = mkLiteral "0px"; - y-offset = mkLiteral "0px"; - cursor = "default"; - enabled = true; - border-radius = mkLiteral "15px"; - background-color = mkLiteral "@bg"; - }; - "mainbox" = { - enabled = true; - spacing = mkLiteral "0px"; - orientation = mkLiteral "horizontal"; - children = map mkLiteral [ - "imagebox" - "listbox" - ]; - background-color = mkLiteral "transparent"; - }; - "imagebox" = { - padding = mkLiteral "20px"; - background-color = mkLiteral "transparent"; - background-image = mkLiteral ''url("~/Pictures/Wallpapers/Rainnight.jpg", height)''; - orientation = mkLiteral "vertical"; - children = map mkLiteral [ - "inputbar" - "dummy" - "mode-switcher" - ]; - }; - "listbox" = { - spacing = mkLiteral "20px"; - padding = mkLiteral "20px"; - background-color = mkLiteral "transparent"; - orientation = mkLiteral "vertical"; - children = map mkLiteral [ - "message" - "listview" - ]; - }; - "dummy" = { - background-color = mkLiteral "transparent"; - }; - "inputbar" = { - enabled = true; - spacing = mkLiteral "10px"; - padding = mkLiteral "10px"; - border-radius = mkLiteral "10px"; - background-color = mkLiteral "@bg-alt"; - text-color = mkLiteral "@foreground"; - children = map mkLiteral [ - "textbox-prompt-colon" - "entry" - ]; - }; - "textbox-prompt-colon" = { - enabled = true; - expand = false; - str = ""; - background-color = mkLiteral "inherit"; - text-color = mkLiteral "inherit"; - }; - "entry" = { - enabled = true; - background-color = mkLiteral "inherit"; - text-color = mkLiteral "inherit"; - cursor = mkLiteral "text"; - placeholder = "Search"; - placeholder-color = mkLiteral "inherit"; - }; - "mode-switcher" = { - enabled = true; - spacing = mkLiteral "20px"; - background-color = mkLiteral "transparent"; - text-color = mkLiteral "@foreground"; - }; - "button" = { - padding = mkLiteral "15px"; - border-radius = mkLiteral "10px"; - background-color = mkLiteral "@bg-alt"; - text-color = mkLiteral "inherit"; - cursor = mkLiteral "pointer"; - }; - "button selected" = { - background-color = mkLiteral "@selected"; - text-color = mkLiteral "@foreground"; - }; - "listview" = { - enabled = true; - columns = 1; - lines = 8; - cycle = true; - dynamic = true; - scrollbar = false; - layout = mkLiteral "vertical"; - reverse = false; - fixed-height = true; - fixed-columns = true; - spacing = mkLiteral "10px"; - background-color = mkLiteral "transparent"; - text-color = mkLiteral "@foreground"; - cursor = "default"; - }; - "element" = { - enabled = true; - spacing = mkLiteral "15px"; - padding = mkLiteral "8px"; - border-radius = mkLiteral "10px"; - background-color = mkLiteral "transparent"; - text-color = mkLiteral "@text-color"; - cursor = mkLiteral "pointer"; - }; - "element normal.normal" = { - background-color = mkLiteral "inherit"; - text-color = mkLiteral "@text-color"; - }; - "element normal.urgent" = { - background-color = mkLiteral "@urgent"; - text-color = mkLiteral "@text-color"; - }; - "element normal.active" = { - background-color = mkLiteral "inherit"; - text-color = mkLiteral "@text-color"; - }; - "element selected.normal" = { - background-color = mkLiteral "@selected"; - text-color = mkLiteral "@foreground"; - }; - "element selected.urgent" = { - background-color = mkLiteral "@urgent"; - text-color = mkLiteral "@text-selected"; - }; - "element selected.active" = { - background-color = mkLiteral "@urgent"; - text-color = mkLiteral "@text-selected"; - }; - "element-icon" = { - background-color = mkLiteral "transparent"; - text-color = mkLiteral "inherit"; - size = mkLiteral "36px"; - cursor = mkLiteral "inherit"; - }; - "element-text" = { - background-color = mkLiteral "transparent"; - text-color = mkLiteral "inherit"; - cursor = mkLiteral "inherit"; - vertical-align = mkLiteral "0.5"; - horizontal-align = mkLiteral "0.0"; - }; - "message" = { - background-color = mkLiteral "transparent"; - }; - "textbox" = { - padding = mkLiteral "15px"; - border-radius = mkLiteral "10px"; - background-color = mkLiteral "@bg-alt"; - text-color = mkLiteral "@foreground"; - vertical-align = mkLiteral "0.5"; - horizontal-align = mkLiteral "0.0"; - }; - "error-message" = { - padding = mkLiteral "15px"; - border-radius = mkLiteral "20px"; - background-color = mkLiteral "@bg"; - text-color = mkLiteral "@foreground"; - }; + theme = let + inherit (config.lib.formats.rasi) mkLiteral; + in { + "*" = { + bg = mkLiteral "#${config.stylix.base16Scheme.base00}"; + bg-alt = mkLiteral "#${config.stylix.base16Scheme.base09}"; + foreground = mkLiteral "#${config.stylix.base16Scheme.base01}"; + selected = mkLiteral "#${config.stylix.base16Scheme.base08}"; + active = mkLiteral "#${config.stylix.base16Scheme.base0B}"; + text-selected = mkLiteral "#${config.stylix.base16Scheme.base00}"; + text-color = mkLiteral "#${config.stylix.base16Scheme.base05}"; + border-color = mkLiteral "#${config.stylix.base16Scheme.base0F}"; + urgent = mkLiteral "#${config.stylix.base16Scheme.base0E}"; }; + "window" = { + transparency = "real"; + width = mkLiteral "1000px"; + location = mkLiteral "center"; + anchor = mkLiteral "center"; + fullscreen = false; + x-offset = mkLiteral "0px"; + y-offset = mkLiteral "0px"; + cursor = "default"; + enabled = true; + border-radius = mkLiteral "15px"; + background-color = mkLiteral "@bg"; + }; + "mainbox" = { + enabled = true; + spacing = mkLiteral "0px"; + orientation = mkLiteral "horizontal"; + children = map mkLiteral [ + "imagebox" + "listbox" + ]; + background-color = mkLiteral "transparent"; + }; + "imagebox" = { + padding = mkLiteral "20px"; + background-color = mkLiteral "transparent"; + background-image = mkLiteral ''url("~/Pictures/Wallpapers/Rainnight.jpg", height)''; + orientation = mkLiteral "vertical"; + children = map mkLiteral [ + "inputbar" + "dummy" + "mode-switcher" + ]; + }; + "listbox" = { + spacing = mkLiteral "20px"; + padding = mkLiteral "20px"; + background-color = mkLiteral "transparent"; + orientation = mkLiteral "vertical"; + children = map mkLiteral [ + "message" + "listview" + ]; + }; + "dummy" = { + background-color = mkLiteral "transparent"; + }; + "inputbar" = { + enabled = true; + spacing = mkLiteral "10px"; + padding = mkLiteral "10px"; + border-radius = mkLiteral "10px"; + background-color = mkLiteral "@bg-alt"; + text-color = mkLiteral "@foreground"; + children = map mkLiteral [ + "textbox-prompt-colon" + "entry" + ]; + }; + "textbox-prompt-colon" = { + enabled = true; + expand = false; + str = ""; + background-color = mkLiteral "inherit"; + text-color = mkLiteral "inherit"; + }; + "entry" = { + enabled = true; + background-color = mkLiteral "inherit"; + text-color = mkLiteral "inherit"; + cursor = mkLiteral "text"; + placeholder = "Search"; + placeholder-color = mkLiteral "inherit"; + }; + "mode-switcher" = { + enabled = true; + spacing = mkLiteral "20px"; + background-color = mkLiteral "transparent"; + text-color = mkLiteral "@foreground"; + }; + "button" = { + padding = mkLiteral "15px"; + border-radius = mkLiteral "10px"; + background-color = mkLiteral "@bg-alt"; + text-color = mkLiteral "inherit"; + cursor = mkLiteral "pointer"; + }; + "button selected" = { + background-color = mkLiteral "@selected"; + text-color = mkLiteral "@foreground"; + }; + "listview" = { + enabled = true; + columns = 1; + lines = 8; + cycle = true; + dynamic = true; + scrollbar = false; + layout = mkLiteral "vertical"; + reverse = false; + fixed-height = true; + fixed-columns = true; + spacing = mkLiteral "10px"; + background-color = mkLiteral "transparent"; + text-color = mkLiteral "@foreground"; + cursor = "default"; + }; + "element" = { + enabled = true; + spacing = mkLiteral "15px"; + padding = mkLiteral "8px"; + border-radius = mkLiteral "10px"; + background-color = mkLiteral "transparent"; + text-color = mkLiteral "@text-color"; + cursor = mkLiteral "pointer"; + }; + "element normal.normal" = { + background-color = mkLiteral "inherit"; + text-color = mkLiteral "@text-color"; + }; + "element normal.urgent" = { + background-color = mkLiteral "@urgent"; + text-color = mkLiteral "@text-color"; + }; + "element normal.active" = { + background-color = mkLiteral "inherit"; + text-color = mkLiteral "@text-color"; + }; + "element selected.normal" = { + background-color = mkLiteral "@selected"; + text-color = mkLiteral "@foreground"; + }; + "element selected.urgent" = { + background-color = mkLiteral "@urgent"; + text-color = mkLiteral "@text-selected"; + }; + "element selected.active" = { + background-color = mkLiteral "@urgent"; + text-color = mkLiteral "@text-selected"; + }; + "element-icon" = { + background-color = mkLiteral "transparent"; + text-color = mkLiteral "inherit"; + size = mkLiteral "36px"; + cursor = mkLiteral "inherit"; + }; + "element-text" = { + background-color = mkLiteral "transparent"; + text-color = mkLiteral "inherit"; + cursor = mkLiteral "inherit"; + vertical-align = mkLiteral "0.5"; + horizontal-align = mkLiteral "0.0"; + }; + "message" = { + background-color = mkLiteral "transparent"; + }; + "textbox" = { + padding = mkLiteral "15px"; + border-radius = mkLiteral "10px"; + background-color = mkLiteral "@bg-alt"; + text-color = mkLiteral "@foreground"; + vertical-align = mkLiteral "0.5"; + horizontal-align = mkLiteral "0.0"; + }; + "error-message" = { + padding = mkLiteral "15px"; + border-radius = mkLiteral "20px"; + background-color = mkLiteral "@bg"; + text-color = mkLiteral "@foreground"; + }; + }; }; }; } diff --git a/modules/home/scripts/default.nix b/modules/home/scripts/default.nix index f88fade..ed15dc6 100644 --- a/modules/home/scripts/default.nix +++ b/modules/home/scripts/default.nix @@ -1,28 +1,29 @@ -{ pkgs -, username -, profile -, ... +{ + pkgs, + username, + profile, + ... }: { home.packages = [ - (import ./emopicker9000.nix { inherit pkgs; }) - (import ./hm-find.nix { inherit pkgs; }) - (import ./keybinds.nix { inherit pkgs; }) - (import ./qs-keybinds.nix { inherit pkgs; }) - (import ./note.nix { inherit pkgs; }) - (import ./note-from-clipboard.nix { inherit pkgs; }) - (import ./nvidia-offload.nix { inherit pkgs; }) - (import ./rofi-launcher.nix { inherit pkgs; }) - (import ./screenshootin.nix { inherit pkgs; }) - (import ./squirtle.nix { inherit pkgs; }) - (import ./task-waybar.nix { inherit pkgs; }) + (import ./emopicker9000.nix {inherit pkgs;}) + (import ./hm-find.nix {inherit pkgs;}) + (import ./keybinds.nix {inherit pkgs;}) + (import ./qs-keybinds.nix {inherit pkgs;}) + (import ./note.nix {inherit pkgs;}) + (import ./note-from-clipboard.nix {inherit pkgs;}) + (import ./nvidia-offload.nix {inherit pkgs;}) + (import ./rofi-launcher.nix {inherit pkgs;}) + (import ./screenshootin.nix {inherit pkgs;}) + (import ./squirtle.nix {inherit pkgs;}) + (import ./task-waybar.nix {inherit pkgs;}) (import ./wallsetter.nix { inherit pkgs; inherit username; }) - (import ./web-search.nix { inherit pkgs; }) + (import ./web-search.nix {inherit pkgs;}) # Cheatsheets viewer + parser - (import ./cheatsheets-parser.nix { inherit pkgs; }) - (import ./qs-cheatsheets.nix { inherit pkgs; }) + (import ./cheatsheets-parser.nix {inherit pkgs;}) + (import ./qs-cheatsheets.nix {inherit pkgs;}) (import ./zcli.nix { inherit pkgs profile; backupFiles = [ diff --git a/modules/home/scripts/emopicker9000.nix b/modules/home/scripts/emopicker9000.nix index ed8e4ed..b622cc3 100644 --- a/modules/home/scripts/emopicker9000.nix +++ b/modules/home/scripts/emopicker9000.nix @@ -1,4 +1,4 @@ -{ pkgs }: +{pkgs}: pkgs.writeShellScriptBin "emopicker9000" '' # check if rofi is already running if pidof rofi > /dev/null; then diff --git a/modules/home/scripts/gemini-cli.nix b/modules/home/scripts/gemini-cli.nix index d39d30c..acb521d 100644 --- a/modules/home/scripts/gemini-cli.nix +++ b/modules/home/scripts/gemini-cli.nix @@ -1,9 +1,11 @@ -{ config, pkgs, ... }: - -let +{ + config, + pkgs, + ... +}: let gemini-launcher = pkgs.writeShellScriptBin "gemini-launcher" '' #!${pkgs.bash}/bin/bash - + # Define the path to your API key file KEY_FILE="${config.home.homeDirectory}/gem.key" @@ -18,9 +20,7 @@ let exec ${pkgs.kitty}/bin/kitty -e bash -c "echo 'NOTE: Gemini API key file not found at ~/.gem.key.'; echo 'To use a key, create this file with content: export GEMINI_API_KEY=\"YOUR_KEY\"'; echo; echo 'Starting Gemini CLI, which will fall back to web-based login...'; echo; exec ${pkgs.gemini-cli}/bin/gemini" fi ''; - -in -{ +in { home.packages = [ gemini-launcher ]; @@ -32,6 +32,6 @@ in exec = "gemini-launcher"; terminal = false; type = "Application"; - categories = [ "Development" "Utility" ]; + categories = ["Development" "Utility"]; }; } diff --git a/modules/home/scripts/hm-find.nix b/modules/home/scripts/hm-find.nix index 77771d5..d997469 100644 --- a/modules/home/scripts/hm-find.nix +++ b/modules/home/scripts/hm-find.nix @@ -1,4 +1,4 @@ -{ pkgs }: +{pkgs}: pkgs.writeShellScriptBin "hm-find" '' #!/usr/bin/env bash diff --git a/modules/home/scripts/keybinds.nix b/modules/home/scripts/keybinds.nix index d19af17..15da0ad 100644 --- a/modules/home/scripts/keybinds.nix +++ b/modules/home/scripts/keybinds.nix @@ -1,4 +1,4 @@ -{ pkgs }: +{pkgs}: pkgs.writeShellScriptBin "list-keybinds" '' # check if rofi is already running if pidof rofi > /dev/null; then @@ -6,7 +6,7 @@ pkgs.writeShellScriptBin "list-keybinds" '' fi msg='☣️ NOTE ☣️: Clicking with Mouse or Pressing ENTER will have NO function' - + # Parse keybind entries from the Nix config and format for rofi display BIND_NIX="$HOME/zaneyos/modules/home/hyprland/binds.nix" if [[ -f "$BIND_NIX" ]]; then @@ -16,18 +16,18 @@ pkgs.writeShellScriptBin "list-keybinds" '' /noctaliaBind/ { in_block = 1; next } /rofiBind/ { in_block = 1; next } /bindd[ ]*=/ && /\[/ { in_block = 1; next } - + in_block { # Check for end of array if (/^[ ]*\]/) { in_block = 0 next } - + # Extract quoted string from line if (match($0, /"([^"]+)"/, arr)) { line = arr[1] - + # Split by comma to get: mods, key, desc, action, params n = split(line, parts, ",") if (n >= 3) { @@ -35,17 +35,17 @@ pkgs.writeShellScriptBin "list-keybinds" '' mods = parts[1] key = parts[2] desc = parts[3] - + gsub(/^[ \t]+|[ \t]+$/, "", mods) gsub(/^[ \t]+|[ \t]+$/, "", key) gsub(/^[ \t]+|[ \t]+$/, "", desc) - + # Build display keybind if (mods != "" && key != "") { display = mods " + " key gsub(/\$modifier/, "SUPER", display) gsub(/ +/, " ", display) - + # Output: "KEYBIND: Description" if (desc != "") { printf "%s: %s\n", display, desc diff --git a/modules/home/scripts/note-from-clipboard.nix b/modules/home/scripts/note-from-clipboard.nix index 3c4546e..ddb767a 100644 --- a/modules/home/scripts/note-from-clipboard.nix +++ b/modules/home/scripts/note-from-clipboard.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{pkgs, ...}: pkgs.writeShellScriptBin "note-from-clipboard" '' #!/usr/bin/env bash diff --git a/modules/home/scripts/note.nix b/modules/home/scripts/note.nix index 3554cb1..43a1786 100644 --- a/modules/home/scripts/note.nix +++ b/modules/home/scripts/note.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{pkgs, ...}: pkgs.writeShellScriptBin "note" '' # Colors for nice output @@ -16,7 +16,7 @@ pkgs.writeShellScriptBin "note" '' # XDG-compliant notes directory and file NOTES_DIR="$HOME/.local/share/notes" NOTES_FILE="$NOTES_DIR/notes.txt" - + # Create notes directory if it doesn't exist mkdir -p "$NOTES_DIR" @@ -42,24 +42,24 @@ pkgs.writeShellScriptBin "note" '' local note_text="$1" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local date_only=$(date '+%Y-%m-%d') - + # Create notes file if it doesn't exist touch "$NOTES_FILE" - + # Get next note number local note_num=1 if [ -f "$NOTES_FILE" ] && [ -s "$NOTES_FILE" ]; then note_num=$(grep -E "^#[0-9]+" "$NOTES_FILE" | sed 's/^#\([0-9]*\).*/\1/' | sort -n | tail -1) note_num=$((note_num + 1)) fi - + # Add the note with proper formatting { echo "#$note_num [$timestamp]" echo "$note_text" echo "" } >> "$NOTES_FILE" - + echo -e "''${GREEN}✓''${NC} Note #$note_num added ''${GRAY}($date_only)''${NC}" } @@ -70,14 +70,14 @@ pkgs.writeShellScriptBin "note" '' echo -e "''${GRAY}Use ''${CYAN}note ''${GRAY} to add your first note''${NC}" return fi - + echo -e "''${BOLD}''${BLUE}📝 Your Notes''${NC}" echo -e "''${GRAY}📁 $NOTES_FILE''${NC}" echo -e "''${GRAY}$(printf '%.0s─' {1..50})''${NC}" - + local in_note=false local note_content="" - + while IFS= read -r line; do # Check if line starts with # followed by numbers and space and [ if echo "$line" | grep -q "^#[0-9][0-9]* \["; then @@ -86,13 +86,13 @@ pkgs.writeShellScriptBin "note" '' echo -e "$note_content" echo "" fi - + # Extract note number and timestamp local num=$(echo "$line" | sed 's/^#\([0-9]*\) \[.*/\1/') local timestamp=$(echo "$line" | sed 's/^#[0-9]* \[\(.*\)\]/\1/') local date_part=$(echo "$timestamp" | cut -d' ' -f1) local time_part=$(echo "$timestamp" | cut -d' ' -f2) - + echo -e "''${BOLD}''${CYAN}#$num''${NC} ''${GRAY}[$date_part ''${YELLOW}$time_part''${GRAY}]''${NC}" in_note=true note_content="" @@ -113,13 +113,13 @@ pkgs.writeShellScriptBin "note" '' note_content="" fi done < "$NOTES_FILE" - + # Print last note if file doesn't end with empty line if [ "$in_note" = true ] && [ -n "$note_content" ]; then echo -e "$note_content" echo "" fi - + local total_notes=$(grep -c "^#[0-9]" "$NOTES_FILE") echo -e "''${GRAY}$(printf '%.0s─' {1..50})''${NC}" echo -e "''${GRAY}Total: ''${BOLD}$total_notes''${NC} ''${GRAY}notes''${NC}" @@ -128,27 +128,27 @@ pkgs.writeShellScriptBin "note" '' # Function to delete a note delete_note() { local note_num="$1" - + if [ ! -f "$NOTES_FILE" ] || [ ! -s "$NOTES_FILE" ]; then echo -e "''${RED}✗''${NC} No notes found" return 1 fi - + if ! echo "$note_num" | grep -q "^[0-9][0-9]*$"; then echo -e "''${RED}✗''${NC} Invalid note number: $note_num" return 1 fi - + # Check if note exists if ! grep -q "^#$note_num " "$NOTES_FILE"; then echo -e "''${RED}✗''${NC} Note #$note_num not found" return 1 fi - + # Create temporary file without the specified note local temp_file=$(mktemp) local skip_lines=false - + while IFS= read -r line; do if echo "$line" | grep -q "^#[0-9][0-9]* "; then local current_num=$(echo "$line" | sed 's/^#\([0-9]*\) .*/\1/') @@ -159,7 +159,7 @@ pkgs.writeShellScriptBin "note" '' skip_lines=false fi fi - + if [ "$skip_lines" = false ]; then echo "$line" >> "$temp_file" elif [ -z "$line" ]; then @@ -167,7 +167,7 @@ pkgs.writeShellScriptBin "note" '' skip_lines=false fi done < "$NOTES_FILE" - + mv "$temp_file" "$NOTES_FILE" echo -e "''${GREEN}✓''${NC} Note #$note_num deleted" } @@ -178,11 +178,11 @@ pkgs.writeShellScriptBin "note" '' echo -e "''${YELLOW}📝 No notes to clear''${NC}" return fi - + local total_notes=$(grep -c "^#[0-9]" "$NOTES_FILE") echo -e "''${YELLOW}⚠''${NC} This will delete all $total_notes notes. Are you sure? ''${GRAY}[y/N]''${NC}" read -r confirmation - + if echo "$confirmation" | grep -qi "^y"; then > "$NOTES_FILE" echo -e "''${GREEN}✓''${NC} All notes cleared" @@ -204,7 +204,7 @@ pkgs.writeShellScriptBin "note" '' piped_content="$piped_content"$'\n'"$line" fi done - + if [ -n "$piped_content" ]; then add_note "$piped_content" else @@ -213,7 +213,7 @@ pkgs.writeShellScriptBin "note" '' fi return fi - + # Handle command line arguments case "$1" in "") diff --git a/modules/home/scripts/nvidia-offload.nix b/modules/home/scripts/nvidia-offload.nix index ada00d9..a99f6d4 100644 --- a/modules/home/scripts/nvidia-offload.nix +++ b/modules/home/scripts/nvidia-offload.nix @@ -1,5 +1,4 @@ -{ pkgs }: - +{pkgs}: pkgs.writeShellScriptBin "nvidia-offload" '' export __NV_PRIME_RENDER_OFFLOAD=1 export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 diff --git a/modules/home/scripts/rofi-launcher.nix b/modules/home/scripts/rofi-launcher.nix index 014802d..b1a3eb2 100644 --- a/modules/home/scripts/rofi-launcher.nix +++ b/modules/home/scripts/rofi-launcher.nix @@ -1,4 +1,4 @@ -{ pkgs }: +{pkgs}: pkgs.writeShellScriptBin "rofi-launcher" '' # check if rofi is already running if pidof rofi > /dev/null; then diff --git a/modules/home/scripts/screenshootin.nix b/modules/home/scripts/screenshootin.nix index 15042b4..40de68e 100644 --- a/modules/home/scripts/screenshootin.nix +++ b/modules/home/scripts/screenshootin.nix @@ -1,5 +1,4 @@ -{ pkgs }: - +{pkgs}: pkgs.writeShellScriptBin "screenshootin" '' grim -g "$(slurp)" - | swappy -f - '' diff --git a/modules/home/scripts/squirtle.nix b/modules/home/scripts/squirtle.nix index c1aeb93..198a18c 100644 --- a/modules/home/scripts/squirtle.nix +++ b/modules/home/scripts/squirtle.nix @@ -1,23 +1,22 @@ -{ pkgs }: - +{pkgs}: pkgs.writeShellScriptBin "squirtle" '' echo " -  ████████ ██████ -  ██████████████ ██████████ +  ████████ ██████ +  ██████████████ ██████████  ████████████████████ ██████████████  ████████████████████████ ██████████████ ██████████████████████████████████████████ - ████████████████████████████████████████ - ██████████████████████████████████████ -  ██████████████████████████████████ -  ████████████████████████████████ -  ██████████████████████████████ -  ██████████████████████████ -  ██████████████████████ -  ██████████████████████ -  ██████████████████████ -  ████ ████████████ -  ██████████ + ████████████████████████████████████████ + ██████████████████████████████████████ +  ██████████████████████████████████ +  ████████████████████████████████ +  ██████████████████████████████ +  ██████████████████████████ +  ██████████████████████ +  ██████████████████████ +  ██████████████████████ +  ████ ████████████ +  ██████████  ██████  " '' diff --git a/modules/home/scripts/task-waybar.nix b/modules/home/scripts/task-waybar.nix index 9ba29d1..46b079c 100644 --- a/modules/home/scripts/task-waybar.nix +++ b/modules/home/scripts/task-waybar.nix @@ -1,5 +1,4 @@ -{ pkgs }: - +{pkgs}: pkgs.writeShellScriptBin "task-waybar" '' sleep 0.1 ${pkgs.swaynotificationcenter}/bin/swaync-client -t & diff --git a/modules/home/scripts/wallsetter.nix b/modules/home/scripts/wallsetter.nix index 6f391a6..a2ae7d5 100644 --- a/modules/home/scripts/wallsetter.nix +++ b/modules/home/scripts/wallsetter.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: - +{pkgs, ...}: pkgs.writeShellScriptBin "wallsetter" '' TIMEOUT=720 diff --git a/modules/home/scripts/web-search.nix b/modules/home/scripts/web-search.nix index 0a28e6b..7a0f5c4 100644 --- a/modules/home/scripts/web-search.nix +++ b/modules/home/scripts/web-search.nix @@ -1,4 +1,4 @@ -{ pkgs }: +{pkgs}: pkgs.writeShellScriptBin "web-search" '' # check if rofi is already running if pidof rofi > /dev/null; then diff --git a/modules/home/scripts/zcli.nix b/modules/home/scripts/zcli.nix index 26ca095..880848f 100644 --- a/modules/home/scripts/zcli.nix +++ b/modules/home/scripts/zcli.nix @@ -1,11 +1,11 @@ -{ pkgs -, profile -, backupFiles ? [ ".config/mimeapps.list.backup" ] -, ... -}: -let +{ + pkgs, + profile, + backupFiles ? [".config/mimeapps.list.backup"], + ... +}: let backupFilesString = pkgs.lib.strings.concatStringsSep " " backupFiles; - + # Create the get-doom script as a dependency get-doom-script = pkgs.writeShellScriptBin "get-doom" '' #!/usr/bin/env bash @@ -78,625 +78,624 @@ let print_success "All done! Doom Emacs is ready to use." ''; in + pkgs.writeShellScriptBin "zcli" '' + #!${pkgs.bash}/bin/bash + set -euo pipefail -pkgs.writeShellScriptBin "zcli" '' - #!${pkgs.bash}/bin/bash - set -euo pipefail - - # --- Program info --- - # - # zcli - NixOS System Management CLI - # ================================== - # - # Purpose: NixOS system management utility for ZaneyOS distribution - # Author: Don Williams (ddubs) & Zaney - # Start Date: June 7th, 2025 - # Version: 1.0.2 - # - # Architecture: - # - Nix-generated shell script using writeShellScriptBin - # - Configuration via Nix parameters (profile, backupFiles) - # - Uses 'nh' tool for NixOS operations, 'inxi' for diagnostics - # - Git integration for host configuration versioning - # - # Helper Functions: - # verify_hostname() - Validates current hostname against flake.nix host variable - # Exits with error if mismatch or missing host directory - # detect_gpu_profile() - Parses lspci output to identify GPU hardware - # Returns: nvidia/nvidia-laptop/amd-hybrid/amd/intel/vm/empty - # handle_backups() - Removes files listed in BACKUP_FILES array from $HOME - # parse_nh_args() - Parses command-line arguments for nh operations - # print_help() - Outputs command usage and available operations - # - # Command Functions: - # cleanup - Interactive cleanup of old generations via 'nh clean' - # diag - Generate system report using 'inxi --full' - # list-gens - Display user/system generations via nix-env and nix profile - # rebuild - NixOS rebuild using 'nh os switch' - # rebuild-boot - NixOS rebuild for next boot using 'nh os boot' - # trim - SSD optimization via 'sudo fstrim -v /' - # update - Flake update + rebuild using 'nh os switch --update' - # update-host - Modify flake.nix host/profile variables via sed - # add-host - Add new host configuration - # del-host - Delete host configuration - # doom [sub] - Doom Emacs management (install/status/remove/update) - # - # Variables: - # PROJECT - Base directory name (ddubsos/zaneyos) - # PROFILE - Hardware profile from Nix parameter - # BACKUP_FILES - Array of backup file paths to clean - # FLAKE_NIX_PATH - Path to flake.nix for host/profile updates - # + # --- Program info --- + # + # zcli - NixOS System Management CLI + # ================================== + # + # Purpose: NixOS system management utility for ZaneyOS distribution + # Author: Don Williams (ddubs) & Zaney + # Start Date: June 7th, 2025 + # Version: 1.0.2 + # + # Architecture: + # - Nix-generated shell script using writeShellScriptBin + # - Configuration via Nix parameters (profile, backupFiles) + # - Uses 'nh' tool for NixOS operations, 'inxi' for diagnostics + # - Git integration for host configuration versioning + # + # Helper Functions: + # verify_hostname() - Validates current hostname against flake.nix host variable + # Exits with error if mismatch or missing host directory + # detect_gpu_profile() - Parses lspci output to identify GPU hardware + # Returns: nvidia/nvidia-laptop/amd-hybrid/amd/intel/vm/empty + # handle_backups() - Removes files listed in BACKUP_FILES array from $HOME + # parse_nh_args() - Parses command-line arguments for nh operations + # print_help() - Outputs command usage and available operations + # + # Command Functions: + # cleanup - Interactive cleanup of old generations via 'nh clean' + # diag - Generate system report using 'inxi --full' + # list-gens - Display user/system generations via nix-env and nix profile + # rebuild - NixOS rebuild using 'nh os switch' + # rebuild-boot - NixOS rebuild for next boot using 'nh os boot' + # trim - SSD optimization via 'sudo fstrim -v /' + # update - Flake update + rebuild using 'nh os switch --update' + # update-host - Modify flake.nix host/profile variables via sed + # add-host - Add new host configuration + # del-host - Delete host configuration + # doom [sub] - Doom Emacs management (install/status/remove/update) + # + # Variables: + # PROJECT - Base directory name (ddubsos/zaneyos) + # PROFILE - Hardware profile from Nix parameter + # BACKUP_FILES - Array of backup file paths to clean + # FLAKE_NIX_PATH - Path to flake.nix for host/profile updates + # - # --- Configuration --- - PROJECT="zaneyos" #ddubos or zaneyos - PROFILE="${profile}" - BACKUP_FILES_STR="${backupFilesString}" - VERSION="1.0.2" - FLAKE_NIX_PATH="$HOME/$PROJECT/flake.nix" + # --- Configuration --- + PROJECT="zaneyos" #ddubos or zaneyos + PROFILE="${profile}" + BACKUP_FILES_STR="${backupFilesString}" + VERSION="1.0.2" + FLAKE_NIX_PATH="$HOME/$PROJECT/flake.nix" - read -r -a BACKUP_FILES <<< "$BACKUP_FILES_STR" + read -r -a BACKUP_FILES <<< "$BACKUP_FILES_STR" - # --- Helper Functions --- - verify_hostname() { - local current_hostname - local flake_hostname - - current_hostname="$(hostname)" - - # Extract the host value from flake.nix - if [ -f "$FLAKE_NIX_PATH" ]; then - flake_hostname=$(${pkgs.gnugrep}/bin/grep -E '^[[:space:]]*host[[:space:]]*=' "$FLAKE_NIX_PATH" | ${pkgs.gnused}/bin/sed 's/.*=[[:space:]]*"\([^"]*\)".*/\1/') - - if [ -z "$flake_hostname" ]; then - echo "Error: Could not find 'host' variable in $FLAKE_NIX_PATH" >&2 - exit 1 - fi - - if [ "$current_hostname" != "$flake_hostname" ]; then - echo "Error: Hostname mismatch!" >&2 - echo " Current hostname: '$current_hostname'" >&2 - echo " Flake.nix host: '$flake_hostname'" >&2 - echo "" >&2 - echo "Hint: Run 'zcli update-host' to automatically update flake.nix" >&2 - echo " or manually edit $FLAKE_NIX_PATH" >&2 - exit 1 - fi - else - echo "Error: Flake.nix not found at $FLAKE_NIX_PATH" >&2 - exit 1 - fi - - # Also check if host folder exists - local folder="$HOME/$PROJECT/hosts/$current_hostname" - if [ ! -d "$folder" ]; then - echo "Error: Matching host not found in $PROJECT, Missing folder: $folder" >&2 - exit 1 - fi - } + # --- Helper Functions --- + verify_hostname() { + local current_hostname + local flake_hostname - print_help() { - echo "ZaneyOS CLI Utility -- version $VERSION" - echo "" - echo "Usage: zcli [command] [options]" - echo "" - echo "Commands:" - echo " cleanup - Clean up old system generations. Can specify a number to keep." - echo " diag - Create a system diagnostic report." - echo " (Filename: homedir/diag.txt)" - echo " list-gens - List user and system generations." - echo " rebuild - Rebuild the NixOS system configuration." - echo " rebuild-boot - Rebuild and set as boot default (activates on next restart)." - echo " trim - Trim filesystems to improve SSD performance." - echo " update - Update the flake and rebuild the system." - echo " update-host - Auto set host and profile in flake.nix." - echo " (Opt: zcli update-host [hostname] [profile])" - echo "" - echo "Options for rebuild, rebuild-boot, and update commands:" - echo " --dry, -n - Show what would be done without doing it" - echo " --ask, -a - Ask for confirmation before proceeding" - echo " --cores N - Limit build to N cores (useful for VMs)" - echo " --verbose, -v - Show verbose output" - echo " --no-nom - Don't use nix-output-monitor" - echo "" - echo "Doom Emacs:" - echo " doom install - Install Doom Emacs using get-doom script." - echo " doom status - Check if Doom Emacs is installed." - echo " doom remove - Remove Doom Emacs installation." - echo " doom update - Update Doom Emacs (runs doom sync)." - echo "" - echo " help - Show this help message." - } + current_hostname="$(hostname)" - handle_backups() { - if [ ''${#BACKUP_FILES[@]} -eq 0 ]; then - echo "No backup files configured to check." - return - fi + # Extract the host value from flake.nix + if [ -f "$FLAKE_NIX_PATH" ]; then + flake_hostname=$(${pkgs.gnugrep}/bin/grep -E '^[[:space:]]*host[[:space:]]*=' "$FLAKE_NIX_PATH" | ${pkgs.gnused}/bin/sed 's/.*=[[:space:]]*"\([^"]*\)".*/\1/') - echo "Checking for backup files to remove..." - for file_path in "''${BACKUP_FILES[@]}"; do - full_path="$HOME/$file_path" - if [ -f "$full_path" ]; then - echo "Removing stale backup file: $full_path" - rm "$full_path" - fi - done - } - - detect_gpu_profile() { - local detected_profile="" - local has_nvidia=false - local has_intel=false - local has_amd=false - local has_vm=false - - if ${pkgs.pciutils}/bin/lspci &> /dev/null; then # Check if lspci is available - if ${pkgs.pciutils}/bin/lspci | ${pkgs.gnugrep}/bin/grep -qi 'vga\|3d'; then - while read -r line; do - if echo "$line" | ${pkgs.gnugrep}/bin/grep -qi 'nvidia'; then - has_nvidia=true - elif echo "$line" | ${pkgs.gnugrep}/bin/grep -qi 'amd'; then - has_amd=true - elif echo "$line" | ${pkgs.gnugrep}/bin/grep -qi 'intel'; then - has_intel=true - elif echo "$line" | ${pkgs.gnugrep}/bin/grep -qi 'virtio\|vmware'; then - has_vm=true - fi - done < <(${pkgs.pciutils}/bin/lspci | ${pkgs.gnugrep}/bin/grep -i 'vga\|3d') - - if "$has_vm"; then - detected_profile="vm" - elif "$has_nvidia" && "$has_intel"; then - detected_profile="nvidia-laptop" - elif "$has_nvidia" && "$has_amd"; then - detected_profile="amd-hybrid" - elif "$has_nvidia"; then - detected_profile="nvidia" - elif "$has_amd"; then - detected_profile="amd" - elif "$has_intel"; then - detected_profile="intel" + if [ -z "$flake_hostname" ]; then + echo "Error: Could not find 'host' variable in $FLAKE_NIX_PATH" >&2 + exit 1 fi - fi - else - echo "Warning: lspci command not found. Cannot auto-detect GPU profile." >&2 - fi - echo "$detected_profile" # Return the detected profile - } - # --- Helper function to parse additional arguments --- - parse_nh_args() { - local args_string="" - local options_selected=() - shift # Remove the main command (rebuild, rebuild-boot, update) - - while [[ $# -gt 0 ]]; do - case $1 in - --dry|-n) - args_string="$args_string --dry" - options_selected+=("dry run mode (showing what would be done)") - shift - ;; - --ask|-a) - args_string="$args_string --ask" - options_selected+=("confirmation prompts enabled") - shift - ;; - --cores) - if [[ -n $2 && $2 =~ ^[0-9]+$ ]]; then - args_string="$args_string -- --cores $2" - options_selected+=("limited to $2 CPU cores") - shift 2 + if [ "$current_hostname" != "$flake_hostname" ]; then + echo "Error: Hostname mismatch!" >&2 + echo " Current hostname: '$current_hostname'" >&2 + echo " Flake.nix host: '$flake_hostname'" >&2 + echo "" >&2 + echo "Hint: Run 'zcli update-host' to automatically update flake.nix" >&2 + echo " or manually edit $FLAKE_NIX_PATH" >&2 + exit 1 + fi + else + echo "Error: Flake.nix not found at $FLAKE_NIX_PATH" >&2 + exit 1 + fi + + # Also check if host folder exists + local folder="$HOME/$PROJECT/hosts/$current_hostname" + if [ ! -d "$folder" ]; then + echo "Error: Matching host not found in $PROJECT, Missing folder: $folder" >&2 + exit 1 + fi + } + + print_help() { + echo "ZaneyOS CLI Utility -- version $VERSION" + echo "" + echo "Usage: zcli [command] [options]" + echo "" + echo "Commands:" + echo " cleanup - Clean up old system generations. Can specify a number to keep." + echo " diag - Create a system diagnostic report." + echo " (Filename: homedir/diag.txt)" + echo " list-gens - List user and system generations." + echo " rebuild - Rebuild the NixOS system configuration." + echo " rebuild-boot - Rebuild and set as boot default (activates on next restart)." + echo " trim - Trim filesystems to improve SSD performance." + echo " update - Update the flake and rebuild the system." + echo " update-host - Auto set host and profile in flake.nix." + echo " (Opt: zcli update-host [hostname] [profile])" + echo "" + echo "Options for rebuild, rebuild-boot, and update commands:" + echo " --dry, -n - Show what would be done without doing it" + echo " --ask, -a - Ask for confirmation before proceeding" + echo " --cores N - Limit build to N cores (useful for VMs)" + echo " --verbose, -v - Show verbose output" + echo " --no-nom - Don't use nix-output-monitor" + echo "" + echo "Doom Emacs:" + echo " doom install - Install Doom Emacs using get-doom script." + echo " doom status - Check if Doom Emacs is installed." + echo " doom remove - Remove Doom Emacs installation." + echo " doom update - Update Doom Emacs (runs doom sync)." + echo "" + echo " help - Show this help message." + } + + handle_backups() { + if [ ''${#BACKUP_FILES[@]} -eq 0 ]; then + echo "No backup files configured to check." + return + fi + + echo "Checking for backup files to remove..." + for file_path in "''${BACKUP_FILES[@]}"; do + full_path="$HOME/$file_path" + if [ -f "$full_path" ]; then + echo "Removing stale backup file: $full_path" + rm "$full_path" + fi + done + } + + detect_gpu_profile() { + local detected_profile="" + local has_nvidia=false + local has_intel=false + local has_amd=false + local has_vm=false + + if ${pkgs.pciutils}/bin/lspci &> /dev/null; then # Check if lspci is available + if ${pkgs.pciutils}/bin/lspci | ${pkgs.gnugrep}/bin/grep -qi 'vga\|3d'; then + while read -r line; do + if echo "$line" | ${pkgs.gnugrep}/bin/grep -qi 'nvidia'; then + has_nvidia=true + elif echo "$line" | ${pkgs.gnugrep}/bin/grep -qi 'amd'; then + has_amd=true + elif echo "$line" | ${pkgs.gnugrep}/bin/grep -qi 'intel'; then + has_intel=true + elif echo "$line" | ${pkgs.gnugrep}/bin/grep -qi 'virtio\|vmware'; then + has_vm=true + fi + done < <(${pkgs.pciutils}/bin/lspci | ${pkgs.gnugrep}/bin/grep -i 'vga\|3d') + + if "$has_vm"; then + detected_profile="vm" + elif "$has_nvidia" && "$has_intel"; then + detected_profile="nvidia-laptop" + elif "$has_nvidia" && "$has_amd"; then + detected_profile="amd-hybrid" + elif "$has_nvidia"; then + detected_profile="nvidia" + elif "$has_amd"; then + detected_profile="amd" + elif "$has_intel"; then + detected_profile="intel" + fi + fi + else + echo "Warning: lspci command not found. Cannot auto-detect GPU profile." >&2 + fi + echo "$detected_profile" # Return the detected profile + } + + # --- Helper function to parse additional arguments --- + parse_nh_args() { + local args_string="" + local options_selected=() + shift # Remove the main command (rebuild, rebuild-boot, update) + + while [[ $# -gt 0 ]]; do + case $1 in + --dry|-n) + args_string="$args_string --dry" + options_selected+=("dry run mode (showing what would be done)") + shift + ;; + --ask|-a) + args_string="$args_string --ask" + options_selected+=("confirmation prompts enabled") + shift + ;; + --cores) + if [[ -n $2 && $2 =~ ^[0-9]+$ ]]; then + args_string="$args_string -- --cores $2" + options_selected+=("limited to $2 CPU cores") + shift 2 + else + echo "Error: --cores requires a numeric argument" >&2 + exit 1 + fi + ;; + --verbose|-v) + args_string="$args_string --verbose" + options_selected+=("verbose output enabled") + shift + ;; + --no-nom) + args_string="$args_string --no-nom" + options_selected+=("nix-output-monitor disabled") + shift + ;; + --) + shift + args_string="$args_string -- $*" + options_selected+=("additional arguments: $*") + break + ;; + -*) + echo "Warning: Unknown flag '$1' - passing through to nh" >&2 + args_string="$args_string $1" + options_selected+=("unknown flag '$1' passed through") + shift + ;; + *) + echo "Error: Unexpected argument '$1'" >&2 + exit 1 + ;; + esac + done + + # Print friendly confirmation of selected options to stderr so it doesn't interfere with return value + if [[ ''${#options_selected[@]} -gt 0 ]]; then + echo "Options selected:" >&2 + for option in "''${options_selected[@]}"; do + echo " ✓ $option" >&2 + done + echo >&2 + fi + + # Return only the args string + echo "$args_string" + } + + # --- Main Logic --- + if [ "$#" -eq 0 ]; then + echo "Error: No command provided." >&2 + print_help + exit 1 + fi + + case "$1" in + cleanup) + echo "Warning! This will remove old generations of your system." + read -p "How many generations to keep (default: all)? " keep_count + + if [ -z "$keep_count" ]; then + read -p "This will remove all but the current generation. Continue (y/N)? " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + ${pkgs.nh}/bin/nh clean all -v else - echo "Error: --cores requires a numeric argument" >&2 + echo "Cleanup cancelled." + fi + else + read -p "This will keep the last $keep_count generations. Continue (y/N)? " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + ${pkgs.nh}/bin/nh clean all -k "$keep_count" -v + else + echo "Cleanup cancelled." + fi + fi + + LOG_DIR="$HOME/zcli-cleanup-logs" + mkdir -p "$LOG_DIR" + LOG_FILE="$LOG_DIR/zcli-cleanup-$(${pkgs.coreutils}/bin/date +%Y-%m-%d_%H-%M-%S).log" + echo "Cleaning up old log files..." >> "$LOG_FILE" + ${pkgs.findutils}/bin/find "$LOG_DIR" -type f -mtime +3 -name "*.log" -delete >> "$LOG_FILE" 2>&1 + echo "Cleanup process logged to $LOG_FILE" + ;; + diag) + echo "Generating system diagnostic report..." + ${pkgs.inxi}/bin/inxi --full > "$HOME/diag.txt" + echo "Diagnostic report saved to $HOME/diag.txt" + ;; + help) + print_help + ;; + list-gens) + echo "--- User Generations ---" + ${pkgs.nix}/bin/nix-env --list-generations | ${pkgs.coreutils}/bin/cat || echo "Could not list user generations." + echo "" + echo "--- System Generations ---" + ${pkgs.nix}/bin/nix profile history --profile /nix/var/nix/profiles/system | ${pkgs.coreutils}/bin/cat || echo "Could not list system generations." + ;; + rebuild) + verify_hostname + handle_backups + + # Parse additional arguments + extra_args=$(parse_nh_args "$@") + + echo "Starting NixOS rebuild for host: $(${pkgs.nettools}/bin/hostname)" + if eval "${pkgs.nh}/bin/nh os switch --hostname '$PROFILE' $extra_args"; then + echo "Rebuild finished successfully" + else + echo "Rebuild Failed" >&2 + exit 1 + fi + ;; + rebuild-boot) + verify_hostname + handle_backups + + # Parse additional arguments + extra_args=$(parse_nh_args "$@") + + echo "Starting NixOS rebuild (boot) for host: $(${pkgs.nettools}/bin/hostname)" + echo "Note: Configuration will be activated on next reboot" + if eval "${pkgs.nh}/bin/nh os boot --hostname '$PROFILE' $extra_args"; then + echo "Rebuild-boot finished successfully" + echo "New configuration set as boot default - restart to activate" + else + echo "Rebuild-boot Failed" >&2 + exit 1 + fi + ;; + trim) + echo "Running 'sudo fstrim -v /' may take a few minutes and impact system performance." + read -p "Enter (y/Y) to run now or enter to exit (y/N): " -n 1 -r + echo # move to a new line + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "Running fstrim..." + sudo ${pkgs.util-linux}/bin/fstrim -v / + echo "fstrim complete." + else + echo "Trim operation cancelled." + fi + ;; + update) + verify_hostname + handle_backups + + # Parse additional arguments + extra_args=$(parse_nh_args "$@") + + echo "Updating flake and rebuilding system for host: $(${pkgs.nettools}/bin/hostname)" + if eval "${pkgs.nh}/bin/nh os switch --hostname '$PROFILE' --update $extra_args"; then + echo "Update and rebuild finished successfully" + else + echo "Update and rebuild Failed" >&2 + exit 1 + fi + ;; + update-host) + target_hostname="" + target_profile="" + + if [ "$#" -eq 3 ]; then # zcli update-host + target_hostname="$2" + target_profile="$3" + elif [ "$#" -eq 1 ]; then # zcli update-host (auto-detect) + echo "Attempting to auto-detect hostname and GPU profile..." + target_hostname=$(${pkgs.nettools}/bin/hostname) + target_profile=$(detect_gpu_profile) + + if [ -z "$target_profile" ]; then + echo "Error: Could not auto-detect a specific GPU profile. Please provide it manually." >&2 + echo "Usage: zcli update-host [hostname] [profile]" >&2 exit 1 fi - ;; - --verbose|-v) - args_string="$args_string --verbose" - options_selected+=("verbose output enabled") - shift - ;; - --no-nom) - args_string="$args_string --no-nom" - options_selected+=("nix-output-monitor disabled") - shift - ;; - --) - shift - args_string="$args_string -- $*" - options_selected+=("additional arguments: $*") - break - ;; - -*) - echo "Warning: Unknown flag '$1' - passing through to nh" >&2 - args_string="$args_string $1" - options_selected+=("unknown flag '$1' passed through") - shift - ;; - *) - echo "Error: Unexpected argument '$1'" >&2 - exit 1 - ;; - esac - done - - # Print friendly confirmation of selected options to stderr so it doesn't interfere with return value - if [[ ''${#options_selected[@]} -gt 0 ]]; then - echo "Options selected:" >&2 - for option in "''${options_selected[@]}"; do - echo " ✓ $option" >&2 - done - echo >&2 - fi - - # Return only the args string - echo "$args_string" - } - - # --- Main Logic --- - if [ "$#" -eq 0 ]; then - echo "Error: No command provided." >&2 - print_help - exit 1 - fi - - case "$1" in - cleanup) - echo "Warning! This will remove old generations of your system." - read -p "How many generations to keep (default: all)? " keep_count - - if [ -z "$keep_count" ]; then - read -p "This will remove all but the current generation. Continue (y/N)? " -n 1 -r - echo - if [[ $REPLY =~ ^[Yy]$ ]]; then - ${pkgs.nh}/bin/nh clean all -v + echo "Auto-detected Hostname: $target_hostname" + echo "Auto-detected Profile: $target_profile" else - echo "Cleanup cancelled." - fi - else - read -p "This will keep the last $keep_count generations. Continue (y/N)? " -n 1 -r - echo - if [[ $REPLY =~ ^[Yy]$ ]]; then - ${pkgs.nh}/bin/nh clean all -k "$keep_count" -v - else - echo "Cleanup cancelled." - fi - fi - - LOG_DIR="$HOME/zcli-cleanup-logs" - mkdir -p "$LOG_DIR" - LOG_FILE="$LOG_DIR/zcli-cleanup-$(${pkgs.coreutils}/bin/date +%Y-%m-%d_%H-%M-%S).log" - echo "Cleaning up old log files..." >> "$LOG_FILE" - ${pkgs.findutils}/bin/find "$LOG_DIR" -type f -mtime +3 -name "*.log" -delete >> "$LOG_FILE" 2>&1 - echo "Cleanup process logged to $LOG_FILE" - ;; - diag) - echo "Generating system diagnostic report..." - ${pkgs.inxi}/bin/inxi --full > "$HOME/diag.txt" - echo "Diagnostic report saved to $HOME/diag.txt" - ;; - help) - print_help - ;; - list-gens) - echo "--- User Generations ---" - ${pkgs.nix}/bin/nix-env --list-generations | ${pkgs.coreutils}/bin/cat || echo "Could not list user generations." - echo "" - echo "--- System Generations ---" - ${pkgs.nix}/bin/nix profile history --profile /nix/var/nix/profiles/system | ${pkgs.coreutils}/bin/cat || echo "Could not list system generations." - ;; - rebuild) - verify_hostname - handle_backups - - # Parse additional arguments - extra_args=$(parse_nh_args "$@") - - echo "Starting NixOS rebuild for host: $(${pkgs.nettools}/bin/hostname)" - if eval "${pkgs.nh}/bin/nh os switch --hostname '$PROFILE' $extra_args"; then - echo "Rebuild finished successfully" - else - echo "Rebuild Failed" >&2 - exit 1 - fi - ;; - rebuild-boot) - verify_hostname - handle_backups - - # Parse additional arguments - extra_args=$(parse_nh_args "$@") - - echo "Starting NixOS rebuild (boot) for host: $(${pkgs.nettools}/bin/hostname)" - echo "Note: Configuration will be activated on next reboot" - if eval "${pkgs.nh}/bin/nh os boot --hostname '$PROFILE' $extra_args"; then - echo "Rebuild-boot finished successfully" - echo "New configuration set as boot default - restart to activate" - else - echo "Rebuild-boot Failed" >&2 - exit 1 - fi - ;; - trim) - echo "Running 'sudo fstrim -v /' may take a few minutes and impact system performance." - read -p "Enter (y/Y) to run now or enter to exit (y/N): " -n 1 -r - echo # move to a new line - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "Running fstrim..." - sudo ${pkgs.util-linux}/bin/fstrim -v / - echo "fstrim complete." - else - echo "Trim operation cancelled." - fi - ;; - update) - verify_hostname - handle_backups - - # Parse additional arguments - extra_args=$(parse_nh_args "$@") - - echo "Updating flake and rebuilding system for host: $(${pkgs.nettools}/bin/hostname)" - if eval "${pkgs.nh}/bin/nh os switch --hostname '$PROFILE' --update $extra_args"; then - echo "Update and rebuild finished successfully" - else - echo "Update and rebuild Failed" >&2 - exit 1 - fi - ;; - update-host) - target_hostname="" - target_profile="" - - if [ "$#" -eq 3 ]; then # zcli update-host - target_hostname="$2" - target_profile="$3" - elif [ "$#" -eq 1 ]; then # zcli update-host (auto-detect) - echo "Attempting to auto-detect hostname and GPU profile..." - target_hostname=$(${pkgs.nettools}/bin/hostname) - target_profile=$(detect_gpu_profile) - - if [ -z "$target_profile" ]; then - echo "Error: Could not auto-detect a specific GPU profile. Please provide it manually." >&2 + echo "Error: Invalid number of arguments for 'update-host'." >&2 echo "Usage: zcli update-host [hostname] [profile]" >&2 exit 1 fi - echo "Auto-detected Hostname: $target_hostname" - echo "Auto-detected Profile: $target_profile" - else - echo "Error: Invalid number of arguments for 'update-host'." >&2 - echo "Usage: zcli update-host [hostname] [profile]" >&2 - exit 1 - fi - echo "Updating $FLAKE_NIX_PATH..." + echo "Updating $FLAKE_NIX_PATH..." - # Update host - if ${pkgs.gnused}/bin/sed -i "s/^[[:space:]]*host[[:space:]]*=[[:space:]]*\".*\"/ host = \"$target_hostname\"/" "$FLAKE_NIX_PATH"; then - echo "Successfully updated host to: $target_hostname" - else - echo "Error: Failed to update host in $FLAKE_NIX_PATH" >&2 - exit 1 - fi - - # Update profile - if ${pkgs.gnused}/bin/sed -i "s/^[[:space:]]*profile[[:space:]]*=[[:space:]]*\".*\"/ profile = \"$target_profile\"/" "$FLAKE_NIX_PATH"; then - echo "Successfully updated profile to: $target_profile" - else - echo "Error: Failed to update profile in $FLAKE_NIX_PATH" >&2 - exit 1 - fi - - echo "Flake.nix updated successfully!" - ;; - add-host) - hostname="" - profile_arg="" - - if [ "$#" -ge 2 ]; then - hostname="$2" - fi - if [ "$#" -eq 3 ]; then - profile_arg="$3" - fi - - if [ -z "$hostname" ]; then - read -p "Enter the new hostname: " hostname - fi - - if [ -d "$HOME/$PROJECT/hosts/$hostname" ]; then - echo "Error: Host '$hostname' already exists." >&2 - exit 1 - fi - - echo "Copying default host configuration..." - ${pkgs.coreutils}/bin/cp -r "$HOME/$PROJECT/hosts/default" "$HOME/$PROJECT/hosts/$hostname" - - detected_profile="" - if [[ -n "$profile_arg" && "$profile_arg" =~ ^(intel|amd|nvidia|nvidia-laptop|amd-hybrid|vm)$ ]]; then - detected_profile="$profile_arg" - else - echo "Detecting GPU profile..." - detected_profile=$(detect_gpu_profile) - echo "Detected GPU profile: $detected_profile" - read -p "Is this correct? (y/n) " -n 1 -r - echo - if [[ $REPLY =~ ^[Nn]$ ]]; then - read -p "Enter the correct profile (intel, amd, nvidia, nvidia-laptop, amd-hybrid, vm): " new_profile - while [[ ! "$new_profile" =~ ^(intel|amd|nvidia|nvidia-laptop|amd-hybrid|vm)$ ]]; do - echo "Invalid profile. Please enter one of the following: intel, amd, nvidia, nvidia-laptop, amd-hybrid, vm" - read -p "Enter the correct profile: " new_profile - done - detected_profile=$new_profile - fi - fi - - echo "Setting profile to '$detected_profile'..." - ${pkgs.gnused}/bin/sed -i "s/profile = .*/profile = \"$detected_profile\";/" "$HOME/$PROJECT/hosts/$hostname/default.nix" - - read -p "Generate new hardware.nix? (y/n) " -n 1 -r - echo - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "Generating hardware.nix..." - sudo nixos-generate-config --show-hardware-config > "$HOME/$PROJECT/hosts/$hostname/hardware.nix" - echo "hardware.nix generated." - fi - - echo "Adding new host to git..." - ${pkgs.git}/bin/git -C "$HOME/$PROJECT" add . - echo "hostname: $hostname added" - ;; - del-host) - hostname="" - if [ "$#" -eq 2 ]; then - hostname="$2" - else - read -p "Enter the hostname to delete: " hostname - fi - - if [ ! -d "$HOME/$PROJECT/hosts/$hostname" ]; then - echo "Error: Host '$hostname' does not exist." >&2 - exit 1 - fi - - read -p "Are you sure you want to delete the host '$hostname'? (y/N) " -n 1 -r - echo - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "Deleting host '$hostname'..." - ${pkgs.coreutils}/bin/rm -rf "$HOME/$PROJECT/hosts/$hostname" - ${pkgs.git}/bin/git -C "$HOME/$PROJECT" add . - echo "hostname: $hostname removed" - else - echo "Deletion cancelled." - fi - ;; - doom) - if [ "$#" -lt 2 ]; then - echo "Error: doom command requires a subcommand." >&2 - echo "Usage: zcli doom [install|status|remove|update]" >&2 - exit 1 - fi - - # Ensure we're acting on a valid host and we can locate variables.nix - verify_hostname - current_hostname="$(hostname)" - host_vars_file="$HOME/$PROJECT/hosts/$current_hostname/variables.nix" - - if [ ! -f "$host_vars_file" ]; then - echo "Error: Host variables file not found: $host_vars_file" >&2 - echo "Please ensure your host folder exists and contains variables.nix." >&2 - exit 1 - fi - - is_doom_enabled() { - # Return 0 if doomEmacsEnable = true; appears (ignoring leading spaces) - ${pkgs.gnugrep}/bin/grep -Eq '^[[:space:]]*doomEmacsEnable[[:space:]]*=[[:space:]]*true[[:space:]]*;' "$host_vars_file" - } - - ensure_doom_enabled() { - # If the variable is present but false, flip it; if missing, append it - if ${pkgs.gnugrep}/bin/grep -Eq '^[[:space:]]*doomEmacsEnable[[:space:]]*=' "$host_vars_file"; then - ${pkgs.gnused}/bin/sed -i 's/^[[:space:]]*doomEmacsEnable[[:space:]]*=.*/ doomEmacsEnable = true;/' "$host_vars_file" + # Update host + if ${pkgs.gnused}/bin/sed -i "s/^[[:space:]]*host[[:space:]]*=[[:space:]]*\".*\"/ host = \"$target_hostname\"/" "$FLAKE_NIX_PATH"; then + echo "Successfully updated host to: $target_hostname" else - echo "" >> "$host_vars_file" - echo " # Enabled by zcli doom on $(date)" >> "$host_vars_file" - echo " doomEmacsEnable = true;" >> "$host_vars_file" + echo "Error: Failed to update host in $FLAKE_NIX_PATH" >&2 + exit 1 fi - } - doom_subcommand="$2" - case "$doom_subcommand" in - install) - if ! is_doom_enabled; then - echo "✗ Doom Emacs is disabled for host '$current_hostname' (doomEmacsEnable = false)." >&2 - echo "To enable, set doomEmacsEnable = true; in:" >&2 - echo " $host_vars_file" >&2 - echo "and rebuild your system before installing Doom." >&2 - echo - read -p "Enable Doom for this host now and rebuild? (y/N) " -n 1 -r - echo - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "Enabling Doom Emacs in $host_vars_file..." - ensure_doom_enabled - echo "Rebuilding system so user modules are applied..." - if ${pkgs.nh}/bin/nh os switch --hostname "$PROFILE"; then - echo "Rebuild complete. Proceeding with Doom installation." - else - echo "Error: Rebuild failed. Please fix the build and re-run 'zcli doom install'." >&2 - exit 1 - fi - else - echo "Aborting. Please enable doomEmacsEnable and rebuild before installing." >&2 - exit 1 - fi - fi - echo "Installing Doom Emacs..." - ${get-doom-script}/bin/get-doom - ;; - status) - if [ -x "$HOME/.emacs.d/bin/doom" ] && [ -f "$HOME/.emacs.d/core/doom.el" ]; then - echo "✔ Doom Emacs appears installed at $HOME/.emacs.d" - if [ -f "$HOME/.doom.d/init.el" ]; then - echo " • User config found: $HOME/.doom.d/init.el" - else - echo " • Warning: User config (~/.doom.d) not found" - fi - echo "Version information:" - "$HOME/.emacs.d/bin/doom" version 2>/dev/null || echo "Could not get version information" - else - if [ -d "$HOME/.emacs.d" ]; then - if [ -z "$(ls -A "$HOME/.emacs.d" 2>/dev/null)" ]; then - echo "✗ Found empty ~/.emacs.d (not a valid Doom installation)" - else - echo "✗ ~/.emacs.d exists but Doom was not detected" - fi - else - echo "✗ Doom Emacs is not installed" - fi - echo "Run 'zcli doom install' to install it" - fi - ;; - remove) - if [ ! -d "$HOME/.emacs.d" ]; then - echo "Doom Emacs is not installed" - exit 0 - fi + # Update profile + if ${pkgs.gnused}/bin/sed -i "s/^[[:space:]]*profile[[:space:]]*=[[:space:]]*\".*\"/ profile = \"$target_profile\"/" "$FLAKE_NIX_PATH"; then + echo "Successfully updated profile to: $target_profile" + else + echo "Error: Failed to update profile in $FLAKE_NIX_PATH" >&2 + exit 1 + fi - echo "Warning: This will completely remove Doom Emacs and all your configuration!" - read -p "Are you sure you want to continue? (y/N) " -n 1 -r + echo "Flake.nix updated successfully!" + ;; + add-host) + hostname="" + profile_arg="" + + if [ "$#" -ge 2 ]; then + hostname="$2" + fi + if [ "$#" -eq 3 ]; then + profile_arg="$3" + fi + + if [ -z "$hostname" ]; then + read -p "Enter the new hostname: " hostname + fi + + if [ -d "$HOME/$PROJECT/hosts/$hostname" ]; then + echo "Error: Host '$hostname' already exists." >&2 + exit 1 + fi + + echo "Copying default host configuration..." + ${pkgs.coreutils}/bin/cp -r "$HOME/$PROJECT/hosts/default" "$HOME/$PROJECT/hosts/$hostname" + + detected_profile="" + if [[ -n "$profile_arg" && "$profile_arg" =~ ^(intel|amd|nvidia|nvidia-laptop|amd-hybrid|vm)$ ]]; then + detected_profile="$profile_arg" + else + echo "Detecting GPU profile..." + detected_profile=$(detect_gpu_profile) + echo "Detected GPU profile: $detected_profile" + read -p "Is this correct? (y/n) " -n 1 -r echo - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "Removing Doom Emacs..." - ${pkgs.coreutils}/bin/rm -rf "$HOME/.emacs.d" - echo "✔ Doom Emacs has been removed" - else - echo "Removal cancelled" - fi - ;; - update) - if [ ! -x "$HOME/.emacs.d/bin/doom" ] || [ ! -f "$HOME/.emacs.d/core/doom.el" ]; then - echo "Error: Doom Emacs is not installed correctly. Run 'zcli doom install' first." >&2 - exit 1 + if [[ $REPLY =~ ^[Nn]$ ]]; then + read -p "Enter the correct profile (intel, amd, nvidia, nvidia-laptop, amd-hybrid, vm): " new_profile + while [[ ! "$new_profile" =~ ^(intel|amd|nvidia|nvidia-laptop|amd-hybrid|vm)$ ]]; do + echo "Invalid profile. Please enter one of the following: intel, amd, nvidia, nvidia-laptop, amd-hybrid, vm" + read -p "Enter the correct profile: " new_profile + done + detected_profile=$new_profile fi + fi - echo "Updating Doom Emacs..." - "$HOME/.emacs.d/bin/doom" sync - echo "✔ Doom Emacs update complete" - ;; - *) - echo "Error: Invalid doom subcommand '$doom_subcommand'" >&2 + echo "Setting profile to '$detected_profile'..." + ${pkgs.gnused}/bin/sed -i "s/profile = .*/profile = \"$detected_profile\";/" "$HOME/$PROJECT/hosts/$hostname/default.nix" + + read -p "Generate new hardware.nix? (y/n) " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "Generating hardware.nix..." + sudo nixos-generate-config --show-hardware-config > "$HOME/$PROJECT/hosts/$hostname/hardware.nix" + echo "hardware.nix generated." + fi + + echo "Adding new host to git..." + ${pkgs.git}/bin/git -C "$HOME/$PROJECT" add . + echo "hostname: $hostname added" + ;; + del-host) + hostname="" + if [ "$#" -eq 2 ]; then + hostname="$2" + else + read -p "Enter the hostname to delete: " hostname + fi + + if [ ! -d "$HOME/$PROJECT/hosts/$hostname" ]; then + echo "Error: Host '$hostname' does not exist." >&2 + exit 1 + fi + + read -p "Are you sure you want to delete the host '$hostname'? (y/N) " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "Deleting host '$hostname'..." + ${pkgs.coreutils}/bin/rm -rf "$HOME/$PROJECT/hosts/$hostname" + ${pkgs.git}/bin/git -C "$HOME/$PROJECT" add . + echo "hostname: $hostname removed" + else + echo "Deletion cancelled." + fi + ;; + doom) + if [ "$#" -lt 2 ]; then + echo "Error: doom command requires a subcommand." >&2 echo "Usage: zcli doom [install|status|remove|update]" >&2 exit 1 - ;; - esac - ;; - *) - echo "Error: Invalid command '$1'" >&2 - print_help - exit 1 - ;; - esac -'' + fi + + # Ensure we're acting on a valid host and we can locate variables.nix + verify_hostname + current_hostname="$(hostname)" + host_vars_file="$HOME/$PROJECT/hosts/$current_hostname/variables.nix" + + if [ ! -f "$host_vars_file" ]; then + echo "Error: Host variables file not found: $host_vars_file" >&2 + echo "Please ensure your host folder exists and contains variables.nix." >&2 + exit 1 + fi + + is_doom_enabled() { + # Return 0 if doomEmacsEnable = true; appears (ignoring leading spaces) + ${pkgs.gnugrep}/bin/grep -Eq '^[[:space:]]*doomEmacsEnable[[:space:]]*=[[:space:]]*true[[:space:]]*;' "$host_vars_file" + } + + ensure_doom_enabled() { + # If the variable is present but false, flip it; if missing, append it + if ${pkgs.gnugrep}/bin/grep -Eq '^[[:space:]]*doomEmacsEnable[[:space:]]*=' "$host_vars_file"; then + ${pkgs.gnused}/bin/sed -i 's/^[[:space:]]*doomEmacsEnable[[:space:]]*=.*/ doomEmacsEnable = true;/' "$host_vars_file" + else + echo "" >> "$host_vars_file" + echo " # Enabled by zcli doom on $(date)" >> "$host_vars_file" + echo " doomEmacsEnable = true;" >> "$host_vars_file" + fi + } + + doom_subcommand="$2" + case "$doom_subcommand" in + install) + if ! is_doom_enabled; then + echo "✗ Doom Emacs is disabled for host '$current_hostname' (doomEmacsEnable = false)." >&2 + echo "To enable, set doomEmacsEnable = true; in:" >&2 + echo " $host_vars_file" >&2 + echo "and rebuild your system before installing Doom." >&2 + echo + read -p "Enable Doom for this host now and rebuild? (y/N) " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "Enabling Doom Emacs in $host_vars_file..." + ensure_doom_enabled + echo "Rebuilding system so user modules are applied..." + if ${pkgs.nh}/bin/nh os switch --hostname "$PROFILE"; then + echo "Rebuild complete. Proceeding with Doom installation." + else + echo "Error: Rebuild failed. Please fix the build and re-run 'zcli doom install'." >&2 + exit 1 + fi + else + echo "Aborting. Please enable doomEmacsEnable and rebuild before installing." >&2 + exit 1 + fi + fi + echo "Installing Doom Emacs..." + ${get-doom-script}/bin/get-doom + ;; + status) + if [ -x "$HOME/.emacs.d/bin/doom" ] && [ -f "$HOME/.emacs.d/core/doom.el" ]; then + echo "✔ Doom Emacs appears installed at $HOME/.emacs.d" + if [ -f "$HOME/.doom.d/init.el" ]; then + echo " • User config found: $HOME/.doom.d/init.el" + else + echo " • Warning: User config (~/.doom.d) not found" + fi + echo "Version information:" + "$HOME/.emacs.d/bin/doom" version 2>/dev/null || echo "Could not get version information" + else + if [ -d "$HOME/.emacs.d" ]; then + if [ -z "$(ls -A "$HOME/.emacs.d" 2>/dev/null)" ]; then + echo "✗ Found empty ~/.emacs.d (not a valid Doom installation)" + else + echo "✗ ~/.emacs.d exists but Doom was not detected" + fi + else + echo "✗ Doom Emacs is not installed" + fi + echo "Run 'zcli doom install' to install it" + fi + ;; + remove) + if [ ! -d "$HOME/.emacs.d" ]; then + echo "Doom Emacs is not installed" + exit 0 + fi + + echo "Warning: This will completely remove Doom Emacs and all your configuration!" + read -p "Are you sure you want to continue? (y/N) " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "Removing Doom Emacs..." + ${pkgs.coreutils}/bin/rm -rf "$HOME/.emacs.d" + echo "✔ Doom Emacs has been removed" + else + echo "Removal cancelled" + fi + ;; + update) + if [ ! -x "$HOME/.emacs.d/bin/doom" ] || [ ! -f "$HOME/.emacs.d/core/doom.el" ]; then + echo "Error: Doom Emacs is not installed correctly. Run 'zcli doom install' first." >&2 + exit 1 + fi + + echo "Updating Doom Emacs..." + "$HOME/.emacs.d/bin/doom" sync + echo "✔ Doom Emacs update complete" + ;; + *) + echo "Error: Invalid doom subcommand '$doom_subcommand'" >&2 + echo "Usage: zcli doom [install|status|remove|update]" >&2 + exit 1 + ;; + esac + ;; + *) + echo "Error: Invalid command '$1'" >&2 + print_help + exit 1 + ;; + esac + '' diff --git a/modules/home/starship-ddubs-1.nix b/modules/home/starship-ddubs-1.nix index 2faa8b0..6bc0434 100644 --- a/modules/home/starship-ddubs-1.nix +++ b/modules/home/starship-ddubs-1.nix @@ -1,13 +1,12 @@ # starship is a minimal, fast, and extremely customizable prompt for any shell! -{ config -, lib -, ... -}: -let +{ + config, + lib, + ... +}: let accent = "#${config.lib.stylix.colors.base0D}"; background-alt = "#${config.lib.stylix.colors.base01}"; -in -{ +in { programs.starship = { enable = false; settings = { @@ -22,7 +21,7 @@ in "\n" "$character" ]; - directory = { style = accent; }; + directory = {style = accent;}; character = { success_symbol = "[❯](${accent})"; diff --git a/modules/home/starship.nix b/modules/home/starship.nix index 51090b9..05e7772 100644 --- a/modules/home/starship.nix +++ b/modules/home/starship.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { programs.starship = { enable = false; package = pkgs.starship; diff --git a/modules/home/swappy.nix b/modules/home/swappy.nix index b3b62a3..0029798 100644 --- a/modules/home/swappy.nix +++ b/modules/home/swappy.nix @@ -1,4 +1,4 @@ -{ username, ... }: { +{username, ...}: { home.file = { ".config/swappy/config".text = '' [Default] diff --git a/modules/home/swaync.nix b/modules/home/swaync.nix index 2662402..07e6261 100644 --- a/modules/home/swaync.nix +++ b/modules/home/swaync.nix @@ -1,4 +1,4 @@ -{ config, ... }: { +{config, ...}: { services.swaync = { enable = true; settings = { diff --git a/modules/home/tealdeer.nix b/modules/home/tealdeer.nix index 1b2c859..a8e6c94 100644 --- a/modules/home/tealdeer.nix +++ b/modules/home/tealdeer.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { programs.tealdeer = { enable = true; settings = { diff --git a/modules/home/terminals/ghostty.nix b/modules/home/terminals/ghostty.nix index be09725..98cd595 100644 --- a/modules/home/terminals/ghostty.nix +++ b/modules/home/terminals/ghostty.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -let +{pkgs, ...}: let # A recent issue 7/7/2025 w/ghostty causes it to hang or respond slowly # This is a workaround until a fix is released myGhostty = pkgs.ghostty.overrideAttrs (_: { @@ -9,8 +8,7 @@ let shopt -u globstar ''; }); -in -{ +in { programs.ghostty = { enable = true; package = myGhostty; # to fix a but in current builds of ghostty diff --git a/modules/home/terminals/kitty.nix b/modules/home/terminals/kitty.nix index 69a4490..e34c3a4 100644 --- a/modules/home/terminals/kitty.nix +++ b/modules/home/terminals/kitty.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { programs.kitty = { enable = true; package = pkgs.kitty; diff --git a/modules/home/terminals/wezterm.nix b/modules/home/terminals/wezterm.nix index d939ca0..ab274ff 100644 --- a/modules/home/terminals/wezterm.nix +++ b/modules/home/terminals/wezterm.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { programs.wezterm = { enable = true; package = pkgs.wezterm; diff --git a/modules/home/virtmanager.nix b/modules/home/virtmanager.nix index 0a885e1..15065e6 100644 --- a/modules/home/virtmanager.nix +++ b/modules/home/virtmanager.nix @@ -1,10 +1,8 @@ -{ ... }: - -{ +{...}: { dconf.settings = { "org/virt-manager/virt-manager/connections" = { - autoconnect = [ "qemu:///system" ]; - uris = [ "qemu:///system" ]; + autoconnect = ["qemu:///system"]; + uris = ["qemu:///system"]; }; }; } diff --git a/modules/home/waybar/waybar-curved.nix b/modules/home/waybar/waybar-curved.nix index 09a07e3..33e46fe 100644 --- a/modules/home/waybar/waybar-curved.nix +++ b/modules/home/waybar/waybar-curved.nix @@ -1,277 +1,277 @@ -{ pkgs -, lib -, host -, config -, ... -}: -let +{ + pkgs, + lib, + host, + config, + ... +}: let betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)"; inherit (import ../../../hosts/${host}/variables.nix) clock24h; in -with lib; { - # Configure & Theme Waybar - programs.waybar = { - enable = true; - package = pkgs.waybar; - settings = [ - { - layer = "top"; - position = "top"; - modules-center = [ "hyprland/workspaces" ]; - modules-left = [ - "custom/startmenu" - "hyprland/window" - "pulseaudio" - "cpu" - "memory" - "idle_inhibitor" - ]; - modules-right = [ - "custom/hyprbindings" - "custom/notification" - "custom/exit" - "battery" - "tray" - "clock" - ]; + with lib; { + # Configure & Theme Waybar + programs.waybar = { + enable = true; + package = pkgs.waybar; + settings = [ + { + layer = "top"; + position = "top"; + modules-center = ["hyprland/workspaces"]; + modules-left = [ + "custom/startmenu" + "hyprland/window" + "pulseaudio" + "cpu" + "memory" + "idle_inhibitor" + ]; + modules-right = [ + "custom/hyprbindings" + "custom/notification" + "custom/exit" + "battery" + "tray" + "clock" + ]; - "hyprland/workspaces" = { - format = "{name}"; - format-icons = { - default = " "; - active = " "; - urgent = " "; + "hyprland/workspaces" = { + format = "{name}"; + format-icons = { + default = " "; + active = " "; + urgent = " "; + }; + on-scroll-up = "hyprctl dispatch workspace e+1"; + on-scroll-down = "hyprctl dispatch workspace e-1"; }; - on-scroll-up = "hyprctl dispatch workspace e+1"; - on-scroll-down = "hyprctl dispatch workspace e-1"; - }; - "clock" = { - format = - if clock24h == true - then '' {:L%H:%M}'' - else '' {:L%I:%M %p}''; - tooltip = true; - tooltip-format = "{:%A, %d.%B %Y }\n{calendar}"; - }; - "hyprland/window" = { - max-length = 22; - separate-outputs = false; - rewrite = { - "" = " 🙈 No Windows? "; + "clock" = { + format = + if clock24h == true + then '' {:L%H:%M}'' + else '' {:L%I:%M %p}''; + tooltip = true; + tooltip-format = "{:%A, %d.%B %Y }\n{calendar}"; }; - }; - "memory" = { - interval = 5; - format = " {}%"; - tooltip = true; - }; - "cpu" = { - interval = 5; - format = " {usage:2}%"; - tooltip = true; - }; - "disk" = { - format = " {free}"; - tooltip = true; - }; - "network" = { - format-icons = [ - "󰤯" - "󰤟" - "󰤢" - "󰤥" - "󰤨" - ]; - format-ethernet = " {bandwidthDownOctets}"; - format-wifi = "{icon} {signalStrength}%"; - format-disconnected = "󰤮"; - tooltip = false; - }; - "tray" = { - spacing = 12; - }; - "pulseaudio" = { - format = "{icon} {volume}% {format_source}"; - format-bluetooth = "{volume}% {icon} {format_source}"; - format-bluetooth-muted = " {icon} {format_source}"; - format-muted = " {format_source}"; - format-source = " {volume}%"; - format-source-muted = ""; - format-icons = { - headphone = ""; - hands-free = ""; - headset = ""; - phone = ""; - portable = ""; - car = ""; - default = [ - "" - "" - "" + "hyprland/window" = { + max-length = 22; + separate-outputs = false; + rewrite = { + "" = " 🙈 No Windows? "; + }; + }; + "memory" = { + interval = 5; + format = " {}%"; + tooltip = true; + }; + "cpu" = { + interval = 5; + format = " {usage:2}%"; + tooltip = true; + }; + "disk" = { + format = " {free}"; + tooltip = true; + }; + "network" = { + format-icons = [ + "󰤯" + "󰤟" + "󰤢" + "󰤥" + "󰤨" ]; + format-ethernet = " {bandwidthDownOctets}"; + format-wifi = "{icon} {signalStrength}%"; + format-disconnected = "󰤮"; + tooltip = false; }; - on-click = "sleep 0.1 && pavucontrol"; - }; - "custom/exit" = { - tooltip = false; - format = ""; - on-click = "sleep 0.1 && wlogout"; - }; - "custom/startmenu" = { - tooltip = false; - format = ""; - # exec = "rofi -show drun"; - on-click = "sleep 0.1 && rofi-launcher"; - }; - "custom/hyprbindings" = { - tooltip = false; - format = "󱕴"; - on-click = "sleep 0.1 && list-keybinds"; - }; - "idle_inhibitor" = { - format = "{icon}"; - format-icons = { - activated = ""; - deactivated = ""; + "tray" = { + spacing = 12; }; - tooltip = "true"; - }; - "custom/notification" = { - tooltip = false; - format = "{icon} {}"; - format-icons = { - notification = ""; - none = ""; - dnd-notification = ""; - dnd-none = ""; - inhibited-notification = ""; - inhibited-none = ""; - dnd-inhibited-notification = ""; - dnd-inhibited-none = ""; + "pulseaudio" = { + format = "{icon} {volume}% {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-muted = " {format_source}"; + format-source = " {volume}%"; + format-source-muted = ""; + format-icons = { + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + portable = ""; + car = ""; + default = [ + "" + "" + "" + ]; + }; + on-click = "sleep 0.1 && pavucontrol"; }; - return-type = "json"; - exec-if = "which swaync-client"; - exec = "swaync-client -swb"; - on-click = "sleep 0.1 && task-waybar"; - escape = true; - }; - "battery" = { - states = { - warning = 30; - critical = 15; + "custom/exit" = { + tooltip = false; + format = ""; + on-click = "sleep 0.1 && wlogout"; + }; + "custom/startmenu" = { + tooltip = false; + format = ""; + # exec = "rofi -show drun"; + on-click = "sleep 0.1 && rofi-launcher"; + }; + "custom/hyprbindings" = { + tooltip = false; + format = "󱕴"; + on-click = "sleep 0.1 && list-keybinds"; + }; + "idle_inhibitor" = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + tooltip = "true"; + }; + "custom/notification" = { + tooltip = false; + format = "{icon} {}"; + format-icons = { + notification = ""; + none = ""; + dnd-notification = ""; + dnd-none = ""; + inhibited-notification = ""; + inhibited-none = ""; + dnd-inhibited-notification = ""; + dnd-inhibited-none = ""; + }; + return-type = "json"; + exec-if = "which swaync-client"; + exec = "swaync-client -swb"; + on-click = "sleep 0.1 && task-waybar"; + escape = true; + }; + "battery" = { + states = { + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-charging = "󰂄 {capacity}%"; + format-plugged = "󱘖 {capacity}%"; + format-icons = [ + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + on-click = ""; + tooltip = false; }; - format = "{icon} {capacity}%"; - format-charging = "󰂄 {capacity}%"; - format-plugged = "󱘖 {capacity}%"; - format-icons = [ - "󰁺" - "󰁻" - "󰁼" - "󰁽" - "󰁾" - "󰁿" - "󰂀" - "󰂁" - "󰂂" - "󰁹" - ]; - on-click = ""; - tooltip = false; - }; - } - ]; - style = concatStrings [ - '' - * { - font-family: JetBrainsMono Nerd Font Mono; - font-size: 16px; - border-radius: 0px; - border: none; - min-height: 0px; } - window#waybar { - background: rgba(0,0,0,0); - } - #workspaces { - color: #${config.lib.stylix.colors.base00}; - background: #${config.lib.stylix.colors.base01}; - margin: 4px 4px; - padding: 5px 5px; - border-radius: 16px; - } - #workspaces button { - font-weight: bold; - padding: 0px 5px; - margin: 0px 3px; - border-radius: 16px; - color: #${config.lib.stylix.colors.base00}; - background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); - opacity: 0.5; - transition: ${betterTransition}; - } - #workspaces button.active { - font-weight: bold; - padding: 0px 5px; - margin: 0px 3px; - border-radius: 16px; - color: #${config.lib.stylix.colors.base00}; - background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); - transition: ${betterTransition}; - opacity: 1.0; - min-width: 40px; - } - #workspaces button:hover { - font-weight: bold; - border-radius: 16px; - color: #${config.lib.stylix.colors.base00}; - background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); - opacity: 0.8; - transition: ${betterTransition}; - } - tooltip { - background: #${config.lib.stylix.colors.base00}; - border: 1px solid #${config.lib.stylix.colors.base08}; - border-radius: 12px; - } - tooltip label { - color: #${config.lib.stylix.colors.base08}; - } - #window, #pulseaudio, #cpu, #memory, #idle_inhibitor { - font-weight: bold; - margin: 4px 0px; - margin-left: 7px; - padding: 0px 18px; - background: #${config.lib.stylix.colors.base04}; - color: #${config.lib.stylix.colors.base00}; - border-radius: 24px 10px 24px 10px; - } - #custom-startmenu { - color: #${config.lib.stylix.colors.base0B}; - background: #${config.lib.stylix.colors.base02}; - font-size: 28px; - margin: 0px; - padding: 0px 30px 0px 15px; - border-radius: 0px 0px 40px 0px; - } - #custom-hyprbindings, #network, #battery, - #custom-notification, #tray, #custom-exit { - font-weight: bold; - background: #${config.lib.stylix.colors.base0F}; - color: #${config.lib.stylix.colors.base00}; - margin: 4px 0px; - margin-right: 7px; - border-radius: 10px 24px 10px 24px; - padding: 0px 18px; - } - #clock { - font-weight: bold; - color: #0D0E15; - background: linear-gradient(90deg, #${config.lib.stylix.colors.base0E}, #${config.lib.stylix.colors.base0C}); - margin: 0px; - padding: 0px 15px 0px 30px; - border-radius: 0px 0px 0px 40px; - } - '' - ]; - }; -} + ]; + style = concatStrings [ + '' + * { + font-family: JetBrainsMono Nerd Font Mono; + font-size: 16px; + border-radius: 0px; + border: none; + min-height: 0px; + } + window#waybar { + background: rgba(0,0,0,0); + } + #workspaces { + color: #${config.lib.stylix.colors.base00}; + background: #${config.lib.stylix.colors.base01}; + margin: 4px 4px; + padding: 5px 5px; + border-radius: 16px; + } + #workspaces button { + font-weight: bold; + padding: 0px 5px; + margin: 0px 3px; + border-radius: 16px; + color: #${config.lib.stylix.colors.base00}; + background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); + opacity: 0.5; + transition: ${betterTransition}; + } + #workspaces button.active { + font-weight: bold; + padding: 0px 5px; + margin: 0px 3px; + border-radius: 16px; + color: #${config.lib.stylix.colors.base00}; + background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); + transition: ${betterTransition}; + opacity: 1.0; + min-width: 40px; + } + #workspaces button:hover { + font-weight: bold; + border-radius: 16px; + color: #${config.lib.stylix.colors.base00}; + background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); + opacity: 0.8; + transition: ${betterTransition}; + } + tooltip { + background: #${config.lib.stylix.colors.base00}; + border: 1px solid #${config.lib.stylix.colors.base08}; + border-radius: 12px; + } + tooltip label { + color: #${config.lib.stylix.colors.base08}; + } + #window, #pulseaudio, #cpu, #memory, #idle_inhibitor { + font-weight: bold; + margin: 4px 0px; + margin-left: 7px; + padding: 0px 18px; + background: #${config.lib.stylix.colors.base04}; + color: #${config.lib.stylix.colors.base00}; + border-radius: 24px 10px 24px 10px; + } + #custom-startmenu { + color: #${config.lib.stylix.colors.base0B}; + background: #${config.lib.stylix.colors.base02}; + font-size: 28px; + margin: 0px; + padding: 0px 30px 0px 15px; + border-radius: 0px 0px 40px 0px; + } + #custom-hyprbindings, #network, #battery, + #custom-notification, #tray, #custom-exit { + font-weight: bold; + background: #${config.lib.stylix.colors.base0F}; + color: #${config.lib.stylix.colors.base00}; + margin: 4px 0px; + margin-right: 7px; + border-radius: 10px 24px 10px 24px; + padding: 0px 18px; + } + #clock { + font-weight: bold; + color: #0D0E15; + background: linear-gradient(90deg, #${config.lib.stylix.colors.base0E}, #${config.lib.stylix.colors.base0C}); + margin: 0px; + padding: 0px 15px 0px 30px; + border-radius: 0px 0px 0px 40px; + } + '' + ]; + }; + } diff --git a/modules/home/waybar/waybar-ddubs-2.nix b/modules/home/waybar/waybar-ddubs-2.nix index 2b44044..2cce101 100644 --- a/modules/home/waybar/waybar-ddubs-2.nix +++ b/modules/home/waybar/waybar-ddubs-2.nix @@ -1,9 +1,9 @@ -{ pkgs -, config -, lib -, ... -}: -let +{ + pkgs, + config, + lib, + ... +}: let terminal = "kitty"; base00 = "0F1419"; base01 = "131721"; @@ -20,337 +20,337 @@ let base0E = "D2A6FF"; base0F = "E6B673"; in -with lib; { - # Configure & Theme Waybar - programs.waybar = { - enable = true; - package = pkgs.waybar; - settings = [ - { - layer = "top"; - position = "top"; + with lib; { + # Configure & Theme Waybar + programs.waybar = { + enable = true; + package = pkgs.waybar; + settings = [ + { + layer = "top"; + position = "top"; - modules-left = [ "custom/startmenu" "tray" "hyprland/window" ]; - modules-center = [ "hyprland/workspaces" ]; - modules-right = [ "idle_inhibitor" "custom/notification" "pulseaudio" "battery" "clock" "custom/exit" ]; + modules-left = ["custom/startmenu" "tray" "hyprland/window"]; + modules-center = ["hyprland/workspaces"]; + modules-right = ["idle_inhibitor" "custom/notification" "pulseaudio" "battery" "clock" "custom/exit"]; - "hyprland/workspaces" = { - format = "{name}"; - format-icons = { - default = " "; - active = " "; - urgent = " "; + "hyprland/workspaces" = { + format = "{name}"; + format-icons = { + default = " "; + active = " "; + urgent = " "; + }; + on-scroll-up = "hyprctl dispatch workspace e+1"; + on-scroll-down = "hyprctl dispatch workspace e-1"; }; - on-scroll-up = "hyprctl dispatch workspace e+1"; - on-scroll-down = "hyprctl dispatch workspace e-1"; - }; - "clock" = { - format = '' {:%H:%M}''; - /* + "clock" = { + format = '' {:%H:%M}''; + /* ''{: %I:%M %p}''; */ - tooltip = true; - tooltip-format = "{:%A, %d.%B %Y }{calendar}"; - }; - "hyprland/window" = { - max-length = 60; - separate-outputs = false; - }; - "memory" = { - interval = 5; - format = " {}%"; - tooltip = true; - on-click = "${terminal} -e btop"; - }; - "cpu" = { - interval = 5; - format = " {usage:2}%"; - tooltip = true; - on-click = "${terminal} -e btop"; - }; - "disk" = { - format = " {free}"; - tooltip = true; - # Not working with zaneyos window open then closes - #on-click = "${terminal} -e sh -c df -h ; read"; - }; - "network" = { - format-icons = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ]; - format-ethernet = " {bandwidthDownBits}"; - format-wifi = " {bandwidthDownBits}"; - format-disconnected = "󰤮"; - tooltip = false; - on-click = "${terminal} -e btop"; - }; - "tray" = { - spacing = 12; - }; - "pulseaudio" = { - format = "{icon} {volume}% {format_source}"; - format-bluetooth = "{volume}% {icon} {format_source}"; - format-bluetooth-muted = " {icon} {format_source}"; - format-muted = " {format_source}"; - format-source = " {volume}%"; - format-source-muted = ""; - format-icons = { - headphone = ""; - hands-free = ""; - headset = ""; - phone = ""; - portable = ""; - car = ""; - default = [ "" "" "" ]; + tooltip = true; + tooltip-format = "{:%A, %d.%B %Y }{calendar}"; }; - on-click = "pavucontrol"; - }; - "custom/exit" = { - tooltip = false; - format = "⏻"; - on-click = "sleep 0.1 && wlogout"; - }; - "custom/startmenu" = { - tooltip = false; - format = " "; - # exec = "rofi -show drun"; - on-click = "rofi -show drun"; - }; - "idle_inhibitor" = { - format = "{icon}"; - format-icons = { - activated = " "; - deactivated = " "; + "hyprland/window" = { + max-length = 60; + separate-outputs = false; }; - tooltip = "true"; - }; - "custom/notification" = { - tooltip = false; - format = "{icon} {}"; - format-icons = { - notification = ""; - none = ""; - dnd-notification = ""; - dnd-none = ""; - inhibited-notification = ""; - inhibited-none = ""; - dnd-inhibited-notification = ""; - dnd-inhibited-none = ""; + "memory" = { + interval = 5; + format = " {}%"; + tooltip = true; + on-click = "${terminal} -e btop"; }; - return-type = "json"; - exec-if = "which swaync-client"; - exec = "swaync-client -swb"; - on-click = "swaync-client -t"; - escape = true; - }; - "battery" = { - states = { - warning = 30; - critical = 15; + "cpu" = { + interval = 5; + format = " {usage:2}%"; + tooltip = true; + on-click = "${terminal} -e btop"; + }; + "disk" = { + format = " {free}"; + tooltip = true; + # Not working with zaneyos window open then closes + #on-click = "${terminal} -e sh -c df -h ; read"; + }; + "network" = { + format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"]; + format-ethernet = " {bandwidthDownBits}"; + format-wifi = " {bandwidthDownBits}"; + format-disconnected = "󰤮"; + tooltip = false; + on-click = "${terminal} -e btop"; + }; + "tray" = { + spacing = 12; + }; + "pulseaudio" = { + format = "{icon} {volume}% {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-muted = " {format_source}"; + format-source = " {volume}%"; + format-source-muted = ""; + format-icons = { + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + portable = ""; + car = ""; + default = ["" "" ""]; + }; + on-click = "pavucontrol"; + }; + "custom/exit" = { + tooltip = false; + format = "⏻"; + on-click = "sleep 0.1 && wlogout"; + }; + "custom/startmenu" = { + tooltip = false; + format = " "; + # exec = "rofi -show drun"; + on-click = "rofi -show drun"; + }; + "idle_inhibitor" = { + format = "{icon}"; + format-icons = { + activated = " "; + deactivated = " "; + }; + tooltip = "true"; + }; + "custom/notification" = { + tooltip = false; + format = "{icon} {}"; + format-icons = { + notification = ""; + none = ""; + dnd-notification = ""; + dnd-none = ""; + inhibited-notification = ""; + inhibited-none = ""; + dnd-inhibited-notification = ""; + dnd-inhibited-none = ""; + }; + return-type = "json"; + exec-if = "which swaync-client"; + exec = "swaync-client -swb"; + on-click = "swaync-client -t"; + escape = true; + }; + "battery" = { + states = { + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-charging = "󰂄 {capacity}%"; + format-plugged = "󱘖 {capacity}%"; + format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; + on-click = ""; + tooltip = false; }; - format = "{icon} {capacity}%"; - format-charging = "󰂄 {capacity}%"; - format-plugged = "󱘖 {capacity}%"; - format-icons = [ "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ]; - on-click = ""; - tooltip = false; - }; - } - ]; - style = concatStrings [ - '' - * { - font-size: 16pt; - font-family: JetBrainsMono Nerd Font, Font Awesome, sans-serif; - font-weight: bold; } - window#waybar { - /* + ]; + style = concatStrings [ + '' + * { + font-size: 16pt; + font-family: JetBrainsMono Nerd Font, Font Awesome, sans-serif; + font-weight: bold; + } + window#waybar { + /* + + background-color: rgba(26,27,38,0); + border-bottom: 1px solid rgba(26,27,38,0); + border-radius: 0px; + color: #${base0F}; + */ background-color: rgba(26,27,38,0); border-bottom: 1px solid rgba(26,27,38,0); border-radius: 0px; color: #${base0F}; - */ - - background-color: rgba(26,27,38,0); - border-bottom: 1px solid rgba(26,27,38,0); - border-radius: 0px; - color: #${base0F}; - } - #workspaces { - /* - Eternal - background: linear-gradient(180deg, #${base00}, #${base01}); - margin: 5px 5px 5px 0px; - padding: 0px 10px; - border-radius: 0px 15px 15px 0px; + } + #workspaces { + /* + Eternal + background: linear-gradient(180deg, #${base00}, #${base01}); + margin: 5px 5px 5px 0px; + padding: 0px 10px; + border-radius: 0px 15px 15px 0px; + border: 0px; + font-style: normal; + color: #${base00}; + */ + background: linear-gradient(45deg, #${base01}, #${base01}); + margin: 5px; + padding: 0px 1px; + border-radius: 15px; border: 0px; font-style: normal; color: #${base00}; - */ - background: linear-gradient(45deg, #${base01}, #${base01}); - margin: 5px; - padding: 0px 1px; - border-radius: 15px; - border: 0px; - font-style: normal; - color: #${base00}; - } - #workspaces button { - padding: 0px 5px; - margin: 4px 3px; - border-radius: 15px; - border: 0px; - color: #${base00}; - background: linear-gradient(45deg, #${base0D}, #${base0E}); - opacity: 0.5; - transition: all 0.3s ease-in-out; - } - #workspaces button.active { - padding: 0px 5px; - margin: 4px 3px; - border-radius: 15px; - border: 0px; - color: #${base00}; - background: linear-gradient(45deg, #${base0D}, #${base0E}); - opacity: 1.0; - min-width: 40px; - transition: all 0.3s ease-in-out; - } - #workspaces button:hover { - border-radius: 15px; - color: #${base00}; - background: linear-gradient(45deg, #${base0D}, #${base0E}); - opacity: 0.8; - } - tooltip { - background: #${base00}; - border: 1px solid #${base0E}; - border-radius: 10px; - } - tooltip label { - color: #${base07}; - } - #window { - /* - Eternal + } + #workspaces button { + padding: 0px 5px; + margin: 4px 3px; + border-radius: 15px; + border: 0px; + color: #${base00}; + background: linear-gradient(45deg, #${base0D}, #${base0E}); + opacity: 0.5; + transition: all 0.3s ease-in-out; + } + #workspaces button.active { + padding: 0px 5px; + margin: 4px 3px; + border-radius: 15px; + border: 0px; + color: #${base00}; + background: linear-gradient(45deg, #${base0D}, #${base0E}); + opacity: 1.0; + min-width: 40px; + transition: all 0.3s ease-in-out; + } + #workspaces button:hover { + border-radius: 15px; + color: #${base00}; + background: linear-gradient(45deg, #${base0D}, #${base0E}); + opacity: 0.8; + } + tooltip { + background: #${base00}; + border: 1px solid #${base0E}; + border-radius: 10px; + } + tooltip label { + color: #${base07}; + } + #window { + /* + Eternal + color: #${base05}; + background: #${base00}; + border-radius: 15px; + margin: 5px; + padding: 2px 20px; + */ + margin: 5px; + padding: 2px 20px; + color: #${base05}; + background: #${base01}; + border-radius: 15px 15px 15px 15px; + } + #memory { + color: #${base0F}; + /* + Eternal + background: #${base00}; + border-radius: 15px 15px 15px 15px; + margin: 5px; + padding: 2px 20px; + */ + background: #${base01}; + margin: 5px; + padding: 2px 20px; + border-radius: 15px 15px 15px 15px; + } + #clock { + color: #${base0B}; + background: #${base00}; + border-radius: 15px 15px 15px 15px; + margin: 5px; + padding: 2px 20px; + } + #idle_inhibitor { + color: #${base0A}; + background: #${base00}; + border-radius: 15px 15px 15px 15px; + margin: 3px; + padding: 2px 20px; + } + #cpu { + color: #${base07}; + background: #${base00}; + border-radius: 15px 15px 15px 15px; + margin: 5px; + padding: 2px 20px; + } + #disk { + color: #${base0F}; + background: #${base00}; + border-radius: 15px 15px 15px 15px; + margin: 5px; + padding: 2px 20px; + } + #battery { + color: #${base08}; + background: #${base00}; + border-radius: 15px 15px 15px 15px; + margin: 5px; + padding: 2px 20px; + } + #network { + color: #${base09}; + background: #${base00}; + border-radius: 15px 15px 15px 15px; + margin: 5px; + padding: 2px 20px; + } + #tray { color: #${base05}; background: #${base00}; - border-radius: 15px; + border-radius: 15px 15px 15px 15px; margin: 5px; + padding: 2px 15px; + } + #pulseaudio { + color: #${base0D}; + /* + Eternal + background: #${base00}; + border-radius: 15px 15px 15px 15px; + margin: 5px; + padding: 2px 20px; + */ + background: #${base01}; + margin: 4px; padding: 2px 20px; - */ - margin: 5px; - padding: 2px 20px; - color: #${base05}; - background: #${base01}; - border-radius: 15px 15px 15px 15px; - } - #memory { - color: #${base0F}; - /* - Eternal + border-radius: 15px 15px 15px 15px; + } + #custom-notification { + color: #${base0C}; background: #${base00}; border-radius: 15px 15px 15px 15px; margin: 5px; padding: 2px 20px; - */ - background: #${base01}; - margin: 5px; - padding: 2px 20px; - border-radius: 15px 15px 15px 15px; - } - #clock { - color: #${base0B}; + } + #custom-startmenu { + color: #${base0E}; + background: #${base00}; + border-radius: 0px 15px 15px 0px; + margin: 5px 5px 5px 0px; + padding: 2px 20px; + } + #idle_inhibitor { + color: #${base09}; background: #${base00}; border-radius: 15px 15px 15px 15px; margin: 5px; padding: 2px 20px; - } - #idle_inhibitor { - color: #${base0A}; + } + #custom-exit { + color: #${base0E}; background: #${base00}; - border-radius: 15px 15px 15px 15px; - margin: 3px; + border-radius: 15px 0px 0px 15px; + margin: 5px 0px 5px 5px; padding: 2px 20px; - } - #cpu { - color: #${base07}; - background: #${base00}; - border-radius: 15px 15px 15px 15px; - margin: 5px; - padding: 2px 20px; - } - #disk { - color: #${base0F}; - background: #${base00}; - border-radius: 15px 15px 15px 15px; - margin: 5px; - padding: 2px 20px; - } - #battery { - color: #${base08}; - background: #${base00}; - border-radius: 15px 15px 15px 15px; - margin: 5px; - padding: 2px 20px; - } - #network { - color: #${base09}; - background: #${base00}; - border-radius: 15px 15px 15px 15px; - margin: 5px; - padding: 2px 20px; - } - #tray { - color: #${base05}; - background: #${base00}; - border-radius: 15px 15px 15px 15px; - margin: 5px; - padding: 2px 15px; - } - #pulseaudio { - color: #${base0D}; - /* - Eternal - background: #${base00}; - border-radius: 15px 15px 15px 15px; - margin: 5px; - padding: 2px 20px; - */ - background: #${base01}; - margin: 4px; - padding: 2px 20px; - border-radius: 15px 15px 15px 15px; - } - #custom-notification { - color: #${base0C}; - background: #${base00}; - border-radius: 15px 15px 15px 15px; - margin: 5px; - padding: 2px 20px; - } - #custom-startmenu { - color: #${base0E}; - background: #${base00}; - border-radius: 0px 15px 15px 0px; - margin: 5px 5px 5px 0px; - padding: 2px 20px; - } - #idle_inhibitor { - color: #${base09}; - background: #${base00}; - border-radius: 15px 15px 15px 15px; - margin: 5px; - padding: 2px 20px; - } - #custom-exit { - color: #${base0E}; - background: #${base00}; - border-radius: 15px 0px 0px 15px; - margin: 5px 0px 5px 5px; - padding: 2px 20px; - } - '' - ]; - }; -} + } + '' + ]; + }; + } diff --git a/modules/home/waybar/waybar-ddubs.nix b/modules/home/waybar/waybar-ddubs.nix index 094babe..08edf50 100644 --- a/modules/home/waybar/waybar-ddubs.nix +++ b/modules/home/waybar/waybar-ddubs.nix @@ -1,283 +1,283 @@ -{ pkgs -, lib -, host -, config -, ... -}: -let +{ + pkgs, + lib, + host, + config, + ... +}: let betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)"; inherit (import ../../../hosts/${host}/variables.nix) clock24h; in -with lib; { - # Configure & Theme Waybar - programs.waybar = { - enable = true; - package = pkgs.waybar; - settings = [ - { - layer = "top"; - position = "top"; - modules-center = [ "hyprland/workspaces" ]; - modules-left = [ - "custom/startmenu" - "hyprland/window" - "pulseaudio" - "cpu" - "memory" - "idle_inhibitor" - ]; - modules-right = [ - "custom/hyprbindings" - "custom/notification" - "custom/exit" - "battery" - "tray" - "clock" - ]; + with lib; { + # Configure & Theme Waybar + programs.waybar = { + enable = true; + package = pkgs.waybar; + settings = [ + { + layer = "top"; + position = "top"; + modules-center = ["hyprland/workspaces"]; + modules-left = [ + "custom/startmenu" + "hyprland/window" + "pulseaudio" + "cpu" + "memory" + "idle_inhibitor" + ]; + modules-right = [ + "custom/hyprbindings" + "custom/notification" + "custom/exit" + "battery" + "tray" + "clock" + ]; - "hyprland/workspaces" = { - format = "{name}"; - format-icons = { - default = " "; - active = " "; - urgent = " "; + "hyprland/workspaces" = { + format = "{name}"; + format-icons = { + default = " "; + active = " "; + urgent = " "; + }; + on-scroll-up = "hyprctl dispatch workspace e+1"; + on-scroll-down = "hyprctl dispatch workspace e-1"; }; - on-scroll-up = "hyprctl dispatch workspace e+1"; - on-scroll-down = "hyprctl dispatch workspace e-1"; - }; - "clock" = { - format = - if clock24h == true - then '' {:L%H:%M}'' - else '' {:L%I:%M %p}''; - tooltip = true; - tooltip-format = "{:%A, %d.%B %Y }\n{calendar}"; - }; - "hyprland/window" = { - max-length = 22; - separate-outputs = false; - rewrite = { - "" = " 🙈 No Windows? "; + "clock" = { + format = + if clock24h == true + then '' {:L%H:%M}'' + else '' {:L%I:%M %p}''; + tooltip = true; + tooltip-format = "{:%A, %d.%B %Y }\n{calendar}"; }; - }; - "memory" = { - interval = 5; - format = " {}%"; - tooltip = true; - }; - "cpu" = { - interval = 5; - format = " {usage:2}%"; - tooltip = true; - }; - "disk" = { - format = " {free}"; - tooltip = true; - }; - "network" = { - format-icons = [ - "󰤯" - "󰤟" - "󰤢" - "󰤥" - "󰤨" - ]; - format-ethernet = " {bandwidthDownOctets}"; - format-wifi = "{icon} {signalStrength}%"; - format-disconnected = "󰤮"; - tooltip = false; - }; - "tray" = { - spacing = 12; - }; - "pulseaudio" = { - format = "{icon} {volume}% {format_source}"; - format-bluetooth = "{volume}% {icon} {format_source}"; - format-bluetooth-muted = " {icon} {format_source}"; - format-muted = " {format_source}"; - format-source = " {volume}%"; - format-source-muted = ""; - format-icons = { - headphone = ""; - hands-free = ""; - headset = ""; - phone = ""; - portable = ""; - car = ""; - default = [ - "" - "" - "" + "hyprland/window" = { + max-length = 22; + separate-outputs = false; + rewrite = { + "" = " 🙈 No Windows? "; + }; + }; + "memory" = { + interval = 5; + format = " {}%"; + tooltip = true; + }; + "cpu" = { + interval = 5; + format = " {usage:2}%"; + tooltip = true; + }; + "disk" = { + format = " {free}"; + tooltip = true; + }; + "network" = { + format-icons = [ + "󰤯" + "󰤟" + "󰤢" + "󰤥" + "󰤨" ]; + format-ethernet = " {bandwidthDownOctets}"; + format-wifi = "{icon} {signalStrength}%"; + format-disconnected = "󰤮"; + tooltip = false; }; - on-click = "sleep 0.1 && pavucontrol"; - }; - "custom/exit" = { - tooltip = false; - format = ""; - on-click = "sleep 0.1 && wlogout"; - }; - "custom/startmenu" = { - tooltip = false; - format = ""; - # exec = "rofi -show drun"; - #on-click = "sleep 0.1 && rofi-launcher"; - on-click = "sleep 0.1 && nwg-drawer -mb 200 -mt 200 -mr 200 -ml 200"; - }; - "custom/hyprbindings" = { - tooltip = false; - format = "󱕴"; - on-click = "sleep 0.1 && list-keybinds"; - }; - "idle_inhibitor" = { - format = "{icon}"; - format-icons = { - activated = ""; - deactivated = ""; + "tray" = { + spacing = 12; }; - tooltip = "true"; - }; - "custom/notification" = { - tooltip = false; - format = "{icon} {}"; - format-icons = { - notification = ""; - none = ""; - dnd-notification = ""; - dnd-none = ""; - inhibited-notification = ""; - inhibited-none = ""; - dnd-inhibited-notification = ""; - dnd-inhibited-none = ""; + "pulseaudio" = { + format = "{icon} {volume}% {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-muted = " {format_source}"; + format-source = " {volume}%"; + format-source-muted = ""; + format-icons = { + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + portable = ""; + car = ""; + default = [ + "" + "" + "" + ]; + }; + on-click = "sleep 0.1 && pavucontrol"; }; - return-type = "json"; - exec-if = "which swaync-client"; - exec = "swaync-client -swb"; - on-click = "sleep 0.1 && task-waybar"; - escape = true; - }; - "battery" = { - states = { - warning = 30; - critical = 15; + "custom/exit" = { + tooltip = false; + format = ""; + on-click = "sleep 0.1 && wlogout"; + }; + "custom/startmenu" = { + tooltip = false; + format = ""; + # exec = "rofi -show drun"; + #on-click = "sleep 0.1 && rofi-launcher"; + on-click = "sleep 0.1 && nwg-drawer -mb 200 -mt 200 -mr 200 -ml 200"; + }; + "custom/hyprbindings" = { + tooltip = false; + format = "󱕴"; + on-click = "sleep 0.1 && list-keybinds"; + }; + "idle_inhibitor" = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + tooltip = "true"; + }; + "custom/notification" = { + tooltip = false; + format = "{icon} {}"; + format-icons = { + notification = ""; + none = ""; + dnd-notification = ""; + dnd-none = ""; + inhibited-notification = ""; + inhibited-none = ""; + dnd-inhibited-notification = ""; + dnd-inhibited-none = ""; + }; + return-type = "json"; + exec-if = "which swaync-client"; + exec = "swaync-client -swb"; + on-click = "sleep 0.1 && task-waybar"; + escape = true; + }; + "battery" = { + states = { + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-charging = "󰂄 {capacity}%"; + format-plugged = "󱘖 {capacity}%"; + format-icons = [ + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + on-click = ""; + tooltip = false; }; - format = "{icon} {capacity}%"; - format-charging = "󰂄 {capacity}%"; - format-plugged = "󱘖 {capacity}%"; - format-icons = [ - "󰁺" - "󰁻" - "󰁼" - "󰁽" - "󰁾" - "󰁿" - "󰂀" - "󰂁" - "󰂂" - "󰁹" - ]; - on-click = ""; - tooltip = false; - }; - } - ]; - style = concatStrings [ - '' - * { - font-family: JetBrainsMono Nerd Font Mono; - font-size: 18px; - border-radius: 0px; - border: none; - min-height: 0px; } - window#waybar { - background: rgba(0,0,0,0); - } - #workspaces { - color: #${config.lib.stylix.colors.base00}; - background: #${config.lib.stylix.colors.base01}; - margin: 4px 4px; - padding: 5px 5px; - border-radius: 16px; - } - #workspaces button { - font-weight: bold; - padding: 0px 5px; - margin: 0px 3px; - border-radius: 16px; - color: #${config.lib.stylix.colors.base00}; - background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); - opacity: 0.5; - transition: ${betterTransition}; - } - #workspaces button.active { - font-weight: bold; - padding: 0px 5px; - margin: 0px 3px; - border-radius: 16px; - color: #${config.lib.stylix.colors.base00}; - background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); - transition: ${betterTransition}; - opacity: 1.0; - min-width: 40px; - } - #workspaces button:hover { - font-weight: bold; - border-radius: 16px; - color: #${config.lib.stylix.colors.base00}; - background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); - opacity: 0.8; - transition: ${betterTransition}; - } - tooltip { - background: #${config.lib.stylix.colors.base00}; - border: 1px solid #${config.lib.stylix.colors.base08}; - border-radius: 12px; - } - tooltip label { - color: #${config.lib.stylix.colors.base08}; - } - #window, #pulseaudio, #cpu, #memory, #idle_inhibitor { - font-weight: bold; - margin: 4px 0px; - margin-left: 7px; - padding: 0px 18px; - background: #${config.lib.stylix.colors.base00}; - color: #${config.lib.stylix.colors.base08}; - border-radius: 8px 8px 8px 8px; - } - #idle_inhibitor { - font-size: 28px; - } - #custom-startmenu { - color: #${config.lib.stylix.colors.base0B}; - background: #${config.lib.stylix.colors.base02}; - font-size: 22px; - margin: 0px; - padding: 0px 5px 0px 5px; - border-radius: 16px 16px 16px 16px; - } - #custom-hyprbindings, #network, #battery, - #custom-notification, #tray, #custom-exit { - /* font-weight: bold; */ - font-size: 20px; - background: #${config.lib.stylix.colors.base00}; - color: #${config.lib.stylix.colors.base08}; - margin: 4px 0px; - margin-right: 7px; - border-radius: 8px 8px 8px 8px; - padding: 0px 18px; - } - #clock { - font-weight: bold; - font-size: 16px; - color: #0D0E15; - background: linear-gradient(90deg, #${config.lib.stylix.colors.base0B}, #${config.lib.stylix.colors.base02}); - margin: 0px; - padding: 0px 5px 0px 5px; - border-radius: 16px 16px 16px 16px; - } - '' - ]; - }; -} + ]; + style = concatStrings [ + '' + * { + font-family: JetBrainsMono Nerd Font Mono; + font-size: 18px; + border-radius: 0px; + border: none; + min-height: 0px; + } + window#waybar { + background: rgba(0,0,0,0); + } + #workspaces { + color: #${config.lib.stylix.colors.base00}; + background: #${config.lib.stylix.colors.base01}; + margin: 4px 4px; + padding: 5px 5px; + border-radius: 16px; + } + #workspaces button { + font-weight: bold; + padding: 0px 5px; + margin: 0px 3px; + border-radius: 16px; + color: #${config.lib.stylix.colors.base00}; + background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); + opacity: 0.5; + transition: ${betterTransition}; + } + #workspaces button.active { + font-weight: bold; + padding: 0px 5px; + margin: 0px 3px; + border-radius: 16px; + color: #${config.lib.stylix.colors.base00}; + background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); + transition: ${betterTransition}; + opacity: 1.0; + min-width: 40px; + } + #workspaces button:hover { + font-weight: bold; + border-radius: 16px; + color: #${config.lib.stylix.colors.base00}; + background: linear-gradient(45deg, #${config.lib.stylix.colors.base08}, #${config.lib.stylix.colors.base0D}); + opacity: 0.8; + transition: ${betterTransition}; + } + tooltip { + background: #${config.lib.stylix.colors.base00}; + border: 1px solid #${config.lib.stylix.colors.base08}; + border-radius: 12px; + } + tooltip label { + color: #${config.lib.stylix.colors.base08}; + } + #window, #pulseaudio, #cpu, #memory, #idle_inhibitor { + font-weight: bold; + margin: 4px 0px; + margin-left: 7px; + padding: 0px 18px; + background: #${config.lib.stylix.colors.base00}; + color: #${config.lib.stylix.colors.base08}; + border-radius: 8px 8px 8px 8px; + } + #idle_inhibitor { + font-size: 28px; + } + #custom-startmenu { + color: #${config.lib.stylix.colors.base0B}; + background: #${config.lib.stylix.colors.base02}; + font-size: 22px; + margin: 0px; + padding: 0px 5px 0px 5px; + border-radius: 16px 16px 16px 16px; + } + #custom-hyprbindings, #network, #battery, + #custom-notification, #tray, #custom-exit { + /* font-weight: bold; */ + font-size: 20px; + background: #${config.lib.stylix.colors.base00}; + color: #${config.lib.stylix.colors.base08}; + margin: 4px 0px; + margin-right: 7px; + border-radius: 8px 8px 8px 8px; + padding: 0px 18px; + } + #clock { + font-weight: bold; + font-size: 16px; + color: #0D0E15; + background: linear-gradient(90deg, #${config.lib.stylix.colors.base0B}, #${config.lib.stylix.colors.base02}); + margin: 0px; + padding: 0px 5px 0px 5px; + border-radius: 16px 16px 16px 16px; + } + '' + ]; + }; + } diff --git a/modules/home/waybar/waybar-dwm-2.nix b/modules/home/waybar/waybar-dwm-2.nix index 862f609..2ec4d4e 100644 --- a/modules/home/waybar/waybar-dwm-2.nix +++ b/modules/home/waybar/waybar-dwm-2.nix @@ -477,4 +477,3 @@ ''; }; } - diff --git a/modules/home/waybar/waybar-jerry.nix b/modules/home/waybar/waybar-jerry.nix index 96e3c1f..3d9890b 100644 --- a/modules/home/waybar/waybar-jerry.nix +++ b/modules/home/waybar/waybar-jerry.nix @@ -1,9 +1,9 @@ -{ pkgs -, config -, lib -, ... -}: -let +{ + pkgs, + config, + lib, + ... +}: let terminal = "kitty"; base00 = "0F1419"; base01 = "131721"; @@ -20,337 +20,337 @@ let base0E = "D2A6FF"; base0F = "E6B673"; in -with lib; { - # Configure & Theme Waybar - programs.waybar = { - enable = true; - package = pkgs.waybar; - settings = [ - { - layer = "top"; - position = "top"; + with lib; { + # Configure & Theme Waybar + programs.waybar = { + enable = true; + package = pkgs.waybar; + settings = [ + { + layer = "top"; + position = "top"; - modules-center = [ "network" "pulseaudio" "cpu" "hyprland/workspaces" "memory" "disk" "clock" ]; # Eterna: [ "hyprland/window" ] - modules-left = [ "custom/startmenu" "hyprland/window" ]; # Eternal: [ "hyprland/workspaces" "cpu" "memory" "network" ] - modules-right = [ "tray" "idle_inhibitor" "custom/notification" "battery" "custom/exit" ]; # Eternal: [ "idle_inhibitor" "pulseaudio" "clock" "custom/notification" "tray" ] + modules-center = ["network" "pulseaudio" "cpu" "hyprland/workspaces" "memory" "disk" "clock"]; # Eterna: [ "hyprland/window" ] + modules-left = ["custom/startmenu" "hyprland/window"]; # Eternal: [ "hyprland/workspaces" "cpu" "memory" "network" ] + modules-right = ["tray" "idle_inhibitor" "custom/notification" "battery" "custom/exit"]; # Eternal: [ "idle_inhibitor" "pulseaudio" "clock" "custom/notification" "tray" ] - "hyprland/workspaces" = { - format = "{name}"; - format-icons = { - default = " "; - active = " "; - urgent = " "; + "hyprland/workspaces" = { + format = "{name}"; + format-icons = { + default = " "; + active = " "; + urgent = " "; + }; + on-scroll-up = "hyprctl dispatch workspace e+1"; + on-scroll-down = "hyprctl dispatch workspace e-1"; }; - on-scroll-up = "hyprctl dispatch workspace e+1"; - on-scroll-down = "hyprctl dispatch workspace e-1"; - }; - "clock" = { - format = '' {:%H:%M}''; - /* + "clock" = { + format = '' {:%H:%M}''; + /* ''{: %I:%M %p}''; */ - tooltip = true; - tooltip-format = "{:%A, %d.%B %Y }{calendar}"; - }; - "hyprland/window" = { - max-length = 60; - separate-outputs = false; - }; - "memory" = { - interval = 5; - format = " {}%"; - tooltip = true; - on-click = "${terminal} -e btop"; - }; - "cpu" = { - interval = 5; - format = " {usage:2}%"; - tooltip = true; - on-click = "${terminal} -e btop"; - }; - "disk" = { - format = " {free}"; - tooltip = true; - # Not working with zaneyos window open then closes - #on-click = "${terminal} -e sh -c df -h ; read"; - }; - "network" = { - format-icons = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ]; - format-ethernet = " {bandwidthDownBits}"; - format-wifi = " {bandwidthDownBits}"; - format-disconnected = "󰤮"; - tooltip = false; - on-click = "${terminal} -e btop"; - }; - "tray" = { - spacing = 12; - }; - "pulseaudio" = { - format = "{icon} {volume}% {format_source}"; - format-bluetooth = "{volume}% {icon} {format_source}"; - format-bluetooth-muted = " {icon} {format_source}"; - format-muted = " {format_source}"; - format-source = " {volume}%"; - format-source-muted = ""; - format-icons = { - headphone = ""; - hands-free = ""; - headset = ""; - phone = ""; - portable = ""; - car = ""; - default = [ "" "" "" ]; + tooltip = true; + tooltip-format = "{:%A, %d.%B %Y }{calendar}"; }; - on-click = "pavucontrol"; - }; - "custom/exit" = { - tooltip = false; - format = "⏻"; - on-click = "sleep 0.1 && wlogout"; - }; - "custom/startmenu" = { - tooltip = false; - format = " "; - # exec = "rofi -show drun"; - on-click = "rofi -show drun"; - }; - "idle_inhibitor" = { - format = "{icon}"; - format-icons = { - activated = " "; - deactivated = " "; + "hyprland/window" = { + max-length = 60; + separate-outputs = false; }; - tooltip = "true"; - }; - "custom/notification" = { - tooltip = false; - format = "{icon} {}"; - format-icons = { - notification = ""; - none = ""; - dnd-notification = ""; - dnd-none = ""; - inhibited-notification = ""; - inhibited-none = ""; - dnd-inhibited-notification = ""; - dnd-inhibited-none = ""; + "memory" = { + interval = 5; + format = " {}%"; + tooltip = true; + on-click = "${terminal} -e btop"; }; - return-type = "json"; - exec-if = "which swaync-client"; - exec = "swaync-client -swb"; - on-click = "swaync-client -t"; - escape = true; - }; - "battery" = { - states = { - warning = 30; - critical = 15; + "cpu" = { + interval = 5; + format = " {usage:2}%"; + tooltip = true; + on-click = "${terminal} -e btop"; + }; + "disk" = { + format = " {free}"; + tooltip = true; + # Not working with zaneyos window open then closes + #on-click = "${terminal} -e sh -c df -h ; read"; + }; + "network" = { + format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"]; + format-ethernet = " {bandwidthDownBits}"; + format-wifi = " {bandwidthDownBits}"; + format-disconnected = "󰤮"; + tooltip = false; + on-click = "${terminal} -e btop"; + }; + "tray" = { + spacing = 12; + }; + "pulseaudio" = { + format = "{icon} {volume}% {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-muted = " {format_source}"; + format-source = " {volume}%"; + format-source-muted = ""; + format-icons = { + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + portable = ""; + car = ""; + default = ["" "" ""]; + }; + on-click = "pavucontrol"; + }; + "custom/exit" = { + tooltip = false; + format = "⏻"; + on-click = "sleep 0.1 && wlogout"; + }; + "custom/startmenu" = { + tooltip = false; + format = " "; + # exec = "rofi -show drun"; + on-click = "rofi -show drun"; + }; + "idle_inhibitor" = { + format = "{icon}"; + format-icons = { + activated = " "; + deactivated = " "; + }; + tooltip = "true"; + }; + "custom/notification" = { + tooltip = false; + format = "{icon} {}"; + format-icons = { + notification = ""; + none = ""; + dnd-notification = ""; + dnd-none = ""; + inhibited-notification = ""; + inhibited-none = ""; + dnd-inhibited-notification = ""; + dnd-inhibited-none = ""; + }; + return-type = "json"; + exec-if = "which swaync-client"; + exec = "swaync-client -swb"; + on-click = "swaync-client -t"; + escape = true; + }; + "battery" = { + states = { + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-charging = "󰂄 {capacity}%"; + format-plugged = "󱘖 {capacity}%"; + format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; + on-click = ""; + tooltip = false; }; - format = "{icon} {capacity}%"; - format-charging = "󰂄 {capacity}%"; - format-plugged = "󱘖 {capacity}%"; - format-icons = [ "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ]; - on-click = ""; - tooltip = false; - }; - } - ]; - style = concatStrings [ - '' - * { - font-size: 16px; - font-family: JetBrainsMono Nerd Font, Font Awesome, sans-serif; - font-weight: bold; } - window#waybar { - /* + ]; + style = concatStrings [ + '' + * { + font-size: 16px; + font-family: JetBrainsMono Nerd Font, Font Awesome, sans-serif; + font-weight: bold; + } + window#waybar { + /* + + background-color: rgba(26,27,38,0); + border-bottom: 1px solid rgba(26,27,38,0); + border-radius: 0px; + color: #${base0F}; + */ background-color: rgba(26,27,38,0); border-bottom: 1px solid rgba(26,27,38,0); border-radius: 0px; color: #${base0F}; - */ - - background-color: rgba(26,27,38,0); - border-bottom: 1px solid rgba(26,27,38,0); - border-radius: 0px; - color: #${base0F}; - } - #workspaces { - /* - Eternal - background: linear-gradient(180deg, #${base00}, #${base01}); - margin: 5px 5px 5px 0px; - padding: 0px 10px; - border-radius: 0px 15px 50px 0px; + } + #workspaces { + /* + Eternal + background: linear-gradient(180deg, #${base00}, #${base01}); + margin: 5px 5px 5px 0px; + padding: 0px 10px; + border-radius: 0px 15px 50px 0px; + border: 0px; + font-style: normal; + color: #${base00}; + */ + background: linear-gradient(45deg, #${base01}, #${base01}); + margin: 5px; + padding: 0px 1px; + border-radius: 15px; border: 0px; font-style: normal; color: #${base00}; - */ - background: linear-gradient(45deg, #${base01}, #${base01}); - margin: 5px; - padding: 0px 1px; - border-radius: 15px; - border: 0px; - font-style: normal; - color: #${base00}; - } - #workspaces button { - padding: 0px 5px; - margin: 4px 3px; - border-radius: 15px; - border: 0px; - color: #${base00}; - background: linear-gradient(45deg, #${base0D}, #${base0E}); - opacity: 0.5; - transition: all 0.3s ease-in-out; - } - #workspaces button.active { - padding: 0px 5px; - margin: 4px 3px; - border-radius: 15px; - border: 0px; - color: #${base00}; - background: linear-gradient(45deg, #${base0D}, #${base0E}); - opacity: 1.0; - min-width: 40px; - transition: all 0.3s ease-in-out; - } - #workspaces button:hover { - border-radius: 15px; - color: #${base00}; - background: linear-gradient(45deg, #${base0D}, #${base0E}); - opacity: 0.8; - } - tooltip { - background: #${base00}; - border: 1px solid #${base0E}; - border-radius: 10px; - } - tooltip label { - color: #${base07}; - } - #window { - /* - Eternal + } + #workspaces button { + padding: 0px 5px; + margin: 4px 3px; + border-radius: 15px; + border: 0px; + color: #${base00}; + background: linear-gradient(45deg, #${base0D}, #${base0E}); + opacity: 0.5; + transition: all 0.3s ease-in-out; + } + #workspaces button.active { + padding: 0px 5px; + margin: 4px 3px; + border-radius: 15px; + border: 0px; + color: #${base00}; + background: linear-gradient(45deg, #${base0D}, #${base0E}); + opacity: 1.0; + min-width: 40px; + transition: all 0.3s ease-in-out; + } + #workspaces button:hover { + border-radius: 15px; + color: #${base00}; + background: linear-gradient(45deg, #${base0D}, #${base0E}); + opacity: 0.8; + } + tooltip { + background: #${base00}; + border: 1px solid #${base0E}; + border-radius: 10px; + } + tooltip label { + color: #${base07}; + } + #window { + /* + Eternal + color: #${base05}; + background: #${base00}; + border-radius: 15px; + margin: 5px; + padding: 2px 20px; + */ + margin: 5px; + padding: 2px 20px; + color: #${base05}; + background: #${base01}; + border-radius: 50px 15px 50px 15px; + } + #memory { + color: #${base0F}; + /* + Eternal + background: #${base00}; + border-radius: 50px 15px 50px 15px; + margin: 5px; + padding: 2px 20px; + */ + background: #${base01}; + margin: 5px; + padding: 2px 20px; + border-radius: 15px 50px 15px 50px; + } + #clock { + color: #${base0B}; + background: #${base00}; + border-radius: 15px 50px 15px 50px; + margin: 5px; + padding: 2px 20px; + } + #idle_inhibitor { + color: #${base0A}; + background: #${base00}; + border-radius: 50px 15px 50px 15px; + margin: 5px; + padding: 2px 20px; + } + #cpu { + color: #${base07}; + background: #${base00}; + border-radius: 50px 15px 50px 15px; + margin: 5px; + padding: 2px 20px; + } + #disk { + color: #${base0F}; + background: #${base00}; + border-radius: 15px 50px 15px 50px; + margin: 5px; + padding: 2px 20px; + } + #battery { + color: #${base08}; + background: #${base00}; + border-radius: 15px 50px 15px 50px; + margin: 5px; + padding: 2px 20px; + } + #network { + color: #${base09}; + background: #${base00}; + border-radius: 50px 15px 50px 15px; + margin: 5px; + padding: 2px 20px; + } + #tray { color: #${base05}; background: #${base00}; - border-radius: 15px; + border-radius: 15px 50px 15px 50px; margin: 5px; padding: 2px 20px; - */ - margin: 5px; - padding: 2px 20px; - color: #${base05}; - background: #${base01}; - border-radius: 50px 15px 50px 15px; - } - #memory { - color: #${base0F}; - /* - Eternal - background: #${base00}; + } + #pulseaudio { + color: #${base0D}; + /* + Eternal + background: #${base00}; + border-radius: 15px 50px 15px 50px; + margin: 5px; + padding: 2px 20px; + */ + background: #${base01}; + margin: 4px; + padding: 2px 20px; border-radius: 50px 15px 50px 15px; - margin: 5px; - padding: 2px 20px; - */ - background: #${base01}; - margin: 5px; - padding: 2px 20px; - border-radius: 15px 50px 15px 50px; - } - #clock { - color: #${base0B}; + } + #custom-notification { + color: #${base0C}; background: #${base00}; border-radius: 15px 50px 15px 50px; margin: 5px; padding: 2px 20px; - } - #idle_inhibitor { - color: #${base0A}; + } + #custom-startmenu { + color: #${base0E}; background: #${base00}; - border-radius: 50px 15px 50px 15px; - margin: 5px; + border-radius: 0px 15px 50px 0px; + margin: 5px 5px 5px 0px; padding: 2px 20px; - } - #cpu { - color: #${base07}; - background: #${base00}; - border-radius: 50px 15px 50px 15px; - margin: 5px; - padding: 2px 20px; - } - #disk { - color: #${base0F}; + } + #idle_inhibitor { + color: #${base09}; background: #${base00}; border-radius: 15px 50px 15px 50px; margin: 5px; padding: 2px 20px; - } - #battery { - color: #${base08}; - background: #${base00}; - border-radius: 15px 50px 15px 50px; - margin: 5px; - padding: 2px 20px; - } - #network { - color: #${base09}; - background: #${base00}; - border-radius: 50px 15px 50px 15px; - margin: 5px; - padding: 2px 20px; - } - #tray { - color: #${base05}; - background: #${base00}; - border-radius: 15px 50px 15px 50px; - margin: 5px; - padding: 2px 20px; - } - #pulseaudio { - color: #${base0D}; - /* - Eternal + } + #custom-exit { + color: #${base0E}; background: #${base00}; - border-radius: 15px 50px 15px 50px; - margin: 5px; + border-radius: 15px 0px 0px 50px; + margin: 5px 0px 5px 5px; padding: 2px 20px; - */ - background: #${base01}; - margin: 4px; - padding: 2px 20px; - border-radius: 50px 15px 50px 15px; - } - #custom-notification { - color: #${base0C}; - background: #${base00}; - border-radius: 15px 50px 15px 50px; - margin: 5px; - padding: 2px 20px; - } - #custom-startmenu { - color: #${base0E}; - background: #${base00}; - border-radius: 0px 15px 50px 0px; - margin: 5px 5px 5px 0px; - padding: 2px 20px; - } - #idle_inhibitor { - color: #${base09}; - background: #${base00}; - border-radius: 15px 50px 15px 50px; - margin: 5px; - padding: 2px 20px; - } - #custom-exit { - color: #${base0E}; - background: #${base00}; - border-radius: 15px 0px 0px 50px; - margin: 5px 0px 5px 5px; - padding: 2px 20px; - } - '' - ]; - }; -} + } + '' + ]; + }; + } diff --git a/modules/home/waybar/waybar-nekodyke.nix b/modules/home/waybar/waybar-nekodyke.nix index 0a9988e..11aebd0 100755 --- a/modules/home/waybar/waybar-nekodyke.nix +++ b/modules/home/waybar/waybar-nekodyke.nix @@ -1,306 +1,306 @@ -{ pkgs -, lib -, host -, config -, ... -}: -let +{ + pkgs, + lib, + host, + config, + ... +}: let betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)"; inherit (import ../../../hosts/${host}/variables.nix) clock24h; in -with lib; { - # Configure & Theme Waybar - programs.waybar = { - enable = true; - package = pkgs.waybar; - settings = [ - { - layer = "top"; - position = "top"; - margin-top = 6; - margin-left = 6; - margin-right = 6; - modules-center = [ "hyprland/workspaces" ]; - modules-left = [ - "custom/startmenu" - "cpu" - "memory" - "temperature" - "disk" - "hyprland/window" - "idle_inhibitor" - ]; - modules-right = [ - "pulseaudio" - "battery" - "custom/hyprbindings" - "custom/notification" - "clock" - "tray" - ]; - - "hyprland/workspaces" = { - format = "{name}"; - format-icons = { - default = " "; - active = " "; - urgent = " "; - }; - on-scroll-up = "hyprctl dispatch workspace e+1"; - on-scroll-down = "hyprctl dispatch workspace e-1"; - }; - "pulseaudio/slider" = { - min = 0; - max = 100; - orientation = "horizontal"; - }; - "temperature" = { - format = " {temperatureC}°C "; - }; - "clock" = { - format = - if clock24h == true - then '' {:L%H:%M}'' - else '' {:L%I:%M %p}''; - tooltip = true; - tooltip-format = "{:%A, %d.%B %Y }\n{calendar}"; - }; - "hyprland/window" = { - max-length = 22; - separate-outputs = false; - rewrite = { - "" = " 🙈 No Windows? "; - }; - }; - "memory" = { - interval = 5; - icon-size = 20; - format = " {}%"; - tooltip = true; - }; - "cpu" = { - interval = 5; - format = " {usage:2}%"; - tooltip = true; - }; - "disk" = { - format = "󱛟 {free}"; - tooltip = true; - }; - "network" = { - format-icons = [ - "󰤯" - "󰤟" - "󰤢" - "󰤥" - "󰤨" + with lib; { + # Configure & Theme Waybar + programs.waybar = { + enable = true; + package = pkgs.waybar; + settings = [ + { + layer = "top"; + position = "top"; + margin-top = 6; + margin-left = 6; + margin-right = 6; + modules-center = ["hyprland/workspaces"]; + modules-left = [ + "custom/startmenu" + "cpu" + "memory" + "temperature" + "disk" + "hyprland/window" + "idle_inhibitor" ]; - format-ethernet = " {bandwidthDownOctets}"; - format-wifi = "{icon} {signalStrength}%"; - format-disconnected = "󰤮"; - tooltip = false; - }; - "tray" = { - spacing = 12; - }; - "pulseaudio" = { - format = "{icon} {volume}% {format_source}"; - format-bluetooth = "{volume}% {icon} {format_source}"; - format-bluetooth-muted = " {icon} {format_source}"; - format-muted = " {format_source}"; - format-source = " {volume}%"; - format-source-muted = ""; - format-icons = { - headphone = ""; - hands-free = ""; - headset = ""; - phone = ""; - portable = ""; - car = ""; - default = [ - "" - "" - "" + modules-right = [ + "pulseaudio" + "battery" + "custom/hyprbindings" + "custom/notification" + "clock" + "tray" + ]; + + "hyprland/workspaces" = { + format = "{name}"; + format-icons = { + default = " "; + active = " "; + urgent = " "; + }; + on-scroll-up = "hyprctl dispatch workspace e+1"; + on-scroll-down = "hyprctl dispatch workspace e-1"; + }; + "pulseaudio/slider" = { + min = 0; + max = 100; + orientation = "horizontal"; + }; + "temperature" = { + format = " {temperatureC}°C "; + }; + "clock" = { + format = + if clock24h == true + then '' {:L%H:%M}'' + else '' {:L%I:%M %p}''; + tooltip = true; + tooltip-format = "{:%A, %d.%B %Y }\n{calendar}"; + }; + "hyprland/window" = { + max-length = 22; + separate-outputs = false; + rewrite = { + "" = " 🙈 No Windows? "; + }; + }; + "memory" = { + interval = 5; + icon-size = 20; + format = " {}%"; + tooltip = true; + }; + "cpu" = { + interval = 5; + format = " {usage:2}%"; + tooltip = true; + }; + "disk" = { + format = "󱛟 {free}"; + tooltip = true; + }; + "network" = { + format-icons = [ + "󰤯" + "󰤟" + "󰤢" + "󰤥" + "󰤨" ]; + format-ethernet = " {bandwidthDownOctets}"; + format-wifi = "{icon} {signalStrength}%"; + format-disconnected = "󰤮"; + tooltip = false; }; - on-click = "sleep 0.1 && pavucontrol"; - scroll-step = 2; - }; - "custom/exit" = { - tooltip = false; - format = ""; - on-click = "sleep 0.1 && wlogout"; - }; - "custom/startmenu" = { - tooltip = false; - format = ""; - # exec = "rofi -show drun"; - #on-click = "sleep 0.1 && rofi-launcher"; - on-click = "sleep 0.1 && nwg-drawer -mb 200 -mt 200 -mr 200 -ml 200"; - }; - "custom/hyprbindings" = { - tooltip = false; - format = "󱕴"; - on-click = "sleep 0.1 && list-keybinds"; - }; - "idle_inhibitor" = { - format = "{icon}"; - format-icons = { - activated = ""; - deactivated = ""; + "tray" = { + spacing = 12; }; - tooltip = "true"; - }; - "custom/notification" = { - tooltip = false; - format = "{icon} {}"; - format-icons = { - notification = ""; - none = ""; - dnd-notification = ""; - dnd-none = ""; - inhibited-notification = ""; - inhibited-none = ""; - dnd-inhibited-notification = ""; - dnd-inhibited-none = ""; + "pulseaudio" = { + format = "{icon} {volume}% {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-muted = " {format_source}"; + format-source = " {volume}%"; + format-source-muted = ""; + format-icons = { + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + portable = ""; + car = ""; + default = [ + "" + "" + "" + ]; + }; + on-click = "sleep 0.1 && pavucontrol"; + scroll-step = 2; }; - return-type = "json"; - exec-if = "which swaync-client"; - exec = "swaync-client -swb"; - on-click = "sleep 0.1 && task-waybar"; - escape = true; - }; - "battery" = { - states = { - warning = 30; - critical = 15; + "custom/exit" = { + tooltip = false; + format = ""; + on-click = "sleep 0.1 && wlogout"; + }; + "custom/startmenu" = { + tooltip = false; + format = ""; + # exec = "rofi -show drun"; + #on-click = "sleep 0.1 && rofi-launcher"; + on-click = "sleep 0.1 && nwg-drawer -mb 200 -mt 200 -mr 200 -ml 200"; + }; + "custom/hyprbindings" = { + tooltip = false; + format = "󱕴"; + on-click = "sleep 0.1 && list-keybinds"; + }; + "idle_inhibitor" = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + tooltip = "true"; + }; + "custom/notification" = { + tooltip = false; + format = "{icon} {}"; + format-icons = { + notification = ""; + none = ""; + dnd-notification = ""; + dnd-none = ""; + inhibited-notification = ""; + inhibited-none = ""; + dnd-inhibited-notification = ""; + dnd-inhibited-none = ""; + }; + return-type = "json"; + exec-if = "which swaync-client"; + exec = "swaync-client -swb"; + on-click = "sleep 0.1 && task-waybar"; + escape = true; + }; + "battery" = { + states = { + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-charging = "󰂄 {capacity}%"; + format-plugged = "󱘖 {capacity}%"; + format-icons = [ + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + on-click = ""; + tooltip = false; }; - format = "{icon} {capacity}%"; - format-charging = "󰂄 {capacity}%"; - format-plugged = "󱘖 {capacity}%"; - format-icons = [ - "󰁺" - "󰁻" - "󰁼" - "󰁽" - "󰁾" - "󰁿" - "󰂀" - "󰂁" - "󰂂" - "󰁹" - ]; - on-click = ""; - tooltip = false; - }; - } - ]; - style = concatStrings [ - '' - * { - font-family: JetBrainsMono Nerd Font Mono; - font-size: 16px; - border-radius: 0px; - border: none; - min-height: 0px; - margin: 0px; } - window#waybar { - background: #${config.lib.stylix.colors.base00}; - padding: 2px; - border-radius: 4px; - } - #workspaces { - color: #${config.lib.stylix.colors.base00}; - background: #${config.lib.stylix.colors.base00}; - border: 2px solid #${config.lib.stylix.colors.base0B}; - margin: 2px 4px; - padding: 5px 5px; - border-radius: 4px; - } - #workspaces button { - font-weight: bold; - padding: 0px 5px; - margin: 0px 3px; - border-radius: 16px; - color: #${config.lib.stylix.colors.base0B}; - background: #${config.lib.stylix.colors.base00}; + ]; + style = concatStrings [ + '' + * { + font-family: JetBrainsMono Nerd Font Mono; + font-size: 16px; + border-radius: 0px; + border: none; + min-height: 0px; + margin: 0px; + } + window#waybar { + background: #${config.lib.stylix.colors.base00}; + padding: 2px; + border-radius: 4px; + } + #workspaces { + color: #${config.lib.stylix.colors.base00}; + background: #${config.lib.stylix.colors.base00}; + border: 2px solid #${config.lib.stylix.colors.base0B}; + margin: 2px 4px; + padding: 5px 5px; + border-radius: 4px; + } + #workspaces button { + font-weight: bold; + padding: 0px 5px; + margin: 0px 3px; + border-radius: 16px; + color: #${config.lib.stylix.colors.base0B}; + background: #${config.lib.stylix.colors.base00}; - } - #workspaces button.active { - font-weight: bold; - padding: 0px 5px; - margin: 0px 3px; - border-radius: 4px; - color: #${config.lib.stylix.colors.base00}; - background: #${config.lib.stylix.colors.base0B}; - transition: ${betterTransition}; - opacity: 1.0; - min-width: 40px; - } - #workspaces button:hover { - font-weight: bold; - border-radius: 4px; - color: #${config.lib.stylix.colors.base00}; - background: #${config.lib.stylix.colors.base0B}; - opacity: 0.8; - } - tooltip { - background: #${config.lib.stylix.colors.base00}; - border: 1px solid #${config.lib.stylix.colors.base08}; - border-radius: 12px; - } - tooltip label { - color: #${config.lib.stylix.colors.base08}; - } - #window, #pulseaudio, #temperature, #cpu, #memory, #idle_inhibitor, #disk { - font-weight: bold; - margin: 2px 0px; - margin-right: 7px; - padding: 0px 18px; - background: #${config.lib.stylix.colors.base00}; - color: #${config.lib.stylix.colors.base0B}; - border: 2px solid #${config.lib.stylix.colors.base0B}; - border-radius: 4px; - } - #idle_inhibitor { - font-size: 28px; - } - #custom-startmenu { - color: #${config.lib.stylix.colors.base00}; - background: #${config.lib.stylix.colors.base0B}; - font-size: 22px; - padding: 0px 5px 0px 5px; - border-radius: 4px; - padding: 0px 8px; - margin: 0px; - margin-right:7px; + } + #workspaces button.active { + font-weight: bold; + padding: 0px 5px; + margin: 0px 3px; + border-radius: 4px; + color: #${config.lib.stylix.colors.base00}; + background: #${config.lib.stylix.colors.base0B}; + transition: ${betterTransition}; + opacity: 1.0; + min-width: 40px; + } + #workspaces button:hover { + font-weight: bold; + border-radius: 4px; + color: #${config.lib.stylix.colors.base00}; + background: #${config.lib.stylix.colors.base0B}; + opacity: 0.8; + } + tooltip { + background: #${config.lib.stylix.colors.base00}; + border: 1px solid #${config.lib.stylix.colors.base08}; + border-radius: 12px; + } + tooltip label { + color: #${config.lib.stylix.colors.base08}; + } + #window, #pulseaudio, #temperature, #cpu, #memory, #idle_inhibitor, #disk { + font-weight: bold; + margin: 2px 0px; + margin-right: 7px; + padding: 0px 18px; + background: #${config.lib.stylix.colors.base00}; + color: #${config.lib.stylix.colors.base0B}; + border: 2px solid #${config.lib.stylix.colors.base0B}; + border-radius: 4px; + } + #idle_inhibitor { + font-size: 28px; + } + #custom-startmenu { + color: #${config.lib.stylix.colors.base00}; + background: #${config.lib.stylix.colors.base0B}; + font-size: 22px; + padding: 0px 5px 0px 5px; + border-radius: 4px; + padding: 0px 8px; + margin: 0px; + margin-right:7px; - } - #custom-hyprbindings, #network, #battery, - #custom-notification, #clock, #custom-exit { - /* font-weight: bold; */ - font-size: 20px; - background: #${config.lib.stylix.colors.base00}; - color: #${config.lib.stylix.colors.base0B}; - margin: 2px 0px; - margin-right: 7px; - border: 2px solid #${config.lib.stylix.colors.base0B}; - border-radius: 4px; - padding: 0px 12px; - } - #tray{ - font-weight: bold; - font-size: 16px; - margin: 0px; - background: #${config.lib.stylix.colors.base0B}; - color: #${config.lib.stylix.colors.base00}; - border: 2px solid #${config.lib.stylix.colors.base0B}; - padding: 0px 18px; - margin: 0px 0px; - border-radius: 4px; - } - '' - ]; - }; -} + } + #custom-hyprbindings, #network, #battery, + #custom-notification, #clock, #custom-exit { + /* font-weight: bold; */ + font-size: 20px; + background: #${config.lib.stylix.colors.base00}; + color: #${config.lib.stylix.colors.base0B}; + margin: 2px 0px; + margin-right: 7px; + border: 2px solid #${config.lib.stylix.colors.base0B}; + border-radius: 4px; + padding: 0px 12px; + } + #tray{ + font-weight: bold; + font-size: 16px; + margin: 0px; + background: #${config.lib.stylix.colors.base0B}; + color: #${config.lib.stylix.colors.base00}; + border: 2px solid #${config.lib.stylix.colors.base0B}; + padding: 0px 18px; + margin: 0px 0px; + border-radius: 4px; + } + '' + ]; + }; + } diff --git a/modules/home/waybar/waybar-simple.nix b/modules/home/waybar/waybar-simple.nix index 9ffb056..04f1ae0 100644 --- a/modules/home/waybar/waybar-simple.nix +++ b/modules/home/waybar/waybar-simple.nix @@ -1,305 +1,305 @@ -{ pkgs -, lib -, host -, config -, ... -}: -let +{ + pkgs, + lib, + host, + config, + ... +}: let inherit (import ../../../hosts/${host}/variables.nix) clock24h; in -with lib; { - # Configure & Theme Waybar - programs.waybar = { - enable = true; - package = pkgs.waybar; - settings = [ - { - layer = "top"; - position = "top"; - modules-center = [ "hyprland/workspaces" ]; - modules-left = [ - "custom/startmenu" - "custom/arrow6" - "pulseaudio" - "cpu" - "memory" - "idle_inhibitor" - "custom/arrow7" - "hyprland/window" - ]; - modules-right = [ - "custom/arrow4" - "custom/hyprbindings" - "custom/arrow3" - "custom/notification" - "custom/arrow3" - "custom/exit" - "battery" - "custom/arrow2" - "tray" - "custom/arrow1" - "clock" - ]; + with lib; { + # Configure & Theme Waybar + programs.waybar = { + enable = true; + package = pkgs.waybar; + settings = [ + { + layer = "top"; + position = "top"; + modules-center = ["hyprland/workspaces"]; + modules-left = [ + "custom/startmenu" + "custom/arrow6" + "pulseaudio" + "cpu" + "memory" + "idle_inhibitor" + "custom/arrow7" + "hyprland/window" + ]; + modules-right = [ + "custom/arrow4" + "custom/hyprbindings" + "custom/arrow3" + "custom/notification" + "custom/arrow3" + "custom/exit" + "battery" + "custom/arrow2" + "tray" + "custom/arrow1" + "clock" + ]; - "hyprland/workspaces" = { - format = "{name}"; - format-icons = { - default = " "; - active = " "; - urgent = " "; + "hyprland/workspaces" = { + format = "{name}"; + format-icons = { + default = " "; + active = " "; + urgent = " "; + }; + on-scroll-up = "hyprctl dispatch workspace e+1"; + on-scroll-down = "hyprctl dispatch workspace e-1"; }; - on-scroll-up = "hyprctl dispatch workspace e+1"; - on-scroll-down = "hyprctl dispatch workspace e-1"; - }; - "clock" = { - format = - if clock24h == true - then '' {:L%H:%M}'' - else '' {:L%I:%M %p}''; - tooltip = true; - tooltip-format = "{:%A, %d.%B %Y }\n{calendar}"; - }; - "hyprland/window" = { - max-length = 22; - separate-outputs = false; - rewrite = { - "" = " 🙈 No Windows? "; + "clock" = { + format = + if clock24h == true + then '' {:L%H:%M}'' + else '' {:L%I:%M %p}''; + tooltip = true; + tooltip-format = "{:%A, %d.%B %Y }\n{calendar}"; }; - }; - "memory" = { - interval = 5; - format = " {}%"; - tooltip = true; - }; - "cpu" = { - interval = 5; - format = " {usage:2}%"; - tooltip = true; - }; - "disk" = { - format = " {free}"; - tooltip = true; - }; - "network" = { - format-icons = [ - "󰤯" - "󰤟" - "󰤢" - "󰤥" - "󰤨" - ]; - format-ethernet = " {bandwidthDownOctets}"; - format-wifi = "{icon} {signalStrength}%"; - format-disconnected = "󰤮"; - tooltip = false; - }; - "tray" = { - spacing = 12; - }; - "pulseaudio" = { - format = "{icon} {volume}% {format_source}"; - format-bluetooth = "{volume}% {icon} {format_source}"; - format-bluetooth-muted = " {icon} {format_source}"; - format-muted = " {format_source}"; - format-source = " {volume}%"; - format-source-muted = ""; - format-icons = { - headphone = ""; - hands-free = ""; - headset = ""; - phone = ""; - portable = ""; - car = ""; - default = [ - "" - "" - "" + "hyprland/window" = { + max-length = 22; + separate-outputs = false; + rewrite = { + "" = " 🙈 No Windows? "; + }; + }; + "memory" = { + interval = 5; + format = " {}%"; + tooltip = true; + }; + "cpu" = { + interval = 5; + format = " {usage:2}%"; + tooltip = true; + }; + "disk" = { + format = " {free}"; + tooltip = true; + }; + "network" = { + format-icons = [ + "󰤯" + "󰤟" + "󰤢" + "󰤥" + "󰤨" ]; + format-ethernet = " {bandwidthDownOctets}"; + format-wifi = "{icon} {signalStrength}%"; + format-disconnected = "󰤮"; + tooltip = false; }; - on-click = "sleep 0.1 && pavucontrol"; - }; - "custom/exit" = { - tooltip = false; - format = ""; - on-click = "sleep 0.1 && wlogout"; - }; - "custom/startmenu" = { - tooltip = false; - format = ""; - on-click = "sleep 0.1 && rofi-launcher"; - }; - "custom/hyprbindings" = { - tooltip = false; - format = "󱕴"; - on-click = "sleep 0.1 && list-keybinds"; - }; - "idle_inhibitor" = { - format = "{icon}"; - format-icons = { - activated = ""; - deactivated = ""; + "tray" = { + spacing = 12; }; - tooltip = "true"; - }; - "custom/notification" = { - tooltip = false; - format = "{icon} {}"; - format-icons = { - notification = ""; - none = ""; - dnd-notification = ""; - dnd-none = ""; - inhibited-notification = ""; - inhibited-none = ""; - dnd-inhibited-notification = ""; - dnd-inhibited-none = ""; + "pulseaudio" = { + format = "{icon} {volume}% {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-muted = " {format_source}"; + format-source = " {volume}%"; + format-source-muted = ""; + format-icons = { + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + portable = ""; + car = ""; + default = [ + "" + "" + "" + ]; + }; + on-click = "sleep 0.1 && pavucontrol"; }; - return-type = "json"; - exec-if = "which swaync-client"; - exec = "swaync-client -swb"; - on-click = "sleep 0.1 && task-waybar"; - escape = true; - }; - "battery" = { - states = { - warning = 30; - critical = 15; + "custom/exit" = { + tooltip = false; + format = ""; + on-click = "sleep 0.1 && wlogout"; + }; + "custom/startmenu" = { + tooltip = false; + format = ""; + on-click = "sleep 0.1 && rofi-launcher"; + }; + "custom/hyprbindings" = { + tooltip = false; + format = "󱕴"; + on-click = "sleep 0.1 && list-keybinds"; + }; + "idle_inhibitor" = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + tooltip = "true"; + }; + "custom/notification" = { + tooltip = false; + format = "{icon} {}"; + format-icons = { + notification = ""; + none = ""; + dnd-notification = ""; + dnd-none = ""; + inhibited-notification = ""; + inhibited-none = ""; + dnd-inhibited-notification = ""; + dnd-inhibited-none = ""; + }; + return-type = "json"; + exec-if = "which swaync-client"; + exec = "swaync-client -swb"; + on-click = "sleep 0.1 && task-waybar"; + escape = true; + }; + "battery" = { + states = { + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-charging = "󰂄 {capacity}%"; + format-plugged = "󱘖 {capacity}%"; + format-icons = [ + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + on-click = ""; + tooltip = false; + }; + "custom/arrow1" = { + format = ""; + }; + "custom/arrow2" = { + format = ""; + }; + "custom/arrow3" = { + format = ""; + }; + "custom/arrow4" = { + format = ""; + }; + "custom/arrow5" = { + format = ""; + }; + "custom/arrow6" = { + format = ""; + }; + "custom/arrow7" = { + format = ""; }; - format = "{icon} {capacity}%"; - format-charging = "󰂄 {capacity}%"; - format-plugged = "󱘖 {capacity}%"; - format-icons = [ - "󰁺" - "󰁻" - "󰁼" - "󰁽" - "󰁾" - "󰁿" - "󰂀" - "󰂁" - "󰂂" - "󰁹" - ]; - on-click = ""; - tooltip = false; - }; - "custom/arrow1" = { - format = ""; - }; - "custom/arrow2" = { - format = ""; - }; - "custom/arrow3" = { - format = ""; - }; - "custom/arrow4" = { - format = ""; - }; - "custom/arrow5" = { - format = ""; - }; - "custom/arrow6" = { - format = ""; - }; - "custom/arrow7" = { - format = ""; - }; - } - ]; - style = concatStrings [ - '' - * { - font-family: JetBrainsMono Nerd Font Mono; - font-size: 14px; - border-radius: 0px; - border: none; - min-height: 0px; } - window#waybar { - background: #${config.lib.stylix.colors.base00}; - color: #${config.lib.stylix.colors.base05}; - } - #workspaces button { - padding: 0px 5px; - background: transparent; - color: #${config.lib.stylix.colors.base04}; - } - #workspaces button.active { - color: #${config.lib.stylix.colors.base08}; - } - #workspaces button:hover { - color: #${config.lib.stylix.colors.base08}; - } - tooltip { - background: #${config.lib.stylix.colors.base00}; - border: 1px solid #${config.lib.stylix.colors.base05}; - border-radius: 12px; - } - tooltip label { - color: #${config.lib.stylix.colors.base05}; - } - #window { - padding: 0px 10px; - } - #pulseaudio, #cpu, #memory, #idle_inhibitor { - padding: 0px 10px; - background: #${config.lib.stylix.colors.base04}; - color: #${config.lib.stylix.colors.base00}; - } - #custom-startmenu { - color: #${config.lib.stylix.colors.base02}; - padding: 0px 14px; - font-size: 20px; - background: #${config.lib.stylix.colors.base0B}; - } - #custom-hyprbindings, #network, #battery, - #custom-notification, #custom-exit { - background: #${config.lib.stylix.colors.base0F}; - color: #${config.lib.stylix.colors.base00}; - padding: 0px 10px; - } - #tray { - background: #${config.lib.stylix.colors.base02}; - color: #${config.lib.stylix.colors.base00}; - padding: 0px 10px; - } - #clock { - font-weight: bold; - padding: 0px 10px; - color: #${config.lib.stylix.colors.base00}; - background: #${config.lib.stylix.colors.base0E}; - } - #custom-arrow1 { - font-size: 24px; - color: #${config.lib.stylix.colors.base0E}; - background: #${config.lib.stylix.colors.base02}; - } - #custom-arrow2 { - font-size: 24px; - color: #${config.lib.stylix.colors.base02}; - background: #${config.lib.stylix.colors.base0F}; - } - #custom-arrow3 { - font-size: 24px; - color: #${config.lib.stylix.colors.base00}; - background: #${config.lib.stylix.colors.base0F}; - } - #custom-arrow4 { - font-size: 24px; - color: #${config.lib.stylix.colors.base0F}; - background: transparent; - } - #custom-arrow6 { - font-size: 24px; - color: #${config.lib.stylix.colors.base0B}; - background: #${config.lib.stylix.colors.base04}; - } - #custom-arrow7 { - font-size: 24px; - color: #${config.lib.stylix.colors.base04}; - background: transparent; - } - '' - ]; - }; -} + ]; + style = concatStrings [ + '' + * { + font-family: JetBrainsMono Nerd Font Mono; + font-size: 14px; + border-radius: 0px; + border: none; + min-height: 0px; + } + window#waybar { + background: #${config.lib.stylix.colors.base00}; + color: #${config.lib.stylix.colors.base05}; + } + #workspaces button { + padding: 0px 5px; + background: transparent; + color: #${config.lib.stylix.colors.base04}; + } + #workspaces button.active { + color: #${config.lib.stylix.colors.base08}; + } + #workspaces button:hover { + color: #${config.lib.stylix.colors.base08}; + } + tooltip { + background: #${config.lib.stylix.colors.base00}; + border: 1px solid #${config.lib.stylix.colors.base05}; + border-radius: 12px; + } + tooltip label { + color: #${config.lib.stylix.colors.base05}; + } + #window { + padding: 0px 10px; + } + #pulseaudio, #cpu, #memory, #idle_inhibitor { + padding: 0px 10px; + background: #${config.lib.stylix.colors.base04}; + color: #${config.lib.stylix.colors.base00}; + } + #custom-startmenu { + color: #${config.lib.stylix.colors.base02}; + padding: 0px 14px; + font-size: 20px; + background: #${config.lib.stylix.colors.base0B}; + } + #custom-hyprbindings, #network, #battery, + #custom-notification, #custom-exit { + background: #${config.lib.stylix.colors.base0F}; + color: #${config.lib.stylix.colors.base00}; + padding: 0px 10px; + } + #tray { + background: #${config.lib.stylix.colors.base02}; + color: #${config.lib.stylix.colors.base00}; + padding: 0px 10px; + } + #clock { + font-weight: bold; + padding: 0px 10px; + color: #${config.lib.stylix.colors.base00}; + background: #${config.lib.stylix.colors.base0E}; + } + #custom-arrow1 { + font-size: 24px; + color: #${config.lib.stylix.colors.base0E}; + background: #${config.lib.stylix.colors.base02}; + } + #custom-arrow2 { + font-size: 24px; + color: #${config.lib.stylix.colors.base02}; + background: #${config.lib.stylix.colors.base0F}; + } + #custom-arrow3 { + font-size: 24px; + color: #${config.lib.stylix.colors.base00}; + background: #${config.lib.stylix.colors.base0F}; + } + #custom-arrow4 { + font-size: 24px; + color: #${config.lib.stylix.colors.base0F}; + background: transparent; + } + #custom-arrow6 { + font-size: 24px; + color: #${config.lib.stylix.colors.base0B}; + background: #${config.lib.stylix.colors.base04}; + } + #custom-arrow7 { + font-size: 24px; + color: #${config.lib.stylix.colors.base04}; + background: transparent; + } + '' + ]; + }; + } diff --git a/modules/home/wlogout/default.nix b/modules/home/wlogout/default.nix index e51de04..efc67e6 100644 --- a/modules/home/wlogout/default.nix +++ b/modules/home/wlogout/default.nix @@ -1,6 +1,4 @@ -{ config, ... }: - -{ +{config, ...}: { programs.wlogout = { enable = true; layout = [ diff --git a/modules/home/xdg.nix b/modules/home/xdg.nix index b485c29..82b4b63 100644 --- a/modules/home/xdg.nix +++ b/modules/home/xdg.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { xdg = { enable = true; mime.enable = true; @@ -7,8 +7,8 @@ }; portal = { enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-hyprland ]; - configPackages = [ pkgs.hyprland ]; + extraPortals = [pkgs.xdg-desktop-portal-hyprland]; + configPackages = [pkgs.hyprland]; }; }; } diff --git a/modules/home/yazi/default.nix b/modules/home/yazi/default.nix index 2b758e2..9364039 100644 --- a/modules/home/yazi/default.nix +++ b/modules/home/yazi/default.nix @@ -1,10 +1,8 @@ -{ pkgs, ... }: -let +{pkgs, ...}: let settings = import ./yazi.nix; keymap = import ./keymap.nix; theme = import ./theme.nix; -in -{ +in { programs.yazi = { enable = true; enableZshIntegration = true; diff --git a/modules/home/yazi/keymap.nix b/modules/home/yazi/keymap.nix index d4e4267..c8e2561 100644 --- a/modules/home/yazi/keymap.nix +++ b/modules/home/yazi/keymap.nix @@ -92,7 +92,7 @@ desc = "Move cursor down one page"; } { - on = [ "g" "g" ]; + on = ["g" "g"]; run = "arrow top"; desc = "Move cursor to the top"; } @@ -133,7 +133,7 @@ } { on = ""; - run = [ "toggle" "arrow 1" ]; + run = ["toggle" "arrow 1"]; desc = "Toggle the current selection state"; } { @@ -297,52 +297,52 @@ desc = "Jump to a file/directory via fzf"; } { - on = [ "m" "s" ]; + on = ["m" "s"]; run = "linemode size"; desc = "Linemode: size"; } { - on = [ "m" "p" ]; + on = ["m" "p"]; run = "linemode permissions"; desc = "Linemode: permissions"; } { - on = [ "m" "b" ]; + on = ["m" "b"]; run = "linemode btime"; desc = "Linemode: btime"; } { - on = [ "m" "m" ]; + on = ["m" "m"]; run = "linemode mtime"; desc = "Linemode: mtime"; } { - on = [ "m" "o" ]; + on = ["m" "o"]; run = "linemode owner"; desc = "Linemode: owner"; } { - on = [ "m" "n" ]; + on = ["m" "n"]; run = "linemode none"; desc = "Linemode: none"; } { - on = [ "c" "c" ]; + on = ["c" "c"]; run = "copy path"; desc = "Copy the file path"; } { - on = [ "c" "d" ]; + on = ["c" "d"]; run = "copy dirname"; desc = "Copy the directory path"; } { - on = [ "c" "f" ]; + on = ["c" "f"]; run = "copy filename"; desc = "Copy the filename"; } { - on = [ "c" "n" ]; + on = ["c" "n"]; run = "copy name_without_ext"; desc = "Copy the filename without extension"; } @@ -372,87 +372,87 @@ desc = "Goto the previous found"; } { - on = [ "," "m" ]; - run = [ "sort mtime --reverse=no" "linemode mtime" ]; + on = ["," "m"]; + run = ["sort mtime --reverse=no" "linemode mtime"]; desc = "Sort by modified time"; } { - on = [ "," "M" ]; - run = [ "sort mtime --reverse" "linemode mtime" ]; + on = ["," "M"]; + run = ["sort mtime --reverse" "linemode mtime"]; desc = "Sort by modified time (reverse)"; } { - on = [ "," "b" ]; - run = [ "sort btime --reverse=no" "linemode btime" ]; + on = ["," "b"]; + run = ["sort btime --reverse=no" "linemode btime"]; desc = "Sort by birth time"; } { - on = [ "," "B" ]; - run = [ "sort btime --reverse" "linemode btime" ]; + on = ["," "B"]; + run = ["sort btime --reverse" "linemode btime"]; desc = "Sort by birth time (reverse)"; } { - on = [ "," "e" ]; + on = ["," "e"]; run = "sort extension --reverse=no"; desc = "Sort by extension"; } { - on = [ "," "E" ]; + on = ["," "E"]; run = "sort extension --reverse"; desc = "Sort by extension (reverse)"; } { - on = [ "," "a" ]; + on = ["," "a"]; run = "sort alphabetical --reverse=no"; desc = "Sort alphabetically"; } { - on = [ "," "A" ]; + on = ["," "A"]; run = "sort alphabetical --reverse"; desc = "Sort alphabetically (reverse)"; } { - on = [ "," "n" ]; + on = ["," "n"]; run = "sort natural --reverse=no"; desc = "Sort naturally"; } { - on = [ "," "N" ]; + on = ["," "N"]; run = "sort natural --reverse"; desc = "Sort naturally (reverse)"; } { - on = [ "," "s" ]; - run = [ "sort size --reverse=no" "linemode size" ]; + on = ["," "s"]; + run = ["sort size --reverse=no" "linemode size"]; desc = "Sort by size"; } { - on = [ "," "S" ]; - run = [ "sort size --reverse" "linemode size" ]; + on = ["," "S"]; + run = ["sort size --reverse" "linemode size"]; desc = "Sort by size (reverse)"; } { - on = [ "," "r" ]; + on = ["," "r"]; run = "sort random --reverse=no"; desc = "Sort randomly"; } { - on = [ "g" "h" ]; + on = ["g" "h"]; run = "cd ~"; desc = "Go home"; } { - on = [ "g" "c" ]; + on = ["g" "c"]; run = "cd ~/.config"; desc = "Goto ~/.config"; } { - on = [ "g" "d" ]; + on = ["g" "d"]; run = "cd ~/Downloads"; desc = "Goto ~/Downloads"; } { - on = [ "g" "" ]; + on = ["g" ""]; run = "cd --interactive"; desc = "Jump interactively"; } @@ -544,7 +544,7 @@ ]; prepend_keymap = [ { - on = [ "g" "i" ]; + on = ["g" "i"]; run = "plugin lazygit"; desc = "run lazygit"; } @@ -682,7 +682,7 @@ desc = "Swipe to the previous file"; } { - on = [ "c" "c" ]; + on = ["c" "c"]; run = "copy cell"; desc = "Copy selected cell"; } @@ -781,7 +781,7 @@ } { on = "I"; - run = [ "move first-char" "insert" ]; + run = ["move first-char" "insert"]; desc = "Move to the BOL, and enter insert mode"; } { @@ -791,7 +791,7 @@ } { on = "A"; - run = [ "move eol" "insert --append" ]; + run = ["move eol" "insert --append"]; desc = "Move to the EOL, and enter append mode"; } { @@ -806,17 +806,17 @@ } { on = "V"; - run = [ "move bol" "visual" "move eol" ]; + run = ["move bol" "visual" "move eol"]; desc = "Select from BOL to EOL"; } { on = ""; - run = [ "move eol" "visual" "move bol" ]; + run = ["move eol" "visual" "move bol"]; desc = "Select from EOL to BOL"; } { on = ""; - run = [ "move bol" "visual" "move eol" ]; + run = ["move bol" "visual" "move eol"]; desc = "Select from BOL to EOL"; } { @@ -976,7 +976,7 @@ } { on = "D"; - run = [ "delete --cut" "move eol" ]; + run = ["delete --cut" "move eol"]; desc = "Cut until the EOL"; } { @@ -986,12 +986,12 @@ } { on = "C"; - run = [ "delete --cut --insert" "move eol" ]; + run = ["delete --cut --insert" "move eol"]; desc = "Cut until the EOL, and enter insert mode"; } { on = "x"; - run = [ "delete --cut" "move 1 --in-operating" ]; + run = ["delete --cut" "move 1 --in-operating"]; desc = "Cut the current character"; } { @@ -1109,7 +1109,7 @@ } { on = ""; - run = [ "close --submit" "close_input --submit" ]; + run = ["close --submit" "close_input --submit"]; desc = "Submit the completion and input"; } { diff --git a/modules/home/yazi/theme.nix b/modules/home/yazi/theme.nix index 77bee22..392eb24 100644 --- a/modules/home/yazi/theme.nix +++ b/modules/home/yazi/theme.nix @@ -11,24 +11,24 @@ tab_width = 1; border_symbol = "│"; }; - mode = { }; + mode = {}; status = { - overall = { bold = true; }; - sep_left = [ "░▒▓" "▓▒░" ]; - sep_right = [ "░▒▓" "▓▒░" ]; + overall = {bold = true;}; + sep_left = ["░▒▓" "▓▒░"]; + sep_right = ["░▒▓" "▓▒░"]; }; which = { cols = 3; separator = "  "; }; confirm = { - border = { fg = "gray"; }; + border = {fg = "gray";}; title = { fg = "blue"; bold = true; }; - content = { }; - list = { }; + content = {}; + list = {}; btn_yes = { bg = "green"; fg = "black"; @@ -39,39 +39,39 @@ fg = "black"; bold = true; }; - btn_labels = [ " [Y]es " " (N)o " ]; + btn_labels = [" [Y]es " " (N)o "]; }; spot = { - border = { fg = "blue"; }; - title = { fg = "blue"; }; - tbl_col = { fg = "blue"; }; + border = {fg = "blue";}; + title = {fg = "blue";}; + tbl_col = {fg = "blue";}; tbl_cell = { fg = "yellow"; reversed = true; }; }; notify = { - title_info = { fg = "green"; }; - title_warn = { fg = "yellow"; }; - title_error = { fg = "red"; }; + title_info = {fg = "green";}; + title_warn = {fg = "yellow";}; + title_error = {fg = "red";}; icon_info = ""; icon_warn = ""; icon_error = ""; }; - pick = { }; - input = { }; + pick = {}; + input = {}; cmp = { - active = { reversed = true; }; - inactive = { }; + active = {reversed = true;}; + inactive = {}; icon_file = ""; icon_folder = ""; icon_command = ""; }; - tasks = { }; - help = { }; - filetype = { }; + tasks = {}; + help = {}; + filetype = {}; icon = { - globs = [ ]; + globs = []; dirs = [ { name = ".config"; diff --git a/modules/home/yazi/yazi.nix b/modules/home/yazi/yazi.nix index 1fe053b..71c8b74 100644 --- a/modules/home/yazi/yazi.nix +++ b/modules/home/yazi/yazi.nix @@ -1,7 +1,7 @@ { settings = { manager = { - ratio = [ 1 4 3 ]; + ratio = [1 4 3]; sort_by = "alphabetical"; sort_sensitive = false; sort_reverse = false; @@ -11,7 +11,7 @@ show_hidden = false; show_symlink = true; scrolloff = 5; - mouse_events = [ "click" "scroll" ]; + mouse_events = ["click" "scroll"]; title_format = "Yazi: {cwd}"; }; preview = { @@ -25,7 +25,7 @@ image_quality = 75; sixel_fraction = 15; ueberzug_scale = 1; - ueberzug_offset = [ 0 0 0 0 ]; + ueberzug_offset = [0 0 0 0]; }; opener = { edit = [ @@ -135,40 +135,39 @@ rules = [ { name = "*/"; - use = [ "edit" "open" "reveal" ]; + use = ["edit" "open" "reveal"]; } { mime = "text/*"; - use = [ "edit" "reveal" ]; + use = ["edit" "reveal"]; } { mime = "image/*"; - use = [ "open" "reveal" ]; + use = ["open" "reveal"]; } { mime = "{audio,video}/*"; - use = [ "play" "reveal" ]; + use = ["play" "reveal"]; } { - mime = - "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}"; - use = [ "extract" "reveal" ]; + mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}"; + use = ["extract" "reveal"]; } { mime = "application/{json,ndjson}"; - use = [ "edit" "reveal" ]; + use = ["edit" "reveal"]; } { mime = "*/javascript"; - use = [ "edit" "reveal" ]; + use = ["edit" "reveal"]; } { mime = "inode/empty"; - use = [ "edit" "reveal" ]; + use = ["edit" "reveal"]; } { name = "*"; - use = [ "open" "reveal" ]; + use = ["open" "reveal"]; } ]; }; @@ -177,16 +176,18 @@ macro_workers = 10; bizarre_retry = 3; image_alloc = 536870912; - image_bound = [ 0 0 ]; + image_bound = [0 0]; suppress_preload = false; }; plugin = { - fetchers = [{ - id = "mime"; - name = "*"; - run = "mime"; - prio = "high"; - }]; + fetchers = [ + { + id = "mime"; + name = "*"; + run = "mime"; + prio = "high"; + } + ]; spotters = [ { name = "*/"; @@ -278,13 +279,11 @@ run = "pdf"; } { - mime = - "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}"; + mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}"; run = "archive"; } { - mime = - "application/{debian*-package,redhat-package-manager,rpm,android.package-archive}"; + mime = "application/{debian*-package,redhat-package-manager,rpm,android.package-archive}"; run = "archive"; } { @@ -337,47 +336,46 @@ cursor_blink = false; cd_title = "Change directory:"; cd_origin = "top-center"; - cd_offset = [ 0 2 50 3 ]; - create_title = [ "Create:" "Create (dir):" ]; + cd_offset = [0 2 50 3]; + create_title = ["Create:" "Create (dir):"]; create_origin = "top-center"; - create_offset = [ 0 2 50 3 ]; + create_offset = [0 2 50 3]; rename_title = "Rename:"; rename_origin = "hovered"; - rename_offset = [ 0 1 50 3 ]; + rename_offset = [0 1 50 3]; filter_title = "Filter:"; filter_origin = "top-center"; - filter_offset = [ 0 2 50 3 ]; - find_title = [ "Find next:" "Find previous:" ]; + filter_offset = [0 2 50 3]; + find_title = ["Find next:" "Find previous:"]; find_origin = "top-center"; - find_offset = [ 0 2 50 3 ]; + find_offset = [0 2 50 3]; search_title = "Search via {n}:"; search_origin = "top-center"; - search_offset = [ 0 2 50 3 ]; - shell_title = [ "Shell:" "Shell (block):" ]; + search_offset = [0 2 50 3]; + shell_title = ["Shell:" "Shell (block):"]; shell_origin = "top-center"; - shell_offset = [ 0 2 50 3 ]; + shell_offset = [0 2 50 3]; }; confirm = { trash_title = "Trash {n} selected file{s}?"; trash_origin = "center"; - trash_offset = [ 0 0 70 20 ]; + trash_offset = [0 0 70 20]; delete_title = "Permanently delete {n} selected file{s}?"; delete_origin = "center"; - delete_offset = [ 0 0 70 20 ]; + delete_offset = [0 0 70 20]; overwrite_title = "Overwrite file?"; overwrite_content = "Will overwrite the following file:"; overwrite_origin = "center"; - overwrite_offset = [ 0 0 50 15 ]; + overwrite_offset = [0 0 50 15]; quit_title = "Quit?"; - quit_content = - "The following tasks are still running, are you sure you want to quit?"; + quit_content = "The following tasks are still running, are you sure you want to quit?"; quit_origin = "center"; - quit_offset = [ 0 0 50 15 ]; + quit_offset = [0 0 50 15]; }; pick = { open_title = "Open with:"; open_origin = "hovered"; - open_offset = [ 0 1 50 7 ]; + open_offset = [0 1 50 7]; }; which = { sort_by = "none"; diff --git a/modules/home/zoxide.nix b/modules/home/zoxide.nix index 9ab1845..153d85c 100644 --- a/modules/home/zoxide.nix +++ b/modules/home/zoxide.nix @@ -10,4 +10,3 @@ _: { }; }; } - diff --git a/modules/home/zsh/default.nix b/modules/home/zsh/default.nix index 50e0f7d..9f1bcbb 100644 --- a/modules/home/zsh/default.nix +++ b/modules/home/zsh/default.nix @@ -1,7 +1,8 @@ -{ profile -, pkgs -, lib -, ... +{ + profile, + pkgs, + lib, + ... }: { imports = [ ./zshrc-personal.nix @@ -12,7 +13,7 @@ autosuggestion.enable = true; syntaxHighlighting = { enable = true; - highlighters = [ "main" "brackets" "pattern" "regexp" "root" "line" ]; + highlighters = ["main" "brackets" "pattern" "regexp" "root" "line"]; }; historySubstringSearch.enable = true; @@ -50,6 +51,7 @@ ''; shellAliases = { + nix-fmt-all = "nix fmt ./"; sv = "sudo nvim"; v = "nvim"; c = "clear"; diff --git a/modules/home/zsh/zshrc-personal.nix b/modules/home/zsh/zshrc-personal.nix index 545cfd2..cd3b820 100644 --- a/modules/home/zsh/zshrc-personal.nix +++ b/modules/home/zsh/zshrc-personal.nix @@ -1,20 +1,19 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ zsh ]; +{pkgs, ...}: { + home.packages = with pkgs; [zsh]; home.file."./.zshrc-personal".text = '' - # This file allows you to define your own aliases, functions, etc - # below are just some examples of what you can use this file for - - #!/usr/bin/env zsh - # Set defaults - # - #export EDITOR="nvim" - #export VISUAL="nvim" - - #alias c="clear" - + # This file allows you to define your own aliases, functions, etc + # below are just some examples of what you can use this file for + + #!/usr/bin/env zsh + # Set defaults + # + #export EDITOR="nvim" + #export VISUAL="nvim" + + #alias c="clear" + ''; } - diff --git a/profiles/amd-hybrid/default.nix b/profiles/amd-hybrid/default.nix index fa239e4..1e1a133 100644 --- a/profiles/amd-hybrid/default.nix +++ b/profiles/amd-hybrid/default.nix @@ -1,9 +1,6 @@ -{ host, ... }: -let +{host, ...}: let inherit (import ../../hosts/${host}/variables.nix) amdgpuID nvidiaID; - -in -{ +in { imports = [ ../../hosts/${host} ../../modules/drivers diff --git a/profiles/amd/default.nix b/profiles/amd/default.nix index 9c1d8ce..1b5506b 100644 --- a/profiles/amd/default.nix +++ b/profiles/amd/default.nix @@ -1,4 +1,4 @@ -{ host, ... }: { +{host, ...}: { imports = [ ../../hosts/${host} ../../modules/drivers diff --git a/profiles/intel/default.nix b/profiles/intel/default.nix index cc0d3d6..f99a114 100644 --- a/profiles/intel/default.nix +++ b/profiles/intel/default.nix @@ -1,4 +1,4 @@ -{ host, ... }: { +{host, ...}: { imports = [ ../../hosts/${host} ../../modules/drivers diff --git a/profiles/nvidia-laptop/default.nix b/profiles/nvidia-laptop/default.nix index 6d58b83..2c4444b 100644 --- a/profiles/nvidia-laptop/default.nix +++ b/profiles/nvidia-laptop/default.nix @@ -1,8 +1,6 @@ -{ host, ... }: -let +{host, ...}: let inherit (import ../../hosts/${host}/variables.nix) intelID nvidiaID; -in -{ +in { imports = [ ../../hosts/${host} ../../modules/drivers diff --git a/profiles/nvidia/default.nix b/profiles/nvidia/default.nix index 6beee5f..5b50370 100644 --- a/profiles/nvidia/default.nix +++ b/profiles/nvidia/default.nix @@ -1,4 +1,4 @@ -{ host, ... }: { +{host, ...}: { imports = [ ../../hosts/${host} ../../modules/drivers diff --git a/profiles/vm/default.nix b/profiles/vm/default.nix index cf51f94..130c1b7 100644 --- a/profiles/vm/default.nix +++ b/profiles/vm/default.nix @@ -1,4 +1,4 @@ -{ host, ... }: { +{host, ...}: { imports = [ ../../hosts/${host} ../../modules/drivers