diff --git a/dotfiles/neovim/lazy-lock.json b/dotfiles/neovim/lazy-lock.json index b4e5e5c..28cb7a0 100644 --- a/dotfiles/neovim/lazy-lock.json +++ b/dotfiles/neovim/lazy-lock.json @@ -43,7 +43,7 @@ "nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" }, "nvim-lspconfig": { "branch": "master", "commit": "0f94c5fded29c0024254259f3d8a0284bfb507ea" }, "nvim-tree.lua": { "branch": "master", "commit": "a50723e35f57f89fb67019127a16d90f16edfef8" }, - "nvim-treesitter": { "branch": "master", "commit": "25b656a4b771ee7d440e506280b9ae546d6f7233" }, + "nvim-treesitter": { "branch": "master", "commit": "ee1d6182801204c397534ac69c37f83283ba69e3" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "582cbb5a4cb50f6161cac8cc01f55aeaff6d836a" }, "nvim-web-devicons": { "branch": "master", "commit": "074e13f21f52bb45d654069bdadbcb6d7c2b65d0" }, "nvim_context_vt": { "branch": "master", "commit": "e592a9142fbfe0878ce886cd0d745963604c61d2" }, diff --git a/flake.nix b/flake.nix index 849bd0d..0f4be00 100644 --- a/flake.nix +++ b/flake.nix @@ -87,10 +87,10 @@ overlays = import ./overlays; # Reusable nixos modules - nixosModules = import ./modules/nixos; + nixosModules = import ./modules/nixos // import ./modules/common; # Reusable home-manager modules - homeManagerModules = import ./modules/home-manager; + homeManagerModules = import ./modules/home-manager // import ./modules/common; # NixOS configuration entrypoint # Available through 'nixos-rebuild --flake .#... diff --git a/home/adrielus/features/cli/fish/config.fish b/home/adrielus/features/cli/fish/config.fish index ffd8955..5df3751 100644 --- a/home/adrielus/features/cli/fish/config.fish +++ b/home/adrielus/features/cli/fish/config.fish @@ -1,6 +1,7 @@ # {{{ Start tmux if not already inside tmux if status is-interactive and not set -q TMUX +and not set -q NO_TMUX exec tmux attach -t Welcome || tmux || echo "Something went wrong trying to start tmux" end # }}} diff --git a/home/adrielus/features/desktop/common/eww/default.nix b/home/adrielus/features/desktop/common/eww/default.nix index 6397361..6052a77 100644 --- a/home/adrielus/features/desktop/common/eww/default.nix +++ b/home/adrielus/features/desktop/common/eww/default.nix @@ -4,7 +4,7 @@ let template = builtins.readFile ./template.yuck; }; - widgets = config.satellite-dev.path "home/adrielus/features/desktop/common/eww/widgets"; + widgets = config.satellite.dev.path "home/adrielus/features/desktop/common/eww/widgets"; in { home.packages = [ pkgs.eww ]; diff --git a/home/adrielus/features/desktop/common/polybar/default.nix b/home/adrielus/features/desktop/common/polybar/default.nix index c637185..e729997 100644 --- a/home/adrielus/features/desktop/common/polybar/default.nix +++ b/home/adrielus/features/desktop/common/polybar/default.nix @@ -14,7 +14,7 @@ in enable = true; extraConfig = '' ; Generated theme - ${builtins.readFile base16-polybar} + include-file = ${base16-polybar} ; Consistent fonts [fonts] diff --git a/home/adrielus/features/desktop/common/rofi/default.nix b/home/adrielus/features/desktop/common/rofi/default.nix index bb12c61..a0aa9dd 100644 --- a/home/adrielus/features/desktop/common/rofi/default.nix +++ b/home/adrielus/features/desktop/common/rofi/default.nix @@ -12,6 +12,7 @@ in { home.packages = with pkgs; [ rofi ]; + xdg.configFile."rofi/base16.rasi".source = base16-rofi; xdg.configFile."rofi/config.rasi".text = '' // Manual config ${builtins.readFile ./config.rasi} @@ -22,6 +23,6 @@ in } // Theme - ${builtins.readFile base16-rofi} + @import "base16" ''; } diff --git a/home/adrielus/features/desktop/common/wezterm/default.nix b/home/adrielus/features/desktop/common/wezterm/default.nix new file mode 100644 index 0000000..34748b7 --- /dev/null +++ b/home/adrielus/features/desktop/common/wezterm/default.nix @@ -0,0 +1,8 @@ +{ pkgs, config, ... }: { + home.packages = [ pkgs.wezterm ]; + + # Create link to config + xdg.configFile."wezterm/colorscheme.lua".text = config.satellite.colorscheme.lua; + xdg.configFile."wezterm/wezterm.lua".source = + config.satellite.dev.path "home/adrielus/features/desktop/common/wezterm/wezterm.lua"; +} diff --git a/home/adrielus/features/desktop/common/wezterm/wezterm.lua b/home/adrielus/features/desktop/common/wezterm/wezterm.lua new file mode 100644 index 0000000..1d7cbd2 --- /dev/null +++ b/home/adrielus/features/desktop/common/wezterm/wezterm.lua @@ -0,0 +1,63 @@ +-- {{{ Import stuff & create config object +local wezterm = require("wezterm") +local colorscheme = require("colorscheme") -- injected by nix! + +-- This table will hold the configuration. +local config = {} + +-- In newer versions of wezterm, use the config_builder which will +-- help provide clearer error messages +if wezterm.config_builder then + config = wezterm.config_builder() +end +-- }}} + +local font_size = 20.0 + +-- {{{ Theming +config.colors = wezterm.color.load_base16_scheme(colorscheme.source) + +-- {{{ Window frame +config.window_frame = { + font = wezterm.font({ family = colorscheme.fonts.monospace }), + font_size = font_size, + active_titlebar_bg = colorscheme.base00, + inactive_titlebar_bg = colorscheme.base00, +} +-- }}} +-- {{{ Tab bar colors +config.colors.tab_bar = { + background = colorscheme.base02, + active_tab = { + bg_color = colorscheme.base0A, + fg_color = colorscheme.base00, + }, + inactive_tab = { + bg_color = colorscheme.base02, + fg_color = colorscheme.base05, + }, + inactive_tab_hover = { + bg_color = colorscheme.base01, + fg_color = colorscheme.base05, + }, + new_tab = { + bg_color = colorscheme.base02, + fg_color = colorscheme.base05, + }, + new_tab_hover = { + bg_color = colorscheme.base02, + fg_color = colorscheme.base05, + italic = true, + }, +} +-- }}} +-- }}} +-- {{{ Main config options +config.adjust_window_size_when_changing_font_size = false -- Makes it work with fixed window sizes. +config.automatically_reload_config = true +config.font_size = font_size +config.use_fancy_tab_bar = false +-- }}} + +-- and finally, return the configuration to wezterm +return config diff --git a/home/adrielus/features/desktop/common/zathura.nix b/home/adrielus/features/desktop/common/zathura.nix index 7a2d600..e37457e 100644 --- a/home/adrielus/features/desktop/common/zathura.nix +++ b/home/adrielus/features/desktop/common/zathura.nix @@ -13,7 +13,7 @@ in enable = true; extraConfig = '' # Generated theme - ${builtins.readFile base16-zathura} + include ${base16-zathura} # Open document in fit-width mode by default set adjust-open "best-fit" diff --git a/home/adrielus/features/desktop/xmonad.nix b/home/adrielus/features/desktop/xmonad.nix index 9e75a6a..9868c56 100644 --- a/home/adrielus/features/desktop/xmonad.nix +++ b/home/adrielus/features/desktop/xmonad.nix @@ -3,6 +3,7 @@ ./common/rofi ./common/polybar ./common/eww + ./common/wezterm ./common/alacritty.nix ./common/feh.nix ]; diff --git a/home/adrielus/features/neovim/default.nix b/home/adrielus/features/neovim/default.nix index 7895b1e..4ce17a9 100644 --- a/home/adrielus/features/neovim/default.nix +++ b/home/adrielus/features/neovim/default.nix @@ -65,16 +65,13 @@ let # {{{ extraRuntime extraRuntime = env: [ # Snippets - (config.satellite-dev.path "dotfiles/vscode-snippets") + (config.satellite.dev.path "dotfiles/vscode-snippets") # Base16 theme (pkgs.writeTextDir "lua/nix/theme.lua" - '' - return { - name = "${config.lib.stylix.scheme.scheme}" - } - '') + config.satellite.colorscheme.lua + ) # Provide hints as to what app we are in # (Useful because neovide does not provide the info itself right away) @@ -126,7 +123,7 @@ in # Do not manage neovim via nix programs.neovim.enable = false; - home.file.".config/nvim".source = config.satellite-dev.path "dotfiles/neovim"; + xdg.configFile.nvim.source = config.satellite.dev.path "dotfiles/neovim"; home.sessionVariables.EDITOR = "nvim"; home.packages = [ diff --git a/home/adrielus/tethys.nix b/home/adrielus/tethys.nix index 3952039..b56ce99 100644 --- a/home/adrielus/tethys.nix +++ b/home/adrielus/tethys.nix @@ -27,5 +27,5 @@ ]; home.sessionVariables.QT_SCREEN_SCALE_FACTOR = 1.4; # Bigger text in qt apps - satellite-dev.enable = true; # Simlink some stuff outside the store + satellite.dev.enable = true; # Simlink some stuff outside the store } diff --git a/modules/common/default.nix b/modules/common/default.nix new file mode 100644 index 0000000..11cb41d --- /dev/null +++ b/modules/common/default.nix @@ -0,0 +1,6 @@ +# (https://nixos.wiki/wiki/Module). + +{ + # example = import ./example.nix; + lua-colorscheme = import ./lua-colorscheme.nix; +} diff --git a/modules/common/lua-colorscheme.nix b/modules/common/lua-colorscheme.nix new file mode 100644 index 0000000..d805f18 --- /dev/null +++ b/modules/common/lua-colorscheme.nix @@ -0,0 +1,35 @@ +# Lua file containing the current colorscheme. +{ lib, config, ... }: { + options.satellite.colorscheme.lua = lib.mkOption { + type = lib.types.lines; + description = "Lua file containing the current colorscheme"; + }; + + config.satellite.colorscheme.lua = '' + return { + name = "${config.lib.stylix.scheme.scheme}", + base00 = "${config.lib.stylix.scheme.base00}", + base01 = "${config.lib.stylix.scheme.base01}", + base02 = "${config.lib.stylix.scheme.base02}", + base03 = "${config.lib.stylix.scheme.base03}", + base04 = "${config.lib.stylix.scheme.base04}", + base05 = "${config.lib.stylix.scheme.base05}", + base06 = "${config.lib.stylix.scheme.base06}", + base07 = "${config.lib.stylix.scheme.base07}", + base08 = "${config.lib.stylix.scheme.base07}", + base09 = "${config.lib.stylix.scheme.base09}", + base0A = "${config.lib.stylix.scheme.base0A}", + base0B = "${config.lib.stylix.scheme.base0B}", + base0C = "${config.lib.stylix.scheme.base0C}", + base0D = "${config.lib.stylix.scheme.base0D}", + base0E = "${config.lib.stylix.scheme.base0E}", + base0F = "${config.lib.stylix.scheme.base0F}", + -- TODO: check if this works with the genetic algorithm + source = "${config.stylix.base16Scheme}", + fonts = { + normal = "${config.stylix.fonts.sansSerif.name}", + monospace = "${config.stylix.fonts.monospace.name}" + } + } + ''; +} diff --git a/modules/home-manager/satellite-dev.nix b/modules/home-manager/satellite-dev.nix index 2eabe35..89c175d 100644 --- a/modules/home-manager/satellite-dev.nix +++ b/modules/home-manager/satellite-dev.nix @@ -1,5 +1,5 @@ { lib, config, ... }: { - options.satellite-dev = { + options.satellite.dev = { enable = lib.mkOption { type = lib.types.bool; default = false; @@ -18,8 +18,8 @@ }; }; - config.satellite-dev.path = path: - if config.satellite-dev.enable then - config.lib.file.mkOutOfStoreSymlink "${config.satellite-dev.root}/${path}" + config.satellite.dev.path = path: + if config.satellite.dev.enable then + config.lib.file.mkOutOfStoreSymlink "${config.satellite.dev.root}/${path}" else "${../..}/${path}"; }