commit 1b7b1e66f065e99600cc436e8553dda758bb71e3 Author: _cry64 Date: Wed Mar 25 22:55:15 2026 -0700 init (cerulean template) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4a847d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/result diff --git a/README.md b/README.md new file mode 100644 index 0000000..b4c4443 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +## UniverseBow has a flake now?? +(she's so cool) diff --git a/bak/configuration.nix b/bak/configuration.nix new file mode 100644 index 0000000..0f18584 --- /dev/null +++ b/bak/configuration.nix @@ -0,0 +1,123 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # networking.hostName = "nixos"; # Define your hostname. + + # Configure network connections interactively with nmcli or nmtui. + networking.networkmanager.enable = true; + + # Set your time zone. + # time.timeZone = "Europe/Amsterdam"; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # useXkbConfig = true; # use xkb.options in tty. + # }; + + # Enable the X11 windowing system. + # services.xserver.enable = true; + + + + + # Configure keymap in X11 + # services.xserver.xkb.layout = "us"; + # services.xserver.xkb.options = "eurosign:e,caps:escape"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # services.pulseaudio.enable = true; + # OR + # services.pipewire = { + # enable = true; + # pulse.enable = true; + # }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + # users.users.alice = { + # isNormalUser = true; + # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + # packages = with pkgs; [ + # tree + # ]; + # }; + + # programs.firefox.enable = true; + + # List packages installed in system profile. + # You can use https://search.nixos.org/ to find more packages (and options). + # environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + # ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "25.11"; # Did you read the comment? + +} + diff --git a/bak/flake.nix b/bak/flake.nix new file mode 100644 index 0000000..739773d --- /dev/null +++ b/bak/flake.nix @@ -0,0 +1,16 @@ +{ + inputs = { + # This is pointing to an unstable release. + # If you prefer a stable release instead, you can this to the latest number shown here: https://nixos.org/download + # i.e. nixos-24.11 + # Use `nix flake update` to update the flake to the latest revision of the chosen release channel. + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + outputs = inputs@{ self, nixpkgs, ... }: { + # NOTE: 'nixos' is the default hostname + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + modules = [ ./configuration.nix ]; + }; + }; +} + diff --git a/bak/hardware-configuration.nix b/bak/hardware-configuration.nix new file mode 100644 index 0000000..ea7d685 --- /dev/null +++ b/bak/hardware-configuration.nix @@ -0,0 +1,33 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c959876c-805c-4433-bb36-67eb13924c62"; + fsType = "btrfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/8CC6-6102"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/091b5706-ba96-44b9-89b7-9aa7e85b8221"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6e68646 --- /dev/null +++ b/flake.lock @@ -0,0 +1,1420 @@ +{ + "nodes": { + "abseil-src": { + "flake": false, + "locked": { + "lastModified": 1722535511, + "narHash": "sha256-51jpDhdZ0n+KLmxh8KVaTz53pZAB0dHjmILFX+OLud4=", + "owner": "abseil", + "repo": "abseil-cpp", + "rev": "4447c7562e3bc702ade25105912dce503f0c4010", + "type": "github" + }, + "original": { + "owner": "abseil", + "ref": "20240722.0", + "repo": "abseil-cpp", + "type": "github" + } + }, + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1773436376, + "narHash": "sha256-OUPRrprbgN27BXHuWkMAPSCfLLQ/uwpWghEfKYN2iAg=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "43f10d24391692bba3d762931ee35e7f17f8e8b8", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "asio-src": { + "flake": false, + "locked": { + "lastModified": 1702548444, + "narHash": "sha256-8Xo6J6+dTvDtsthjbLMMTInHMDnMMM0rQwzbZu70J/s=", + "owner": "chriskohlhoff", + "repo": "asio", + "rev": "22ccfc94fc77356f7820601f9f33b9129a337d2d", + "type": "github" + }, + "original": { + "owner": "chriskohlhoff", + "ref": "asio-1-30-0", + "repo": "asio", + "type": "github" + } + }, + "awww": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1770895252, + "narHash": "sha256-TUGZVDcC5xsrWVnpBNosAG1cTy+aWchCWXPyeLZdnGM=", + "ref": "refs/heads/main", + "rev": "2c86d41d07471f518e24f5cd1f586e4d2a32d12c", + "revCount": 1331, + "type": "git", + "url": "https://codeberg.org/LGFae/awww" + }, + "original": { + "type": "git", + "url": "https://codeberg.org/LGFae/awww" + } + }, + "cerulean": { + "inputs": { + "deploy-rs": "deploy-rs", + "microvm": "microvm", + "nixpkgs": [ + "nixpkgs" + ], + "nt": "nt", + "sops-nix": "sops-nix", + "systems": [ + "systems" + ] + }, + "locked": { + "lastModified": 1774498035, + "narHash": "sha256-7TS/1kjtiVYx9tfzMi5s01Zfc8GloygBVihEaU5+wDs=", + "owner": "cry128", + "repo": "cerulean", + "rev": "22c31ad331145a25125c165d96bd898ae9f3c916", + "type": "github" + }, + "original": { + "owner": "cry128", + "ref": "refactor/snowflake", + "repo": "cerulean", + "type": "github" + } + }, + "curl-src": { + "flake": false, + "locked": { + "lastModified": 1743572790, + "narHash": "sha256-huAGWNm2rYBmgzUuYQ21IYp2skyQECelEkXPMBJY3cE=", + "owner": "curl", + "repo": "curl", + "rev": "1c3149881769e7bd79b072e48374e4c2b3678b2f", + "type": "github" + }, + "original": { + "owner": "curl", + "ref": "curl-8_13_0", + "repo": "curl", + "type": "github" + } + }, + "deploy-rs": { + "inputs": { + "flake-compat": "flake-compat_2", + "nixpkgs": [ + "cerulean", + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1770019181, + "narHash": "sha256-hwsYgDnby50JNVpTRYlF3UR/Rrpt01OrxVuryF40CFY=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "77c906c0ba56aabdbc72041bf9111b565cdd6171", + "type": "github" + }, + "original": { + "owner": "serokell", + "repo": "deploy-rs", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1761588595, + "narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "revCount": 69, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "cerulean", + "nt", + "nix-unit", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1762440070, + "narHash": "sha256-xxdepIcb39UJ94+YydGP221rjnpkDZUlykKuF54PsqI=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "26d05891e14c88eb4a5d5bee659c0db5afb609d8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "fmt-src": { + "flake": false, + "locked": { + "lastModified": 1758127535, + "narHash": "sha256-AZDmIeU1HbadC+K0TIAGogvVnxt0oE9U6ocpawIgl6g=", + "owner": "fmtlib", + "repo": "fmt", + "rev": "e424e3f2e607da02742f73db84873b8084fc714c", + "type": "github" + }, + "original": { + "owner": "fmtlib", + "ref": "12.0.0", + "repo": "fmt", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "grub2-themes": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1757136219, + "narHash": "sha256-tKU+vq34KHu/A2wD7WdgP5A4/RCmSD8hB0TyQAUlixA=", + "owner": "vinceliuice", + "repo": "grub2-themes", + "rev": "80dd04ddf3ba7b284a7b1a5df2b1e95ee2aad606", + "type": "github" + }, + "original": { + "owner": "vinceliuice", + "repo": "grub2-themes", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772985280, + "narHash": "sha256-FdrNykOoY9VStevU4zjSUdvsL9SzJTcXt4omdEDZDLk=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "8f736f007139d7f70752657dff6a401a585d6cbc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.11", + "repo": "home-manager", + "type": "github" + } + }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1772461003, + "narHash": "sha256-pVICsV7FtcEeVwg5y/LFh3XFUkVJninm/P1j/JHzEbM=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "b62396457b9cfe2ebf24fe05404b09d2a40f8ed7", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1772461523, + "narHash": "sha256-mI6A51do+hEUzeJKk9YSWfVHdI/SEEIBi2tp5Whq5mI=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "7d63c04b4a2dd5e59ef943b4b143f46e713df804", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprgraphics": "hyprgraphics", + "hyprland-guiutils": "hyprland-guiutils", + "hyprland-protocols": "hyprland-protocols", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "hyprwire": "hyprwire", + "nixpkgs": [ + "nixpkgs-unstable" + ], + "pre-commit-hooks": "pre-commit-hooks", + "systems": [ + "systems" + ], + "xdph": "xdph" + }, + "locked": { + "lastModified": 1774136452, + "narHash": "sha256-pSwj8WNWXMuZaDqCyhQwlngRD3JyNmZwldSe6UqWAos=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "bf31f642b08a8d8ca796a1b713285f2580805c2f", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-guiutils": { + "inputs": { + "aquamarine": [ + "hyprland", + "aquamarine" + ], + "hyprgraphics": [ + "hyprland", + "hyprgraphics" + ], + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprtoolkit": "hyprtoolkit", + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1772467975, + "narHash": "sha256-kipyuDBxrZq+beYpZqWzGvFWm4QbayW9agAvi94vDXY=", + "owner": "hyprwm", + "repo": "hyprland-guiutils", + "rev": "5e1c6b9025aaf4d578f3eff7c0eb1f0c197a9507", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-guiutils", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1772460177, + "narHash": "sha256-/6G/MsPvtn7bc4Y32pserBT/Z4SUUdBd4XYJpOEKVR4=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "1cb6db5fd6bb8aee419f4457402fa18293ace917", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1772459629, + "narHash": "sha256-/iwvNUYShmmnwmz/czEUh6+0eF5vCMv0xtDW0STPIuM=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "7615ee388de18239a4ab1400946f3d0e498a8186", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprtoolkit": { + "inputs": { + "aquamarine": [ + "hyprland", + "hyprland-guiutils", + "aquamarine" + ], + "hyprgraphics": [ + "hyprland", + "hyprland-guiutils", + "hyprgraphics" + ], + "hyprlang": [ + "hyprland", + "hyprland-guiutils", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprland-guiutils", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprland-guiutils", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "hyprland-guiutils", + "nixpkgs" + ], + "systems": [ + "hyprland", + "hyprland-guiutils", + "systems" + ] + }, + "locked": { + "lastModified": 1772462885, + "narHash": "sha256-5pHXrQK9zasMnIo6yME6EOXmWGFMSnCITcfKshhKJ9I=", + "owner": "hyprwm", + "repo": "hyprtoolkit", + "rev": "9af245a69fa6b286b88ddfc340afd288e00a6998", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprtoolkit", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1773948364, + "narHash": "sha256-S76omfIVQ1TpGiXFbqih6o6XcH3sA5+5QI+SXB4HvlY=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "b85b779e3e3a1adcd9b098e3447cf48f9e780b35", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1772459835, + "narHash": "sha256-978jRz/y/9TKmZb/qD4lEYHCQGHpEXGqy+8X2lFZsak=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "0a692d4a645165eebd65f109146b8861e3a925e7", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "hyprwire": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1773074819, + "narHash": "sha256-qRqYnXiKoJLRTcfaRukn7EifmST2IVBUMZOeZMAc5UA=", + "owner": "hyprwm", + "repo": "hyprwire", + "rev": "f68afd0e73687598cc2774804fedad76693046f0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwire", + "type": "github" + } + }, + "incbin-src": { + "flake": false, + "locked": { + "lastModified": 1748303270, + "narHash": "sha256-vgOfViZnWTKpBB6vDNDJSB3YuuGGVhg++zsi9Ubatno=", + "owner": "graphitemaster", + "repo": "incbin", + "rev": "22061f51fe9f2f35f061f85c2b217b55dd75310d", + "type": "github" + }, + "original": { + "owner": "graphitemaster", + "repo": "incbin", + "rev": "22061f51fe9f2f35f061f85c2b217b55dd75310d", + "type": "github" + } + }, + "json-src": { + "flake": false, + "locked": { + "lastModified": 1744360948, + "narHash": "sha256-cECvDOLxgX7Q9R3IE86Hj9JJUxraDQvhoyPDF03B2CY=", + "owner": "nlohmann", + "repo": "json", + "rev": "55f93686c01528224f448c19128836e7df245f72", + "type": "github" + }, + "original": { + "owner": "nlohmann", + "ref": "v3.12.0", + "repo": "json", + "type": "github" + } + }, + "libgit2-src": { + "flake": false, + "locked": { + "lastModified": 1749227175, + "narHash": "sha256-/xI3v7LNhpgfjv/m+sZwYDhhYvS6kQYxiiiG3+EF8Mw=", + "owner": "libgit2", + "repo": "libgit2", + "rev": "0060d9cf5666f015b1067129bd874c6cc4c9c7ac", + "type": "github" + }, + "original": { + "owner": "libgit2", + "ref": "v1.9.1", + "repo": "libgit2", + "type": "github" + } + }, + "luajit-src": { + "flake": false, + "locked": { + "lastModified": 1763177035, + "narHash": "sha256-oYD86MqmlJpiCuEs4LwVtxvarPtz1RPWm8nJqNE0sBs=", + "owner": "SteamClientHomebrew", + "repo": "LuaJIT", + "rev": "89550023569c3e195e75e12951c067fe5591e0d2", + "type": "github" + }, + "original": { + "owner": "SteamClientHomebrew", + "ref": "v2.1", + "repo": "LuaJIT", + "type": "github" + } + }, + "luajson-src": { + "flake": false, + "locked": { + "lastModified": 1763065879, + "narHash": "sha256-5Mdp4jp+rqz2ufkBa1gMfd8nep+Um+mBdr6+Ut6yz9I=", + "owner": "SteamClientHomebrew", + "repo": "LuaJSON", + "rev": "0c1fabf07c42f3907287d1e4f729e0620c1fe6fd", + "type": "github" + }, + "original": { + "owner": "SteamClientHomebrew", + "repo": "LuaJSON", + "rev": "0c1fabf07c42f3907287d1e4f729e0620c1fe6fd", + "type": "github" + } + }, + "microvm": { + "inputs": { + "nixpkgs": [ + "cerulean", + "nixpkgs" + ], + "spectrum": "spectrum" + }, + "locked": { + "lastModified": 1773018425, + "narHash": "sha256-fpgZBmZpKoEXEowBK/6m8g9FcOLWQ4UxhXHqCw2CpSM=", + "owner": "microvm-nix", + "repo": "microvm.nix", + "rev": "25ebda3c558e923720c965832dc9a04f559a055c", + "type": "github" + }, + "original": { + "owner": "microvm-nix", + "repo": "microvm.nix", + "type": "github" + } + }, + "millennium": { + "inputs": { + "abseil-src": "abseil-src", + "asio-src": "asio-src", + "curl-src": "curl-src", + "fmt-src": "fmt-src", + "incbin-src": "incbin-src", + "json-src": "json-src", + "libgit2-src": "libgit2-src", + "luajit-src": "luajit-src", + "luajson-src": "luajson-src", + "millennium-src": "millennium-src", + "minhook-src": "minhook-src", + "mini-src": "mini-src", + "minizip-src": "minizip-src", + "nixpkgs": [ + "nixpkgs-unstable" + ], + "re2-src": "re2-src", + "websocketpp-src": "websocketpp-src", + "zlib-src": "zlib-src" + }, + "locked": { + "dir": "packages/nix", + "lastModified": 1774360398, + "narHash": "sha256-IvuZMTxTe5osTszZp4r27X/F0R7FVhLWkP7g6pYMgTs=", + "owner": "SteamClientHomebrew", + "repo": "millennium", + "rev": "4378aac79283a11912dd1a7adf89f79ab3736a87", + "type": "github" + }, + "original": { + "dir": "packages/nix", + "owner": "SteamClientHomebrew", + "repo": "millennium", + "type": "github" + } + }, + "millennium-src": { + "flake": false, + "locked": { + "lastModified": 1770463863, + "narHash": "sha256-MceGTpXobCAh5Ll/1iTWcEf6/nHY3Ll1t06JxbYc+Co=", + "owner": "SteamClientHomebrew", + "repo": "Millennium", + "rev": "1bc62c94a06f25f7e8d7e269f11cd968cf576bff", + "type": "github" + }, + "original": { + "owner": "SteamClientHomebrew", + "repo": "Millennium", + "rev": "1bc62c94a06f25f7e8d7e269f11cd968cf576bff", + "type": "github" + } + }, + "minhook-src": { + "flake": false, + "locked": { + "lastModified": 1743163800, + "narHash": "sha256-0eGFfg365bb4zic1WTHMvKHbxuhhGp72/clu8OklHXs=", + "owner": "TsudaKageyu", + "repo": "minhook", + "rev": "c3fcafdc10146beb5919319d0683e44e3c30d537", + "type": "github" + }, + "original": { + "owner": "TsudaKageyu", + "ref": "v1.3.4", + "repo": "minhook", + "type": "github" + } + }, + "mini-src": { + "flake": false, + "locked": { + "lastModified": 1743356736, + "narHash": "sha256-zBFFOlECbie7+62fTGf+NP4gNmfv2Qddw3ys6xn7o9U=", + "owner": "metayeti", + "repo": "mINI", + "rev": "52b66e987cb56171dc91d96115cdf094b6e4d7a0", + "type": "github" + }, + "original": { + "owner": "metayeti", + "ref": "0.9.18", + "repo": "mINI", + "type": "github" + } + }, + "minizip-src": { + "flake": false, + "locked": { + "lastModified": 1746408966, + "narHash": "sha256-I3CZwtfJMsZYQOMdGhooUN8vssnQj6rCzv8F+rne3vg=", + "owner": "zlib-ng", + "repo": "minizip-ng", + "rev": "f3ed731e27a97e30dffe076ed5e0537daae5c1bd", + "type": "github" + }, + "original": { + "owner": "zlib-ng", + "ref": "4.0.10", + "repo": "minizip-ng", + "type": "github" + } + }, + "nix-flatpak": { + "locked": { + "lastModified": 1767983141, + "narHash": "sha256-7ZCulYUD9RmJIDULTRkGLSW1faMpDlPKcbWJLYHoXcs=", + "owner": "gmodena", + "repo": "nix-flatpak", + "rev": "440818969ac2cbd77bfe025e884d0aa528991374", + "type": "github" + }, + "original": { + "owner": "gmodena", + "ref": "latest", + "repo": "nix-flatpak", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "cerulean", + "nt", + "nix-unit", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737420293, + "narHash": "sha256-F1G5ifvqTpJq7fdkT34e/Jy9VCyzd5XfJ9TO8fHhJWE=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "f4158fa080ef4503c8f4c820967d946c2af31ec9", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nix-unit": { + "inputs": { + "flake-parts": "flake-parts", + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "cerulean", + "nt", + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1762774186, + "narHash": "sha256-hRADkHjNt41+JUHw2EiSkMaL4owL83g5ZppjYUdF/Dc=", + "owner": "nix-community", + "repo": "nix-unit", + "rev": "1c9ab50554eed0b768f9e5b6f646d63c9673f0f7", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-unit", + "type": "github" + } + }, + "nixcats": { + "locked": { + "lastModified": 1770584904, + "narHash": "sha256-9Zaz8lbKF2W9pwXZEnbiGsicHdBoU+dHt3Wv3mCJoZ8=", + "owner": "BirdeeHub", + "repo": "nixCats-nvim", + "rev": "538fdde784d2909700d97a8ef307783b33a86fb1", + "type": "github" + }, + "original": { + "owner": "BirdeeHub", + "repo": "nixCats-nvim", + "type": "github" + } + }, + "nixcord": { + "inputs": { + "flake-compat": "flake-compat_4", + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-nixcord": "nixpkgs-nixcord" + }, + "locked": { + "lastModified": 1774312874, + "narHash": "sha256-mFc7Iy+Oqwr7Vwb7CmNIWilSYiTw2857imf6Rb75ITg=", + "owner": "FlameFlag", + "repo": "nixcord", + "rev": "71f4b3f92ca534c3665deb63e229195955d96cf9", + "type": "github" + }, + "original": { + "owner": "FlameFlag", + "repo": "nixcord", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1767313136, + "narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1772328832, + "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-master": { + "locked": { + "lastModified": 1773068446, + "narHash": "sha256-MCEmktH6AFJH8Pg1rBGB2Q0FhS5z5K87IsMbUU8uzHI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "70b7278e2c0acc26ad3360551bf9c15c5ccc0acd", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-nixcord": { + "locked": { + "lastModified": 1773222311, + "narHash": "sha256-BHoB/XpbqoZkVYZCfXJXfkR+GXFqwb/4zbWnOr2cRcU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0590cd39f728e129122770c029970378a79d076a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1772773019, + "narHash": "sha256-E1bxHxNKfDoQUuvriG71+f+s/NT0qWkImXsYZNFFfCs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "aca4d95fce4914b3892661bcb80b8087293536c6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1772822230, + "narHash": "sha256-yf3iYLGbGVlIthlQIk5/4/EQDZNNEmuqKZkQssMljuw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "71caefce12ba78d84fe618cf61644dce01cf3a96", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nt": { + "inputs": { + "nix-unit": "nix-unit", + "nixpkgs": "nixpkgs", + "systems": "systems_2" + }, + "locked": { + "lastModified": 1773738366, + "narHash": "sha256-oH22HyNHEdCoCQo734sQCHUr6C0jmGQJMZ13dsgEHkk=", + "owner": "cry128", + "repo": "nt", + "rev": "f32c3a726a3d608d30aaaa1df2301c1eaf5ef8f4", + "type": "github" + }, + "original": { + "owner": "cry128", + "repo": "nt", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat_3", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772893680, + "narHash": "sha256-JDqZMgxUTCq85ObSaFw0HhE+lvdOre1lx9iI6vYyOEs=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "8baab586afc9c9b57645a734c820e4ac0a604af9", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "re2-src": { + "flake": false, + "locked": { + "lastModified": 1762353507, + "narHash": "sha256-0J1HVk+eR7VN0ymucW9dNlT36j16XIfCzcs1EVyEIEU=", + "owner": "google", + "repo": "re2", + "rev": "927f5d53caf8111721e734cf24724686bb745f55", + "type": "github" + }, + "original": { + "owner": "google", + "ref": "2025-11-05", + "repo": "re2", + "type": "github" + } + }, + "root": { + "inputs": { + "awww": "awww", + "cerulean": "cerulean", + "grub2-themes": "grub2-themes", + "home-manager": "home-manager", + "hyprland": "hyprland", + "millennium": "millennium", + "nix-flatpak": "nix-flatpak", + "nixcats": "nixcats", + "nixcord": "nixcord", + "nixpkgs": "nixpkgs_2", + "nixpkgs-master": "nixpkgs-master", + "nixpkgs-unstable": "nixpkgs-unstable", + "sddm-silent": "sddm-silent", + "systems": "systems_3", + "wa2k": "wa2k" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "awww", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1764038373, + "narHash": "sha256-M6w2wNBRelcavoDAyFL2iO4NeWknD40ASkH1S3C0YGM=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "ab3536fe850211a96673c6ffb2cb88aab8071cc9", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "sddm-silent": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1771956684, + "narHash": "sha256-+EtzmEzGA2xqwIvKrP0euYaOzrmTQWEWAiWV+k2WBEM=", + "owner": "uiriansan", + "repo": "SilentSDDM", + "rev": "34f82e1fb8412fff78b82a0dcce763492b36054c", + "type": "github" + }, + "original": { + "owner": "uiriansan", + "repo": "SilentSDDM", + "type": "github" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "cerulean", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1773096132, + "narHash": "sha256-M3zEnq9OElB7zqc+mjgPlByPm1O5t2fbUrH3t/Hm5Ag=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "d1ff3b1034d5bab5d7d8086a7803c5a5968cd784", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "spectrum": { + "flake": false, + "locked": { + "lastModified": 1772189877, + "narHash": "sha256-i1p90Rgssb//aNiTDFq46ZG/fk3LmyRLChtp/9lddyA=", + "ref": "refs/heads/main", + "rev": "fe39e122d898f66e89ffa17d4f4209989ccb5358", + "revCount": 1255, + "type": "git", + "url": "https://spectrum-os.org/git/spectrum" + }, + "original": { + "type": "git", + "url": "https://spectrum-os.org/git/spectrum" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "cerulean", + "nt", + "nix-unit", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1762410071, + "narHash": "sha256-aF5fvoZeoXNPxT0bejFUBXeUjXfHLSL7g+mjR/p5TEg=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "97a30861b13c3731a84e09405414398fbf3e109f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "wa2k": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "systems": [ + "systems" + ] + }, + "locked": { + "lastModified": 1773470994, + "narHash": "sha256-cIxF6mHXmyAkSjY9+iZS/ljXs76lYRltgvbJUPvO1Ew=", + "ref": "refs/heads/main", + "rev": "5fee4396ac0d23b471475185eca586e2130088f6", + "revCount": 7, + "type": "git", + "url": "https://tearforge.net/cry/wa2k.com" + }, + "original": { + "type": "git", + "url": "https://tearforge.net/cry/wa2k.com" + } + }, + "websocketpp-src": { + "flake": false, + "locked": { + "lastModified": 1587320717, + "narHash": "sha256-9fIwouthv2GcmBe/UPvV7Xn9P2o0Kmn2hCI4jCh0hPM=", + "owner": "zaphoyd", + "repo": "websocketpp", + "rev": "56123c87598f8b1dd471be83ca841ceae07f95ba", + "type": "github" + }, + "original": { + "owner": "zaphoyd", + "ref": "0.8.2", + "repo": "websocketpp", + "type": "github" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1772669058, + "narHash": "sha256-XhnY0aRuDo5LT8pmJVPofPOgO2hAR7T+XRoaQxtNPzQ=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "906d0ac159803a7df2dc1f948df9327670380f69", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + }, + "zlib-src": { + "flake": false, + "locked": { + "lastModified": 1754565515, + "narHash": "sha256-c2RYqHi3hj/ViBzJcYWoNib27GAbq/B1SJUfvG7CPG4=", + "owner": "zlib-ng", + "repo": "zlib-ng", + "rev": "425439062b114a0f6cf625022c41d929c7e879f9", + "type": "github" + }, + "original": { + "owner": "zlib-ng", + "ref": "2.2.5", + "repo": "zlib-ng", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7043d8c --- /dev/null +++ b/flake.nix @@ -0,0 +1,77 @@ +{ + description = "uni uses nix now!!"; + + inputs = { + systems.url = "github:nix-systems/default-linux"; + + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs-master.url = "github:NixOS/nixpkgs/master"; + + home-manager = { + url = "github:nix-community/home-manager/release-25.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + cerulean = { + url = "github:cry128/cerulean/refactor/snowflake"; + inputs = { + systems.follows = "systems"; + nixpkgs.follows = "nixpkgs"; + }; + }; + + grub2-themes = { + url = "github:vinceliuice/grub2-themes"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + sddm-silent = { + url = "github:uiriansan/SilentSDDM"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + hyprland = { + url = "github:hyprwm/Hyprland"; + + inputs = { + nixpkgs.follows = "nixpkgs-unstable"; + systems.follows = "systems"; + }; + }; + + awww = { + url = "git+https://codeberg.org/LGFae/awww"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixcats.url = "github:BirdeeHub/nixCats-nvim"; + + nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=latest"; + + nixcord = { + url = "github:FlameFlag/nixcord"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + millennium = { + url = "github:SteamClientHomebrew/millennium?dir=packages/nix"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; + + wa2k = { + url = "git+https://tearforge.net/cry/wa2k.com"; + inputs = { + systems.follows = "systems"; + nixpkgs.follows = "nixpkgs"; + }; + }; + }; + + nixConfig = { + extra-experimental-features = "pipe-operators"; + }; + + outputs = {cerulean, ...} @ inputs: + cerulean.snow.flake inputs ./.; +} diff --git a/groups/all/default.nix b/groups/all/default.nix new file mode 100644 index 0000000..1214fc8 --- /dev/null +++ b/groups/all/default.nix @@ -0,0 +1,89 @@ +{ + pkgs, + lib, + ... +}: { + imports = [ + ../../hosts/modules/core/garbage-collector.nix + ]; + + networking = { + networkmanager.enable = true; + + nftables.enable = true; + firewall = { + enable = lib.mkDefault true; + allowPing = lib.mkDefault true; + }; + + # Use CloudFlare's WARP+ 1.1.1.1 DNS service + nameservers = [ + "1.1.1.1" + "1.0.0.1" + ]; + }; + + programs.nh = { + enable = true; + clean.enable = true; + clean.extraArgs = "--keep-since 7d --keep 3"; + flake = "/etc/nixos"; # sets NH_OS_FLAKE variable for you + }; + + nix.settings = { + # making wheel group trusted allows your user + # to import packages not signed by a trusted key + trusted-users = ["root" "@wheel"]; + experimental-features = [ + "nix-command" + "flakes" + "pipe-operators" + ]; + download-buffer-size = 524288000; # 500 MiB + }; + + time.timeZone = lib.mkDefault "America/Los_Angeles"; + i18n.defaultLocale = lib.mkDefault "en_US.UTF-8"; + + # Enable initrd hook for virtual console customisation + # aka cool colours when bootting yay!! + console = { + enable = true; + earlySetup = true; # initrd pre hook + keyMap = "us"; + font = "Lat2-Terminus16"; + # ANSI 24-bit color definitions (theme: dracula) + colors = [ + "21222c" + "ff5555" + "50fa7b" + "f1fa8c" + "bd93f9" + "ff79c6" + "8be9fd" + "f8f8f2" + "6272a4" + "ff6e6e" + "69ff94" + "ffffa5" + "d6acff" + "ff92df" + "a4ffff" + "ffffff" + ]; + }; + + users.defaultUserShell = pkgs.bash; + + security.sudo-rs = { + enable = true; + wheelNeedsPassword = lib.mkOverride 200 true; + }; + + environment.systemPackages = with pkgs; [ + git + vim + wget + tree + ]; +} diff --git a/groups/desktops/default.nix b/groups/desktops/default.nix new file mode 100644 index 0000000..e44b56e --- /dev/null +++ b/groups/desktops/default.nix @@ -0,0 +1,85 @@ +{ + pkgs, + lib, + config, + ... +}: { + imports = [ + ./system.nix + ./programs.nix + + ../../hosts/modules/bashistrans.nix + ../../hosts/modules/wm/hyprland.nix + ]; + + boot.loader.grub2-theme = { + enable = true; + # GitHub: vinceliuice/grub2-themes + theme = "whitesur"; # stylish, vimix, or whitesur + footer = true; + customResolution = "1920x1080"; + }; + + # Set display manager (login screen) + services.displayManager = { + # sddm relies on pkgs.libsForQt5.qt5.qtgraphicaleffects + sddm = { + enable = true; + wayland.enable = ! config.services.xserver.enable; # experimental + theme = "corners"; + }; + + defaultSession = + if config.programs.hyprland.withUWSM == true + then "hyprland-uwsm" + else "hyprland"; + }; + + programs.fish.enable = true; + + # ----- FONTS ----- + fonts = { + enableDefaultPackages = true; # no clue what this line does tbh + packages = with pkgs; + [ + geist-font # for my hyprlock theme + # texlive maintains a noto-emoji flake + texlivePackages.noto-emoji + ] + ++ builtins.filter lib.attrsets.isDerivation ( + builtins.attrValues pkgs.nerd-fonts + ); + + # TODO: change your default fonts + fontconfig = { + defaultFonts = { + serif = ["Geist"]; + sansSerif = ["Geist"]; + monospace = ["Cousine"]; + emoji = ["Noto Emoji"]; + }; + }; + }; + + # ---- ENVIRONMENT VARIABLES ---- + environment = { + sessionVariables = { + # Hint Electrons apps to use Wayland + NIXOS_OZONE_WL = "1"; + + XDG_DOWNLOAD_DIR = "$HOME/Downloads"; + XDG_CONFIG_HOME = "$HOME/.config"; + }; + + systemPackages = with pkgs; [ + sddm-theme-corners + ]; + }; + + # ------- USERS ------- + users.users.lorkan = { + isNormalUser = true; + extraGroups = ["wheel" "netdev" "docker"]; + shell = pkgs.fish; + }; +} diff --git a/groups/desktops/programs.nix b/groups/desktops/programs.nix new file mode 100644 index 0000000..6be45cb --- /dev/null +++ b/groups/desktops/programs.nix @@ -0,0 +1,76 @@ +{pkgs, ...}: { + imports = [ + ../../hosts/modules/apps/sober.nix + ../../hosts/modules/apps/steam.nix + ]; + + environment.systemPackages = with pkgs; [ + # Shell + bash + fish + grc # colorise command outputs + + # Nix + nix-prefetch-git + nix-index + nix-unit + ns # nix-search-tv overlay + + # Modern Unix Commands + tlrc + btop + eza + yazi + exiftool # for yazi + ripgrep + viddy # modern `watch` command + timg # terminal image (sixel) viewer + wormhole-rs + + # Pretty necessary + git + git-filter-repo + brightnessctl + acpi + vim + powertop + usbutils + nmap + + # "Standard" Unix Commands + file + wget + tree + pstree + zip + unzip + unrar-free + lz4 + moreutils + man-pages + man-pages-posix + + # Desktop Services + awww + bluetui + hyprpicker # color picker + hyprshot # screenshot utility + wl-clipboard # clipboard for wayland + wl-screenrec # screen recording utility + + # Userland Applications + helvum + easyeffects + pavucontrol + qbittorrent # torrenting + ]; + + services.pcscd.enable = true; + # GNUPG-Agent stores your GPG+SSH keys securely + programs = { + gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + }; +} diff --git a/groups/desktops/system.nix b/groups/desktops/system.nix new file mode 100644 index 0000000..4937910 --- /dev/null +++ b/groups/desktops/system.nix @@ -0,0 +1,80 @@ +{...}: { + hardware = { + graphics = { + enable = true; + enable32Bit = true; + }; + + bluetooth = { + enable = true; + powerOnBoot = true; + }; + }; + + virtualisation.docker.enable = true; + + services = { + # systemd-resolved provides network name resolution + # to local processes via a D-Bus interface. + resolved = { + enable = true; + dnssec = "true"; + domains = ["~."]; + # Use CloudFlare's WARP+ 1.1.1.1 DNS service + fallbackDns = [ + "1.1.1.1#one.one.one.one" + "1.0.0.1#one.one.one.one" + ]; + dnsovertls = "true"; + }; + + # Multimedia Framework + # With backwards compatability for alsa/pulseaudio/jack + pipewire = { + enable = true; + audio.enable = true; + wireplumber.enable = true; + + alsa.enable = true; + alsa.support32Bit = true; + # pulse.enable = true; + # jack.enable = true; + + # disable X11 bell module, which plays a sound on urgency hint + extraConfig = { + pipewire."99-silent-bell.conf" = { + "context.properties" = { + "module.x11.bell" = false; + }; + }; + }; + }; + }; + + # allows pipewire to use the realtime scheduler for increased performance + security.rtkit.enable = true; + + # ---- ENVIRONMENT VARIABLES ---- + environment = { + # always install "dev" derivation outputs + extraOutputsToInstall = ["dev"]; + }; + + documentation = { + enable = true; + doc.enable = false; # install /share/doc packages + man = { + enable = true; # install manpages + + # https://discourse.nixos.org/t/slow-build-at-building-man-cache/52365/4 + generateCaches = false; + }; + info.enable = false; # install GNU info + dev.enable = true; # install docs intended for developers + nixos = { + enable = true; # install NixOS documentation (ie man -k nix, & nixos-help) + options.splitBuild = true; + includeAllModules = false; + }; + }; +} diff --git a/homes/lorkan/default.nix b/homes/lorkan/default.nix new file mode 100755 index 0000000..189de25 --- /dev/null +++ b/homes/lorkan/default.nix @@ -0,0 +1,95 @@ +{pkgs, ...}: { + imports = [ + ./modules/cli/git.nix + ./modules/cli/ssh.nix + + ../modules/term/foot.nix + ../modules/shell/fish.nix + ../modules/editor/helix.nix + ../modules/editor/neovim + + ../modules/cli/bat.nix + ../modules/cli/btop.nix + ../modules/cli/hyfetch.nix + + ../modules/apps/firefox.nix + ../modules/apps/nixcord.nix + + ../modules/wm/hyprland + ../modules/de/mako.nix + ../modules/de/waybar + ]; + + home = { + shellAliases = { + # nix + nd = "nix develop"; + rebuild = "nh os switch /etc/nixos"; + trybuild = "nh os test /etc/nixos"; + + # shell utilities + ls = "eza --color=auto"; + l = "eza -Alh --color=auto --icons=auto"; + ll = "eza -lh --color=auto --icons=auto"; + li = "eza --color=auto --git-ignore"; + rgf = "rg --files | rg"; + watch = "viddy"; + }; + + pointerCursor = { + gtk.enable = true; + # x11.enable = true # dont enable since im on hyprland + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Ice"; + size = 16; + }; + + packages = with pkgs; [ + # for services.gnome-keyring + gcr # provides org.gnome.keyring.SystemPrompter + seahorse # gui + + fuzzel + speedtest-cli + ]; + }; + + gtk = { + enable = true; + font.name = "Victor Mono SemiBold 12"; + theme = { + name = "Dracula"; + package = pkgs.dracula-theme; + }; + iconTheme = { + name = "kora"; + package = pkgs.kora-icon-theme; + }; + # TODO: use a variable to mirror this cursor size + # with the `home.pointerCurser.size` + cursorTheme = { + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Ice"; + size = 16; + }; + }; + + qt = { + enable = true; + platformTheme.name = "gtk2"; + style.name = "gtk2"; + }; + + services = { + gnome-keyring.enable = true; + }; + + # Nicely reload system units when changing configs + systemd.user.startServices = "sd-switch"; + + # XXX: WARNING: DO NOT MODIFY + # XXX: WARNING: DO NOT MODIFY + # XXX: WARNING: IM DEAD SERIOUS DO NOT CHANGE THIS VALUE + # XXX: WARNING: IM DEAD SERIOUS DO NOT CHANGE THIS VALUE + home.stateVersion = "25.11"; # Did you read the comment? +} diff --git a/homes/lorkan/modules/cli/git.nix b/homes/lorkan/modules/cli/git.nix new file mode 100755 index 0000000..83c7137 --- /dev/null +++ b/homes/lorkan/modules/cli/git.nix @@ -0,0 +1,106 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + delta # git diff viewer + ]; + + programs = { + git = { + enable = true; + lfs.enable = true; + + # signing = { + # key = "YOUR-GPG-KEY-HERE"; + # format = "openpgp"; + # signByDefault = true; + # }; + + settings = { + user.name = "UniverseBow"; + user.email = "lorkandavidson@gmail.com"; + + alias = { + s = "status"; + d = "diff"; + l = "log"; + c = "commit"; + p = "push"; + }; + + color.ui = true; + core.editor = "vim"; + + # delta diff viewer + core.pager = "delta"; + interactive.diffFilter = "delta --color-only"; + delta = { + navigate = true; + line-numbers = true; + side-by-side = true; + }; + merge.conflictStyle = "zdiff3"; + + init = { + defaultBranch = "main"; + }; + url = { + "git@github.com:" = { + insteadOf = [ + "gh:" + "github:" + ]; + }; + "https://gitlab.com/" = { + insteadOf = [ + "gl:" + "gitlab:" + ]; + }; + "git@codeberg.org:" = { + insteadOf = [ + "cb:" + "codeberg:" + ]; + }; + "git@tearforge.net/" = { + insteadOf = [ + "cry:" + "forge:" + ]; + }; + }; + }; + }; + + lazygit = { + enable = true; + enableFishIntegration = true; + enableZshIntegration = true; + + shellWrapperName = "lg"; + + settings = { + gui = { + useHunkModeInStagingView = false; + + skipDiscardChangeWarning = false; + skipStashWarning = true; + + animateExplosion = true; # FUCK YEAH + + theme = { + lightTheme = false; + activeBorderColor = ["green" "bold"]; + inactiveBorderColor = ["white"]; + selectedLineBgColor = ["default"]; + }; + }; + + git.pagers = [ + { + pager = "delta --dark --pager=never"; + } + ]; + }; + }; + }; +} diff --git a/homes/lorkan/modules/cli/ssh.nix b/homes/lorkan/modules/cli/ssh.nix new file mode 100644 index 0000000..841bedc --- /dev/null +++ b/homes/lorkan/modules/cli/ssh.nix @@ -0,0 +1,10 @@ +{...}: { + # set ssh profiles + # WARNING: this DOES NOT start the ssh-agent + # WARNING: for that you need to use `services.ssh-agent.enable` + programs.ssh = { + enable = true; + forwardAgent = false; + addKeysToAgent = "yes"; + }; +} diff --git a/homes/modules/apps/firefox.nix b/homes/modules/apps/firefox.nix new file mode 100644 index 0000000..c8acbb3 --- /dev/null +++ b/homes/modules/apps/firefox.nix @@ -0,0 +1,8 @@ +{...}: { + programs.firefox = { + enable = true; + policies = { + DefaultDownloadDirectory = "\${home}/Downloads"; + }; + }; +} diff --git a/homes/modules/apps/nixcord.nix b/homes/modules/apps/nixcord.nix new file mode 100644 index 0000000..ff9ce6d --- /dev/null +++ b/homes/modules/apps/nixcord.nix @@ -0,0 +1,254 @@ +{inputs, ...}: { + imports = [ + inputs.nixcord.homeModules.nixcord + ]; + + programs.nixcord = { + enable = true; + # equibop.enable = true; + + discord = { + vencord.enable = false; + equicord.enable = true; + }; + + config = { + enabledThemes = [ + "aurorastheme.css" + "base16-colors.css" + ]; + plugins = { + invisibleChat.enable = true; + anonymiseFileNames = { + enable = true; + anonymiseByDefault = true; + method = 0; + randomisedLength = 16; + }; + betterSessions = { + backgroundCheck = true; + checkInterval = 1; + }; + biggerStreamPreview.enable = true; + callTimer.enable = true; + fixYoutubeEmbeds.enable = true; + fixSpotifyEmbeds.enable = true; + tidalEmbeds.enable = true; + youtubeAdblock.enable = true; + followVoiceUser.enable = true; + friendsSince.enable = true; + ircColors = { + enable = true; + lightness = 80; + memberListColors = true; + applyColorOnlyInDms = false; + applyColorOnlyToUsersWithoutColor = false; + }; + messageLogger = { + enable = true; + showEditDiffs = true; + separatedDiffs = false; + }; + fakeNitro.enable = true; + ghosted.enable = false; + noF1.enable = true; + noMaskedUrlPaste.enable = true; + messageLatency = { + enable = false; + latency = -1; + showMillis = true; + }; + openInApp.enable = true; + crashHandler.enable = true; + disableCallIdle.enable = true; + experiments.enable = true; + expressionCloner.enable = true; + favoriteGifSearch.enable = true; + fixImagesQuality.enable = true; + forceOwnerCrown.enable = true; + forwardAnywhere.enable = true; + spotifyCrack.enable = true; + spotifyShareCommands.enable = true; + fullUserInChatbox.enable = true; + gifPaste.enable = true; + ignoreActivities = { + enable = true; + ignorePlaying = true; + ignoreStreaming = true; + ignoreListening = true; + ignoreWatching = true; + ignoreCompeting = true; + }; + imageLink.enable = true; + imageZoom.enable = true; + memberCount.enable = true; + noDevtoolsWarning.enable = true; + noUnblockToJump.enable = true; + pauseInvitesForever.enable = true; + permissionsViewer.enable = true; + pictureInPicture = { + enable = true; + loop = true; + }; + platformIndicators.enable = true; + previewMessage.enable = true; + relationshipNotifier.enable = true; + revealAllSpoilers.enable = true; + serverInfo.enable = true; + serverListIndicators.enable = true; + musicControls = { + enable = true; + showSpotifyControls = true; + showSpotifyLyrics = true; + }; + showHiddenChannels.enable = true; + showHiddenThings.enable = true; + showTimeoutDuration = { + enable = true; + displayStyle = "tooltip"; + }; + silentTyping = { + enable = true; + enabledGlobally = true; + }; + startupTimings.enable = true; + typingIndicator.enable = true; + unlockedAvatarZoom = { + enable = true; + zoomMultiplier = 4.0; + }; + userMessagesPronouns.enable = true; + validUser.enable = true; + validReply.enable = true; + viewIcons = { + enable = true; + format = "webp"; + imgSize = "4096"; + }; + voiceChatDoubleClick.enable = true; + voiceDownload.enable = true; + voiceMessages = { + enable = true; + noiseSuppression = false; + echoCancellation = true; + }; + volumeBooster.enable = true; + webKeybinds.enable = true; + webScreenShareFixes.enable = true; + whoReacted.enable = true; + whosWatching.enable = true; + quickReply.enable = true; + shikiCodeblocks = { + enable = true; + useDevIcon = "COLOR"; + theme = "https://raw.githubusercontent.com/shikijs/textmate-grammars-themes/2d87559c7601a928b9f7e0f0dda243d2fb6d4499/packages/tm-themes/themes/kanagawa-wave.json"; + }; + }; + }; + }; + + programs.nixcord.config.plugins.PinDMs = { + enable = true; + canCollapseDmSection = true; + # userBasedCategoryList = { + # "1202666382760607774" = [ + # { + # id = "i9dflmraztc"; + # name = "🏳️‍⚧️ girlfriends!!! :3 🏳️‍⚧️"; + # color = 16359423; + # collapsed = false; + # channels = [ + # "1436964273162289185" + # "1436988320474206311" + # "1449837047383855119" + # "1436965652861685891" + # "1436968495190642722" + # "1465424321919975454" + # "1468324280445046824" + # ]; + # } + # { + # id = "p2v1f5y9zbd"; + # name = "🦋 best frens <3 🦋"; + # color = 10223511; + # collapsed = false; + # channels = [ + # "1436985374286155799" + # "1436965657076826222" + # "1429921297160212681" + # "1394808379381387385" + # "1433593753183977545" + # "1438254055452446881" + # "1436966389549236376" + # "1202678007026819134" + # "1437151552224624660" + # "1441906462094921789" + # "1450340272079769712" + # "1458123717124165764" + # "1436975341129306155" + # "1461885176534794427" + # "1462155159470866443" + # "1468735915076878407" + # "1461929299727749145" + # "1470963392121536657" + # ]; + # } + # { + # id = "c0mg5w635j8"; + # name = "🏳️‍🌈 close frens x3 🏳️‍🌈"; + # color = 10780927; + # collapsed = false; + # channels = [ + # "1437077103873888290" + # "1436975346338762823" + # "1437123353101205590" + # "1441516692164575283" + # "1419557866502754334" + # "1436985041203892315" + # "1438071327515742229" + # ]; + # } + # { + # id = "ghjrq5el3b"; + # name = "frens :3"; + # color = 7334399; + # collapsed = false; + # channels = [ + # "1437007154132422701" + # "1437006448948416526" + # "1446781617422209068" + # "1444723474835837103" + # "1437098569483161721" + # "1437237573146771469" + # "1436973705421914123" + # "1437135359359320125" + # "1438010723837022343" + # "1440553969461104740" + # "1437097082887475201" + # "1447222320015085740" + # "1462624704027164824" + # "1449513783893692589" + # "1463737720961634461" + # "1463000874392748249" + # "1436984534712451105" + # "1436983282582683813" + # "1437283420312047659" + # "1437089201651847315" + # "1467307140443148288" + # ]; + # } + # { + # id = "zbmj00xw7d8"; + # name = "goop chats"; + # color = 14876549; + # collapsed = false; + # channels = [ + # "1437132769141719040" + # "1445549416516681902" + # "1458849972815663209" + # ]; + # } + # ]; + # }; + }; +} diff --git a/homes/modules/apps/obs.nix b/homes/modules/apps/obs.nix new file mode 100644 index 0000000..264ad91 --- /dev/null +++ b/homes/modules/apps/obs.nix @@ -0,0 +1,12 @@ +{pkgs, ...}: { + programs = { + obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + wlrobs + obs-backgroundremoval + obs-pipewire-audio-capture + ]; + }; + }; +} diff --git a/homes/modules/apps/spicetify.nix b/homes/modules/apps/spicetify.nix new file mode 100644 index 0000000..7fa740e --- /dev/null +++ b/homes/modules/apps/spicetify.nix @@ -0,0 +1,32 @@ +{ + inputs, + upkgs, + system, + ... +}: let + spicetifyPkgs = inputs.spicetify-nix.legacyPackages.${system}; +in { + imports = [inputs.spicetify-nix.homeManagerModules.default]; + programs.spicetify = { + enable = true; + + enabledExtensions = with spicetifyPkgs.extensions; [ + adblock + shuffle + keyboardShortcut + { + src = + (upkgs.fetchFromGitHub { + owner = "Spikerko"; + repo = "spicy-lyrics"; + rev = "568c83326aa6aba6ded28c95df6fcfb25cab3648"; + hash = "sha256-lej93EDzGkmyrg5YMdPSqzrxlIfKsfaDBZosTvxoTNw="; + }) + + /builds; + name = "spicy-lyrics.mjs"; + } + ]; + theme = spicetifyPkgs.themes.comfy; + colorScheme = "Sakura"; + }; +} diff --git a/homes/modules/apps/zen-browser.nix b/homes/modules/apps/zen-browser.nix new file mode 100644 index 0000000..dee6846 --- /dev/null +++ b/homes/modules/apps/zen-browser.nix @@ -0,0 +1,17 @@ +{ + inputs, + system, + ... +}: let + inherit (inputs) zen-browser; +in { + imports = [ + zen-browser.homeModules.twilight + ]; + + programs.zen-browser = { + enable = true; + package = zen-browser.packages.${system}.twilight; + # suppressXdgMigrationWarning = true; + }; +} diff --git a/homes/modules/cli/bat.nix b/homes/modules/cli/bat.nix new file mode 100644 index 0000000..70268f5 --- /dev/null +++ b/homes/modules/cli/bat.nix @@ -0,0 +1,109 @@ +let + # Module Meta Configuration + setShellAliases = true; + supportBash = true; + supportZsh = true; + supportFish = true; +in + { + osConfig, + config, + pkgs, + lib, + username, + ... + }: let + inherit + (builtins) + elemAt + ; + + inherit + (lib) + flip + mkIf + optional + splitString + ; + + cfg = config.programs.bat; + + # NOTE: `.pname` can be used instead of `.meta.mainProgram` + # NOTE: but then `pkgs.bash` would return `"bash-interactive"` which is annoying... + shellPkg = osConfig.users.users.${username}.shell; + shell = shellPkg.meta.mainProgram; + + pager = + cfg.config.pager + |> splitString " " + |> flip elemAt 0; + in { + programs.bat = { + enable = true; + config = { + # WARNING: pager must be set for this module to function + # NOTE: not sure whether to use ov/moor/viddy as my pager? + pager = "less -FR"; + # theme = "Dracula"; + }; + }; + + home = { + shellAliases = mkIf setShellAliases { + bat = "prettybat"; + cat = "prettybat"; + diff = "batdiff"; + brg = "batgrep"; + man = "batman"; + # watch = "batwatch"; # NOTE: using viddy instead atm + }; + + sessionVariables = { + PAGER = pager; + + # REF: https://github.com/eth-p/bat-extras/blob/master/doc/batpipe.md + BATPIPE_ENABLE_COLOR = "true"; + BATPIPE_INSIDE_LESS = "true"; + BATPIPE_TERM_WIDTH = "-"; # hyphone -> auto detect + }; + + packages = with pkgs.bat-extras; + [ + batdiff + batgrep + batman + batpipe + batwatch + prettybat + ] + ++ (with pkgs; [ + bat + entr # required by pkgs.bat-extras.batwatch + ripgrep # required by pkgs.bat-extras.batgrep + delta # required by pkgs.bat-extras.batdiff + ]) + ++ optional (pkgs?${pager}) pkgs.${pager}; + }; + + # Configure the user's shell to source batpipe + # WARNING: only currently supports bash, zsh, & fish + programs = { + bash = mkIf (supportBash || shell == "bash") { + initExtra = '' + eval "$(batpipe)" + ''; + }; + + zsh = mkIf (supportZsh || shell == "zsh") { + initContent = '' + eval "$(batpipe)" + ''; + }; + + fish = mkIf (supportFish || shell == "fish") { + interactiveShellInit = '' + eval (batpipe) + ''; + }; + }; + } diff --git a/homes/modules/cli/btop.nix b/homes/modules/cli/btop.nix new file mode 100644 index 0000000..765ccea --- /dev/null +++ b/homes/modules/cli/btop.nix @@ -0,0 +1,79 @@ +{config, ...}: { + programs.btop = { + enable = true; + + settings = { + # Theming + color_theme = "dracula"; + theme_background = true; + truecolor = true; + force_tty = false; + vim_keys = false; # allow vim keybindings + # Units + clock_format = "%I:%M %p, %b %d"; + temp_scale = "celsius"; + base_10_sizes = false; # use KB or KiB + + # UI + background_update = true; + update_ms = 100; + rounded_corners = false; + graph_symbol = "braille"; # braille/block/tty + graph_symbol_cpu = "default"; + graph_symbol_mem = "default"; + graph_symbol_net = "default"; + graph_symbol_proc = "default"; + + # Processes Window + proc_left = true; # show on left side of window + proc_colors = true; + proc_gradient = true; + proc_per_core = false; # false: % of ALL cores + proc_mem_bytes = false; # show mem usage as % + proc_sorting = "cpu lazy"; + proc_filter_kernel = false; # hide kernel child processes + proc_tree = false; + + # CPU Window + cpu_bottom = false; # display at bottom of window + show_uptime = true; + show_cpu_freq = true; + check_temp = true; # show cpu temp + show_coretemp = true; # show temp per core + cpu_graph_upper = "total"; # upper graph shows total CPU usage + cpu_graph_lower = "user"; # lower graph shows user's CPU usage + cpu_invert_lower = true; + cpu_single_graph = false; # disable lower graph + show_gpu_info = "Off"; # Auto/On/Off + gpu_mirror_graph = false; # horizontally mirror gpu graph + + # Memory Window + mem_below_net = false; # show below net window + mem_graphs = true; # show graphs not meters + show_swap = true; # show swap memory usage + # Disks Subwindow + show_disks = true; # split mem box to show disk info + swap_disk = true; # show swap memory as disk + show_io_stat = true; + io_graph_combined = false; # combine read/write stats + io_mode = true; # show io stat as graph + use_fstab = true; # read disk list from /etc/fstab + only_physical = false; # ignore non-physical disks + + # Network Window + net_iface = ""; # default network interface to monitor + net_auto = true; # overrides net_download/net_upload (below) + net_sync = false; # sync download/upload graph scales + net_download = 100; # max download speed graphed + net_upload = 100; # max upload speed graphed + + # Battery + show_battery = true; + selected_battery = "Auto"; + show_battery_watts = true; + + # Other + log_level = "WARNING"; # ERROR/WARNING/INFO/DEBUG + }; + }; +} diff --git a/homes/modules/cli/hyfetch.nix b/homes/modules/cli/hyfetch.nix new file mode 100644 index 0000000..e567922 --- /dev/null +++ b/homes/modules/cli/hyfetch.nix @@ -0,0 +1,26 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + neofetch + ]; + + programs.hyfetch = { + enable = true; + settings = { + backend = "neofetch"; + args = null; + distro = null; + + preset = "transgender"; + pride_month_disable = false; + custom_ascii_path = null; + + mode = "rgb"; + light_dark = "light"; + auto_detect_light_dark = true; + lightness = 0.65; + color_align = { + mode = "horizontal"; + }; + }; + }; +} diff --git a/homes/modules/de/mako.nix b/homes/modules/de/mako.nix new file mode 100644 index 0000000..6377fb1 --- /dev/null +++ b/homes/modules/de/mako.nix @@ -0,0 +1,55 @@ +{...}: let + dracula = rec { + background = "#282A36"; + border = cyan; + + cyan = "#8BE9FD"; + yellow = "#F1FA8C"; + red = "#FF5555"; + }; + + theme = dracula; +in { + # notification daemon for Wayland + services.mako = { + enable = true; + settings = { + actions = true; + # output = ""; # screen to display on + anchor = "top-right"; + layer = "overlay"; + sort = "-time"; + + height = 100; + width = 300; + margin = 50; + background-color = theme.background; + border-color = theme.border; + border-radius = 20; + border-size = 4; + font = "monospace 10"; + + markup = true; + icons = true; + max-icon-size = 64; + + default-timeout = 5000; + ignore-timeout = false; + + "actionable=true" = { + anchor = "top-right"; + }; + + "urgency=low" = { + border-color = theme.border; + }; + "urgency=normal" = { + border-color = theme.yellow; + }; + "urgency=high" = { + default-timeout = 0; + border-color = theme.red; + }; + }; + }; +} diff --git a/homes/modules/de/waybar/colors.css b/homes/modules/de/waybar/colors.css new file mode 100644 index 0000000..98bb26f --- /dev/null +++ b/homes/modules/de/waybar/colors.css @@ -0,0 +1,19 @@ +@define-color colorbg #26233a; +@define-color colorfg #eb6f92; + +@define-color color00 #26233a; /* black (Overlay) */ +@define-color color01 #eb6f92; /* red (Love) */ +@define-color color02 #9ccfd8; /* green (Foam) */ +@define-color color03 #f6c177; /* yellow (Gold) */ +@define-color color04 #31748f; /* blue (Pine) */ +@define-color color05 #c4a7e7; /* magenta (Iris) */ +@define-color color06 #ebbcba; /* cyan (Rose) */ +@define-color color07 #e0def4; /* white (Text) */ +@define-color color08 #47435d; /* bright black (lighter Overlay) */ +@define-color color09 #ff98ba; /* bright red (lighter Love) */ +@define-color color10 #c5f9ff; /* bright green (lighter Foam) */ +@define-color color11 #ffeb9e; /* bright yellow (lighter Gold) */ +@define-color color12 #5b9ab7; /* bright blue (lighter Pine) */ +@define-color color13 #eed0ff; /* bright magenta (lighter Iris) */ +@define-color color14 #ffe5e3; /* bright cyan (lighter Rose) */ +@define-color color15 #fefcff; /* bright white (lighter Text) */ diff --git a/homes/modules/de/waybar/default.nix b/homes/modules/de/waybar/default.nix new file mode 100644 index 0000000..33e7a42 --- /dev/null +++ b/homes/modules/de/waybar/default.nix @@ -0,0 +1,101 @@ +{upkgs, ...}: { + programs.waybar = { + enable = true; + settings = { + mainBar = { + layer = "top"; + position = "top"; + height = 30; + # modules-left = ["hyprland/workspaces" "wlr/taskbar" "custom/media"]; + modules-left = ["hyprland/workspaces" "wlr/taskbar"]; + modules-center = ["clock"]; + modules-right = ["cpu" "memory" "network" "pulseaudio" "privacy" "tray"]; + + # left + "hyprland/workspaces" = { + format = "{id}"; + }; + "ext/workspaces" = { + # not enabled yet, hyprland and mango need two different configs ;-; + format = "{id}"; + ignore-hidden = true; + on-click = "activate"; + }; + "wlr/taskbar" = { + format = "{icon}"; + icon-size = 12; + }; + # "custom/media" = { + # exec = "auroramedia"; + # return-type = "json"; + # escape = true; + # restart-interval = 1; + # }; + + # center + "clock" = { + format = "{:%Y %b %a %d %H:%M:%S}"; + interval = 1; + tooltip = false; + }; + + # right + "cpu" = { + format = " {usage}%"; + interval = 1; + }; + "memory" = { + format = " {used:0.1f} / {total:0.1f} GiB"; + interval = 1; + }; + "network" = { + format = "{bandwidthUpBytes}  {bandwidthDownBytes}  {ifname}"; + format-wifi = " {bandwidthUpBytes}  {bandwidthDownBytes} "; + format-ethernet = "󰈀 {bandwidthUpBytes}  {bandwidthDownBytes} "; + format-disconnected = "no internet ~ rawr! ~ x3"; # empty format hides module + interval = 1; + max-length = 32; + }; + "pulseaudio" = { + format = "{icon} {volume}%"; + format-muted = " {volume}%"; + format-icons = { + default = [ + "" + "" + "" + ]; + }; + "scroll-step" = 5; + }; + "privacy" = { + icon-size = 12; + icon-spacing = 5; + transition-duration = 200; + modules = [ + { + type = "screenshare"; + tooltip = true; + tooltip-icon-size = 12; + } + { + type = "audio-in"; + tooltip = true; + tooltip-icon-size = 12; + } + ]; + }; + "tray" = { + icon-size = 12; + spacing = 10; + # fixes spotify not showing up when "close button should minimize the Spotify window" is false + show-passive-items = true; + }; + }; + }; + + style = + builtins.readFile ./colors.css + + builtins.readFile ./style.css; + }; +} diff --git a/homes/modules/de/waybar/style.css b/homes/modules/de/waybar/style.css new file mode 100644 index 0000000..294991c --- /dev/null +++ b/homes/modules/de/waybar/style.css @@ -0,0 +1,164 @@ +* { + border: none; + border-radius: 0; + font-family: 'GeistMono Nerd Font'; + font-size: 15px; + font-weight: bold; + min-height: 10px; +} +window#waybar { + background: rgba(0, 0, 0, 0); +} +/* +adds a margin around the edge of the taskbar, surrounding the modules, +spacing it out from the edge of the screen and windows below +*/ +window#waybar > box { + margin: 0px 12px; +} + +tooltip { + background: @colorbg; + color: @colorfg; + opacity: 0.9; + padding: 4px; + border-radius: 12px; + border: 1px solid @color01; +} +tooltip label { + background: rgba(0, 0, 0, 0); + color: @colorfg; +} + +#clock, +#memory, +#network, +#workspaces, +#taskbar, +#cpu, +#pulseaudio, +#privacy, +#tray, +#custom-media { + background: @colorbg; + color: @colorfg; + opacity: 0.9; + padding: 4px 16px; + border-radius: 32px; + border: 1px solid @color01; +} + +/* +left-side modules +*/ +#workspaces, +#taskbar, +#custom-media { + margin: 4px 4px 4px 0px; +} + +/* +center modules +*/ +#clock { + margin: 4px 0px 4px 0px; +} + +/* +right-side modules +*/ +#memory, +#network, +#cpu, +#pulseaudio, +#tray, +#privacy { + margin: 4px 0px 4px 4px; +} + +#workspaces, +#taskbar { + padding: 0px; +} + +#taskbar.empty { + opacity: 0; + padding: 0px; + margin: 0px; + border: none; +} +#tray.empty { + opacity: 0; + padding: 0; + margin: 0; + border: none; +} + +/* + connects the workspace and taskbar together :3 +*/ +/* +#workspaces { + margin: 4px 0px 4px 12px; + padding: 0px 8px 0px 0px; + border-radius: 100px 0px 0px 100px; + border-width: 1px 0px 1px 1px; +} +#taskbar { + margin: 4px 0px 4px 0px; + padding: 0px 0px 0px 8px; + border-radius: 0px 100px 100px 0px; +} +*/ + +#cpu { + margin: 4px 0 4px 0; + border-radius: 32px 0px 0px 32px; +} +#memory { + margin: 4px 0 4px 0; + border-radius: 0px; + border-width: 1px 0px 1px 0px; +} +#network { + margin: 4px 0 4px 0; + border-radius: 0px 32px 32px 0px; +} + +#workspaces button { + padding: 2px 4px; + border-radius: 32px; + color: @colorfg; +} +#workspaces button:hover { + background: @colorfg; + color: @colorbg; + opacity: 0.8; +} +#workspaces button.active { + background: @colorfg; + color: @colorbg; +} + +#taskbar button { + padding: 2px 4px; + border-radius: 32px; + color: @colorfg; +} +#taskbar button:hover { + background: @colorfg; + color: @colorbg; + opacity: 0.8; +} +#taskbar button.active { + background: @colorfg; + color: @colorbg; +} +/* + icons in each button on the taskbar to correct + for them not being properly centred sometimes :3 +*/ +#taskbar button box image { + padding-left: 2px; +} + diff --git a/homes/modules/editor/helix.nix b/homes/modules/editor/helix.nix new file mode 100755 index 0000000..b7a7f04 --- /dev/null +++ b/homes/modules/editor/helix.nix @@ -0,0 +1,164 @@ +{pkgs, ...}: let + lsps = { + bash-language-server = { + pkg = pkgs.bash-language-server; + cmd = "bash-language-server"; + }; + + # TODO: once upgraded past Nix-24.07 this line won't be necessary (I think) + # helix will support nixd by default + # SOURCE: https://github.com/nix-community/nixd/blob/main/nixd/docs/editor-setup.md#Helix + nixd = { + pkg = pkgs.nixd; + cmd = "nixd"; + }; + + ty = { + pkg = pkgs.ty; # DEBUG: upkgs.ty; + cmd = "ty"; + }; + }; +in { + home.packages = + lsps + |> builtins.attrValues + |> map (lsp: lsp.pkg); + + # REF: https://docs.helix-editor.com/editor.html + programs.helix = { + enable = true; + settings = { + theme = "dracula"; + + editor = { + line-number = "absolute"; + popup-border = "all"; + scroll-lines = 3; + color-modes = true; # colour the mode indicator depending on mode + shell = ["bash" "-c"]; + + auto-format = true; + auto-completion = true; # enable popup for autocomplete + completion-timeout = 250; # time before completions display + preview-completion-insert = true; + completion-trigger-len = 2; # min word length to trigger completions + completion-replace = true; # completions replace entire word + + indent-heuristic = "tree-sitter"; # how indentation is computed + middle-click-paste = true; + insert-final-newline = true; # append newline to file on write + + gutters = [ + "diagnostics" + "spacer" + "line-numbers" + "spacer" + "diff" + ]; + + whitespace = { + render = { + space = "none"; # "all" + tab = "none"; #"all" + nbsp = "none"; + nnbsp = "none"; + newline = "none"; + }; + characters = { + space = "·"; + nbsp = "⍽"; + nnbsp = "␣"; + tab = "→"; + newline = "⤶"; + tabpad = "·"; # Tabs will look like "→···" (depending on tab width) + }; + }; + + indent-guides = { + render = true; + character = "▏"; # "|" + skip-levels = 1; + }; + + lsp = { + enable = true; + auto-signature-help = true; # hints for function parameters + display-inlay-hints = true; # inline hints + snippets = true; + }; + + cursor-shape = { + normal = "block"; + insert = "bar"; + select = "block"; + }; + + file-picker = { + hidden = true; # show hidden files + follow-symlinks = true; + deduplicate-links = true; + git-ignore = true; # dont read .gitignore files + ignore = true; # use .ignore for helix instead of .gitignore + }; + + statusline = { + left = [ + "mode" + "spacer" + "version-control" + "spinner" + ]; + center = [ + "file-name" + "read-only-indicator" + "file-modification-indicator" + ]; + right = [ + "position" + "total-line-numbers" + "file-encoding" + "file-line-ending" + "file-type" + ]; + separator = "|"; + mode.normal = "NORMAL"; + mode.insert = "INSERT"; + mode.select = "SELECT"; + }; + }; + }; + + languages = { + language = [ + { + name = "nix"; + indent = { + tab-width = 2; + unit = " "; + }; + block-comment-tokens = { + start = "/*"; + end = "*/"; + }; + auto-format = true; + formatter.command = "${pkgs.alejandra}/bin/alejandra"; + language-servers = ["nixd"]; + } + { + name = "python"; + indent = { + tab-width = 4; + unit = " "; + }; + auto-format = true; + rulers = [80]; + language-servers = ["ty"]; + } + ]; + + language-server = + lsps + |> builtins.mapAttrs (_: lsp: {command = "${lsp.pkg}/bin/${lsp.cmd}";}); + }; + }; +} diff --git a/homes/modules/editor/neovim/default.nix b/homes/modules/editor/neovim/default.nix new file mode 100644 index 0000000..35f4c54 --- /dev/null +++ b/homes/modules/editor/neovim/default.nix @@ -0,0 +1,236 @@ +# TODO: look into changing to this: +# https://github.com/BirdeeHub/nix-wrapper-modules +{ + inputs, + lib, + ... +}: let + inherit + (inputs.nixcats) + utils + ; +in { + imports = [ + inputs.nixcats.homeModule + ]; + + nixCats = { + enable = true; + nixpkgs_version = inputs.nixpkgs-unstable; + addOverlays = + [ + (utils.standardPluginOverlay inputs) + ] + ++ lib.optional (builtins.pathExists ./overlays.nix) ./overlays.nix; + + # see the packageDefinitions below. + # This says which of those to install. + packageNames = ["cryvim"]; + + luaPath = ./.; + + # NOTE: the .replace vs .merge options are for modules based on existing configurations, + # NOTE: they refer to how multiple categoryDefinitions get merged together by the module. + # NOTE: for useage of this section, refer to :h nixCats.flake.outputs.categories + categoryDefinitions.replace = { + pkgs, + settings, + categories, + extra, + name, + mkNvimPlugin, + ... + } @ packageDef: { + lspsAndRuntimeDeps = with pkgs; { + general = [ + ripgrep + fd + ]; + treesitter = [ + tree-sitter + ]; + lang = { + lua = [ + lua-language-server + stylua + ]; + nix = [ + nil + nix-doc # TODO: i forgot what this is for + nixfmt + ]; + rust = [ + rust-analyzer + rustfmt + ]; + zig = [ + zls + ]; + elixir = [ + elixir-ls + ]; + gleam = [ + gleam + ]; + haskell = [ + haskell-language-server + ormolu + ]; + java = [ + jdt-language-server + javaPackages.compiler.openjdk17 + javaPackages.compiler.openjdk21 + ]; + protobuf = [ + protols + buf + ]; + }; + }; + + startupPlugins = with pkgs.vimPlugins; { + general = [ + lze + plenary-nvim + nvim-notify + nvim-web-devicons + base16-nvim + mini-nvim + ]; + treesitter = [ + nvim-treesitter-textobjects + nvim-treesitter.withAllGrammars + ]; + }; + + optionalPlugins = with pkgs.vimPlugins; { + general = [ + ]; + ui = [ + dressing-nvim + ]; + qol = [ + undotree + mini-hipatterns + ]; + telescope = [ + telescope-nvim + telescope-fzf-native-nvim + telescope-ui-select-nvim + ]; + fyler = [ + fyler-nvim + ]; + lsp = [ + nvim-lspconfig + ]; + completion = [ + blink-cmp + nvim-cmp + luasnip + friendly-snippets + cmp_luasnip + cmp-buffer + cmp-path + cmp-nvim-lua + cmp-nvim-lsp + cmp-cmdline + cmp-nvim-lsp-signature-help + cmp-cmdline-history + lspkind-nvim + ]; + format = [ + conform-nvim + ]; + comment = [ + comment-nvim + ]; + lang = { + java = [ + nvim-jdtls + ]; + }; + }; + + # shared libraries to be added to nvim runtime's LD_LIBRARY_PATH + sharedLibraries = { + general = with pkgs; [ + # libgit2 + ]; + }; + + environmentVariables = { + lang = { + rust.lsp = { + # it literally won't see the rust-analyzer provided to it + RUST_ANALYZER_CMD = "${pkgs.rust-analyzer}/bin/rust-analyzer"; + }; + elixir.lsp = { + ELIXIR_LS_CMD = "${pkgs.elixir-ls}/scripts/language_server.sh"; + }; + java.lsp = { + JAVA_HOME = "${pkgs.javaPackages.compiler.openjdk17}"; + OPENJDK_17 = "${pkgs.javaPackages.compiler.openjdk17}"; + OPENJDK_21 = "${pkgs.javaPackages.compiler.openjdk21}"; + }; + }; + }; + + extraWrapperArgs = {}; + # lists of the functions you would have passed to + # python.withPackages or lua.withPackages + + # get the path to this python environment + # in your lua config via + # vim.g.python3_host_prog + # or run from nvim terminal via :!-python3 + extraPython3Packages = {}; + # populates $LUA_PATH and $LUA_CPATH + extraLuaPackages = {}; + }; + + # REF: :help nixCats.flake.outputs.packageDefinitions + packageDefinitions.replace = { + # these are the names of your packages + # you can include as many as you wish. + cryvim = {pkgs, ...}: { + # they contain a settings set defined above + # REF: :help nixCats.flake.outputs.settings + settings = { + wrapRc = true; + aliases = [ + "ce" + ]; + }; + + # and a set of categories that you want + # (and other information to pass to lua) + categories = { + general = true; + + ui = true; + qol = true; + telescope = true; + fyler = true; + lsp = true; + completion = true; + treesitter = true; + format = true; + comment = true; + + lang = { + lua = true; + nix = true; + rust = true; + zig = true; + elixir = true; + gleam = true; + haskell = true; + java = true; + protobuf = true; + }; + }; + }; + }; + }; +} diff --git a/homes/modules/editor/neovim/init.lua b/homes/modules/editor/neovim/init.lua new file mode 100644 index 0000000..696587c --- /dev/null +++ b/homes/modules/editor/neovim/init.lua @@ -0,0 +1,9 @@ +vim.g.mapleader = " " + +vim.opt.termguicolors = true -- use terminal colors +vim.opt.relativenumber = true +vim.opt.wrap = false +vim.opt.colorcolumn = "80" + +require("plugins") +require("lsp") diff --git a/homes/modules/editor/neovim/lua/lsp/capabilities.lua b/homes/modules/editor/neovim/lua/lsp/capabilities.lua new file mode 100644 index 0000000..7e9957b --- /dev/null +++ b/homes/modules/editor/neovim/lua/lsp/capabilities.lua @@ -0,0 +1,66 @@ +local M = {} + +function M.on_attach(_, bufnr) + -- we create a function that lets us more easily define mappings specific + -- for LSP related items. It sets the mode, buffer and description for us each time. + + local nmap = function(keys, func, desc) + if desc then + desc = "LSP: " .. desc + end + + vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc }) + end + + nmap("rn", vim.lsp.buf.rename, "[R]e[n]ame") + nmap("ca", vim.lsp.buf.code_action, "[C]ode [A]ction") + + nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition") + + -- NOTE: why are these functions that call the telescope builtin? + -- because otherwise they would load telescope eagerly when this is defined. + -- due to us using the on_require handler to make sure it is available. + if nixCats("general.telescope") then + nmap("gr", function() + require("telescope.builtin").lsp_references() + end, "[G]oto [R]eferences") + nmap("gI", function() + require("telescope.builtin").lsp_implementations() + end, "[G]oto [I]mplementation") + nmap("ds", function() + require("telescope.builtin").lsp_document_symbols() + end, "[D]ocument [S]ymbols") + nmap("ws", function() + require("telescope.builtin").lsp_dynamic_workspace_symbols() + end, "[W]orkspace [S]ymbols") + nmap("dd", "Telescope diagnostics bufnr=0", "[D]ocument [D]iagnostics") + nmap("wd", "Telescope diagnostics", "[W]orkspace [D]iagnostics") + end -- TODO: someone who knows the builtin versions of these to do instead help me out please. + + nmap("D", vim.lsp.buf.type_definition, "Type [D]efinition") + nmap("e", vim.diagnostic.open_float, "Show [E]rror") + + -- See `:help K` for why this keymap + nmap("K", vim.lsp.buf.hover, "Hover Documentation") + nmap("", vim.lsp.buf.signature_help, "Signature Documentation") + + -- Lesser used LSP functionality + nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") + nmap("wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder") + nmap("wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder") + nmap("wl", function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, "[W]orkspace [L]ist Folders") + + -- Create a command `:Format` local to the LSP buffer + vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_) + vim.lsp.buf.format() + end, { desc = "Format current buffer with LSP" }) +end + +function M.get(server_name) + local capabilities = require("blink.cmp").get_lsp_capabilities() + + return capabilities +end +return M diff --git a/homes/modules/editor/neovim/lua/lsp/completion.lua b/homes/modules/editor/neovim/lua/lsp/completion.lua new file mode 100644 index 0000000..b408f23 --- /dev/null +++ b/homes/modules/editor/neovim/lua/lsp/completion.lua @@ -0,0 +1,103 @@ +return { + { + "friendly-snippets", + dep_of = { "blink.cmp" }, + }, + { + "blink.cmp", + event = { "InsertEnter", "CmdlineEnter" }, + on_require = "blink", + load = function(name) + vim.cmd.packadd(name) + end, + after = function(plugin) + local blink = require("blink.cmp") + + blink.setup({ + keymap = { + [""] = { "show", "show_documentation", "hide_documentation" }, + [""] = { "hide", "fallback" }, + [""] = { "select_and_accept", "fallback" }, + + [""] = { "select_prev", "fallback_to_mappings" }, + [""] = { "select_next", "fallback_to_mappings" }, + [""] = { "select_prev", "fallback" }, + [""] = { "select_next", "fallback" }, + + [""] = { "scroll_documentation_up", "fallback" }, + [""] = { "scroll_documentation_down", "fallback" }, + + [""] = { "snippet_forward", "fallback" }, + [""] = { "snippet_backward", "fallback" }, + + [""] = { "show_signature", "hide_signature", "fallback" }, + }, + + appearance = { + nerd_font_variant = "mono", + }, + + sources = { + default = { "lsp", "path", "snippets", "buffer" }, + providers = { + lsp = { + name = "LSP", + module = "blink.cmp.sources.lsp", + enabled = true, + }, + path = { + name = "Path", + module = "blink.cmp.sources.path", + enabled = true, + }, + snippets = { + name = "Snippets", + module = "blink.cmp.sources.snippets", + enabled = true, + }, + buffer = { + name = "Buffer", + module = "blink.cmp.sources.buffer", + enabled = true, + }, + }, + }, + + completion = { + accept = { + auto_brackets = { + enabled = true, + }, + }, + + menu = { + border = "rounded", + max_height = 12, + scrolloff = 2, + + draw = { + columns = { + { "kind_icon", gap = 1 }, + { "label", "label_description", gap = 1 }, + }, + }, + }, + + documentation = { + auto_show = false, + window = { + border = "rounded", + }, + }, + }, + + signature = { + enabled = true, + window = { + border = "rounded", + }, + }, + }) + end, + }, +} diff --git a/homes/modules/editor/neovim/lua/lsp/indentation.lua b/homes/modules/editor/neovim/lua/lsp/indentation.lua new file mode 100644 index 0000000..5deae31 --- /dev/null +++ b/homes/modules/editor/neovim/lua/lsp/indentation.lua @@ -0,0 +1,20 @@ +vim.api.nvim_create_autocmd("FileType", { + pattern = { "lua", "nix", "gleam" }, + callback = function() + vim.opt_local.shiftwidth = 2 + vim.opt_local.tabstop = 2 + vim.opt_local.expandtab = true + end, +}) + +vim.api.nvim_create_autocmd("User", { + pattern = "TelescopePreviewerLoaded", + callback = function(args) + local ft = args.data.filetype + if vim.tbl_contains({ "lua", "nix", "gleam", "rust" }, ft) then + vim.bo.shiftwidth = 2 + vim.bo.tabstop = 2 + vim.bo.expandtab = true + end + end, +}) diff --git a/homes/modules/editor/neovim/lua/lsp/init.lua b/homes/modules/editor/neovim/lua/lsp/init.lua new file mode 100644 index 0000000..e2d09ed --- /dev/null +++ b/homes/modules/editor/neovim/lua/lsp/init.lua @@ -0,0 +1,6 @@ +require("lze").load({ + { import = "lsp.completion" }, +}) + +require("lsp.indentation") +require("lsp.lsp") diff --git a/homes/modules/editor/neovim/lua/lsp/lsp.lua b/homes/modules/editor/neovim/lua/lsp/lsp.lua new file mode 100644 index 0000000..d115a00 --- /dev/null +++ b/homes/modules/editor/neovim/lua/lsp/lsp.lua @@ -0,0 +1,134 @@ +local servers = {} + +servers.lua_ls = { + settings = { + Lua = { + formatters = { + ignoreComments = false, + }, + signatureHelp = { enable = true }, + diagnostics = { + globals = { "nixCats", "vim" }, + -- disable = { 'missing-fields' }, + }, + workspace = { + -- make the server aware of the neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false, + }, + }, + telemetry = { enabled = false }, + }, +} + +servers.nil_ls = { + settings = {}, +} + +local rust_analyzer_cmd = os.getenv("RUST_ANALYZER_CMD") +servers.rust_analyzer = { + cmd = { rust_analyzer_cmd }, + settings = { + server = { + -- For debugging rust-analyzer, to see log location do :LspInfo in neovim + -- extraEnv = { {["RA_LOG"]="project_model=debug"} }, + }, + cargo = { + allFeatures = false, + allTargets = false, + buildScripts = { enable = true }, + target = "x86_64-unknown-linux-gnu", + }, + diagnostics = { + enable = true, + }, + }, +} + +servers.zls = { + settings = {}, +} + +local elixir_ls_cmd = os.getenv("ELIXIR_LS_CMD") +servers.elixirls = { + cmd = { elixir_ls_cmd }, + settings = {}, +} + +servers.gleam = { + settings = {}, +} + +servers.hls = { + settings = {}, +} + +local java_home = os.getenv("JAVA_HOME") +servers.jdtls = { + settings = { + java = { + contentProvider = { preferred = "fernflower" }, + configuration = { + runtimes = { + { + name = "OpenJDK 17", + path = os.getenv("OPENJDK_17"), + }, + { + name = "OpenJDK 21", + path = os.getenv("OPENJDK_21"), + }, + }, + }, + }, + }, +} + +servers.protols = { + settings = {}, +} + +-- Taken from nixCats example: +-- If you were to comment out this autocommand +-- and instead pass the on attach function directly to +-- nvim-lspconfig, it would do the same thing. +-- come to think of it, it might be better because then lspconfig doesnt have to be called before lsp attach? +-- but you would still end up triggering on a FileType event anyway, so, it makes little difference. +vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("nixCats-lsp-attach", { clear = true }), + callback = function(event) + require("lsp.capabilities").on_attach(vim.lsp.get_client_by_id(event.data.client_id), event.buf) + end, +}) + +require("lze").load({ + { + "nvim-lspconfig", + event = "FileType", + after = function(plugin) + -- Just register configs, don't enable yet + for server_name, cfg in pairs(servers) do + vim.lsp.config(server_name, { + capabilities = require("lsp.capabilities").get(server_name), + settings = (cfg or {}).settings, + filetypes = (cfg or {}).filetypes, + cmd = (cfg or {}).cmd, + root_pattern = (cfg or {}).root_pattern, + }) + end + + -- Enable on-demand per filetype + for server_name, cfg in pairs(servers) do + local filetypes = cfg.filetypes or vim.lsp.config[server_name].filetypes + if filetypes then + vim.api.nvim_create_autocmd("FileType", { + pattern = filetypes, + callback = function() + vim.lsp.enable(server_name) + end, + }) + end + end + end, + }, +}) diff --git a/homes/modules/editor/neovim/lua/plugins/comment.lua b/homes/modules/editor/neovim/lua/plugins/comment.lua new file mode 100644 index 0000000..caae704 --- /dev/null +++ b/homes/modules/editor/neovim/lua/plugins/comment.lua @@ -0,0 +1,23 @@ +return { + { + "comment.nvim", + event = { "BufReadPost", "BufNewFile" }, + after = function(plugin) + require("Comment").setup({ + toggler = { + line = "cc", + block = "bc", + }, + opleader = { + line = "c", + block = "b", + }, + extra = { + above = "c", + below = "co", + eol = "cA", + }, + }) + end, + }, +} diff --git a/homes/modules/editor/neovim/lua/plugins/dressing.lua b/homes/modules/editor/neovim/lua/plugins/dressing.lua new file mode 100644 index 0000000..42e7280 --- /dev/null +++ b/homes/modules/editor/neovim/lua/plugins/dressing.lua @@ -0,0 +1,5 @@ +return { + { + "dressing.nvim", + }, +} diff --git a/homes/modules/editor/neovim/lua/plugins/format.lua b/homes/modules/editor/neovim/lua/plugins/format.lua new file mode 100644 index 0000000..2cd28a4 --- /dev/null +++ b/homes/modules/editor/neovim/lua/plugins/format.lua @@ -0,0 +1,34 @@ +-- docs -> https://github.com/stevearc/conform.nvim +return { + { + "conform.nvim", + enabled = nixCats("format") or false, + keys = { + { "p", desc = "Format File (pretty :3)" }, + }, + after = function(plugin) + local conform = require("conform") + + conform.setup({ + formatters_by_ft = { + lua = nixCats("lang.lua") and { "stylua" } or nil, + nix = nixCats("lang.nix") and { "nixfmt" } or nil, + rust = nixCats("lang.rust") and { "rustfmt", lsp_format = "fallback" } or nil, + haskell = nixCats("lang.haskell") and { "ormolu" } or nil, + proto = nixCats("lang.protobuf") and { "buf" } or nil, + }, + format_on_save = { + timeout_ms = 500, + }, + }) + + vim.keymap.set({ "n", "v" }, "p", function() + conform.format({ + lsp_fallback = false, + async = false, + timeout_ms = 1000, + }) + end, { desc = "Format File (pretty :3)" }) + end, + }, +} diff --git a/homes/modules/editor/neovim/lua/plugins/fyler.lua b/homes/modules/editor/neovim/lua/plugins/fyler.lua new file mode 100644 index 0000000..2737b78 --- /dev/null +++ b/homes/modules/editor/neovim/lua/plugins/fyler.lua @@ -0,0 +1,22 @@ +return { + { + "fyler.nvim", + cmd = { "Fyler" }, + keys = { + { + "tf", + function() + return require("fyler").toggle({ kind = "split_right" }) + end, + mode = { "n" }, + desc = "Open [F]yler", + }, + }, + load = function(name) + vim.cmd.packadd(name) + end, + after = function(plugin) + local fyler = require("fyler").setup() + end, + }, +} diff --git a/homes/modules/editor/neovim/lua/plugins/init.lua b/homes/modules/editor/neovim/lua/plugins/init.lua new file mode 100644 index 0000000..62de146 --- /dev/null +++ b/homes/modules/editor/neovim/lua/plugins/init.lua @@ -0,0 +1,9 @@ +require("lze").load({ + { import = "plugins.dressing" }, + { import = "plugins.telescope" }, + { import = "plugins.treesitter" }, + { import = "plugins.fyler" }, + { import = "plugins.mini-hipatterns" }, + { import = "plugins.format" }, + { import = "plugins.comment" }, +}) diff --git a/homes/modules/editor/neovim/lua/plugins/mini-hipatterns.lua b/homes/modules/editor/neovim/lua/plugins/mini-hipatterns.lua new file mode 100644 index 0000000..f41688e --- /dev/null +++ b/homes/modules/editor/neovim/lua/plugins/mini-hipatterns.lua @@ -0,0 +1,76 @@ +return { + { + "mini.hipatterns", + after = function(plugin) + local hipatterns = require("mini.hipatterns") + + -- Returns hex color group for matching short hex color. + -- + ---@param match string + ---@return string + local hex_color_short = function(_, match) + local style = "fg" -- 'fg' or 'bg', for extmark_opts_inline use 'fg' + local r, g, b = match:sub(2, 2), match:sub(3, 3), match:sub(4, 4) + local hex = string.format("#%s%s%s%s%s%s", r, r, g, g, b, b) + return hipatterns.compute_hex_color_group(hex, style) + end + + -- Returns hex color group for matching alpha hex color. + -- + ---@param match string + ---@return string + local hex_color_alpha = function(_, match) + local style = "fg" -- 'fg' or 'bg', for extmark_opts_inline use 'fg' + local r, g, b = match:sub(2, 3), match:sub(4, 5), match:sub(6, 7) + local hex = string.format("#%s%s%s", r, g, b) + return hipatterns.compute_hex_color_group(hex, style) + end + + -- Returns extmark opts for highlights with virtual inline text. + -- + ---@param data table Includes `hl_group`, `full_match` and more. + ---@return table + local extmark_opts_inline = function(_, _, data) + return { + virt_text = { { "󰧞", data.hl_group } }, + virt_text_pos = "inline", + right_gravity = false, + } + end + + -- Returns extmark opts for highlights with virtual inline text. + -- + ---@param data table Includes `hl_group`, `full_match` and more. + ---@return table + local extmark_opts_inline_alpha = function(_, _, data) + return { + virt_text = { { "󱡓", data.hl_group } }, + virt_text_pos = "inline", + right_gravity = false, + } + end + + hipatterns.setup({ + highlighters = { + -- #rrggbb + hex_color = hipatterns.gen_highlighter.hex_color({ + style = "inline", + inline_text = "󰧞", + }), + -- #rgb + hex_color_short = { + pattern = "#%x%x%x%f[%X]", + group = hex_color_short, + extmark_opts = extmark_opts_inline, + }, + -- #rrggbbaa + hex_color_alpha = { + pattern = "#%x%x%x%x%x%x%x%x%f[%X]", + group = hex_color_alpha, + extmark_opts = extmark_opts_inline_alpha, + }, + }, + }) + end, + }, +} diff --git a/homes/modules/editor/neovim/lua/plugins/telescope.lua b/homes/modules/editor/neovim/lua/plugins/telescope.lua new file mode 100644 index 0000000..a61f19c --- /dev/null +++ b/homes/modules/editor/neovim/lua/plugins/telescope.lua @@ -0,0 +1,78 @@ +return { + { + "telescope.nvim", + cmd = { "Telescope" }, + keys = { + { + "f", + function() + return require("telescope.builtin").find_files() + end, + mode = { "n" }, + desc = "Telescope search [F]iles", + }, + { + "tr", + function() + return require("telescope.builtin").oldfiles() + end, + mode = { "n" }, + desc = "[T]elescope search [R]ecent files", + }, + { + "ts", + function() + return require("telescope.builtin").live_grep() + end, + mode = { "n" }, + desc = "[T]elescope [S]earch cwd with grep", + }, + { + "tw", + function() + return require("telescope.builtin").grep_string() + end, + mode = { "n" }, + desc = "[T]elescope search current [W]ord", + }, + { + "tk", + function() + return require("telescope.builtin").keymaps() + end, + mode = { "n" }, + desc = "[T]elescope search [K]eymaps", + }, + { + "tb", + function() + return require("telescope.builtin").buffers() + end, + mode = { "n" }, + desc = "[T]elescope search [B]uffers", + }, + }, + load = function(name) + vim.cmd.packadd(name) + vim.cmd.packadd("telescope-fzf-native.nvim") + end, + after = function(plugin) + local telescope = require("telescope") + local actions = require("telescope.actions") + + telescope.setup({ + defaults = { + mappings = { + i = { + [""] = actions.move_selection_previous, -- move to prev result + [""] = actions.move_selection_next, -- move to next result + [""] = actions.send_selected_to_qflist + actions.open_qflist, + }, + }, + }, + }) + + pcall(telescope.load_extension, "fzf") + end, + }, +} diff --git a/homes/modules/editor/neovim/lua/plugins/treesitter.lua b/homes/modules/editor/neovim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..55984c7 --- /dev/null +++ b/homes/modules/editor/neovim/lua/plugins/treesitter.lua @@ -0,0 +1,95 @@ +-- to help me write this after nvim-treesitter updated, i used: +-- https://github.com/BirdeeHub/nixCats-nvim/blob/3c9bc4d7123e1b48d92f25ba505b889af541e897/templates/example/lua/myLuaConf/plugins/treesitter.lua + +return { + { + "nvim-treesitter", + lazy = false, + after = function(plugin) + --@param buf integer + --@param language string + local function treesitter_try_attach(buf, language) + --check if parser exists and load it + if not vim.treesitter.language.add(language) then + return + end + + -- enables syntax highlight and other treesitter features + vim.treesitter.start(buf, language) + + -- enables treesitter based folds + vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" + + -- enables treesiter based indentation + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end + + local available_parsers = require("nvim-treesitter").get_available() + vim.api.nvim_create_autocmd("FileType", { + callback = function(args) + local buf, filetype = args.buf, args.match + local language = vim.treesitter.language.get_lang(filetype) + if not language then + return + end + + local installed_parsers = require("nvim-treesitter").get_installed("parsers") + + if vim.tbl_contains(installed_parsers, language) then + -- enable the parser if it is installed + treesitter_try_attach(buf, language) + elseif vim.tbl_contains(available_parsers, language) then + -- if a parser is available in `nvim-treesitter` enable it after ensuring it is installed + require("nvim-treesitter").install(language):await(function() + treesitter_try_attach(buf, language) + end) + else + -- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter` + treesitter_try_attach(buf, language) + end + end, + }) + end, + }, + { + "nvim-treesitter-textobjects", + lazy = false, + before = function(plugin) + vim.g.no_plugin_maps = true + end, + after = function(plugin) + require("nvim-treesitter-textobjects").setup({ + select = { + lookahead = true, + selection_modes = { + ["@parameter.outer"] = "v", -- charwise + ["@function.outer"] = "V", -- linewise + }, + include_surrounding_whitespace = false, + }, + }) + + -- keymaps + vim.keymap.set({ "x", "o" }, "am", function() + require("nvim-treesitter-textobjects.select").select_textobject("@function.outer", "textobjects") + end) + vim.keymap.set({ "x", "o" }, "im", function() + require("nvim-treesitter-textobjects.select").select_textobject("@function.inner", "textobjects") + end) + vim.keymap.set({ "x", "o" }, "ac", function() + require("nvim-treesitter-textobjects.select").select_textobject("@class.outer", "textobjects") + end) + vim.keymap.set({ "x", "o" }, "ic", function() + require("nvim-treesitter-textobjects.select").select_textobject("@class.inner", "textobjects") + end) + -- You can also use captures from other query groups like `locals.scm` + vim.keymap.set({ "x", "o" }, "as", function() + require("nvim-treesitter-textobjects.select").select_textobject("@local.scope", "locals") + end) + + -- NOTE: for more textobjects options, see the following link. + -- This template is using the new `main` branch of the repo. + -- https://github.com/nvim-treesitter/nvim-treesitter-textobjects/tree/main + end, + }, +} diff --git a/homes/modules/editor/vscodium.nix b/homes/modules/editor/vscodium.nix new file mode 100644 index 0000000..dabe665 --- /dev/null +++ b/homes/modules/editor/vscodium.nix @@ -0,0 +1,30 @@ +{pkgs, ...}: { + # REF: https://home-manager-options.extranix.com/?query=vscode&release=release-25.05 + programs.vscode = { + enable = true; + package = pkgs.vscodium; + + mutableExtensionsDir = true; + + profiles.default = { + enableUpdateCheck = true; + enableExtensionUpdateCheck = true; + # extension format: USER.PACKAGENAME + extensions = with pkgs.vscode-extensions; [ + dracula-theme.theme-dracula + ]; + + userSettings = { + "workbench.colorTheme" = "Dracula Theme"; + }; + }; + }; + + home.file.".vscode/argv.json".text = builtins.toJSON { + password-store = "gnome-libsecret"; + + disable-hardware-acceleration = false; + disable-color-correct-rendering = false; + enable-crash-reporter = false; + }; +} diff --git a/homes/modules/services/ssh-agent.nix b/homes/modules/services/ssh-agent.nix new file mode 100644 index 0000000..a0b505c --- /dev/null +++ b/homes/modules/services/ssh-agent.nix @@ -0,0 +1,16 @@ +{osConfig, ...}: { + assertions = [ + { + assertion = !osConfig.services.gnupg.agent.enable; + message = '' + It is not recommended to enable both `homeConfig.services.ssh-agent.enable` and `osConfig.services.gnupg.agent.enable`! + ''; + } + ]; + + # enable OpenSSH private key agent + services.ssh-agent.enable = true; + + # WARNING: the ssh-agent won't set this for itself... + systemd.user.sessionVariables.SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/ssh-agent"; +} diff --git a/homes/modules/shell/elvish.nix b/homes/modules/shell/elvish.nix new file mode 100644 index 0000000..44a19dd --- /dev/null +++ b/homes/modules/shell/elvish.nix @@ -0,0 +1,29 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.programs.elvish; +in { + options.programs.elvish = { + enable = lib.mkEnableOption "elvish"; + }; + + config = lib.mkIf cfg.enable { + home = { + packages = with pkgs; [elvish]; + + file.".elvish/nix.elv".source = let + elvish-modules = pkgs.fetchFromGitHub { + owner = "zzamboni"; + repo = "elvish-modules"; + rev = "9005c970346ab06214b3cd3ed3e70f04f3c632ba"; + hash = "sha256-/Dwtl12QzPvMoMMGoj+v3dwX2ZwFT8t/bohVy1zDE0c="; + }; + in + builtins.toPath "${elvish-modules}/nix.elv"; + # /${builtins.toPath elvish-modules.outPath}/nix.elv; + }; + }; +} diff --git a/homes/modules/shell/fish.nix b/homes/modules/shell/fish.nix new file mode 100755 index 0000000..5da1bd0 --- /dev/null +++ b/homes/modules/shell/fish.nix @@ -0,0 +1,58 @@ +{pkgs, ...}: { + programs.fish = { + enable = true; + generateCompletions = true; + + interactiveShellInit = let + greetings = + [ + # Official _cry64 quotes + "Do butterflies cry when they're sad?" + "I hope they do" + "I think Alice is lost..." + "I once again retreat to the sanctuary of my virtual realm" + + # Unknown + "Welcome weary traveler to my shop" + + # Legend of Zelda + "It's dangerous to go alone! Take this." + + # ULTRAKILL + "Something wicked this way comes" + "May your L's be many... and your bitches few" + + # Terraria + "What a horrible night to have a curse." + "The ancient spirits of light and dark have been released." + + # Calamity + "The god of the stars rejects your offering. The ritual can only be performed at night." + "You should have just died..." + "Supreme Witch, Calamitas has killed every player!" + + # Key Fairy + "A broken heart beats in fractals" + + # Signalis + "Remember our promise" + ] + |> map (x: "\"${x}\"") + |> builtins.concatStringsSep " "; + in '' + function rand_greet + set greetings ${greetings} + echo -n $greetings[(random 1 (count $greetings))] + end + + set -g fish_greeting (rand_greet) + ''; + + plugins = [ + { + name = "grc"; + src = pkgs.fishPlugins.grc.src; + } + ]; + }; +} diff --git a/homes/modules/shell/zsh.nix b/homes/modules/shell/zsh.nix new file mode 100644 index 0000000..361191e --- /dev/null +++ b/homes/modules/shell/zsh.nix @@ -0,0 +1,17 @@ +{...}: { + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + + history = { + size = 10000; + ignoreAllDups = true; + path = "$HOME/.zsh_history"; + ignorePatterns = [ + "rm *" + ]; + }; + }; +} diff --git a/homes/modules/term/foot.nix b/homes/modules/term/foot.nix new file mode 100644 index 0000000..728c7d6 --- /dev/null +++ b/homes/modules/term/foot.nix @@ -0,0 +1,324 @@ +{pkgs, ...}: { + programs.foot = { + enable = true; + package = pkgs.foot; + + server.enable = true; + + settings = let + none = "\"\""; + in { + main = { + term = "foot"; # set $TERM + login-shell = "no"; + title = "foot"; + locked-title = "no"; + + font = "JetBrainsMonoNL Nerd Font:size=12"; + # font-bold = ""; + # font-italice = ""; + # font-bold-italice = ""; + # font-size-adjustment = 0.5; + # line-height = ...; + # letter-spacing = 0; + # horizontal-letter-offset = 0; + # vertical-letter-offset = 0; + # underline-offset = ...; + # underline-thickness = ...; + # strikeout-thickness = ...; + box-drawings-uses-font-glyphs = "no"; + dpi-aware = "no"; + gamma-correct-blending = "no"; + + initial-color-theme = "1"; + # initial-window-size-pixels = "700x500"; # pixel COLSxROWS + initial-window-size-chars = "90x26"; # char COLSxROWS + initial-window-mode = "windowed"; + pad = "32x32 center-when-maximized-and-fullscreen"; + resize-by-cells = "yes"; + resize-keep-grid = "yes"; + resize-delay-ms = "100"; + + bold-text-in-bright = "no"; + word-delimiters = ",│`|:\"'()[]{}<>"; + selection-target = "primary"; + # workers = ...; # number of logical CPUs + }; + + # environment = { + # name = "value"; + # } + + security = { + osc52 = "enabled"; + }; + + bell = { + system = "no"; + urgent = "no"; + notify = "no"; + visual = "no"; + # command = ...; + # command-focused = "no"; + }; + + desktop-notifications = { + command = "notify-send --wait --app-name \${app-id} --icon \${app-id} --category \${category} --urgency \${urgency} --expire-time \${expire-time} --hint STRING:image-path:\${icon} --hint BOOLEAN:suppress-sound:\${muted} --hint STRING:sound-name:\${sound-name} --replace-id \${replace-id} \${action-argument} --print-id -- \${title} \${body}"; + command-action-argument = "--action \${action-name=\${action-label}}"; + close = none; + inhibit-when-focused = "no"; + }; + + scrollback = { + lines = 1000; + multiplier = 1.0; + indicator-position = "relative"; + indicator-format = none; + }; + + url = { + launch = "xdg-open \${url}"; + label-letters = "sadfjklewcmpgh"; + osc8-underline = "url-mode"; + regex = "(((https?://|mailto:|ftp://|file:|ssh:|ssh://|git://|tel:|magnet:|ipfs://|ipns://|gemini://|gopher://|news:)|www\\.)([0-9a-zA-Z:/?#@!$&*+,;=.~_%^\\-]+|\\([]\\[\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\)|\\[[\\(\\)\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\]|\"[]\\[\\(\\)0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\"|'[]\\[\\(\\)0-9a-zA-Z:/?#@!$&*+,;=.~_%^\\-]*')+([0-9a-zA-Z/#@$&*+=~_%^\\-]|\\([]\\[\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\)|\\[[\\(\\)\"0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\\]|\"[]\\[\\(\\)0-9a-zA-Z:/?#@!$&'*+,;=.~_%^\\-]*\"|'[]\\[\\(\\)0-9a-zA-Z:/?#@!$&*+,;=.~_%^\\-]*'))"; + }; + + # "regex:your-fancy-name" = { + # regex = ...; + # launch = "[path to script/application] \${match}" + # }; + # + # key-bindings = { + # regex-launch = "[your-fancy-name] Control+Shift+q"; + # regex-copy = "[your-fancy-name] Control+Alt+shift+q"; + # }; + + cursor = { + style = "block"; + blink = "no"; + # blink-rate = 500; + beam-thickness = 1.0; + # underline-thickness = ...; + }; + + mouse = { + hide-when-typing = "yes"; + alternate-scroll-mode = "yes"; + }; + + touch = { + long-press-delay = 400; + }; + + # Theme: Dracula + # REF: https://github.com/dracula/foot + colors = { + alpha = 1.0; + alpha-mode = "default"; # default/matching/all + + background = "282a36"; + foreground = "f8f8f2"; + + ## Normal/regular colors (color palette 0-7) + regular0 = "21222c"; # black + regular1 = "ff5555"; # red + regular2 = "50fa7b"; # green + regular3 = "f1fa8c"; # yellow + regular4 = "bd93f9"; # blue + regular5 = "ff79c6"; # magenta + regular6 = "8be9fd"; # cyan + regular7 = "f8f8f2"; # white + + ## Bright colors (color palette 8-15) + bright0 = "6272a4"; # bright black + bright1 = "ff6e6e"; # bright red + bright2 = "69ff94"; # bright green + bright3 = "ffffa5"; # bright yellow + bright4 = "d6acff"; # bright blue + bright5 = "ff92df"; # bright magenta + bright6 = "a4ffff"; # bright cyan + bright7 = "ffffff"; # bright white + + ## Misc colors + selection-foreground = "ffffff"; + selection-background = "44475a"; + # jump-labels= # black-on-yellow + # scrollback-indicator= # black-on-bright-blue + # search-box-no-match= # black-on-red + # search-box-match= # black-on-yellow + urls = "8be9fd"; + + flash = "7f7f00"; + flash-alpha = 0.5; + }; + + # Alternative colour palette (see `man 5 foot.ini`) + colors2 = { + alpha = 1.0; + alpha-mode = "default"; + + background = "191724"; + foreground = "e0def4"; + + regular0 = "26233a"; # black (Overlay) + regular1 = "eb6f92"; # red (Love) + regular2 = "9ccfd8"; # green (Foam) + regular3 = "f6c177"; # yellow (Gold) + regular4 = "31748f"; # blue (Pine) + regular5 = "c4a7e7"; # magenta (Iris) + regular6 = "ebbcba"; # cyan (Rose) + regular7 = "e0def4"; # white (Text) + + bright0 = "47435d"; # bright black (lighter Overlay) + bright1 = "ff98ba"; # bright red (lighter Love) + bright2 = "c5f9ff"; # bright green (lighter Foam) + bright3 = "ffeb9e"; # bright yellow (lighter Gold) + bright4 = "5b9ab7"; # bright blue (lighter Pine) + bright5 = "eed0ff"; # bright magenta (lighter Iris) + bright6 = "ffe5e3"; # bright cyan (lighter Rose) + bright7 = "fefcff"; # bright white (lighter Text) + + selection-foreground = "ffffff"; + selection-background = "393553"; + + urls = "ebbcba"; # Rose + + flash = "f6c177"; # yellow (Gold) + flash-alpha = 0.5; + + cursor = "191724 e0def4"; + }; + + # csd = { + # preferred = "server"; + # size = 26; + # font = ...; + # color = ...; # foreground color + # hide-when-maximized = "no"; + # border-width = 0; + # border-color = ...; + # button-width = 26; + # button-color = ...; # background color + # button-minimize-color = ...; + # button-maximize-color = ...; + # button-close-color = ...; + # }; + + key-bindings = { + scrollback-up-page = "Shift+Page_Up Shift+KP_Page_Up"; + # scrollback-up-half-page = "none"; + # scrollback-up-line = "none"; + scrollback-down-page = "Shift+Page_Down Shift+KP_Page_Down"; + # scrollback-down-half-page = "none"; + # scrollback-down-line = "none"; + # scrollback-home = "none"; + # scrollback-end = "none"; + + clipboard-copy = "Control+Shift+c XF86Copy"; + clipboard-paste = "Control+Shift+v XF86Paste"; + primary-paste = "Shift+Insert"; + search-start = "Control+Shift+r"; + + font-increase = "Control+plus Control+equal Control+KP_Add"; + font-decrease = "Control+minus Control+KP_Subtract"; + font-reset = "Control+0 Control+KP_0"; + + spawn-terminal = "Control+Shift+n"; + # minimize = "none"; + # maximize = "none"; + # fullscreen = "none"; + + pipe-visible = "[sh -c \"xurls | fuzzel | xargs -r firefox\"] none"; + pipe-scrollback = "[sh -c \"xurls | fuzzel | xargs -r firefox\"] none"; + pipe-selected = "[xargs -r firefox] none"; + pipe-command-output = "[wl-copy] none"; + + show-urls-launch = "Control+Shift+o"; + # show-urls-copy = "none"; + # show-urls-persistent = "none"; + + prompt-prev = "Control+Shift+z"; + prompt-next = "Control+Shift+x"; + + unicode-input = "Control+Shift+u"; + # color-theme-switch-1 = "none"; + # color-theme-switch-2 = "none"; + color-theme-toggle = "Control+Alt+p"; + + # noop = "none"; + # quit = "none"; + }; + + search-bindings = { + cancel = "Control+g Control+c Escape"; + commit = "Return KP_Enter"; + + find-prev = "Control+r"; + find-next = "Control+s"; + + cursor-left = "Left Control+b"; + cursor-left-word = "Control+Left Mod1+b"; + cursor-right = "Right Control+f"; + cursor-right-word = "Control+Right Mod1+f"; + cursor-home = "Home Control+a"; + cursor-end = "End Control+e"; + + delete-prev = "BackSpace"; + delete-prev-word = "Mod1+BackSpace Control+BackSpace"; + delete-next = "Delete"; + delete-next-word = "Mod1+d Control+Delete"; + delete-to-start = "Control+u"; + delete-to-end = "Control+k"; + + extend-char = "Shift+Right"; + extend-to-word-boundary = "Control+w Control+Shift+Right"; + extend-to-next-whitespace = "Control+Shift+w"; + extend-line-down = "Shift+Down"; + extend-backward-char = "Shift+Left"; + extend-backward-to-word-boundary = "Control+Shift+Left"; + # extend-backward-to-next-whitespace = "none"; + extend-line-up = "Shift+Up"; + + clipboard-paste = "Control+v Control+Shift+v Control+y XF86Paste"; + primary-paste = "Shift+Insert"; + + # unicode-input = "none"; + + scrollback-up-page = "Shift+Page_Up Shift+KP_Page_Up"; + # scrollback-up-half-page = "none"; + # scrollback-up-line = "none"; + scrollback-down-page = "Shift+Page_Down Shift+KP_Page_Down"; + # scrollback-down-half-page = "none"; + # scrollback-down-line = "none"; + # scrollback-home = "none"; + # scrollback-end = "none"; + }; + + url-bindings = { + cancel = "Control+g Control+c Control+d Escape"; + toggle-url-visible = "t"; + }; + + text-bindings = { + "\\x03" = "Mod4+c"; # map Super+c -> Control+c + }; + + mouse-bindings = { + scrollback-up-mouse = "BTN_WHEEL_BACK"; + scrollback-down-mouse = "BTN_WHEEL_FORWARD"; + font-increase = "Control+BTN_WHEEL_BACK"; + font-decrease = "Control+BTN_WHEEL_FORWARD"; + selection-override-modifiers = "Shift"; + primary-paste = "BTN_MIDDLE"; + select-begin = "BTN_LEFT"; + select-begin-block = "Control+BTN_LEFT"; + select-extend = "BTN_RIGHT"; + select-extend-character-wise = "Control+BTN_RIGHT"; + select-word = "BTN_LEFT-2"; + select-word-whitespace = "Control+BTN_LEFT-2"; + select-quote = "BTN_LEFT-3"; + select-row = "BTN_LEFT-4"; + }; + }; + }; +} diff --git a/homes/modules/wm/hyprland/default.nix b/homes/modules/wm/hyprland/default.nix new file mode 100755 index 0000000..8e7ad71 --- /dev/null +++ b/homes/modules/wm/hyprland/default.nix @@ -0,0 +1,358 @@ +# NOTE: hyprland must be enabled in BOTH your host config (for running hyprland) +# NOTE: and your home-manager config (for managing hyprland's config files) +{pkgs, ...}: { + home.packages = with pkgs; [ + playerctl + ]; + + wayland.windowManager.hyprland = { + enable = true; + package = null; + portalPackage = null; + + xwayland.enable = true; + + # systemd= { + # enable = true; + # # enable autostart of applications + # # REF: `man 8 systemd-xdg-autostart-generator` + # enableXdgAutostart = true; + # }; + + settings = { + "$MOD" = "SUPER"; + + # applications + "$editor" = "hx"; + "$terminal" = "foot"; + "$menu" = "fuzzel"; + "$colorpicker" = "hyprpicker | head -c 7 | wl-copy"; + "$screenshot_region" = "hyprshot -m region --clipboard-only"; + "$screenshot_window" = "hyprshot -m window --clipboard-only"; + "$cursorLock" = "~/scripts/bin/hyprland-cursor-lock"; + + # startup programs + exec-once = [ + # TODO: make these independent of hyprland, add these to the + "mako &" + "awww-daemon &" + "waybar &" + + # "wl-paste --type text --watch cliphist store" + # "wl-paste --type image --watch cliphist store" + # "wl-clip-persist --clipboard regular" + # "playerctld daemon" + ]; + + # monitor configuration + monitor = [ + "eDP-1, highres@highrr, 0x0, 1.0" + ]; + + # .__. .___ __..___. . . .___ .___. ._. __ __. + # [__] [__ (__ | |__| [__ | | / ` (__ + # | | [___ .__) | | | [___ | _|_ \__. .__) + general = { + gaps_in = 12; # margin between windows + gaps_out = 25; # margin from windows to monitor edge + gaps_workspaces = 0; # margin between workspaces (stacks with gaps_out) + # float_gaps = 0; # gaps_out but for floating windows + + border_size = 4; + + "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + "col.inactive_border" = "rgba(00000000)"; + + # Enable resizing windows by clicking and dragging the border + resize_on_border = true; + + # REF: https://wiki.hyprland.org/Configuring/Tearing/ + allow_tearing = false; + + layout = "dwindle"; + + snap = { + enabled = false; + window_gap = 10; + monitor_gap = 10; + border_overlap = false; + # respect_gaps = false; + }; + }; + + decoration = { + rounding = 20; + rounding_power = 4.0; # Lp norm + border_part_of_window = true; # consider border as part of its window + # screen_shader = ...; # path to custom GLSL fragment shader + + # window Transparency + active_opacity = 1.0; + inactive_opacity = 0.95; + fullscreen_opacity = 1.0; # fullscreened windows + # inactive Window Dimming + dim_inactive = false; + dim_strength = 0.5; + dim_special = 0.2; + dim_around = 0.4; + + blur = { + enabled = true; + new_optimizations = true; + xray = false; # floating windows xray through tiling windows + ignore_opacity = true; + + # blur Parameters + size = 8; + passes = 1; + noise = 0.0117; # default + contrast = 0.8916; # default + brightness = 0.8172; # default + vibrancy = 0.1696; # default + vibrancy_darkness = 0.0; # default + + # blurring For Specific Window Types + special = false; # blur special windows + popups = false; # blur popups + popups_ignorealpha = 0.2; + input_methods = false; + input_methods_ignorealpha = 0.2; + }; + + shadow = { + enabled = true; + ignore_window = true; # only render at edges (not behind) + + range = 3; + render_power = 1; # falloff rate + sharp = false; # aka infinite shadow.render_power + offset = "0 0"; # vec2 + scale = 1.0; + + color = "rgba(00000000)"; + color_inactive = "rgba(000000ff)"; # defaults to shadow.color if unset + }; + }; + + # REF: https://cubic-bezier.com + bezier = [ + "easeOutQuint,0.23,1,0.32,1" + "easeInOutCubic,0.65,0.05,0.36,1" + "linear,0,0,1,1" + "almostLinear,0.5,0.5,0.75,1.0" + "quick,0.15,0,0.1,1" + ]; + + # REF: https://wiki.hyprland.org/Configuring/Animations + # Animation Declaration Format: + # "animation = NAME, ENABLE, SPEED, BEZIER [,STYLE]" + # NOTE: SPEED is in ds (where 1ds = 100ms) + animations = [ + "global, 1, 10, default" + "border, 1, 5.39, easeOutQuint" + + "windowsIn, 1, 4, linear, slide bottom" + "windowsOut, 1, 10, linear, popin" + + "fadeIn, 1, 1.73, almostLinear" + "fadeOut, 1, 1.46, almostLinear" + "fade, 1, 3.03, quick" + + "layers, 1, 3.81, easeOutQuint" + "layersIn, 1, 4, easeOutQuint, fade" + "layersOut, 1, 1.5, linear, fade" + + "fadeLayersIn, 1, 1.79, almostLinear" + "fadeLayersOut, 1, 1.39, almostLinear" + + "workspaces, 1, 1.94, almostLinear, fade" + "workspacesIn, 1, 1.21, almostLinear, fade" + "workspacesOut, 1, 1.94, almostLinear, fade" + ]; + + # REF: https://wiki.hyprland.org/Configuring/Dwindle-Layout + dwindle = { + # master switch for pseudotiling. enabling is bound to MOD + P in the keybinds section below + pseudotile = true; + preserve_split = true; # You probably want this + }; + + # REF: https://wiki.hyprland.org/Configuring/Master-Layout + master = { + new_status = "master"; + }; + + misc = { + #force_default_wallpaper = -1; # Set to 0 or 1 to disable the anime mascot wallpapers + disable_hyprland_logo = true; + disable_splash_rendering = true; + + enable_anr_dialog = false; + font_family = "Geist Mono"; + }; + + input = { + # kb_layout = "us"; + # kb_variant = + # kb_model = + # kb_options = + # kb_rules = + + follow_mouse = 1; + + sensitivity = 0; # -1.0 - 1.0, 0 means no modification + accel_profile = "flat"; + force_no_accel = false; # not recommended to turn on + + repeat_rate = 50; + repeat_delay = 300; + + touchpad = { + natural_scroll = true; + }; + }; + + cursor.no_hardware_cursors = true; + + # standard keypress bindings + bind = [ + # terminal commands + "$MOD, RETURN, exec, $terminal" + + # btop + "$MOD, P, exec, bash -c \"{ hyprctl clients | rg '^\w*title: btop' &>/dev/null; } && hyprctl dispatch closewindow title:btop || $terminal -T btop btop & disown\"" + + "$MOD, R, exec, $menu" + + # lock mouse to window (mostly, for gaming) + "$MOD, F1, exec, pkill hyprland-cursor || $cursorLock" + "$MOD, F2, exec, $colorpicker" + + # screenshots + "$MOD, S, exec, $screenshot_region" + "$MOD SHIFT, S, exec, $screenshot_window" + + "$MOD, F, fullscreen" + "$MOD SHIFT, F, fullscreenstate, 0 3" # fakefullscreen + "$MOD, C, killactive" + "$MOD SHIFT, Delete, exit" + + # switch window + "$MOD, left, movefocus, l" + "$MOD, right, movefocus, r" + "$MOD, up, movefocus, u" + "$MOD, down, movefocus, d" + "$MOD, H, movefocus, l" + "$MOD, J, movefocus, d" + "$MOD, K, movefocus, u" + "$MOD, L, movefocus, r" + + # switch workspaces + "$MOD, 1, workspace, 1" + "$MOD, 2, workspace, 2" + "$MOD, 3, workspace, 3" + "$MOD, 4, workspace, 4" + "$MOD, 5, workspace, 5" + "$MOD, 6, workspace, 6" + "$MOD, 7, workspace, 7" + "$MOD, 8, workspace, 8" + "$MOD, 9, workspace, 9" + "$MOD, 0, workspace, 10" + "$MOD SHIFT, left, workspace, e-1" + "$MOD SHIFT, right, workspace, e+1" + + # move window to workspace + "$MOD SHIFT, 1, movetoworkspace, 1" + "$MOD SHIFT, 2, movetoworkspace, 2" + "$MOD SHIFT, 3, movetoworkspace, 3" + "$MOD SHIFT, 4, movetoworkspace, 4" + "$MOD SHIFT, 5, movetoworkspace, 5" + "$MOD SHIFT, 6, movetoworkspace, 6" + "$MOD SHIFT, 7, movetoworkspace, 7" + "$MOD SHIFT, 8, movetoworkspace, 8" + "$MOD SHIFT, 9, movetoworkspace, 9" + "$MOD SHIFT, 0, movetoworkspace, 10" + + # move workspace to monitor + "$MOD TAB, 1, movecurrentworkspacetomonitor, DP-2" + "$MOD TAB, 2, movecurrentworkspacetomonitor, HDMA-A-1" + ]; + + # bindings for mouse + bindm = [ + "$MOD, mouse:272, movewindow" + "$MOD, mouse:273, resizewindow" + ]; + + # bindings that work even while screen is locked + bindl = [ + # WARNING: requires `pkgs.playerctl` + ", XF86AudioNext, exec, playerctl next" + ", XF86AudioPause, exec, playerctl play-pause" + ", XF86AudioPlay, exec, playerctl play-pause" + ", XF86AudioPrev, exec, playerctl previous" + ]; + + # bindings that work even while screen is locked + # and also repeat when the key is held + bindel = [ + ",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" + ",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + ",XF86MonBrightnessUp, exec, brightnessctl s 10%+" + ",XF86MonBrightnessDown, exec, brightnessctl s 10%-" + ]; + + windowrule = [ + # btop process manager + { + name = "terminal-manager"; + "match:class" = "^(foot)$"; + "match:title" = "^(btop)$"; + float = true; + center = true; + size = "(monitor_w*0.65) (monitor_h*0.65)"; + } + + # ignore maximize requests from apps + { + name = "suppress-maximize"; + suppress_event = "maximize"; + "match:class" = ".*"; + } + + # fix some dragging issues with XWayland + { + name = "no-focus"; + no_focus = "on"; + "match:class" = "^$"; + "match:title" = "^$"; + "match:xwayland" = true; + "match:float" = true; + "match:fullscreen" = false; + "match:pin" = false; + } + + # TODO: style fakefullscreen windows to clearly indicate their difference + # { + # name = "fake-fullscreen"; + # } + ]; + + # █▀▀ █▄░█ █░█   █░█ ▄▀█ █▀█ + # ██▄ █░▀█ ▀▄▀   ▀▄▀ █▀█ █▀▄ + env = [ + "XCURSOR_THEME,Bibata-Modern-Ice" + "XCURSOR_SIZE,16" + "HYPRCURSOR_THEME,Bibata-Modern-Ice" + "HYPRCURSOR_SIZE,16" + + "QT_QPA_PLATFORM,wayland" + "QT_QPA_PLATFORMTHEME,xdgdesktopportal" # makes portals work correctly + "XDG_MENU_PREFIX,arch-" + "XDG_CURRENT_DESKTOP,Hyprland" + ]; + }; + }; +} diff --git a/homes/modules/wm/hyprland/hypridle.nix b/homes/modules/wm/hyprland/hypridle.nix new file mode 100755 index 0000000..e31be07 --- /dev/null +++ b/homes/modules/wm/hyprland/hypridle.nix @@ -0,0 +1,29 @@ +{ + config, + pkgs, + ... +}: { + services.hypridle = { + enable = true; + settings = { + general = { + ignore_dbus_inhibit = false; + lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; + before_sleep_cmd = "loginctl lock-session"; + after_sleep_cmd = "hyprctl dispatch dpms on"; + }; + + listener = [ + { + timeout = 600; + on-timeout = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; + } + + { + timeout = 660; + on-timeout = "systemctl suspend"; + } + ]; + }; + }; +} diff --git a/homes/modules/wm/hyprland/hyprlock.nix b/homes/modules/wm/hyprland/hyprlock.nix new file mode 100755 index 0000000..2470b1a --- /dev/null +++ b/homes/modules/wm/hyprland/hyprlock.nix @@ -0,0 +1,115 @@ +{...}: { + programs.hyprlock = { + enable = true; + settings = { + background = { + monitor = ""; + # TODO: ooni pls change this to something of your own + # path = "$HOME/downloads/wallpaper/kill-my-firstborn/astronaut-pink-blue.png"; + # color = $color1 + + # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations + blur_size = 4; + blur_passes = 3; # 0 disables blurring + noise = 0.0117; + contrast = 1.3000; # Vibrant!!! + brightness = 0.8000; + vibrancy = 0.2100; + vibrancy_darkness = 0.0; + }; + label = [ + { + # Hours + monitor = ""; + text = ''cmd[update:1000] echo " $(date +"%H") "''; + color = "rgb(255, 255, 255, 1)"; + font_size = 112; + font_family = "Geist Mono 10"; + shadow_passes = 3; + shadow_size = 4; + + position = "0, 240"; + halign = "center"; + valign = "center"; + } + + { + # Minutes + monitor = ""; + text = ''cmd[update:1000] echo " $(date +"%M") "''; + color = "rgb(255, 255, 255, 1)"; + font_size = 112; + font_family = "Geist Mono 10"; + shadow_passes = 3; + shadow_size = 4; + + position = "0, 120"; + halign = "center"; + valign = "center"; + } + + # Today + { + monitor = ""; + text = ''cmd[update:18000000] echo " "$(date +'%A')" "''; + color = "rgb(255, 255, 255, 1)"; + font_size = 22; + font_family = "JetBrainsMono Nerd Font 10"; + + position = "0, 30"; + halign = "center"; + valign = "center"; + } + + # Week + { + monitor = ""; + text = ''cmd[update:18000000] echo " "$(date +'%d %b')" "''; + color = "rgb(255, 255, 255, 1)"; + font_size = 18; + font_family = "JetBrainsMono Nerd Font 10"; + + position = "0, 6"; + halign = "center"; + valign = "center"; + } + + { + # Degrees + monitor = ""; + # get temperature in Brisbane + text = ''cmd[update:18000000] echo "Feels like $(curl -s 'wttr.in/bne?format=%t' | tr -d '+')"''; + color = "rgb(255, 255, 255, 1)"; + font_size = 18; + font_family = "Geist Mono 10"; + + position = "0, 40"; + halign = "center"; + valign = "bottom"; + } + ]; + + input-field = { + monitor = ""; + size = "300, 50"; + outline_thickness = 3; + + dots_size = 0.26; # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.64; # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = true; + dots_rouding = -1; + + rounding = 22; + outer_color = "rgb(0, 0, 0, 0)"; + inner_color = "rgb(100, 114, 125, 0.1)"; + font_color = "rgb(200, 200, 200)"; + fade_on_empty = true; + placeholder_text = "Password..."; # Text rendered in the input box when it's empty. + + position = "0, 120"; + halign = "center"; + valign = "bottom"; + }; + }; + }; +} diff --git a/hosts/MACBOOKI9/default.nix b/hosts/MACBOOKI9/default.nix new file mode 100755 index 0000000..cd9829b --- /dev/null +++ b/hosts/MACBOOKI9/default.nix @@ -0,0 +1,41 @@ +{ + pkgs, + upkgs, + lib, + ... +}: { + imports = [ + ./hardware.nix + ]; + + networking.hostName = "MACBOOKI9"; + + boot.loader = { + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + grub = { + efiSupport = true; + device = "nodev"; + + # detect other bootable systems at build-time + useOSProber = false; + }; + }; + + # ----- SERVICES ----- + services = { + # Touchpad support + libinput.enable = true; + }; + + # ---- SYSTEM PACKAGES ----- + environment.systemPackages = with pkgs; []; + + # XXX: WARNING: DO NOT MODIFY + # XXX: WARNING: DO NOT MODIFY + # XXX: WARNING: IM DEAD SERIOUS DO NOT CHANGE THIS VALUE + # XXX: WARNING: IM DEAD SERIOUS DO NOT CHANGE THIS VALUE + system.stateVersion = "25.11"; # Did you read the comment? +} diff --git a/hosts/MACBOOKI9/hardware.nix b/hosts/MACBOOKI9/hardware.nix new file mode 100644 index 0000000..ea7d685 --- /dev/null +++ b/hosts/MACBOOKI9/hardware.nix @@ -0,0 +1,33 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c959876c-805c-4433-bb36-67eb13924c62"; + fsType = "btrfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/8CC6-6102"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/091b5706-ba96-44b9-89b7-9aa7e85b8221"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/modules/apps/sober.nix b/hosts/modules/apps/sober.nix new file mode 100644 index 0000000..60e3571 --- /dev/null +++ b/hosts/modules/apps/sober.nix @@ -0,0 +1,12 @@ +{...}: { + services.flatpak = { + enable = true; + packages = [ + { + # Linux Runtime for Roblox + appId = "org.vinegarhq.Sober"; + origin = "flathub"; + } + ]; + }; +} diff --git a/hosts/modules/apps/steam.nix b/hosts/modules/apps/steam.nix new file mode 100644 index 0000000..8bffdf3 --- /dev/null +++ b/hosts/modules/apps/steam.nix @@ -0,0 +1,50 @@ +{ + pkgs, + upkgs, + ... +}: { + nixpkgs.overlays = [ + (self: super: { + lutris = super.lutris.overrideAttrs (final: prev: { + # WARNING: pkgs.mbedtls_2 is marked insecure! + # Replace pkgs.mbedtls_2 (v2.28.10) with pkgs.mbedtls (v3.6.4) + targetPkgs = pkgs: ( + (builtins.filter (p: p != pkgs.mbedtls_2) (prev.targetPkgs pkgs)) + ++ [pkgs.mbedtls] + ); + }); + }) + ]; + + programs = { + steam = { + enable = true; + package = upkgs.millennium-steam; + gamescopeSession.enable = false; # .desktop entry for gamescope + + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + + extraCompatPackages = with pkgs; [ + proton-ge-bin + ]; + }; + + gamemode.enable = true; + }; + + environment.systemPackages = with pkgs; [ + steamcmd + + mangohud + protonup-qt + + # XXX: DEBUG: disable lutris + # XXX: NOTE: pkgs.lutris depends on pkgs.mbedtls_2 which is marked insecure! + # XXX: NOTE: Use the provided overlay to patch pkgs.mbedtls_2 -> pkgs.mbedtls + # lutris + + bottles + ]; +} diff --git a/hosts/modules/bashistrans.nix b/hosts/modules/bashistrans.nix new file mode 100644 index 0000000..81fc2dd --- /dev/null +++ b/hosts/modules/bashistrans.nix @@ -0,0 +1,27 @@ +{pkgs, ...}: { + # I want to use fish as my login shell but it always goes terrible + # cause it isn't POSIX compliant, so instead Bash is my login and + # will just exec fish (^-^) + programs = { + fish.enable = true; + + bash = { + blesh.enable = false; # ble.sh replacement for GNU readline + completion.enable = true; + + interactiveShellInit = '' + # help bash transition into a beautiful fish! + if [[ -z $BASH_IS_TRANS ]] + then + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] + then + shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + fi + # bash is trans now! (no more transitioning required) + export BASH_IS_TRANS=true + ''; + }; + }; +} diff --git a/hosts/modules/core/garbage-collector.nix b/hosts/modules/core/garbage-collector.nix new file mode 100755 index 0000000..bcfd809 --- /dev/null +++ b/hosts/modules/core/garbage-collector.nix @@ -0,0 +1,14 @@ +{...}: { + # Optimize storage and automatic scheduled GC running + # If you want to run GC manually, use commands: + # `nix-store --optimize` for finding and eliminating redundant copies of identical store paths + # `nix-store --gc` for optimizing the nix store and removing unreferenced and obsolete store paths + # `nix-collect-garbage -d` for deleting old generations of user profiles + nix.settings.auto-optimise-store = true; + nix.optimise.automatic = true; + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; +} diff --git a/hosts/modules/wm/hyprland.nix b/hosts/modules/wm/hyprland.nix new file mode 100644 index 0000000..9edd9bd --- /dev/null +++ b/hosts/modules/wm/hyprland.nix @@ -0,0 +1,33 @@ +{ + inputs, + pkgs, + lib, + system, + ... +}: let + hyprpkgs = inputs.hyprland.inputs.nixpkgs.legacyPackages.${system}; +in { + environment.defaultPackages = with pkgs; [ + hyprsunset + ]; + + xdg.portal = { + enable = true; + + wlr.enable = true; + }; + + programs = { + hyprland = { + enable = true; + package = inputs.hyprland.packages.${system}.hyprland; + portalPackage = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland; + xwayland.enable = true; + }; + }; + + hardware.graphics = { + package = lib.mkForce hyprpkgs.mesa; + package32 = lib.mkForce hyprpkgs.pkgsi686Linux.mesa; + }; +} diff --git a/nixpkgs.nix b/nixpkgs.nix new file mode 100644 index 0000000..31751ea --- /dev/null +++ b/nixpkgs.nix @@ -0,0 +1,42 @@ +{inputs, ...} @ args: let + sharedOverlays = [ + inputs.wa2k.overlays.default + inputs.millennium.overlays.default + (import ./overlays args) + ]; +in { + nixpkgs.channels = rec { + # base + base = npkgs; + + # nixpkgs-stable + npkgs = { + source = inputs.nixpkgs; + overlays = [] ++ sharedOverlays; + config = { + allowUnfree = true; + allowBroken = false; + }; + }; + + # nixpkgs-unstable + upkgs = { + source = inputs.nixpkgs-unstable; + overlays = [] ++ sharedOverlays; + config = { + allowUnfree = true; + allowBroken = false; + }; + }; + + # nixpkgs-master + mpkgs = { + source = inputs.nixpkgs-master; + overlays = [] ++ sharedOverlays; + config = { + allowUnfree = true; + allowBroken = false; + }; + }; + }; +} diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..db1ecef --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,93 @@ +{ + inputs, + system, + ... +}: ( + self: super: let + pkgs = super; + inherit + (super) + lib + ; + in { + ns = pkgs.writeShellApplication { + name = "ns"; + runtimeInputs = with pkgs; [ + fzf + nix-search-tv + ]; + text = builtins.readFile "${pkgs.nix-search-tv.src}/nixpkgs.sh"; + + excludeShellChecks = [ + # SC2016 (info): Expressions don't expand in single quotes, use double quotes for that. + "SC2016" + ]; + }; + + sddm-theme-corners = import ../packages/sddm-theme/corners.nix { + inherit pkgs; + }; + + sddm-theme-sugar-dark = import ../packages/sddm-theme/sugar-dark.nix { + inherit pkgs; + }; + + xdg-desktop-portal-hyprland = + lib.mkIf (inputs?hyprland) + inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland; + hyprland-git = + lib.mkIf (inputs?hyprland) + (inputs.hyprland.packages.${system}.hyprland.overrideAttrs (final: prev: { + patches = let + glaze_version = inputs.hyprland.inputs.nixpkgs.legacyPackages.glaze.version; + in + prev.patches + ++ [ + '' + diff --git a/hyprpm/CMakeLists.txt b/hyprpm/CMakeLists.txt + index 9f1318f4..7d5b8eda 100644 + --- a/hyprpm/CMakeLists.txt + +++ b/hyprpm/CMakeLists.txt + @@ -11,9 +11,9 @@ set(CMAKE_CXX_STANDARD 23) + + pkg_check_modules(hyprpm_deps REQUIRED IMPORTED_TARGET tomlplusplus hyprutils>=0.7.0) + + -find_package(glaze 7.0.0 QUIET) + +find_package(glaze ${glaze_version} QUIET) + if (NOT glaze_FOUND) + - set(GLAZE_VERSION v7.0.0) + + set(GLAZE_VERSION v${glaze_version}) + message(STATUS "glaze dependency not found, retrieving ''${GLAZE_VERSION} with FetchContent") + include(FetchContent) + FetchContent_Declare( + '' + ]; + })); + + awww = inputs.awww.packages.${system}.awww; + + prismlauncher = pkgs.prismlauncher.overrideAttrs (final: prev: { + buildInputs = + prev.buildInputs + ++ (with pkgs; [ + libxtst + ]); + }); + + element-desktop = pkgs.element-desktop.overrideAttrs (final: prev: { + desktopItems = [ + ((builtins.elemAt prev.desktopItems 0).override { + exec = "element-desktop %u --password-store=\"gnome-libsecret\""; + }) + ]; + }); + + # in wake of CVE-2022-3602/CVE-2022-3786 + nginxStable = pkgs.nginxStable.override {openssl = pkgs.libressl;}; + nginx = pkgs.nginx.override {openssl = pkgs.libressl;}; + + bottles = pkgs.bottles.override { + removeWarningPopup = true; + }; + } +) diff --git a/overlays/patches/glaze.patch b/overlays/patches/glaze.patch new file mode 100644 index 0000000..48c68bf --- /dev/null +++ b/overlays/patches/glaze.patch @@ -0,0 +1,16 @@ +diff --git a/hyprpm/CMakeLists.txt b/hyprpm/CMakeLists.txt +index 9f1318f4..7d5b8eda 100644 +--- a/hyprpm/CMakeLists.txt ++++ b/hyprpm/CMakeLists.txt +@@ -11,9 +11,9 @@ set(CMAKE_CXX_STANDARD 23) + + pkg_check_modules(hyprpm_deps REQUIRED IMPORTED_TARGET tomlplusplus hyprutils>=0.7.0) + +-find_package(glaze 7.0.0 QUIET) ++find_package(glaze 6.0.1 QUIET) + if (NOT glaze_FOUND) +- set(GLAZE_VERSION v7.0.0) ++ set(GLAZE_VERSION v6.0.1) + message(STATUS "glaze dependency not found, retrieving ${GLAZE_VERSION} with FetchContent") + include(FetchContent) + FetchContent_Declare( diff --git a/packages/README.md b/packages/README.md new file mode 100644 index 0000000..b584c44 --- /dev/null +++ b/packages/README.md @@ -0,0 +1,3 @@ +# /packages +This directory (`hosts/packages`) contains custom package derivations, and differs +from `hosts/modules/` which contains importable modules for your flake. diff --git a/packages/sddm-theme/corners.nix b/packages/sddm-theme/corners.nix new file mode 100755 index 0000000..b0e3789 --- /dev/null +++ b/packages/sddm-theme/corners.nix @@ -0,0 +1,24 @@ +{pkgs}: +pkgs.stdenv.mkDerivation { + name = "sddm-theme-corners"; + version = "1.0.0"; + + installPhase = '' + mkdir -p $out/share/sddm/themes + cp -ar $src/corners $out/share/sddm/themes/ + ''; + src = pkgs.fetchFromGitHub { + owner = "aczw"; + repo = "sddm-theme-corners"; + rev = "6ff0ff455261badcae36cd7d151a34479f157a3c"; + sha256 = "0iiasrbl7ciyhq3z02la636as915zk9ph063ac7vm5iwny8vgwh8"; + }; + + buildInputs = with pkgs; [ + libsForQt5.qt5.qtgraphicaleffects + ]; + + nativeBuildInputs = with pkgs; [ + qt5.wrapQtAppsHook + ]; +} diff --git a/packages/sddm-theme/sugar-dark.nix b/packages/sddm-theme/sugar-dark.nix new file mode 100755 index 0000000..d60c046 --- /dev/null +++ b/packages/sddm-theme/sugar-dark.nix @@ -0,0 +1,35 @@ +{ pkgs }: + +let + #image = pkgs.fetchurl { + # url = "https://"; + # sha256 = ""; + #}; +in +pkgs.stdenv.mkDerivation { + name = "sddm-theme"; + src = pkgs.fetchFromGitHub { + owner = "MarianArlt"; + repo = "sddm-sugar-dark"; + rev = "ceb2c455663429be03ba62d9f898c571650ef7fe"; + sha256 = "0153z1kylbhc9d12nxy9vpn0spxgrhgy36wy37pk6ysq7akaqlvy"; + }; + # dependencies + buildInputs = with pkgs.libsForQt5; [ + qt5.qtbase + qt5.qtx11extras + qt5.qtquickcontrols2 + qt5.qtgraphicaleffects + qt5.wrapQtAppsHook + #libsForQt5.qt5.qtquickcontrols2 + #libsForQt5.qt5.qtgraphicaleffects + ]; + installPhase = '' + # move necessary files + mkdir -p $out + cp -R ./* $out/ + ''; + # set background + #rm $out/Background.jpg + #mv ${image} $out/Background.jpg +} diff --git a/snow.nix b/snow.nix new file mode 100644 index 0000000..02dcb31 --- /dev/null +++ b/snow.nix @@ -0,0 +1,29 @@ +{inputs, ...} @ args: { + nodes = { + base = inputs.nixpkgs; + homeManager = inputs.home-manager; + + args = {inherit inputs;}; + modules = [ + inputs.sddm-silent.nixosModules.default + inputs.wa2k.nixosModules.default + ]; + + groups = { + # group containing all your desktops + desktops = {}; + }; + + nodes = { + # wow she's on nix :3 + MACBOOKI9 = { + system = "x86_64-linux"; + groups = groups: [groups.desktops]; + modules = with inputs; [ + grub2-themes.nixosModules.default + nix-flatpak.nixosModules.nix-flatpak + ]; + }; + }; + }; +}