mirror of
https://github.com/ParkerTenBroeck/dotfiles.git
synced 2026-06-06 21:00:35 -04:00
added work laptop config
This commit is contained in:
parent
8a4f715cbb
commit
3b1bfaccb7
4 changed files with 139 additions and 2 deletions
116
hosts/work.nix
116
hosts/work.nix
|
|
@ -1,17 +1,129 @@
|
|||
{
|
||||
{ pkgs, lib, config, ... }:
|
||||
|
||||
let
|
||||
hyprOneLine = script:
|
||||
"sh -c ${lib.escapeShellArg (lib.concatStringsSep "; " (
|
||||
builtins.filter (line: line != "") (
|
||||
map lib.trim (lib.splitString "\n" script)
|
||||
)
|
||||
))}";
|
||||
|
||||
chromiumX11 = pkgs.symlinkJoin {
|
||||
name = "chromium";
|
||||
paths = [
|
||||
(pkgs.writeShellScriptBin "chromium" ''
|
||||
exec ${pkgs.chromium}/bin/chromium --ozone-platform=x11 "$@"
|
||||
'')
|
||||
|
||||
(pkgs.makeDesktopItem {
|
||||
name = "chromium";
|
||||
desktopName = "Chromium";
|
||||
genericName = "Web Browser";
|
||||
exec = "chromium %U";
|
||||
icon = "chromium";
|
||||
categories = [ "Network" "WebBrowser" ];
|
||||
mimeTypes = [
|
||||
"text/html"
|
||||
"x-scheme-handler/http"
|
||||
"x-scheme-handler/https"
|
||||
];
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
hyprRun = pkgs.writeShellScript "hypr-run-nvidia" ''
|
||||
export XDG_CURRENT_DESKTOP=Hyprland
|
||||
export XDG_SESSION_DESKTOP=Hyprland
|
||||
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||
export GBM_BACKEND=nvidia
|
||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||
export XCURSOR_SIZE=24
|
||||
export WLR_DRM_DEVICES=$HOME/.config/hypr/card
|
||||
|
||||
export __NV_PRIME_RENDER_OFFLOAD=1
|
||||
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
|
||||
export __VK_LAYER_NV_optimus=NVIDIA_only
|
||||
|
||||
exec ${pkgs.hyprland}/bin/Hyprland
|
||||
'';
|
||||
in {
|
||||
imports = [
|
||||
./common.nix
|
||||
/home/may/Documents/GitHub/mywt/nixos-wt-httpd.nix
|
||||
../modules/networking.nix
|
||||
../modules/bluetooth.nix
|
||||
../modules/nvidia.nix
|
||||
../modules/fonts.nix
|
||||
../modules/packages.nix
|
||||
../modules/tex.nix
|
||||
../modules/docker.nix
|
||||
../modules/hyprland
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
networking.hostName = "work";
|
||||
networking.firewall.allowedTCPPorts = [ 5900 8026 25565 42069 8000 8080 ];
|
||||
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
services.wtLocal = {
|
||||
enable = true;
|
||||
root = "/home/may/Documents/GitHub/wt";
|
||||
user = "may";
|
||||
group = "users";
|
||||
};
|
||||
|
||||
home-manager.users.may.wayland.windowManager.hyprland.settings.exec-once = lib.mkAfter [
|
||||
(hyprOneLine ''
|
||||
sleep 2
|
||||
|
||||
hyprctl dispatch exec "[workspace 1 silent] chromium --restore-last-session"
|
||||
|
||||
hyprctl dispatch exec "[workspace 2 silent] code /home/may/Documents/GitHub/wt"
|
||||
hyprctl dispatch exec "[workspace 2 silent] alacritty --working-directory /home/may/Documents/GitHub/wt"
|
||||
|
||||
hyprctl dispatch exec "[workspace 2 silent] code /home/may/Documents/GitHub/mywt"
|
||||
hyprctl dispatch exec "[workspace 2 silent] alacritty --working-directory /home/may/Documents/GitHub/mywt"
|
||||
|
||||
hyprctl dispatch exec "[workspace 4 silent] firefox"
|
||||
'')
|
||||
];
|
||||
|
||||
home-manager.users.may.home.packages = [
|
||||
chromiumX11
|
||||
] ++ (with pkgs; [
|
||||
docker
|
||||
killall
|
||||
wayvnc
|
||||
wlr-randr
|
||||
]);
|
||||
|
||||
environment.sessionVariables = {
|
||||
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||
GBM_BACKEND = "nvidia";
|
||||
_JAVA_AWT_WM_NONREPARENTING = "1";
|
||||
XCURSOR_SIZE = "24";
|
||||
|
||||
__NV_PRIME_RENDER_OFFLOAD = "1";
|
||||
__NV_PRIME_RENDER_OFFLOAD_PROVIDER = "NVIDIA-G0";
|
||||
__VK_LAYER_NV_optimus = "NVIDIA_only";
|
||||
};
|
||||
|
||||
hardware.nvidia.prime = {
|
||||
sync.enable = true;
|
||||
intelBusId = "PCI:0:2:0";
|
||||
nvidiaBusId = "PCI:0:0:0";
|
||||
};
|
||||
|
||||
|
||||
services.greetd = lib.mkIf (config.services.greetd.enable && config.programs.hyprland.enable) {
|
||||
settings = {
|
||||
initial_session.command = lib.mkForce "${hyprRun}";
|
||||
default_session.command =
|
||||
lib.mkForce "${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd ${hyprRun}";
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
home-manager.users.may.home.stateVersion = "25.11";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,5 +12,7 @@
|
|||
screen
|
||||
ranger # file manager
|
||||
ripgrep
|
||||
cloc
|
||||
gdu
|
||||
];
|
||||
}
|
||||
4
modules/docker.nix
Normal file
4
modules/docker.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
virtualisation.docker.enable = true;
|
||||
users.users.may.extraGroups = [ "docker" ];
|
||||
}
|
||||
19
modules/nvidia.nix
Normal file
19
modules/nvidia.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, pkgs, ... }: {
|
||||
|
||||
hardware.graphics.enable = true;
|
||||
nixpkgs.config.nvidia.acceptLicense = true;
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
nvidiaSettings = true;
|
||||
powerManagement.enable = false;
|
||||
powerManagement.finegrained = false;
|
||||
open = false;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
home-manager.users.may.home.packages = with pkgs; [
|
||||
nvtopPackages.nvidia
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue