From 0dd4f090016d9180d72197586871f70235d93fd6 Mon Sep 17 00:00:00 2001 From: vali Date: Wed, 10 Apr 2024 17:39:26 +0200 Subject: [PATCH] fully refactored stolen config :D --- flake.nix | 73 +--- hosts/common/default.nix | 62 --- hosts/common/packages.nix | 22 -- hosts/default.nix | 16 + hosts/vali/configuration.nix | 66 ++++ hosts/vali/default.nix | 8 + hosts/vali/desktop/boot.nix | 11 - hosts/vali/desktop/default.nix | 16 - hosts/vali/desktop/packages.nix | 29 -- .../{desktop => }/hardware-configuration.nix | 0 hosts/vali/laptop/default.nix | 0 hosts/vali/laptop/hardware-configuration.nix | 0 hosts/vali/laptop/packages.nix | 0 hosts/vali/profile.nix | 11 + hosts/vali/programs.nix | 57 +++ modules/vali/cli/default.nix | 7 + modules/vali/cli/git.nix | 63 +++ modules/vali/cli/starship.nix | 42 ++ modules/vali/cli/zsh.nix | 67 ++++ modules/vali/core/boot/boot.nix | 10 - modules/vali/default.nix | 8 +- modules/vali/gui/cursor.nix | 39 ++ modules/vali/gui/default.nix | 373 ++++++++++++++++++ modules/vali/gui/gtk.nix | 75 ++++ modules/vali/gui/mpv.nix | 32 ++ modules/vali/gui/qt.nix | 87 ++++ modules/vali/gui/schizofox.nix | 104 +++++ modules/vali/other/default.nix | 7 + modules/vali/other/home-manager.nix | 38 ++ modules/vali/other/system.nix | 28 ++ modules/vali/other/xdg.nix | 118 ++++++ modules/vali/services/default.nix | 5 + modules/vali/services/pipewire.nix | 16 + modules/vali/tui/btop.nix | 30 ++ modules/vali/tui/default.nix | 8 + modules/vali/tui/neovim.nix | 271 +++++++++++++ modules/vali/web/schizofox.nix | 0 options/common/pin-registry.nix | 4 + options/common/preserve-system.nix | 6 + 39 files changed, 1603 insertions(+), 206 deletions(-) delete mode 100644 hosts/common/default.nix delete mode 100644 hosts/common/packages.nix create mode 100644 hosts/vali/configuration.nix create mode 100644 hosts/vali/default.nix delete mode 100644 hosts/vali/desktop/boot.nix delete mode 100644 hosts/vali/desktop/default.nix delete mode 100644 hosts/vali/desktop/packages.nix rename hosts/vali/{desktop => }/hardware-configuration.nix (100%) delete mode 100644 hosts/vali/laptop/default.nix delete mode 100644 hosts/vali/laptop/hardware-configuration.nix delete mode 100644 hosts/vali/laptop/packages.nix create mode 100644 hosts/vali/profile.nix create mode 100644 hosts/vali/programs.nix create mode 100644 modules/vali/cli/default.nix create mode 100644 modules/vali/cli/git.nix create mode 100644 modules/vali/cli/starship.nix create mode 100644 modules/vali/cli/zsh.nix delete mode 100644 modules/vali/core/boot/boot.nix create mode 100644 modules/vali/gui/cursor.nix create mode 100644 modules/vali/gui/default.nix create mode 100644 modules/vali/gui/gtk.nix create mode 100644 modules/vali/gui/mpv.nix create mode 100644 modules/vali/gui/qt.nix create mode 100644 modules/vali/gui/schizofox.nix create mode 100644 modules/vali/other/default.nix create mode 100644 modules/vali/other/home-manager.nix create mode 100644 modules/vali/other/system.nix create mode 100644 modules/vali/other/xdg.nix create mode 100644 modules/vali/services/default.nix create mode 100644 modules/vali/services/pipewire.nix create mode 100644 modules/vali/tui/btop.nix create mode 100644 modules/vali/tui/default.nix create mode 100644 modules/vali/tui/neovim.nix delete mode 100644 modules/vali/web/schizofox.nix create mode 100644 options/common/pin-registry.nix create mode 100644 options/common/preserve-system.nix diff --git a/flake.nix b/flake.nix index b98ce31..77fa88e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,58 +1,27 @@ { - description = "Our NixOS config lol"; + description = "lololo"; + outputs = inputs @ { self, nixpkgs, ... }: + { + inherit (nixpkgs) lib; + nixosConfigurations = import ./hosts { inherit inputs; }; + }; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nur.url = "github:nix-community/NUR"; - schizofox.url = "github:schizofox/schizofox"; - home-manager = { - url = "github:nix-community/home-manager/"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = inputs @ { self, nixpkgs, nur, home-manager, ... }: - let - inherit (self) outputs; - mkSystem = { - hostname, - modules ? [], - user-configs ? [], - system ? "x86_64-linux" - }: - let - profile-config = { inherit hostname system modules user-configs; }; - in - nixpkgs.lib.nixosSystem { - inherit modules; - specialArgs = { inherit inputs outputs profile-config; }; - }; - mkHome = user: modules: pkgs: home-manager.lib.homeManagerConfiguration { - inherit modules pkgs user; - extraSpecialArgs = { inherit inputs outputs user; }; - }; - in { - nixpkgs.config.allowUnfree = true; - - nixosConfigurations = { - vlaptop = mkSystem { - hostname = "nixos"; - modules = [./hosts/vali/laptop ./modules/vali]; - user-configs = [{ - name = "vali"; - config = ./homes/vali/vlaptop.nix; - }]; - }; - vdesktop = mkSystem { - hostname = "nixos"; - modules = [ ./hosts/vali/desktop]; - user-configs = [{ - name = "vali"; - config = ./homes/vali/vdesktop.nix; - }]; - }; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; }; - }; + nur.url = "github:nix-community/NUR"; + agenix.url = "github:ryantm/agenix"; + + schizofox = { + url = "github:schizofox/schizofox"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + }; } diff --git a/hosts/common/default.nix b/hosts/common/default.nix deleted file mode 100644 index 8b227d3..0000000 --- a/hosts/common/default.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ inputs, outputs, profile-config, pkgs, ... }: - -{ - imports = [ - #profile-config.overlays - inputs.home-manager.nixosModules.home-manager - ./packages.nix - ]; - - services.locate = { - enable = true; - interval = "daily"; - package = pkgs.plocate; - localuser = null; - }; - - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - - home-manager.users = builtins.listToAttrs (builtins.map( - u-conf: { - inherit inputs; - name = u-conf.name; - value = import u-conf.config { inherit pkgs inputs outputs; user = u-conf.name; }; - } - )profile-config.user-configs); - - users.users = builtins.listToAttrs (builtins.map( - u-conf: { - name = u-conf.name; - value = { - initialPassword = "${u-conf.name}"; - isNormalUser = true; - extraGroups = [ "wheel" "audio" "video" "input"]; - }; - } - )profile-config.user-configs); - - time.timeZone = "Europe/Zurich"; - i18n.defaultLocale = "en_US.UTF-8"; - documentation.nixos.enable = false; - # Set the keyboard layout to german - # Eable CUPS - services.printing.enable = true; - # Sound settings - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - jack.enable = true; - pulse.enable = true; - wireplumber.enable = true; - alsa.support32Bit = true; - }; - nix = { - package = pkgs.nixFlakes; - extraOptions = "experimental-features = nix-command flakes"; - }; - system.stateVersion = "23.11"; -} diff --git a/hosts/common/packages.nix b/hosts/common/packages.nix deleted file mode 100644 index 3553785..0000000 --- a/hosts/common/packages.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ inputs, outputs, profile-config, pkgs, ... }: - -{ - environment.systemPackages = with pkgs; [ - vim - neovim - eza - zsh - git - zip - unzip - neofetch - fastfetch - wget - zoxide - python3 - gcc - htop - networkmanager - uwufetch - ]; -} diff --git a/hosts/default.nix b/hosts/default.nix index e69de29..3fa13ac 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -0,0 +1,16 @@ +{ inputs, ... }: +let + inherit (inputs) self; + inherit (self) lib; +in { + vali = lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit lib inputs self; }; + }; + modules = [ + ./vali + ../modules/vali + inputs.home-manager.noxosModules.home-manager + inputs.agenix.noxosModules.default + ]; +} diff --git a/hosts/vali/configuration.nix b/hosts/vali/configuration.nix new file mode 100644 index 0000000..1fe6d16 --- /dev/null +++ b/hosts/vali/configuration.nix @@ -0,0 +1,66 @@ +{ config, inputs, pkgs, ... }: +{ + time.timeZone = "Europe/Zurich"; + security.sudo.package = pkgs.sudo.override { withInsults = true; }; + security.polkit.enable = true; + programs.kdeconnect.enable = true; + myOptions = { + other = { + system = { + hostname = "nixos"; + username = "vali"; + }; + home-manager = { + enable = true; + }; + }; + programs = { + vesktop.enable = true; + btop.enable = true; + mpv.enable = true; + neovim.enable = true; + pipewire.enable = true; + git = { + enable = true; + userName = "vali"; + userEmail = "valentin@kaas.cc"; + defaultBranch = "master"; + }; + starship.enable = true; + zsh = { + enable = true; + profiling = false; + }; + i3 = { + + }; + }; + themes = { + cursor = { + enable = true; + package = pkgs.bibabta.cursors; + name = "Bibata-Modern-Classic"; + size = "24"; + }; + gtk = { + enable = true; + package = pkgs.catppuccin-gtk; + name = "Catppuccin-Mocha-Standard-Green-Dark"; + variant = "mocha"; + accentColour = "green"; + iconTtheme = { + name = "Papirus-Dark"; + package = pkgs.catppuccin-papirus-foldersM + }; + }; + qt = { + enable = true; + package = pkgs.catppuccin-kde; + name = "Catppuccin-Mocha-Dark" + variant = "mocha"; + accentColour = "green"; + }; + }; + }; + system.stateVersion = "23.11"; +} diff --git a/hosts/vali/default.nix b/hosts/vali/default.nix new file mode 100644 index 0000000..4110339 --- /dev/null +++ b/hosts/vali/default.nix @@ -0,0 +1,8 @@ +_: { + imports = [ + ./configuration.nix + ./programs.nix + ./hardware-configuration.nix + ./profile.nix + ] +} diff --git a/hosts/vali/desktop/boot.nix b/hosts/vali/desktop/boot.nix deleted file mode 100644 index 6ab4bde..0000000 --- a/hosts/vali/desktop/boot.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ inputs, outputs, profile-config, pkgs, ... }: -{ - boot.loader = { - efi.canTouchEfiVariables = true; - grub = { - enable = true; - efiSupport = true; - device = "nodev"; - }; - }; -} diff --git a/hosts/vali/desktop/default.nix b/hosts/vali/desktop/default.nix deleted file mode 100644 index 3b622d2..0000000 --- a/hosts/vali/desktop/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ inputs, outputs, pks, lib, profile-config, ... }: -{ - imports = [ - ../../../modules/vali/default.nix - ../../common - ./hardware-configuration.nix - ./packages.nix - ./boot.nix - ]; - i3wm.enable = true; - security.polkit.enable = true; - # Set the keyboard layout to DE - services.xserver.xkb.layout = "de"; - console.keyMap = "de"; -} - diff --git a/hosts/vali/desktop/packages.nix b/hosts/vali/desktop/packages.nix deleted file mode 100644 index 6c7169b..0000000 --- a/hosts/vali/desktop/packages.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ inputs, outputs, pkgs, profile-config, ... }: - -{ - environment.systemPackages = with pkgs; [ - jetbrains.idea-community - ani-cli - okular - texliveFull - signal-desktop - nextcloud-client - vlc - strawberry - telegram-desktop - betterbird - xclip - pavucontrol - lazygit - vesktop - zsh - zoxide - eza - mpv - librewolf - keepassxc - feh - libreoffice - openjdk - ]; -} diff --git a/hosts/vali/desktop/hardware-configuration.nix b/hosts/vali/hardware-configuration.nix similarity index 100% rename from hosts/vali/desktop/hardware-configuration.nix rename to hosts/vali/hardware-configuration.nix diff --git a/hosts/vali/laptop/default.nix b/hosts/vali/laptop/default.nix deleted file mode 100644 index e69de29..0000000 diff --git a/hosts/vali/laptop/hardware-configuration.nix b/hosts/vali/laptop/hardware-configuration.nix deleted file mode 100644 index e69de29..0000000 diff --git a/hosts/vali/laptop/packages.nix b/hosts/vali/laptop/packages.nix deleted file mode 100644 index e69de29..0000000 diff --git a/hosts/vali/profile.nix b/hosts/vali/profile.nix new file mode 100644 index 0000000..150d786 --- /dev/null +++ b/hosts/vali/profile.nix @@ -0,0 +1,11 @@ +_: { + imports = [ + ../../options/boot/grub-boot.nix + ../../options/desktop/fonts.nix + ../../options/common/networking.nix + ../../options/common/gpu/nvidia.nix + ../../options/common/pin-registry.nix + ../../options/common/preserve-system.nix + #../../options/ + ]; +} diff --git a/hosts/vali/programs.nix b/hosts/vali/programs.nix new file mode 100644 index 0000000..fc3d363 --- /dev/null +++ b/hosts/vali/programs.nix @@ -0,0 +1,57 @@ +{ config, inputs, pkgs, ... }: +let + username = config.myOptions.other.system.usermame; +in + home-manager.users.${username} = { + home.packages = let + + in with pkgs; [ + git + keepassxc + eza ripgrep + signal-desktop-beta + element-desktop + steam + tor-browser-bundle-bin + betterbird + telegram-desktop + libreoffice-fresh + qbittorrent + ventoy-full + zip + unzip + gcc + trash-cli + bibata-cursors + networkmanagerapplet + xclip + pamixer + dig + pcmanfm + ffmpeg_6-full + yt-dlp + (fenix.complete.withComponents [ + "cargo" + "clippy" + "rust-src" + "rustc" + "rustfmt" + ]) + polkit + asciinema + fastfetch + alsa-utils + imagemagick + pavucontrol + gdb + tree + smartmontools + krita + python3 + rustdesk + httpie + sherlock + strawberry + ]; + }; + } diff --git a/modules/vali/cli/default.nix b/modules/vali/cli/default.nix new file mode 100644 index 0000000..1e43012 --- /dev/null +++ b/modules/vali/cli/default.nix @@ -0,0 +1,7 @@ +_: { + imports = [ + ./git.nix + ./starship.nix + ./zsh.nix + ]; +} diff --git a/modules/vali/cli/git.nix b/modules/vali/cli/git.nix new file mode 100644 index 0000000..bc8ce28 --- /dev/null +++ b/modules/vali/cli/git.nix @@ -0,0 +1,63 @@ +{ + config, + lib, + pkgs, + ... +}: with lib; let + cfg = config.myOptions.programs.git; + username = config.myOptions.other.system.username; +in { + options.myOptions.programs.git = { + enable = mkEnableOption "git"; + userName = mkOption { + type = types.str; + description = "git username"; + }; + userEmail = mkOption { + type = types.str; + description = "git email"; + }; +# signingKey = mkOption { + # type = types.str; + # description = "git commit signing key"; + # }; + editor = mkOption { + type = types.str; + default = "$EDITOR"; + description = "commit message editor"; + }; + defaultBranch = mkOption { + type = types.str; + default = "master"; + description = "default git branch"; + }; + }; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + programs.git = { + inherit (cfg) enable userName userEmail; + extraConfig = { + core = { + editor = cfg.editor; + pager = "${pkgs.delta}/bin/delta"; + }; + init.defaultBranch = cfg.defaultBranch; + push.autoSetupRemote = true; + commit = { + verbose = true; + gpgsign = true; + }; + gpg.format = "ssh"; +# user.signingkey = "key::${cfg.signingKey}"; + merge.conflictstyle = "zdiff3"; + interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only"; + diff.algorithm = "histogram"; + transfer.fsckobjects = true; + fetch.fsckobjects = true; + receive.fsckobjects = true; + }; + }; + }; + }; +} diff --git a/modules/vali/cli/starship.nix b/modules/vali/cli/starship.nix new file mode 100644 index 0000000..09ae8af --- /dev/null +++ b/modules/vali/cli/starship.nix @@ -0,0 +1,42 @@ +{ + config, + lib, + ... +}: with lib; let + cfg = config.myOptions.programs.starship; + username = config.myOptions.other.system.username; +in { + options.myOptions.programs.starship.enable = mkEnableOption "starship"; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + programs.starship = { + enable = true; + enableZshIntegration = config.myOptions.programs.zsh.enable; + settings = { + add_newline = false; + command_timeout = 1000; + line_break = { + disabled = true; + }; + directory = { + truncation_length = 3; + truncate_to_repo = false; + truncation_symbol = "…/"; + }; + c.symbol = " "; + directory.read_only = " 󰌾"; + git_branch.symbol = " "; + haskell.symbol = " "; + hostname.ssh_symbol = " "; + java.symbol = " "; + kotlin.symbol = " "; + meson.symbol = "󰔷 "; + nix_shell.symbol = " "; + package.symbol = "󰏗 "; + rust.symbol = " "; + }; + }; + }; + }; +} diff --git a/modules/vali/cli/zsh.nix b/modules/vali/cli/zsh.nix new file mode 100644 index 0000000..47b4b27 --- /dev/null +++ b/modules/vali/cli/zsh.nix @@ -0,0 +1,67 @@ +{ config, lib, pkgs, ... }: +with lib; let + cfg = config.myOptions.programs.zsh; + username = config.myOptions.other.system.username; +in { + options.myOptions.programs.zsh = { + enable = mkEnableOption "zsh"; + extraAliases = mkOption { + type = types.attrs; + description = "extra shell aliases"; + default = {}; + }; + profiling = mkOption { + type = types.bool; + description = "enable zsh profiling"; + default = false; + }; + }; + + config = mkIf cfg.enable { + programs.zsh.enable = true; + user.users.${username}.shell = pkgs.zsh; + environment = { + shells = [ pkgs.zsh ]; + pathsToLink = [ "/share/zsh" ]; + }; + home-manager.users.${username} = { + programs.zsh = { + enable = true; + shellAliases = { + c = "clear"; + cc = "cd && clear"; + mv = "mv -iv"; + rm = "trash -v"; + l = "eza -a --icons"; + la = "eza -lha --icons --git"; + cd = "zoxide" + } // cfg.extraAliases; + initExtraFirst = mkIf cfg.profiling "zmodload zsh/zprof"; + initExtra = mkIf cfg.profiling "zprof"; + history { + path = "${config.home-manager.users.${username}.xdg.dataHome}/zsh/zsh_history"; + size = 99999; + save = 99999; + extended = true; + ignoreSpace = true; + }; + autosuggestion.enable = true; + enableCompletion = true; + autocd = false; + dotDir = ".config/zsh"; + plugins = [ + { + name = "fast-syntax-highlighting"; + file = "fast-syntax-highlighting.plugin.zsh"; + src = pkgs.fetchFromGitHub { + owner = "zdharma-continuum"; + repo = "fast-syntax-highlighting"; + rev = "cf318e06a9b7c9f2219d78f41b46fa6e06011fd9"; + sha256 = "sha256-RVX9ZSzjBW3LpFs2W86lKI6vtcvDWP6EPxzeTcRZua4="; + }; + } + ]; + }; + }; + }; +} diff --git a/modules/vali/core/boot/boot.nix b/modules/vali/core/boot/boot.nix deleted file mode 100644 index 2fc65ab..0000000 --- a/modules/vali/core/boot/boot.nix +++ /dev/null @@ -1,10 +0,0 @@ -_: { - boot.loader = { - efi.canTouchEfiVariables = true; - grub = { - enable = true; - efiSupport = true; - device = "nodev"; - }; - }; -} diff --git a/modules/vali/default.nix b/modules/vali/default.nix index f93aa63..48e5635 100644 --- a/modules/vali/default.nix +++ b/modules/vali/default.nix @@ -1,9 +1,9 @@ { pkgs, lib, config, ...}: { imports = [ - ./core/boot/boot.nix - ./graphics/default.nix - #./web/default.nix - #./terminal/default.nix + ./cli/default.nix + ./gui/default.nix + ./other/default.nix + ./services/default.nix ]; } diff --git a/modules/vali/gui/cursor.nix b/modules/vali/gui/cursor.nix new file mode 100644 index 0000000..6b3a454 --- /dev/null +++ b/modules/vali/gui/cursor.nix @@ -0,0 +1,39 @@ +{ + config, + lib, + ... +}: with lib; let + cfg = config.myOptions.themes.cursor; + username = config.myOptions.other.system.username; +in { + options.myOptions.themes.cursor = { + enable = mkEnableOption "cursor theming"; + package = mkOption { + description = "cursor theme package"; + type = types.package; + }; + name = mkOption { + description = "cursor theme name"; + type = types.str; + }; + size = mkOption { + description = "cursor size"; + type = types.int; + }; + }; + + config = mkIf cfg.enable { + environment.sessionVariables = { + XCURSOR_THEME = "${cfg.name}"; + XCURSOR_SIZE = "${toString cfg.size}"; + }; + + home-manager.users.${username} = { + home.pointerCursor = { + inherit (cfg) package name size; + gtk.enable = true; + x11.enable = true; + }; + }; + }; +} diff --git a/modules/vali/gui/default.nix b/modules/vali/gui/default.nix new file mode 100644 index 0000000..ab8eb18 --- /dev/null +++ b/modules/vali/gui/default.nix @@ -0,0 +1,373 @@ +{ + config, + lib, + pkgs, + ... +}: with lib; let + cfg = config.myOptions.programs.vesktop; + username = config.myOptions.other.system.username; +in { + options.myOptions.programs.vesktop = { + enable = mkEnableOption "vesktop"; + }; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + xdg.configFile."vesktop/settings.json".text = builtins.toJSON { + discordBranch = "ptb"; + firstLaunch = false; + arRPC = "on"; + splashColor = "rgb(219, 222, 225)"; + splashBackground = "rgb(49, 51, 56)"; + checkUpdates = false; + staticTitle = true; + disableMinSize = true; + minimizeToTray = false; + tray = false; + appBadge = false; + }; + + xdg.configFile."vesktop/settings/settings.json".text = builtins.toJSON { + notifyAboutUpdates = false; + autoUpdate = false; + autoUpdateNotification = false; + useQuickCss = true; + themeLinks = []; + enabledThemes = ["Catppuccin.theme.css"]; + enableReactDevtools = true; + frameless = false; + transparent = false; + winCtrlQ = false; + macosTranslucency = false; + disableMinSize = true; + winNativeTitleBar = false; + plugins = { + BadgeAPI.enabled = true; + CommandsAPI.enabled = true; + ContextMenuAPI.enabled = true; + MemberListDecoratorsAPI.enabled = true; + MessageAccessoriesAPI.enabled = true; + MessageDecorationsAPI.enabled = true; + MessageEventsAPI.enabled = true; + MessagePopoverAPI.enabled = true; + NoticesAPI.enabled = true; + ServerListAPI.enabled = true; + SettingsStoreAPI.enabled = true; + NoTrack.enabled = true; + Settings = { + enabled = true; + settingsLocation = "aboveActivity"; + }; + AlwaysAnimate.enabled = false; + AlwaysTrust.enabled = false; + AnonymiseFileNames.enabled = false; + "WebRichPresence (arRPC)".enabled = false; + BANger.enabled = false; + BetterFolders = { + enabled = true; + sidebar = true; + sidebarAnim = true; + closeAllFolders = false; + closeAllHomeButton = false; + closeOthers = false; + forceOpen = false; + keepIcons = false; + showFolderIcon = 1; + }; + BetterGifAltText.enabled = false; + BetterNotesBox.enabled = false; + BetterRoleDot.enabled = false; + BetterUploadButton.enabled = true; + BiggerStreamPreview.enabled = true; + BlurNSFW.enabled = false; + CallTimer = { + enabled = true; + format = "human"; + }; + ClearURLs.enabled = true; + ColorSighted.enabled = true; + ConsoleShortcuts.enabled = false; + CopyUserURLs.enabled = true; + CrashHandler.enabled = true; + CustomRPC.enabled = false; + Dearrow.enabled = true; + DisableDMCallIdle.enabled = true; + EmoteCloner.enabled = false; + Experiments = { + enabled = true; + enableIsStaff = false; + }; + F8Break.enabled = false; + FakeNitro = { + enabled = true; + enableEmojiBypass = true; + emojiSize = 48; + transformEmojis = true; + enableStickerBypass = true; + stickerSize = 160; + transformStickers = true; + transformCompoundSentence = false; + enableStreamQualityBypass = true; + }; + FakeProfileThemes = { + enabled = true; + nitroFirst = true; + }; + FavoriteEmojiFirst.enabled = true; + FavoriteGifSearch = { + enabled = true; + searchOption = "hostandpath"; + }; + FixImagesQuality.enabled = true; + FixSpotifyEmbed = { + enabled = true; + volume = 10; + }; + ForceOwnerCrown.enabled = true; + FriendInvites.enabled = false; + GameActivityToggle.enabled = true; + GifPaste.enabled = true; + HideAttachments.enabled = true; + iLoveSpam.enabled = true; + IgnoreActivities = { + enabled = true; + ignoredActivities = []; + }; + ImageZoom = { + enabled = true; + saveZoomValues = true; + invertScroll = true; + nearestNeighbour = false; + square = false; + zoom = 2; + size = 100; + zoomSpeed = 0.5; + }; + InvisibleChat = { + enabled = true; + savedPasswords = "password"; + }; + KeepCurrentChannel.enabled = true; + LastFMRichPresence.enabled = false; + LoadingQuotes.enabled = false; + MemberCount.enabled = true; + MessageClickActions = { + enabled = true; + enableDeleteOnClick = true; + enableDoubleClickToEdit = true; + enableDoubeClickToReply = true; + requireModifier = true; + }; + MessageLinkEmbeds = { + enabled = true; + automodEmbeds = "never"; + listMode = "blacklist"; + idList = ""; + }; + MessageLogger = { + enabled = true; + deleteStyle = "text"; + ignoreBots = false; + ignoreSelf = false; + ignoreUsers = ""; + ignoreChannels = ""; + ignoreGuilds = ""; + }; + MessageTags.enabled = false; + MoreCommands.enabled = true; + MoreKaomoji.enabled = true; + MoreUserTags.enabled = true; + Moyai.enabled = false; + MuteNewGuild = { + enabled = true; + guild = false; + everyone = true; + role = true; + }; + MutualGroupDMs.enabled = true; + NoBlockedMessages = { + enabled = false; + ignoreBlockedMessages = false; + }; + NoDevtoolsWarning.enabled = false; + NoF1.enabled = false; + NoPendingCount.enabled = false; + NoProfileThemes.enabled = true; + NoReplyMention = { + enabled = true; + userList = "372809091208445953"; + shouldPingListed = false; + inverseShiftReply = true; + }; + NoScreensharePreview.enabled = true; + NoTypingAnimation = true; + NoUnblockToJump.enabled = true; + NSFWGateBypass.enabled = true; + oneko.enabled = false; + OpenInApp.enabled = false; + "Party mode 🎉".enabled = false; + PermissionFreeWill = { + enabled = true; + lockout = true; + onboarding = true; + }; + PermissionsViewer = { + enabled = true; + permissionsSortOrder = 0; + defaultPermissionsDropdownState = false; + }; + petpet.enabled = true; + PictureInPicture = { + enabled = true; + loop = false; + }; + PinDMs.enabled = true; + PlainFolderIcon.enabled = false; + PlatformIndicators = { + enabled = true; + list = true; + badges = true; + messages = true; + colorMobileIndicator = true; + }; + PreviewMessage.enabled = true; + PronounDB.enabled = false; + QuickMention.enabled = false; + QuickReply.enabled = false; + ReactErrorDecoder.enabled = false; + ReadAllNotificationsButton.enabled = false; + RelationshipNotifier = { + enabled = true; + notices = true; + offlineRemovals = true; + friends = true; + friendRequestCancels = true; + servers = true; + groups = true; + }; + RevealAllSpoilers.enabled = true; + ReverseImageSearch.enabled = false; + ReviewDB.enabled = false; + RoleColorEverywhere = { + enabled = true; + chatMentions = true; + memberList = true; + voiceUsers = true; + }; + SearchReply.enabled = true; + SendTimestamps.enabled = false; + ServerListIndicators = { + enabled = true; + mode = 3; + }; + ServerProfile.enabled = true; + ShikiCodeblocks = { + enabled = true; + theme = "https://raw.githubusercontent.com/shikijs/shiki/0b28ad8ccfbf2615f2d9d38ea8255416b8ac3043/packages/shiki/themes/dark-plus.json"; + tryHljs = "SECONDARY"; + uesDevIcon = "GREYSCALE"; + bgOpacity = 100; + }; + ShowAllMessageButtons.enabled = true; + ShowConnections = { + enabled = true; + iconSize = 32; + iconSpacing = 1; + }; + ShowHiddenChannels = { + enabled = true; + hideUnreads = true; + showMode = 0; + defaultAllowedUsersAndRolesDropdownState = true; + }; + ShowMeYourName.enabled = false; + ShowTimeouts.enabled = true; + SilentMessageToggle = { + enabled = true; + persistState = false; + autoDisable = true; + }; + SilentTyping = { + enabled = true; + showIcon = false; + isEnabled = true; + }; + SortFriendRequests.enabled = false; + SpotifyControls.enabled = false; + SpotifyCrack.enabled = false; + SpotifyShareCommands.enabled = false; + StartupTimings.enabled = false; + SupportHelper.enabled = true; + TextReplace.enabled = false; + TimeBarAllActivities.enabled = false; + Translate.enabled = false; + TypingIndicator = { + enabled = true; + includeMutedChannels = false; + includeBlockedUsers = true; + }; + TypingTweaks = { + enabled = true; + showAvatars = true; + showRoleColors = true; + alternativeFormatting = true; + }; + Unindent.enabled = true; + UnsuppressEmbeds.enabled = true; + UrbanDictionary.enabled = false; + UserVoiceShow = { + enabled = true; + showInUserProfileModal = true; + showVoiceChannelSectionHeader = true; + }; + USRBG.enabled = false; + UwUifier.enabled = false; + ValidUser.enabled = false; + VoiceChatDoubleClick.enabled = true; + VcNarrator.enabled = false; + VencordToolbox.enabled = false; + ViewIcons = { + enabled = true; + format = "png"; + imgSize = "2048"; + }; + ViewRaw = { + enabled = true; + clickMethod = "Left"; + }; + VoiceMessages = { + enabled = true; + noiseSuppression = true; + echoCancellation = true; + }; + WebContextMenus = { + enabled = true; + addBack = true; + }; + WebKeybinds.enabled = true; + GreetStickerPicker.enabled = false; + WhoReacted.enabled = true; + Wikisearch.enabled = false; + NormalizeMessageLinks.enabled = false; + "AI Noise Suppression" = { + enabled = true; + isEnabled = true; + }; + SecretRingToneEnabler.enabled = false; + }; + notifications = { + timeout = 5000; + position = "bottom-right"; + useNative = "not-focused"; + logLimit = 50; + }; + cloud = { + authenticated = false; + url = "https://api.vencord.dev/"; + settingsSync = false; + settingsSyncVersion = 1682768329526; + }; + }; + }; + }; +} diff --git a/modules/vali/gui/gtk.nix b/modules/vali/gui/gtk.nix new file mode 100644 index 0000000..df5b0db --- /dev/null +++ b/modules/vali/gui/gtk.nix @@ -0,0 +1,75 @@ +{ + config, + lib, + ... +}: with lib; let + cfg = config.myOptions.themes.gtk; + username = config.myOptions.other.system.username; + hmCfg = config.home-manager.users.${username}; +in { + options.myOptions.themes.gtk = { + enable = mkEnableOption "gtk theming"; + name = mkOption { + description = "gtk theme name"; + type = types.str; + }; + variant = mkOption { + description = "gtk theme variant"; + type = types.str; + }; + accentColour = mkOption { + description = "accent colour for gtk theme"; + type = types.str; + }; + package = mkOption { + description = "gtk theme package"; + type = types.package; + }; + iconTheme = mkOption { + description = "gtk icon theme"; + type = with types; submodule { + options = { + name = mkOption { + description = "gtk icon theme name"; + type = str; + }; + package = mkOption { + description = "gtk icon theme package"; + type = package; + }; + }; + }; + }; + }; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + gtk = { + enable = true; + theme = { + inherit (cfg) name; + package = cfg.package.override { + size = "standard"; + accents = [ cfg.accentColour ]; + inherit (cfg) variant; + tweaks = [ "normal" ]; + }; + }; + iconTheme = { + inherit (cfg.iconTheme) name; + package = cfg.iconTheme.package.override { + accent = cfg.accentColour; + flavor = cfg.variant; + }; + }; + gtk2 = { + configLocation = "${hmCfg.xdg.configHome}/gtk-2.0/gtkrc"; + }; + }; + home.sessionVariables = { + GTK_THEME = cfg.name; + GTK_USE_PORTAL = "1"; + }; + }; + }; +} diff --git a/modules/vali/gui/mpv.nix b/modules/vali/gui/mpv.nix new file mode 100644 index 0000000..0e3ba5d --- /dev/null +++ b/modules/vali/gui/mpv.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + pkgs, + ... +}: with lib; let + cfg = config.myOptions.programs.mpv; + username = config.myOptions.other.system.username; +in { + options.myOptions.programs.mpv.enable = mkEnableOption "mpv"; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + programs.mpv = { + enable = true; + config = { + hwdec = "auto"; + volume = 50; + osc = "no"; + osd-bar = "no"; + border = "no"; + }; + scripts = with pkgs.mpvScripts; [ + mpris + thumbfast + sponsorblock + uosc + ]; + }; + }; + }; +} diff --git a/modules/vali/gui/qt.nix b/modules/vali/gui/qt.nix new file mode 100644 index 0000000..a448f55 --- /dev/null +++ b/modules/vali/gui/qt.nix @@ -0,0 +1,87 @@ +{ + config, + lib, + pkgs, + ... +}: with lib; let + cfg = config.myOptions.themes.qt; + username = config.myOptions.other.system.username; +in { + options.myOptions.themes.qt = { + enable = mkEnableOption "qt theming"; + name = mkOption { + description = "qt theme name"; + type = types.str; + }; + variant = mkOption { + description = "qt theme variant"; + type = types.str; + }; + accentColour = mkOption { + description = "accent colour for qt theme"; + type = types.str; + }; + package = mkOption { + description = "qt theme package"; + type = types.package; + }; + }; + + config = mkIf cfg.enable { + environment.sessionVariables = { + QT_QPA_PLATFORMTHEME = "qt5ct"; + }; + + home-manager.users.${username} = { + # thanks raf :3 https://github.com/NotAShelf/nyx/blob/main/homes/notashelf/themes/qt.nix + qt = { + enable = true; + platformTheme = "qtct"; + style = { + inherit (cfg) name; + package = cfg.package.override { + flavour = [ cfg.variant ]; + accents = [ cfg.accentColour ]; + }; + }; + }; + + home = { + packages = with pkgs; [ + qt5.qttools + qt6Packages.qtstyleplugin-kvantum + libsForQt5.qtstyleplugin-kvantum + libsForQt5.qt5ct + breeze-icons + ]; + + sessionVariables = { + #QT_STYLE_OVERRIDE = "kvantum"; + QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + QT_QPA_PLATFORM = "wayland;xcb"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + DISABLE_QT_COMPAT = "0"; + }; + }; + + # TODO somehow make this configurable IDK + xdg.configFile = { + "Kvantum/catppuccin/catppuccin.kvconfig".source = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/catppuccin/Kvantum/main/src/Catppuccin-Mocha-Green/Catppuccin-Mocha-Green.kvconfig"; + sha256 = "16ry4k09nf5w1gyawwz2ny14zn6infqk40l35lqlg30lhgbdmr5f"; + }; + "Kvantum/catppuccin/catppuccin.svg".source = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/catppuccin/Kvantum/main/src/Catppuccin-Mocha-Green/Catppuccin-Mocha-Green.svg"; + sha256 = "1djh625qag34rjsp7y67nzbi9nbmiwgq63ydfizsh65n3fyfakf1"; + }; + "Kvantum/kvantum.kvconfig".text = '' + [General] + theme=catppuccin + + [Applications] + catppuccin=qt5ct, org.qbittorrent.qBittorrent, hyprland-share-picker + ''; + }; + }; + }; +} diff --git a/modules/vali/gui/schizofox.nix b/modules/vali/gui/schizofox.nix new file mode 100644 index 0000000..907f63f --- /dev/null +++ b/modules/vali/gui/schizofox.nix @@ -0,0 +1,104 @@ +{ + config, + inputs, + lib, + ... +}: with lib; let + cfg = config.myOptions.programs.schizofox; + username = config.myOptions.other.system.username; +in { + options.myOptions.programs.schizofox = { + enable = mkEnableOption "schizofox"; + }; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + imports = [ inputs.schizofox.homeManagerModule ]; + + programs.schizofox = { + enable = true; + theme = { + background-darker = "181825"; + background = "1e1e2e"; + foreground = "cdd6f4"; + font = "Lexend"; + simplefox.enable = false; + darkreader.enable = true; + extraCss = '' + body { + color: red !important; + } + ''; + }; + search = { + defaultSearchEngine = "Startpage"; + removeEngines = ["Google" "Bing" "Amazon.com" "eBay" "Twitter" "Wikipedia"]; + searxUrl = "https://search.notashelf.dev"; + searxQuery = "https://search.notashelf.dev/search?q={searchTerms}"; + addEngines = [ + { + Name = "NixOS Packages"; + Description = "NixOS Unstable package search"; + Alias = "!np"; + Method = "GET"; + URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}"; + } + { + Name = "NixOS Options"; + Description = "NixOS Unstable option search"; + Alias = "!no"; + Method = "GET"; + URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}"; + } + { + Name = "NixOS Wiki"; + Description = "NixOS Wiki search"; + Alias = "!nw"; + Method = "GET"; + URLTemplate = "https://nixos.wiki/index.php?search={searchTerms}"; + } + { + Name = "Home Manager Options"; + Description = "Home Manager option search"; + Alias = "!hm"; + Method = "GET"; + URLTemplate = "https://mipmip.github.io/home-manager-option-search?query={searchTerms}"; + } + { + Name = "Arch Wiki"; + Description = "Arch Wiki search"; + Alias = "!aw"; + Method = "GET"; + URLTemplate = "https://wiki.archlinux.org/index.php?search={searchTerms}"; + } + { + Name = "Gentoo Wiki"; + Description = "Gentoo Wiki search"; + Alias = "!gw"; + Method = "GET"; + URLTemplate = "https://wiki.gentoo.org/index.php?search={searchTerms}"; + } + { + Name = "Debian Wiki"; + Description = "Debian Wiki search"; + Alias = "!dw"; + Method = "GET"; + URLTemplate = "https://wiki.debian.org/FrontPage?action=fullsearch&value={searchTerms}"; + } + ]; + }; + + security = { + sanitizeOnShutdown = true; + sandbox = true; + userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0"; + }; + + misc = { + drmFix = false; + disableWebgl = true; + }; + }; + }; + }; +} diff --git a/modules/vali/other/default.nix b/modules/vali/other/default.nix new file mode 100644 index 0000000..7ce8d0e --- /dev/null +++ b/modules/vali/other/default.nix @@ -0,0 +1,7 @@ +_: { + imports = [ + ./home-manager.nix + ./system.nix + ./xdg.nix + ]; +} diff --git a/modules/vali/other/home-manager.nix b/modules/vali/other/home-manager.nix new file mode 100644 index 0000000..78f2cdb --- /dev/null +++ b/modules/vali/other/home-manager.nix @@ -0,0 +1,38 @@ +{ + config, + inputs, + lib, + self, + ... +}: with lib; let + cfg = config.myOptions.other.home-manager; + username = config.myOptions.other.system.username; +in { + options.myOptions.other.home-manager = { + enable = mkEnableOption "home-manager"; + enableDirenv = mkEnableOption "direnv"; + }; + + config = mkIf cfg.enable { + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + extraSpecialArgs = {inherit inputs self;}; + users.${username} = { + programs = { + home-manager.enable = true; + direnv = mkIf cfg.enableDirenv { + enable = true; + nix-direnv.enable = true; + }; + }; + + home = { + inherit username; + homeDirectory = "/home/${username}"; + stateVersion = lib.mkDefault "23.11"; + }; + }; + }; + }; +} diff --git a/modules/vali/other/system.nix b/modules/vali/other/system.nix new file mode 100644 index 0000000..2f14a84 --- /dev/null +++ b/modules/vali/other/system.nix @@ -0,0 +1,28 @@ +{ + config, + lib, + ... +}: with lib; let + cfg = config.myOptions.other.system; +in { + options.myOptions.other.system = { + hostname = mkOption { + description = "hostname for this system"; + type = types.str; + }; + + username = mkOption { + description = "username for this system"; + type = types.str; + }; + }; + + config = { + networking.hostName = cfg.hostname; + + users.users.${cfg.username} = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + }; + }; +} diff --git a/modules/vali/other/xdg.nix b/modules/vali/other/xdg.nix new file mode 100644 index 0000000..c69a7f8 --- /dev/null +++ b/modules/vali/other/xdg.nix @@ -0,0 +1,118 @@ +{ + config, + ... +}: let + username = config.myOptions.other.system.username; + hmCfg = config.home-manager.users.${username}; + + primary_browser = "firefox-schizo.desktop"; + secondary_browser = "firefox-unschizo.desktop"; + mail_client = "betterbird.desktop"; + file_manager = "pcmanfm.desktop"; + media_player = "mpv.desktop"; + image_viewer = "imv.desktop"; + text_editor = "nvim.desktop"; +in { + + environment.sessionVariables = { + CARGO_HOME = "${hmCfg.xdg.dataHome}/cargo"; + GOPATH = "${hmCfg.xdg.dataHome}/go"; + GNUPGHOME = "${hmCfg.xdg.dataHome}/gnupg"; + GRADLE_USER_HOME = "${hmCfg.xdg.dataHome}/gradle"; + HISTFILE = "${hmCfg.xdg.stateHome}/bash/history"; + MYSQL_HISTFILE = "${hmCfg.xdg.stateHome}/mysql/history"; + NPM_CONFIG_USERCONFIG = "${hmCfg.xdg.configHome}/npm/npmrc"; + NUGET_PACKAGES = "${hmCfg.xdg.cacheHome}/NuGetPackages"; + JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${hmCfg.xdg.configHome}/java"; + PARALLEL_HOME = "${hmCfg.xdg.configHome}/parallel"; + PYTHONSTARTUP = "${hmCfg.xdg.configHome}/python/pythonrc"; + RUSTUP_HOME = "${hmCfg.xdg.dataHome}/rustup"; + WINEPREFIX = "${hmCfg.xdg.dataHome}/wine"; + XAUTHORITY = "\$XDG_RUNTIME_DIR/Xauthority"; + }; + + myOptions.programs.zsh.extraAliases = { + gdb = "gdb -n -x ${hmCfg.xdg.configHome}/gdb/init"; + pidgin = "pidgin --config=${hmCfg.xdg.dataHome}/purple"; + svn = "svn --config-dir ${hmCfg.xdg.configHome}/subversion"; + wget = "wget --hsts-file=\"${hmCfg.xdg.dataHome}/wget-hsts\""; + }; + + home-manager.users.${username} = { + xdg.configFile."npm/npmrc".text = '' + prefix=${hmCfg.xdg.dataHome}/npm + cache=${hmCfg.xdg.cacheHome}/npm + tmp=\$XDG_RUNTIME_DIR/npm + init-module=${hmCfg.xdg.configHome}/npm/config/npm-init.js + ''; + + xdg.configFile."python/pythonrc".text = '' + import os + import atexit + import readline + + history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python_history') + try: + readline.read_history_file(history) + except OSError: + pass + + def write_history(): + try: + readline.write_history_file(history) + except OSError: + pass + + atexit.register(write_history) + ''; + + xdg = { + cacheHome = "${hmCfg.home.homeDirectory}/.cache"; + configHome = "${hmCfg.home.homeDirectory}/.config"; + dataHome = "${hmCfg.home.homeDirectory}/.local/share"; + stateHome = "${hmCfg.home.homeDirectory}/.local/state"; + mimeApps = { + enable = true; + defaultApplications = { + "text/html" = [ primary_browser secondary_browser ]; + "x-scheme-handler/http" = [ primary_browser secondary_browser ]; + "x-scheme-handler/https" = [ primary_browser secondary_browser ]; + "x-scheme-handler/about" = [ primary_browser secondary_browser ]; + "x-scheme-handler/unknown" = [ primary_browser secondary_browser ]; + "x-scheme-handler/mailto" = [ mail_client ]; + "message/rfc822" = [ mail_client ]; + "x-scheme-handler/mid" = [ mail_client ]; + "inode/directory" = [ file_manager ]; + "x-scheme-handler/heroic" = [ "heroic.desktop" ]; + "audio/mp3" = [ media_player ]; + "audio/ogg" = [ media_player ]; + "audio/mpeg" = [ media_player ]; + "audio/aac" = [ media_player ]; + "audio/opus" = [ media_player ]; + "audio/wav" = [ media_player ]; + "audio/webm" = [ media_player ]; + "audio/3gpp" = [ media_player ]; + "audio/3gpp2" = [ media_player ]; + "video/mp4" = [ media_player ]; + "video/x-msvideo" = [ media_player ]; + "video/mpeg" = [ media_player ]; + "video/ogg" = [ media_player ]; + "video/mp2t" = [ media_player ]; + "video/webm" = [ media_player ]; + "video/3gpp" = [ media_player ]; + "video/3gpp2" = [ media_player ]; + "image/png" = [ image_viewer ]; + "image/jpeg" = [ image_viewer ]; + "image/gif" = [ image_viewer ]; + "image/avif" = [ image_viewer ]; + "image/bmp" = [ image_viewer ]; + "image/vnd.microsoft.icon" = [ image_viewer ]; + "image/svg+xml" = [ image_viewer ]; + "image/tiff" = [ image_viewer ]; + "image/webp" = [ image_viewer ]; + "text/plain" = [ text_editor ]; + }; + }; + }; + }; +} diff --git a/modules/vali/services/default.nix b/modules/vali/services/default.nix new file mode 100644 index 0000000..a17ae8a --- /dev/null +++ b/modules/vali/services/default.nix @@ -0,0 +1,5 @@ +_: { + imports = [ + ./pipewire.nix + ]; + } diff --git a/modules/vali/services/pipewire.nix b/modules/vali/services/pipewire.nix new file mode 100644 index 0000000..9265e58 --- /dev/null +++ b/modules/vali/services/pipewire.nix @@ -0,0 +1,16 @@ +{ config, lib, ... }: +in { + options.myOptions.services.enable = mkEnableOption "pipewire"; + + config = mkIf config.myOptions.services.pipewire.enable { + hardware.pulseaudio.enable = false; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + wireplumber.enable = true; + }; + security.rtkit.enable = true; + }; +} diff --git a/modules/vali/tui/btop.nix b/modules/vali/tui/btop.nix new file mode 100644 index 0000000..5611903 --- /dev/null +++ b/modules/vali/tui/btop.nix @@ -0,0 +1,30 @@ +{ + config, + lib, + ... +}: with lib; let + cfg = config.myOptions.programs.btop; + username = config.myOptions.other.system.username; +in { + options.myOptions.programs.btop.enable = mkEnableOption "btop"; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + programs.btop = { + enable = true; + settings = { + theme_background = false; + vim_keys = true; + update_ms = 1000; + cpu_single_graph = true; + clock_format = "%X"; + use_fstab = true; + io_mode = true; + net_sync = true; + net_iface = "enp4s0"; + log_level = "WARNING"; + }; + }; + }; + }; +} diff --git a/modules/vali/tui/default.nix b/modules/vali/tui/default.nix new file mode 100644 index 0000000..89f194e --- /dev/null +++ b/modules/vali/tui/default.nix @@ -0,0 +1,8 @@ +_: { + imports = [ + ./btop.nix +# ./helix.nix +# ./neovim.nix +# ./newsboat.nix + ]; +} diff --git a/modules/vali/tui/neovim.nix b/modules/vali/tui/neovim.nix new file mode 100644 index 0000000..d3b81fe --- /dev/null +++ b/modules/vali/tui/neovim.nix @@ -0,0 +1,271 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: with lib; let + cfg = config.myOptions.programs.neovim; + username = config.myOptions.other.system.username; +in { + options.myOptions.programs.neovim.enable = mkEnableOption "neovim"; + + config = mkIf cfg.enable { + nixpkgs.overlays = [ inputs.neovim-nightly-overlay.overlay ]; + + home-manager.users.${username} = { + imports = [ inputs.nixvim.homeManagerModules.nixvim ]; + + programs.nixvim = { + enable = true; + package = pkgs.neovim-nightly; + enableMan = true; + defaultEditor = true; + + colorscheme = "catppuccin"; + colorschemes.catppuccin = { + enable = true; + flavour = "mocha"; + transparentBackground = true; + }; + + opts = { + number = true; + relativenumber = true; + autoread = true; + so = 7; + cmdheight = 1; + ignorecase = true; + smartcase = true; + showmatch = true; + timeoutlen = 500; + encoding = "utf8"; + smarttab = true; + shiftwidth = 4; + tabstop = 4; + expandtab = true; + linebreak = true; + smartindent = true; + updatetime = 300; + hidden = true; + background = "dark"; + mousemoveevent = true; + smoothscroll = true; + }; + + globals = { + mapleader = " "; + }; + + keymaps = [ + { + # TODO move this to lua to be cool + # action = "vim.cmd { cmd = \"Neotree\", args = { \"toggle\" } }"; + # lua = true; + action = "Neotree toggle"; + key = "v"; + options.silent = true; + } + { + action = "vim.cmd.MarkdownPreviewToggle"; + lua = true; + key = "m"; + options.silent = true; + } + ]; + + plugins = { + airline = { + enable = false; + settings.theme = "catppuccin"; + }; + lualine = { + enable = true; + theme = "catppuccin"; + }; + fugitive.enable = true; + treesitter = { + enable = true; + folding = false; + indent = true; + nixvimInjections = true; + incrementalSelection.enable = true; + }; + treesitter-context = { + enable = true; + }; + coq-nvim = { + enable = true; + installArtifacts = true; + settings = { + auto_start = "shut-up"; + keymap.recommended = true; + completion.always = false; + }; + }; + neo-tree = { + enable = true; + }; + toggleterm = { + enable = true; + direction = "float"; + openMapping = ""; + shadeTerminals = true; + shadingFactor = 2; + size = 10; + }; + # TODO laytan/cloak.nvim + gitsigns = { + enable = true; + settings = { + current_line_blame = true; + numhl = true; + signcolumn = true; + word_diff = true; + on_attach = '' + function(bufnr) + local gs = package.loaded.gitsigns + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '' + end, {expr=true}) + + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, {expr=true}) + + -- Actions + map('n', 'hs', gs.stage_hunk) + map('n', 'hr', gs.reset_hunk) + map('v', 'hs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end) + map('v', 'hr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end) + map('n', 'hS', gs.stage_buffer) + map('n', 'hu', gs.undo_stage_hunk) + map('n', 'hR', gs.reset_buffer) + map('n', 'hp', gs.preview_hunk) + map('n', 'hb', function() gs.blame_line{full=true} end) + map('n', 'tb', gs.toggle_current_line_blame) + map('n', 'hd', gs.diffthis) + map('n', 'hD', function() gs.diffthis('~') end) + map('n', 'td', gs.toggle_deleted) + + -- Text object + map({'o', 'x'}, 'ih', ':Gitsigns select_hunk') + end + ''; + }; + }; + lsp = { + enable = true; + servers = { + rust-analyzer = { + enable = true; + installCargo = false; + installRustc = false; + }; + lua-ls.enable = true; + ccls.enable = true; + nil_ls.enable = true; + bashls.enable = true; + tsserver.enable = true; + java-language-server.enable = true; + #pylyzer.enable = true; + }; + #onAttach = '' + # vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + # local bufopts = { noremap = true, silent = true, buffer = bufnr } + # vim.keymap.set('n', 'wl', function() + # print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + # end, bufopts) + # vim.keymap.set('n', '', function() vim.lsp.buf.format { async = true } end, bufopts) + #''; + keymaps = { + lspBuf = { + gD = "declaration"; + gd = "definition"; + K = "hover"; + gi = "implementation"; + "" = "signature_help"; + "wa" = "add_workspace_folder"; + "wr" = "remove_workspace_folder"; + "wl" = "list_workspace_folders"; + "D" = "type_definition"; + "r" = "rename"; + "a" = "code_action"; + gr = "references"; + "" = "format"; + }; + diagnostic = { + "e" = "open_float"; + "j" = "goto_prev"; + "k" = "goto_next"; + "q" = "setloclist"; + }; + silent = true; + }; + }; + rust-tools = { + enable = true; + crateGraph = { + enabledGraphvizBackends = ["png" "svg"]; + backend = "x11"; + }; + inlayHints = { + auto = true; + onlyCurrentLine = true; + showParameterHints = true; + }; + }; + leap.enable = true; + fidget.enable = true; + telescope = { + enable = true; + keymaps = { + "ff" = "find_files"; + "fg" = "git_files"; + "fs" = "live_grep"; + "fb" = "buffers"; + "fh" = "help_tags"; + }; + keymapsSilent = true; + }; + comment.enable = true; + crates-nvim.enable = true; + harpoon = { + enable = true; + package = pkgs.vimPlugins.harpoon.overrideAttrs { + src = pkgs.fetchFromGitHub { + owner = "ThePrimeagen"; + repo = "harpoon"; + rev = "a38be6e0dd4c6db66997deab71fc4453ace97f9c"; + hash = "sha256-RjwNUuKQpLkRBX3F9o25Vqvpu3Ah1TCFQ5Dk4jXhsbI="; + }; + }; + enableTelescope = true; + keymapsSilent = false; + }; + markdown-preview = { + enable = true; + settings.theme = "dark"; + }; + }; + + extraPlugins = with pkgs.vimPlugins; [ + zen-mode-nvim + ]; + }; + }; + }; +} diff --git a/modules/vali/web/schizofox.nix b/modules/vali/web/schizofox.nix deleted file mode 100644 index e69de29..0000000 diff --git a/options/common/pin-registry.nix b/options/common/pin-registry.nix new file mode 100644 index 0000000..4c93bff --- /dev/null +++ b/options/common/pin-registry.nix @@ -0,0 +1,4 @@ +{ inputs, lib, ...}: +{ + nix.registry = lib.mapAttrs (_: v: {flake = v; }) inputs; +} diff --git a/options/common/preserve-system.nix b/options/common/preserve-system.nix new file mode 100644 index 0000000..51c84f5 --- /dev/null +++ b/options/common/preserve-system.nix @@ -0,0 +1,6 @@ +{ + self, + ... +}: { + environment.etc."current-flake".source = self; +}