From 65282e05c952c7167fad90d6094c7b78e1d7d45d Mon Sep 17 00:00:00 2001 From: Julia Lange Date: Sat, 12 Oct 2024 21:19:23 -0700 Subject: [PATCH] Global, Hypr, Systems, Flake update 2024-10-21 Refactored systems to be dependant on host. So that jibril and onizuka can have separate profiles. Doing this split up the systems/ folder, and also forced a flake update to test. This was done midway through the hypr rework, and would have been difficult to decouple, so I just did a big commit instead <3 Refactored the entire hypr system to use settings and nix rather than its native config. This is working and tested on Jibril, but is missing the scripts used for switching workspaces on Onizuka. --- flake.lock | 239 ++++++++++++++---- flake.nix | 5 +- hmModules/apps/default.nix | 1 + hmModules/apps/hypr/default.nix | 228 +++++++++++++++-- hmModules/apps/hypr/keybinds.conf | 48 ---- hmModules/apps/hypr/league_rules.conf | 25 -- hmModules/apps/hypr/nvidia.conf | 7 - hmModules/apps/hypr/scripts/initdb.xsh | 13 - hmModules/apps/hypr/settings.conf | 62 ----- hmModules/apps/hypr/window_rules.conf | 40 --- hmModules/apps/hypr/xwaylandvideobridge.conf | 5 - hmModules/apps/librewolf/default.nix | 2 + .../apps/terminal-emulators/kitty/default.nix | 2 + hmModules/services/home/default.nix | 5 + systems/jibril/default.nix | 110 ++++++++ systems/{pan => onizuka}/default.nix | 54 ++++ 16 files changed, 572 insertions(+), 274 deletions(-) delete mode 100644 hmModules/apps/hypr/keybinds.conf delete mode 100644 hmModules/apps/hypr/league_rules.conf delete mode 100644 hmModules/apps/hypr/nvidia.conf delete mode 100755 hmModules/apps/hypr/scripts/initdb.xsh delete mode 100644 hmModules/apps/hypr/settings.conf delete mode 100644 hmModules/apps/hypr/window_rules.conf delete mode 100644 hmModules/apps/hypr/xwaylandvideobridge.conf create mode 100644 systems/jibril/default.nix rename systems/{pan => onizuka}/default.nix (59%) diff --git a/flake.lock b/flake.lock index b35f8a9..4e753bc 100644 --- a/flake.lock +++ b/flake.lock @@ -2,14 +2,15 @@ "nodes": { "ags": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "systems": "systems" }, "locked": { - "lastModified": 1721074762, - "narHash": "sha256-RhqFBMLh6G5vAo7Jz9mdsworI50E4FAAg7rPho4CNfY=", + "lastModified": 1728326430, + "narHash": "sha256-tV1ABHuA1HItMdCTuNdA8fMB+qw7LpjvI945VwMSABI=", "owner": "Aylur", "repo": "ags", - "rev": "8194f0c9546a150525a2022c17aed51df1464b80", + "rev": "60180a184cfb32b61a1d871c058b31a3b9b0743d", "type": "github" }, "original": { @@ -18,16 +19,87 @@ "type": "github" } }, + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1729527199, + "narHash": "sha256-D5/YksfRga8Akd04ZtIkuYSIOjXVrAzQIQBSeplokzU=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "8d732fa8aff8b12ef2b1e2f00fc8153e41312b72", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "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" + } + }, "home-manager": { "inputs": { "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1720734513, - "narHash": "sha256-neWQ8eNtLTd+YMesb7WjKl1SVCbDyCm46LUgP/g/hdo=", + "lastModified": 1729551526, + "narHash": "sha256-7LAGY32Xl14OVQp3y6M43/0AtHYYvV6pdyBcp3eoz0s=", "owner": "nix-community", "repo": "home-manager", - "rev": "90ae324e2c56af10f20549ab72014804a3064c7f", + "rev": "5ec753a1fc4454df9285d8b3ec0809234defb975", "type": "github" }, "original": { @@ -52,11 +124,11 @@ ] }, "locked": { - "lastModified": 1720108799, - "narHash": "sha256-AxRkTJlbB8r7aG6gvc7IaLhc2T9TO4/8uqanKRxukBQ=", + "lastModified": 1728669738, + "narHash": "sha256-EDNAU9AYcx8OupUzbTbWE1d3HYdeG0wO6Msg3iL1muk=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "a5c0d57325c5f0814c39110a70ca19c070ae9486", + "rev": "0264e698149fcb857a66a53018157b41f8d97bb0", "type": "github" }, "original": { @@ -67,26 +139,27 @@ }, "hyprland": { "inputs": { + "aquamarine": "aquamarine", "hyprcursor": "hyprcursor", + "hyprland-protocols": "hyprland-protocols", "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", "nixpkgs": "nixpkgs_3", - "systems": "systems", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems_2", "xdph": "xdph" }, "locked": { - "lastModified": 1721044084, - "narHash": "sha256-vO6wBIaInnyIQqmsKc28AsFSWeCFgnFilNhv2zoN/tU=", + "lastModified": 1729715559, + "narHash": "sha256-DigThx4MJv4tWEimqYzxymIZFUcTgQ3D1vZyG8FD9VA=", "ref": "refs/heads/main", - "rev": "bd526822deb9ed47c0b51b534817aa8541fff07b", - "revCount": 4927, - "submodules": true, + "rev": "cdac64970e894c3211d94da8925fbf905b52a594", + "revCount": 5369, "type": "git", "url": "https://github.com/hyprwm/Hyprland" }, "original": { - "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" } @@ -96,11 +169,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1720709712, - "narHash": "sha256-78j/cY+AXoMIqqiNc1vWx237EPfpERAcYsb57ABUbwQ=", + "lastModified": 1729224425, + "narHash": "sha256-w9dNUedNe2qnhHuhcRf7A1l29+/6DxdMfwN6g4U3c/w=", "owner": "hyprwm", "repo": "contrib", - "rev": "65d42dcbfde2229a75ccdb195c318dfe241f9ade", + "rev": "d72bc8b1cd30d448bd438e8328f8eeb4c0f2ddb6", "type": "github" }, "original": { @@ -113,21 +186,19 @@ "inputs": { "nixpkgs": [ "hyprland", - "xdph", "nixpkgs" ], "systems": [ "hyprland", - "xdph", "systems" ] }, "locked": { - "lastModified": 1718746314, - "narHash": "sha256-HUklK5u86w2Yh9dOkk4FdsL8eehcOZ95jPhLixGDRQY=", + "lastModified": 1728345020, + "narHash": "sha256-xGbkc7U/Roe0/Cv3iKlzijIaFBNguasI31ynL2IlEoM=", "owner": "hyprwm", "repo": "hyprland-protocols", - "rev": "1b61f0093afff20ab44d88ad707aed8bf2215290", + "rev": "a7c183800e74f337753de186522b9017a07a8cee", "type": "github" }, "original": { @@ -152,11 +223,11 @@ ] }, "locked": { - "lastModified": 1720381373, - "narHash": "sha256-lyC/EZdHULsaAKVryK11lgHY9u6pXr7qR4irnxNWC7k=", + "lastModified": 1728168612, + "narHash": "sha256-AnB1KfiXINmuiW7BALYrKqcjCnsLZPifhb/7BsfPbns=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "5df0174fd09de4ac5475233d65ffc703e89b82eb", + "rev": "f054f2e44d6a0b74607a6bc0f52dba337a3db38e", "type": "github" }, "original": { @@ -177,11 +248,11 @@ ] }, "locked": { - "lastModified": 1720545076, - "narHash": "sha256-Pxacc2uoxI00koXp5+CyNqHOTQlqNlK0rlRHDBHX4+g=", + "lastModified": 1728941256, + "narHash": "sha256-WRypmcZ2Bw94lLmcmxYokVOHPJSZ7T06V49QZ4tkZeQ=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "6174a2a25f4e216c0f1d0c4278adc23c476b1d09", + "rev": "fd4be8b9ca932f7384e454bcd923c5451ef2aa85", "type": "github" }, "original": { @@ -202,11 +273,11 @@ ] }, "locked": { - "lastModified": 1720215857, - "narHash": "sha256-JPdL+Qul+jEueAn8CARfcWP83eJgwkhMejQYfDvrgvU=", + "lastModified": 1726874836, + "narHash": "sha256-VKR0sf0PSNCB0wPHVKSAn41mCNVCnegWmgkrneKDhHM=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "d5fa094ca27e0039be5e94c0a80ae433145af8bb", + "rev": "500c81a9e1a76760371049a8d99e008ea77aa59e", "type": "github" }, "original": { @@ -217,11 +288,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1718714799, - "narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=", + "lastModified": 1725634671, + "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e", + "rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c", "type": "github" }, "original": { @@ -231,13 +302,29 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs-stable": { "locked": { - "lastModified": 1719848872, - "narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=", + "lastModified": 1720386169, + "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "00d80d13810dbfea8ab4ed1009b09100cca86ba8", + "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1729256560, + "narHash": "sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c+cHUJwA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0", "type": "github" }, "original": { @@ -249,11 +336,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1720542800, - "narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=", + "lastModified": 1729413321, + "narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "feb2849fdeb70028c70d73b848214b00d324a497", + "rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26", "type": "github" }, "original": { @@ -281,11 +368,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1720957393, - "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", + "lastModified": 1729413321, + "narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb", + "rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26", "type": "github" }, "original": { @@ -294,6 +381,30 @@ "type": "indirect" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1729104314, + "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "ags": "ags", @@ -318,13 +429,39 @@ "type": "github" } }, + "systems_2": { + "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" + } + }, "xdph": { "inputs": { - "hyprland-protocols": "hyprland-protocols", + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], "hyprlang": [ "hyprland", "hyprlang" ], + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], "nixpkgs": [ "hyprland", "nixpkgs" @@ -335,11 +472,11 @@ ] }, "locked": { - "lastModified": 1720194466, - "narHash": "sha256-Rizg9efi6ue95zOp0MeIV2ZedNo+5U9G2l6yirgBUnA=", + "lastModified": 1728166987, + "narHash": "sha256-w6dVTguAn9zJ+7aPOhBQgDz8bn6YZ7b56cY8Kg5HJRI=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "b9b97e5ba23fe7bd5fa4df54696102e8aa863cf6", + "rev": "fb9c8d665af0588bb087f97d0f673ddf0d501787", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index aab3597..e1f211a 100644 --- a/flake.nix +++ b/flake.nix @@ -5,7 +5,7 @@ nixpkgs.url = "nixpkgs/nixos-unstable"; home-manager.url = "github:nix-community/home-manager"; - hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; + hyprland.url = "git+https://github.com/hyprwm/Hyprland"; hyprland-contrib.url = "github:hyprwm/contrib"; ags.url = "github:Aylur/ags"; }; @@ -22,6 +22,7 @@ ] ++ extraModules; }; in { - homeConfigurations.pan = defaultConfig [ ./systems/pan ]; + homeConfigurations."pan@onizuka" = defaultConfig [ ./systems/onizuka ]; + homeConfigurations."pan@jibril" = defaultConfig [ ./systems/jibril ]; }; } diff --git a/hmModules/apps/default.nix b/hmModules/apps/default.nix index 735a533..ef1c1b2 100644 --- a/hmModules/apps/default.nix +++ b/hmModules/apps/default.nix @@ -7,6 +7,7 @@ ./gimp ./git ./hypr + ./librewolf ./lutris ./media-viewers ./neovim diff --git a/hmModules/apps/hypr/default.nix b/hmModules/apps/hypr/default.nix index 45c67df..a28db98 100644 --- a/hmModules/apps/hypr/default.nix +++ b/hmModules/apps/hypr/default.nix @@ -3,51 +3,237 @@ let rootPath = ./.; in { options.hypr = { enable = lib.mkEnableOption "Enables hyprland"; + mod_key = lib.mkOption { default = "SUPER"; }; + monitor = { + details = lib.mkOption { default = []; }; + }; + workspace = { + workspaces = lib.mkOption { default = {}; }; + scratchpad.enable = lib.mkEnableOption "Enables a scratchpad"; + defaults = lib.mkOption { default = {}; }; + # primary-secondary = { + # enable = lib.mkEnableOption "Enables the primary-secondary navigation style"; + # primary = lib.mkOption { default = "DP-1"; }; + # secondary = lib.mkOption { default = "DP-2"; }; + # secondaries = lib.mkOption { default = []; }; + # }; + }; + windows.opaque = lib.mkOption { default = []; }; + background = { + enable = lib.mkEnableOption "Enables a wallpaper"; + path = lib.mkOption { default = ""; }; + }; + cursor = { + enable = lib.mkEnableOption "Enables custom cursor"; + theme = lib.mkOption { default = ""; }; + size = lib.mkOption { default = 64; }; + }; + xwayland.videobridge.enable = lib.mkEnableOption "Enable xwaylandvideobridge"; + mouse.sensitivity = lib.mkOption { default = 0; }; + master.mfact = lib.mkOption { default = 0.55; }; + polkit.enable = lib.mkEnableOption "Enables polkit agent"; + screenshot.enable = lib.mkEnableOption "Enables Screenshotting"; }; imports = [ inputs.hyprland.homeManagerModules.default ]; - config = { + config = let + lopts = lib.lists.optionals; + in { nix.settings = { substituters = ["https://hyprland.cachix.org"]; trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; }; } // lib.mkIf config.hypr.enable { - wayland.windowManager.hyprland = { + wayland.windowManager.hyprland = let + mod = config.hypr.mod_key; + # p-s = let + # chw = config.hypr.workspace; + # findDefaultWs = id: if (builtins.hasAttr id chw.workspaces) + # then (builtins.head (builtins.getAttr id chw.workspaces)) + # else ""; + # in with config.hypr.workspace; lib.mkIf primary-secondary.enable { + # primaryWs = findDefaultWs primary-secondary.primary; + # secondaryWs = findDefaultWs primary-secondary.secondary; + # }; + in { enable = true; - extraConfig = '' - ${builtins.readFile ./window_rules.conf} - ${builtins.readFile ./league_rules.conf} - ${builtins.readFile ./settings.conf} - ${builtins.readFile ./nvidia.conf} - ${builtins.readFile ./keybinds.conf} - ${builtins.readFile ./xwaylandvideobridge.conf} - exec-once=${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1 + settings = { + monitor = config.hypr.monitor.details; + workspace = let + wsMonitor = monitor: wrksps: map (ws: + if ws == (builtins.head wrksps) + then "name:"+ws+", monitor:"+monitor+", persistent:true, default:true" + else "name:"+ws+", monitor:"+monitor+", persistent:true" + ) wrksps; + makeRules = wsAttr: builtins.concatLists (builtins.attrValues ( + builtins.mapAttrs wsMonitor wsAttr + )); + in makeRules config.hypr.workspace.workspaces + ++ lopts config.hypr.workspace.scratchpad.enable [ + "special:scratch, on-created-empty: [float; size 50% 50%; center] ${config.defaultApps.terminal}" + ]; + input = { + accel_profile = "flat"; + sensitivity = config.hypr.mouse.sensitivity; + }; + general = { + gaps_in = 3; + gaps_out = 3; + border_size = 2; + "col.active_border" = "rgb(F5C2E7)"; + "col.inactive_border" = "rgb(1E1D2F)"; + layout = "master"; + }; + decoration = { + rounding = 2; + blur = { + enabled = true; + size = 12; + passes = 2; + special = true; + }; + }; + animation = [ + "windows, 1, 4, default, popin 50%" + "windowsOut, 1, 4, default, popin 50%" + "windowsMove, 1, 3, default" + "border, 1, 3, default" + "fade, 1, 3, default" + "workspaces, 1, 3, default" + ]; + master = { + no_gaps_when_only = 1; + mfact = config.hypr.master.mfact; + }; + misc = { + focus_on_activate = true; + }; - env = HYPRCURSOR_THEME,miku - env = HYPRCURSOR_SIZE,64 - ''; + exec-once = lopts config.hypr.polkit.enable [ + "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1" + ] ++ lopts config.hypr.background.enable [ + "${pkgs.swww}/swww init" + "${pkgs.swww}/swww img ${config.hypr.background.path}" + ] ++ lopts config.ags.enable [ + "ags" + ] ++ lopts config.beeper.enable [ + "[workspace name:chat silent] Beeper" + ]; + + env = with config.hypr; [ + # "HYPR_MON_PRIMARY, ${workspace.primary-secondary.primary}" + # "HYPR_MON_SECONDARY, ${workspace.primary-secondary.secondary}" + "HYPR_WORK_DB, ${config.xdg.cacheHome}/hypr/workspace.db" + ] ++ lopts cursor.enable [ + "HYPRCURSOR_THEME,${cursor.theme}" + "HYPRCURSOR_SIZE,${cursor.size}" + ] ++ lopts config.nvidia.enable [ + "LIBVA_DRIVER_NAME,nvidia" + "XDG_SESSION_TYPE,wayland" + "GBM_BACKEND,nvidia-drm" + "__GLX_VENDOR_LIBRARY_NAME,nvidia" + "WLR_RENDERER_ALLOW_SOFTWARE,1" + "WLR_DRM_DEVICES,/dev/dri/card1" + ]; + + windowrulev2 = let + workspaceDefaults = wsname: applist: map ( + app: "workspace " + wsname + ", " + app + ) applist; + allDefault = wsAttr: builtins.concatLists (builtins.attrValues ( + builtins.mapAttrs workspaceDefaults wsAttr + )); + in allDefault config.hypr.workspace.defaults + ++ lopts config.hypr.xwayland.videobridge.enable [ + "opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$" + "noanim,class:^(xwaylandvideobridge)$" + "noinitialfocus,class:^(xwaylandvideobridge)$" + "maxsize 1 1,class:^(xwaylandvideobridge)$" + "noblur,class:^(xwaylandvideobridge)$" + ] ++ map (id: "opacity 1 override, " + id) config.hypr.windows.opaque + ++ [ + "opacity 0.94 fullscreen:0" + "opacity 0.79 override, class:^(${config.defaultApps.terminal})$" + ]; + + # 1, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh home + # 2, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh web + # 3, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh med + # 4, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh game + # 5, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh etc + # _, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh hell + # TAB, exec, $XDG_CONFIG_HOME/hypr/scripts/changesecondary.xsh + # + # SHIFT, 1, movetoworkspacesilent, name:home + # SHIFT, 2, movetoworkspacesilent, name:web + # SHIFT, 3, movetoworkspacesilent, name:med + # SHIFT, 4, movetoworkspacesilent, name:game + # SHIFT, TAB, movetoworkspacesilent, r-1 + + bind = let + modPrefix = kb: if (lib.strings.hasPrefix "&" kb) + then ("${mod}" + kb) + else ("${mod}, " + kb); + in map modPrefix ([ + "return, exec, ${config.defaultApps.terminal}" + "&SHIFT, Q, exit" + "h, focusmonitor, l" + "l, focusmonitor, r" + "j, cyclenext," + "k, cyclenext, prev" + "&SHIFT, h, movecurrentworkspacetomonitor, -1" + "&SHIFT, l, movecurrentworkspacetomonitor, +1" + "&SHIFT, j, swapnext," + "&SHIFT, k, swapnext, prev" + "c, killactive" + "f, togglefloating" + "&SHIFT, f, fullscreen" + ] ++ (let + workspaces = builtins.concatLists ( + builtins.attrValues config.hypr.workspace.workspaces); + wsBinds = with builtins; wrksps: depth: if depth > (length wrksps) + then [] + else let ws = builtins.elemAt wrksps (depth -1); in [ + "${toString depth}, workspace, name:${ws}" + "&SHIFT, ${toString depth}, movetoworkspacesilent, name:${ws}" + ] ++ wsBinds wrksps (depth + 1); + in wsBinds workspaces 1) ++ lopts config.rofi.enable [ + "&SHIFT, return, exec, ${pkgs.rofi}/rofi -show run" + ] ++ lopts config.hypr.screenshot.enable [ + "P, exec, ${pkgs.grimblast}/grimblast --freeze copy area" + "&SHIFT, P, exec, ${pkgs.grimblast}/grimblast --freeze copysave area" + ] ++ lopts config.hypr.workspace.scratchpad.enable [ + "i, togglespecialworkspace, scratch" + ]); + + bindm = map (kb: "${mod}, " + kb) [ + "mouse:272, movewindow" + "mouse:273, movewindow" + ]; + }; }; + home.packages = with pkgs; [ - socat # For hyprland scripts - swww # Wallpaper engine wlr-randr # Xrandr for wayland wl-clipboard # Clipboard manager for wayland xdg-desktop-portal-hyprland # XDP for hyprland + ] ++ lopts config.hypr.xwayland.videobridge.enable [ + xwaylandvideobridge + ] ++ lopts config.hypr.cursor.enable [ + hyprcursor + ] ++ lopts config.hypr.screenshot.enable [ hyprpicker # Colorpicker, needed for screenshot tool - hyprcursor # Hyprland cursor - inputs.hyprland-contrib.packages.${pkgs.system}.grimblast # Screenshot tool - xonsh - polkit-kde-agent # Polkit handler + inputs.hyprland-contrib.packages.${pkgs.system}.grimblast ]; - # Hyprland screenshot tool + xdg.configFile."hypr-scripts" = { source = rootPath + "/scripts"; target = "hypr/scripts"; executable = true; }; - xdg.dataFile."hypr-icons" = { + xdg.dataFile."hypr-icons" = lib.mkIf config.hypr.cursor.enable { source = rootPath + "/icons"; target = "icons/"; recursive = true; diff --git a/hmModules/apps/hypr/keybinds.conf b/hmModules/apps/hypr/keybinds.conf deleted file mode 100644 index 06d307a..0000000 --- a/hmModules/apps/hypr/keybinds.conf +++ /dev/null @@ -1,48 +0,0 @@ -$mainMod = SUPER - -# Exec programs -bind = $mainMod, return, exec, kitty -bind = $mainMod SHIFT, return, exec, rofi -show run -bind = $mainMod, P, exec, grimblast --freeze copy area -bind = $mainMod SHIFT, P, exec, grimblast --freeze copysave area - -# Hyprland Management -bind = $mainMod SHIFT, Q, exit, - -# Workspace / Monitor Management -bind = $mainMod, h, focusmonitor, l -bind = $mainMod, l, focusmonitor, r -bind = $mainMod, j, cyclenext, -bind = $mainMod, k, cyclenext, prev -bind = $mainMod SHIFT, j, swapnext, -bind = $mainMod SHIFT, k, swapnext, prev -bind = $mainMod SHIFT, h, movecurrentworkspacetomonitor, -1 -bind = $mainMod SHIFT, l, movecurrentworkspacetomonitor, +1 - -bind = $mainMod, 1, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh home -bind = $mainMod, 2, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh web -bind = $mainMod, 3, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh med -bind = $mainMod, 4, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh game -binde = $mainMod, 5, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh etc -binde = $mainMod, _, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh hell -binde = $mainMod, TAB, exec, $XDG_CONFIG_HOME/hypr/scripts/changesecondary.xsh - -bind = $mainMod, m, togglespecialworkspace, mus -bind = $mainMod, i, togglespecialworkspace, scratch - -# Window Management -bind = $mainMod, C, killactive, - -bind = $mainMod, F, togglefloating, -bind = $mainMod SHIFT, F, fullscreen, - -bind = $mainMod SHIFT, 1, movetoworkspacesilent, name:home -bind = $mainMod SHIFT, 2, movetoworkspacesilent, name:web -bind = $mainMod SHIFT, 3, movetoworkspacesilent, name:med -bind = $mainMod SHIFT, 4, movetoworkspacesilent, name:game -bind = $mainMod SHIFT, _, movetoworkspacesilent, name:hell -bind = $mainMod SHIFT, TAB, movetoworkspacesilent, r-1 - -# Move/resize windows with mainMod + LMB/RMB and dragging -bindm = $mainMod, mouse:272, movewindow -bindm = $mainMod, mouse:273, resizewindow diff --git a/hmModules/apps/hypr/league_rules.conf b/hmModules/apps/hypr/league_rules.conf deleted file mode 100644 index 5c573f0..0000000 --- a/hmModules/apps/hypr/league_rules.conf +++ /dev/null @@ -1,25 +0,0 @@ -# no opacity -windowrulev2 = opacity 1 1, class:^(league of legends.exe)$ # loading text -windowrulev2 = opacity 1 override, class:^(leagueclientux.exe)$ # client -windowrulev2 = opacity 1 override, class:^(leagueclient.exe)$ # game - -# nice loading text -windowrulev2 = noblur, class:^(leagueclient.exe)$ -windowrulev2 = noborder, class:^(leagueclient.exe)$ -windowrulev2 = nofocus, class:^(leagueclient.exe)$ -windowrulev2 = noshadow, class:^(leagueclient.exe)$ - -# windowrulev2 = immediate, class:^(league of legends.exe)$ -# windowrulev2 = immediate, class:^(overwatch.exe)$ -# windowrulev2 = immediate, class:^(steam_app_1384160)$ -windowrulev2 = fullscreen, class:^(overwatch.exe)$ -windowrulev2 = fullscreen, class:^(steam_app_1384160)$ -windowrulev2 = fullscreen, class:^(league of legends.exe)$ - -# workspaces -windowrule = workspace name:game, leagueclient.exe -windowrule = workspace name:game, leagueclientux.exe -windowrule = workspace name:game, league of legends.exe -windowrule = workspace name:game, overwatch.exe -windowrule = workspace name:game, 東方紅魔郷.exe -windowrule = workspace name:game, steam_app_1384160 diff --git a/hmModules/apps/hypr/nvidia.conf b/hmModules/apps/hypr/nvidia.conf deleted file mode 100644 index 0e00cc7..0000000 --- a/hmModules/apps/hypr/nvidia.conf +++ /dev/null @@ -1,7 +0,0 @@ -# Nivida Settings -env = LIBVA_DRIVER_NAME,nvidia -env = XDG_SESSION_TYPE,wayland -env = GBM_BACKEND,nvidia-drm -env = __GLX_VENDOR_LIBRARY_NAME,nvidia -env = WLR_RENDERER_ALLOW_SOFTWARE,1 -env = WLR_DRM_DEVICES,/dev/dri/card1 diff --git a/hmModules/apps/hypr/scripts/initdb.xsh b/hmModules/apps/hypr/scripts/initdb.xsh deleted file mode 100755 index 85bdad5..0000000 --- a/hmModules/apps/hypr/scripts/initdb.xsh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env xonsh -import shelve - -# Usage: -# ./initdb.xsh -# initialize a db for use hypr workspace scripts - -with shelve.open($HYPR_WORK_DB) as db: - db["primary"] = "home" - db["secondary"] = "chat" - db["secondaries"] = ["chat", "web", "med"] - db["secondary_extras"] = 1 - db["primary_extras"] = 1 diff --git a/hmModules/apps/hypr/settings.conf b/hmModules/apps/hypr/settings.conf deleted file mode 100644 index bc2848c..0000000 --- a/hmModules/apps/hypr/settings.conf +++ /dev/null @@ -1,62 +0,0 @@ -# Monitor Settings -monitor=DP-2,2560x1440@144,0x0,1 -monitor=DP-1,2560x1440@144,-2560x0,1 -monitor=HDMI-A-1,disable - -# Inits -exec-once = swww init -exec-once = swww img $HOME/med/pix/bg.png -exec-once = ags - -# Settings -input { - kb_layout = us - follow_mouse = 1 - accel_profile = flat - sensitivity = -0.52 - #sensitivity = 0.2 # -1.0 - 1.0, 0 means no modification. -} - -general { - gaps_in = 3 - gaps_out = 3 - border_size = 2 - col.active_border = rgb(F5C2E7) - col.inactive_border = rgb(1E1D2F) - - layout = master -} - -decoration { - rounding = 2 - blur { - enabled = true - size = 12 - passes = 2 - special = true - } - dim_special = 0.2 -} - -animations { - enabled = yes - - animation = windows, 1, 4, default, popin 50% - animation = windowsOut, 1, 4, default, popin 50% - animation = windowsMove, 1, 3, default - animation = border, 1, 3, default - animation = fade, 1, 3, default - animation = workspaces, 1, 3, default -} - -master { - no_gaps_when_only = true - new_is_master = false - mfact = 0.53 -} - -misc { - focus_on_activate = true - enable_swallow = false - swallow_regex = ^(Alacritty)$ -} diff --git a/hmModules/apps/hypr/window_rules.conf b/hmModules/apps/hypr/window_rules.conf deleted file mode 100644 index 57be0c8..0000000 --- a/hmModules/apps/hypr/window_rules.conf +++ /dev/null @@ -1,40 +0,0 @@ -env = HYPR_MON_PRIMARY, DP-2 -env = HYPR_MON_SECONDARY, DP-1 - -# Primaries -workspace=name:home, monitor:DP-2, persistent:true, default:true -workspace=name:game, monitor:DP-2, persistent:true -workspace=name:etc0, monitor:DP-2, persistent:true -workspace=name:hell, monitor:DP-2, persistent:true -# Secondaries -workspace=name:chat, monitor:DP-1, persistent:true, default:true -workspace=name:misc0, monitor:DP-1, persistent:true -# Switches -workspace=name:web , monitor:DP-1, persistent:true -workspace=name:med , monitor:DP-1, persistent:true -# Pseudo -workspace=special:mus, persistent:true -workspace=special:scratch, on-created-empty: [float; size 50% 50%; center] kitty - -windowrule = workspace name:web, librewolf -windowrulev2 = workspace name:med, librewolf,title:Picture-in-Picture -windowrule = workspace name:chat, discord -windowrule = workspace name:chat, Beeper -windowrule = workspace name:game, lutris -windowrule = workspace name:game, explorer.exe - -windowrulev2 = opacity 0.94 fullscreen:0 - -windowrulev2 = opacity 0.79 override, class:^(Alacritty)$ -windowrulev2 = opacity 0.79 override, class:^(kitty)$ -windowrulev2 = opacity 1 override, initialTitle:^(Discord Popout)$ -windowrulev2 = opacity 1 override, class:^(firefox)$ -windowrulev2 = opacity 1 override, class:^(Gimp)$ -windowrulev2 = opacity 1 override, class:^(feh)$ -windowrulev2 = opacity 1 override, class:^(mpv)$ - -env = HYPR_WORK_DB,$XDG_CACHE_HOME/hypr/workspace.db - -# exec-once = [workspace special:mus silent;float;size 70% 70%;center] mus client -exec-once = [workspace name:chat silent] vesktop -exec-once = [workspace name:chat silent] beeper diff --git a/hmModules/apps/hypr/xwaylandvideobridge.conf b/hmModules/apps/hypr/xwaylandvideobridge.conf deleted file mode 100644 index 4b77ad2..0000000 --- a/hmModules/apps/hypr/xwaylandvideobridge.conf +++ /dev/null @@ -1,5 +0,0 @@ -windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$ -windowrulev2 = noanim,class:^(xwaylandvideobridge)$ -windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$ -windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$ -windowrulev2 = noblur,class:^(xwaylandvideobridge)$ diff --git a/hmModules/apps/librewolf/default.nix b/hmModules/apps/librewolf/default.nix index 7995cbb..f298127 100644 --- a/hmModules/apps/librewolf/default.nix +++ b/hmModules/apps/librewolf/default.nix @@ -3,6 +3,7 @@ { options.librewolf = { enable = lib.mkEnableOption "Enables librewolf"; + make_default = lib.mkEnableOption "Makes librewolf the default browser"; }; config = lib.mkIf config.librewolf.enable { @@ -12,5 +13,6 @@ home.sessionVariables = { BROWSER = "librewolf"; }; + defaultApps.browser = lib.mkIf config.librewolf.make_default "librewolf"; }; } diff --git a/hmModules/apps/terminal-emulators/kitty/default.nix b/hmModules/apps/terminal-emulators/kitty/default.nix index b4ae35a..23b8161 100644 --- a/hmModules/apps/terminal-emulators/kitty/default.nix +++ b/hmModules/apps/terminal-emulators/kitty/default.nix @@ -3,6 +3,7 @@ { options.kitty = { enable = lib.mkEnableOption "Enables kitty"; + make_default = lib.mkEnableOption "Makes kitty default terminal emulator"; font = lib.mkOption { default = ""; }; font_size = lib.mkOption { default = 18; }; }; @@ -17,5 +18,6 @@ confirm_os_window_close = 0; }; }; + defaultApps.terminal = lib.mkIf config.kitty.make_default "kitty"; }; } diff --git a/hmModules/services/home/default.nix b/hmModules/services/home/default.nix index bbb4cf2..7bf691a 100644 --- a/hmModules/services/home/default.nix +++ b/hmModules/services/home/default.nix @@ -3,6 +3,11 @@ { options = { extraPkgs = lib.mkOption { default = []; }; + nvidia.enable = lib.mkEnableOption "Enables nvidia requirements"; + defaultApps = { + terminal = lib.mkOption { default = ""; }; + browser = lib.mkOption { default = ""; }; + }; }; config = { diff --git a/systems/jibril/default.nix b/systems/jibril/default.nix new file mode 100644 index 0000000..109e666 --- /dev/null +++ b/systems/jibril/default.nix @@ -0,0 +1,110 @@ +{ config, ... }: + +{ + home.username = "pan"; + nixpkgs.config.allowUnfree = true; + home.stateVersion = "23.05"; + + hypr.enable = true; + hypr.monitor = { + details = [ + "eDP-2,2256x1504@60,0x0,1" + ]; + }; + hypr.workspace = { + workspaces = { + "eDP-1" = [ + "home" + "web" + "chat" + "med" + ]; + }; + scratchpad.enable = true; + defaults = { + "name:web" = [ "class:(librewolf)" ]; + "name:med" = [ "class:(librewolf),title:Picture-in-Picture" ]; + "name:chat" = [ "class:(Beeper)" ]; + }; + }; + hypr.windows.opaque = [ + "initialTitle:^(Discord Popout)$" + "class:^(firefox)$" + "class:^(Gimp)$" + "class:^(feh)$" + "class:^(mpv)$" + ]; + hypr.background = { + enable = true; + path = "${config.home.homeDirectory}/med/pix/bg.png"; + }; + # hypr.cursor = { + # enable = true; + # theme = "miku"; + # }; + hypr = { + screenshot.enable = true; + mouse.sensitivity = -0.52; + polkit.enable = true; + master.mfact = 0.53; + xwayland.videobridge.enable = true; + }; + # ags.enable = true; + rofi.enable = true; + + timer.enableHourly = true; + timer.enableQuarterly = true; + colors.enable = true; + manpages.enable = true; + trash.enable = true; + + fish.enable = true; + kitty.enable = true; + kitty.make_default = true; + kitty.font = "Cascadia Code"; + git.enable = true; + git.username = "Julia Lange"; + git.email = "public@julialange.org"; + ssh.enable = true; + librewolf.enable = true; + librewolf.make_default = true; + + mpv.enable = true; + zathura.enable = true; + feh.enable = true; + + neovim.enable = true; + neovim.languages = { + c.enable = true; + nix.enable = true; + rust.enable = true; + }; + neovim.plugins = { + comments.enable = true; + fugitive.enable = true; + lualine.enable = true; + luasnip.enable = true; + nvimcmp.enable = true; + telescope = { + enable = true; + fzf.enable = true; + }; + treesitter.enable = true; + wiki.enable = true; + }; + + lf.enable = true; + lf.hiddenfiles = [ + "${config.home.homeDirectory}/.librewolf" + "${config.home.homeDirectory}/.nix-defexpr" + "${config.home.homeDirectory}/.nix-profile" + "${config.home.homeDirectory}/.nv" + "${config.home.homeDirectory}/.pki" + ]; + zoxide.enable = true; + + gimp.enable = true; + + beeper.enable = true; + discord.enable = true; +} diff --git a/systems/pan/default.nix b/systems/onizuka/default.nix similarity index 59% rename from systems/pan/default.nix rename to systems/onizuka/default.nix index c5473ff..f59b05b 100644 --- a/systems/pan/default.nix +++ b/systems/onizuka/default.nix @@ -6,6 +6,57 @@ home.stateVersion = "23.05"; hypr.enable = true; + hypr.monitor = { + details = [ + "DP-2,2560x1440@144,0x0,1" + "DP-1,2560x1440@144,-2560x0,1" + "HDMI-A-1,disable" + ]; + primary = "DP-2"; + secondary = "DP-1"; + }; + hypr.workspace = { + workspaces = { + "DP-2" = [ + "home" + "web" + "med" + "game" + ]; + "DP-1" = [ + "chat" + ]; + }; + scratchpad.enable = true; + defaults = { + "name:web" = [ "librewolf" ]; + "name:med" = [ "librewolf,title:Picture-in-Picture" ]; + "name:chat" = [ "Beeper" ]; + "name:game" = [ "lutris" "explorer.exe" ]; + }; + }; + windows.opaque = [ + "initialTitle:^(Discord Popout)$" + "class:^(firefox)$" + "class:^(Gimp)$" + "class:^(feh)$" + "class:^(mpv)$" + ]; + hypr.background = { + enable = true; + path = "${config.home.homeDirectory}/med/pix/bg.png"; + }; + hypr.cursor = { + enable = true; + theme = "miku"; + }; + hypr = { + screenshot.enable = true; + mouse.sensitivity = -0.52; + polkit.enable = true; + master.mfact = 0.53; + xwayland.videobridge.enable = true; + }; ags.enable = true; rofi.enable = true; @@ -17,11 +68,14 @@ fish.enable = true; kitty.enable = true; + kitty.make_default = true; kitty.font = "Cascadia Code"; git.enable = true; git.username = "Julia Lange"; git.email = "public@julialange.org"; ssh.enable = true; + librewolf.enable = true; + librewolf.make_default = true; mpv.enable = true; zathura.enable = true;