From d6cfb5e828b12b42662e63deecf4946269176811 Mon Sep 17 00:00:00 2001 From: winston Date: Wed, 8 Mar 2023 08:52:23 +0100 Subject: [PATCH] feat: reinit wayland --- flake.lock | 122 +++++++++++++++++++++++++++++--- flake.nix | 5 +- home/apps/i3.nix | 3 +- home/apps/neovim/lazy-lock.json | 28 ++++---- home/apps/rice.nix | 1 + home/apps/waybar/config | 51 +++++++++++++ home/apps/waybar/style.css | 36 ++++++++++ home/apps/wayland.nix | 115 ++++++++++++++++++++++++++++++ home/default.nix | 1 + home/xdg.nix | 7 ++ machines/common/default.nix | 3 + machines/common/hyprland.nix | 17 +++++ machines/futomaki/default.nix | 1 + 13 files changed, 364 insertions(+), 26 deletions(-) create mode 100644 home/apps/waybar/config create mode 100644 home/apps/waybar/style.css create mode 100644 home/apps/wayland.nix create mode 100644 machines/common/hyprland.nix diff --git a/flake.lock b/flake.lock index 3abbc58..d4f2fdd 100644 --- a/flake.lock +++ b/flake.lock @@ -108,6 +108,48 @@ "type": "github" } }, + "hyprland": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "nixpkgs": "nixpkgs", + "wlroots": "wlroots", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1678199050, + "narHash": "sha256-4U0UDjSKcFgThNDY3JRf0D98sB4dqOiqqlbTGpKJ6hE=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "a85a6fa6c8ff9e51ba774cec112b408bce601451", + "type": "github" + }, + "original": { + "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" + } + }, "nekowinston-nur": { "inputs": { "nixpkgs": [ @@ -130,16 +172,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1678072060, - "narHash": "sha256-6a9Tbjhir5HxDx4uw0u6Z+LHUfYf7tsT9QxF9FN/32w=", - "owner": "nixos", + "lastModified": 1677676435, + "narHash": "sha256-6FxdcmQr5JeZqsQvfinIMr0XcTyTuR7EXX0H3ANShpQ=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "47c003416297e4d59a5e3e7a8b15cdbdf5110560", + "rev": "a08d6979dd7c82c4cef0dcc6ac45ab16051c1169", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-22.11", + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -193,6 +235,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1678072060, + "narHash": "sha256-6a9Tbjhir5HxDx4uw0u6Z+LHUfYf7tsT9QxF9FN/32w=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "47c003416297e4d59a5e3e7a8b15cdbdf5110560", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1671271357, "narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=", @@ -208,7 +266,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1677852945, "narHash": "sha256-liiVJjkBTuBTAkRW3hrI8MbPD2ImYzwUpa7kvteiKhM=", @@ -244,7 +302,7 @@ "flake-compat": "flake-compat", "flake-utils": "flake-utils_2", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -266,8 +324,9 @@ "darwin": "darwin", "flake-utils": "flake-utils", "home-manager": "home-manager", + "hyprland": "hyprland", "nekowinston-nur": "nekowinston-nur", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", "pre-commit-hooks": "pre-commit-hooks", @@ -276,7 +335,7 @@ }, "sops": { "inputs": { - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { @@ -307,6 +366,49 @@ "repo": "flake-utils", "type": "github" } + }, + "wlroots": { + "flake": false, + "locked": { + "host": "gitlab.freedesktop.org", + "lastModified": 1677789111, + "narHash": "sha256-dWrk+Q3bLdtFe5rkyaAKWCQJCeE/KFNllcu1DvBC38c=", + "owner": "wlroots", + "repo": "wlroots", + "rev": "5ae17de23f5fd9bb252a698f3771c840280e2c05", + "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 70a809f..90ccb98 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,7 @@ nekowinston-nur.url = "github:nekowinston/nur"; nekowinston-nur.inputs.nixpkgs.follows = "nixpkgs-unstable"; sops.url = "github:Mic92/sops-nix"; + hyprland.url = "github:hyprwm/Hyprland"; # dev pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; @@ -29,6 +30,7 @@ darwin, flake-utils, home-manager, + hyprland, nekowinston-nur, nixpkgs, nixpkgs-unstable, @@ -59,12 +61,13 @@ system = "x86_64-linux"; modules = [ home-manager.nixosModules.home-manager + hyprland.nixosModules.default ./machines/common ./machines/futomaki ({config, ...}: { config = { - nixpkgs.overlays = [overlays]; + nixpkgs.overlays = [overlays hyprland.outputs.overlays.default]; home-manager = { useGlobalPkgs = true; sharedModules = [sops.homeManagerModules.sops]; diff --git a/home/apps/i3.nix b/home/apps/i3.nix index 73e402d..12f717b 100644 --- a/home/apps/i3.nix +++ b/home/apps/i3.nix @@ -66,6 +66,7 @@ in { }; }; }; + zathura.enable = true; }; services = lib.mkIf isLinux { @@ -262,7 +263,7 @@ in { "${modMove}+9" = "move container to workspace $ws9; workspace $ws9"; "${modMove}+0" = "move container to workspace $ws10; workspace $ws10"; # rofi instead of drun - "${mod}+space" = "exec --no-startup-id ${lib.getExe config.programs.rofi.package} -show drun -dpi $dpi"; + "${mod}+space" = "exec --no-startup-id ${rofi} -show drun -dpi $dpi"; # 1password "${mod}+Shift+space" = "exec ${lib.getExe pkgs._1password-gui} --quick-access"; diff --git a/home/apps/neovim/lazy-lock.json b/home/apps/neovim/lazy-lock.json index 088c8ca..f1fe634 100644 --- a/home/apps/neovim/lazy-lock.json +++ b/home/apps/neovim/lazy-lock.json @@ -2,7 +2,7 @@ "asyncrun.vim": { "branch": "master", "commit": "80750a80e7999318f14d754bb68b64de7af93bc3" }, "asynctasks.vim": { "branch": "master", "commit": "784a4b1f75a913cc6c43dd6c4dbe69d648dbbfa5" }, "auto-dark-mode.nvim": { "branch": "master", "commit": "9a7515c180c73ccbab9fce7124e49914f88cd763" }, - "barbecue": { "branch": "main", "commit": "23348f3979912fb36a1442fb0d07e8d2e739aea2" }, + "barbecue": { "branch": "main", "commit": "65df9a7d51f11df6bd4f8bd9f0d8b378e92bb9b0" }, "bufferline.nvim": { "branch": "main", "commit": "3677aceb9a72630b0613e56516c8f7151b86f95c" }, "catppuccin": { "branch": "main", "commit": "5e2c9cf8277c42fb634007126c36d765fd176f4a" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, @@ -18,38 +18,38 @@ "feline.nvim": { "branch": "master", "commit": "d48b6f92c6ccdd6654c956f437be49ea160b5b0c" }, "fidget.nvim": { "branch": "main", "commit": "688b4fec4517650e29c3e63cfbb6e498b3112ba1" }, "friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" }, - "gitsigns.nvim": { "branch": "main", "commit": "3b6c0a6412b31b91eb26bb8f712562cf7bb1d3be" }, + "gitsigns.nvim": { "branch": "main", "commit": "b1f9cf7c5c5639c006c937fc1819e09f358210fc" }, "go.nvim": { "branch": "master", "commit": "1844fd11a143aba3eec644c2e2099a20f79c1ec1" }, "guihua.lua": { "branch": "master", "commit": "a19ac4447021f21383fadd7a9e1fc150d0b67e1f" }, "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" }, - "lazy.nvim": { "branch": "main", "commit": "e89acede13f46a5db229133cf0c87aee74938c56" }, + "lazy.nvim": { "branch": "main", "commit": "5b4444f0d7e556deba3f7ca949a2ba0e2c3369fb" }, "lightspeed.nvim": { "branch": "main", "commit": "299eefa6a9e2d881f1194587c573dad619fdb96f" }, "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, "ltex-extra.nvim": { "branch": "master", "commit": "1d2f288ceedc70d5a9c00f55c0d0cc788b5164f2" }, "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, - "neogit": { "branch": "master", "commit": "85380916cec322b1351785cac4f4e3f24de36b2a" }, - "null-ls.nvim": { "branch": "main", "commit": "456cd2754c56c991c5e4df60a807d054c1bc7148" }, - "nvim-autopairs": { "branch": "master", "commit": "ab49517cfd1765b3f3de52c1f0fda6190b44e27b" }, + "neogit": { "branch": "master", "commit": "7be1e9358aaa617b0391e61952d936203e99fcf0" }, + "null-ls.nvim": { "branch": "main", "commit": "900c38cfa91eb7ff2716da70f2f2c1d33741cf0a" }, + "nvim-autopairs": { "branch": "master", "commit": "e755f366721bc9e189ddecd39554559045ac0a18" }, "nvim-cmp": { "branch": "main", "commit": "feed47fd1da7a1bad2c7dca456ea19c8a5a9823a" }, "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" }, - "nvim-dap": { "branch": "master", "commit": "c1bfcd89ef440a44d02ade7e71befb1e5aa358ca" }, + "nvim-dap": { "branch": "master", "commit": "75a94b8b577a970c0cad25a54a64dc40fc6fa0ea" }, "nvim-dap-ui": { "branch": "master", "commit": "bdb94e3853d11b5ce98ec182e5a3719d5c0ef6fd" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "8db23ea51203b5f00ad107a0cef7e0b2d7a0476c" }, - "nvim-lspconfig": { "branch": "master", "commit": "1a2d5f5224c65b0709bf5da0ccd9cad29272083a" }, + "nvim-lspconfig": { "branch": "master", "commit": "f3e6c034d103e3476821af596a67df71d76f85a9" }, "nvim-navic": { "branch": "master", "commit": "cdd24539bcf114a499827e9b32869fe74836efe7" }, - "nvim-surround": { "branch": "main", "commit": "8680311f6de05d45b010883db7cc1912b7f0d0e4" }, + "nvim-surround": { "branch": "main", "commit": "1ac5abf6b6c9fdfbf4d793b9bf3a3b0938c6faf3" }, "nvim-tree.lua": { "branch": "master", "commit": "bbb6d4891009de7dab05ad8fc2d39f272d7a751c" }, - "nvim-treesitter": { "branch": "master", "commit": "980f0816cc28c20e45715687a0a21b5b39af59eb" }, + "nvim-treesitter": { "branch": "master", "commit": "ba4bce9bb79f5a5fb2e7b5a6b9b4b0fb256f3db9" }, "nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" }, - "nvim-ts-rainbow2": { "branch": "master", "commit": "293e12e90f0928845582b9a3db7258eaa8e92a65" }, - "nvim-web-devicons": { "branch": "master", "commit": "b2060eac2fbc84e0637ea706378ff66451e7c424" }, + "nvim-ts-rainbow2": { "branch": "master", "commit": "6bcb1472c321a15eef5a7a015b4fefa8758e6513" }, + "nvim-web-devicons": { "branch": "master", "commit": "4af94fec29f508159ceab5413383e5dedd6c24e3" }, "octo.nvim": { "branch": "master", "commit": "ab5dbe20dc276348019676e5c3e97cb391e46b1b" }, "playground": { "branch": "master", "commit": "4044b53c4d4fcd7a78eae20b8627f78ce7dc6f56" }, "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "py_lsp.nvim": { "branch": "main", "commit": "5b2bd6433a2dbab76d54d58ccc1d1e89b220091c" }, "rust-tools.nvim": { "branch": "master", "commit": "71d2cf67b5ed120a0e31b2c8adb210dd2834242f" }, - "schemastore.nvim": { "branch": "main", "commit": "809c05360a0dabfc018093a090045d292d362ef4" }, + "schemastore.nvim": { "branch": "main", "commit": "9538a2c7ed15ca9e42908e3665cece0d5020cac8" }, "stabilize.nvim": { "branch": "master", "commit": "34069870a8e72632c5447188e638e1c6bfebc353" }, "telescope-asynctasks.nvim": { "branch": "main", "commit": "065300fb0a8ba6a1c81991da1873c73e136dcdc0" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "61b3769065131129716974f7fb63f82ee409bd80" }, @@ -63,7 +63,7 @@ "vim-dadbod": { "branch": "master", "commit": "389a2b0120f82b13d51ff7c07f5c13f9bc9f412f" }, "vim-dadbod-completion": { "branch": "master", "commit": "e71eb6140556c5ced80de6299a1fdfe22bd3c1b1" }, "vim-dadbod-ui": { "branch": "master", "commit": "caf45f54dad6150970331ac115e531524e418c7c" }, - "vim-fugitive": { "branch": "master", "commit": "caf1bc99b63a80cc3a35cc9d05320dfa75d7ebfa" }, + "vim-fugitive": { "branch": "master", "commit": "9b72d0c7c8db2367b55f61b387d4edbab7cb5791" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, "vim-helm": { "branch": "master", "commit": "c2e7b85711d410e1d73e64eb5df7b70b1c4c10eb" }, "vim-just": { "branch": "master", "commit": "838c9096d4c5d64d1000a6442a358746324c2123" }, diff --git a/home/apps/rice.nix b/home/apps/rice.nix index d98ef2a..7183b9f 100644 --- a/home/apps/rice.nix +++ b/home/apps/rice.nix @@ -45,6 +45,7 @@ in { programs.rofi = lib.mkIf isLinux { enable = true; + package = pkgs.rofi-wayland; font = "Berkeley Mono 14"; extraConfig.icon-theme = "Papirus-Dark"; terminal = "wezterm"; diff --git a/home/apps/waybar/config b/home/apps/waybar/config new file mode 100644 index 0000000..2c642fd --- /dev/null +++ b/home/apps/waybar/config @@ -0,0 +1,51 @@ +// vim:ft=jsonc +{ + "layer": "top", + "position": "top", + "height": 32, + "spacing": 4, + "modules-left": ["wlr/workspaces"], + "modules-center": [ + "hyprland/window" + ], + "modules-right": [ + "tray", + "idle_inhibitor", + "pulseaudio", + "clock" + ], + "wlr/workspaces": { + "format": "{icon}", + "on-click": "activate", + "format-icons": { + "1": "Ⅰ", + "2": "Ⅱ", + "3": "Ⅲ", + "4": "Ⅳ", + "5": "Ⅴ", + "6": "Ⅵ", + "7": "Ⅶ", + "8": "Ⅷ", + "9": "Ⅸ", + "10": "Ⅹ" + }, + "sort-by-number": true + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "鈴" + } + }, + "tray": { + "spacing": 10 + }, + "pulseaudio": { + "format": "{icon} {volume}%", + "format-icons": { + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + } +} diff --git a/home/apps/waybar/style.css b/home/apps/waybar/style.css new file mode 100644 index 0000000..b8a016d --- /dev/null +++ b/home/apps/waybar/style.css @@ -0,0 +1,36 @@ +* { + font-family: Symbols Nerd Font, Berkeley Mono; + font-size: 16px; + color: #cdd6f4; +} + +window#waybar { + background-color: #000; +} + +#workspaces button { + padding: 0 5px; + border-radius: 0; +} + +#workspaces button:hover { + background: #313244; +} + +#workspaces button.active { + color: #f5c2e7; + background: #585b70; + box-shadow: inset 0 -3px #f5c2e7; +} + +#workspaces button.urgent { + background-color: #f38ba8; +} + +#clock, +#network, +#pulseaudio, +#tray, +#idle_inhibitor { + padding: 0 10px; +} diff --git a/home/apps/wayland.nix b/home/apps/wayland.nix new file mode 100644 index 0000000..17db4a7 --- /dev/null +++ b/home/apps/wayland.nix @@ -0,0 +1,115 @@ +{ + config, + flakePath, + inputs, + lib, + pkgs, + ... +}: let + inherit (pkgs.stdenv.hostPlatform) isLinux; + waybarLauncher = pkgs.writeShellScriptBin "waybar-launcher" (let + killall = lib.getExe pkgs.killall; + inotifywait = pkgs.inotify-tools + "/bin/inotifywait"; + in '' + #!/bin/sh + trap "${killall} .waybar-wrapped" EXIT + while true; do + waybar & + ${inotifywait} -e create,modify "$HOME/.config/waybar/config" "$HOME/.config/waybar/style.css" + ${killall} .waybar-wrapped + done + ''); +in { + programs.waybar = lib.mkIf isLinux { + enable = true; + package = pkgs.waybar-hyprland; + }; + + xdg = lib.mkIf isLinux { + configFile."waybar" = { + source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/waybar"; + recursive = true; + }; + + configFile."hypr/hyprland.conf".text = let + playerctl = lib.getExe pkgs.playerctl; + wpctl = pkgs.wireplumber + "/bin/wpctl"; + in '' + monitor = ,5120x2160@72,0x0,1.5 + + input:follow_mouse = 1 + + general { + gaps_in = 5 + gaps_out = 5 + border_size = 2 + no_cursor_warps = true + col.active_border = 0xfff5c2e7 + col.inactive_border = 0x80cba6f7 + } + + decoration { + rounding = 5 + blur = 0 + } + + animations { + enabled = 1 + animation = workspaces,1,1,default,slide + } + + misc { + disable_hyprland_logo = true + disable_splash_rendering = true + } + + 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 + + binde = ,XF86AudioRaiseVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.0 + binde = ,XF86AudioLowerVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 1.0 + bind = ,XF86AudioMute,exec,${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle + bind = ,XF86AudioNext,exec,${playerctl} next + bind = ,XF86AudioPrev,exec,${playerctl} previous + bind = ,XF86AudioPause,exec,${playerctl} play-pause + exec-once = ${waybarLauncher}/bin/waybar-launcher + ''; + }; +} diff --git a/home/default.nix b/home/default.nix index 36ee447..fc64cac 100644 --- a/home/default.nix +++ b/home/default.nix @@ -23,6 +23,7 @@ in { ./apps/sketchybar.nix ./apps/vscode.nix ./apps/wezterm.nix + ./apps/wayland.nix ./apps/zsh.nix ./secrets/sops.nix ./xdg.nix diff --git a/home/xdg.nix b/home/xdg.nix index 2d6cef4..96bb818 100644 --- a/home/xdg.nix +++ b/home/xdg.nix @@ -39,5 +39,12 @@ in { cacheHome = "${config.home.homeDirectory}/.cache"; configHome = "${config.home.homeDirectory}/.config"; dataHome = "${config.home.homeDirectory}/.local/share"; + mimeApps = { + enable = isLinux; + defaultApplications = { + "inode/directory" = "thunar.desktop"; + "application/pdf" = "zathura.desktop"; + }; + }; }; } diff --git a/machines/common/default.nix b/machines/common/default.nix index 5c98697..9f0e6d0 100644 --- a/machines/common/default.nix +++ b/machines/common/default.nix @@ -11,13 +11,16 @@ auto-optimise-store = true; substituters = [ "https://catppuccin.cachix.org" + "https://hyprland.cachix.org" "https://mic92.cachix.org" "https://nekowinston.cachix.org" "https://nix-community.cachix.org" "https://pre-commit-hooks.cachix.org" ]; + # configuration.nix trusted-public-keys = [ "catppuccin.cachix.org-1:noG/4HkbhJb+lUAdKrph6LaozJvAeEEZj4N732IysmU=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "mic92.cachix.org-1:gi8IhgiT3CYZnJsaW7fxznzTkMUOn1RY4GmXdT/nXYQ=" "nekowinston.cachix.org-1:lucpmaO+JwtoZj16HCO1p1fOv68s/RL1gumpVzRHRDs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" diff --git a/machines/common/hyprland.nix b/machines/common/hyprland.nix new file mode 100644 index 0000000..1e12f12 --- /dev/null +++ b/machines/common/hyprland.nix @@ -0,0 +1,17 @@ +let + nvidiaPrefix = "GDM_BACKEND=nvidia-drm LIBVA_DRIVER_NAME=nvidia __GLX_VENDOR_LIBRARY_NAME=nvidia WLR_NO_HARDWARE_CURSORS=1"; +in { + environment.shellAliases = { + nvidia = "${nvidiaPrefix} Hyprland"; + }; + programs.hyprland = { + enable = true; + xwayland = { + enable = true; + hidpi = true; + }; + nvidiaPatches = true; + }; + xdg.portal.enable = true; + xdg.portal.wlr.enable = true; +} diff --git a/machines/futomaki/default.nix b/machines/futomaki/default.nix index 5d9e29e..fec4251 100644 --- a/machines/futomaki/default.nix +++ b/machines/futomaki/default.nix @@ -8,6 +8,7 @@ in { imports = [ ./hardware.nix ../common/linux + ../common/hyprland.nix ]; boot = {