diff --git a/flake.lock b/flake.lock index 5309404..014b280 100644 --- a/flake.lock +++ b/flake.lock @@ -70,6 +70,21 @@ "type": "github" } }, + "nix-filter": { + "locked": { + "lastModified": 1693833173, + "narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1696983906, @@ -123,7 +138,29 @@ "hyprland": "hyprland", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", - "nur": "nur" + "nur": "nur", + "split-monitor-workspaces": "split-monitor-workspaces" + } + }, + "split-monitor-workspaces": { + "inputs": { + "hyprland": [ + "hyprland" + ], + "nix-filter": "nix-filter" + }, + "locked": { + "lastModified": 1697056199, + "narHash": "sha256-Tkd4cI4Vq6cczZjiZdfs1Q9Gke+4iL1+S3c2GAGhEvc=", + "owner": "Duckonaut", + "repo": "split-monitor-workspaces", + "rev": "9b40de35aeb8c62df3326eae7979b438f3ee0fb1", + "type": "github" + }, + "original": { + "owner": "Duckonaut", + "repo": "split-monitor-workspaces", + "type": "github" } }, "systems": { diff --git a/flake.nix b/flake.nix index dbb1723..45ec81e 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,11 @@ url = "github:hyprwm/Hyprland"; # Requires "hyprland.nixosModules.default" to be added the host modules inputs.nixpkgs.follows = "nixpkgs-unstable"; }; + + split-monitor-workspaces = { + url = "github:Duckonaut/split-monitor-workspaces"; + inputs.hyprland.follows = "hyprland"; # <- make sure this line is present for the plugin to work as intended + }; }; outputs = inputs @ { @@ -41,6 +46,7 @@ home-manager, nur, hyprland, + split-monitor-workspaces, ... }: # Function telling flake which inputs to use @@ -56,7 +62,14 @@ nixosConfigurations = ( # NixOS Configurations import ./hosts { inherit (nixpkgs) lib; - inherit inputs nixpkgs nixpkgs-unstable home-manager nur hyprland vars; # Inherit inputs + inherit inputs nixpkgs nixpkgs-unstable home-manager nur hyprland split-monitor-workspaces vars; # Inherit inputs + } + ); + + homeConfigurations = ( # Nix Configurations + import ./nix/home.nix { + inherit (nixpkgs) lib; + inherit inputs nixpkgs nixpkgs-unstable home-manager vars hyprland split-monitor-workspaces; } ); }; diff --git a/hosts/configuration.nix b/hosts/configuration.nix index 8986f54..1048a58 100644 --- a/hosts/configuration.nix +++ b/hosts/configuration.nix @@ -7,7 +7,7 @@ vars, ... }: { - imports = import ../modules/desktops; + imports = (import ../modules/desktops) ++ (import ../modules/shell); users.users.${vars.user} = { # System User @@ -22,6 +22,8 @@ environment.shells = with pkgs; [fish]; programs.fish.enable = true; + services.flatpak.enable = true; + # Enable the X11 windowing system. # services.xserver.enable = true; @@ -108,6 +110,7 @@ bat lazygit fzf + neofetch # Video/Audio alsa-utils # Audio Control @@ -140,6 +143,7 @@ fishPlugins.sponge fishPlugins.colored-man-pages fishPlugins.autopair + nix-your-shell # Other Packages Found @ # - .//default.nix # - ../modules diff --git a/hosts/default.nix b/hosts/default.nix index 80a0fc2..c066bb5 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -6,6 +6,7 @@ home-manager, nur, hyprland, + split-monitor-workspaces, vars, ... }: let @@ -28,7 +29,7 @@ in { inherit system; specialArgs = { # Pass Flake Variable - inherit inputs system unstable hyprland vars; + inherit inputs system unstable hyprland vars split-monitor-workspaces; host = { hostName = "desktop"; mainMonitor = "DP-3"; @@ -38,9 +39,9 @@ in { modules = [ # Modules Used nur.nixosModules.nur + hyprland.nixosModules.default ./desktop ./configuration.nix - home-manager.nixosModules.home-manager { # Home-Manager Module diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index 5d0e429..72bfb41 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -13,6 +13,8 @@ ../../modules/services/avahi.nix ../../modules/virtualization/docker.nix ../../modules/virtualization/qemu.nix + ../../modules/programs/games.nix + ../../modules/services/easyeffects.nix ]; boot = { @@ -51,6 +53,7 @@ simple-scan # Scanning easyeffects firefox + heroic ]; }; } diff --git a/modules/desktops/hyprland.nix b/modules/desktops/hyprland.nix index eb28bbc..0da34c1 100644 --- a/modules/desktops/hyprland.nix +++ b/modules/desktops/hyprland.nix @@ -11,6 +11,7 @@ hyprland, vars, host, + split-monitor-workspaces, ... }: with lib; @@ -31,21 +32,61 @@ with host; { slurp # Region Selector wl-clipboard # Clipboard wlr-randr # Monitor Settings + dunst + hyprpaper + waybar ]; + # sessionVariables = { + # "NIXOS_OZONE_WL" = "1"; # for any ozone-based browser & electron apps to run on wayland + # "MOZ_ENABLE_WAYLAND" = "1"; # for firefox to run on wayland + # "MOZ_WEBRENDER" = "1"; + # + # # for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/ + # "LIBVA_DRIVER_NAME" = "nvidia"; + # "XDG_SESSION_TYPE" = "wayland"; + # "GBM_BACKEND" = "nvidia-drm"; + # "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; + # "WLR_NO_HARDWARE_CURSORS" = "1"; + # "WLR_EGL_NO_MODIFIRES" = "1"; + # }; }; programs = { hyprland = { # Window Manager enable = true; - package = hyprland.packages.${pkgs.system}.hyprland; - nvidiaPatches = + xwayland.enable = true; + enableNvidiaPatches = if hostName == "desktop" then true else false; }; }; + hardware = { + opengl.enable = true; + nvidia.nvidiaSettings = true; + }; + + xdg.portal = { + enable = true; + extraPortals = with pkgs; [xdg-desktop-portal-gtk]; + }; + + home-manager.users.${vars.user} = { + imports = [hyprland.homeManagerModules.default]; + wayland.windowManager.hyprland = { + enable = true; + systemdIntegration = true; + extraConfig = '' + bind = SUPER, RETURN, exec, alacritty + ''; + plugins = [ + split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces + ]; + }; + }; + nix.settings = { substituters = ["https://hyprland.cachix.org"]; trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; diff --git a/modules/services/easyeffects.nix b/modules/services/easyeffects.nix new file mode 100644 index 0000000..36c45de --- /dev/null +++ b/modules/services/easyeffects.nix @@ -0,0 +1,11 @@ +{ + config, + lib, + pkgs, + vars, + ... +}: { + home-manager.users.${vars.user} = { + services.easyeffects.enable = true; + }; +} diff --git a/modules/shell/default.nix b/modules/shell/default.nix new file mode 100644 index 0000000..26dca0f --- /dev/null +++ b/modules/shell/default.nix @@ -0,0 +1,4 @@ +[ + ./git.nix + ./fish.nix +] diff --git a/modules/shell/fish.nix b/modules/shell/fish.nix new file mode 100644 index 0000000..3ef65f5 --- /dev/null +++ b/modules/shell/fish.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + pkgs, + vars, + ... +}: { + home-manager.users.${vars.user} = { + programs.fish = { + enable = true; + interactiveShellInit = '' + nix-your-shell fish | source + set fish_greeting + ''; + shellAliases = { + lzg = "lazygit"; + lzd = "lazydocker"; + }; + }; + }; +} diff --git a/modules/shell/git.nix b/modules/shell/git.nix new file mode 100644 index 0000000..8ab1d35 --- /dev/null +++ b/modules/shell/git.nix @@ -0,0 +1,15 @@ +{ + config, + lib, + pkgs, + vars, + ... +}: { + home-manager.users.${vars.user} = { + programs.git = { + enable = true; + userName = "GHOSCHT"; + userEmail = "31184695+GHOSCHT@users.noreply.github.com"; + }; + }; +} diff --git a/nix/home.nix b/nix/home.nix new file mode 100644 index 0000000..3f49236 --- /dev/null +++ b/nix/home.nix @@ -0,0 +1,29 @@ +{ + lib, + inputs, + nixpkgs, + home-manager, + hyprland, + split-monitor-workspaces, + vars, + ... +}: let + system = "x86_64-linux"; # System Architecture + pkgs = nixpkgs.legacyPackages.${system}; +in { + pacman = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = {inherit inputs vars hyprland;}; + modules = [ + # Modules Used + { + home = { + username = "${vars.user}"; + homeDirectory = "/home/${vars.user}"; + packages = [pkgs.home-manager]; + stateVersion = "23.05"; + }; + } + ]; + }; +}