diff --git a/flake.lock b/flake.lock index 2a1fc0e..cb326fd 100644 --- a/flake.lock +++ b/flake.lock @@ -81,11 +81,27 @@ "type": "github" } }, + "nur": { + "locked": { + "lastModified": 1676375128, + "narHash": "sha256-rNEF0UWJQhL18V82Y1SGDqH21wSykDy3KxvlzRGB+2w=", + "owner": "nix-community", + "repo": "NUR", + "rev": "89f9ed0f4a56f14bd64260e252c6ded255d596bc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", "hyprland": "hyprland", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nur": "nur" } }, "utils": { diff --git a/flake.nix b/flake.nix index 12b238a..f3cc655 100644 --- a/flake.nix +++ b/flake.nix @@ -11,28 +11,38 @@ url = "github:hyprwm/Hyprland"; inputs.nixpkgs.follows = "nixpkgs"; }; + nur.url = "github:nix-community/NUR"; }; outputs = { self, - nixpkgs, home-manager, hyprland, + nur, ... - } @ inputs: let + } @ rawInput: let user = "zoriya"; # TODO: mode this to a lib folder mkSystem = system: hostname: { nixModules, homeModules, - }: - nixpkgs.lib.nixosSystem { + }: let + nixpkgs = import rawInput.nixpkgs { + inherit system; + overlays = [ + (import ./pkgs) + ]; + }; + inputs = rawInput // {inherit nixpkgs;}; + in + rawInput.nixpkgs.lib.nixosSystem { inherit system; specialArgs = inputs; modules = [ ./modules/nixos nixModules + nur.nixosModules.nur ({pkgs, ...}: { networking.hostName = hostname; @@ -51,7 +61,7 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; - extraSpecialArgs = {inherit user;}; + extraSpecialArgs = inputs; users.${user} = { imports = [ ./modules/home @@ -60,6 +70,9 @@ config.modules = homeModules; }; }; + nixpkgs.overlays = [ + nur.overlay + ]; } # TODO: use a module instead of this. diff --git a/hosts/fuhen/hardware-configuration.nix b/hosts/fuhen/hardware-configuration.nix index 386b651..f2dae96 100644 --- a/hosts/fuhen/hardware-configuration.nix +++ b/hosts/fuhen/hardware-configuration.nix @@ -1,29 +1,30 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/e8f1fdc5-c5fc-4468-b92a-63b7b4093345"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/e8f1fdc5-c5fc-4468-b92a-63b7b4093345"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/D229-F68F"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/D229-F68F"; + fsType = "vfat"; + }; - swapDevices = [ ]; + swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/modules/home/hyprland/default.nix b/modules/home/hyprland/default.nix index e804bc9..91b3561 100644 --- a/modules/home/hyprland/default.nix +++ b/modules/home/hyprland/default.nix @@ -1,4 +1,5 @@ { + pkgs, lib, config, ... @@ -9,6 +10,7 @@ in { config = lib.mkIf cfg.enable { + home.packages = with pkgs; [nur.repos.ocfox.swww]; wayland.windowManager.hyprland = { enable = true; systemdIntegration = true; @@ -19,5 +21,13 @@ in { nvidiaPatches = false; extraConfig = builtins.readFile ./hyprland.conf; }; + + home.file."wallpapers".source = ../../../wallpapers; + home.file.".config/hypr/wallpaper.sh" = { + source = ./wallpaper.sh; + executable = true; + }; + + # TODO: zsh alias for wp }; } diff --git a/modules/home/hyprland/hyprland.conf b/modules/home/hyprland/hyprland.conf index 55c11c0..c3d9235 100644 --- a/modules/home/hyprland/hyprland.conf +++ b/modules/home/hyprland/hyprland.conf @@ -1,4 +1,6 @@ exec-once=eww open bar +exec-once=swww init +exec-once=~/.config/hypr/wallpaper.sh autogenerated = 0 @@ -82,6 +84,14 @@ gestures { # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more +windowrulev2=workspace 5,class:^(discord)$ +windowrulev2=float,title:^(Discord Updater)$ +windowrulev2=workspace 5,title:^(Discord Updater)$ + +windowrulev2=nofullscreenrequest,class:^(zoom)$ +windowrulev2=float,class:^(zoom)$ + + # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER @@ -142,3 +152,10 @@ bind = $mainMod SHIFT, 0, movetoworkspace, 10 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow + +bind=,XF86MonBrightnessUp,exec,brightnessctl set 10%+ +bind=,XF86MonBrightnessDown,exec,brightnessctl set 10%- +bind=,XF86AudioRaiseVolume,exec,pactl set-sink-volume @DEFAULT_SINK@ +10% +bind=,XF86AudioLowerVolume,exec,pactl set-sink-volume @DEFAULT_SINK@ -10% +bind=,XF86AudioMute,exec,pactl set-sink-mute @DEFAULT_SINK@ toggle +bind=,XF86AudioMicMute,exec,pactl set-source-mute @DEFAULT_SOURCE@ toggle diff --git a/modules/home/hyprland/wallpaper.sh b/modules/home/hyprland/wallpaper.sh new file mode 100755 index 0000000..b37cecf --- /dev/null +++ b/modules/home/hyprland/wallpaper.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +WALLPAPERS=~/wallpapers/ +export SWWW_TRANSITION_FPS=60 +export SWWW_TRANSITION_STEP=2 +export SWWW_TRANSITION=grow + +swww img "$(find $WALLPAPERS -type f | shuf -n 1)" diff --git a/wallpapers/Irozuku-Sekai-no-Ashita-kara.png b/wallpapers/Irozuku-Sekai-no-Ashita-kara.png new file mode 100644 index 0000000..c9b8e3d Binary files /dev/null and b/wallpapers/Irozuku-Sekai-no-Ashita-kara.png differ diff --git a/wallpapers/Kujira no Kora wa Sajou ni Utau.png b/wallpapers/Kujira no Kora wa Sajou ni Utau.png new file mode 100644 index 0000000..6267c48 Binary files /dev/null and b/wallpapers/Kujira no Kora wa Sajou ni Utau.png differ diff --git a/wallpapers/MadeInAbyss.jpg b/wallpapers/MadeInAbyss.jpg new file mode 100644 index 0000000..543d392 Binary files /dev/null and b/wallpapers/MadeInAbyss.jpg differ diff --git a/wallpapers/Shelter.jpeg b/wallpapers/Shelter.jpeg new file mode 100644 index 0000000..f7dc490 Binary files /dev/null and b/wallpapers/Shelter.jpeg differ diff --git a/wallpapers/Shrine.jpg b/wallpapers/Shrine.jpg new file mode 100644 index 0000000..21bd55b Binary files /dev/null and b/wallpapers/Shrine.jpg differ diff --git a/wallpapers/blue-period.jpg b/wallpapers/blue-period.jpg new file mode 100644 index 0000000..95c5e64 Binary files /dev/null and b/wallpapers/blue-period.jpg differ diff --git a/wallpapers/celeste.jpg b/wallpapers/celeste.jpg new file mode 100644 index 0000000..2cec9ee Binary files /dev/null and b/wallpapers/celeste.jpg differ diff --git a/wallpapers/fish-city.jpg b/wallpapers/fish-city.jpg new file mode 100644 index 0000000..3c55b53 Binary files /dev/null and b/wallpapers/fish-city.jpg differ diff --git a/wallpapers/fox.jpg b/wallpapers/fox.jpg new file mode 100644 index 0000000..738580a Binary files /dev/null and b/wallpapers/fox.jpg differ diff --git a/wallpapers/freya.jpg b/wallpapers/freya.jpg new file mode 100644 index 0000000..7322465 Binary files /dev/null and b/wallpapers/freya.jpg differ diff --git a/wallpapers/neon-shallows.jpeg b/wallpapers/neon-shallows.jpeg new file mode 100644 index 0000000..7ef77df Binary files /dev/null and b/wallpapers/neon-shallows.jpeg differ diff --git a/wallpapers/rocket.png b/wallpapers/rocket.png new file mode 100644 index 0000000..7e54c88 Binary files /dev/null and b/wallpapers/rocket.png differ diff --git a/wallpapers/sea1.png b/wallpapers/sea1.png new file mode 100644 index 0000000..315dd55 Binary files /dev/null and b/wallpapers/sea1.png differ diff --git a/wallpapers/viktor.jpg b/wallpapers/viktor.jpg new file mode 100644 index 0000000..7c9dc2b Binary files /dev/null and b/wallpapers/viktor.jpg differ diff --git a/wallpapers/whale.jpeg b/wallpapers/whale.jpeg new file mode 100644 index 0000000..0e39d75 Binary files /dev/null and b/wallpapers/whale.jpeg differ diff --git a/wallpapers/where-we-meet.jpg b/wallpapers/where-we-meet.jpg new file mode 100644 index 0000000..ea52695 Binary files /dev/null and b/wallpapers/where-we-meet.jpg differ