diff --git a/flake.nix b/flake.nix index 4b6f4c1..ffa038e 100644 --- a/flake.nix +++ b/flake.nix @@ -24,6 +24,9 @@ home-manager.users.root = import ./home/root.nix; } ]; + pkgs = import nixpkgs { + inherit system; + }; in { nixosConfigurations = { syedm = nixpkgs.lib.nixosSystem { @@ -43,5 +46,16 @@ ]; }; }; + + # For development + devShells.${system}.default = pkgs.mkShell { + packages = with pkgs; [ + nil + nixfmt + + lua-language-server + stylua + ]; + }; }; } diff --git a/home/battery/default.nix b/home/battery/default.nix index ddd5c7d..fd1e5e8 100644 --- a/home/battery/default.nix +++ b/home/battery/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: let battery = pkgs.writeShellScript "battery" '' diff --git a/home/eza/default.nix b/home/eza/default.nix index ff2efa7..5303f5a 100644 --- a/home/eza/default.nix +++ b/home/eza/default.nix @@ -3,119 +3,281 @@ { programs.eza = { enable = true; - + theme = { colourful = true; filekinds = { - normal = { foreground = "#c0caf5"; }; - directory = { foreground = "#7aa2f7"; }; - symlink = { foreground = "#2ac3de"; }; - pipe = { foreground = "#414868"; }; - block_device = { foreground = "#e0af68"; }; - char_device = { foreground = "#e0af68"; }; - socket = { foreground = "#414868"; }; - special = { foreground = "#9d7cd8"; }; - executable = { foreground = "#9ece6a"; }; - mount_point = { foreground = "#b4f9f8"; }; + normal = { + foreground = "#c0caf5"; + }; + directory = { + foreground = "#7aa2f7"; + }; + symlink = { + foreground = "#2ac3de"; + }; + pipe = { + foreground = "#414868"; + }; + block_device = { + foreground = "#e0af68"; + }; + char_device = { + foreground = "#e0af68"; + }; + socket = { + foreground = "#414868"; + }; + special = { + foreground = "#9d7cd8"; + }; + executable = { + foreground = "#9ece6a"; + }; + mount_point = { + foreground = "#b4f9f8"; + }; }; perms = { - user_read = { foreground = "#2ac3de"; }; - user_write = { foreground = "#bb9af7"; }; - user_execute_file = { foreground = "#9ece6a"; }; - user_execute_other = { foreground = "#9ece6a"; }; - group_read = { foreground = "#2ac3de"; }; - group_write = { foreground = "#ff9e64"; }; - group_execute = { foreground = "#9ece6a"; }; - other_read = { foreground = "#2ac3de"; }; - other_write = { foreground = "#ff007c"; }; - other_execute = { foreground = "#9ece6a"; }; - special_user_file = { foreground = "#ff007c"; }; - special_other = { foreground = "#db4b4b"; }; - attribute = { foreground = "#737aa2"; }; + user_read = { + foreground = "#2ac3de"; + }; + user_write = { + foreground = "#bb9af7"; + }; + user_execute_file = { + foreground = "#9ece6a"; + }; + user_execute_other = { + foreground = "#9ece6a"; + }; + group_read = { + foreground = "#2ac3de"; + }; + group_write = { + foreground = "#ff9e64"; + }; + group_execute = { + foreground = "#9ece6a"; + }; + other_read = { + foreground = "#2ac3de"; + }; + other_write = { + foreground = "#ff007c"; + }; + other_execute = { + foreground = "#9ece6a"; + }; + special_user_file = { + foreground = "#ff007c"; + }; + special_other = { + foreground = "#db4b4b"; + }; + attribute = { + foreground = "#737aa2"; + }; }; size = { - major = { foreground = "#2ac3de"; }; - minor = { foreground = "#9d7cd8"; }; - number_byte = { foreground = "#a9b1d6"; }; - number_kilo = { foreground = "#89ddff"; }; - number_mega = { foreground = "#2ac3de"; }; - number_giga = { foreground = "#ff9e64"; }; - number_huge = { foreground = "#ff007c"; }; - unit_byte = { foreground = "#a9b1d6"; }; - unit_kilo = { foreground = "#89ddff"; }; - unit_mega = { foreground = "#2ac3de"; }; - unit_giga = { foreground = "#ff9e64"; }; - unit_huge = { foreground = "#ff007c"; }; + major = { + foreground = "#2ac3de"; + }; + minor = { + foreground = "#9d7cd8"; + }; + number_byte = { + foreground = "#a9b1d6"; + }; + number_kilo = { + foreground = "#89ddff"; + }; + number_mega = { + foreground = "#2ac3de"; + }; + number_giga = { + foreground = "#ff9e64"; + }; + number_huge = { + foreground = "#ff007c"; + }; + unit_byte = { + foreground = "#a9b1d6"; + }; + unit_kilo = { + foreground = "#89ddff"; + }; + unit_mega = { + foreground = "#2ac3de"; + }; + unit_giga = { + foreground = "#ff9e64"; + }; + unit_huge = { + foreground = "#ff007c"; + }; }; users = { - user_you = { foreground = "#3d59a1"; }; - user_root = { foreground = "#bb9af7"; }; - user_other = { foreground = "#2ac3de"; }; - group_yours = { foreground = "#89ddff"; }; - group_root = { foreground = "#bb9af7"; }; - group_other = { foreground = "#c0caf5"; }; + user_you = { + foreground = "#3d59a1"; + }; + user_root = { + foreground = "#bb9af7"; + }; + user_other = { + foreground = "#2ac3de"; + }; + group_yours = { + foreground = "#89ddff"; + }; + group_root = { + foreground = "#bb9af7"; + }; + group_other = { + foreground = "#c0caf5"; + }; }; links = { - normal = { foreground = "#89ddff"; }; - multi_link_file = { foreground = "#2ac3de"; }; + normal = { + foreground = "#89ddff"; + }; + multi_link_file = { + foreground = "#2ac3de"; + }; }; git = { - new = { foreground = "#9ece6a"; }; - modified = { foreground = "#bb9af7"; }; - deleted = { foreground = "#db4b4b"; }; - renamed = { foreground = "#2ac3de"; }; - typechange = { foreground = "#2ac3de"; }; - ignored = { foreground = "#545c7e"; }; - conflicted = { foreground = "#ff9e64"; }; + new = { + foreground = "#9ece6a"; + }; + modified = { + foreground = "#bb9af7"; + }; + deleted = { + foreground = "#db4b4b"; + }; + renamed = { + foreground = "#2ac3de"; + }; + typechange = { + foreground = "#2ac3de"; + }; + ignored = { + foreground = "#545c7e"; + }; + conflicted = { + foreground = "#ff9e64"; + }; }; git_repo = { - branch_main = { foreground = "#737aa2"; }; - branch_other = { foreground = "#b4f9f8"; }; - git_clean = { foreground = "#292e42"; }; - git_dirty = { foreground = "#bb9af7"; }; + branch_main = { + foreground = "#737aa2"; + }; + branch_other = { + foreground = "#b4f9f8"; + }; + git_clean = { + foreground = "#292e42"; + }; + git_dirty = { + foreground = "#bb9af7"; + }; }; security_context = { - colon = { foreground = "#545c7e"; }; - user = { foreground = "#737aa2"; }; - role = { foreground = "#2ac3de"; }; - typ = { foreground = "#3d59a1"; }; - range = { foreground = "#9d7cd8"; }; + colon = { + foreground = "#545c7e"; + }; + user = { + foreground = "#737aa2"; + }; + role = { + foreground = "#2ac3de"; + }; + typ = { + foreground = "#3d59a1"; + }; + range = { + foreground = "#9d7cd8"; + }; }; file_type = { - image = { foreground = "#89ddff"; }; - video = { foreground = "#b4f9f8"; }; - music = { foreground = "#73daca"; }; - lossless = { foreground = "#41a6b5"; }; - crypto = { foreground = "#db4b4b"; }; - document = { foreground = "#a9b1d6"; }; - compressed = { foreground = "#ff9e64"; }; - temp = { foreground = "#737aa2"; }; - compiled = { foreground = "#737aa2"; }; - build = { foreground = "#1abc9c"; }; - source = { foreground = "#bb9af7"; }; + image = { + foreground = "#89ddff"; + }; + video = { + foreground = "#b4f9f8"; + }; + music = { + foreground = "#73daca"; + }; + lossless = { + foreground = "#41a6b5"; + }; + crypto = { + foreground = "#db4b4b"; + }; + document = { + foreground = "#a9b1d6"; + }; + compressed = { + foreground = "#ff9e64"; + }; + temp = { + foreground = "#737aa2"; + }; + compiled = { + foreground = "#737aa2"; + }; + build = { + foreground = "#1abc9c"; + }; + source = { + foreground = "#bb9af7"; + }; }; - punctuation = { foreground = "#292e42"; }; - date = { foreground = "#e0af68"; }; - inode = { foreground = "#737aa2"; }; - blocks = { foreground = "#737aa2"; }; - header = { foreground = "#a9b1d6"; }; - octal = { foreground = "#ff9e64"; }; - flags = { foreground = "#9d7cd8"; }; + punctuation = { + foreground = "#292e42"; + }; + date = { + foreground = "#e0af68"; + }; + inode = { + foreground = "#737aa2"; + }; + blocks = { + foreground = "#737aa2"; + }; + header = { + foreground = "#a9b1d6"; + }; + octal = { + foreground = "#ff9e64"; + }; + flags = { + foreground = "#9d7cd8"; + }; - symlink_path = { foreground = "#89ddff"; }; - control_char = { foreground = "#ff9e64"; }; - broken_symlink = { foreground = "#ff007c"; }; - broken_path_overlay = { foreground = "#ff007c"; }; + symlink_path = { + foreground = "#89ddff"; + }; + control_char = { + foreground = "#ff9e64"; + }; + broken_symlink = { + foreground = "#ff007c"; + }; + broken_path_overlay = { + foreground = "#ff007c"; + }; }; }; } diff --git a/home/kutu/default.nix b/home/kutu/default.nix index 3ebd407..cd96a41 100644 --- a/home/kutu/default.nix +++ b/home/kutu/default.nix @@ -4,7 +4,9 @@ let script = pkgs.substitute { src = ./config.rb; substitutions = [ - "--replace-fail" "@src@" "${./scripts}" + "--replace-fail" + "@src@" + "${./scripts}" ]; }; in diff --git a/home/nvim/default.nix b/home/nvim/default.nix index 5be62d2..464647f 100644 --- a/home/nvim/default.nix +++ b/home/nvim/default.nix @@ -41,12 +41,6 @@ p.cpp ])) ]; - - extraPackages = with pkgs; [ - lua-language-server - clang-tools - stylua - ]; }; home.file.".config/nvim".source = ./.; diff --git a/home/nvim/init.lua b/home/nvim/init.lua index 4f8ca7f..fa3d81e 100644 --- a/home/nvim/init.lua +++ b/home/nvim/init.lua @@ -1,3 +1,4 @@ +require("formatting") require("extra") require("keymaps") require("lsp") diff --git a/home/nvim/lua/formatting.lua b/home/nvim/lua/formatting.lua new file mode 100644 index 0000000..dd07bee --- /dev/null +++ b/home/nvim/lua/formatting.lua @@ -0,0 +1,11 @@ +require("conform").setup({ + formatters_by_ft = { + lua = { "stylua" }, + nix = { "nixfmt" }, + }, + + format_on_save = { + timeout_ms = 500, + lsp_fallback = true, + }, +}) diff --git a/home/nvim/lua/lsp.lua b/home/nvim/lua/lsp.lua index 0af235b..4385cef 100644 --- a/home/nvim/lua/lsp.lua +++ b/home/nvim/lua/lsp.lua @@ -5,24 +5,19 @@ vim.lsp.config("lua_ls", { capabilities = capabilities, settings = { Lua = { - diagnostics = { - globals = { - "vim", - }, - }, - workspace = { - library = vim.api.nvim_get_runtime_file("", true), - }, - telemetry = { - enable = false, - }, + diagnostics = { globals = { "vim" } }, + workspace = { library = vim.api.nvim_get_runtime_file("", true) }, + telemetry = { enable = false }, }, }, }) -vim.lsp.config("clangd", { - capabilities = capabilities, -}) +local servers = { "clangd", "nil", "solargraph", "hls" } -vim.lsp.enable("lua_ls") -vim.lsp.enable("clangd") +for _, server in ipairs(servers) do + vim.lsp.config(server, { capabilities = capabilities }) +end + +vim.list_extend(servers, { "lua_ls" }) + +vim.lsp.enable(servers) diff --git a/home/nvim/lua/plugins.lua b/home/nvim/lua/plugins.lua index 60fb3ca..e5e1d67 100644 --- a/home/nvim/lua/plugins.lua +++ b/home/nvim/lua/plugins.lua @@ -60,17 +60,6 @@ require("nvim-cursorline").setup({ }, }) -require("conform").setup({ - formatters_by_ft = { - lua = { "stylua" }, - }, - - format_on_save = { - timeout_ms = 500, - lsp_fallback = true, - }, -}) - local cmp = require("cmp") cmp.setup({ window = { diff --git a/home/tardis.nix b/home/tardis.nix index a686677..f7c460c 100644 --- a/home/tardis.nix +++ b/home/tardis.nix @@ -24,14 +24,4 @@ in exec ~/.xsession fi ''; - - programs.spicetify = { - enable = true; - enabledExtensions = with spicePkgs.extensions; [ - adblockify - hidePodcasts - ]; - theme = spicePkgs.themes.catppuccin; - colorScheme = "mocha"; - }; } diff --git a/home/yazi/default.nix b/home/yazi/default.nix index 5f0248e..88cbe07 100644 --- a/home/yazi/default.nix +++ b/home/yazi/default.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: +{ pkgs, ... }: let tkn-repo = pkgs.fetchFromGitHub { @@ -43,6 +43,6 @@ in require("git"):setup { order = 1500, } - ''; + ''; }; } diff --git a/hosts/common.nix b/hosts/common.nix index 04f28b4..3b519d3 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -1,15 +1,16 @@ -{ config, lib, pkgs, ... }: +{ + config, + pkgs, + ... +}: { - imports = - [ - ../modules/secrets - ]; + imports = [ + ../modules/secrets + ]; boot.resumeDevice = - if config.swapDevices != [] - then (builtins.head config.swapDevices).device - else null; + if config.swapDevices != [ ] then (builtins.head config.swapDevices).device else null; nixpkgs.config.allowUnfree = true; @@ -44,7 +45,12 @@ users.users.me = { isNormalUser = true; shell = pkgs.fish; - extraGroups = [ "wheel" "video" "networkmanager" "input" ]; + extraGroups = [ + "wheel" + "video" + "networkmanager" + "input" + ]; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMPFh01e9doyInt0980V8T4xaakcSaOyXaxxYE4+oSwM me@syedm # server" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJFUwk54CNtSLUyXSTLsIs5KXgEsjOgE4HGlA4FacKjV me@tardis # msi laptop" diff --git a/hosts/syedm/default.nix b/hosts/syedm/default.nix index 869543f..f340148 100644 --- a/hosts/syedm/default.nix +++ b/hosts/syedm/default.nix @@ -1,14 +1,13 @@ -{ config, lib, pkgs, ... }: +{ ... }: { - imports = - [ - ./hardware-configuration.nix + imports = [ + ./hardware-configuration.nix - ../../modules/cloudflare-ddns - ../../modules/gitea - ../../modules/msjd - ]; + ../../modules/cloudflare-ddns + ../../modules/gitea + ../../modules/msjd + ]; networking.hostName = "syedm"; @@ -37,8 +36,12 @@ tempAddresses = "disabled"; firewall = { enable = true; - allowedTCPPorts = [ 22 80 443 ]; - allowedUDPPorts = []; + allowedTCPPorts = [ + 22 + 80 + 443 + ]; + allowedUDPPorts = [ ]; allowPing = true; }; }; diff --git a/hosts/tardis/default.nix b/hosts/tardis/default.nix index c5ca9f3..0379a88 100644 --- a/hosts/tardis/default.nix +++ b/hosts/tardis/default.nix @@ -1,30 +1,38 @@ -{ config, lib, pkgs, inputs, ... }: +{ + lib, + pkgs, + inputs, + ... +}: { - imports = + imports = [ + ./hardware-configuration.nix + + ../../modules/ollama + ../../modules/workstation/graphics.nix + ../../modules/workstation/audio.nix + ../../modules/workstation/xserver.nix + ../../modules/workstation/keyd.nix + ]; + + environment.systemPackages = lib.mkAfter ( + with pkgs; [ - ./hardware-configuration.nix + firefox + xdg-utils + dmenu + pulseaudio + brightnessctl + maim + xclip + xsel + prismlauncher + spotify - ../../modules/ollama - ../../modules/workstation/graphics.nix - ../../modules/workstation/audio.nix - ../../modules/workstation/xserver.nix - ../../modules/workstation/keyd.nix - ]; - - environment.systemPackages = lib.mkAfter (with pkgs; [ - firefox - xdg-utils - dmenu - pulseaudio - brightnessctl - maim - xclip - xsel - prismlauncher - - inputs.kutu.packages.${stdenv.hostPlatform.system}.default - ]); + inputs.kutu.packages.${stdenv.hostPlatform.system}.default + ] + ); fonts.packages = with pkgs; [ nerd-fonts.hurmit