From 915a1a3b295b2cb5ad4e12067ac6edc9acd74981 Mon Sep 17 00:00:00 2001 From: Varris Date: Tue, 30 Jan 2024 18:51:06 +0100 Subject: [PATCH] update --- flake.nix | 22 ++++++++++++++---- overlay.nix | 18 +++++++-------- system/configuration.nix | 9 +++++--- system/programs/default.nix | 5 ++++ user/configs/firefox/default.nix | 6 +++++ user/configs/fish/default.nix | 11 +++++---- user/configs/helix/default.nix | 21 ++++++++++++++--- user/configs/lf/default.nix | 27 ++-------------------- user/configs/mpv/default.nix | 10 +++++++- user/configs/tmux/default.nix | 4 ++++ user/configs/wayland/eww/config/eww.yuck | 10 ++++---- user/configs/wayland/hyprland/default.nix | 2 +- user/configs/wayland/hyprland/settings.nix | 13 +++++------ user/configs/wezterm/default.nix | 2 +- user/home.nix | 20 +++++++++++++--- 15 files changed, 113 insertions(+), 67 deletions(-) diff --git a/flake.nix b/flake.nix index c5db52e..5b950b1 100755 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,7 @@ }; hyprland = { + # url = "github:hyprwm/hyprland/12d79d63421e2ed3f31130755c7a37f0e4fb5cb1"; url = "github:hyprwm/hyprland"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -100,14 +101,23 @@ self.overlays.default ]; }; + + #edit as you see fit + hostName = "terra"; + userName = "manuel"; + flakeDir = "/home/${userName}/.dotfiles"; in { formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra; overlays = import ./overlay.nix {inherit inputs;}; - nixosConfigurations.terra = nixpkgs.lib.nixosSystem { + nixosConfigurations.${hostName} = nixpkgs.lib.nixosSystem { inherit system; inherit pkgs; - specialArgs = {inherit inputs;}; + specialArgs = { + inherit inputs; + inherit hostName; + inherit userName; + }; modules = [ ./system/configuration.nix inputs.chaotic-nyx.nixosModules.default @@ -115,9 +125,13 @@ ]; }; - homeConfigurations.manuel = home-manager.lib.homeManagerConfiguration { + homeConfigurations.${userName} = home-manager.lib.homeManagerConfiguration { inherit pkgs; - extraSpecialArgs = {inherit inputs;}; + extraSpecialArgs = { + inherit inputs; + inherit userName; + inherit flakeDir; + }; modules = [ ./user/home.nix inputs.nix-index-database.hmModules.nix-index diff --git a/overlay.nix b/overlay.nix index f78a75b..620fd20 100755 --- a/overlay.nix +++ b/overlay.nix @@ -27,6 +27,15 @@ version = "9999"; src = inputs.openmw-git; buildInputs = (prev.lib.lists.remove prev.mygui old.buildInputs) ++ [prev.libyamlcpp prev.luajit prev.collada-dom final.mygui-openmw]; + cmakeFlags = + old.cmakeFlags + ++ [ + "-DBUILD_BSATOOL=OFF" + "-DBUILD_BULLETOBJECTTOOL=OFF" + "-DBUILD_ESMTOOL=OFF" + "-DBUILD_NIFTEST=OFF" + "-DBUILD_OPENCS=OFF" + ]; patches = []; }); @@ -42,14 +51,5 @@ prev.mpg123 ]; }; - - vimPlugins = - prev.vimPlugins - // { - presence-nvim = prev.vimUtils.buildVimPlugin { - name = "presence"; - src = inputs.nvim-presence; - }; - }; }; } diff --git a/system/configuration.nix b/system/configuration.nix index c539859..0acd75c 100755 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -3,6 +3,8 @@ lib, config, inputs, + hostName, + userName, ... }: { imports = [ @@ -41,7 +43,7 @@ powerManagement.cpuFreqGovernor = "schedutil"; networking = { - hostName = "terra"; # Define your hostname. + hostName = "${hostName}"; #hostname declared in flake.nix firewall.enable = false; useNetworkd = true; extraHosts = '' @@ -84,7 +86,7 @@ enable = true; extraRules = [ { - users = ["manuel"]; + users = ["${userName}"]; keepEnv = true; persist = true; } @@ -92,7 +94,7 @@ }; }; - users.users.manuel = { + users.users.${userName} = { isNormalUser = true; extraGroups = ["audio" "games" "input" "lp" "networkmanager" "scanner" "users" "vboxusers" "video" "wheel"]; shell = pkgs.fish; @@ -167,6 +169,7 @@ settings = { auto-optimise-store = true; + extra-sandbox-paths = [config.programs.ccache.cacheDir]; substituters = [ "https://nyx.chaotic.cx" diff --git a/system/programs/default.nix b/system/programs/default.nix index 1696869..9d5558c 100644 --- a/system/programs/default.nix +++ b/system/programs/default.nix @@ -1,5 +1,10 @@ {pkgs, ...}: { programs = { + adb.enable = true; + ccache = { + enable = true; + packageNames = ["openmw"]; + }; dconf.enable = true; fish.enable = true; hyprland.enable = true; diff --git a/user/configs/firefox/default.nix b/user/configs/firefox/default.nix index 9de3868..b572a32 100755 --- a/user/configs/firefox/default.nix +++ b/user/configs/firefox/default.nix @@ -23,9 +23,11 @@ redirector return-youtube-dislikes sponsorblock + startpage-private-search stylus tampermonkey ublock-origin + vimium youtube-shorts-block ]; @@ -45,6 +47,10 @@ name = "NixOS Search"; url = "https://search.nixos.org"; } + { + name = "NUR Search"; + url = "https://nur.nix-community.org"; + } { name = "Home Manager Options List"; url = "https://nix-community.github.io/home-manager/options.xhtml"; diff --git a/user/configs/fish/default.nix b/user/configs/fish/default.nix index 017f1a7..a282680 100755 --- a/user/configs/fish/default.nix +++ b/user/configs/fish/default.nix @@ -2,6 +2,7 @@ config, pkgs, inputs, + flakeDir, ... }: { programs.fish = { @@ -32,20 +33,20 @@ fish_greeting = ""; nor = '' - doas nixos-rebuild switch --flake ${config.home.homeDirectory}/.dotfiles + doas nixos-rebuild switch --flake ${flakeDir} ''; hms = '' - home-manager switch --flake ${config.home.homeDirectory}/.dotfiles + home-manager switch --flake ${flakeDir} ''; nou = '' - nix flake update ${config.home.homeDirectory}/.dotfiles --commit-lock-file - doas nixos-rebuild switch --upgrade --flake ${config.home.homeDirectory}/.dotfiles + nix flake update ${flakeDir} --commit-lock-file + doas nixos-rebuild switch --upgrade --flake ${flakeDir} ''; }; shellAliases = { - ec = "hx ~/.dotfiles"; + ec = "hx ${flakeDir}"; nf = "${pkgs.fastfetch}/bin/fastfetch"; ls = "${pkgs.eza}/bin/eza --icons"; ll = "${pkgs.eza}/bin/eza --icons -l"; diff --git a/user/configs/helix/default.nix b/user/configs/helix/default.nix index 381afdf..08d2d80 100644 --- a/user/configs/helix/default.nix +++ b/user/configs/helix/default.nix @@ -2,6 +2,7 @@ config, inputs, pkgs, + flakeDir, ... }: { programs.helix = { @@ -13,6 +14,21 @@ custom-gruvbox = { inherits = "gruvbox"; "ui.background" = {bg = "none";}; + "ui.statusline.normal" = { + bg = "#AA9A85"; + fg = "#232323"; + modifiers = ["bold"]; + }; + "ui.statusline.insert" = { + bg = "#84A799"; + fg = "#232323"; + modifiers = ["bold"]; + }; + "ui.statusline.select" = { + bg = "#FE8112"; + fg = "#232323"; + modifiers = ["bold"]; + }; }; }; @@ -36,8 +52,7 @@ statusline = { separator = "|"; - left = ["mode" "separator" "spinner"]; - center = ["file-name"]; + left = ["mode" "file-name"]; right = ["selections" "file-type" "position"]; mode.normal = "NORMAL"; @@ -53,7 +68,7 @@ keys.normal = { "esc" = ["collapse_selection" "keep_primary_selection"]; - space."e" = ":open ~/.dotfiles"; + space."e" = ":open ${flakeDir}"; }; }; diff --git a/user/configs/lf/default.nix b/user/configs/lf/default.nix index f66a1a8..303796d 100755 --- a/user/configs/lf/default.nix +++ b/user/configs/lf/default.nix @@ -1,24 +1,4 @@ -{pkgs, ...}: let - previewer = pkgs.writeShellScriptBin "pv.sh" '' - file=$1 - w=$2 - h=$3 - x=$4 - y=$5 - - if [[ "$( ${pkgs.file}/bin/file -Lb --mime-type "$file")" =~ ^image ]]; then - # ''${pkgs.kitty}/bin/kitty +kitten icat --silent --stdin no --transfer-mode file --place "''${w}x''${h}@''${x}x''${y}" "$file" < /dev/null > /dev/tty - ${pkgs.chafa}/bin/chafa -f kitty "$file" - exit 1 - fi - - ${pkgs.pistol}/bin/pistol "$file" - ''; - - cleaner = pkgs.writeShellScriptBin "clean.sh" '' - ${pkgs.kitty}/bin/kitty +kitten icat --clear --stdin no --silent --transfer-mode file < /dev/null > /dev/tty - ''; -in { +{pkgs, ...}: { xdg.configFile."lf/icons".source = ./icons; programs.lf = { @@ -29,10 +9,7 @@ in { icons = true; ignorecase = true; preview = true; - - #image previewer - cleaner = "${cleaner}/bin/clean.sh"; - previewer = "${previewer}/bin/pv.sh"; + sixel = true; }; }; } diff --git a/user/configs/mpv/default.nix b/user/configs/mpv/default.nix index 7ebd76b..c58c6a7 100755 --- a/user/configs/mpv/default.nix +++ b/user/configs/mpv/default.nix @@ -1,4 +1,4 @@ -{ +{pkgs, ...}: { programs.mpv = { enable = true; config = { @@ -7,6 +7,14 @@ hwdec = "vaapi"; force-window = "yes"; ao = "pipewire"; + video-sync = "display-resample"; }; + + scripts = with pkgs.mpvScripts; [ + quality-menu + uosc + sponsorblock + thumbfast + ]; }; } diff --git a/user/configs/tmux/default.nix b/user/configs/tmux/default.nix index 0c97ebd..16fa69b 100755 --- a/user/configs/tmux/default.nix +++ b/user/configs/tmux/default.nix @@ -5,5 +5,9 @@ }: { programs.tmux = { enable = true; + + plugins = with pkgs; [ + tmuxPlugins.sensible + ]; }; } diff --git a/user/configs/wayland/eww/config/eww.yuck b/user/configs/wayland/eww/config/eww.yuck index e6667eb..a5926d9 100644 --- a/user/configs/wayland/eww/config/eww.yuck +++ b/user/configs/wayland/eww/config/eww.yuck @@ -1,5 +1,5 @@ (defpoll TIME :interval "1s" "date '+%H:%M'") -(defpoll VOL :interval "1s" "scripts/getvol") +;; (defpoll VOL :interval "1s" "scripts/getvol") (deflisten ACTIVEWINDOW :initial "[]" "hyprland-activewindow _") (deflisten WORKSPACE0 :initial "[]" "hyprland-workspaces $(hyprctl monitors -j | jq -r \".[0].name\")") @@ -88,10 +88,10 @@ ) (defwidget widget_time [monitor] - (box - :class "widget-time" - TIME - ) + (box + :class "widget-time" + TIME + ) ) ;; -------------------------- diff --git a/user/configs/wayland/hyprland/default.nix b/user/configs/wayland/hyprland/default.nix index 4280068..ad21c96 100755 --- a/user/configs/wayland/hyprland/default.nix +++ b/user/configs/wayland/hyprland/default.nix @@ -26,7 +26,7 @@ [Desktop Action setSWWWWallpaper] Name=Set Image as Wallpaper - Exec=swww img "%f" && ln -sf "%f" ~/.cache/swww/wallpaper + Exec=swww img "%f" ''; home.packages = [ diff --git a/user/configs/wayland/hyprland/settings.nix b/user/configs/wayland/hyprland/settings.nix index 1b6dda0..de7842e 100644 --- a/user/configs/wayland/hyprland/settings.nix +++ b/user/configs/wayland/hyprland/settings.nix @@ -101,7 +101,6 @@ "${pkgs.openrgb}/bin/openrgb --startminimized --profile autorun.orp" "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" "${pkgs.ydotool}/bin/ydotoold" - "${pkgs.bitwarden}/bin/bitwarden" ]; exec = [ @@ -125,12 +124,12 @@ "${modKey}, 5, workspace, 5" "${modKey}, 6, workspace, 6" - "${modKey} SHIFT, 1, movetoworkspace, 1" - "${modKey} SHIFT, 2, movetoworkspace, 2" - "${modKey} SHIFT, 3, movetoworkspace, 3" - "${modKey} SHIFT, 4, movetoworkspace, 4" - "${modKey} SHIFT, 5, movetoworkspace, 5" - "${modKey} SHIFT, 6, movetoworkspace, 6" + "${modKey} SHIFT, 1, movetoworkspacesilent, 1" + "${modKey} SHIFT, 2, movetoworkspacesilent, 2" + "${modKey} SHIFT, 3, movetoworkspacesilent, 3" + "${modKey} SHIFT, 4, movetoworkspacesilent, 4" + "${modKey} SHIFT, 5, movetoworkspacesilent, 5" + "${modKey} SHIFT, 6, movetoworkspacesilent, 6" "${modKey}, P, pseudo, # dwindle" "${modKey}, J, togglesplit, # dwindle" diff --git a/user/configs/wezterm/default.nix b/user/configs/wezterm/default.nix index 179b017..5952e22 100755 --- a/user/configs/wezterm/default.nix +++ b/user/configs/wezterm/default.nix @@ -23,7 +23,7 @@ font = wezterm.font "JetBrainsMono Nerd Font", font_size = 10, - color_scheme = 'Gruvbox Dark (Gogh)', + color_scheme = "Gruvbox Dark (Gogh)", hide_tab_bar_if_only_one_tab = true, line_height = 1.1, window_background_opacity = 0.9, diff --git a/user/home.nix b/user/home.nix index 6cb4d14..cfdc230 100755 --- a/user/home.nix +++ b/user/home.nix @@ -3,6 +3,7 @@ pkgs, lib, inputs, + userName, ... }: { imports = [ @@ -23,8 +24,8 @@ ./configs/xdg-mime.nix ]; - home.username = "manuel"; - home.homeDirectory = "/home/manuel"; + home.username = "${userName}"; + home.homeDirectory = "/home/${userName}"; home.packages = with pkgs; [ appimage-run armcord @@ -72,15 +73,17 @@ twemoji-color-font vimv vulkan-tools + wineWowPackages.staging + winetricks wqy_zenhei #fix for missing non-ascii fonts in TF2 xdg-utils - ]; home.sessionVariables = { GTK_THEME = "${builtins.toString config.gtk.theme.name}"; NIXOS_OZONE_WL = "1"; NIXPKGS_ALLOW_UNFREE = "1"; + WINEDEBUG = "fixme-all"; WINEDLLOVERRIDES = "winemenubuilder.exe=d"; }; @@ -162,6 +165,14 @@ enable = true; plugins = [pkgs.obs-studio-plugins.obs-vkcapture]; }; + + rbw = { + enable = true; + settings = { + pinentry = "gtk2"; + email = "varris@posteo.net"; + }; + }; }; services.gnome-keyring.enable = true; @@ -179,6 +190,9 @@ download = "/mnt/hdd/Downloads"; }; + home.file."Downloads".source = config.lib.file.mkOutOfStoreSymlink "/mnt/hdd/Downloads"; + home.file."Music".source = config.lib.file.mkOutOfStoreSymlink "/mnt/hdd/Music"; + programs.home-manager.enable = true; home.stateVersion = "23.05";