From c85ba298330d2743761c9f47bd4a97bb464968b2 Mon Sep 17 00:00:00 2001 From: ozpv <39195175+ozpv@users.noreply.github.com> Date: Sat, 24 Aug 2024 06:21:15 +0000 Subject: add nixvim and spicetify --- apps/nixvim.nix | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ apps/spicetify.nix | 34 ++++++++++++------------ flake.nix | 17 ++++++++++-- home.nix | 4 ++- 4 files changed, 113 insertions(+), 20 deletions(-) create mode 100644 apps/nixvim.nix diff --git a/apps/nixvim.nix b/apps/nixvim.nix new file mode 100644 index 0000000..7a959be --- /dev/null +++ b/apps/nixvim.nix @@ -0,0 +1,78 @@ +{ config, pkgs, inputs, ... }: + +{ + imports = [ inputs.nixvim.homeManagerModules.nixvim ]; + + programs.nixvim = { + enable = true; + + keymaps = [ + # Equivalent to nnoremap ; : + { + key = ";"; + action = ":"; + } + + # Equivalent to nmap gg Man + { + key = "gg"; + action = "Man"; + options = { + silent = true; + remap = false; + }; + } + # Etc... + ]; + + # We can set the leader key: + globals.mapleader = " "; + + # We can also set options: + opts = { + tabstop = 4; + shiftwidth = 4; + expandtab = false; + + mouse = "a"; + + # etc... + }; + + plugins = { + lazy.enable = true; + + telescope = { + enable = true; + keymaps = { + "ff" = "find_files"; + "lg" = "live_grep"; + }; + }; + + lsp = { + enable = true; + servers = { + tsserver.enable = true; + lua-ls.enable = true; + bashls.enable = true; + html.enable = true; + pyright.enable = true; + jsonls.enable = true; + java-language-server.enable = true; + cmake.enable = true; + sqls.enable = true; + rust-analyzer = { + enable = true; + installRustc = true; + installCargo = true; + }; + }; + }; + }; + + colorschemes.gruvbox.enable = true; + + extraPlugins = with pkgs.vimPlugins; [ vim-toml ]; + }; +} diff --git a/apps/spicetify.nix b/apps/spicetify.nix index d215468..b1a0965 100644 --- a/apps/spicetify.nix +++ b/apps/spicetify.nix @@ -1,20 +1,20 @@ -{ pkgs, lib, spicetify-nix, ... }: +{ pkgs, lib, inputs, ... }: { - imports = [ spicetify-nix.homeManagerModule ]; - programs.spicetify = let - spicePkgs = spicetify-nix.legacyPackages.${pkgs.system}; - in { - # configure spicetify :) - enable = true; # this is the line that will cause spotify to get installed - theme = spicePkgs.themes.catppuccin-mocha; - colorScheme = "mauve"; - # enabledExtensions = with spicePkgs.extensions; [ - # # "playlistIcons.js" # only needed if not using dribbblish - # "fullAlbumDate.js" - # "showQueueDuration.js" - # "playNext.js" - # "shuffle+.js" - # ]; - } + imports = [ inputs.spicetify-nix.homeManagerModules.default ]; + + programs.spicetify = + let + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; + in + { + enable = true; + enabledExtensions = with spicePkgs.extensions; [ + adblock + hidePodcasts + shuffle # shuffle+ (special characters are sanitized out of extension names) + ]; + theme = spicePkgs.themes.starryNight; + # colorScheme = "mocha"; + }; } diff --git a/flake.nix b/flake.nix index 56b25d5..a78b6ce 100644 --- a/flake.nix +++ b/flake.nix @@ -8,9 +8,20 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + + nixvim = { + url = "github:nix-community/nixvim"; + # If using a stable channel you can use `url = "github:nix-community/nixvim/nixos-"` + inputs.nixpkgs.follows = "nixpkgs"; + }; + + spicetify-nix = { + url = "github:Gerg-L/spicetify-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, ... }@inputs: + outputs = { nixpkgs, home-manager, nixvim, spicetify-nix, ... }@inputs: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; @@ -20,7 +31,9 @@ specialArgs = {inherit inputs;}; modules = [ ./configuration.nix - inputs.home-manager.nixosModules.default + home-manager.nixosModules.home-manager { + home-manager.extraSpecialArgs = { inherit inputs; }; + } ]; }; devShells.x86_64-linux = { diff --git a/home.nix b/home.nix index 7675e8b..2532906 100644 --- a/home.nix +++ b/home.nix @@ -1,8 +1,10 @@ -{ config, pkgs, libs, ... }: +{ config, pkgs, libs, inputs, ... }: { imports = [ ./apps/firefox.nix + ./apps/nixvim.nix + ./apps/spicetify.nix ]; home.username = "ozpv"; -- cgit v1.2.3