Personal Nix setup
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Share hyprland config with NixOS module

+127 -85
+2 -48
home/desktop/hyprland.nix
··· 22 22 description = "Whether to enable Hyprland configuration."; 23 23 type = types.bool; 24 24 }; 25 - 26 - input = mkOption { 27 - default = { }; 28 - type = types.submodule { 29 - options = { 30 - sensitivity = mkOption { 31 - default = 0.0; 32 - type = types.float; 33 - }; 34 - kb_model = mkOption { 35 - default = "apple"; 36 - type = types.str; 37 - }; 38 - kb_variant = mkOption { 39 - default = "mac"; 40 - type = types.str; 41 - }; 42 - kb_layout = mkOption { 43 - default = "gb"; 44 - type = types.str; 45 - }; 46 - }; 47 - }; 48 - }; 49 - 50 - monitor = mkOption { 51 - description = "Monitor configuration"; 52 - default = [ ]; 53 - type = lib.types.listOf lib.types.str; 54 - }; 55 25 }; 56 26 57 27 config = mkIf cfg.hyprland.enable { ··· 65 35 plugins = with pkgs.hyprlandPlugins; [ hyprspace ]; 66 36 67 37 settings = { 38 + source = [ "/etc/hypr/hyprland.conf" ]; 39 + 68 40 general = { 69 41 gaps_out = 9; 70 42 gaps_in = 4; ··· 105 77 }; 106 78 }; 107 79 108 - input = { 109 - kb_options = "ctrl:nocaps,lv3:ralt_switch"; 110 - kb_model = cfg.hyprland.input.kb_model; 111 - kb_layout = cfg.hyprland.input.kb_layout; 112 - kb_variant = cfg.hyprland.input.kb_variant; 113 - sensitivity = cfg.hyprland.input.sensitivity; 114 - touchpad = { 115 - clickfinger_behavior = true; 116 - tap-to-click = false; 117 - tap-and-drag = false; 118 - scroll_factor = 0.18; 119 - }; 120 - }; 121 - 122 80 gestures = { 123 81 workspace_swipe = true; 124 82 workspace_swipe_invert = false; ··· 150 108 panelHeight = 150; 151 109 reservedArea = 38; 152 110 }; 153 - 154 - monitor = cfg.hyprland.monitor ++ [ 155 - ", preferred, auto, 1" 156 - ]; 157 111 158 112 bindm = [ 159 113 "SUPER, mouse:272, movewindow"
+13 -1
machines/pepper/configuration.nix
··· 12 12 }; 13 13 14 14 modules = { 15 - desktop.enable = true; 15 + desktop = { 16 + enable = true; 17 + hyprland = { 18 + input = { 19 + sensitivity = -0.5; 20 + kb_layout = "us"; 21 + }; 22 + monitor = [ 23 + "desc:Samsung Electric Company Odyssey G60SD HNAX300205, 2560x1440@360, 0x0, 1, vrr, 1" 24 + "desc:LG Electronics 27GL850 005NTPC4Q200, preferred, auto, 1, transform, 1, vrr, 1" 25 + ]; 26 + }; 27 + }; 16 28 server = { 17 29 enable = true; 18 30 sshd.enable = true;
+1 -13
machines/pepper/home.nix
··· 2 2 3 3 { 4 4 modules = { 5 - desktop = { 6 - enable = true; 7 - hyprland = { 8 - input = { 9 - sensitivity = -0.5; 10 - kb_layout = "us"; 11 - }; 12 - monitor = [ 13 - "desc:Samsung Electric Company Odyssey G60SD HNAX300205, 2560x1440@360, 0x0, 1, vrr, 1" 14 - "desc:LG Electronics 27GL850 005NTPC4Q200, preferred, auto, 1, transform, 1, vrr, 1" 15 - ]; 16 - }; 17 - }; 5 + desktop.enable = true; 18 6 development.enable = false; 19 7 apps = { 20 8 enable = true;
+3
machines/sodacream/configuration.nix
··· 20 20 enable = true; 21 21 rawaccel.enable = false; 22 22 affinity.performanceCores = [ 4 5 6 7 ]; 23 + hyprland = { 24 + monitor = [ "eDP-1, preferred, 0x0, 1.6" ]; 25 + }; 23 26 }; 24 27 server = { 25 28 enable = true;
+1 -4
machines/sodacream/home.nix
··· 1 1 { ... }: { 2 2 modules = { 3 - desktop = { 4 - enable = true; 5 - hyprland.monitor = [ "eDP-1, preferred, 0x0, 1.6" ]; 6 - }; 3 + desktop.enable = true; 7 4 development = { 8 5 enable = true; 9 6 js.enable = true;
+1
modules/desktop/default.nix
··· 24 24 ./rawaccel.nix 25 25 ./audio.nix 26 26 ./networking.nix 27 + ./hyprland.nix 27 28 ]; 28 29 29 30 config = mkIf cfg.enable {
+105
modules/desktop/hyprland.nix
··· 1 + { lib, pkgs, config, ... }: 2 + 3 + with lib; 4 + let 5 + cfg = config.modules.desktop; 6 + in { 7 + options.modules.desktop.hyprland = { 8 + enable = mkOption { 9 + default = cfg.enable; 10 + example = true; 11 + description = "Whether to enable Hyprland"; 12 + type = types.bool; 13 + }; 14 + 15 + input = mkOption { 16 + default = { }; 17 + type = types.submodule { 18 + options = { 19 + sensitivity = mkOption { 20 + default = 0.0; 21 + type = types.float; 22 + }; 23 + kb_model = mkOption { 24 + default = "apple"; 25 + type = types.str; 26 + }; 27 + kb_variant = mkOption { 28 + default = "mac"; 29 + type = types.str; 30 + }; 31 + kb_layout = mkOption { 32 + default = "gb"; 33 + type = types.str; 34 + }; 35 + }; 36 + }; 37 + }; 38 + 39 + monitor = mkOption { 40 + description = "Monitor configuration"; 41 + default = [ ]; 42 + type = lib.types.listOf lib.types.str; 43 + }; 44 + }; 45 + 46 + config = mkIf cfg.hyprland.enable { 47 + programs = { 48 + hyprlock.enable = true; 49 + hyprland = { 50 + enable = true; 51 + withUWSM = true; 52 + xwayland.enable = true; 53 + }; 54 + }; 55 + 56 + security.pam.services.hyprlock = {}; 57 + 58 + xdg.portal = { 59 + enable = true; 60 + xdgOpenUsePortal = true; 61 + extraPortals = with pkgs; [ 62 + xdg-desktop-portal-hyprland 63 + xdg-desktop-portal-gtk 64 + ]; 65 + }; 66 + 67 + environment.etc."hypr/hyprland.conf".text = '' 68 + debug { 69 + error_position=1 70 + } 71 + 72 + general { 73 + allow_tearing=true 74 + } 75 + 76 + input { 77 + touchpad { 78 + clickfinger_behavior=true 79 + scroll_factor=0.180000 80 + tap-and-drag=false 81 + tap-to-click=false 82 + } 83 + kb_options=ctrl:nocaps,lv3:ralt_switch 84 + kb_layout=${cfg.hyprland.input.kb_layout} 85 + kb_model=${cfg.hyprland.input.kb_model} 86 + kb_variant=${cfg.hyprland.input.kb_variant} 87 + sensitivity=${toString cfg.hyprland.input.sensitivity} 88 + } 89 + 90 + misc { 91 + disable_hyprland_logo=true 92 + disable_splash_rendering=true 93 + vrr=1 94 + } 95 + 96 + render { 97 + direct_scanout=1 98 + expand_undersized_textures=false 99 + } 100 + 101 + ${concatMapStringsSep "\n" (x: "monitor=${x}") cfg.hyprland.monitor} 102 + monitor=, preferred, auto, 1 103 + ''; 104 + }; 105 + }
+1 -19
modules/desktop/session.nix
··· 54 54 theme = gtkTheme; 55 55 settings.GTK.application_prefer_dark_theme = true; 56 56 }; 57 - hyprlock.enable = true; 58 - hyprland = { 59 - enable = true; 60 - withUWSM = true; 61 - xwayland.enable = true; 62 - }; 63 57 }; 64 58 65 - security = { 66 - polkit.enable = true; 67 - pam.services.hyprlock = {}; 68 - }; 69 - 70 - xdg.portal = { 71 - enable = true; 72 - xdgOpenUsePortal = true; 73 - extraPortals = with pkgs; [ 74 - xdg-desktop-portal-hyprland 75 - xdg-desktop-portal-gtk 76 - ]; 77 - }; 59 + security.polkit.enable = true; 78 60 }; 79 61 }