add nvidia driver & monitors

This commit is contained in:
danny 2024-12-13 22:30:05 +08:00
parent c2f85fddb8
commit 3e6847c1ef
67 changed files with 1773 additions and 101 deletions

View file

@ -13,5 +13,8 @@ in {
".config/btop".source = "${configDir}/btop";
".config/wofi".source = "${configDir}/wofi";
".config/mako".source = "${configDir}/mako";
# ".config/starship.toml".source = "${configDir}/starship/starship.toml";
".config/macchiato.toml".source = "${configDir}/starship/macchiato.toml";
".config/nushell".source = "${configDir}/nushell";
};
}

6
home/user/offload Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"

View file

@ -1,8 +1,8 @@
{ pkgs, ... }:
{
home.packages = [
pkgs.vscode
pkgs.opera
pkgs.discord
@ -35,7 +35,6 @@
# Utils
pkgs.viewnior
pkgs.hyprshot
pkgs.catppuccin-cursors.macchiatoBlue
pkgs.catppuccin-gtk
# pkgs.papirus-folders

View file

@ -0,0 +1,75 @@
{ pkgs, ... }:
let
treesitterWithGrammars = (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [
p.bash
p.comment
p.css
p.dockerfile
p.fish
p.gitattributes
p.gitignore
p.go
p.gomod
p.gowork
p.hcl
p.javascript
p.jq
p.json5
p.json
p.lua
p.make
p.markdown
p.nix
p.python
p.rust
p.toml
p.typescript
p.vue
p.yaml
]));
treesitter-parsers = pkgs.symlinkJoin {
name = "treesitter-parsers";
paths = treesitterWithGrammars.dependencies;
};
in
{
home.packages = with pkgs; [
ripgrep
fd
lua-language-server
rust-analyzer-unwrapped
black
gh
];
programs.neovim = {
enable = true;
package = pkgs.neovim;
vimAlias = true;
coc.enable = false;
withNodeJs = true;
plugins = [
treesitterWithGrammars
];
};
home.file."./.config/nvim/" = {
source = ../../../config/nvim;
recursive = true;
};
home.file."./.config/nvim/init.lua".text = ''
require("config.lazy")
vim.opt.runtimepath:append("${treesitter-parsers}")
'';
# Treesitter is configured as a locally developed module in lazy.nvim
# we hardcode a symlink here so that we can refer to it in our lazy config
home.file."./.local/share/nvim/nix/nvim-treesitter/" = {
recursive = true;
source = treesitterWithGrammars;
};
}

View file

@ -0,0 +1,10 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p patchelf
# Fixes linking for NixOS
# ./fx_loader.sh ~/.local/share/nvim/mason/packages/rust-analyzer/rust-analyzer
for binary in ${@}; do
patchelf \
--set-interpreter "$(cat ${NIX_CC}/nix-support/dynamic-linker)" \
"${binary}"
done

View file

@ -2,7 +2,6 @@
let
myAliases = {
cat = "bat";
ls = "eza --icons=always";
fullClean = ''
nix-collect-garbage --delete-old
@ -12,24 +11,35 @@ let
sudo /run/current-system/bin/switch-to-configuration boot
'';
rebuild = "sudo nixos-rebuild switch --flake /etc/nixos/#dn-nix";
windows = "sudo bootctl set-oneshot auto-windows";
toWindows = "sudo bootctl set-oneshot auto-windows && reboot";
};
in {
programs = {
zsh = {
nushell = {
enable = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
initExtra = ''
source ~/.p10k.zsh &&
eval "$(zoxide init --cmd cd zsh)" &&
'';
shellAliases = myAliases;
oh-my-zsh = {
enable = true;
custom = "$HOME/.oh-my-custom";
theme = "powerlevel10k/powerlevel10k";
plugins = [ "git" "history" "wd" ];
};
# configFile.source = ../config/nushell/config.nu;
# envFile.source = ../config/nushell/env.nu;
};
zsh = {
enable = true;
shellAliases = myAliases;
};
# carapace.enable = true;
# carapace.enableNushellIntegration = true;
# starship = {
# enable = true;
# settings = {
# add_newline = true;
# };
# };
#
# zoxide = {
# enable = true;
# enableNushellIntegration = true;
# };
};
}