From 6fcac2866361c8d7470ac33e82fd4a39fba563c0 Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Mon, 11 Mar 2024 09:16:47 +0530 Subject: [PATCH] [fix] Use lib.optionals where possible --- config/nix/common/home.nix | 17 +++++++---------- config/nix/linux/hyprland.nix | 4 ++-- config/nix/nixos/configuration.nix | 7 +++++++ config/nix/nixos/ryu.nix | 2 ++ 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/config/nix/common/home.nix b/config/nix/common/home.nix index e9fc4a99..fb015922 100644 --- a/config/nix/common/home.nix +++ b/config/nix/common/home.nix @@ -9,8 +9,8 @@ in # Include the results of the hardware scan. ./tmux.nix ./wezterm.nix - ] ++ (if device.isLinux then [ ../linux ] else [ ]) - ++ (if !lazy then [ ./nvim ] else [ ]); + ] ++ lib.optionals device.isLinux [ ../linux ] + ++ lib.optionals (!lazy) [ ./nvim ]; home.packages = with pkgs; [ @@ -19,7 +19,6 @@ in neovide sqls vcpkg - # vcpkg-tool file yt-dlp ngrok @@ -50,7 +49,7 @@ in lua-language-server (nerdfonts.override { fonts = [ "Hasklig" ]; }) mpv - ] ++ (if device.isLinux then [ + ] ++ lib.optionals device.isLinux [ gnome.seahorse gnome.nautilus nextcloud-client @@ -71,7 +70,6 @@ in accent = "mauve"; flavor = "mocha"; }) - swaynotificationcenter usbutils handlr-regex webcord-vencord @@ -86,8 +84,7 @@ in handlr open "$@" ''; }) - ] else - [ ]) ++ (if device.isMac then [ ] else [ ]); + ] ++ lib.optionals device.isMac [ ]; # xdg.enable = true; @@ -126,9 +123,7 @@ in ls = "eza"; t = "${start-tmux}"; }; - shellAliases = { - g = "git"; - }; + shellAliases = { g = "git"; }; shellInit = '' set fish_greeting yes | fish_config theme save "Catppuccin Mocha" @@ -144,6 +139,7 @@ in shellAliases = { cd = "z"; yy = "yazi"; + nv = "neovide"; }; package = pkgs.nushellFull; configFile.text = '' @@ -245,6 +241,7 @@ in EDITOR = "nvim"; SHELL = "${pkgs.nushellFull}/bin/nu"; CARGO_TARGET_DIR = "${config.xdg.cacheHome}/cargo/target"; + BROWSER = "xdg-open"; }; sessionPath = [ "${config.home.homeDirectory}/.local/bin" diff --git a/config/nix/linux/hyprland.nix b/config/nix/linux/hyprland.nix index 54658f59..399296f7 100644 --- a/config/nix/linux/hyprland.nix +++ b/config/nix/linux/hyprland.nix @@ -31,7 +31,7 @@ kb_options = "ctrl:nocaps"; # kb_rules = ""; - follow_mouse = 0; + # follow_mouse = 0; touchpad = { natural_scroll = true; @@ -146,7 +146,7 @@ "$mainMod, Space, exec, ${pkgs.anyrun}/bin/anyrun" "$mainMod, p, pseudo, # dwindle" "$mainMod, v, togglesplit," - "$mainMod, a, exec, swaync-client -t" + # "$mainMod, a, exec, swaync-client -t" "$mainMod, Tab, cyclenext" # Audio ",xf86audioraisevolume, exec, ${pkgs.swayosd}/bin/swayosd-client --output-volume raise" diff --git a/config/nix/nixos/configuration.nix b/config/nix/nixos/configuration.nix index e405d29e..332021ce 100644 --- a/config/nix/nixos/configuration.nix +++ b/config/nix/nixos/configuration.nix @@ -73,6 +73,13 @@ hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; + hardware.bluetooth.settings = { + General = { + Name = "Ryu"; + Enable = "Source,Sink,Media,Socket"; + }; + }; + # Bootloader. boot.loader.systemd-boot.enable = pkgs.lib.mkForce false; diff --git a/config/nix/nixos/ryu.nix b/config/nix/nixos/ryu.nix index 5783e73f..e371c2e0 100644 --- a/config/nix/nixos/ryu.nix +++ b/config/nix/nixos/ryu.nix @@ -46,6 +46,8 @@ }; + # hardware.bluetooth.settings = { + boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];