diff --git a/flake.lock b/flake.lock index 55c8dc4..33d949a 100644 --- a/flake.lock +++ b/flake.lock @@ -108,18 +108,60 @@ "type": "github" } }, - "nixpkgs": { + "hyprland": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "nixpkgs": "nixpkgs", + "wlroots": "wlroots", + "xdph": "xdph" + }, "locked": { - "lastModified": 1675918889, - "narHash": "sha256-hy7re4F9AEQqwZxubct7jBRos6md26bmxnCjxf5utJA=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "49efda9011e8cdcd6c1aad30384cb1dc230c82fe", + "lastModified": 1676066608, + "narHash": "sha256-wUfFD5kZ4+MSX92Zruy/W64m7E5CzORfiVdLOuyJ15o=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "bda8208aaa3d7eb9f14d49691b919f8f2e9f5594", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-22.11", + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1671839510, + "narHash": "sha256-+PY1qqJfmZzzROgcIY4I7AkCwpnC+qBIYk2eFoA9RWc=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "b8f55e02a328c47ed373133c52483bbfa20a1b75", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1675273418, + "narHash": "sha256-tpYc4TEGvDzh9uRf44QemyQ4TpVuUbxb07b2P99XDbM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4d7c2644dbac9cf8282c0afe68fca8f0f3e7b2db", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -173,6 +215,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1675918889, + "narHash": "sha256-hy7re4F9AEQqwZxubct7jBRos6md26bmxnCjxf5utJA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "49efda9011e8cdcd6c1aad30384cb1dc230c82fe", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1671271357, "narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=", @@ -188,7 +246,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1675523619, "narHash": "sha256-jHvkAwkbAj1s0O5riHMghSDHh9iz8AwLTbXQuVQKQcg=", @@ -224,7 +282,7 @@ "flake-compat": "flake-compat", "flake-utils": "flake-utils_2", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -246,7 +304,8 @@ "darwin": "darwin", "flake-utils": "flake-utils", "home-manager": "home-manager", - "nixpkgs": "nixpkgs", + "hyprland": "hyprland", + "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", "pre-commit-hooks": "pre-commit-hooks", @@ -255,7 +314,7 @@ }, "sops": { "inputs": { - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { @@ -286,6 +345,49 @@ "repo": "flake-utils", "type": "github" } + }, + "wlroots": { + "flake": false, + "locked": { + "host": "gitlab.freedesktop.org", + "lastModified": 1675374853, + "narHash": "sha256-BSrjNcddYWhFUMtjGwxiEXw67MYRaIHGvLn19Mvm1NE=", + "owner": "wlroots", + "repo": "wlroots", + "rev": "677a3f2f8847ed2de49dd60868f9d9487a546f58", + "type": "gitlab" + }, + "original": { + "host": "gitlab.freedesktop.org", + "owner": "wlroots", + "repo": "wlroots", + "type": "gitlab" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1673116118, + "narHash": "sha256-eR0yDSkR2XYMesfdRWJs25kAdXET2mbNNHu5t+KUcKA=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "d479c846531fd0e1d2357c9588b8310a2b859ef2", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 90e2383..005a177 100644 --- a/flake.nix +++ b/flake.nix @@ -20,17 +20,20 @@ # dev pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; flake-utils.url = "github:numtide/flake-utils"; + + hyprland.url = "github:hyprwm/Hyprland"; }; outputs = { self, darwin, - home-manager, flake-utils, - pre-commit-hooks, + home-manager, + hyprland, nixpkgs, nixpkgs-unstable, nur, + pre-commit-hooks, sops, ... }: let @@ -62,6 +65,7 @@ extraSpecialArgs = { nur = nur.nixosModules.nur; sops = sops.homeManagerModules.sops; + hyprland = hyprland.homeManagerModules.default; flakePath = "/home/winston/.config/nixpkgs"; machine.personal = true; }; diff --git a/home.nix b/home.nix index 6c99abb..a777a3c 100644 --- a/home.nix +++ b/home.nix @@ -5,6 +5,7 @@ pkgs, sops, machine, + hyprland, ... }: let inherit (pkgs.stdenv.hostPlatform) isLinux; @@ -12,30 +13,30 @@ in { imports = [ + hyprland nur sops ./catppuccin ./modules/firefox.nix ./modules/git.nix ./modules/gpg.nix + ./modules/hyprland.nix ./modules/i3.nix ./modules/kubernetes.nix ./modules/mail.nix ./modules/music.nix ./modules/neovim.nix ./modules/newsboat.nix + ./modules/rice.nix ./modules/sops.nix ./modules/vscode.nix ./modules/wezterm.nix ./modules/zsh.nix ] - ++ lib.optionals (builtins.pathExists ./modules/secrets.nix) [ - # hotfix: use fucking git-secret, this is atrocious beyond belief - ./modules/secrets.nix - ]; + ++ lib.optionals (builtins.pathExists ./modules/secrets.nix) [./modules/secrets.nix]; catppuccin = { - defaultTheme = "frappe"; + defaultTheme = "mocha"; bat.enable = true; btop.enable = true; dircolors.enable = true; @@ -75,7 +76,7 @@ in { ] ++ lib.optionals (isLinux && machine.personal) [ discover-overlay - unstable.discord + (unstable.discord.override {withOpenASAR = true;}) lutris ]); diff --git a/machines/futomaki/default.nix b/machines/futomaki/default.nix index 6d6207d..5da412c 100644 --- a/machines/futomaki/default.nix +++ b/machines/futomaki/default.nix @@ -64,14 +64,16 @@ in { time.timeZone = "Europe/Vienna"; i18n.defaultLocale = "en_US.UTF-8"; - programs.dconf.enable = true; - programs.steam.enable = true; - programs.thunar = { - enable = true; - plugins = with pkgs.xfce; [ - thunar-archive-plugin - thunar-volman - ]; + programs = { + dconf.enable = true; + steam.enable = true; + thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-volman + ]; + }; }; security.polkit.enable = true; diff --git a/modules/hyprland.nix b/modules/hyprland.nix new file mode 100644 index 0000000..7dbc633 --- /dev/null +++ b/modules/hyprland.nix @@ -0,0 +1,28 @@ +{ + config, + flakePath, + lib, + pkgs, + ... +}: let + inherit (pkgs.stdenv.hostPlatform) isLinux; + nvidiaPrefix = "GDM_BACKEND=nvidia-drm LIBVA_DRIVER_NAME=nvidia __GLX_VENDOR_LIBRARY_NAME=nvidia WLR_NO_HARDWARE_CURSORS=1"; + waylandPrefix = "XDG_SESSION_TYPE=wayland NIXOS_OZONE_WL=1"; +in { + home.shellAliases = lib.mkIf isLinux { + "Hyprland" = "${nvidiaPrefix} ${waylandPrefix} Hyprland"; + }; + wayland = lib.mkIf isLinux { + windowManager.hyprland = { + enable = true; + nvidiaPatches = true; + xwayland = { + enable = true; + hidpi = true; + }; + }; + }; + xdg = lib.mkIf isLinux { + configFile."hypr/hyprland.conf".source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/modules/hyprland/hyprland.conf"; + }; +} diff --git a/modules/hyprland/hyprland.conf b/modules/hyprland/hyprland.conf new file mode 100644 index 0000000..c509fc2 --- /dev/null +++ b/modules/hyprland/hyprland.conf @@ -0,0 +1,72 @@ +monitor = ,5120x2160@72,0x0,1.5 + +input:follow_mouse = 1 + +general { + sensitivity = 1.0 # for mouse cursor + + gaps_in = 5 + gaps_out = 10 + border_size = 2 + no_cursor_warps = true + col.active_border = 0xfff5c2e7 + col.inactive_border = 0x80cba6f7 + + apply_sens_to_raw = 0 # whether to apply the sensitivity to raw input (e.g. used by games where you aim using your mouse) +} + +decoration { + rounding = 10 + blur = 0 +} + +animations { + enabled = 1 + animation = workspaces,1,1,default,slide +} + +misc { + disable_hyprland_logo = true + disable_splash_rendering = true +} + +# example binds +bind = SUPER_SHIFT,return,exec,wezterm +bind = SUPER_SHIFT,q,killactive, +bind = SUPER_SHIFT,M,exit, +bind = SUPER_SHIFT,d,togglefloating, +bind = SUPER,space,exec,rofi -show drun + +bind = SUPER_CTRL,l,movefocus,l +bind = SUPER_CTRL,h,movefocus,r +bind = SUPER_CTRL,k,movefocus,u +bind = SUPER_CTRL,j,movefocus,d +bind = SUPER_SHIFT,h,movewindow,l +bind = SUPER_SHIFT,l,movewindow,r +bind = SUPER_SHIFT,j,movewindow,u +bind = SUPER_SHIFT,k,movewindow,d + +bind = SUPER_CTRL,1,workspace,1 +bind = SUPER_CTRL,2,workspace,2 +bind = SUPER_CTRL,3,workspace,3 +bind = SUPER_CTRL,4,workspace,4 +bind = SUPER_CTRL,5,workspace,5 +bind = SUPER_CTRL,6,workspace,6 +bind = SUPER_CTRL,7,workspace,7 +bind = SUPER_CTRL,8,workspace,8 +bind = SUPER_CTRL,9,workspace,9 +bind = SUPER_CTRL,0,workspace,10 + +bind = SUPER_SHIFT,1,movetoworkspace,1 +bind = SUPER_SHIFT,2,movetoworkspace,2 +bind = SUPER_SHIFT,3,movetoworkspace,3 +bind = SUPER_SHIFT,4,movetoworkspace,4 +bind = SUPER_SHIFT,5,movetoworkspace,5 +bind = SUPER_SHIFT,6,movetoworkspace,6 +bind = SUPER_SHIFT,7,movetoworkspace,7 +bind = SUPER_SHIFT,8,movetoworkspace,8 +bind = SUPER_SHIFT,9,movetoworkspace,9 +bind = SUPER_SHIFT,0,movetoworkspace,10 + +bindm = SUPER,mouse:272,movewindow +bindm = SUPER,mouse:273,resizewindow diff --git a/modules/i3.nix b/modules/i3.nix index f15a63d..71d226e 100644 --- a/modules/i3.nix +++ b/modules/i3.nix @@ -9,6 +9,7 @@ in { home = lib.mkIf isLinux { packages = with pkgs; [ + arandr blueberry libnotify noisetorch @@ -16,42 +17,7 @@ in { ]; }; - gtk = lib.mkIf isLinux { - enable = true; - - cursorTheme = { - name = "Catppuccin-Mocha-Cursors"; - package = pkgs.catppuccin-cursors.mochaPink; - }; - iconTheme = { - package = pkgs.papirus-folders-catppuccin.override { - flavour = "mocha"; - accent = "pink"; - }; - name = "Papirus-Dark"; - }; - theme = { - name = "Catppuccin-Mocha-Standard-Pink-Dark"; - package = pkgs.unstable.catppuccin-gtk; - }; - - gtk2.extraConfig = '' - gtk-xft-antialias=1 - gtk-xft-hinting=1 - gtk-xft-hintstyle="hintslight" - gtk-xft-rgba="rgb" - ''; - gtk3.extraConfig = { - gtk-xft-antialias = 1; - gtk-xft-hinting = 1; - gtk-xft-hintstyle = "hintslight"; - gtk-xft-rgba = "rgb"; - }; - }; - programs = lib.mkIf isLinux { - autorandr.enable = true; - i3status-rust = { enable = true; bars.default = { @@ -95,14 +61,6 @@ in { }; }; }; - - rofi = { - enable = true; - font = "Berkeley Mono 14"; - extraConfig.icon-theme = "Papirus-Dark"; - terminal = "${lib.getExe pkgs.wezterm}"; - theme = ./rofi/theme.rasi; - }; }; services = lib.mkIf isLinux { @@ -177,11 +135,9 @@ in { }; xdg = lib.mkIf isLinux { - configFile = { - "i3" = { - source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/modules/i3"; - recursive = true; - }; + configFile."i3" = { + source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/modules/i3"; + recursive = true; }; }; } diff --git a/modules/neovim/after/plugin/neogit.lua b/modules/neovim/after/plugin/neogit.lua new file mode 100644 index 0000000..90a420c --- /dev/null +++ b/modules/neovim/after/plugin/neogit.lua @@ -0,0 +1,5 @@ +local present, neogit = pcall(require, "neogit") + +if not present then + return +end diff --git a/modules/neovim/init.lua b/modules/neovim/init.lua index d577a9e..e05dd74 100644 --- a/modules/neovim/init.lua +++ b/modules/neovim/init.lua @@ -32,6 +32,7 @@ vim.o.tabstop = 2 vim.o.softtabstop = 0 vim.o.expandtab = true vim.o.signcolumn = "yes:1" +vim.opt.shortmess:append("sI") -- double box drawing characters for splits vim.opt.fillchars:append({ horiz = "═", diff --git a/modules/rice.nix b/modules/rice.nix new file mode 100644 index 0000000..f8f35e5 --- /dev/null +++ b/modules/rice.nix @@ -0,0 +1,49 @@ +{ + lib, + pkgs, + ... +}: let + inherit (pkgs.stdenv.hostPlatform) isLinux; +in { + gtk = lib.mkIf isLinux { + enable = true; + + cursorTheme = { + name = "Catppuccin-Mocha-Cursors"; + package = pkgs.catppuccin-cursors.mochaPink; + }; + iconTheme = { + package = pkgs.papirus-folders-catppuccin.override { + flavour = "mocha"; + accent = "pink"; + }; + name = "Papirus-Dark"; + }; + theme = { + name = "Catppuccin-Mocha-Standard-Pink-Dark"; + package = pkgs.unstable.catppuccin-gtk; + }; + + gtk2.extraConfig = '' + gtk-xft-antialias=1 + gtk-xft-hinting=1 + gtk-xft-hintstyle="hintslight" + gtk-xft-rgba="rgb" + ''; + gtk3.extraConfig = { + gtk-xft-antialias = 1; + gtk-xft-hinting = 1; + gtk-xft-hintstyle = "hintslight"; + gtk-xft-rgba = "rgb"; + }; + }; + + programs.rofi = lib.mkIf isLinux { + enable = true; + package = pkgs.rofi-wayland; + font = "Berkeley Mono 14"; + extraConfig.icon-theme = "Papirus-Dark"; + terminal = "${lib.getExe pkgs.wezterm}"; + theme = ./rofi/theme.rasi; + }; +} diff --git a/modules/wezterm.nix b/modules/wezterm.nix index 2fa9ec5..efcea87 100644 --- a/modules/wezterm.nix +++ b/modules/wezterm.nix @@ -3,10 +3,8 @@ flakePath, ... }: { - xdg.configFile = { - "wezterm" = { - source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/modules/wezterm"; - recursive = true; - }; + xdg.configFile."wezterm" = { + source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/modules/wezterm"; + recursive = true; }; }