more laptop config
This commit is contained in:
parent
c79f514dbe
commit
4fed5d2c38
6 changed files with 92 additions and 48 deletions
12
flake.lock
12
flake.lock
|
@ -187,11 +187,11 @@
|
||||||
"utils": "utils_2"
|
"utils": "utils_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1661323822,
|
"lastModified": 1661371005,
|
||||||
"narHash": "sha256-1UGGcQ00uSo5cPTwL7C3S1zkcScbpF0WzspvnceWkbQ=",
|
"narHash": "sha256-PfWRIyJQhBtVhENqmVcI+C9kisctmzos+nrH+feGX3U=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "1d81e6295ca530603478114f4977402d51299ad8",
|
"rev": "b382b59faf717c5b36f4cd8e1c5d96cdabd382c9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -206,11 +206,11 @@
|
||||||
"wlroots": "wlroots"
|
"wlroots": "wlroots"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1661332451,
|
"lastModified": 1661371527,
|
||||||
"narHash": "sha256-Ikd8XUJ3rQLYz6z+OMrecpXD2CvrPHM3VIfadkpxGTI=",
|
"narHash": "sha256-gOfHnXvncOW3+zTAMFFMgVqFOBcTaI4gdiKBd7gN7go=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "Hyprland",
|
"repo": "Hyprland",
|
||||||
"rev": "9366c187dce5ed5104f85898c8d3a8531f221e3e",
|
"rev": "e92469121d37af387cb7fa507ae6ac6225cb9ebc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
2
nixos/hosts/thalassa/null/README.md
Normal file
2
nixos/hosts/thalassa/null/README.md
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# null
|
||||||
|
This folder contains the NixOS configuration for my laptop, with hostname `null`.
|
|
@ -9,8 +9,26 @@ let
|
||||||
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
|
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
|
||||||
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||||
export __VK_LAYER_NV_optimus=NVIDIA_only
|
export __VK_LAYER_NV_optimus=NVIDIA_only
|
||||||
|
export LIBVA_DRIVER_NAME=nvidia
|
||||||
|
export GBM_BACKEND=nvidia-drm
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
'';
|
'';
|
||||||
|
run-hyprland = pkgs.writeShellScriptBin "run-hyprland" ''
|
||||||
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
|
export XCURSOR_SIZE=24
|
||||||
|
|
||||||
|
export CLUTTER_BACKEND=wayland
|
||||||
|
export XDG_SESSION_TYPE=wayland
|
||||||
|
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
|
||||||
|
export MOZ_ENABLE_WAYLAND=1
|
||||||
|
export WLR_NO_HARDWARE_CURSORS=1
|
||||||
|
export WLR_BACKEND=vulkan
|
||||||
|
export QT_QPA_PLATFORM=wayland
|
||||||
|
export GDK_BACKEND=wayland
|
||||||
|
|
||||||
|
exec Hyprland
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
|
@ -27,6 +45,8 @@ in
|
||||||
inputs.hyprland.homeManagerModules.default
|
inputs.hyprland.homeManagerModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
|
programs.light.enable = true;
|
||||||
|
|
||||||
fonts = {
|
fonts = {
|
||||||
fonts = with pkgs; [
|
fonts = with pkgs; [
|
||||||
material-design-icons
|
material-design-icons
|
||||||
|
@ -71,7 +91,6 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# Select internationalisation properties.
|
# Select internationalisation properties.
|
||||||
i18n.defaultLocale = "en_GB.utf8";
|
i18n.defaultLocale = "en_GB.utf8";
|
||||||
|
|
||||||
|
@ -87,20 +106,12 @@ in
|
||||||
LC_TIME = "en_DK.utf8";
|
LC_TIME = "en_DK.utf8";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable the X11 windowing system.
|
|
||||||
# services.xserver.enable = true;
|
|
||||||
|
|
||||||
# Enable the GNOME Desktop Environment.
|
|
||||||
# services.xserver.displayManager.gdm.enable = true;
|
|
||||||
# services.xserver.desktopManager.gnome.enable = true;
|
|
||||||
# services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
|
|
||||||
|
|
||||||
xdg = {
|
xdg = {
|
||||||
portal = {
|
portal = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wlr.enable = true;
|
wlr.enable = true;
|
||||||
extraPortals = with pkgs; [
|
extraPortals = with pkgs; [
|
||||||
# xdg-desktop-portal-gtk
|
xdg-desktop-portal-gtk
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -111,7 +122,14 @@ in
|
||||||
package = null; # Managed by home manager
|
package = null; # Managed by home manager
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.loginShellInit = ''
|
||||||
|
if [[ "$(tty)" == /dev/tty1 ]]; then
|
||||||
|
${run-hyprland}/bin/run-hyprland
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
|
# enable = true;
|
||||||
layout = "us";
|
layout = "us";
|
||||||
xkbVariant = "altgr-intl";
|
xkbVariant = "altgr-intl";
|
||||||
xkbOptions = "caps:swapescape";
|
xkbOptions = "caps:swapescape";
|
||||||
|
@ -119,15 +137,24 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
# hardware.nvidia.modesetting.enable = true;
|
# hardware.nvidia.modesetting.enable = true;
|
||||||
hardware.nvidia.prime = {
|
hardware.nvidia = {
|
||||||
|
# open = true;
|
||||||
|
prime = {
|
||||||
offload.enable = true;
|
offload.enable = true;
|
||||||
intelBusId = "PCI:0:2:0";
|
intelBusId = "PCI:0:2:0";
|
||||||
nvidiaBusId = "PCI:1:0:0";
|
nvidiaBusId = "PCI:1:0:0";
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
hardware.opengl.extraPackages = with pkgs; [
|
hardware.opengl = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
vaapiVdpau
|
vaapiVdpau
|
||||||
|
intel-media-driver # LIBVA_DRIVER_NAME=iHD
|
||||||
|
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
|
||||||
|
libvdpau-va-gl
|
||||||
];
|
];
|
||||||
|
};
|
||||||
|
|
||||||
virtualisation.podman.enable = true;
|
virtualisation.podman.enable = true;
|
||||||
|
|
||||||
|
@ -154,14 +181,11 @@ in
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
pciutils
|
pciutils
|
||||||
nvidia-offload
|
nvidia-offload
|
||||||
|
run-hyprland
|
||||||
vim
|
vim
|
||||||
wireguard-tools
|
wireguard-tools
|
||||||
slurp
|
slurp
|
||||||
|
gdb
|
||||||
#gnome.gnome-tweaks
|
|
||||||
#gnome.dconf-editor
|
|
||||||
#gnomeExtensions.appindicator
|
|
||||||
#gnomeExtensions.wireguard-indicator
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.steam = {
|
programs.steam = {
|
||||||
|
|
|
@ -8,8 +8,37 @@
|
||||||
grim # Screenshot tool
|
grim # Screenshot tool
|
||||||
wf-recorder # Screenrecorder
|
wf-recorder # Screenrecorder
|
||||||
wl-clipboard # Clipboard manager
|
wl-clipboard # Clipboard manager
|
||||||
|
networkmanager_dmenu
|
||||||
];
|
];
|
||||||
|
|
||||||
|
home.file.".config/networkmanager-dmenu/config.ini".text = ''
|
||||||
|
[dmenu]
|
||||||
|
dmenu_command = rofi -dmenu -i
|
||||||
|
# # Note that dmenu_command can contain arguments as well like:
|
||||||
|
# # `dmenu_command = rofi -dmenu -i -theme nmdm`
|
||||||
|
# # `dmenu_command = rofi -dmenu -width 30 -i`
|
||||||
|
# # `dmenu_command = dmenu -i -l 25 -b -nb #909090 -nf #303030`
|
||||||
|
# (Default: False) use rofi highlighting instead of '=='
|
||||||
|
rofi_highlight = true
|
||||||
|
# compact = <True or False> # (Default: False). Remove extra spacing from display
|
||||||
|
# pinentry = <Pinentry command> # (Default: None) e.g. `pinentry-gtk`
|
||||||
|
# wifi_chars = <string of 4 unicode characters representing 1-4 bars strength>
|
||||||
|
wifi_chars = ▂▄▆█
|
||||||
|
# list_saved = <True or False> # (Default: False) list saved connections
|
||||||
|
|
||||||
|
[dmenu_passphrase]
|
||||||
|
# # Uses the -password flag for Rofi, -x for bemenu. For dmenu, sets -nb and
|
||||||
|
# # -nf to the same color or uses -P if the dmenu password patch is applied
|
||||||
|
# # https://tools.suckless.org/dmenu/patches/password/
|
||||||
|
# obscure = True
|
||||||
|
# obscure_color = #222222
|
||||||
|
|
||||||
|
[editor]
|
||||||
|
# terminal = <name of terminal program>
|
||||||
|
terminal = alacritty
|
||||||
|
# gui_if_available = <True or False> (Default: True)
|
||||||
|
'';
|
||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
@ -18,6 +47,7 @@
|
||||||
|
|
||||||
monitor=eDP-1,1920x1080@60,0x0,1
|
monitor=eDP-1,1920x1080@60,0x0,1
|
||||||
monitor=eDP-1,addreserved,0,0,48,0
|
monitor=eDP-1,addreserved,0,0,48,0
|
||||||
|
monitor=,preferred,auto,1
|
||||||
|
|
||||||
general {
|
general {
|
||||||
layout = dwindle
|
layout = dwindle
|
||||||
|
@ -48,7 +78,7 @@
|
||||||
|
|
||||||
bind=,Print,exec,grim -g "$(slurp)" - | wl-copy -t image/png
|
bind=,Print,exec,grim -g "$(slurp)" - | wl-copy -t image/png
|
||||||
bind=SUPER,W,killactive,
|
bind=SUPER,W,killactive,
|
||||||
bind=SUPER,M,exit,
|
bind=SUPERSHIFT,Q,exit,
|
||||||
bind=SUPER,S,togglefloating,
|
bind=SUPER,S,togglefloating,
|
||||||
bind=SUPER,P,pseudo,
|
bind=SUPER,P,pseudo,
|
||||||
|
|
||||||
|
@ -93,13 +123,11 @@
|
||||||
windowrule=rounding 3,title:^(\s*)$
|
windowrule=rounding 3,title:^(\s*)$
|
||||||
windowrule=animation popin,title:^(\s*)$
|
windowrule=animation popin,title:^(\s*)$
|
||||||
|
|
||||||
bind=,XF86MonBrightnessUp,exec,brightnessctl set +5%
|
bind=,XF86MonBrightnessUp,exec,light -A 5
|
||||||
bind=,XF86MonBrightnessDown,exec,brightnessctl set 5%-
|
bind=,XF86MonBrightnessDown,exec,light -U 5
|
||||||
bind=,XF86MonRaiseVolume,exec,pamixer -i 5
|
bind=,XF86MonRaiseVolume,exec,pamixer -i 5
|
||||||
bind=,XF86MonLowerVolume,exec,pamixer -d 5
|
bind=,XF86MonLowerVolume,exec,pamixer -d 5
|
||||||
bind=,XF86AudioMute,exec,pamixer -t
|
bind=,XF86AudioMute,exec,pamixer -t
|
||||||
|
|
||||||
animation=workspaces,1,8,default,slidevert
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
eww-wayland
|
eww-wayland
|
||||||
brightnessctl
|
|
||||||
pamixer
|
pamixer
|
||||||
lua
|
lua
|
||||||
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
|
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
|
||||||
|
|
|
@ -1,26 +1,17 @@
|
||||||
#!/usr/bin/env lua
|
#!/usr/bin/env lua
|
||||||
|
|
||||||
function trim(s)
|
|
||||||
return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
|
|
||||||
end
|
|
||||||
|
|
||||||
aw = io.popen("hyprctl monitors | grep active | sed 's/()/(1)/g' | sort | awk 'NR>1{print $1}' RS='(' FS=')'")
|
aw = io.popen("hyprctl monitors | grep active | sed 's/()/(1)/g' | sort | awk 'NR>1{print $1}' RS='(' FS=')'")
|
||||||
active_workspace = aw:read("*a")
|
active_workspace = aw:read("*a")
|
||||||
aw:close()
|
aw:close()
|
||||||
|
|
||||||
ew = io.popen("hyprctl workspaces | grep ID | sed 's/()/(1)/g' | sort | awk 'NR>1{print $1}' RS='(' FS=')'")
|
|
||||||
existing_workspaces = ew:read("*a")
|
|
||||||
ew:close()
|
|
||||||
|
|
||||||
box = "(box :orientation \"v\" :spacing 1 :space-evenly \"true\" "
|
box = "(box :orientation \"v\" :spacing 1 :space-evenly \"true\" "
|
||||||
|
|
||||||
for i = 1, #existing_workspaces do
|
for i = 1,10 do
|
||||||
local c = existing_workspaces:sub(i,i)
|
if i == tonumber(active_workspace) then
|
||||||
if tonumber(c) == tonumber(active_workspace) then
|
local btn = "(button :class \"active\" :onclick \"hyprctl dispatch workspace "..i.." \" \"\")"
|
||||||
local btn = "(button :class \"active\" :onclick \"hyprctl dispatch workspace "..c.." \" \"\")"
|
|
||||||
box = box .. btn
|
box = box .. btn
|
||||||
elseif c ~= "\n" then
|
else
|
||||||
local btn = "(button :class \"inactive\" :onclick \"hyprctl dispatch workspace "..c.."\" \"\")"
|
local btn = "(button :class \"inactive\" :onclick \"hyprctl dispatch workspace "..i.."\" \"\")"
|
||||||
box = box .. btn
|
box = box .. btn
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue