diff --git a/assets/images/nix-snowflake-colours.svg b/assets/images/nix-snowflake-colours.svg new file mode 100644 index 0000000..2a065bc --- /dev/null +++ b/assets/images/nix-snowflake-colours.svg @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/assets/scripts/keyboard_sound_thing.py b/assets/scripts/keyboard_sound_thing.py index f6f66e0..b4a649c 100644 --- a/assets/scripts/keyboard_sound_thing.py +++ b/assets/scripts/keyboard_sound_thing.py @@ -14,6 +14,11 @@ def watch_hyprland(): threading.Thread(target=watch_hyprland, daemon=True).start() +dev = None + +def is_target_window(): + return active_class == "kitty" or active_class == "neovide" or active_class == "discord" or active_class == "vesktop" or active_class == "firefox" + for path in evdev.list_devices(): d = evdev.InputDevice(path) if 'keyd virtual keyboard' in d.name: @@ -21,16 +26,15 @@ for path in evdev.list_devices(): break d.close() -print(dev) - -for event in dev.read_loop(): - if event.type == 1 and event.value == 1 and active_class == "kitty": - if event.code == 28: - subprocess.Popen(['pw-play', '/home/pagedmov/.sysflake/assets/sound/msg_finish.wav']) - elif event.code == 14: - subprocess.Popen(['pw-cat', '--playback', '--volume=0.5', '/home/pagedmov/.sysflake/assets/sound/low_hp.wav']) - elif event.code == 1: - subprocess.Popen(['pw-play', '/home/pagedmov/.sysflake/assets/sound/menu_close.wav']) - else: - pitch = random.randint(-50,50) - subprocess.Popen(['play', '-q', '/home/pagedmov/.sysflake/assets/sound/msg.wav', 'pitch', str(pitch)]) +if dev != None: + for event in dev.read_loop(): + if event.type == 1 and event.value == 1 and is_target_window(): + if event.code == 28: + subprocess.Popen(['pw-play', '/home/pagedmov/.sysflake/assets/sound/msg_finish.wav']) + elif event.code == 14: + subprocess.Popen(['pw-cat', '--playback', '--volume=0.5', '/home/pagedmov/.sysflake/assets/sound/low_hp.wav']) + elif event.code == 1: + subprocess.Popen(['pw-play', '/home/pagedmov/.sysflake/assets/sound/menu_close.wav']) + else: + pitch = random.randint(-50,50) + subprocess.Popen(['play', '-q', '/home/pagedmov/.sysflake/assets/sound/msg.wav', 'pitch', str(pitch)]) diff --git a/assets/wallpapers/selective_color/angles.png b/assets/wallpapers/selective_color/angles.png new file mode 100644 index 0000000..1d53c7e Binary files /dev/null and b/assets/wallpapers/selective_color/angles.png differ diff --git a/assets/wallpapers/selective_color/beachpurple.jpeg b/assets/wallpapers/selective_color/beachpurple.jpeg new file mode 100644 index 0000000..c0fb532 Binary files /dev/null and b/assets/wallpapers/selective_color/beachpurple.jpeg differ diff --git a/assets/wallpapers/selective_color/bus_stop.jpeg b/assets/wallpapers/selective_color/bus_stop.jpeg new file mode 100644 index 0000000..0ab906b Binary files /dev/null and b/assets/wallpapers/selective_color/bus_stop.jpeg differ diff --git a/assets/wallpapers/selective_color/crimson_great_wave.jpeg b/assets/wallpapers/selective_color/crimson_great_wave.jpeg new file mode 100644 index 0000000..c97b7f6 Binary files /dev/null and b/assets/wallpapers/selective_color/crimson_great_wave.jpeg differ diff --git a/assets/wallpapers/selective_color/ferns.jpg b/assets/wallpapers/selective_color/ferns.jpg new file mode 100644 index 0000000..addba92 Binary files /dev/null and b/assets/wallpapers/selective_color/ferns.jpg differ diff --git a/assets/wallpapers/selective_color/gameboy.png b/assets/wallpapers/selective_color/gameboy.png new file mode 100644 index 0000000..20ef0dd Binary files /dev/null and b/assets/wallpapers/selective_color/gameboy.png differ diff --git a/assets/wallpapers/selective_color/glass.webp b/assets/wallpapers/selective_color/glass.webp new file mode 100644 index 0000000..045e7af Binary files /dev/null and b/assets/wallpapers/selective_color/glass.webp differ diff --git a/assets/wallpapers/selective_color/grid.jpeg b/assets/wallpapers/selective_color/grid.jpeg new file mode 100644 index 0000000..a45404e Binary files /dev/null and b/assets/wallpapers/selective_color/grid.jpeg differ diff --git a/assets/wallpapers/selective_color/osaka.webp b/assets/wallpapers/selective_color/osaka.webp new file mode 100644 index 0000000..41e82f5 Binary files /dev/null and b/assets/wallpapers/selective_color/osaka.webp differ diff --git a/assets/wallpapers/selective_color/overgrown.jpeg b/assets/wallpapers/selective_color/overgrown.jpeg new file mode 100644 index 0000000..8cf6c94 Binary files /dev/null and b/assets/wallpapers/selective_color/overgrown.jpeg differ diff --git a/assets/wallpapers/selective_color/pcb.png b/assets/wallpapers/selective_color/pcb.png new file mode 100644 index 0000000..1afbdd5 Binary files /dev/null and b/assets/wallpapers/selective_color/pcb.png differ diff --git a/assets/wallpapers/selective_color/road.png b/assets/wallpapers/selective_color/road.png new file mode 100644 index 0000000..8684901 Binary files /dev/null and b/assets/wallpapers/selective_color/road.png differ diff --git a/assets/wallpapers/selective_color/sakura.jpg b/assets/wallpapers/selective_color/sakura.jpg new file mode 100644 index 0000000..4c1a378 Binary files /dev/null and b/assets/wallpapers/selective_color/sakura.jpg differ diff --git a/assets/wallpapers/selective_color/sunmountains.jpeg b/assets/wallpapers/selective_color/sunmountains.jpeg new file mode 100644 index 0000000..7b5d88a Binary files /dev/null and b/assets/wallpapers/selective_color/sunmountains.jpeg differ diff --git a/assets/wallpapers/selective_color/tokyo_night.png b/assets/wallpapers/selective_color/tokyo_night.png new file mode 100644 index 0000000..7918e50 Binary files /dev/null and b/assets/wallpapers/selective_color/tokyo_night.png differ diff --git a/flake.lock b/flake.lock index a53ebba..ea84f4a 100755 --- a/flake.lock +++ b/flake.lock @@ -107,11 +107,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1772928715, - "narHash": "sha256-Z7qGN/5v7oBc6wjNtSR7YI/JneEzPvCqd+P6RAxMltA=", + "lastModified": 1773005383, + "narHash": "sha256-Nlln9sKJa1q5lYX4xXS34Lt1oREwgQbT59Aa37nBGkU=", "owner": "9001", "repo": "copyparty", - "rev": "ffe6a9aa6fb7d49a4a1be3007c8d3297f88f4bc8", + "rev": "266d6e0ae6a6eecac7bc863bd8f746d16686e61a", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1772867152, - "narHash": "sha256-RIFgZ4O6Eg+5ysZ8Tqb3YvcqiRaNy440GEY22ltjRrs=", + "lastModified": 1773025010, + "narHash": "sha256-khlHllTsovXgT2GZ0WxT4+RvuMjNeR5OW0UYeEHPYQo=", "owner": "nix-community", "repo": "disko", - "rev": "eaafb89b56e948661d618eefd4757d9ea8d77514", + "rev": "7b9f7f88ab3b339f8142dc246445abb3c370d3d3", "type": "github" }, "original": { @@ -309,11 +309,11 @@ ] }, "locked": { - "lastModified": 1772845525, - "narHash": "sha256-Dp5Ir2u4jJDGCgeMRviHvEQDe+U37hMxp6RSNOoMMPc=", + "lastModified": 1773093840, + "narHash": "sha256-u/96NoAyN8BSRuM3ZimGf7vyYgXa3pLx4MYWjokuoH4=", "owner": "nix-community", "repo": "home-manager", - "rev": "27b93804fbef1544cb07718d3f0a451f4c4cd6c0", + "rev": "bb014746edb2a98d975abde4dd40fa240de4cf86", "type": "github" }, "original": { @@ -415,11 +415,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1772913214, - "narHash": "sha256-/tzDJr3CcM73Y4ZQmoFYSzNDs7RV7+enE72tvl+Fm0E=", + "lastModified": 1773082851, + "narHash": "sha256-4zkUP+gZF6zveHFN0W3oX750mpVgxfiShL+ZcvcH244=", "ref": "refs/heads/main", - "rev": "a4ecae91600d7e8ceb31610176d6b40cb816711b", - "revCount": 7006, + "rev": "e32eeb1d454b029a24ca71f410896bf52839085d", + "revCount": 7010, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -749,11 +749,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1772173633, - "narHash": "sha256-MOH58F4AIbCkh6qlQcwMycyk5SWvsqnS/TCfnqDlpj4=", + "lastModified": 1772771118, + "narHash": "sha256-xWzaTvmmACR/SRWtABgI/Z97lcqwJAeoSd5QW1KdK1s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c0f3d81a7ddbc2b1332be0d8481a672b4f6004d6", + "rev": "e38213b91d3786389a446dfce4ff5a8aaf6012f2", "type": "github" }, "original": { @@ -813,11 +813,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1772736753, - "narHash": "sha256-au/m3+EuBLoSzWUCb64a/MZq6QUtOV8oC0D9tY2scPQ=", + "lastModified": 1772956932, + "narHash": "sha256-M0yS4AafhKxPPmOHGqIV0iKxgNO8bHDWdl1kOwGBwRY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "917fec990948658ef1ccd07cef2a1ef060786846", + "rev": "608d0cadfed240589a7eea422407a547ad626a14", "type": "github" }, "original": { @@ -964,11 +964,11 @@ "nixpkgs": "nixpkgs_8" }, "locked": { - "lastModified": 1772939073, - "narHash": "sha256-Fl451e4T94L1dUPjs5HEAbh/gP3vXFQBk9b52tW486Y=", + "lastModified": 1773107703, + "narHash": "sha256-Zf2Z7p2tEC+HjIqVoEyd/bLypqUdNdkNCuAg4OnNcIg=", "owner": "km-clay", "repo": "shed", - "rev": "07d7015dd4950833671f2b795e2559295601e5af", + "rev": "85e5fc28754849ce690ff583249381f9c7a91fb9", "type": "github" }, "original": { @@ -985,11 +985,11 @@ "systems": "systems_5" }, "locked": { - "lastModified": 1772494187, - "narHash": "sha256-6ksgNAFXVK+Cg/6ww7bB2nJUPZlnS75UwZC7G+L03EE=", + "lastModified": 1773007504, + "narHash": "sha256-4NtiCDH3RunKbrlWvPCB6dyTjCwqdrHaBDeMCzG6gIA=", "owner": "gerg-l", "repo": "spicetify-nix", - "rev": "915ab06b046d05613041780c575c62a32fe67cea", + "rev": "434e63b851f9139aaeddc3b8de44d47992828b3b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d5d09d5..455d0c4 100755 --- a/flake.nix +++ b/flake.nix @@ -30,7 +30,8 @@ }; }; - outputs = { ... }@inputs: + outputs = + { ... }@inputs: let movLib = import ./lib { inherit inputs; @@ -73,7 +74,8 @@ ]; } ]; - in { + in + { inherit (hosts) nixosConfigurations homeConfigurations; }; } diff --git a/hosts/desktop/config.nix b/hosts/desktop/config.nix index b3bf5ed..163370e 100755 --- a/hosts/desktop/config.nix +++ b/hosts/desktop/config.nix @@ -1,4 +1,9 @@ -{ inputs, pkgs, username, ... }: +{ + inputs, + pkgs, + username, + ... +}: let shed = inputs.shed.packages.${pkgs.stdenv.hostPlatform.system}.default; @@ -31,8 +36,14 @@ in }; environment = { - variables = { PATH = "${pkgs.clang-tools}/bin:$PATH"; }; - shells = [ pkgs.myPkgs.slash pkgs.zsh pkgs.bash ]; + variables = { + PATH = "${pkgs.clang-tools}/bin:$PATH"; + }; + shells = [ + pkgs.myPkgs.slash + pkgs.zsh + pkgs.bash + ]; }; users = { @@ -43,7 +54,12 @@ in isNormalUser = true; initialPassword = "1234"; shell = shed; - extraGroups = [ "input" "wheel" "persist" "libvirtd" ]; + extraGroups = [ + "input" + "wheel" + "persist" + "libvirtd" + ]; }; }; }; diff --git a/hosts/desktop/hardware.nix b/hosts/desktop/hardware.nix index dbddd5a..051663e 100755 --- a/hosts/desktop/hardware.nix +++ b/hosts/desktop/hardware.nix @@ -1,28 +1,44 @@ # 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") - ]; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ]; + boot.initrd.availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "virtio_scsi" + "sr_mod" + "virtio_blk" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/5d8dd8ba-6c4c-4227-adc5-f33bf0022fff"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/5d8dd8ba-6c4c-4227-adc5-f33bf0022fff"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/6A3C-0A12"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/6A3C-0A12"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; swapDevices = [ ]; diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix index 77c49bf..8d1edc1 100755 --- a/hosts/desktop/home.nix +++ b/hosts/desktop/home.nix @@ -1,7 +1,7 @@ -{ username, ... }: { +{ username, ... }: +{ home.username = "${username}"; - home.homeDirectory = - "/home/${username}"; + home.homeDirectory = "/home/${username}"; home.stateVersion = "25.05"; programs.home-manager.enable = true; @@ -14,7 +14,10 @@ envConfig = { hyprlandConfig = { enable = true; - monitorNames = [ "HDMI-A-1" "DP-1" ]; + monitorNames = [ + "HDMI-A-1" + "DP-1" + ]; workspaceLayout = "dualmonitor"; }; userPkgs.enable = true; diff --git a/hosts/laptop/config.nix b/hosts/laptop/config.nix index 8f75438..aa15d83 100755 --- a/hosts/laptop/config.nix +++ b/hosts/laptop/config.nix @@ -1,10 +1,21 @@ -{ username, pkgs, config, ... }: { +{ + username, + pkgs, + config, + ... +}: +{ imports = [ ./hardware.nix ]; boot = { kernelModules = [ "acpi_call" ]; - extraModulePackages = with config.boot.kernelPackages; - [ acpi_call cpupower ] ++ [ pkgs.cpupower-gui ]; + extraModulePackages = + with config.boot.kernelPackages; + [ + acpi_call + cpupower + ] + ++ [ pkgs.cpupower-gui ]; }; movOpts = { @@ -27,9 +38,19 @@ }; environment = { - variables = { PATH = "${pkgs.clang-tools}/bin:$PATH"; }; - shells = with pkgs; [ zsh bash ]; - systemPackages = with pkgs; [ acpi brightnessctl cpupower-gui powertop ]; + variables = { + PATH = "${pkgs.clang-tools}/bin:$PATH"; + }; + shells = with pkgs; [ + zsh + bash + ]; + systemPackages = with pkgs; [ + acpi + brightnessctl + cpupower-gui + powertop + ]; }; users = { @@ -40,7 +61,11 @@ isNormalUser = true; initialPassword = "1234"; shell = pkgs.zsh; - extraGroups = [ "wheel" "persist" "libvirtd" ]; + extraGroups = [ + "wheel" + "persist" + "libvirtd" + ]; }; }; }; diff --git a/hosts/laptop/hardware.nix b/hosts/laptop/hardware.nix index 5736813..5f1238a 100755 --- a/hosts/laptop/hardware.nix +++ b/hosts/laptop/hardware.nix @@ -1,11 +1,24 @@ # 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 + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = - [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; @@ -23,7 +36,10 @@ fileSystems."/boot" = { device = "/dev/sda2"; fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; + options = [ + "fmask=0077" + "dmask=0077" + ]; }; fileSystems."/home" = { @@ -42,6 +58,5 @@ # networking.interfaces.wlp15s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index f978078..35627bd 100755 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -1,9 +1,17 @@ -{ host, pkgs, self, inputs, username, lib, config, ... }: { +{ + host, + pkgs, + self, + inputs, + username, + lib, + config, + ... +}: +{ home.username = "${username}"; # Replace with your actual username - home.homeDirectory = - "/home/${username}"; # Replace with your actual home directory - home.stateVersion = - "24.05"; # Adjust this based on your system's NixOS version + home.homeDirectory = "/home/${username}"; # Replace with your actual home directory + home.stateVersion = "24.05"; # Adjust this based on your system's NixOS version programs.home-manager.enable = true; diff --git a/hosts/server/config.nix b/hosts/server/config.nix index d4642ec..7b0fa01 100755 --- a/hosts/server/config.nix +++ b/hosts/server/config.nix @@ -1,4 +1,5 @@ -{ pkgs, username, ... }: { +{ pkgs, username, ... }: +{ imports = [ ./hardware.nix ]; movOpts = { sysEnv = { @@ -22,7 +23,12 @@ caddyConfig.enable = true; }; }; - networking.firewall = { allowedTCPPorts = [ 443 8920 ]; }; + networking.firewall = { + allowedTCPPorts = [ + 443 + 8920 + ]; + }; environment = { etc."tmpfiles.d/home-permissions.conf".text = '' d /home/pagedmov 0750 pagedmov users - @@ -31,7 +37,10 @@ PATH = "${pkgs.clang-tools}/bin:$PATH"; TERM = "kitty"; }; - shells = with pkgs; [ zsh bash ]; + shells = with pkgs; [ + zsh + bash + ]; }; users = { @@ -42,7 +51,11 @@ isNormalUser = true; initialPassword = "1234"; shell = pkgs.zsh; - extraGroups = [ "wheel" "persist" "libvirtd" ]; + extraGroups = [ + "wheel" + "persist" + "libvirtd" + ]; }; }; }; diff --git a/hosts/server/hardware.nix b/hosts/server/hardware.nix index 6c25253..d77ee67 100755 --- a/hosts/server/hardware.nix +++ b/hosts/server/hardware.nix @@ -1,13 +1,25 @@ # 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 + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = - [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; @@ -25,7 +37,10 @@ fileSystems."/boot" = { device = "/dev/disk/by-uuid/357E-BCCD"; fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; + options = [ + "fmask=0077" + "dmask=0077" + ]; }; fileSystems."/home" = { @@ -44,6 +59,5 @@ # networking.interfaces.wlp11s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/server/home.nix b/hosts/server/home.nix index f373788..e23c26f 100755 --- a/hosts/server/home.nix +++ b/hosts/server/home.nix @@ -1,10 +1,18 @@ -{ host, pkgs, self, inputs, lib, username, config, ... }: { +{ + host, + pkgs, + self, + inputs, + lib, + username, + config, + ... +}: +{ home.username = "${username}"; - home.homeDirectory = - "/home/${username}"; - home.stateVersion = - "24.05"; + home.homeDirectory = "/home/${username}"; + home.stateVersion = "24.05"; programs.home-manager.enable = true; diff --git a/hosts/work/config.nix b/hosts/work/config.nix index 03264cf..942b852 100755 --- a/hosts/work/config.nix +++ b/hosts/work/config.nix @@ -1,4 +1,9 @@ -{ inputs, pkgs, username, ... }: +{ + inputs, + pkgs, + username, + ... +}: let shed = inputs.shed.packages.${pkgs.stdenv.hostPlatform.system}.default; @@ -33,8 +38,14 @@ in }; environment = { - variables = { PATH = "${pkgs.clang-tools}/bin:$PATH"; }; - shells = [ pkgs.myPkgs.slash pkgs.zsh pkgs.bash ]; + variables = { + PATH = "${pkgs.clang-tools}/bin:$PATH"; + }; + shells = [ + pkgs.myPkgs.slash + pkgs.zsh + pkgs.bash + ]; }; programs.shed.enable = true; @@ -52,7 +63,13 @@ in isNormalUser = true; initialPassword = "1234"; shell = pkgs.shed; - extraGroups = [ "davfs2" "input" "wheel" "persist" "libvirtd" ]; + extraGroups = [ + "davfs2" + "input" + "wheel" + "persist" + "libvirtd" + ]; }; }; }; diff --git a/hosts/work/containers.nix b/hosts/work/containers.nix index 9fe4062..7dd09aa 100644 --- a/hosts/work/containers.nix +++ b/hosts/work/containers.nix @@ -1,4 +1,9 @@ -{ slash, pkgs, username, ... }: +{ + slash, + pkgs, + username, + ... +}: let kickstartServer = @@ -17,30 +22,31 @@ let ''; }; startTf2Server = pkgs.writeShellScript "start-srv.sh" '' - set -euo pipefail - export HOME=/home/tf2 - export LD_LIBRARY_PATH=/usr/lib:/usr/lib32 - mkdir -p "$HOME/tf2server" - mkdir -p "$HOME/tf2server" + set -euo pipefail + export HOME=/home/tf2 + export LD_LIBRARY_PATH=/usr/lib:/usr/lib32 + mkdir -p "$HOME/tf2server" + mkdir -p "$HOME/tf2server" - steamcmd +force_install_dir "$HOME/tf2server" \ - +login anonymous \ - +app_update 232250 validate \ - +quit + steamcmd +force_install_dir "$HOME/tf2server" \ + +login anonymous \ + +app_update 232250 validate \ + +quit - cd "$HOME/tf2server" + cd "$HOME/tf2server" - ln -sf "$HOME/.steam/steam/linux64" "$HOME/.steam/sdk64" - ln -sf "$HOME/.steam/steam/linux32" "$HOME/.steam/sdk32" + ln -sf "$HOME/.steam/steam/linux64" "$HOME/.steam/sdk64" + ln -sf "$HOME/.steam/steam/linux32" "$HOME/.steam/sdk32" - exec ./srcds_run -game tf -console -port 25565 +map cp_dustbowl \ - +ip 10.233.1.2 -norestart \ - +sv_setsteamaccount 8862FD4B30F401036B8AAC6A7FE6B123 + exec ./srcds_run -game tf -console -port 25565 +map cp_dustbowl \ + +ip 10.233.1.2 -norestart \ + +sv_setsteamaccount 8862FD4B30F401036B8AAC6A7FE6B123 ''; in - pkgs.buildFHSEnv { - name = "srcds-env"; - targetPkgs = pkgs: with pkgs; [ + pkgs.buildFHSEnv { + name = "srcds-env"; + targetPkgs = + pkgs: with pkgs; [ steamcmd glibc zlib @@ -50,29 +56,30 @@ let libnl libsrcds - # Optional: link compat - stdenv.cc.cc.lib - ]; - multiPkgs = pkgs: with pkgs.pkgsi686Linux; [ - glibc - zlib - ncurses5 - libuuid - alsa-lib - libxcrypt-legacy - gcc - ]; - multiArch = true; - runScript = "${startTf2Server}"; + # Optional: link compat + stdenv.cc.cc.lib + ]; + multiPkgs = + pkgs: with pkgs.pkgsi686Linux; [ + glibc + zlib + ncurses5 + libuuid + alsa-lib + libxcrypt-legacy + gcc + ]; + multiArch = true; + runScript = "${startTf2Server}"; - }; + }; in { networking = { nat = { enable = true; - internalInterfaces = ["ve-+"]; - externalInterface = "enp8s0"; + internalInterfaces = [ "ve-+" ]; + externalInterface = "enp8s0"; }; }; containers.tf2server = { @@ -84,7 +91,6 @@ in imports = [ ]; nixpkgs.config.allowUnfree = true; - services.openssh.enable = true; users.users.root.password = "root"; # For quick login, remove in prod @@ -114,11 +120,19 @@ in }; }; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; # Optional: open ports on the container networking.firewall.allowedTCPPorts = [ 25565 ]; - networking.firewall.allowedUDPPorts = [ 25565 27005 27015 27020 ]; + networking.firewall.allowedUDPPorts = [ + 25565 + 27005 + 27015 + 27020 + ]; system.stateVersion = "25.11"; # or your NixOS version }; diff --git a/hosts/work/hardware.nix b/hosts/work/hardware.nix index fba298a..f5bece9 100755 --- a/hosts/work/hardware.nix +++ b/hosts/work/hardware.nix @@ -1,41 +1,68 @@ # 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 + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "ahci" "uas" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "nvme" + "ahci" + "uas" + "usbhid" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/9a98748d-1953-4316-9788-07d11c5d0af6"; - fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd:3" "noatime" ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/9a98748d-1953-4316-9788-07d11c5d0af6"; + fsType = "btrfs"; + options = [ + "subvol=root" + "compress=zstd:3" + "noatime" + ]; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/5BA1-A9F8"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/5BA1-A9F8"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; - fileSystems."/home" = - { device = "/dev/disk/by-uuid/00fd7a7c-d916-4a61-abc1-8dde26b4413b"; - fsType = "btrfs"; - options = [ "compress=zstd:3" "noatime" ]; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/00fd7a7c-d916-4a61-abc1-8dde26b4413b"; + fsType = "btrfs"; + options = [ + "compress=zstd:3" + "noatime" + ]; + }; - fileSystems."/nix" = - { device = "/dev/disk/by-uuid/7c03499c-e2a7-4352-8797-a21f094ef90b"; - fsType = "btrfs"; - options = [ "compress=zstd:3" "noatime" ]; - }; + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/7c03499c-e2a7-4352-8797-a21f094ef90b"; + fsType = "btrfs"; + options = [ + "compress=zstd:3" + "noatime" + ]; + }; swapDevices = [ ]; diff --git a/hosts/work/home.nix b/hosts/work/home.nix index 074314e..20daf7a 100755 --- a/hosts/work/home.nix +++ b/hosts/work/home.nix @@ -1,7 +1,7 @@ -{ username, ... }: { +{ username, ... }: +{ home.username = "${username}"; - home.homeDirectory = - "/home/${username}"; + home.homeDirectory = "/home/${username}"; home.stateVersion = "25.05"; programs.home-manager.enable = true; @@ -14,7 +14,10 @@ envConfig = { hyprlandConfig = { enable = true; - monitorNames = [ "DP-3" "DP-1" ]; + monitorNames = [ + "DP-3" + "DP-1" + ]; workspaceLayout = "dualmonitor"; }; userPkgs.enable = true; diff --git a/lib/default.nix b/lib/default.nix index 614a35f..e1fc03a 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,14 +1,29 @@ -{ inputs, username, nixpkgsConfig ? { allowUnfree = true; } }: +{ + inputs, + username, + nixpkgsConfig ? { + allowUnfree = true; + }, +}: rec { mkHost = import ./mk_host.nix; - foldHosts = hosts: inputs.nixpkgs.lib.foldl' - (acc: host: - let result = mkHost ({ inherit inputs username nixpkgsConfig; } // host); - in { - nixosConfigurations = acc.nixosConfigurations // result.nixosConfigurations; - homeConfigurations = acc.homeConfigurations // result.homeConfigurations; - }) - { nixosConfigurations = {}; homeConfigurations = {}; } - hosts; + foldHosts = + hosts: + inputs.nixpkgs.lib.foldl' + ( + acc: host: + let + result = mkHost ({ inherit inputs username nixpkgsConfig; } // host); + in + { + nixosConfigurations = acc.nixosConfigurations // result.nixosConfigurations; + homeConfigurations = acc.homeConfigurations // result.homeConfigurations; + } + ) + { + nixosConfigurations = { }; + homeConfigurations = { }; + } + hosts; } diff --git a/lib/mk_host.nix b/lib/mk_host.nix index fed1146..4158762 100644 --- a/lib/mk_host.nix +++ b/lib/mk_host.nix @@ -1,15 +1,17 @@ { inputs, username, - nixpkgsConfig ? { allowUnfree = true; }, + nixpkgsConfig ? { + allowUnfree = true; + }, host, hostDir, system ? "x86_64-linux", kind, - extraNixosModules ? [], - extraHomeModules ? [], - extraOverlays ? [], - overlay ? true + extraNixosModules ? [ ], + extraHomeModules ? [ ], + extraOverlays ? [ ], + overlay ? true, }: let @@ -17,19 +19,31 @@ let ../hosts/${hostDir}/config.nix ../modules/sys inputs.stylix.nixosModules.stylix - ] ++ extraNixosModules; + ] + ++ extraNixosModules; homeModules = [ ../hosts/${hostDir}/home.nix ../modules/home inputs.stylix.homeModules.stylix inputs.nixvim.homeModules.nixvim - ] ++ extraHomeModules; + ] + ++ extraHomeModules; pkgs = import inputs.nixpkgs { inherit system; config = nixpkgsConfig; - overlays = extraOverlays ++ (if overlay then [ - (import ../overlay/overlay.nix { inherit host; root = inputs.self; }) - ] else []); + overlays = + extraOverlays + ++ ( + if overlay then + [ + (import ../overlay/overlay.nix { + inherit host; + root = inputs.self; + }) + ] + else + [ ] + ); }; specialArgs = { inherit inputs username host; @@ -55,7 +69,8 @@ let else null; in - { - nixosConfigurations = if kind == "nixos" || kind == "both" then { ${host} = nixosCfg; } else {}; - homeConfigurations = if kind == "home" || kind == "both" then { ${host + "Home"} = homeCfg; } else {}; - } +{ + nixosConfigurations = if kind == "nixos" || kind == "both" then { ${host} = nixosCfg; } else { }; + homeConfigurations = + if kind == "home" || kind == "both" then { ${host + "Home"} = homeCfg; } else { }; +} diff --git a/modules/home/default.nix b/modules/home/default.nix index 14f4318..4b58485 100755 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,3 +1,18 @@ -{ env, inputs, nixpkgs, config, self, username, host, lib, ... }: { - imports = [ ./programs ./environment ./files.nix ]; +{ + env, + inputs, + nixpkgs, + config, + self, + username, + host, + lib, + ... +}: +{ + imports = [ + ./programs + ./environment + ./files.nix + ]; } diff --git a/modules/home/environment/default.nix b/modules/home/environment/default.nix index 26eee96..2473e5f 100755 --- a/modules/home/environment/default.nix +++ b/modules/home/environment/default.nix @@ -1,4 +1,14 @@ -{ host, nixvim, self, inputs, username, config, home-manager, ... }: { +{ + host, + nixvim, + self, + inputs, + username, + config, + home-manager, + ... +}: +{ imports = [ ./gtk.nix ./spicetify.nix @@ -6,10 +16,11 @@ ./userservices.nix ./starship.nix ./userpkgs.nix - ./zsh - ./shed ./swaync.nix ./hyprland.nix ./waybar.nix + ./zsh + ./shed + ./paperd ]; } diff --git a/modules/home/environment/gtk.nix b/modules/home/environment/gtk.nix index 2fa4607..36a2a60 100755 --- a/modules/home/environment/gtk.nix +++ b/modules/home/environment/gtk.nix @@ -1,16 +1,20 @@ -{ lib, config, pkgs, ... }: { +{ + lib, + config, + pkgs, + ... +}: +{ options = { - movOpts.envConfig.gtkConfig.enable = - lib.mkEnableOption "enable my gtk options"; + movOpts.envConfig.gtkConfig.enable = lib.mkEnableOption "enable my gtk options"; }; config = lib.mkIf config.movOpts.envConfig.gtkConfig.enable { fonts.fontconfig.enable = true; - home.packages = with pkgs; - [ - nerd-fonts.jetbrains-mono - nerd-fonts.symbols-only - cascadia-code - ]; + home.packages = with pkgs; [ + nerd-fonts.jetbrains-mono + nerd-fonts.symbols-only + cascadia-code + ]; gtk = { enable = true; diff --git a/modules/home/environment/hyprland.nix b/modules/home/environment/hyprland.nix index 0ff663a..2cfe5d5 100755 --- a/modules/home/environment/hyprland.nix +++ b/modules/home/environment/hyprland.nix @@ -1,34 +1,46 @@ -{ inputs, pkgs, lib, config, self, host, ... }: +{ + inputs, + pkgs, + lib, + config, + self, + host, + ... +}: let desktop = host == "oganesson" || host == "phosphorous"; - screenshot_bind = if desktop then - [ - "super, print, exec, grimblast copy area" - "super shift, print, exec, grimblast --freeze copy area" - ] - else - [ - # My laptop does not have a printscreen button - "super, insert, exec, grimblast copy area" - ]; + screenshot_bind = + if desktop then + [ + "super, print, exec, grimblast copy area" + "super shift, print, exec, grimblast --freeze copy area" + ] + else + [ + # My laptop does not have a printscreen button + "super, insert, exec, grimblast copy area" + ]; scheme = config.lib.stylix.colors; mons = config.movOpts.envConfig.hyprlandConfig.monitorNames; - smartGapsWorkspaces = [ - "w[tv1], gapsout:0, gapsin:0" - "f[1], gapsout:0, gapsin:0" - ]; - smartGapsWindowrules = [ - "border_size 0, match:float 0, match:workspace w[tv1]" - "rounding 0, match:float 0, match:workspace w[tv1]" - "border_size 0, match:float 0, match:workspace f[1]" - "rounding 0, match:float 0, match:workspace f[1]" - ]; - hostWorkspaces = if (host == "phosphorous") then - [ - "m[DP-3], layoutopt:orientation:top" - ] - else []; -in { + #smartGapsWorkspaces = [ + #"w[tv1], gapsout:0, gapsin:0" + #"f[1], gapsout:0, gapsin:0" + #]; + #smartGapsWindowrules = [ + #"border_size 0, match:float 0, match:workspace w[tv1]" + #"rounding 0, match:float 0, match:workspace w[tv1]" + #"border_size 0, match:float 0, match:workspace f[1]" + #"rounding 0, match:float 0, match:workspace f[1]" + #]; + hostWorkspaces = + if (host == "phosphorous") then + [ + "m[DP-3], layoutopt:orientation:top" + ] + else + [ ]; +in +{ options = { movOpts.envConfig.hyprlandConfig = { @@ -41,7 +53,10 @@ in { type = lib.types.listOf lib.types.str; # The order of the monitor names matters for the purpose of workspace assignment # For instance, in a dual monitor setup, index 0 gets 4,5 and 6, while index 1 gets 1,2 and 3 - default = [ "DP-1" "HDMI-A-1" ]; + default = [ + "DP-1" + "HDMI-A-1" + ]; }; }; }; @@ -58,23 +73,32 @@ in { wayland direnv ]; - systemd.user.targets.hyprland-session.Unit.Wants = - [ "xdg-desktop-autostart.target" ]; + systemd.user.targets.hyprland-session.Unit.Wants = [ "xdg-desktop-autostart.target" ]; wayland.windowManager.hyprland = { enable = true; - xwayland = { enable = true; }; + xwayland = { + enable = true; + }; systemd.enable = true; + extraConfig = '' + source = ~/.local/state/sysflake/hyprland-colors.conf + ''; }; wayland.windowManager.hyprland = { settings = { - monitor = if (host == "oganesson") then [ - "DP-1, 1920x1080@144, 1920x0, 1" - "HDMI-A-1, 1920x1080, 0x0, 1" - ] else if (host == "phosphorous") then [ - "DP-1, highrr, 0x0, 1" - "DP-3, highrr, -1080x-420, 1, transform, 3" - ] else - [ "eDP-1, 1600x900, 0x0, 1" ]; + monitor = + if (host == "oganesson") then + [ + "DP-1, 1920x1080@144, 1920x0, 1" + "HDMI-A-1, 1920x1080, 0x0, 1" + ] + else if (host == "phosphorous") then + [ + "DP-1, highrr, 0x0, 1" + "DP-3, highrr, -1080x-420, 1, transform, 3" + ] + else + [ "eDP-1, 1600x900, 0x0, 1" ]; exec-once = [ "waybar &" @@ -87,26 +111,37 @@ in { "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &" ]; - workspace = hostWorkspaces ++ (if (config.movOpts.envConfig.hyprlandConfig.workspaceLayout == "dualmonitor") then [ - "1,persistent=true,monitor:${builtins.elemAt mons 0}" - "2,persistent=true,monitor:${builtins.elemAt mons 0}" - "3,persistent=true,monitor:${builtins.elemAt mons 0}" - "4,persistent=true,monitor:${builtins.elemAt mons 1}" - "5,persistent=true,monitor:${builtins.elemAt mons 1}" - "6,persistent=true,monitor:${builtins.elemAt mons 1}" - ] else if (config.movOpts.envConfig.hyprlandConfig.workspaceLayout == "singlemonitor") then [ - "1,persistent=true,monitor:${builtins.elemAt mons 0} " - "2,persistent=true,monitor:${builtins.elemAt mons 0}" - "3,persistent=true,monitor:${builtins.elemAt mons 0}" - "4,persistent=true,monitor:${builtins.elemAt mons 0}" - ] else if (config.movOpts.envConfig.hyprlandConfig.workspaceLayout == "trimonitor") then [ + workspace = + hostWorkspaces + ++ ( + if (config.movOpts.envConfig.hyprlandConfig.workspaceLayout == "dualmonitor") then + [ + "1,persistent=true,monitor:${builtins.elemAt mons 0}" + "2,persistent=true,monitor:${builtins.elemAt mons 0}" + "3,persistent=true,monitor:${builtins.elemAt mons 0}" + "4,persistent=true,monitor:${builtins.elemAt mons 1}" + "5,persistent=true,monitor:${builtins.elemAt mons 1}" + "6,persistent=true,monitor:${builtins.elemAt mons 1}" + ] + else if (config.movOpts.envConfig.hyprlandConfig.workspaceLayout == "singlemonitor") then + [ + "1,persistent=true,monitor:${builtins.elemAt mons 0} " + "2,persistent=true,monitor:${builtins.elemAt mons 0}" + "3,persistent=true,monitor:${builtins.elemAt mons 0}" + "4,persistent=true,monitor:${builtins.elemAt mons 0}" + ] + else if (config.movOpts.envConfig.hyprlandConfig.workspaceLayout == "trimonitor") then + [ "1,persistent=true,monitor:${builtins.elemAt mons 2}" "2,persistent=true,monitor:${builtins.elemAt mons 2}" "3,persistent=true,monitor:${builtins.elemAt mons 1}" "4,persistent=true,monitor:${builtins.elemAt mons 1}" "5,persistent=true,monitor:${builtins.elemAt mons 0}" "6,persistent=true,monitor:${builtins.elemAt mons 0}" - ] else [ ]) ++ smartGapsWorkspaces; + ] + else + [ ] + ); env = [ "XDG_CONFIG_HOME,$HOME/.config" @@ -114,38 +149,38 @@ in { "XDG_CACHE_HOME,$HOME/.cache" ]; layerrule = [ - "match:namespace = waybar, blur 1" - "match:namespace = waybar, ignore_alpha 0" + "blur on, ignore_alpha 0, match:namespace waybar" "match:namespace = launcher, blur 1" ]; - windowrule = [ - # From old windowrulev2 - "float true, match:class ^(thunar)$, match:title ^(.*File Operation Progress.*)$" - "float true, match:class ^(firefox)$, match:title ^(Library)$" - "float true, match:class ^(thunar)$, match:title ^(File Operation Progress)$" - "float true, match:class ^(thunar)$, match:title ^(Confirm to replace files)$" - "float true, match:title ^(bwarn)$" - "no_initial_focus on, match:class ^(steam)$" - "float true, match:class ^(firefox)$, match:title ^(ログイン - Google アカウント — Mozilla Firefox)$" - "float true, match:class ^(firefox)$, match:title ^(Firefox — Sharing Indicator)$" - "float true, match:class ^(firefox)$, match:title ^(Firefox — 共有インジケーター)$" - "float true, match:class ^(firefox)$, match:title ^(.*Sign in.*)$" - # From old windowrule - "float true, match:class ^(qt5ct)$" - "float true, match:class ^(zoom)$" - "float true, match:class ^(Steam)$" - "idle_inhibit focus, match:class ^(mpv)$" - "float true, match:title ^(Picture-in-Picture)$" - "float true, match:class ^(nm-connection-editor)$" - "float true, match:class ^(waypaper)$" - "float true, match:title ^(Sign In)(.*)$" - "float true, match:title ^(Firefox — 共有インジケーター)$" - "no_focus on, match:title ^(Firefox — 共有インジケーター)$" - "float true, match:class ^(firefox)$, match:title ^(Sign in - Google Accounts — Mozilla Firefox)$" - "size 0 0, match:title ^(Firefox — 共有インジケーター)$" - "move 100%-470 15, match:title ^(Firefox — Sharing Indicator)$" - "move 100%-470 15, match:title ^(Firefox — 共有インジケーター)$" - ] ++ smartGapsWindowrules; + windowrule = [ + # From old windowrulev2 + "float true, match:class ^(thunar)$, match:title ^(.*File Operation Progress.*)$" + "float true, match:class ^(firefox)$, match:title ^(Library)$" + "float true, match:class ^(thunar)$, match:title ^(File Operation Progress)$" + "float true, match:class ^(thunar)$, match:title ^(Confirm to replace files)$" + "float true, match:title ^(bwarn)$" + "no_initial_focus on, match:class ^(steam)$" + "float true, match:class ^(firefox)$, match:title ^(ログイン - Google アカウント — Mozilla Firefox)$" + "float true, match:class ^(firefox)$, match:title ^(Firefox — Sharing Indicator)$" + "float true, match:class ^(firefox)$, match:title ^(Firefox — 共有インジケーター)$" + "float true, match:class ^(firefox)$, match:title ^(.*Sign in.*)$" + # From old windowrule + "float true, match:class ^(qt5ct)$" + "float true, match:class ^(zoom)$" + "float true, match:class ^(Steam)$" + "idle_inhibit focus, match:class ^(mpv)$" + "float true, match:title ^(Picture-in-Picture)$" + "float true, match:class ^(nm-connection-editor)$" + "float true, match:class ^(waypaper)$" + "float true, match:title ^(Sign In)(.*)$" + "float true, match:title ^(Firefox — 共有インジケーター)$" + "no_focus on, match:title ^(Firefox — 共有インジケーター)$" + "float true, match:class ^(firefox)$, match:title ^(Sign in - Google Accounts — Mozilla Firefox)$" + "size 0 0, match:title ^(Firefox — 共有インジケーター)$" + "opacity 0.8, match:title ^(Neovide)$" + "move 100%-470 15, match:title ^(Firefox — Sharing Indicator)$" + "move 100%-470 15, match:title ^(Firefox — 共有インジケーター)$" + ]; cursor = { no_hardware_cursors = true; @@ -154,24 +189,24 @@ in { input = { kb_layout = "us"; follow_mouse = 1; - accel_profile = "flat"; + follow_mouse_threshold = 5; force_no_accel = 1; sensitivity = 0; }; - general = { - gaps_in = 5; - gaps_out = "0, 9, 9, 9"; # top, right, bottom, left - border_size = 3; - "col.active_border" = lib.mkForce "rgba(404042ff)"; - "col.inactive_border" = lib.mkForce "rgba(83858a00)"; - layout = "master"; - resize_on_border = true; + general = { + gaps_in = 5; + gaps_out = "0, 9, 9, 9"; # top, right, bottom, left + border_size = 3; + "col.active_border" = lib.mkForce "rgba(404042ff)"; + "col.inactive_border" = lib.mkForce "rgba(83858a00)"; + layout = "master"; + resize_on_border = true; - snap = { - enabled = true; - window_gap = 5; - }; - }; + snap = { + enabled = true; + window_gap = 5; + }; + }; misc = { font_family = "EnvyCodeR Nerd Font Mono"; disable_autoreload = true; @@ -188,7 +223,6 @@ in { }; dwindle = { - force_split = 2; pseudotile = "yes"; preserve_split = "yes"; }; @@ -203,83 +237,92 @@ in { decoration = { rounding = 4; + blur = { + enabled = true; + size = 8; + passes = 2; + }; + shadow = { - enabled = true; - ignore_window = true; - range = 80; - render_power = 50; - }; + enabled = true; + ignore_window = true; + range = 20; + render_power = 50; + }; }; - cursor = { - hide_on_key_press = true; - }; + cursor = { + hide_on_key_press = true; + }; animations = { enabled = true; bezier = [ - "myBezier, 0.16, 1, 0.3, 1" + "myBezier, 0.16, 1, 0.3, 1" ]; animation = [ "windows, 1, 7, myBezier, popin 80%" - "fade, 1, 7, myBezier" - "workspaces, 1, 6, myBezier, slidefade 80%" + "fade, 1, 7, myBezier" + "workspaces, 1, 6, myBezier, slidefade 80%" ]; }; - bind = [ - "super, up, exec, pactl set-sink-volume @default_sink@ +10%" - "super, down, exec, pactl set-sink-volume @default_sink@ -10%" - "super, t, exec, swaync-client -t -sw" - "super, a, exec, firefox" - "super, q, exec, kitty" - "super shift, q, exec, [float;size 40% 30%;move onscreen cursor -50% -50%] kitty" - "super, c, killactive," - "super shift, c,exec, hyprctl kill" - "super, e, exec, [float;size 40% 50%;move onscreen cursor -50% -50%] nemo" - "super, p, exec, [float;size 40% 25%;move onscreen cursor] [ ! -f /tmp/keyringfile ] && kitty toolbelt" - "super shift, m, exit," - "super, m, exec, fuzzel" - "super, r, exec, neovide" - "super, b, layoutmsg, togglesplit, # dwindle" - "super, comma, layoutmsg, rollnext" # comma - "super, period, layoutmsg, rollprev" + bind = [ + "super, up, exec, pactl set-sink-volume @default_sink@ +10%" + "super, down, exec, pactl set-sink-volume @default_sink@ -10%" + "super, t, exec, swaync-client -t -sw" + "super, a, exec, firefox" + "super, q, exec, kitty" + "super shift, q, exec, [float;size 40% 30%;move onscreen cursor -50% -50%] kitty" + "super, c, killactive," + "super shift, c,exec, hyprctl kill" + "super, e, exec, [float;size 40% 50%;move onscreen cursor -50% -50%] nemo" + "super, p, exec, [float;size 40% 25%;move onscreen cursor] [ ! -f /tmp/keyringfile ] && kitty toolbelt" + "super shift, m, exit," + "super, m, exec, fuzzel" + "super, r, exec, neovide" + "super, b, layoutmsg, togglesplit, # dwindle" + "super, comma, exec, hyprctl dispatch layoutmsg rollnext; hyprctl dispatch layoutmsg focusmaster" + "super, period, exec, hyprctl dispatch layoutmsg rollprev; hyprctl dispatch layoutmsg focusmaster" "super, n, layoutmsg, swapwithmaster" - "super, f, togglefloating" - "super, g, fullscreen" - "super, h, movefocus, l" - "super, l, movefocus, r" - "super, k, movefocus, u" - "super, j, movefocus, d" + "super, f, togglefloating" + "super, g, fullscreen" + "super, h, movefocus, l" + "super, l, movefocus, r" + "super, k, movefocus, u" + "super, j, movefocus, d" "super, y, exec, /home/pagedmov/splitman-ipc.sh start" "super, u, exec, /home/pagedmov/splitman-ipc.sh split" "super, i, exec, /home/pagedmov/splitman-ipc.sh stop" "super, o, exec, /home/pagedmov/splitman-ipc.sh pause" - "super shift, h, movewindow, l" - "super shift, l, movewindow, r" - "super shift, k, movewindow, u" - "super shift, j, movewindow, d" - "super, d, exec, switchmon" - "super, 1, exec, hyprctl 'dispatch workspace 1'" - "super, 2, exec, hyprctl 'dispatch workspace 2'" - "super, 3, exec, hyprctl 'dispatch workspace 3'" - "super, 4, exec, hyprctl 'dispatch workspace 4'" - "super, 5, exec, hyprctl 'dispatch workspace 5'" - "super, 6, exec, hyprctl 'dispatch workspace 6'" - "super shift, 1, movetoworkspace, 1" - "super shift, 2, movetoworkspace, 2" - "super shift, 3, movetoworkspace, 3" - "super shift, 4, movetoworkspace, 4" - "super shift, 5, movetoworkspace, 5" - "super shift, 6, movetoworkspace, 6" - "super, s, togglespecialworkspace, magic" - "super shift, s, movetoworkspace, special:magic" - ] ++ screenshot_bind; - bindm = - [ "super, mouse:272, movewindow" "super, mouse:273, resizewindow" ]; + "super shift, h, movewindow, l" + "super shift, l, movewindow, r" + "super shift, k, movewindow, u" + "super shift, j, movewindow, d" + "super, d, exec, switchmon" + "super, 1, exec, hyprctl 'dispatch workspace 1'" + "super, 2, exec, hyprctl 'dispatch workspace 2'" + "super, 3, exec, hyprctl 'dispatch workspace 3'" + "super, 4, exec, hyprctl 'dispatch workspace 4'" + "super, 5, exec, hyprctl 'dispatch workspace 5'" + "super, 6, exec, hyprctl 'dispatch workspace 6'" + "super shift, 1, movetoworkspace, 1" + "super shift, 2, movetoworkspace, 2" + "super shift, 3, movetoworkspace, 3" + "super shift, 4, movetoworkspace, 4" + "super shift, 5, movetoworkspace, 5" + "super shift, 6, movetoworkspace, 6" + "super, s, togglespecialworkspace, magic" + "super shift, s, movetoworkspace, special:magic" + ] + ++ screenshot_bind; + bindm = [ + "super, mouse:272, movewindow" + "super, mouse:273, resizewindow" + ]; }; }; }; diff --git a/modules/home/environment/paperd/default.nix b/modules/home/environment/paperd/default.nix new file mode 100644 index 0000000..d79a21c --- /dev/null +++ b/modules/home/environment/paperd/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./paperd.nix + ]; +} diff --git a/modules/home/environment/paperd/paperd.nix b/modules/home/environment/paperd/paperd.nix new file mode 100644 index 0000000..38ad6d7 --- /dev/null +++ b/modules/home/environment/paperd/paperd.nix @@ -0,0 +1,35 @@ +{ + self, + pkgs, + lib, + ... +}: + +let + paperdScript = import ./paperd_script.nix { inherit pkgs; }; +in +{ + home.file.".config/paperd/config.toml".text = '' + wallpaper_dir = "${self}/assets/wallpapers/selective_color" + interval = 1800 + + [transition] + type = "fade" + duration = 3 + fps = 60 + ''; + systemd.user.services = { + paperd = { + Unit = { + Description = "Paperd Wallpaper Daemon"; + After = [ "swww-daemon.service" ]; + Requires = [ "swww-daemon.service" ]; + }; + Install.WantedBy = [ "hyprland-session.target" ]; + Service = { + Environment = "PYTHONUNBUFFERED=1"; + ExecStart = "${pkgs.myPython}/bin/python3 ${paperdScript}"; + }; + }; + }; +} diff --git a/modules/home/environment/paperd/paperd_script.nix b/modules/home/environment/paperd/paperd_script.nix new file mode 100644 index 0000000..4b153c2 --- /dev/null +++ b/modules/home/environment/paperd/paperd_script.nix @@ -0,0 +1,89 @@ +{ pkgs }: + +let + themeBuilder = import ./theme_builder.nix { inherit pkgs; }; +in +pkgs.writeText "paperd.py" /* python */ '' + import tomllib + import sys + import time + from pathlib import Path + from collections import deque + import subprocess + from pynvim import attach + + + config = None + + with open(Path("~/.config/paperd/config.toml").expanduser(), "rb") as f: + config = tomllib.load(f) + + interval = config["interval"] + paper_dir = Path(config["wallpaper_dir"]) + transition = config.get("transition", {}) + transition_type = transition.get("type") + transition_fps = transition.get("fps") + transition_duration = transition.get("duration") + transition_angle = transition.get("angle") + transition_step = transition.get("step") + + exts = {".jpg", ".jpeg", ".png", ".webp"} + images = deque([f for f in Path(paper_dir).iterdir() if f.suffix.lower() in exts]) + + if len(images) == 0: + print("No images found in the specified directory.") + sys.exit(1) + + def get_command(): + command = ["${pkgs.swww}/bin/swww", "img"] + if transition_type: + command.append("--transition-type") + command.append(transition_type) + if transition_fps: + command.append("--transition-fps") + command.append(str(transition_fps)) + if transition_duration: + command.append("--transition-duration") + command.append(str(transition_duration)) + if transition_angle: + command.append("--transition-angle") + command.append(str(transition_angle)) + if transition_step: + command.append("--transition-step") + command.append(str(transition_step)) + command.append(str(images[0])) + return command + + + print(f"Found {len(images)} images. Starting wallpaper rotation every {interval} seconds.") + current_time = int(time.time()) + + initial_idx = (current_time // interval) % len(images) + + command = get_command() + subprocess.run(command) + subprocess.run(["${pkgs.myPython}/bin/python3", "${themeBuilder}", str(images[0])]) + + print(f"Setting wallpaper to {images[0]} with transition {transition_type} (fps: {transition_fps}, duration: {transition_duration}, angle: {transition_angle}, step: {transition_step})") + + images.rotate(-1) + last_check = current_time % interval + time.sleep(5) + + while True: + current_time = int(time.time()) + if (current_time % interval) >= last_check: + last_check = current_time % interval + time.sleep(5) + continue + + command = get_command() + + print(f"Setting wallpaper to {images[0]} with transition {transition_type} (fps: {transition_fps}, duration: {transition_duration}, angle: {transition_angle}, step: {transition_step})") + + subprocess.run(command) + subprocess.run(["${pkgs.myPython}/bin/python3", "${themeBuilder}", str(images[0])]) + images.rotate(-1) + last_check = current_time % interval + time.sleep(5) +'' diff --git a/modules/home/environment/paperd/theme_builder.nix b/modules/home/environment/paperd/theme_builder.nix new file mode 100644 index 0000000..567fd42 --- /dev/null +++ b/modules/home/environment/paperd/theme_builder.nix @@ -0,0 +1,474 @@ +{ pkgs }: + +pkgs.writeText "theme-builder.py" '' + from colorsys import rgb_to_hls, hls_to_rgb + from collections import Counter + from pathlib import Path + from PIL import Image + from pynvim import attach + import subprocess + import math + import os + import sys + + STATE_DIR = Path(os.path.expanduser("~/.local/state/sysflake")) + MULT = 2.5 + + GRAYSCALE = { + "base00": "1a1a1a", + "base01": "2a2a2a", + "base02": "3a3a3a", + "base03": "5a5a5a", + "base04": "8a8a8a", + "base05": "b0b0b0", + "base06": "d0d0d0", + "base07": "e8e8e8", + "base08": "4a4a4a", + "base09": "555555", + "base0A": "606060", + "base0B": "6b6b6b", + "base0C": "767676", + "base0D": "818181", + "base0E": None, # accent slot + "base0F": "8c8c8c", + } + + KITTY_MAP = { + "background": "00", "foreground": "05", "cursor": "05", + "selection_background": "02", "selection_foreground": "05", + "color0": "00", "color1": "08", "color2": "0E", "color3": "0A", + "color4": "0D", "color5": "0E", "color6": "0E", "color7": "05", + "color8": "03", "color9": "08", "color10": "0E", "color11": "0A", + "color12": "0D", "color13": "0E", "color14": "0E", "color15": "07", + } + + + def extract_accent(image_path): + img = Image.open(image_path).resize((200, 200)).quantize(colors=32).convert("RGB") + pixels = list(img.get_flattened_data()) + counts = Counter(pixels) + total = len(pixels) + + def score(color): + _, l, s = rgb_to_hls(color[0] / 255, color[1] / 255, color[2] / 255) + vibrancy = s * (1 - abs(l - 0.5) * 2) + frequency = counts[color] / total + return vibrancy * frequency + + best = max(counts.keys(), key=score) + h, l, s = rgb_to_hls(best[0] / 255, best[1] / 255, best[2] / 255) + + new_s = min(max(s * MULT, 0.6), 0.7) + + # Blue hues are perceptually darker — gradually boost lightness floor + blue_center = 0.63 + blue_width = 0.09 + blue_factor = max(0, 1 - abs(h - blue_center) / blue_width) + min_l = 0.45 + 0.2 * blue_factor + + new_l = max(min_l, min(0.7, l)) + r, g, b = hls_to_rgb(h, new_l, new_s) + return f"{int(r * 255):02x}{int(g * 255):02x}{int(b * 255):02x}" + + + def build_scheme(accent): + scheme = dict(GRAYSCALE) + scheme["base0E"] = accent + return scheme + + + def write_scheme(scheme): + path = STATE_DIR / "scheme.txt" + with open(path, "w") as f: + for key, val in scheme.items(): + f.write(f"{key} {val}\n") + + + def write_kitty(scheme): + path = STATE_DIR / "kitty-colors.conf" + with open(path, "w") as f: + for name, base in KITTY_MAP.items(): + f.write(f"{name} #{scheme['base' + base]}\n") + + + VESKTOP_DIR = Path(os.path.expanduser("~/.config/vesktop/themes")) + + + def hex_to_oklch(hex_color): + """Convert hex color to oklch (lightness, chroma, hue) values.""" + r = int(hex_color[0:2], 16) / 255 + g = int(hex_color[2:4], 16) / 255 + b = int(hex_color[4:6], 16) / 255 + + # sRGB to linear + def to_linear(c): + return c / 12.92 if c <= 0.04045 else ((c + 0.055) / 1.055) ** 2.4 + + lr, lg, lb = to_linear(r), to_linear(g), to_linear(b) + + # Linear RGB to OKLab + l_ = 0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb + m_ = 0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb + s_ = 0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb + + l_ = l_ ** (1/3) if l_ >= 0 else -((-l_) ** (1/3)) + m_ = m_ ** (1/3) if m_ >= 0 else -((-m_) ** (1/3)) + s_ = s_ ** (1/3) if s_ >= 0 else -((-s_) ** (1/3)) + + L = 0.2104542553 * l_ + 0.7936177850 * m_ - 0.0040720468 * s_ + a = 1.9779984951 * l_ - 2.4285922050 * m_ + 0.4505937099 * s_ + bv = 0.0259040371 * l_ + 0.7827717662 * m_ - 0.8086757660 * s_ + + C = math.sqrt(a ** 2 + bv ** 2) + H = math.degrees(math.atan2(bv, a)) % 360 + + return L, C, H + + + def write_vesktop(scheme): + VESKTOP_DIR.mkdir(parents=True, exist_ok=True) + accent = scheme["base0E"] + _, chroma, hue = hex_to_oklch(accent) + + path = VESKTOP_DIR / "system24-dynamic.css" + with open(path, "w") as f: + f.write("""\ + /** + * system24 dynamic theme — generated by theme-engine + */ + + @import url('https://refact0r.github.io/system24/build/system24.css'); + + :root { + --colors: on; + + /* override purple (accent) with extracted color */ + """) + for i, lightness in enumerate([75, 70, 65, 60, 55], start=1): + f.write(f" --purple-{i}: oklch({lightness}% {chroma:.4f} {hue:.1f});\n") + + f.write("}\n") + + + def write_nvim(scheme): + accent = scheme["base0E"] + path = STATE_DIR / "nvim-colors.lua" + with open(path, "w") as f: + f.write("require('base16-colorscheme').setup({\n") + for key, val in scheme.items(): + f.write(f" {key} = '#{val}',\n") + f.write("})\n\n") + f.write(f"local accent = '#{accent}'\n") + f.write(f"local light_gray = '#{scheme['base05']}'\n") + for group in ["Statement", "Conditional", "Repeat", "Macro", "Function", "Exception", + "TSMethod", "@lsp.type.method", "@lsp.type.function", "@lsp.type.macro", + "DiagnosticUnderlineHint", "Boolean"]: + f.write(f"vim.api.nvim_set_hl(0, '{group}', {{ fg = accent }})\n") + for group in ["@lsp.type.variable", "@lsp.type.parameter", "@lsp.type.struct", "@lsp.type.class", + "@lsp.type.selfTypeKeyword", "Identifier"]: + f.write(f"vim.api.nvim_set_hl(0, '{group}', {{ fg = light_gray }})\n") + for group in ["@lsp.type.enumMember", "@lsp.type.enum", "Number", "Integer"]: + f.write(f"vim.api.nvim_set_hl(0, '{group}', {{ fg = '#{scheme['base04']}' }})\n") + + + def write_swaync(scheme): + accent = scheme["base0E"] + path = STATE_DIR / "swaync-colors.css" + with open(path, "w") as f: + f.write(f"""\ + @define-color base #{scheme['base00']}; + @define-color mantle #{scheme['base01']}; + @define-color crust #{scheme['base00']}; + @define-color text #{scheme['base05']}; + @define-color subtext0 #{scheme['base04']}; + @define-color subtext1 #{scheme['base05']}; + @define-color surface0 #{scheme['base01']}; + @define-color surface1 #{scheme['base02']}; + @define-color surface2 #{scheme['base03']}; + @define-color overlay0 #{scheme['base03']}; + @define-color overlay1 #{scheme['base04']}; + @define-color overlay2 #{scheme['base04']}; + @define-color lavender #{accent}; + """) + + + EZA_DIR = Path(os.path.expanduser("~/.config/eza")) + + + def write_eza(scheme): + EZA_DIR.mkdir(parents=True, exist_ok=True) + accent = f'"#{scheme["base0E"]}"' + file_color = f'"#{scheme["base05"]}"' + dim = f'"#{scheme["base04"]}"' + dimmer = f'"#{scheme["base03"]}"' + dark = f'"#{scheme["base02"]}"' + + path = EZA_DIR / "theme.yml" + with open(path, "w") as f: + f.write(f"""\ + filekinds: + normal: + foreground: {file_color} + directory: + foreground: {accent} + is_bold: true + is_underline: true + symlink: + foreground: {dim} + pipe: + foreground: {dimmer} + block_device: + foreground: {dim} + char_device: + foreground: {dim} + socket: + foreground: {dimmer} + special: + foreground: {dim} + executable: + foreground: {accent} + is_bold: true + mount_point: + foreground: {accent} + + perms: + user_read: + foreground: {file_color} + user_write: + foreground: {dim} + user_execute_file: + foreground: {accent} + user_execute_other: + foreground: {accent} + group_read: + foreground: {dim} + group_write: + foreground: {dimmer} + group_execute: + foreground: {dim} + other_read: + foreground: {dimmer} + other_write: + foreground: {dimmer} + other_execute: + foreground: {dimmer} + special_user_file: + foreground: {accent} + special_other: + foreground: {dimmer} + attribute: + foreground: {dimmer} + + size: + number_byte: + foreground: {file_color} + number_kilo: + foreground: {dim} + number_mega: + foreground: {dim} + number_giga: + foreground: {accent} + number_huge: + foreground: {accent} + unit_byte: + foreground: {dimmer} + unit_kilo: + foreground: {dimmer} + unit_mega: + foreground: {dimmer} + unit_giga: + foreground: {dimmer} + unit_huge: + foreground: {dimmer} + + users: + user_you: + foreground: {file_color} + user_root: + foreground: {accent} + user_other: + foreground: {dim} + group_yours: + foreground: {dim} + group_other: + foreground: {dimmer} + group_root: + foreground: {accent} + + links: + normal: + foreground: {dim} + multi_link_file: + foreground: {accent} + + git: + new: + foreground: {accent} + modified: + foreground: {dim} + deleted: + foreground: {dimmer} + renamed: + foreground: {dim} + typechange: + foreground: {dim} + ignored: + foreground: {dark} + conflicted: + foreground: {accent} + + git_repo: + branch_main: + foreground: {file_color} + branch_other: + foreground: {dim} + git_clean: + foreground: {accent} + git_dirty: + foreground: {dim} + + file_type: + image: + foreground: {dim} + video: + foreground: {dim} + music: + foreground: {dim} + lossless: + foreground: {dim} + crypto: + foreground: {dimmer} + document: + foreground: {file_color} + compressed: + foreground: {dimmer} + temp: + foreground: {dark} + compiled: + foreground: {dimmer} + build: + foreground: {dimmer} + source: + foreground: {file_color} + + punctuation: + foreground: {dimmer} + date: + foreground: {dim} + inode: + foreground: {dimmer} + blocks: + foreground: {dimmer} + header: + foreground: {file_color} + octal: + foreground: {dimmer} + flags: + foreground: {dim} + + symlink_path: + foreground: {dim} + control_char: + foreground: {dimmer} + broken_symlink: + foreground: {accent} + broken_path_overlay: + foreground: {dark} + """) + + + def write_waybar(scheme): + accent = scheme["base0E"] + bg = scheme["base00"] + fg = scheme["base05"] + path = STATE_DIR / "waybar-colors.css" + with open(path, "w") as f: + f.write(f"@define-color accent #{accent};\n") + f.write(f"@define-color bg-dark #{bg};\n") + f.write(f"@define-color fg-text #{fg};\n") + + + def write_hyprland(scheme): + accent = scheme["base0E"] + inactive = scheme["base03"] + path = STATE_DIR / "hyprland-colors.conf" + with open(path, "w") as f: + f.write(f"general:col.active_border = rgba({accent}ff)\n") + f.write(f"general:col.inactive_border = rgba({inactive}ff)\n") + + + def reload_apps(): + print("Reloading applications with new theme...") + subprocess.run(["pkill", "-SIGUSR1", "kitty"], capture_output=True) + print("Sent reload signal to Kitty.") + + nvim_colors = STATE_DIR / "nvim-colors.lua" + for sock in Path("/run/user/1000").glob("nvim.*.0"): + try: + nvim = attach('socket', path=str(sock)) + nvim.command(f"luafile {nvim_colors}") + print(f"Sent reload command to Neovim instance at {sock}.") + except Exception as e: + print(f"Failed to connect to Neovim instance at {sock}: {e}") + + # Live-update hyprland borders + scheme = {} + for line in open(STATE_DIR / "scheme.txt"): + k, v = line.split() + scheme[k] = v + subprocess.run(["hyprctl", "keyword", "general:col.active_border", f"rgba({scheme['base0E']}ff)"], capture_output=True) + subprocess.run(["hyprctl", "keyword", "general:col.inactive_border", f"rgba({scheme['base03']}ff)"], capture_output=True) + print("Updated Hyprland border colors.") + + # Reload swaync styles + subprocess.run(["swaync-client", "-rs"], capture_output=True) + print("Sent reload signal to Swaync.") + + # Reload waybar + subprocess.run(["pkill", "-SIGUSR2", "waybar"], capture_output=True) + print("Sent reload signal to Waybar.") + + + def main(): + if len(sys.argv) < 2: + print("Usage: theme-engine.py ", file=sys.stderr) + sys.exit(1) + + STATE_DIR.mkdir(parents=True, exist_ok=True) + + accent = extract_accent(sys.argv[1]) + scheme = build_scheme(accent) + print(f"Extracted accent color: #{accent}") + write_scheme(scheme) + print("Scheme written to state directory.") + write_kitty(scheme) + print("Kitty config written.") + write_vesktop(scheme) + print("Vesktop theme written.") + write_nvim(scheme) + print("Neovim colors written.") + write_hyprland(scheme) + print("Hyprland colors written.") + write_swaync(scheme) + print("Swaync colors written.") + write_eza(scheme) + print("Eza theme written.") + write_waybar(scheme) + print("Waybar colors written.") + reload_apps() + print("Sent reload signals to applications.") + + print(f"Accent: #{accent}") + print(f"Scheme written to {STATE_DIR / 'scheme.txt'}") + print(f"Kitty config written to {STATE_DIR / 'kitty-colors.conf'}") + print(f"Vesktop theme written to {VESKTOP_DIR / 'system24-dynamic.css'}") + print(f"Neovim colors written to {STATE_DIR / 'nvim-colors.lua'}") + print(f"Hyprland colors written to {STATE_DIR / 'hyprland-colors.conf'}") + print(f"Swaync colors written to {STATE_DIR / 'swaync-colors.css'}") + print(f"Eza theme written to {EZA_DIR / 'theme.yml'}") + print(f"Waybar colors written to {STATE_DIR / 'waybar-colors.css'}") + + + if __name__ == "__main__": + main() +'' diff --git a/modules/home/environment/shed/aliases.nix b/modules/home/environment/shed/aliases.nix index 4630147..e050c44 100644 --- a/modules/home/environment/shed/aliases.nix +++ b/modules/home/environment/shed/aliases.nix @@ -1,4 +1,10 @@ -{ lib, config, pkgs, self, ... }: +{ + lib, + config, + pkgs, + self, + ... +}: { programs.shed = { aliases = { @@ -20,7 +26,7 @@ mkexe = "chmod +x"; shortdate = "date +%m-%d-%y"; suvi = "sudoedit"; - suvide = "EDITOR=neovide; suvi"; + suvide = "EDITOR=neovide suvi"; rustdev = "nix develop github:km-clay/devshells#rust"; y = "yazi"; @@ -29,6 +35,8 @@ gpush = "gitpush_sfx"; gpull = "gitpull_sfx"; grebase = "gitrebase_sfx"; + videconf = "EDITOR=neovide viconf"; + nix-shell = "command nix-shell --command 'exec shed'"; }; }; } diff --git a/modules/home/environment/shed/extraconfig.nix b/modules/home/environment/shed/extraconfig.nix index 69d7eda..34926d2 100644 --- a/modules/home/environment/shed/extraconfig.nix +++ b/modules/home/environment/shed/extraconfig.nix @@ -1,4 +1,10 @@ -{ lib, config, self, pkgs, ... }: +{ + lib, + config, + self, + pkgs, + ... +}: let shellsound = "${pkgs.myScripts.playshellsound}/bin/playshellsound"; color-commit = "${pkgs.myScripts.color-commit}/bin/color-commit"; @@ -15,6 +21,8 @@ in if [ "$0" = "-shed" ]; then ${shellsound} $FLAKEPATH/assets/sound/login.wav fi + + if [ -n "$LS_COLORS" ]; then unset LS_COLORS; fi ''; }; } diff --git a/modules/home/environment/shed/functions.nix b/modules/home/environment/shed/functions.nix index ca71e6c..0498f92 100644 --- a/modules/home/environment/shed/functions.nix +++ b/modules/home/environment/shed/functions.nix @@ -276,7 +276,6 @@ in ls = /* bash */ '' eza -1 --group-directories-first --icons "$@" - ${shellsound} ${sndpath}/ls.wav ''; mkcd = /* bash */ '' @@ -286,7 +285,6 @@ in cd = /* bash */ '' eza -1 --group-directories-first --icons "$@" 2> /dev/null builtin cd "$@" - ${shellsound} ${sndpath}/cd.wav ''; hyprsock = /* bash */ '' diff --git a/modules/home/environment/shed/keymaps.nix b/modules/home/environment/shed/keymaps.nix index c2a0e49..6842dcb 100644 --- a/modules/home/environment/shed/keymaps.nix +++ b/modules/home/environment/shed/keymaps.nix @@ -2,7 +2,7 @@ { programs.shed = { functions = { - _read_obj= /* bash */ '' + _read_obj = /* bash */ '' _obj="" while read_key -v key; do if [[ "''${#_obj}" -ge 3 ]]; then return 1; fi diff --git a/modules/home/environment/spicetify.nix b/modules/home/environment/spicetify.nix index 7d6d7bf..7c3f51a 100755 --- a/modules/home/environment/spicetify.nix +++ b/modules/home/environment/spicetify.nix @@ -1,16 +1,21 @@ -{ lib, config, pkgs, inputs, ... }: +{ + lib, + config, + pkgs, + inputs, + ... +}: let spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; scheme = config.lib.stylix.colors; -in { +in +{ imports = [ inputs.spicetify-nix.homeManagerModules.default ]; options = { - movOpts.envConfig.spicetifyConfig.enable = - lib.mkEnableOption "enable my spicetify options"; + movOpts.envConfig.spicetifyConfig.enable = lib.mkEnableOption "enable my spicetify options"; }; config = lib.mkIf config.movOpts.envConfig.spicetifyConfig.enable { - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ "spotify" ]; + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "spotify" ]; programs.spicetify = { enable = true; diff --git a/modules/home/environment/starship.nix b/modules/home/environment/starship.nix index 627b2fb..ef8e5ee 100755 --- a/modules/home/environment/starship.nix +++ b/modules/home/environment/starship.nix @@ -1,7 +1,12 @@ -{ config, lib, inputs, ... }: { +{ + config, + lib, + inputs, + ... +}: +{ options = { - movOpts.envConfig.starshipConfig.enable = - lib.mkEnableOption "enables my starship configuration"; + movOpts.envConfig.starshipConfig.enable = lib.mkEnableOption "enables my starship configuration"; }; config = lib.mkIf config.movOpts.envConfig.starshipConfig.enable { programs.starship = { diff --git a/modules/home/environment/stylixhome.nix b/modules/home/environment/stylixhome.nix index 2d68dd8..e888f5d 100755 --- a/modules/home/environment/stylixhome.nix +++ b/modules/home/environment/stylixhome.nix @@ -1,19 +1,24 @@ -{ lib, self, config, host, pkgs, ... }: +{ + lib, + self, + config, + host, + pkgs, + ... +}: let scheme = "seti"; - wallpaper = "${self}/assets/wallpapers/dark-waves.jpg"; server = (host == "xenon"); -in { +in +{ options = { - movOpts.envConfig.stylixHomeConfig.enable = - lib.mkEnableOption "enables my stylix Home-Manager options"; + movOpts.envConfig.stylixHomeConfig.enable = lib.mkEnableOption "enables my stylix Home-Manager options"; }; config = lib.mkIf config.movOpts.envConfig.stylixHomeConfig.enable { stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/${scheme}.yaml"; - image = wallpaper; polarity = "dark"; autoEnable = true; targets = { diff --git a/modules/home/environment/swaync.nix b/modules/home/environment/swaync.nix index bbbc8b2..9954499 100755 --- a/modules/home/environment/swaync.nix +++ b/modules/home/environment/swaync.nix @@ -1,7 +1,12 @@ -{ lib, config, pkgs, ... }: { +{ + lib, + config, + pkgs, + ... +}: +{ options = { - movOpts.envConfig.swayncConfig.enable = - lib.mkEnableOption "enables my swaync configuration"; + movOpts.envConfig.swayncConfig.enable = lib.mkEnableOption "enables my swaync configuration"; }; config = lib.mkIf config.movOpts.envConfig.swayncConfig.enable { home.packages = with pkgs; [ swaynotificationcenter ]; @@ -608,6 +613,8 @@ .right.overlay-indicator { all: unset; } + + @import url("file:///home/pagedmov/.local/state/sysflake/swaync-colors.css"); ''; xdg.configFile."swaync/config.json".text = '' { diff --git a/modules/home/environment/userpkgs.nix b/modules/home/environment/userpkgs.nix index e762174..11ae454 100755 --- a/modules/home/environment/userpkgs.nix +++ b/modules/home/environment/userpkgs.nix @@ -1,4 +1,11 @@ -{ inputs, lib, config, pkgs, self, ... }: +{ + inputs, + lib, + config, + pkgs, + self, + ... +}: let scripts = with pkgs; [ @@ -25,74 +32,76 @@ let myScripts.color-commit myScripts.mntstack ]; - pythonWithStuff = pkgs.python3.withPackages(ps: with ps; [ requests ]); -in { +in +{ options = { - movOpts.envConfig.userPkgs.enable = - lib.mkEnableOption "enables my default user packages"; + movOpts.envConfig.userPkgs.enable = lib.mkEnableOption "enables my default user packages"; }; config = lib.mkIf config.movOpts.envConfig.userPkgs.enable { - home.packages = with pkgs; [ - cargo - rustc - clippy - rust-analyzer - nerd-fonts.envy-code-r - clippy - rust-analyzer - nemo - feh - gtk3 - vicut - imagemagick - vlc - lolcat - vesktop - zsh - zsh-syntax-highlighting - zsh-history-substring-search - zsh-autosuggestions - #libreoffice - gtrash - ripgrep - wf-recorder - toilet - vkbasalt - firefox - spotify - zathura - tor - tor-browser - chromium - obs-studio - gparted - dust - porsmo - w3m - sox - neovide - claude-code - pythonWithStuff - monero-cli - protonup-qt - piper - libratbag - ghostty - firefox - fd - delta - glfw - mesa-demos - xwayland - discord - cloc - wine - gimp - fira-code - nerd-fonts.fira-code - nodejs_latest - myPkgs.noto-sans-jp - myPkgs.billy-font - ] ++ scripts; + home.packages = + with pkgs; + [ + cargo + rustc + clippy + rust-analyzer + nerd-fonts.envy-code-r + clippy + rust-analyzer + nemo + feh + gtk3 + vicut + imagemagick + vlc + lolcat + vesktop + zsh + zsh-syntax-highlighting + zsh-history-substring-search + zsh-autosuggestions + #libreoffice + gtrash + ripgrep + wf-recorder + toilet + vkbasalt + firefox + spotify + zathura + tor + tor-browser + chromium + obs-studio + gparted + dust + porsmo + w3m + sox + neovide + claude-code + myPython + monero-cli + protonup-qt + piper + libratbag + ghostty + firefox + fd + delta + glfw + mesa-demos + xwayland + discord + cloc + wine + gimp + fira-code + nerd-fonts.fira-code + nodejs_latest + myPkgs.noto-sans-jp + myPkgs.billy-font + ] + ++ scripts; }; } diff --git a/modules/home/environment/userservices.nix b/modules/home/environment/userservices.nix index b1033a0..1540b02 100644 --- a/modules/home/environment/userservices.nix +++ b/modules/home/environment/userservices.nix @@ -1,27 +1,37 @@ { pkgs, self, ... }: let - pythonWithPkgs = pkgs.python3.withPackages (p: [ p.evdev ]); keyboardSfxScript = "${self}/assets/scripts/keyboard_sound_thing.py"; in { systemd.user = { timers = { maintenanceCheck = { - Unit = { Description = "Timer for package maintenance check"; }; + Unit = { + Description = "Timer for package maintenance check"; + }; Timer = { OnCalendar = "hourly"; Persistent = true; }; - Install = { WantedBy = [ "timers.target" ]; }; + Install = { + WantedBy = [ "timers.target" ]; + }; }; }; services = { + swww-daemon = { + Unit.Description = "Daemon for swww (sway wayland wallpaper manager)"; + Install.WantedBy = [ "hyprland-session.target" ]; + Service = { + ExecStart = "${pkgs.swww}/bin/swww-daemon"; + }; + }; kitty-keyboard-sounds = { - description = "Keyboard sound effects for kitty"; - wantedBy = [ "hyprland-session.target" ]; - serviceConfig = { - ExecStart = "${pythonWithPkgs}/bin/python3 ${keyboardSfxScript}"; + Unit.Description = "Keyboard sound effects for kitty"; + Install.WantedBy = [ "hyprland-session.target" ]; + Service = { + ExecStart = "${pkgs.myPython}/bin/python3 ${keyboardSfxScript}"; }; }; }; diff --git a/modules/home/environment/waybar.nix b/modules/home/environment/waybar.nix index 283b9a9..169a3b1 100755 --- a/modules/home/environment/waybar.nix +++ b/modules/home/environment/waybar.nix @@ -1,4 +1,10 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + self, + ... +}: let layout = config.movOpts.envConfig.hyprlandConfig.workspaceLayout; @@ -27,226 +33,245 @@ let "20" = "20"; }; persistent-workspaces = - if (layout == "singlemonitor") then { - "${builtins.elemAt monitors 0}" = [ 1 2 3 4 ]; - } else if (layout == "dualmonitor") then { - "${builtins.elemAt monitors 0}" = [ 1 2 3 ]; - "${builtins.elemAt monitors 1}" = [ 4 5 6 ]; - } else if (layout == "trimonitor") then { - "${builtins.elemAt monitors 2}" = [ 1 2 ]; - "${builtins.elemAt monitors 1}" = [ 3 4 ]; - "${builtins.elemAt monitors 0}" = [ 5 6 ]; - } else + if (layout == "singlemonitor") then + { + "${builtins.elemAt monitors 0}" = [ + 1 + 2 + 3 + 4 + ]; + } + else if (layout == "dualmonitor") then + { + "${builtins.elemAt monitors 0}" = [ + 1 + 2 + 3 + ]; + "${builtins.elemAt monitors 1}" = [ + 4 + 5 + 6 + ]; + } + else if (layout == "trimonitor") then + { + "${builtins.elemAt monitors 2}" = [ + 1 + 2 + ]; + "${builtins.elemAt monitors 1}" = [ + 3 + 4 + ]; + "${builtins.elemAt monitors 0}" = [ + 5 + 6 + ]; + } + else { }; }; - scheme = config.lib.stylix.colors; - bg = { - darkester = scheme.base00; - darkest = scheme.base01; - darker = scheme.base02; - dark = scheme.base03; - }; - fg = { - lightester = scheme.base07; - lightest = scheme.base06; - lighter = scheme.base05; - light = scheme.base04; - }; monitors = config.movOpts.envConfig.hyprlandConfig.monitorNames; - bar-gauge = [ - "░░░░░░░░" - "█░░░░░░░" - "██░░░░░░" - "███░░░░░" - "████░░░░" - "█████░░░" - "██████░░" - "███████░" - "████████" - ]; - bar-gauge-critical = [ - "░░░░░░░░" - "█░░░░░░░" - "██░░░░░░" - "███░░░░░" - "████░░░░" - "█████░░░" - "██████░░" - "!!!!!!!!" - "CRITICAL" - ]; -in { +in +{ options = { - movOpts.envConfig.waybarConfig.enable = - lib.mkEnableOption "enables my waybar configuration"; + movOpts.envConfig.waybarConfig.enable = lib.mkEnableOption "enables my waybar configuration"; }; config = { programs.waybar = { enable = true; - package = pkgs.waybar.overrideAttrs (oa: { - mesonFlags = (oa.mesonFlags or [ ]) ++ [ "-Dexperimental=true" ]; - }); settings = { mainBar = { layer = "top"; - output = if layout == "singlemonitor" then builtins.elemAt monitors 0 - else builtins.elemAt monitors 1; + output = monitors; position = "top"; - name = "mainBar"; + name = "waybar"; margin-left = 0; margin-top = 0; margin-right = 0; - mode = "dock"; - exclusive = true; - passthrough = false; + exclusive = true; + passthrough = false; "gtk-layer-shell" = true; - modules-left = [ "clock" "hyprland/workspaces" "tray" ]; - modules-center = []; - modules-right = [ "cpu" "memory" "pulseaudio" "network" ]; + modules-left = [ + "tray" + "hyprland/workspaces" + ]; + modules-center = [ "hyprland/window" ]; + + "hyprland/window" = { + format = "{title}"; + }; + modules-right = [ + "cpu" + "memory" + "pulseaudio" + "network" + "clock" + "image#nixicon" + ]; "hyprland/workspaces" = workspaces; clock = { - format = "[ CLK: {:%H.%M %a %b %d} ]"; - tooltip-format = "{calendar}"; - calendar = { - mode = "month"; - weeks-pos = ""; - on-scroll = 1; - format = { - months = "CAL: {}\n"; - days = "{}"; - weeks = "{}"; - weekdays = "{}"; - today = "{}"; - }; - }; - actions = { - on-scroll-up = "shift_down"; - on-scroll-down = "shift_up"; - }; + format = "󱑍 {:%H:%M}"; }; - pulseaudio = { - format = "VOL: [ {icon} ] {volume}%"; - tooltip = true; - tooltip-format = "DEVICE: {desc}"; - format-muted = "VOL: [ XXXXXXXX ] {volume}%"; - on-click = "if [ $(pamixer --get-mute) == true ]; then pamixer --unmute; else pamixer --mute; fi"; - on-scroll-up = "pamixer -i 2"; - on-scroll-down = "pamixer -d 2"; - scroll-step = 2; - reverse-scrolling = true; - format-icons = bar-gauge; - }; + pulseaudio = { + format = " {volume}%"; + tooltip = true; + tooltip-format = "{desc}"; + format-muted = " {volume}%"; + on-click = "if [ $(pamixer --get-mute) == true ]; then pamixer --unmute; else pamixer --mute; fi"; + on-scroll-up = "pamixer -i 2"; + on-scroll-down = "pamixer -d 2"; + scroll-step = 2; + reverse-scrolling = true; + }; - network = { - format-wifi = "[ ONLINE ]"; - format-ethernet = "[ ONLINE ]"; - tooltip-format-wifi = "ESSID\t: {essid}\nSTRNGTH\t: {signaldBm}\n\nADDRESS\t: {ipaddr}\nGATE\t: {gwaddr}\nMASK\t: {netmask} | {cidr}"; - tooltip-format-ethernet = "IFNAME: {ifname}\nADDRESS: {ipaddr}"; - format-disconnected = "[ XXXXXX ]"; - on-click = "nm-connection-editor"; - }; + network = { + format-wifi = "󰖩 {essid}"; + format-ethernet = " {ifname}"; + tooltip-format-wifi = "ESSID\t: {essid}\nSTRNGTH\t: {signaldBm}\n\nADDRESS\t: {ipaddr}\nGATE\t: {gwaddr}\nMASK\t: {netmask} | {cidr}"; + tooltip-format-ethernet = "IFNAME: {ifname}\nADDRESS: {ipaddr}"; + format-disconnected = "󱚼"; + on-click = "nm-connection-editor"; + }; - memory = { - interval = 20; - format = "MEM: [ {icon} ] {percentage}%"; - tooltip-format = "MEM_TOT\t: {total}GiB\nSWP_TOT\t: {swapTotal}GiB\n\nMEM_USD\t: {used:0.1f}GiB\nSWP_USD\t: {swapUsed:0.1f}GiB"; - format-icons = bar-gauge-critical; - }; + "image#nixicon" = { + path = "/home/pagedmov/.sysflake/assets/images/nix-snowflake-colours.svg"; + size = 28; + }; - cpu = { + memory = { + interval = 20; + format = " {percentage}%"; + tooltip-format = "MEM_TOT\t: {total}GiB\nSWP_TOT\t: {swapTotal}GiB\n\nMEM_USD\t: {used:0.1f}GiB\nSWP_USD\t: {swapUsed:0.1f}GiB"; + }; - interval = 1; - format = "CPU: [ {icon} ] {usage}%"; - tooltip = true; - format-icons = bar-gauge-critical; - }; + cpu = { + interval = 1; + format = "󰍛 {usage}%"; + tooltip = true; + }; }; }; style = '' - * { - font-size: 16px; - border: none; - font-family: EnvyCodeR Nerd Font Mono; - font-weight: Bold; - min-height: 0; - border-radius: 0px; - padding: 2px; - } + @define-color accent #CF1B30; + @define-color bg-dark #1a1a1a; + @define-color bg-island #2a2a2a; + @define-color fg-dim #aaaaaa; + @define-color fg-text #d0d0d0; - window#waybar { - color: #${fg.lightest}; - background: #${bg.darkester}; - } + * { + font-size: 20px; + border: none; + font-family: EnvyCodeR Nerd Font Mono; + font-weight: bold; + min-height: 0; + border-radius: 0; + } - tooltip { - background: #${bg.darkester}; - } + window#waybar { + background: rgba(0, 0, 0, 0.05); + color: @fg-text; + } - #workspaces button { - color: #${fg.lightest}; - background: #${bg.darkester}; - } + tooltip { + background: @bg-dark; + border: 2px solid @accent; + border-radius: 8px; + } - #workspaces button.active { - color: #${bg.darker}; - background: #${bg.darkester}; - } + /* ── Tray island (far left) ── */ + #tray { + background-color: @bg-dark; + color: @accent; + border: 2px solid @accent; + border-radius: 8px; + padding: 4px 8px; + margin: 6px 4px 6px 10px; + } - #workspaces button.focused { - color: #${bg.dark}; - background: #${bg.darkester}; - } + /* ── Workspaces island ── */ + #workspaces { + background-color: @bg-dark; + border: 2px solid @accent; + border-radius: 8px; + margin: 6px 4px; + padding: 0 4px; + } - #workspaces button.urgent { - color: #${fg.lightest}; - background: #${bg.darkester}; - } + #workspaces button { + color: @fg-dim; + background: transparent; + padding: 4px 8px; + border-radius: 6px; + margin: 2px; + } - #workspaces button:hover { - color: #${fg.lightest}; - background: #${bg.darkester}; - } + #workspaces button.active { + color: @bg-dark; + background-color: @accent; + } - #window, - #clock, - #pulseaudio, - #network, - #workspaces, - #tray, - #cpu { - padding: 0px 10px; - margin: 0px; - } + #workspaces button:hover { + color: @bg-dark; + background-color: alpha(@accent, 0.5); + } - #tray { - margin-right: 10px; - } + /* ── Right info modules island ── */ + #cpu, + #memory, + #pulseaudio, + #network, + #window, + #clock { + background-color: @bg-dark; + color: @accent; + border-top: 2px solid @accent; + border-bottom: 2px solid @accent; + padding: 4px 10px; + margin: 6px 0; + } - #workspaces { - color: #${fg.lightest}; - } + /* ── Window title island (center) ── */ + #window { + border-radius: 8px; + border-left: 2px solid @accent; + border-right: 2px solid @accent; + margin: 6px 4px; + } - #window { - color: #${fg.lightest}; - } + /* round left edge of first module in the group */ + #cpu { + border-radius: 8px 0 0 8px; + border-left: 2px solid @accent; + margin-left: 4px; + } - #clock { - color: #${fg.lightest}; - } + /* round right edge of last module before nixicon */ + #clock { + border-radius: 0 8px 8px 0; + border-right: 2px solid @accent; + margin-right: 4px; + } - #network { - color: #${fg.lightest}; - } + /* ── NixOS icon island (far right, outlined) ── */ + #image { + background-color: @bg-dark; + color: @accent; + border: 2px solid @accent; + border-radius: 8px; + padding: 4px 10px; + margin: 6px 10px 6px 4px; + } - #pulseaudio { - color: #${fg.lightest}; - } + @import url("file:///home/pagedmov/.local/state/sysflake/waybar-colors.css"); ''; }; }; diff --git a/modules/home/environment/zsh/aliases.nix b/modules/home/environment/zsh/aliases.nix index e4490aa..061eb69 100644 --- a/modules/home/environment/zsh/aliases.nix +++ b/modules/home/environment/zsh/aliases.nix @@ -1,6 +1,12 @@ -{ lib, config, self, ... }: { - options.movOpts.envConfig.zshConfig.shellAliases.enable = lib.mkEnableOption "enables my zsh aliases"; + lib, + config, + self, + ... +}: +{ + options.movOpts.envConfig.zshConfig.shellAliases.enable = + lib.mkEnableOption "enables my zsh aliases"; config = lib.mkIf config.movOpts.envConfig.zshConfig.shellAliases.enable { programs.zsh = { shellAliases = { diff --git a/modules/home/environment/zsh/default.nix b/modules/home/environment/zsh/default.nix index 4333d66..5d5fa43 100644 --- a/modules/home/environment/zsh/default.nix +++ b/modules/home/environment/zsh/default.nix @@ -1,4 +1,9 @@ -{ lib, config, self, ... }: +{ + lib, + config, + self, + ... +}: { imports = [ diff --git a/modules/home/environment/zsh/env.nix b/modules/home/environment/zsh/env.nix index 4db5432..82f005e 100644 --- a/modules/home/environment/zsh/env.nix +++ b/modules/home/environment/zsh/env.nix @@ -2,7 +2,8 @@ { options = { - movOpts.envConfig.zshConfig.envVariables.enable = lib.mkEnableOption "enables my default session variables"; + movOpts.envConfig.zshConfig.envVariables.enable = + lib.mkEnableOption "enables my default session variables"; }; config = lib.mkIf config.movOpts.envConfig.zshConfig.envVariables.enable { programs.zsh = { diff --git a/modules/home/environment/zsh/extraconfig.nix b/modules/home/environment/zsh/extraconfig.nix index 4d5f9ea..55b17a1 100644 --- a/modules/home/environment/zsh/extraconfig.nix +++ b/modules/home/environment/zsh/extraconfig.nix @@ -1,4 +1,10 @@ -{ lib, config, self, pkgs, ... }: +{ + lib, + config, + self, + pkgs, + ... +}: let shellsound = "${pkgs.myScripts.playshellsound}/bin/playshellsound"; @@ -8,7 +14,8 @@ let in { options = { - movOpts.envConfig.zshConfig.extraConfig.enable = lib.mkEnableOption "enables my extra shell configurations"; + movOpts.envConfig.zshConfig.extraConfig.enable = + lib.mkEnableOption "enables my extra shell configurations"; }; config = lib.mkIf config.movOpts.envConfig.zshConfig.extraConfig.enable { programs.zsh = { diff --git a/modules/home/environment/zsh/options.nix b/modules/home/environment/zsh/options.nix index 52fed25..2cc7514 100644 --- a/modules/home/environment/zsh/options.nix +++ b/modules/home/environment/zsh/options.nix @@ -2,7 +2,8 @@ { options = { - movOpts.envConfig.zshConfig.shellOptions.enable = lib.mkEnableOption "enables my default shell settings"; + movOpts.envConfig.zshConfig.shellOptions.enable = + lib.mkEnableOption "enables my default shell settings"; }; config = lib.mkIf config.movOpts.envConfig.zshConfig.shellOptions.enable { programs.zoxide = { diff --git a/modules/home/files.nix b/modules/home/files.nix index d5b4655..df75653 100755 --- a/modules/home/files.nix +++ b/modules/home/files.nix @@ -1,40 +1,51 @@ -{ pkgs, lib, self, config, ... }: +{ + pkgs, + lib, + self, + config, + ... +}: # This folder is for programs that do not have existing configuration modules in NixOS. # Basically a to-do list for stuff I need to write my own modules for. let # Extract color scheme from base_16 yaml file - extractSchemeFromYaml = base16_scheme: let - scheme_path = "${pkgs.base16-schemes}/share/themes/${base16_scheme}.yaml"; - scheme_string = builtins.readFile scheme_path; - scheme_list = lib.splitString "\n" scheme_string; # Split into a list - colors = - lib.filter (line: builtins.match "^ *base[0-9A-F]{2}: .*" line != null) # Get raw hex values from scheme list - scheme_list; - parsed_scheme = lib.lists.foldl' (acc: line: # Initialize attribute set and begin folding values into it - let - splitLine = lib.splitString ": " line; # Split into keys (base00, base01, etc.) and values - key = builtins.elemAt splitLine 0; - value = builtins.elemAt splitLine 1; - trimmedKey = lib.trim key; # Start cleaning values - cleanValue_step1 = lib.splitString " " value; - cleanValue_step2 = builtins.elemAt cleanValue_step1 0; # Get just the hex value, ignore comments etc. - cleanValue_final = - builtins.substring 1 (builtins.stringLength cleanValue_step2 - 2) - cleanValue_step2; - in acc // { "${trimmedKey}" = cleanValue_final; }) { } colors; # Accumulate keys/values into attribute set - in parsed_scheme; # Return parsed color scheme + extractSchemeFromYaml = + base16_scheme: + let + scheme_path = "${pkgs.base16-schemes}/share/themes/${base16_scheme}.yaml"; + scheme_string = builtins.readFile scheme_path; + scheme_list = lib.splitString "\n" scheme_string; # Split into a list + colors = + lib.filter (line: builtins.match "^ *base[0-9A-F]{2}: .*" line != null) # Get raw hex values from scheme list + scheme_list; + parsed_scheme = lib.lists.foldl' ( + acc: line: # Initialize attribute set and begin folding values into it + let + splitLine = lib.splitString ": " line; # Split into keys (base00, base01, etc.) and values + key = builtins.elemAt splitLine 0; + value = builtins.elemAt splitLine 1; + trimmedKey = lib.trim key; # Start cleaning values + cleanValue_step1 = lib.splitString " " value; + cleanValue_step2 = builtins.elemAt cleanValue_step1 0; # Get just the hex value, ignore comments etc. + cleanValue_final = builtins.substring 1 ( + builtins.stringLength cleanValue_step2 - 2 + ) cleanValue_step2; + in + acc // { "${trimmedKey}" = cleanValue_final; } + ) { } colors; # Accumulate keys/values into attribute set + in + parsed_scheme; # Return parsed color scheme - ssh_scheme = extractSchemeFromYaml "atelier-cave" ; - nix-shell_scheme = extractSchemeFromYaml "blueish"; + ssh_scheme = extractSchemeFromYaml "atelier-cave"; + nix-shell_scheme = extractSchemeFromYaml "blueish"; def_scheme = config.lib.stylix.colors; - # Custom theme for nix-shell -in { +in +{ options = { - movOpts.homeFiles.enable = - lib.mkEnableOption "enables declared custom files"; + movOpts.homeFiles.enable = lib.mkEnableOption "enables declared custom files"; }; config = { home.file = { diff --git a/modules/home/programs/autojump.nix b/modules/home/programs/autojump.nix index 7885bc7..5df8a3e 100755 --- a/modules/home/programs/autojump.nix +++ b/modules/home/programs/autojump.nix @@ -1,7 +1,7 @@ -{ lib, config, ... }: { +{ lib, config, ... }: +{ options = { - movOpts.programConfigs.autojumpConfig.enable = - lib.mkEnableOption "enables my autojump options"; + movOpts.programConfigs.autojumpConfig.enable = lib.mkEnableOption "enables my autojump options"; }; config = lib.mkIf config.movOpts.programConfigs.autojumpConfig.enable { programs.autojump = { diff --git a/modules/home/programs/bat.nix b/modules/home/programs/bat.nix index f4ec83c..878589e 100755 --- a/modules/home/programs/bat.nix +++ b/modules/home/programs/bat.nix @@ -1,12 +1,19 @@ -{ lib, config, inputs, ... }: { +{ + lib, + config, + inputs, + ... +}: +{ options = { - movOpts.programConfigs.batConfig.enable = - lib.mkEnableOption "enables my bat options"; + movOpts.programConfigs.batConfig.enable = lib.mkEnableOption "enables my bat options"; }; config = lib.mkIf config.movOpts.programConfigs.batConfig.enable { programs.bat = { enable = true; - config = { pager = "less -FR"; }; + config = { + pager = "less -FR"; + }; }; }; } diff --git a/modules/home/programs/btop.nix b/modules/home/programs/btop.nix index 2f7eee3..139f183 100755 --- a/modules/home/programs/btop.nix +++ b/modules/home/programs/btop.nix @@ -1,7 +1,12 @@ -{ lib, config, pkgs, ... }: { +{ + lib, + config, + pkgs, + ... +}: +{ options = { - movOpts.programConfigs.btopConfig.enable = - lib.mkEnableOption "enables my btop config"; + movOpts.programConfigs.btopConfig.enable = lib.mkEnableOption "enables my btop config"; }; config = lib.mkIf config.movOpts.programConfigs.btopConfig.enable { programs.btop = { @@ -10,8 +15,7 @@ settings = { update_ms = 500; vim_keys = true; - color_theme = "nord"; - theme_background = true; + color_theme = "TTY"; temp_scale = "fahrenheit"; graph_symbol = "block"; disks_filter = "exclude=/boot /"; diff --git a/modules/home/programs/cava.nix b/modules/home/programs/cava.nix index a198197..d6ab39e 100755 --- a/modules/home/programs/cava.nix +++ b/modules/home/programs/cava.nix @@ -1,9 +1,17 @@ -{ lib, config, inputs, pkgs, ... }: { +{ + lib, + config, + inputs, + pkgs, + ... +}: +{ options = { - movOpts.programConfigs.cavaConfig.enable = - lib.mkEnableOption "enables my cava settings"; + movOpts.programConfigs.cavaConfig.enable = lib.mkEnableOption "enables my cava settings"; }; config = lib.mkIf config.movOpts.programConfigs.cavaConfig.enable { - programs.cava = { enable = true; }; + programs.cava = { + enable = true; + }; }; } diff --git a/modules/home/programs/default.nix b/modules/home/programs/default.nix index e149a12..dac4af2 100755 --- a/modules/home/programs/default.nix +++ b/modules/home/programs/default.nix @@ -1,8 +1,27 @@ -{ env, host, nixvim, self, inputs, username, config, home-manager, ... }: { - imports = [ (import ./btop.nix) ] ++ [ (import ./yazi.nix) ] - ++ [ (import ./kitty.nix) ] ++ [ (import ./fuzzel.nix) ] - ++ [ (import ./eza.nix) ] ++ [ (import ./cava.nix) ] - ++ [ (import ./bat.nix) ] ++ [ (import ./fzf.nix) ] - ++ [ (import ./git.nix) ] ++ [ (import ./password-store.nix) ] - ++ [ (import ./autojump.nix) ] ++ [ (import ./nixvim) ]; +{ + env, + host, + nixvim, + self, + inputs, + username, + config, + home-manager, + ... +}: +{ + imports = [ + (import ./btop.nix) + ] + ++ [ (import ./yazi.nix) ] + ++ [ (import ./kitty.nix) ] + ++ [ (import ./fuzzel.nix) ] + ++ [ (import ./eza.nix) ] + ++ [ (import ./cava.nix) ] + ++ [ (import ./bat.nix) ] + ++ [ (import ./fzf.nix) ] + ++ [ (import ./git.nix) ] + ++ [ (import ./password-store.nix) ] + ++ [ (import ./autojump.nix) ] + ++ [ (import ./nixvim) ]; } diff --git a/modules/home/programs/eza.nix b/modules/home/programs/eza.nix index b532fcd..c225eb4 100755 --- a/modules/home/programs/eza.nix +++ b/modules/home/programs/eza.nix @@ -1,13 +1,17 @@ -{ lib, config, ... }: { +{ lib, config, ... }: +{ options = { - movOpts.programConfigs.ezaConfig.enable = - lib.mkEnableOption "enables my eza options"; + movOpts.programConfigs.ezaConfig.enable = lib.mkEnableOption "enables my eza options"; }; config = lib.mkIf config.movOpts.programConfigs.ezaConfig.enable { programs.eza = { enable = true; enableZshIntegration = false; - extraOptions = [ "-1" "-h" "--group-directories-first" ]; + extraOptions = [ + "-1" + "-h" + "--group-directories-first" + ]; icons = "auto"; git = true; }; diff --git a/modules/home/programs/fuzzel.nix b/modules/home/programs/fuzzel.nix index c4589b1..301dfa7 100755 --- a/modules/home/programs/fuzzel.nix +++ b/modules/home/programs/fuzzel.nix @@ -1,7 +1,7 @@ -{ config, lib, ... }: { +{ config, lib, ... }: +{ options = { - movOpts.programConfigs.fuzzelConfig.enable = - lib.mkEnableOption "enables my fuzzel configuration"; + movOpts.programConfigs.fuzzelConfig.enable = lib.mkEnableOption "enables my fuzzel configuration"; }; config = lib.mkIf config.movOpts.programConfigs.fuzzelConfig.enable { programs.fuzzel = { diff --git a/modules/home/programs/fzf.nix b/modules/home/programs/fzf.nix index 2c30cb1..f524217 100755 --- a/modules/home/programs/fzf.nix +++ b/modules/home/programs/fzf.nix @@ -1,7 +1,7 @@ -{ lib, config, ... }: { +{ lib, config, ... }: +{ options = { - movOpts.programConfigs.fzfConfig.enable = - lib.mkEnableOption "enables my fzf options"; + movOpts.programConfigs.fzfConfig.enable = lib.mkEnableOption "enables my fzf options"; }; config = lib.mkIf config.movOpts.programConfigs.fzfConfig.enable { programs.fzf = { diff --git a/modules/home/programs/git.nix b/modules/home/programs/git.nix index 9ec917a..c144fd4 100755 --- a/modules/home/programs/git.nix +++ b/modules/home/programs/git.nix @@ -1,7 +1,13 @@ -{ lib, config, username, pkgs, ... }: { +{ + lib, + config, + username, + pkgs, + ... +}: +{ options = { - movOpts.programConfigs.gitConfig.enable = - lib.mkEnableOption "enables my git configuration"; + movOpts.programConfigs.gitConfig.enable = lib.mkEnableOption "enables my git configuration"; }; config = lib.mkIf config.movOpts.programConfigs.gitConfig.enable { programs.git = { diff --git a/modules/home/programs/kitty.nix b/modules/home/programs/kitty.nix index 40c210d..ef7a9b8 100755 --- a/modules/home/programs/kitty.nix +++ b/modules/home/programs/kitty.nix @@ -1,7 +1,13 @@ -{ self, lib, config, pkgs, ... }: { +{ + self, + lib, + config, + pkgs, + ... +}: +{ options = { - movOpts.programConfigs.kittyConfig.enable = - lib.mkEnableOption "enables my kitty configuration"; + movOpts.programConfigs.kittyConfig.enable = lib.mkEnableOption "enables my kitty configuration"; }; config = lib.mkIf config.movOpts.programConfigs.kittyConfig.enable { programs.kitty = { @@ -14,7 +20,7 @@ settings = { confirm_os_window_close = 0; - background_opacity = lib.mkForce 0.5; + background_opacity = lib.mkForce 0.65; window_padding_width = 4; scrollback_lines = 10000; enable_audio_bell = true; @@ -31,6 +37,8 @@ tab_powerline_style = "round"; }; + extraConfig = "include ~/.local/state/sysflake/kitty-colors.conf"; + keybindings = { "ctrl+shift+l" = "next_tab"; "ctrl+shift+h" = "previous_tab"; diff --git a/modules/home/programs/nixvim/autocmd.nix b/modules/home/programs/nixvim/autocmd.nix index 2a07f7a..7c34e22 100755 --- a/modules/home/programs/nixvim/autocmd.nix +++ b/modules/home/programs/nixvim/autocmd.nix @@ -1,19 +1,18 @@ -{ pkgs, self, ... }: { +{ pkgs, self, ... }: +{ programs.nixvim = { autoCmd = [ { command = "silent! mkview"; event = [ "BufWinLeave" ]; pattern = [ "*" ]; - desc = - "Save session window settings to be loaded next time the file is opened"; + desc = "Save session window settings to be loaded next time the file is opened"; } { command = "silent! loadview"; event = [ "BufWinEnter" ]; pattern = [ "*" ]; - desc = - "Load previous session window settings for the opened file (folds, cursor pos, etc)"; + desc = "Load previous session window settings for the opened file (folds, cursor pos, etc)"; } { command = "silent! FloatermNew --name=def_term --width=0.8 --height=0.8 --wintype=topright --silent"; diff --git a/modules/home/programs/nixvim/default.nix b/modules/home/programs/nixvim/default.nix index 489aaa4..1414c38 100755 --- a/modules/home/programs/nixvim/default.nix +++ b/modules/home/programs/nixvim/default.nix @@ -1,6 +1,19 @@ -{ env, config, pkgs, host, self, ... }: { +{ + env, + config, + pkgs, + host, + self, + ... +}: +{ programs.nixvim = { nixpkgs.useGlobalPackages = true; }; - imports = [ ./plugins ./options.nix ./keymaps.nix ./autocmd.nix ]; + imports = [ + ./plugins + ./options.nix + ./keymaps.nix + ./autocmd.nix + ]; } diff --git a/modules/home/programs/nixvim/keymaps.nix b/modules/home/programs/nixvim/keymaps.nix index 471439f..10644f2 100755 --- a/modules/home/programs/nixvim/keymaps.nix +++ b/modules/home/programs/nixvim/keymaps.nix @@ -49,7 +49,10 @@ { action = "FloatermToggle def_term"; key = ""; - mode = [ "n" "t" ]; + mode = [ + "n" + "t" + ]; } { action = "lua require('treesj').toggle()"; @@ -64,82 +67,127 @@ { action = ''"+y''; key = "y"; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { action = ''"+p''; key = "p"; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { - action.__raw = /*lua*/''function() require('opencode').prompt('test', {submit=true}) end''; + action.__raw = /* lua */ "function() require('opencode').prompt('test', {submit=true}) end"; key = "at"; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { - action.__raw = /*lua*/''function() require('opencode').select() end''; + action.__raw = /* lua */ "function() require('opencode').select() end"; key = "as"; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { - action.__raw = /*lua*/''function() require('opencode').prompt('document', {submit=true}) end''; + action.__raw = /* lua */ "function() require('opencode').prompt('document', {submit=true}) end"; key = "ad"; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { - action.__raw = /*lua*/''function() require('opencode').prompt('review', {submit=true}) end''; + action.__raw = /* lua */ "function() require('opencode').prompt('review', {submit=true}) end"; key = "ar"; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { - action.__raw = /*lua*/''function() require('opencode').prompt('fix', {submit=true}) end''; + action.__raw = /* lua */ "function() require('opencode').prompt('fix', {submit=true}) end"; key = "af"; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { - action.__raw = /*lua*/''function() require('opencode').ask("@this ", {submit=true}) end''; + action.__raw = /* lua */ ''function() require('opencode').ask("@this ", {submit=true}) end''; key = "aa"; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { - action.__raw = /*lua*/''function() require('opencode').explain("@this ") end''; + action.__raw = /* lua */ ''function() require('opencode').explain("@this ") end''; key = "ae"; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { - action.__raw = /*lua*/''function() require('opencode').command("session.half.page.up") end''; + action.__raw = /* lua */ ''function() require('opencode').command("session.half.page.up") end''; key = ""; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { - action.__raw = /*lua*/''function() require('opencode').command("session.half.page.down") end''; + action.__raw = /* lua */ ''function() require('opencode').command("session.half.page.down") end''; key = ""; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { - action.__raw = /*lua*/''function() require('opencode').command("prompt.clear") end''; + action.__raw = /* lua */ ''function() require('opencode').command("prompt.clear") end''; key = ""; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { - action.__raw = /*lua*/''function() require('opencode').operator("@this ") end''; + action.__raw = /* lua */ ''function() require('opencode').operator("@this ") end''; key = "go"; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } { - action.__raw = /*lua*/''function() return require('opencode').operator("@this ") .. "_" end''; + action.__raw = /* lua */ ''function() return require('opencode').operator("@this ") .. "_" end''; key = "goo"; mode = [ "n" ]; } { action = "lua require('opencode').toggle()"; key = ""; - mode = [ "n" "t" ]; + mode = [ + "n" + "t" + ]; } { action = "lua require('opencode').select()"; key = ""; - mode = [ "n" "x" ]; + mode = [ + "n" + "x" + ]; } ]; }; diff --git a/modules/home/programs/nixvim/options.nix b/modules/home/programs/nixvim/options.nix index 74915d1..6849e04 100755 --- a/modules/home/programs/nixvim/options.nix +++ b/modules/home/programs/nixvim/options.nix @@ -1,7 +1,9 @@ { config, ... }: -let scheme = config.lib.stylix.colors; -in { +let + scheme = config.lib.stylix.colors; +in +{ programs.nixvim = { colorschemes.base16 = { enable = true; @@ -31,14 +33,17 @@ in { signs = false; }; extraConfigLua = /* lua */ '' + local theme_file = vim.fn.expand("~/.local/state/sysflake/nvim-colors.lua") + if vim.fn.filereadable(theme_file) == 1 then + dofile(theme_file) + end + if vim.g.started_by_firenvim == true then vim.o.laststatus = 0 end if vim.g.neovide then vim.g.neovide_refresh_rate = 144 vim.g.neovide_cursor_animate_in_insert_mode = true - vim.g.neovide_opacity = 0.5; - vim.g.neovide_normal_opacity = 1.0; end vim.g.vimwiki_list = {{path = '~/vimwiki/', syntax = 'markdown', ext = '.md'}} diff --git a/modules/home/programs/nixvim/plugins/airline.nix b/modules/home/programs/nixvim/plugins/airline.nix index 777ef46..bca0ad9 100644 --- a/modules/home/programs/nixvim/plugins/airline.nix +++ b/modules/home/programs/nixvim/plugins/airline.nix @@ -1,7 +1,7 @@ { programs.nixvim = { plugins.airline = { - enable = false; + enable = true; settings = { left_sep = ""; right_sep = ""; diff --git a/modules/home/programs/nixvim/plugins/barbar.nix b/modules/home/programs/nixvim/plugins/barbar.nix index 663ff37..215f6d6 100644 --- a/modules/home/programs/nixvim/plugins/barbar.nix +++ b/modules/home/programs/nixvim/plugins/barbar.nix @@ -2,7 +2,9 @@ programs.nixvim = { plugins.barbar = { enable = false; - settings = { auto_hide = 1; }; + settings = { + auto_hide = 1; + }; }; }; } diff --git a/modules/home/programs/nixvim/plugins/coq.nix b/modules/home/programs/nixvim/plugins/coq.nix index 37a41fd..64b8a8f 100644 --- a/modules/home/programs/nixvim/plugins/coq.nix +++ b/modules/home/programs/nixvim/plugins/coq.nix @@ -2,7 +2,9 @@ programs.nixvim = { plugins.coq-nvim = { enable = true; - settings = { auto_start = false; }; + settings = { + auto_start = false; + }; }; }; } diff --git a/modules/home/programs/nixvim/plugins/default.nix b/modules/home/programs/nixvim/plugins/default.nix index 6aa3b1e..239fcd4 100644 --- a/modules/home/programs/nixvim/plugins/default.nix +++ b/modules/home/programs/nixvim/plugins/default.nix @@ -1,4 +1,10 @@ -{ host, self, pkgs, env, ... }: +{ + host, + self, + pkgs, + env, + ... +}: { imports = [ diff --git a/modules/home/programs/nixvim/plugins/extra_plugins.nix b/modules/home/programs/nixvim/plugins/extra_plugins.nix index f295207..832beb1 100644 --- a/modules/home/programs/nixvim/plugins/extra_plugins.nix +++ b/modules/home/programs/nixvim/plugins/extra_plugins.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ programs.nixvim = { extraPlugins = [ (pkgs.vimUtils.buildVimPlugin { diff --git a/modules/home/programs/nixvim/plugins/fidget.nix b/modules/home/programs/nixvim/plugins/fidget.nix index 5751e8f..8da8c03 100644 --- a/modules/home/programs/nixvim/plugins/fidget.nix +++ b/modules/home/programs/nixvim/plugins/fidget.nix @@ -4,7 +4,9 @@ settings = { notification = { overrideVimNotify = true; - window = { border = "rounded"; }; + window = { + border = "rounded"; + }; }; }; }; diff --git a/modules/home/programs/nixvim/plugins/haskell.nix b/modules/home/programs/nixvim/plugins/haskell.nix index 82b837b..a335675 100644 --- a/modules/home/programs/nixvim/plugins/haskell.nix +++ b/modules/home/programs/nixvim/plugins/haskell.nix @@ -1,15 +1,16 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ programs.nixvim = { #extraPlugins = [ - #(pkgs.vimUtils.buildVimPlugin { - #name = "haskell-tools.nvim"; - #src = pkgs.fetchFromGitHub { - #owner = "mrcjkb"; - #repo = "haskell-tools.nvim"; - #rev = "39c4ced6f1bff1abc8d4df5027efd11ac38c6e6c"; - #hash = "sha256-f+M35EwAlHwjJ2Xs2u9FLnyH0FJT22D0LLShDXCbEEs="; - #}; - #}) + #(pkgs.vimUtils.buildVimPlugin { + #name = "haskell-tools.nvim"; + #src = pkgs.fetchFromGitHub { + #owner = "mrcjkb"; + #repo = "haskell-tools.nvim"; + #rev = "39c4ced6f1bff1abc8d4df5027efd11ac38c6e6c"; + #hash = "sha256-f+M35EwAlHwjJ2Xs2u9FLnyH0FJT22D0LLShDXCbEEs="; + #}; + #}) #]; #plugins = { haskell-scope-highlighting.enable = true; }; }; diff --git a/modules/home/programs/nixvim/plugins/indent-blankline.nix b/modules/home/programs/nixvim/plugins/indent-blankline.nix index 02f4951..e2ca75a 100644 --- a/modules/home/programs/nixvim/plugins/indent-blankline.nix +++ b/modules/home/programs/nixvim/plugins/indent-blankline.nix @@ -3,7 +3,7 @@ plugins.indent-blankline = { enable = true; #settings = { - #indent.char = "│"; + #indent.char = "│"; #}; }; }; diff --git a/modules/home/programs/nixvim/plugins/lsp.nix b/modules/home/programs/nixvim/plugins/lsp.nix index 229d004..610fa2a 100644 --- a/modules/home/programs/nixvim/plugins/lsp.nix +++ b/modules/home/programs/nixvim/plugins/lsp.nix @@ -61,7 +61,9 @@ }) ''; }; - window = { completion.border = "rounded"; }; + window = { + completion.border = "rounded"; + }; }; }; lsp = { @@ -98,10 +100,8 @@ }; options = { # uses Xenon config because it has every option exposed to it - nixos.expr = '' - (builtins.getFlake "github:pagedMov/nixos-config").nixosConfigurations.phosphorous.options''; - home.expr = '' - (builtins.getFlake "github:pagedMov/nixos-config").homeConfigurations.phospohorousHome.options''; + nixos.expr = ''(builtins.getFlake "github:pagedMov/nixos-config").nixosConfigurations.phosphorous.options''; + home.expr = ''(builtins.getFlake "github:pagedMov/nixos-config").homeConfigurations.phospohorousHome.options''; }; }; }; diff --git a/modules/home/programs/nixvim/plugins/lualine.nix b/modules/home/programs/nixvim/plugins/lualine.nix index 184d9e4..57e43db 100644 --- a/modules/home/programs/nixvim/plugins/lualine.nix +++ b/modules/home/programs/nixvim/plugins/lualine.nix @@ -1,42 +1,100 @@ +let + colors = { + blue = "#80a0ff"; + cyan = "#79dac8"; + black = "#080808"; + white = "#c6c6c6"; + red = "#ff5189"; + violet = "#d183e8"; + grey = "#303030"; + bg_grey = "#202020"; + }; + bubbles_theme = { + normal = { + a = { + fg = colors.black; + bg = colors.violet; + gui = "bold"; + }; + b = { + fg = colors.white; + bg = colors.grey; + }; + c = { + fg = colors.white; + bg = colors.bg_grey; + }; + }; + + insert = { + a = { + fg = colors.black; + bg = colors.blue; + }; + }; + visual = { + a = { + fg = colors.black; + bg = colors.cyan; + }; + }; + replace = { + a = { + fg = colors.black; + bg = colors.red; + }; + }; + inactive = { + a = { + fg = colors.white; + bg = colors.grey; + }; + b = { + fg = colors.white; + bg = colors.black; + }; + c = { + fg = colors.white; + }; + z = { + fg = colors.white; + bg = colors.grey; + }; + }; + }; +in { programs.nixvim = { plugins.lualine = { - enable = true; + enable = false; settings = { options = { icons_enabled = true; - theme = "auto"; + theme = bubbles_theme; component_separators = { - left = ""; - right = ""; + left = "|"; + right = "|"; }; section_separators = { left = ""; right = ""; }; - always_divide_middle = true; - globalstatus = true; - refresh = { - statusline = 1000; - tabline = 1000; - winbar = 1000; - }; }; sections = { - lualine_a = [ "mode" ]; - lualine_b = [ "buffers" ]; - lualine_c = [ ]; - lualine_x = [ "searchcount" "fileformat" "filetype" ]; - lualine_y = [ "branch" "diff" "diagnostics" ]; - lualine_z = [ "location" ]; + lualine_a.__raw = "{ { 'mode', separator = { left = '' }, right_padding = 2 } }"; + lualine_b.__raw = "{ 'filename', 'branch' }"; + lualine_c.__raw = "{}"; + lualine_x.__raw = "{}"; + lualine_y.__raw = "{ 'filetype', 'progress' }"; + lualine_z.__raw = "{ { 'location', separator = { right = '' }, left_padding = 2 } }"; }; inactive_sections = { - lualine_a = [ ]; - lualine_b = [ ]; - lualine_c = [ "filename" ]; - lualine_x = [ "location" ]; - lualine_y = [ ]; - lualine_z = [ ]; + lualine_a.__raw = "{ { 'mode', separator = { left = '' }, right_padding = 2 } }"; + lualine_b.__raw = "{ 'filename', 'branch' }"; + lualine_c.__raw = "{}"; + lualine_x.__raw = "{}"; + lualine_y.__raw = "{ 'filetype', 'progress' }"; + lualine_z.__raw = "{ { 'location', separator = { right = '' }, left_padding = 2 } }"; }; }; }; diff --git a/modules/home/programs/nixvim/plugins/mini.nix b/modules/home/programs/nixvim/plugins/mini.nix index 80e7c64..44006cf 100644 --- a/modules/home/programs/nixvim/plugins/mini.nix +++ b/modules/home/programs/nixvim/plugins/mini.nix @@ -1,8 +1,12 @@ { programs.nixvim = { plugins = { - mini-align = { enable = true; }; - mini-clue = { enable = true; }; + mini-align = { + enable = true; + }; + mini-clue = { + enable = true; + }; }; }; } diff --git a/modules/home/programs/nixvim/plugins/neocord.nix b/modules/home/programs/nixvim/plugins/neocord.nix index 0433148..222243f 100644 --- a/modules/home/programs/nixvim/plugins/neocord.nix +++ b/modules/home/programs/nixvim/plugins/neocord.nix @@ -2,8 +2,7 @@ programs.nixvim.plugins.neocord = { enable = true; settings = { - logo = - "https://styles.redditmedia.com/t5_30kix/styles/communityIcon_n2hvyn96zwk81.png"; + logo = "https://styles.redditmedia.com/t5_30kix/styles/communityIcon_n2hvyn96zwk81.png"; logo_tooltip = "Neovim"; buttons = [ { diff --git a/modules/home/programs/nixvim/plugins/nvim-lightbulb.nix b/modules/home/programs/nixvim/plugins/nvim-lightbulb.nix index e38622b..618a0f5 100644 --- a/modules/home/programs/nixvim/plugins/nvim-lightbulb.nix +++ b/modules/home/programs/nixvim/plugins/nvim-lightbulb.nix @@ -2,7 +2,9 @@ programs.nixvim.plugins.nvim-lightbulb = { enable = true; settings = { - virtual_text = { enable = true; }; + virtual_text = { + enable = true; + }; autocmd.enabled = true; sign.enabled = false; }; diff --git a/modules/home/programs/nixvim/plugins/plugins.nix b/modules/home/programs/nixvim/plugins/plugins.nix index 03cf5bf..14b8882 100644 --- a/modules/home/programs/nixvim/plugins/plugins.nix +++ b/modules/home/programs/nixvim/plugins/plugins.nix @@ -15,7 +15,7 @@ markdown-preview.enable = true; marks.enable = true; nvim-surround.enable = true; - rainbow-delimiters.enable = true; + # rainbow-delimiters.enable = true; render-markdown.enable = true; treesitter.enable = true; trim.enable = true; diff --git a/modules/home/programs/nixvim/plugins/scratch.nix b/modules/home/programs/nixvim/plugins/scratch.nix index f08f559..1191115 100644 --- a/modules/home/programs/nixvim/plugins/scratch.nix +++ b/modules/home/programs/nixvim/plugins/scratch.nix @@ -1 +1,5 @@ -{ programs.nixvim.plugins.chatgpt = { enable = true; }; } +{ + programs.nixvim.plugins.chatgpt = { + enable = true; + }; +} diff --git a/modules/home/programs/nixvim/plugins/vim-matchup.nix b/modules/home/programs/nixvim/plugins/vim-matchup.nix index 8a134a8..992adff 100644 --- a/modules/home/programs/nixvim/plugins/vim-matchup.nix +++ b/modules/home/programs/nixvim/plugins/vim-matchup.nix @@ -8,7 +8,9 @@ motion_enabled = 1; motion_cursor_end = 1; matchparen_deferred_hi_surround_always = true; - matchparen_offscreen = { method = "popup"; }; + matchparen_offscreen = { + method = "popup"; + }; treesitter = { enable = true; include_match_words = true; diff --git a/modules/home/programs/password-store.nix b/modules/home/programs/password-store.nix index 3f7117a..a6f6d4f 100755 --- a/modules/home/programs/password-store.nix +++ b/modules/home/programs/password-store.nix @@ -1,14 +1,22 @@ -{ lib, config, username, ... }: -let home = "/home/${username}"; -in { +{ + lib, + config, + username, + ... +}: +let + home = "/home/${username}"; +in +{ options = { - movOpts.programConfigs.passConfig.enable = - lib.mkEnableOption "enables my pass config"; + movOpts.programConfigs.passConfig.enable = lib.mkEnableOption "enables my pass config"; }; config = lib.mkIf config.movOpts.programConfigs.passConfig.enable { programs.password-store = { enable = true; - settings = { PASSWORD_STORE_DIR = "${home}/.password-store"; }; + settings = { + PASSWORD_STORE_DIR = "${home}/.password-store"; + }; }; }; } diff --git a/modules/home/programs/yazi.nix b/modules/home/programs/yazi.nix index 714c69e..436004e 100755 --- a/modules/home/programs/yazi.nix +++ b/modules/home/programs/yazi.nix @@ -1,7 +1,7 @@ -{ lib, config, ... }: { +{ lib, config, ... }: +{ options = { - movOpts.programConfigs.yaziConfig.enable = - lib.mkEnableOption "enables my yazi config"; + movOpts.programConfigs.yaziConfig.enable = lib.mkEnableOption "enables my yazi config"; }; config = lib.mkIf config.movOpts.programConfigs.yaziConfig.enable { programs.yazi = { diff --git a/modules/home/servermodule.nix b/modules/home/servermodule.nix index 6694faa..30ff2fe 100644 --- a/modules/home/servermodule.nix +++ b/modules/home/servermodule.nix @@ -1,4 +1,14 @@ -{ inputs, nixpkgs, config, self, username, host, lib, ... }: { +{ + inputs, + nixpkgs, + config, + self, + username, + host, + lib, + ... +}: +{ imports = [ ./environment/starship.nix ./environment/userpkgs.nix diff --git a/modules/server/cdn/default.nix b/modules/server/cdn/default.nix index 122c147..ed3b033 100755 --- a/modules/server/cdn/default.nix +++ b/modules/server/cdn/default.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: { imports = [ ./jellyfin.nix ]; diff --git a/modules/server/cdn/jellyfin.nix b/modules/server/cdn/jellyfin.nix index 4640002..daf4204 100755 --- a/modules/server/cdn/jellyfin.nix +++ b/modules/server/cdn/jellyfin.nix @@ -1,9 +1,13 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: { options = { - movOpts.serverCfg.jellyfinConfig.enable = - lib.mkEnableOption "Enables the server's jellyfin config"; + movOpts.serverCfg.jellyfinConfig.enable = lib.mkEnableOption "Enables the server's jellyfin config"; }; config = lib.mkIf config.movOpts.serverCfg.jellyfinConfig.enable { services.jellyfin = { diff --git a/modules/server/default.nix b/modules/server/default.nix index fa8accd..4ac689a 100755 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -1,5 +1,8 @@ { pkgs, lib, ... }: { - imports = [ ./cdn ./glasshaus ]; + imports = [ + ./cdn + ./glasshaus + ]; } diff --git a/modules/server/glasshaus/caddy.nix b/modules/server/glasshaus/caddy.nix index 9e734e7..529afc9 100755 --- a/modules/server/glasshaus/caddy.nix +++ b/modules/server/glasshaus/caddy.nix @@ -1,9 +1,13 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: { options = { - movOpts.serverCfg.caddyConfig.enable = lib.mkEnableOption - "Enable my caddy config for the glasshaus.info domain name"; + movOpts.serverCfg.caddyConfig.enable = lib.mkEnableOption "Enable my caddy config for the glasshaus.info domain name"; }; config = lib.mkIf config.movOpts.serverCfg.caddyConfig.enable { services.caddy = { diff --git a/modules/server/glasshaus/default.nix b/modules/server/glasshaus/default.nix index c1ec1fc..ea81763 100755 --- a/modules/server/glasshaus/default.nix +++ b/modules/server/glasshaus/default.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: { imports = [ ./caddy.nix ]; diff --git a/modules/sys/default.nix b/modules/sys/default.nix index 3e3bde3..f5c3932 100755 --- a/modules/sys/default.nix +++ b/modules/sys/default.nix @@ -1,3 +1,17 @@ -{ inputs, nixpkgs, config, self, username, host, lib, ... }: { - imports = [ ./hardware ./software ./sysenv ]; +{ + inputs, + nixpkgs, + config, + self, + username, + host, + lib, + ... +}: +{ + imports = [ + ./hardware + ./software + ./sysenv + ]; } diff --git a/modules/sys/hardware/bootloader.nix b/modules/sys/hardware/bootloader.nix index 33f9efd..d3bef9a 100755 --- a/modules/sys/hardware/bootloader.nix +++ b/modules/sys/hardware/bootloader.nix @@ -1,7 +1,12 @@ -{ pkgs, lib, config, ... }: { +{ + pkgs, + lib, + config, + ... +}: +{ options = { - movOpts.hardwareCfg.bootLoader.enable = - lib.mkEnableOption "enables bootloader config"; + movOpts.hardwareCfg.bootLoader.enable = lib.mkEnableOption "enables bootloader config"; }; config = lib.mkIf config.movOpts.hardwareCfg.bootLoader.enable { boot = { diff --git a/modules/sys/hardware/default.nix b/modules/sys/hardware/default.nix index 9dfb3b2..fa548bb 100755 --- a/modules/sys/hardware/default.nix +++ b/modules/sys/hardware/default.nix @@ -1,8 +1,21 @@ -{ inputs, nixpkgs, nixvim, config, self, username, host, ... }: { - imports = [ (import ./bootloader.nix) ] ++ [ (import ./network.nix) ] - ++ [ (import ./powerprofiles.nix) ] - ++ [ (import ./kernel.nix) ] - ++ [ (import ./input.nix) ]; +{ + inputs, + nixpkgs, + nixvim, + config, + self, + username, + host, + ... +}: +{ + imports = [ + (import ./bootloader.nix) + ] + ++ [ (import ./network.nix) ] + ++ [ (import ./powerprofiles.nix) ] + ++ [ (import ./kernel.nix) ] + ++ [ (import ./input.nix) ]; hardware.keyboard.uhk.enable = true; } diff --git a/modules/sys/hardware/input.nix b/modules/sys/hardware/input.nix index 95a0258..114d957 100644 --- a/modules/sys/hardware/input.nix +++ b/modules/sys/hardware/input.nix @@ -1,4 +1,5 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +{ i18n.inputMethod = { type = "fcitx5"; enable = true; diff --git a/modules/sys/hardware/kernel.nix b/modules/sys/hardware/kernel.nix index fc2018d..c592229 100644 --- a/modules/sys/hardware/kernel.nix +++ b/modules/sys/hardware/kernel.nix @@ -1,4 +1,10 @@ -{ lib, config, pkgs, ... }: { +{ + lib, + config, + pkgs, + ... +}: +{ options = { movOpts.hardwareCfg.kernelModule.enable = lib.mkEnableOption "enables kernel module configuration"; }; diff --git a/modules/sys/hardware/network.nix b/modules/sys/hardware/network.nix index 6ffc169..38fb5e4 100755 --- a/modules/sys/hardware/network.nix +++ b/modules/sys/hardware/network.nix @@ -1,7 +1,12 @@ -{ host, lib, config, ... }: { +{ + host, + lib, + config, + ... +}: +{ options = { - movOpts.hardwareCfg.networkModule.enable = - lib.mkEnableOption "enables network configuration"; + movOpts.hardwareCfg.networkModule.enable = lib.mkEnableOption "enables network configuration"; }; config = lib.mkIf config.movOpts.hardwareCfg.networkModule.enable { networking = { @@ -12,13 +17,23 @@ "192.168.1.201" = [ "oganesson" ]; "192.168.1.202" = [ "mercury" ]; "192.168.1.134" = [ "hosting.localhost" ]; - "192.168.1.140" = [ "panel.test" "dnsman.test" ]; + "192.168.1.140" = [ + "panel.test" + "dnsman.test" + ]; }; firewall = { enable = true; - allowedTCPPorts = [ 443 8080 ]; + allowedTCPPorts = [ + 443 + 8080 + ]; allowedUDPPorts = [ 27960 ]; - trustedInterfaces = [ "vnet9" "virbr0" "enp0s2" ]; + trustedInterfaces = [ + "vnet9" + "virbr0" + "enp0s2" + ]; }; }; }; diff --git a/modules/sys/hardware/powerprofiles.nix b/modules/sys/hardware/powerprofiles.nix index 48ad41e..68bcd0a 100755 --- a/modules/sys/hardware/powerprofiles.nix +++ b/modules/sys/hardware/powerprofiles.nix @@ -1,7 +1,7 @@ -{ lib, config, ... }: { +{ lib, config, ... }: +{ options = { - movOpts.hardwareCfg.powerProfiles.enable = - lib.mkEnableOption "enables power profiles"; + movOpts.hardwareCfg.powerProfiles.enable = lib.mkEnableOption "enables power profiles"; }; config = lib.mkIf config.movOpts.hardwareCfg.powerProfiles.enable { services = { diff --git a/modules/sys/software/default.nix b/modules/sys/software/default.nix index 6b7172a..230882f 100755 --- a/modules/sys/software/default.nix +++ b/modules/sys/software/default.nix @@ -1,5 +1,18 @@ -{ inputs, nixpkgs, config, self, username, host, ... }: { - imports = [ (import ./packages.nix) ] ++ [ (import ./programs.nix) ] - ++ [ (import ./services.nix) ] ++ [ (import ./virtualization.nix) ] - ++ [ (import ./gaming) ]; +{ + inputs, + nixpkgs, + config, + self, + username, + host, + ... +}: +{ + imports = [ + (import ./packages.nix) + ] + ++ [ (import ./programs.nix) ] + ++ [ (import ./services.nix) ] + ++ [ (import ./virtualization.nix) ] + ++ [ (import ./gaming) ]; } diff --git a/modules/sys/software/gaming/default.nix b/modules/sys/software/gaming/default.nix index 6b1c76a..138b487 100755 --- a/modules/sys/software/gaming/default.nix +++ b/modules/sys/software/gaming/default.nix @@ -1,3 +1,4 @@ -{ ... }: { +{ ... }: +{ imports = [ (import ./steam.nix) ] ++ [ (import ./gaming_pkgs.nix) ]; } diff --git a/modules/sys/software/gaming/gaming_pkgs.nix b/modules/sys/software/gaming/gaming_pkgs.nix index 6a692fb..abc1d2c 100755 --- a/modules/sys/software/gaming/gaming_pkgs.nix +++ b/modules/sys/software/gaming/gaming_pkgs.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: let cust-openrct2 = pkgs.openrct2.overrideAttrs (oldAttrs: { @@ -12,10 +17,10 @@ let cust-prismlauncher = pkgs.prismlauncher.override (oldAttrs: { jdks = [ pkgs.temurin-bin-21 ]; }); -in { +in +{ options = { - movOpts.softwareCfg.gamingPkgs.enable = - lib.mkEnableOption "enables gaming packages"; + movOpts.softwareCfg.gamingPkgs.enable = lib.mkEnableOption "enables gaming packages"; }; config = lib.mkIf config.movOpts.softwareCfg.gamingPkgs.enable { environment.systemPackages = with pkgs; [ diff --git a/modules/sys/software/gaming/steam.nix b/modules/sys/software/gaming/steam.nix index 494ba2e..c76dbf7 100755 --- a/modules/sys/software/gaming/steam.nix +++ b/modules/sys/software/gaming/steam.nix @@ -1,7 +1,12 @@ -{ lib, config, pkgs, ... }: { +{ + lib, + config, + pkgs, + ... +}: +{ options = { - movOpts.softwareCfg.steamConfig.enable = - lib.mkEnableOption "enables steam configuration"; + movOpts.softwareCfg.steamConfig.enable = lib.mkEnableOption "enables steam configuration"; }; config = lib.mkIf config.movOpts.softwareCfg.steamConfig.enable { programs.steam = { diff --git a/modules/sys/software/packages.nix b/modules/sys/software/packages.nix index 7e43bfd..88812e2 100755 --- a/modules/sys/software/packages.nix +++ b/modules/sys/software/packages.nix @@ -1,71 +1,75 @@ -{ lib, config, pkgs, inputs, ... }: { +{ + lib, + config, + pkgs, + inputs, + ... +}: +{ options = { - movOpts.softwareCfg.sysPkgs.enable = - lib.mkEnableOption "enables default system packages"; + movOpts.softwareCfg.sysPkgs.enable = lib.mkEnableOption "enables default system packages"; }; config = - let - shed = inputs.shed.packages.${pkgs.stdenv.hostPlatform.system}.default; - in - lib.mkIf config.movOpts.softwareCfg.sysPkgs.enable { - environment.systemPackages = with pkgs; [ - dotnetCorePackages.sdk_8_0_4xx - alsa-lib - xwayland - shed - wayland - alsa-utils - bc - cliphist - fail2ban - git - gcc - zip - unzip - hyprland-workspaces - hyprpaper - hyprpicker - inetutils - rcon-cli - kitty - lolcat - lsof - fastfetch - nh - nix-index - nix-output-monitor - nix-prefetch-scripts - nixos-option - nix-search-cli - nix-template - nixfmt - sshfs - nvd - pamixer - pavucontrol - playerctl - usbutils - vim - uhk-agent - jq - jinja2-cli - socat - python3 - python313Packages.jinja2 - python313Packages.pillow - ffmpeg - wl-clipboard - cmake - libnotify - gnumake - file - pkg-config - openssl - libvirt-glib - man-pages - man-pages-posix - most - wget - ]; - }; + let + shed = inputs.shed.packages.${pkgs.stdenv.hostPlatform.system}.default; + in + lib.mkIf config.movOpts.softwareCfg.sysPkgs.enable { + environment.systemPackages = with pkgs; [ + dotnetCorePackages.sdk_8_0_4xx + alsa-lib + xwayland + shed + wayland + alsa-utils + bc + cliphist + fail2ban + git + gcc + zip + unzip + hyprland-workspaces + hyprpaper + hyprpicker + inetutils + rcon-cli + kitty + lolcat + lsof + fastfetch + nh + nix-index + nix-output-monitor + nix-prefetch-scripts + nixos-option + nix-search-cli + nix-template + nixfmt + sshfs + nvd + pamixer + pavucontrol + playerctl + usbutils + vim + uhk-agent + jq + jinja2-cli + socat + myPython + ffmpeg + wl-clipboard + cmake + libnotify + gnumake + file + pkg-config + openssl + libvirt-glib + man-pages + man-pages-posix + most + wget + ]; + }; } diff --git a/modules/sys/software/programs.nix b/modules/sys/software/programs.nix index d939403..53b7950 100755 --- a/modules/sys/software/programs.nix +++ b/modules/sys/software/programs.nix @@ -1,22 +1,27 @@ -{ lib, config, pkgs, ... }: { +{ + lib, + config, + pkgs, + ... +}: +{ options = { - movOpts.softwareCfg.sysProgs.enable = - lib.mkEnableOption "enables default system programs"; + movOpts.softwareCfg.sysProgs.enable = lib.mkEnableOption "enables default system programs"; }; config = lib.mkIf config.movOpts.softwareCfg.sysProgs.enable { environment.etc."shells" = { enable = true; text = '' -/run/current-system/sw/bin/zsh -/run/current-system/sw/bin/bash -/run/current-system/sw/bin/zsh -/nix/store/m7l6yzmflrf9hjs8707lk9nkhi6f73n1-zsh-5.9/bin/zsh -/run/current-system/sw/bin/bash -/run/current-system/sw/bin/sh -/nix/store/f33kh08pa7pmy4kvsmsibda46sh46s66-bash-interactive-5.2p37/bin/bash -/nix/store/f33kh08pa7pmy4kvsmsibda46sh46s66-bash-interactive-5.2p37/bin/sh -/bin/sh -/home/pagedmov/Coding/projects/rust/rsh/target/debug/rsh + /run/current-system/sw/bin/zsh + /run/current-system/sw/bin/bash + /run/current-system/sw/bin/zsh + /nix/store/m7l6yzmflrf9hjs8707lk9nkhi6f73n1-zsh-5.9/bin/zsh + /run/current-system/sw/bin/bash + /run/current-system/sw/bin/sh + /nix/store/f33kh08pa7pmy4kvsmsibda46sh46s66-bash-interactive-5.2p37/bin/bash + /nix/store/f33kh08pa7pmy4kvsmsibda46sh46s66-bash-interactive-5.2p37/bin/sh + /bin/sh + /home/pagedmov/Coding/projects/rust/rsh/target/debug/rsh ''; }; programs = { @@ -24,7 +29,10 @@ zsh.enable = lib.mkDefault true; nix-ld = { enable = lib.mkDefault true; - libraries = with pkgs; [ stdenv.cc.cc ffmpeg-full ]; + libraries = with pkgs; [ + stdenv.cc.cc + ffmpeg-full + ]; }; gnupg.agent = { enable = lib.mkDefault true; diff --git a/modules/sys/software/services.nix b/modules/sys/software/services.nix index b541212..fbb6fe1 100755 --- a/modules/sys/software/services.nix +++ b/modules/sys/software/services.nix @@ -1,7 +1,12 @@ -{ lib, pkgs, config, ... }: { +{ + lib, + pkgs, + config, + ... +}: +{ options = { - movOpts.softwareCfg.sysServices.enable = - lib.mkEnableOption "enables default system services"; + movOpts.softwareCfg.sysServices.enable = lib.mkEnableOption "enables default system services"; }; config = lib.mkIf config.movOpts.softwareCfg.sysServices.enable { users.users.pagedmov = { @@ -18,7 +23,9 @@ enable = true; keyboards.default = { ids = [ "*" ]; - settings.main = { capslock = "esc"; }; + settings.main = { + capslock = "esc"; + }; }; }; copyparty = { diff --git a/modules/sys/software/virtualization.nix b/modules/sys/software/virtualization.nix index ad7073d..9a30358 100755 --- a/modules/sys/software/virtualization.nix +++ b/modules/sys/software/virtualization.nix @@ -1,7 +1,13 @@ -{ lib, config, username, pkgs, ... }: { +{ + lib, + config, + username, + pkgs, + ... +}: +{ options = { - movOpts.softwareCfg.virtConfig.enable = - lib.mkEnableOption "enables virtualization"; + movOpts.softwareCfg.virtConfig.enable = lib.mkEnableOption "enables virtualization"; }; config = lib.mkIf config.movOpts.softwareCfg.virtConfig.enable { virtualisation.libvirtd.enable = true; diff --git a/modules/sys/sysenv/console.nix b/modules/sys/sysenv/console.nix index 7851206..c826f6d 100644 --- a/modules/sys/sysenv/console.nix +++ b/modules/sys/sysenv/console.nix @@ -1,7 +1,12 @@ -{ lib, config, pkgs, ... }: { +{ + lib, + config, + pkgs, + ... +}: +{ options = { - movOpts.sysEnv.consoleSettings.enable = - lib.mkEnableOption "enables my console settings"; + movOpts.sysEnv.consoleSettings.enable = lib.mkEnableOption "enables my console settings"; }; config = lib.mkIf config.movOpts.sysEnv.consoleSettings.enable { i18n.defaultLocale = "en_US.UTF-8"; diff --git a/modules/sys/sysenv/default.nix b/modules/sys/sysenv/default.nix index 5175561..166da05 100755 --- a/modules/sys/sysenv/default.nix +++ b/modules/sys/sysenv/default.nix @@ -1,5 +1,19 @@ -{ inputs, nixpkgs, nixvim, config, self, username, host, ... }: { - imports = [ (import ./sddm.nix) ] ++ [ (import ./issue.nix) ] - ++ [ (import ./nix.nix) ] ++ [ (import ./stylix.nix) ]; +{ + inputs, + nixpkgs, + nixvim, + config, + self, + username, + host, + ... +}: +{ + imports = [ + (import ./sddm.nix) + ] + ++ [ (import ./issue.nix) ] + ++ [ (import ./nix.nix) ] + ++ [ (import ./stylix.nix) ]; #++ [ (import ./console.nix) ]; } diff --git a/modules/sys/sysenv/issue.nix b/modules/sys/sysenv/issue.nix index 394b12f..1d7afa6 100755 --- a/modules/sys/sysenv/issue.nix +++ b/modules/sys/sysenv/issue.nix @@ -1,7 +1,7 @@ -{ lib, config, ... }: { +{ lib, config, ... }: +{ options = { - movOpts.sysEnv.issue.enable = - lib.mkEnableOption "enables custom /etc/issue splash screen for the tty"; + movOpts.sysEnv.issue.enable = lib.mkEnableOption "enables custom /etc/issue splash screen for the tty"; }; config = lib.mkIf config.movOpts.sysEnv.issue.enable { environment.etc."issue".text = '' diff --git a/modules/sys/sysenv/nix.nix b/modules/sys/sysenv/nix.nix index b1de146..929e521 100755 --- a/modules/sys/sysenv/nix.nix +++ b/modules/sys/sysenv/nix.nix @@ -1,14 +1,17 @@ -{ lib, config, ... }: { +{ lib, config, ... }: +{ options = { - movOpts.sysEnv.nixSettings.enable = - lib.mkEnableOption "enables my nixos settings"; + movOpts.sysEnv.nixSettings.enable = lib.mkEnableOption "enables my nixos settings"; }; config = lib.mkIf config.movOpts.sysEnv.nixSettings.enable { system.stateVersion = "24.05"; nix = { settings = { auto-optimise-store = true; - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; substituters = [ "https://nix-gaming.cachix.org" ]; }; gc = { diff --git a/modules/sys/sysenv/sddm.nix b/modules/sys/sysenv/sddm.nix index 76253b5..2e7dfe5 100755 --- a/modules/sys/sysenv/sddm.nix +++ b/modules/sys/sysenv/sddm.nix @@ -1,7 +1,13 @@ -{ pkgs, self, lib, config, ... }: { +{ + pkgs, + self, + lib, + config, + ... +}: +{ options = { - movOpts.sysEnv.sddmConfig.enable = - lib.mkEnableOption "enables custom sddm configuration"; + movOpts.sysEnv.sddmConfig.enable = lib.mkEnableOption "enables custom sddm configuration"; }; config = lib.mkIf config.movOpts.sysEnv.sddmConfig.enable { environment.systemPackages = [ diff --git a/modules/sys/sysenv/stylix.nix b/modules/sys/sysenv/stylix.nix index 47f451c..f3e66c3 100755 --- a/modules/sys/sysenv/stylix.nix +++ b/modules/sys/sysenv/stylix.nix @@ -1,25 +1,28 @@ -{ pkgs, self, lib, config, ... }: +{ + pkgs, + self, + lib, + config, + ... +}: let scheme = "ayu-dark"; - wallpaper = "${self}/assets/wallpapers/dark-waves.jpg"; -in { +in +{ options = { - movOpts.sysEnv.stylixConfig.enable = - lib.mkEnableOption "enables custom stylix options"; + movOpts.sysEnv.stylixConfig.enable = lib.mkEnableOption "enables custom stylix options"; }; config = lib.mkIf config.movOpts.sysEnv.stylixConfig.enable { stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/${scheme}.yaml"; - image = wallpaper; homeManagerIntegration = { autoImport = true; followSystem = true; }; polarity = "dark"; autoEnable = true; - opacity.terminal = 0.8; targets = { console.enable = false; feh.enable = true; diff --git a/overlay/overlay.nix b/overlay/overlay.nix index 02706ed..e02ad1f 100644 --- a/overlay/overlay.nix +++ b/overlay/overlay.nix @@ -1,4 +1,9 @@ -{ host ? "oganesson", root, ... }: self: super: +{ + host ? "oganesson", + root, + ... +}: +self: super: let extraFigletFonts = super.fetchFromGitHub { @@ -13,7 +18,8 @@ let rev = "v0.4.2"; sha256 = "sha256-y5H4m/1ZNYkvhYnfvKs2zVq6dzUgUYsu0UCBGpcoYgQ="; }; -in { +in +{ vicut = super.rustPlatform.buildRustPackage { pname = "vicut"; version = "v0.4.2"; @@ -25,7 +31,7 @@ in { description = "A Vim-based, scriptable, headless text editor for the command line"; homepage = "https://github.com/km-clay/vicut"; license = super.lib.licenses.mit; - maintainers = []; + maintainers = [ ]; }; }; @@ -39,11 +45,18 @@ in { ''; }); + myPython = super.python3.withPackages (p: [ + p.evdev + p.requests + p.pillow + p.pynvim + ]); + myPkgs = { - slash = super.callPackage ./pkgs/slash/package.nix {}; - fzf-tab = super.callPackage ./pkgs/zsh-fzf-tab/package.nix {}; - noto-sans-jp = super.callPackage ./pkgs/noto-sans-jp/package.nix {}; - billy-font = super.callPackage ./pkgs/billy-font/package.nix {}; + slash = super.callPackage ./pkgs/slash/package.nix { }; + fzf-tab = super.callPackage ./pkgs/zsh-fzf-tab/package.nix { }; + noto-sans-jp = super.callPackage ./pkgs/noto-sans-jp/package.nix { }; + billy-font = super.callPackage ./pkgs/billy-font/package.nix { }; }; myScripts = import ./scripts { inherit super root host; }; diff --git a/overlay/pkgs/billy-font/package.nix b/overlay/pkgs/billy-font/package.nix index 17d518d..f66ae61 100644 --- a/overlay/pkgs/billy-font/package.nix +++ b/overlay/pkgs/billy-font/package.nix @@ -1,4 +1,6 @@ -{ pkgs ? import {} }: +{ + pkgs ? import { }, +}: pkgs.stdenvNoCC.mkDerivation { pname = "billy-font"; diff --git a/overlay/pkgs/breezex-cursor/package.nix b/overlay/pkgs/breezex-cursor/package.nix index 4855ba8..75b8a7a 100644 --- a/overlay/pkgs/breezex-cursor/package.nix +++ b/overlay/pkgs/breezex-cursor/package.nix @@ -3,7 +3,7 @@ fetchFromGitHub, fetchzip, clickgen, - lib + lib, }: stdenvNoCC.mkDerivation rec { diff --git a/overlay/pkgs/noto-sans-jp/package.nix b/overlay/pkgs/noto-sans-jp/package.nix index f292646..0d686c8 100644 --- a/overlay/pkgs/noto-sans-jp/package.nix +++ b/overlay/pkgs/noto-sans-jp/package.nix @@ -1,4 +1,6 @@ -{ pkgs ? import {} }: +{ + pkgs ? import { }, +}: pkgs.stdenvNoCC.mkDerivation rec { pname = "noto-sans-jp"; diff --git a/overlay/pkgs/slash/package.nix b/overlay/pkgs/slash/package.nix index 8080fcb..694daf1 100644 --- a/overlay/pkgs/slash/package.nix +++ b/overlay/pkgs/slash/package.nix @@ -1,22 +1,23 @@ -{ pkgs ? import {} }: +{ + pkgs ? import { }, +}: pkgs.rustPlatform.buildRustPackage rec { - pname = "slash"; - version = "v0.5.0_662cb43"; + pname = "slash"; + version = "v0.5.0_662cb43"; - src = pkgs.fetchFromGitHub { + src = pkgs.fetchFromGitHub { owner = "pagedMov"; repo = "slash"; rev = "662cb43e499d179579d99bf358073516605230ea"; hash = "sha256-4DKAhRkd1XeDNyYH8yL1TnbTc6hZnp2+UV7UYeDRkpE="; }; - - doCheck = false; # TODO: Find a way to make tests work + doCheck = false; # TODO: Find a way to make tests work - cargoLock.lockFile = ./Cargo.lock; + cargoLock.lockFile = ./Cargo.lock; - passthru = { - shellPath = "/bin/slash"; - }; - } + passthru = { + shellPath = "/bin/slash"; + }; +} diff --git a/overlay/pkgs/zsh-fzf-tab/package.nix b/overlay/pkgs/zsh-fzf-tab/package.nix index 666c561..2ae68af 100644 --- a/overlay/pkgs/zsh-fzf-tab/package.nix +++ b/overlay/pkgs/zsh-fzf-tab/package.nix @@ -1,4 +1,6 @@ -{ pkgs ? import { } }: +{ + pkgs ? import { }, +}: pkgs.stdenv.mkDerivation { pname = "fzf-tab"; diff --git a/overlay/scripts/commands/default.nix b/overlay/scripts/commands/default.nix index 110ea49..1c4d3c5 100644 --- a/overlay/scripts/commands/default.nix +++ b/overlay/scripts/commands/default.nix @@ -1,12 +1,12 @@ { super, root }: { - icanhazip = super.callPackage ./icanhazip.nix {}; + icanhazip = super.callPackage ./icanhazip.nix { }; invoke = super.callPackage ./invoke.nix { self = root; }; git-compose = super.callPackage ./git-compose.nix { self = root; }; - runbg = super.callPackage ./runbg.nix {}; - splash = super.callPackage ./splash.nix {}; - toolbelt = super.callPackage ./toolbelt.nix {}; - viconf = super.callPackage ./viconf.nix {}; - vipkg = super.callPackage ./vipkg.nix {}; + runbg = super.callPackage ./runbg.nix { }; + splash = super.callPackage ./splash.nix { }; + toolbelt = super.callPackage ./toolbelt.nix { }; + viconf = super.callPackage ./viconf.nix { }; + vipkg = super.callPackage ./vipkg.nix { }; } diff --git a/overlay/scripts/commands/icanhazip.nix b/overlay/scripts/commands/icanhazip.nix index 18d9401..ec5d536 100644 --- a/overlay/scripts/commands/icanhazip.nix +++ b/overlay/scripts/commands/icanhazip.nix @@ -2,7 +2,12 @@ pkgs.writeShellApplication { name = "icanhazip"; - runtimeInputs = with pkgs; [ iproute2 curl gawk coreutils ]; + runtimeInputs = with pkgs; [ + iproute2 + curl + gawk + coreutils + ]; text = '' if [ $# -eq 0 ]; then echo "Public IP: $(curl -s icanhazip.com -4)" diff --git a/overlay/scripts/commands/runbg.nix b/overlay/scripts/commands/runbg.nix index 16f7c3e..5864217 100755 --- a/overlay/scripts/commands/runbg.nix +++ b/overlay/scripts/commands/runbg.nix @@ -1,4 +1,4 @@ -{ pkgs, }: +{ pkgs }: pkgs.writeShellApplication { name = "runbg"; runtimeInputs = with pkgs; [ diff --git a/overlay/scripts/commands/splash.nix b/overlay/scripts/commands/splash.nix index 43b4638..1d53857 100755 --- a/overlay/scripts/commands/splash.nix +++ b/overlay/scripts/commands/splash.nix @@ -1,7 +1,11 @@ { pkgs }: pkgs.writeShellApplication { name = "splash"; - runtimeInputs = with pkgs; [ lolcat toilet coreutils ]; + runtimeInputs = with pkgs; [ + lolcat + toilet + coreutils + ]; text = '' echo "NixOS kernel ver. $(uname -a | awk '{print $3}') x86_64 GNU/Linux" date +"%A %B %-d %Y" diff --git a/overlay/scripts/commands/viconf.nix b/overlay/scripts/commands/viconf.nix index 603640f..3b88eaa 100755 --- a/overlay/scripts/commands/viconf.nix +++ b/overlay/scripts/commands/viconf.nix @@ -1,14 +1,19 @@ { pkgs }: pkgs.writeShellApplication { name = "viconf"; - runtimeInputs = with pkgs; [ coreutils fd ripgrep fzf ]; + runtimeInputs = with pkgs; [ + coreutils + fd + ripgrep + fzf + ]; text = '' open_file() { file="$1" if grep -Pq "[^\x00-\x7F]" "$file"; then - NIXD_FLAGS="--semantic-tokens=false" nvim "$file" + NIXD_FLAGS="--semantic-tokens=false" $EDITOR "$file" else - nvim "$file" + $EDITOR "$file" fi } diff --git a/overlay/scripts/commands/vipkg.nix b/overlay/scripts/commands/vipkg.nix index 65aa006..548f41d 100644 --- a/overlay/scripts/commands/vipkg.nix +++ b/overlay/scripts/commands/vipkg.nix @@ -1,4 +1,6 @@ -{ pkgs ? import { } }: +{ + pkgs ? import { }, +}: let nixpkgs_toplevel = pkgs.fetchFromGitHub { owner = "NixOS"; @@ -6,9 +8,15 @@ let rev = "63dacb46bf939521bdc93981b4cbb7ecb58427a0"; hash = "sha256-vboIEwIQojofItm2xGCdZCzW96U85l9nDW3ifMuAIdM="; }; -in pkgs.writeShellApplication { +in +pkgs.writeShellApplication { name = "vipkg"; - runtimeInputs = with pkgs; [ coreutils fd ripgrep fzf ]; + runtimeInputs = with pkgs; [ + coreutils + fd + ripgrep + fzf + ]; text = '' [ ! $# -eq 1 ] && echo "Usage: vipkg " && exit 1 diff --git a/overlay/scripts/default.nix b/overlay/scripts/default.nix index 1f7ba3f..52fe393 100644 --- a/overlay/scripts/default.nix +++ b/overlay/scripts/default.nix @@ -1,7 +1,11 @@ -{ super, root, host }: +{ + super, + root, + host, +}: # We need to fold all of these into a single attribute set -import ./commands { inherit super root; } // -import ./nix { inherit super host root; } // -import ./misc { inherit super; } // -import ./wm-controls { inherit super; } +import ./commands { inherit super root; } +// import ./nix { inherit super host root; } +// import ./misc { inherit super; } +// import ./wm-controls { inherit super; } diff --git a/overlay/scripts/misc/default.nix b/overlay/scripts/misc/default.nix index 95d50b6..744acb4 100644 --- a/overlay/scripts/misc/default.nix +++ b/overlay/scripts/misc/default.nix @@ -1,6 +1,6 @@ { super }: { - color-commit = super.callPackage ./color-commit.nix {}; - mntstack = super.callPackage ./mntstack.nix {}; + color-commit = super.callPackage ./color-commit.nix { }; + mntstack = super.callPackage ./mntstack.nix { }; } diff --git a/overlay/scripts/misc/mntstack.nix b/overlay/scripts/misc/mntstack.nix index 2c0d5fb..4e0257c 100644 --- a/overlay/scripts/misc/mntstack.nix +++ b/overlay/scripts/misc/mntstack.nix @@ -2,7 +2,7 @@ pkgs.writeShellApplication { name = "mntstack"; - runtimeInputs = []; + runtimeInputs = [ ]; text = '' set -e diff --git a/overlay/scripts/nix/check_updates.nix b/overlay/scripts/nix/check_updates.nix index b87edab..188cb44 100644 --- a/overlay/scripts/nix/check_updates.nix +++ b/overlay/scripts/nix/check_updates.nix @@ -1,91 +1,94 @@ { pkgs }: pkgs.stdenv.mkDerivation { - pname = "pkg_maintenance_check"; - version = "1.0"; - src = ./.; - buildPhase = '' - mkdir -p $out/bin - cat > $out/bin/checkupdates.py <<- EOF -import json -import subprocess -import requests -def get_packages_by_maintainer(target_maintainer): - try: - nix_env_command = [ - "nix-env", "--meta", "--json", "-qaP" - ] - jq_query = ( - 'to_entries[] | select(.value.meta.maintainers? // [] | ' - f'any(.github == "{target_maintainer}")) | .value' - ) - result = subprocess.run( - nix_env_command, - capture_output=True, - text=True, - check=True - ) - filtered_packages = subprocess.run( - ["jq", "-r", "-c", jq_query], - input=result.stdout, - capture_output=True, - text=True, - check=True - ) - return [json.loads(pkg) for pkg in filtered_packages.stdout.strip().split('\n') if pkg] - except subprocess.CalledProcessError as e: - print(f"Error running nix-env or jq: {e}") - return [] + pname = "pkg_maintenance_check"; + version = "1.0"; + src = ./.; + buildPhase = '' + mkdir -p $out/bin + cat > $out/bin/checkupdates.py <<- EOF + import json + import subprocess + import requests + def get_packages_by_maintainer(target_maintainer): + try: + nix_env_command = [ + "nix-env", "--meta", "--json", "-qaP" + ] + jq_query = ( + 'to_entries[] | select(.value.meta.maintainers? // [] | ' + f'any(.github == "{target_maintainer}")) | .value' + ) + result = subprocess.run( + nix_env_command, + capture_output=True, + text=True, + check=True + ) + filtered_packages = subprocess.run( + ["jq", "-r", "-c", jq_query], + input=result.stdout, + capture_output=True, + text=True, + check=True + ) + return [json.loads(pkg) for pkg in filtered_packages.stdout.strip().split('\n') if pkg] + except subprocess.CalledProcessError as e: + print(f"Error running nix-env or jq: {e}") + return [] -def check_github_releases(maintained_packages): - github_api_template = "https://api.github.com/repos/{owner}/{repo}/releases/latest" - updates = [] + def check_github_releases(maintained_packages): + github_api_template = "https://api.github.com/repos/{owner}/{repo}/releases/latest" + updates = [] - for package in maintained_packages: - pname = package.get("pname", "unknown") - repo_url = package.get("meta", {}).get("homepage", "") - current_version = package.get("version", "unknown") + for package in maintained_packages: + pname = package.get("pname", "unknown") + repo_url = package.get("meta", {}).get("homepage", "") + current_version = package.get("version", "unknown") - if "github.com" in repo_url: - owner_repo = repo_url.split("github.com/")[1].rstrip('/') - owner, repo = owner_repo.split('/') - api_url = github_api_template.format(owner=owner, repo=repo) + if "github.com" in repo_url: + owner_repo = repo_url.split("github.com/")[1].rstrip('/') + owner, repo = owner_repo.split('/') + api_url = github_api_template.format(owner=owner, repo=repo) - response = requests.get(api_url) - if response.status_code == 200: - latest_release = response.json() - latest_version = latest_release.get("tag_name", "").lstrip('v') - if latest_version and latest_version != current_version: - updates.append({"pkg": pname, "version": latest_version}) + response = requests.get(api_url) + if response.status_code == 200: + latest_release = response.json() + latest_version = latest_release.get("tag_name", "").lstrip('v') + if latest_version and latest_version != current_version: + updates.append({"pkg": pname, "version": latest_version}) + else: + print(f"{pname} is up to date.\n") else: - print(f"{pname} is up to date.\n") + print(f"Failed to check version for {pname} (HTTP {response.status_code}).\n") else: - print(f"Failed to check version for {pname} (HTTP {response.status_code}).\n") - else: - print(f"Skipping non-GitHub repository for {pname}.\n") - return updates + print(f"Skipping non-GitHub repository for {pname}.\n") + return updates -def notify_updates(updates): - if updates: - update_string = '\n'.join([f" {update['pkg']} -> {update['version']}" for update in updates]) - subprocess.run([ - "notify-send", - "--icon=/home/pagedmov/.sysflake/assets/images/nixos-icon-generic.png", - "Maintenance Update", - f"Package updates found:\n{update_string}" - ]) - subprocess.run(["aplay", "-q", "-N", "/home/pagedmov/.sysflake/assets/sound/login.wav"]) + def notify_updates(updates): + if updates: + update_string = '\n'.join([f" {update['pkg']} -> {update['version']}" for update in updates]) + subprocess.run([ + "notify-send", + "--icon=/home/pagedmov/.sysflake/assets/images/nixos-icon-generic.png", + "Maintenance Update", + f"Package updates found:\n{update_string}" + ]) + subprocess.run(["aplay", "-q", "-N", "/home/pagedmov/.sysflake/assets/sound/login.wav"]) -target_maintainer = "pagedMov" -maintained_packages = get_packages_by_maintainer(target_maintainer) + target_maintainer = "pagedMov" + maintained_packages = get_packages_by_maintainer(target_maintainer) -if maintained_packages: - updates = check_github_releases(maintained_packages) - notify_updates(updates) -else: - print(f"No packages maintained by {target_maintainer} were found.") -EOF - ''; - buildInputs = with pkgs; [ python3Packages.requests jq ]; - installPhase = ":"; + if maintained_packages: + updates = check_github_releases(maintained_packages) + notify_updates(updates) + else: + print(f"No packages maintained by {target_maintainer} were found.") + EOF + ''; + buildInputs = with pkgs; [ + python3Packages.requests + jq + ]; + installPhase = ":"; } diff --git a/overlay/scripts/nix/default.nix b/overlay/scripts/nix/default.nix index 4884eac..d03b274 100644 --- a/overlay/scripts/nix/default.nix +++ b/overlay/scripts/nix/default.nix @@ -1,9 +1,16 @@ -{ super, host, root }: +{ + super, + host, + root, +}: { - fetchfromgh = super.callPackage ./templates/fetchfromgh.nix {}; - mkshell = super.callPackage ./templates/mkshell.nix {}; - garbage-collect = super.callPackage ./garbage-collect.nix {}; - check_updates = super.callPackage ./check_updates.nix {}; - rebuild = super.callPackage ./rebuild.nix { inherit host; self = root; }; + fetchfromgh = super.callPackage ./templates/fetchfromgh.nix { }; + mkshell = super.callPackage ./templates/mkshell.nix { }; + garbage-collect = super.callPackage ./garbage-collect.nix { }; + check_updates = super.callPackage ./check_updates.nix { }; + rebuild = super.callPackage ./rebuild.nix { + inherit host; + self = root; + }; } diff --git a/overlay/scripts/nix/rebuild.nix b/overlay/scripts/nix/rebuild.nix index 3f3d161..136e241 100755 --- a/overlay/scripts/nix/rebuild.nix +++ b/overlay/scripts/nix/rebuild.nix @@ -1,4 +1,8 @@ -{ host, self, pkgs, }: +{ + host, + self, + pkgs, +}: pkgs.writeShellApplication { name = "rebuild"; runtimeInputs = [ @@ -30,11 +34,8 @@ pkgs.writeShellApplication { dry=false update=false - played_start=false - hooray() { playshellsound "${self}/assets/sound/update.wav"; } damn() { playshellsound "${self}/assets/sound/error.wav"; } - start() { [ "$played_start" = false ] && playshellsound "${self}/assets/sound/nixswitch-start.wav" && played_start=true || true; } update_done() { playshellsound "${self}/assets/sound/update_alt.wav"; } usage="\033[1;4;38;2;243;139;168mUsage\033[0m: rebuild -h for home config, rebuild -s for sys config, rebuild -a for both. Including 'n' with the flag does a dry run, i.e. rebuild -nh" @@ -49,10 +50,10 @@ pkgs.writeShellApplication { dry_flag="" [ "$dry" = true ] && dry_flag="-n" - [ "$update" = true ] && start && (cd "$FLAKEPATH" && nix flake update) && update_done + [ "$update" = true ] && (cd "$FLAKEPATH" && nix flake update) && update_done - [ "$all" = true ] && if sudo sleep 0.1 && start && nh os switch $dry_flag -H "${host}" "$FLAKEPATH" && nh home switch $dry_flag -c "${host}Home" "$FLAKEPATH"; then hooray; else damn; fi - [ "$system" = true ] && start && if nh os switch $dry_flag -H "${host}" "$FLAKEPATH"; then hooray; else damn; fi - [ "$home" = true ] && start && if nh home switch $dry_flag -c "${host}Home" "$FLAKEPATH"; then hooray; else damn; fi + [ "$all" = true ] && if sudo sleep 0.1 && nh os switch $dry_flag -H "${host}" "$FLAKEPATH" && nh home switch $dry_flag -c "${host}Home" "$FLAKEPATH"; then hooray; else damn; fi + [ "$system" = true ] && if nh os switch $dry_flag -H "${host}" "$FLAKEPATH"; then hooray; else damn; fi + [ "$home" = true ] && if nh home switch $dry_flag -c "${host}Home" "$FLAKEPATH"; then hooray; else damn; fi ''; } diff --git a/overlay/scripts/nix/templates/fetchfromgh.nix b/overlay/scripts/nix/templates/fetchfromgh.nix index 5d6c25d..6eadbaf 100644 --- a/overlay/scripts/nix/templates/fetchfromgh.nix +++ b/overlay/scripts/nix/templates/fetchfromgh.nix @@ -1,4 +1,6 @@ -{ pkgs ? import { } }: +{ + pkgs ? import { }, +}: pkgs.writeShellApplication { name = "fetchfromgh"; diff --git a/overlay/scripts/nix/templates/mkshell.nix b/overlay/scripts/nix/templates/mkshell.nix index a233b52..cbfef6c 100644 --- a/overlay/scripts/nix/templates/mkshell.nix +++ b/overlay/scripts/nix/templates/mkshell.nix @@ -1,19 +1,21 @@ -{ pkgs ? import { } }: +{ + pkgs ? import { }, +}: pkgs.writeShellApplication { name = "mkshell"; - runtimeInputs = []; + runtimeInputs = [ ]; text = '' - command cat <' -A base16-schemes)"/share/themes | \ sed 's/\.yaml//g' | \ diff --git a/overlay/scripts/wm-controls/default.nix b/overlay/scripts/wm-controls/default.nix index 0c7267b..0766836 100644 --- a/overlay/scripts/wm-controls/default.nix +++ b/overlay/scripts/wm-controls/default.nix @@ -1,12 +1,12 @@ { super }: { - chpaper = super.callPackage ./chpaper.nix {}; - chscheme = super.callPackage ./chscheme.nix {}; - keyring = super.callPackage ./keyring.nix {}; - playshellsound = super.callPackage ./playshellsound.nix {}; - mkscreenshots = super.callPackage ./mkscreenshots.nix {}; - moveonscreen = super.callPackage ./moveonscreen.nix {}; - s_check = super.callPackage ./s_check.nix {}; - switchmon = super.callPackage ./switchmon.nix {}; + chpaper = super.callPackage ./chpaper.nix { }; + chscheme = super.callPackage ./chscheme.nix { }; + keyring = super.callPackage ./keyring.nix { }; + playshellsound = super.callPackage ./playshellsound.nix { }; + mkscreenshots = super.callPackage ./mkscreenshots.nix { }; + moveonscreen = super.callPackage ./moveonscreen.nix { }; + s_check = super.callPackage ./s_check.nix { }; + switchmon = super.callPackage ./switchmon.nix { }; } diff --git a/overlay/scripts/wm-controls/mkscreenshots.nix b/overlay/scripts/wm-controls/mkscreenshots.nix index caa603e..268c0c6 100644 --- a/overlay/scripts/wm-controls/mkscreenshots.nix +++ b/overlay/scripts/wm-controls/mkscreenshots.nix @@ -2,7 +2,15 @@ pkgs.writeShellApplication { name = "mkscreenshots"; - runtimeInputs = with pkgs; [ jq fastfetch kitty coreutils nemo grimblast git ]; + runtimeInputs = with pkgs; [ + jq + fastfetch + kitty + coreutils + nemo + grimblast + git + ]; text = '' if [ -n "$(hyprctl clients -j | jq -r '.[] | select(.workspace.name == "4")')" ]; then echo "There are windows in workspace 4. This script uses workspace 4, so move those windows and run it again." diff --git a/overlay/scripts/wm-controls/moveonscreen.nix b/overlay/scripts/wm-controls/moveonscreen.nix index 8714d08..b8aa890 100755 --- a/overlay/scripts/wm-controls/moveonscreen.nix +++ b/overlay/scripts/wm-controls/moveonscreen.nix @@ -1,7 +1,12 @@ { pkgs }: pkgs.writeShellApplication { name = "moveonscreen"; - runtimeInputs = with pkgs; [ hyprland jq coreutils gawk ]; + runtimeInputs = with pkgs; [ + hyprland + jq + coreutils + gawk + ]; text = '' center_window=false if [[ ! $# -eq 0 ]] && [[ $1 == "--center" ]]; then diff --git a/overlay/scripts/wm-controls/s_check.nix b/overlay/scripts/wm-controls/s_check.nix index 3fcc514..bf2580b 100755 --- a/overlay/scripts/wm-controls/s_check.nix +++ b/overlay/scripts/wm-controls/s_check.nix @@ -1,4 +1,4 @@ -{ pkgs, }: +{ pkgs }: pkgs.writeShellApplication { name = "scheck"; text = '' diff --git a/overlay/scripts/wm-controls/switchmon.nix b/overlay/scripts/wm-controls/switchmon.nix index 808e0d3..b7917d7 100755 --- a/overlay/scripts/wm-controls/switchmon.nix +++ b/overlay/scripts/wm-controls/switchmon.nix @@ -1,4 +1,4 @@ -{ pkgs, }: +{ pkgs }: pkgs.writeShellApplication { name = "switchmon"; text = ''