diff options
author | Preston Pan <preston@nullring.xyz> | 2024-07-14 14:44:02 -0700 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2024-07-14 14:44:02 -0700 |
commit | 5e0544dad7d317607de0be9123fb4ca484027c87 (patch) | |
tree | 1555c1cc69cbe1e4b22ba98d9cf66b190e4047b7 | |
parent | 1296fcd66822b8ee4b0f6696bb1f06a501edc7ae (diff) |
run nix flake update
-rw-r--r-- | configuration.nix | 98 | ||||
-rw-r--r-- | flake.nix | 4 | ||||
-rw-r--r-- | home.nix | 84 |
3 files changed, 118 insertions, 68 deletions
diff --git a/configuration.nix b/configuration.nix index 83ac157..dd696e3 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,6 +1,7 @@ { config, pkgs, ... }: { + nixpkgs.config.cudaSupport = true; imports = [ ./hardware-configuration.nix @@ -11,9 +12,10 @@ boot.loader.efi.canTouchEfiVariables = true; networking.hostName = "continuity"; - # networking.wireless.enable = true; - networking.networkmanager.enable = true; + networking.firewall = { + allowedTCPPorts = [ 80 443 6600 8000 11434 7777 ]; + }; time.timeZone = "America/Vancouver"; @@ -25,17 +27,36 @@ hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; + hardware.graphics = { + enable = true; + extraPackages = with pkgs; [ + vaapiVdpau + libvdpau-va-gl + nvidia-vaapi-driver + ]; + }; services.blueman.enable = true; virtualisation.docker.enable = true; services.xserver = { + videoDrivers = [ "nvidia" ]; xkb.layout = "us"; xkb.variant = ""; xkb.options = "caps:escape"; }; + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = true; + powerManagement.finegrained = false; + nvidiaSettings = true; + open = false; + }; + hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; services.ollama = { enable = true; + acceleration = "cuda"; + host = "0.0.0.0"; }; services.printing.enable = true; @@ -43,13 +64,6 @@ sound.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; - services.xserver.windowManager.qtile = { - enable = true; - backend = "wayland"; - #backend = "x11"; - extraPackages = python3Packages: with python3Packages; [ - ]; - }; services.pipewire = { enable = true; alsa.enable = true; @@ -58,6 +72,7 @@ jack.enable = true; #media-session.enable = true; }; + services.udisks2.enable = true; services.kanata = { enable = true; @@ -86,6 +101,11 @@ git groff nixd + cudatoolkit + restic + cudaPackages.cudnn + cudaPackages.libcublas + linuxPackages.nvidia_x11 ]; programs.light.enable = true; @@ -93,7 +113,7 @@ xdg.portal = { enable = true; wlr.enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-kde ]; + extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal pkgs.xdg-desktop-portal-hyprland ]; config.common.default = "*"; }; @@ -107,41 +127,25 @@ pkgs.platformio-core.udev pkgs.openocd ]; - - # security.apparmor.enable = true; - # security.apparmor.policies = pkgs.apparmor-profiles; - # security.apparmor.killUnconfinedConfinables = true; -# boot.kernelParams = [ - # Slab/slub sanity checks, redzoning, and poisoning -# "slub_debug=FZP" - - # Overwrite free'd memory -# "page_poison=1" - - # Enable page allocator randomization -# "page_alloc.shuffle=1" -# ]; - - # Disable bpf() JIT (to eliminate spray attacks) -# boot.kernel.sysctl."net.core.bpf_jit_enable" = false; - - # Disable ftrace debugging -# boot.kernel.sysctl."kernel.ftrace_enabled" = false; - - # boot.kernel.sysctl."net.ipv4.conf.all.log_martians" = true; - # boot.kernel.sysctl."net.ipv4.conf.all.rp_filter" = "1"; - # boot.kernel.sysctl."net.ipv4.conf.default.log_martians" = true; - # boot.kernel.sysctl."net.ipv4.conf.default.rp_filter" = "1"; - - # boot.kernel.sysctl."net.ipv4.icmp_echo_ignore_broadcasts" = true; - - # boot.kernel.sysctl."net.ipv4.conf.all.accept_redirects" = false; - # boot.kernel.sysctl."net.ipv4.conf.all.secure_redirects" = false; - # boot.kernel.sysctl."net.ipv4.conf.default.accept_redirects" = false; - # boot.kernel.sysctl."net.ipv4.conf.default.secure_redirects" = false; - # boot.kernel.sysctl."net.ipv6.conf.all.accept_redirects" = false; - # boot.kernel.sysctl."net.ipv6.conf.default.accept_redirects" = false; - - # boot.kernel.sysctl."net.ipv4.conf.all.send_redirects" = false; - # boot.kernel.sysctl."net.ipv4.conf.default.send_redirects" = false; + services.calibre-server = { + enable = true; + host = "0.0.0.0"; + port = 7777; + user = "preston"; + group = "preston"; + }; + services.calibre-web = { + enable = true; + user = "preston"; + group = "preston"; + listen.port = 7777; + listen.ip = "0.0.0.0"; + openFirewall = true; + options = { + enableBookUploading = true; + enableKepubify = true; + enableBookConversion = true; + calibreLibrary = "/home/preston/books/"; + }; + }; } @@ -2,7 +2,9 @@ description = "A comprehensive NixOS+Emacs+HyprLand Configuration"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs = { + url = "github:nixos/nixpkgs/nixos-unstable"; + }; home-manager = { url = "github:nix-community/home-manager/release-23.11"; inputs.nixpkgs.follows = "nixpkgs"; @@ -1,5 +1,6 @@ -{ config, lib, nixpkgs, pkgs, wallpapers, scripts, ... }: +{ pkgs, wallpapers, scripts, ... }: { + nixpkgs.config.cudaSupport = true; home.enableNixpkgsReleaseCheck = false; home.username = "preston"; home.homeDirectory = "/home/preston"; @@ -14,7 +15,7 @@ grim light gnupg - (pass.withExtensions (ext: with ext; [ pass-audit pass-otp pass-import pass-genphrase pass-update pass-tomb])) + (pass.withExtensions (ext: with ext; [ pass-otp pass-import pass-genphrase pass-update pass-tomb])) passExtensions.pass-otp fira-code croc @@ -44,11 +45,10 @@ inkscape nixfmt-rfc-style podman-desktop - #monero-gui - electrum + monero-gui + # electrum fluffychat - iamb - #veracrypt + veracrypt imagemagick tor-browser qsynth @@ -58,10 +58,19 @@ graphviz vscode-langservers-extracted alsa-scarlett-gui + openscad + blender + krita + kdenlive + # telegram-desktop + # kicad + obs-studio + obs-cli + python312Packages.jedi + octaveFull (aspellWithDicts (dicts: with dicts; [ en en-computers en-science ])) (nerdfonts.override { fonts = [ "Iosevka" ]; }) - nodePackages.pyright ]; fonts.fontconfig.enable = true; xsession.enable = true; @@ -73,6 +82,7 @@ extraConfig = '' allow-emacs-pinentry allow-loopback-pinentry + ''; }; @@ -96,11 +106,23 @@ network.port = 6600; musicDirectory = "/home/preston/music"; playlistDirectory = "/home/preston/.config/mpd/playlists"; + network.listenAddress = "0.0.0.0"; extraConfig = '' audio_output { type "pipewire" name "pipewire output" } + audio_output { + type "httpd" + name "My HTTP Stream" + encoder "opus" # optional + port "8000" + # quality "5.0" # do not define if bitrate is defined + bitrate "128000" # do not define if quality is defined + format "48000:16:1" + always_on "yes" # prevent MPD from disconnecting all listeners when playback is stopped. + tags "yes" # httpd supports sending tags to listening streams. + } ''; }; @@ -170,7 +192,8 @@ r = "gammastep -O 3000"; ns = "nix-shell"; n = "nix"; - nf = "nix flake"; + nfu = "cd /etc/nixos/ && sudo nix flake update"; + rb = "sudo nixos-rebuild switch"; }; }; programs.mpv = { @@ -841,22 +864,18 @@ mainBar = { layer = "top"; position = "top"; - height = 30; + height = 50; output = [ - "LVDS-1" + "HDMI-A-1" + "DP-2" + "DP-3" ]; modules-left = [ "hyprland/workspaces" ]; modules-center = [ "hyprland/window" ]; modules-right = [ "battery" "clock" ]; - battery = { - bat = "BAT0"; - format = "{capacity}% {icon}"; - format-icons = [ "" "" "" "" "" ]; - }; - clock = { format = "{:%a %d, %b %H:%M}"; }; @@ -867,7 +886,11 @@ programs.zsh = { enable = true; initExtra = '' - source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh + export CUDA_PATH=${pkgs.cudatoolkit} + # export LD_LIBRARY_PATH=${pkgs.linuxPackages.nvidia_x11}/lib + export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib" + export EXTRA_CCFLAGS="-I/usr/include" + source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh ''; localVariables = { EDITOR = "emacsclient --create-frame --alternate-editor=vim"; @@ -883,6 +906,8 @@ g = "git"; v = "vim"; py = "python3"; + rb = "sudo nixos-rebuild switch"; + nfu = "cd /etc/nixos/ && sudo nix flake update"; }; loginExtra = '' if [ "$(tty)" = "/dev/tty1" ];then @@ -1046,6 +1071,12 @@ fi package = pkgs.hyprland; xwayland.enable = true; systemd.enable = true; +# extraConfig = '' +# device = { +# name = beken-usb-gaming-mouse-1 +# sensitivity = 0.5 +# }; +# ''; settings = { "$mod" = "SUPER"; exec-once = [ @@ -1056,11 +1087,21 @@ fi "fcitx5 -d --replace" "fcitx5-remote -r" "emacs" - "chromium" + "firefox" + ]; + env = [ + "LIBVA_DRIVER_NAME,nvidia" + "XDG_SESSION_TYPE,wayland" + "GBM_BACKEND,nvidia-drm" + "__GLX_VENDOR_LIBRARY_NAME,nvidia" + "ELECTRON_OZONE_PLATFORM_HINT,auto" ]; blurls = [ "waybar" ]; + monitor = [ + "Unknown-1,disable" + ]; windowrule = [ "workspace 1, ^(.*emacs.*)$" "workspace 2, ^(.*firefox.*)$" @@ -1076,13 +1117,13 @@ fi ]; bind = [ "$mod, F, exec, firefox" - "$mod, W, exec, chromium-browser" + "$mod, W, exec, chromium-browser --enable-features=UseOzonePlatform --ozone-platform=wayland" "$mod, Return, exec, kitty" "$mod, E, exec, emacs" "$mod, B, exec, electrum" + "$mod, T, exec, telegram-desktop" "$mod, M, exec, monero-wallet-gui" "$mod, V, exec, vesktop" - "$mod, T, exec, veracrypt" "$mod, C, exec, fluffychat" "$mod, D, exec, wofi --show run" "$mod, P, exec, bash ${scripts}/powermenu.sh" @@ -1150,6 +1191,9 @@ fi tap-to-click = true; }; }; + cursor = { + no_hardware_cursors = true; + }; misc = { force_default_wallpaper = 0; disable_hyprland_logo = true; |