diff --git a/flake.nix b/flake.nix index 93db66f..1da0cd3 100644 --- a/flake.nix +++ b/flake.nix @@ -68,7 +68,7 @@ }; }; pkgs = import nixpkgs nixpkgsSettings; - unstablePkgs = import nixpkgs nixpkgsSettings; + unstablePkgs = import unstable nixpkgsSettings; homeManagerSettings = { home-manager = { @@ -83,7 +83,7 @@ nixos-hardware.nixosModules.common-cpu-intel nixos-hardware.nixosModules.common-pc-laptop nixos-hardware.nixosModules.common-pc-laptop-ssd - ./odin/base.nix + ./odin/common_configuration.nix ]; thorBaseModules = [ @@ -99,7 +99,7 @@ modules = odinBaseModules ++ [ home-manager.nixosModules.home-manager homeManagerSettings - { home-manager.users.bertof = import ./odin.nix; } + { home-manager.users.bertof = import ./home_manager/odin.nix; } ] ++ extraModules; }; @@ -108,7 +108,7 @@ modules = odinBaseModules ++ [ home-manager-unstable.nixosModules.home-manager homeManagerSettings - { home-manager.users.bertof = import ./odin.nix; } + { home-manager.users.bertof = import ./home_manager/odin.nix; } ] ++ extraModules; }; @@ -136,19 +136,18 @@ nixosConfigurations = rec { - thor = thor-unstable; + thor = thor-stable; thor-stable = thorStable [ ./nixos_modules/pro_audio.nix ]; thor-unstable = thorUnstable [ ./nixos_modules/pro_audio.nix ]; thor-big-data = thorUnstable [ ./nixos_modules/pro_audio.nix ./nixos_modules/big_data.nix ]; - odin = odin-intel-unstable; - - odin-intel-unstable = odinUnstable [ ./odin/odin-intel.nix ./nixos_modules/pro_audio.nix ]; - odin-nvidia-unstable = odinUnstable [ ./odin/odin-nvidia.nix ./nixos_modules/pro_audio.nix ]; - odin-intel-stable = odinStable [ ./odin/odin-intel.nix ./nixos_modules/pro_audio.nix ]; - odin-nvidia-stable = odinStable [ ./odin/odin-nvidia.nix ./nixos_modules/pro_audio.nix ]; + odin = odin-intel-stable; + odin-intel-unstable = odinUnstable [ ./odin/configuration-intel.nix ./nixos_modules/pro_audio.nix ]; + odin-nvidia-unstable = odinUnstable [ ./odin/configuration-nvidia.nix ./nixos_modules/pro_audio.nix ]; + odin-intel-stable = odinStable [ ./odin/configuration-intel.nix ./nixos_modules/pro_audio.nix ]; + odin-nvidia-stable = odinStable [ ./odin/configuration-nvidia.nix ./nixos_modules/pro_audio.nix ]; }; }; } diff --git a/home_manager/basic_env.nix b/home_manager/basic_env.nix new file mode 100644 index 0000000..bf266a4 --- /dev/null +++ b/home_manager/basic_env.nix @@ -0,0 +1,50 @@ +{ pkgs, ... }: +{ + home = { + language.base = "it_IT.UTF-8"; + keyboard = { + layout = "it"; + options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" ]; + }; + packages = with pkgs; [ + file + htop + mmv-go + neofetch + nixos-option + nix-tree + unrar + unzip + wget + xclip + yq + zip + ]; + }; + + imports = [ + ./modules/configurations.nix + + ./modules/bash.nix + ./modules/bat.nix + ./modules/bottom.nix + ./modules/broot.nix + ./modules/dircolors.nix + ./modules/direnv.nix + ./modules/fonts.nix + ./modules/fzf.nix + ./modules/git.nix + ./modules/gpg.nix + ./modules/info.nix + ./modules/jq.nix + ./modules/keychain.nix + ./modules/lf.nix + ./modules/man.nix + ./modules/shell_aliases.nix + ./modules/ssh.nix + ./modules/starship.nix + ./modules/tmux.nix + ./modules/zoxide.nix + ./modules/zsh.nix + ]; +} diff --git a/modules/alacritty.nix b/home_manager/modules/alacritty.nix similarity index 100% rename from modules/alacritty.nix rename to home_manager/modules/alacritty.nix diff --git a/modules/bash.nix b/home_manager/modules/bash.nix similarity index 100% rename from modules/bash.nix rename to home_manager/modules/bash.nix diff --git a/modules/bat.nix b/home_manager/modules/bat.nix similarity index 100% rename from modules/bat.nix rename to home_manager/modules/bat.nix diff --git a/modules/bottom.nix b/home_manager/modules/bottom.nix similarity index 100% rename from modules/bottom.nix rename to home_manager/modules/bottom.nix diff --git a/modules/broot.nix b/home_manager/modules/broot.nix similarity index 100% rename from modules/broot.nix rename to home_manager/modules/broot.nix diff --git a/modules/bspwm.nix b/home_manager/modules/bspwm.nix similarity index 100% rename from modules/bspwm.nix rename to home_manager/modules/bspwm.nix diff --git a/modules/configurations.nix b/home_manager/modules/configurations.nix similarity index 100% rename from modules/configurations.nix rename to home_manager/modules/configurations.nix diff --git a/home_manager/modules/cpp.nix b/home_manager/modules/cpp.nix new file mode 100644 index 0000000..08fa37c --- /dev/null +++ b/home_manager/modules/cpp.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + clang-tools + ]; +} diff --git a/modules/dircolors.nix b/home_manager/modules/dircolors.nix similarity index 100% rename from modules/dircolors.nix rename to home_manager/modules/dircolors.nix diff --git a/modules/direnv.nix b/home_manager/modules/direnv.nix similarity index 100% rename from modules/direnv.nix rename to home_manager/modules/direnv.nix diff --git a/modules/dunst.nix b/home_manager/modules/dunst.nix similarity index 100% rename from modules/dunst.nix rename to home_manager/modules/dunst.nix diff --git a/modules/fonts.nix b/home_manager/modules/fonts.nix similarity index 100% rename from modules/fonts.nix rename to home_manager/modules/fonts.nix diff --git a/modules/fzf.nix b/home_manager/modules/fzf.nix similarity index 100% rename from modules/fzf.nix rename to home_manager/modules/fzf.nix diff --git a/modules/git.nix b/home_manager/modules/git.nix similarity index 100% rename from modules/git.nix rename to home_manager/modules/git.nix diff --git a/home_manager/modules/go.nix b/home_manager/modules/go.nix new file mode 100644 index 0000000..9f7fe72 --- /dev/null +++ b/home_manager/modules/go.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: { + programs.go = { + enable = true; + }; + + home.packages = with pkgs; [ + gopls + ]; +} diff --git a/modules/gpg.nix b/home_manager/modules/gpg.nix similarity index 100% rename from modules/gpg.nix rename to home_manager/modules/gpg.nix diff --git a/modules/grobi.nix b/home_manager/modules/grobi.nix similarity index 100% rename from modules/grobi.nix rename to home_manager/modules/grobi.nix diff --git a/modules/gtk_theme.nix b/home_manager/modules/gtk_theme.nix similarity index 100% rename from modules/gtk_theme.nix rename to home_manager/modules/gtk_theme.nix diff --git a/modules/info.nix b/home_manager/modules/info.nix similarity index 100% rename from modules/info.nix rename to home_manager/modules/info.nix diff --git a/modules/java.nix b/home_manager/modules/java.nix similarity index 100% rename from modules/java.nix rename to home_manager/modules/java.nix diff --git a/home_manager/modules/javascript.nix b/home_manager/modules/javascript.nix new file mode 100644 index 0000000..80e714a --- /dev/null +++ b/home_manager/modules/javascript.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + flow + ]; +} + diff --git a/modules/joystickwake.nix b/home_manager/modules/joystickwake.nix similarity index 100% rename from modules/joystickwake.nix rename to home_manager/modules/joystickwake.nix diff --git a/modules/jq.nix b/home_manager/modules/jq.nix similarity index 100% rename from modules/jq.nix rename to home_manager/modules/jq.nix diff --git a/home_manager/modules/kakoune.nix b/home_manager/modules/kakoune.nix new file mode 100644 index 0000000..50ae49e --- /dev/null +++ b/home_manager/modules/kakoune.nix @@ -0,0 +1,284 @@ +{ config, lib, pkgs, ... }: +let + strPalette = with pkgs.rice; palette.toRgbShortHex colorPalette; + themeBuilder = palette: with palette; '' + set-face global value rgb:${normal.magenta},default + set-face global type rgb:${bright.white},default + set-face global identifier rgb:${normal.cyan},default + set-face global string rgb:${normal.green},default + set-face global error rgb:${normal.red},default + set-face global keyword rgb:${normal.blue},default + set-face global operator rgb:${normal.blue},default + set-face global attribute rgb:${bright.blue},default + set-face global comment rgb:${bright.blue},default + set-face global meta rgb:${normal.yellow},default + set-face global Default rgb:${normal.white},default + set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow} + set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white} + set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow} + set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white} + set-face global MenuForeground rgb:${normal.white},rgb:${bright.black} + set-face global MenuBackground default,rgb:${normal.black} + set-face global MenuInfo default,rgb:${normal.black} + set-face global Information rgb:${dark.black},rgb:${normal.cyan} + set-face global StatusLine rgb:${normal.white},rgb:${normal.black} + set-face global StatusLineMode rgb:${normal.blue},rgb:${normal.black} + set-face global StatusLineInfo rgb:${normal.blue},rgb:${normal.black} + set-face global StatusLineValue rgb:${normal.blue},rgb:${normal.black} + set-face global StatusCursor rgb:${dark.black},rgb:${normal.yellow} + set-face global Prompt rgb:${normal.cyan},rgb:${normal.black} + set-face global BufferPadding default,default + ''; + + packages = with pkgs; [ + yaml-language-server + nodePackages.vscode-langservers-extracted + rnix-lsp + # (pkgs.makeDesktopItem + # { + # name = "kakoune"; + # exec = "kak %U"; + # icon = "kakoune"; + # desktopName = "Kakoune"; + # comment = "Kakoune text editor"; + # terminal = true; + # categories = [ "Development" ]; + # }) + editorconfig-core-c + aspell + aspellDicts.en + aspellDicts.en-computers + aspellDicts.en-science + aspellDicts.it + ]; + +in +{ + home.sessionVariables = { EDITOR = "kak"; VISUAL = "kak"; }; + programs.bash.shellAliases = { k = "kak"; }; + programs.zsh.shellAliases = { k = "kak"; }; + home.packages = packages; + programs.kakoune = { + enable = true; + config = { + colorScheme = "nord"; + tabStop = 2; + indentWidth = 2; + alignWithTabs = true; + scrollOff = { lines = 5; columns = 3; }; + ui = { setTitle = true; changeColors = true; enableMouse = true; }; + wrapLines = { enable = true; word = true; }; + numberLines = { enable = true; highlightCursor = true; }; + keyMappings = [ + { mode = "normal"; docstring = "Edit file"; key = ""; effect = ":edit"; } + { mode = "user"; docstring = "Code actions"; key = "a"; effect = ":lsp-code-actions"; } + { mode = "user"; docstring = "Comment block"; key = "b"; effect = ":comment-block"; } + { mode = "user"; docstring = "Comment line"; key = "l"; effect = ":comment-line"; } + { mode = "user"; docstring = "Copy to clipboard"; key = "y"; effect = "${pkgs.xclip}/bin/xclip -i -selection clipboard"; } + { mode = "user"; docstring = "Format code with formatter"; key = "f"; effect = ":format"; } + { mode = "user"; docstring = "Format code with LSP"; key = "F"; effect = ":lsp-formatting-sync"; } + { mode = "user"; docstring = "Jump to definition"; key = "d"; effect = ":lsp-definition"; } + { mode = "user"; docstring = "Rename object"; key = "r"; effect = ":lsp-rename-prompt"; } + { mode = "user"; docstring = "Jump to type definition"; key = "t"; effect = ":lsp-type-definition"; } + { mode = "user"; docstring = "List project diagnostics"; key = "i"; effect = ":lsp-diagnostics"; } + { mode = "user"; docstring = "Paste from clipboard (after)"; key = "P"; effect = "${pkgs.xclip}/bin/xclip -selection clipboard -o"; } + { mode = "user"; docstring = "Paste from clipboard (before)"; key = "p"; effect = "!${pkgs.xclip}/bin/xclip -selection clipboard -o"; } + { mode = "user"; docstring = "Show hover info"; key = "q"; effect = ":lsp-hover"; } + { mode = "user"; docstring = "Spellcheck English"; key = "S"; effect = ":spell en"; } + { mode = "user"; docstring = "Spellcheck"; key = "s"; effect = ":spell "; } + { mode = "normal"; docstring = "Try next snippet placeholder"; key = ""; effect = ": insert-c-n"; } + # { mode = "normal"; docstring = "Search"; key = "/"; effect = "/(?i)"; } + # { mode = "normal"; docstring = "Reverse search"; key = ""; effect = "(?i)"; } + ]; + hooks = with pkgs; [ + { name = "BufCreate"; option = ".*"; commands = "editorconfig-load"; } + # { name = "ModuleLoaded"; option = "auto-pairs"; commands = "auto-pairs-enable"; } + { name = "ModuleLoaded"; option = "powerline"; commands = "powerline-enable; powerline-start"; } + { name = "BufSetOption"; option = "filetype=latex"; commands = "set-option buffer formatcmd latexindent"; } + { name = "BufSetOption"; option = "filetype=python"; commands = "set-option buffer formatcmd 'black -'"; } + { name = "BufSetOption"; option = "filetype=(markdown|html|json|yaml|css|scss|less)"; commands = "set-option buffer formatcmd prettier"; } + { name = "BufSetOption"; option = "filetype=rust"; commands = "set-option buffer formatcmd 'rustfmt'"; } + { name = "BufSetOption"; option = "filetype=sh"; commands = "set-option buffer formatcmd 'rustfmt'"; } + ]; + # TODO add more formatters from https://github.com/mawww/kakoune/wiki/Format + }; + extraConfig = builtins.concatStringsSep "\n" [ + "# Custom commands" + "add-highlighter global/ regex \\h+$ 0:Error # Highlight trailing spaces" + "eval %sh{kak-lsp --kakoune -s $kak_session}" + "lsp-enable" + '' + def -hidden insert-c-n %{ + try %{ + lsp-snippets-select-next-placeholders + exec 'd' + } catch %{ + exec -with-hooks '' + } + } + '' + "require-module powerline" + "require-module connect-broot" + "require-module connect-lf" + "require-module connect-rofi" + ]; + plugins = with pkgs.kakounePlugins; [ + prelude-kak + kak-lsp + auto-pairs-kak + powerline-kak + connect-kak + ]; + }; + + # THEME FILE + xdg.configFile."kak/colors/nord.kak".text = with strPalette; '' + set-face global value rgb:${normal.magenta},default + set-face global type rgb:${bright.white},default + set-face global identifier rgb:${normal.cyan},default + set-face global string rgb:${normal.green},default + set-face global error rgb:${normal.red},default + set-face global keyword rgb:${normal.blue},default + set-face global operator rgb:${normal.blue},default + set-face global attribute rgb:${bright.blue},default + set-face global comment rgb:${bright.blue},default + set-face global meta rgb:${normal.yellow},default + set-face global Default rgb:${normal.white},default + set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow} + set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white} + set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow} + set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white} + set-face global MenuForeground rgb:${normal.white},rgb:${bright.black} + set-face global MenuBackground default,rgb:${normal.black} + set-face global MenuInfo default,rgb:${normal.black} + set-face global Information rgb:${dark.black},rgb:${normal.cyan} + set-face global StatusLine rgb:${normal.white},rgb:${normal.black} + set-face global StatusLineMode rgb:${normal.blue},rgb:${normal.black} + set-face global StatusLineInfo rgb:${normal.blue},rgb:${normal.black} + set-face global StatusLineValue rgb:${normal.blue},rgb:${normal.black} + set-face global StatusCursor rgb:${dark.black},rgb:${normal.yellow} + set-face global Prompt rgb:${normal.cyan},rgb:${normal.black} + set-face global BufferPadding default,default + ''; + + xdg.configFile."kak-lsp/kak-lsp.toml".text = with pkgs; '' + snippet_support = false + verbosity = 2 + [server] + timeout = 1800 # seconds = 30 minutes + + [language.c_cpp] + filetypes = ["c", "cpp"] + roots = ["compile_commands.json", ".clangd"] + command = "clangd" + offset_encoding = "utf-8" + + [language.json] + filetypes = ["json"] + roots = ["package.json"] + command = "vscode-json-language-server" + args = ["--stdio"] + + [language.yaml] + filetypes = ["yaml"] + roots = [".git"] + command = "yaml-language-server" + args = ["--stdio"] + + [language.yaml.settings] + # See https://github.com/redhat-developer/yaml-language-server#language-server-settings + # Defaults are at https://github.com/redhat-developer/yaml-language-server/blob/master/src/yamlSettings.ts + yaml.format.enable = true + + [language.go] + filetypes = ["go"] + roots = ["Gopkg.toml", "go.mod", ".git", ".hg"] + command = "gopls" + offset_encoding = "utf-8" + settings_section = "gopls" + + [language.go.settings.gopls] + # See https://github.com/golang/tools/blob/master/gopls/doc/settings.md + # "build.buildFlags" = [] + + [language.html] + filetypes = ["html"] + roots = ["package.json"] + command = "vscode-html-language-server" + args = ["--stdio"] + + [language.css] + filetypes = ["css"] + roots = ["package.json", ".git"] + command = "vscode-css-language-server" + args = ["--stdio"] + + [language.less] + filetypes = ["less"] + roots = ["package.json", ".git"] + command = "vscode-css-language-server" + args = ["--stdio"] + + [language.scss] + filetypes = ["scss"] + roots = ["package.json", ".git"] + command = "vscode-css-language-server" + args = ["--stdio"] + + [language.javascript] + filetypes = ["javascript"] + roots = [".flowconfig"] + command = "flow" + args = ["lsp"] + + [language.latex] + filetypes = ["latex"] + roots = [".git"] + command = "texlab" + settings_section = "texlab" + + [language.latex.settings.texlab] + # See https://github.com/latex-lsp/texlab/blob/master/src/options.rs + # bibtexFormatter = "texlab" + + [language.nix] + filetypes = ["nix"] + roots = ["flake.nix", "shell.nix", ".git"] + command = "rnix-lsp" + + [language.python] + filetypes = ["python"] + roots = ["requirements.txt", "setup.py", ".git", ".hg"] + command = "pylsp" + offset_encoding = "utf-8" + + [language.python.settings] + # See https://github.com/palantir/python-language-server#configuration + # and https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json + # "pyls.configurationSources" = ["flake8"] + + [language.rust] + filetypes = ["rust"] + roots = ["Cargo.toml"] + command = "rust-analyzer" + settings_section = "rust-analyzer" + + [language.rust.settings.rust-analyzer] + hoverActions.enable = false # kak-lsp doesn't support this at the moment + # cargo.features = [] + # See https://rust-analyzer.github.io/manual.html#configuration + # If you get 'unresolved proc macro' warnings, you have two options + # 1. The safe choice is two disable the warning: + diagnostics.disabled = ["unresolved-proc-macro"] + # 2. Or you can opt-in for proc macro support + procMacro.enable = true + cargo.loadOutDirsFromCheck = true + # See https://github.com/rust-analyzer/rust-analyzer/issues/6448 + + [language.bash] + filetypes = ["sh"] + roots = [".git", ".hg"] + command = "bash-language-server" + args = ["start"] + ''; +} diff --git a/modules/keepassxc.nix b/home_manager/modules/keepassxc.nix similarity index 100% rename from modules/keepassxc.nix rename to home_manager/modules/keepassxc.nix diff --git a/modules/keychain.nix b/home_manager/modules/keychain.nix similarity index 100% rename from modules/keychain.nix rename to home_manager/modules/keychain.nix diff --git a/modules/kitty.nix b/home_manager/modules/kitty.nix similarity index 100% rename from modules/kitty.nix rename to home_manager/modules/kitty.nix diff --git a/home_manager/modules/latex.nix b/home_manager/modules/latex.nix new file mode 100644 index 0000000..b4a0a7c --- /dev/null +++ b/home_manager/modules/latex.nix @@ -0,0 +1,8 @@ +{ pkgs, lib, ...}: +{ + home.packages = with pkgs; [ + tex2nix + texlab + texlive.combined.scheme-medium + ]; +} diff --git a/modules/lf.nix b/home_manager/modules/lf.nix similarity index 100% rename from modules/lf.nix rename to home_manager/modules/lf.nix diff --git a/modules/libinput-gestures.nix b/home_manager/modules/libinput-gestures.nix similarity index 100% rename from modules/libinput-gestures.nix rename to home_manager/modules/libinput-gestures.nix diff --git a/modules/lorri.nix b/home_manager/modules/lorri.nix similarity index 100% rename from modules/lorri.nix rename to home_manager/modules/lorri.nix diff --git a/modules/man.nix b/home_manager/modules/man.nix similarity index 100% rename from modules/man.nix rename to home_manager/modules/man.nix diff --git a/modules/mangohud.nix b/home_manager/modules/mangohud.nix similarity index 100% rename from modules/mangohud.nix rename to home_manager/modules/mangohud.nix diff --git a/modules/megasync.nix b/home_manager/modules/megasync.nix similarity index 100% rename from modules/megasync.nix rename to home_manager/modules/megasync.nix diff --git a/modules/nix-index.nix b/home_manager/modules/nix-index.nix similarity index 100% rename from modules/nix-index.nix rename to home_manager/modules/nix-index.nix diff --git a/modules/noti.nix b/home_manager/modules/noti.nix similarity index 100% rename from modules/noti.nix rename to home_manager/modules/noti.nix diff --git a/modules/obs-studio.nix b/home_manager/modules/obs-studio.nix similarity index 100% rename from modules/obs-studio.nix rename to home_manager/modules/obs-studio.nix diff --git a/modules/office.nix b/home_manager/modules/office.nix similarity index 100% rename from modules/office.nix rename to home_manager/modules/office.nix diff --git a/modules/onedrive.nix b/home_manager/modules/onedrive.nix similarity index 100% rename from modules/onedrive.nix rename to home_manager/modules/onedrive.nix diff --git a/modules/picom.nix b/home_manager/modules/picom.nix similarity index 100% rename from modules/picom.nix rename to home_manager/modules/picom.nix diff --git a/modules/polybar.nix b/home_manager/modules/polybar.nix similarity index 100% rename from modules/polybar.nix rename to home_manager/modules/polybar.nix diff --git a/modules/pro_audio.nix b/home_manager/modules/pro_audio.nix similarity index 100% rename from modules/pro_audio.nix rename to home_manager/modules/pro_audio.nix diff --git a/modules/pycharm.nix b/home_manager/modules/pycharm.nix similarity index 100% rename from modules/pycharm.nix rename to home_manager/modules/pycharm.nix diff --git a/home_manager/modules/python.nix b/home_manager/modules/python.nix new file mode 100644 index 0000000..a6ab8fa --- /dev/null +++ b/home_manager/modules/python.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + black + ] ++ (with pkgs.python3Packages; [ + python-lsp-server + # pyls-black # not updated to the new pylsp + pyls-flake8 + pyls-isort + ]); +} diff --git a/modules/rofi.nix b/home_manager/modules/rofi.nix similarity index 87% rename from modules/rofi.nix rename to home_manager/modules/rofi.nix index cab8166..e0097fe 100644 --- a/modules/rofi.nix +++ b/home_manager/modules/rofi.nix @@ -20,5 +20,5 @@ @theme "nord" ''; - xdg.configFile."rofi/nord.rasi".source = ../configs/rofi/nord.rasi; + xdg.configFile."rofi/nord.rasi".source = ../../configs/rofi/nord.rasi; } diff --git a/modules/rofimoji.nix b/home_manager/modules/rofimoji.nix similarity index 100% rename from modules/rofimoji.nix rename to home_manager/modules/rofimoji.nix diff --git a/home_manager/modules/rust.nix b/home_manager/modules/rust.nix new file mode 100644 index 0000000..ce75c16 --- /dev/null +++ b/home_manager/modules/rust.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + bacon + cargo + clippy + rust-analyzer + rustfmt + ]; +} diff --git a/modules/screen_locker.nix b/home_manager/modules/screen_locker.nix similarity index 100% rename from modules/screen_locker.nix rename to home_manager/modules/screen_locker.nix diff --git a/modules/security.nix b/home_manager/modules/security.nix similarity index 100% rename from modules/security.nix rename to home_manager/modules/security.nix diff --git a/modules/shell_aliases.nix b/home_manager/modules/shell_aliases.nix similarity index 74% rename from modules/shell_aliases.nix rename to home_manager/modules/shell_aliases.nix index 4e85072..1f992bb 100644 --- a/modules/shell_aliases.nix +++ b/home_manager/modules/shell_aliases.nix @@ -15,6 +15,7 @@ let }; in { - programs.bash = { inherit shellAliases; }; - programs.zsh = { inherit shellAliases; }; + home = { inherit shellAliases; }; + # programs.bash = { inherit shellAliases; }; + # programs.zsh = { inherit shellAliases; }; } diff --git a/modules/ssh.nix b/home_manager/modules/ssh.nix similarity index 100% rename from modules/ssh.nix rename to home_manager/modules/ssh.nix diff --git a/modules/starship.nix b/home_manager/modules/starship.nix similarity index 100% rename from modules/starship.nix rename to home_manager/modules/starship.nix diff --git a/modules/sxhkd.nix b/home_manager/modules/sxhkd.nix similarity index 100% rename from modules/sxhkd.nix rename to home_manager/modules/sxhkd.nix diff --git a/modules/syncthing.nix b/home_manager/modules/syncthing.nix similarity index 100% rename from modules/syncthing.nix rename to home_manager/modules/syncthing.nix diff --git a/modules/terminator.nix b/home_manager/modules/terminator.nix similarity index 100% rename from modules/terminator.nix rename to home_manager/modules/terminator.nix diff --git a/modules/tmux.nix b/home_manager/modules/tmux.nix similarity index 100% rename from modules/tmux.nix rename to home_manager/modules/tmux.nix diff --git a/modules/update_background.nix b/home_manager/modules/update_background.nix similarity index 100% rename from modules/update_background.nix rename to home_manager/modules/update_background.nix diff --git a/modules/webapp.nix b/home_manager/modules/webapp.nix similarity index 100% rename from modules/webapp.nix rename to home_manager/modules/webapp.nix diff --git a/modules/xidlehook.nix b/home_manager/modules/xidlehook.nix similarity index 100% rename from modules/xidlehook.nix rename to home_manager/modules/xidlehook.nix diff --git a/modules/zoxide.nix b/home_manager/modules/zoxide.nix similarity index 100% rename from modules/zoxide.nix rename to home_manager/modules/zoxide.nix diff --git a/modules/zsh.nix b/home_manager/modules/zsh.nix similarity index 100% rename from modules/zsh.nix rename to home_manager/modules/zsh.nix diff --git a/home_manager/odin.nix b/home_manager/odin.nix new file mode 100644 index 0000000..7730519 --- /dev/null +++ b/home_manager/odin.nix @@ -0,0 +1,151 @@ +{ pkgs, lib, ... }: +{ + home = { + packages = with pkgs; [ + # # pulseaudio + easyeffects + tex2nix + + kubectl + docker-compose + docker-machine + + arandr + ark + authy + bitwarden + catgirl # IRC + cava + discord + droidcam + # element-desktop # matrix client + # evolution + filelight + # firefox + gallery-dl + # gnome.dconf-editor + # gnome.eog + # gnome.evince + gnome.geary + gnome.gnome-calendar + # gnomeExtensions.appindicator + # gnomeExtensions.caffeine + # gnomeExtensions.dash-to-dock + # gnomeExtensions.dynamic-panel-transparency + # gnomeExtensions.gtile + # gnomeExtensions.just-perfection + # gnomeExtensions.vitals + # gnome.file-roller + # gnome.gnome-screenshot + # gnome.gnome-sound-recorder + # gnome.gnome-sudoku + # gnome.gnome-system-monitor + # gnome.gnome-tweaks + # gnome.nautilus + # gnome.quadrapassel + # gnome.seahorse + # gnome.sushi + google-chrome + gucharmap + httpie + # hyperspace-cli + inkscape + jetbrains.datagrip + kmail + kompare + kontact + korganizer + krita + ksystemlog + kubectl + lutris + kcolorchooser + kompare + korganizer + # keepassxc + kgpg + # kid3 # tag mp3 + krita + ksystemlog + lutris + meld + mmv-go + mpv + neofetch + nixos-option + nix-prefetch-scripts + nix-tree + obsidian + okular + openvpn + p7zip + pavucontrol + pcmanfm + pentablet-driver + procps + ripgrep + skypeforlinux + spotify + unstable.tdesktop + teams + tracker + transmission-gtk + unrar + unzip + virt-manager + wget + # wineFull + wireguard-tools + xclip + xournalpp + yq + zip + zoom-us + zotero + ]; + }; + + imports = [ + ./basic_env.nix + + ./modules/cpp.nix + ./modules/go.nix + ./modules/java.nix + ./modules/javascript.nix + ./modules/latex.nix + ./modules/python.nix + ./modules/rust.nix + + ./modules/alacritty.nix + # ./modules/bspwm.nix + # ./modules/dunst.nix + # ./modules/grobi.nix + ./modules/gtk_theme.nix + ./modules/joystickwake.nix + ./modules/kakoune.nix + # ./modules/keepassxc.nix + ./modules/kitty.nix + ./modules/latex.nix + ./modules/libinput-gestures.nix + ./modules/mangohud.nix + ./modules/megasync.nix + # ./modules/noti.nix + ./modules/obs-studio.nix + ./modules/office.nix + ./modules/onedrive.nix + # ./modules/picom.nix + # ./modules/polybar.nix + ./modules/pro_audio.nix + # ./modules/pycharm.nix + ./modules/rofimoji.nix + ./modules/rofi.nix + # ./modules/screen_locker.nix + # ./modules/security.nix + # ./modules/sxhkd.nix + ./modules/syncthing.nix + ./modules/terminator.nix + # ./modules/update_background.nix + ./modules/webapp.nix + # ./modules/xidlehook.nix + ]; +} diff --git a/modules/go.nix b/modules/go.nix deleted file mode 100644 index f8d8c26..0000000 --- a/modules/go.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.go = { - enable = true; - }; -} diff --git a/modules/kakoune.nix b/modules/kakoune.nix deleted file mode 100644 index e8e6e06..0000000 --- a/modules/kakoune.nix +++ /dev/null @@ -1,453 +0,0 @@ -{ config, lib, pkgs, ... }: -let - strPalette = with pkgs.rice; - palette.toRgbShortHex colorPalette; - packages = with pkgs; - [ - (pkgs.makeDesktopItem - { - name = "kakoune"; - exec = "kak %U"; - icon = "kakoune"; - desktopName = "Kakoune"; - comment = "Kakoune text editor"; - terminal = true; - categories = [ "Development" ]; - }) - ] ++ [ - # editorconfig-core-c - python3.pkgs.editorconfig - ] ++ ( - [ - clang-tools - ] - ) ++ ( - [ - yaml-language-server - nodePackages.vscode-langservers-extracted - ] - ) ++ ( - [ - nodePackages.vscode-langservers-extracted - ] - ) ++ ( - [ - flow - ] - ) ++ ( - [ - texlab - ] - ) ++ ( - [ - rnix-lsp - ] - ) ++ ( - with python3.pkgs; - [ - black - # pyls-black - pyls-flake8 - pyls-isort - # pyls-mypy - python-lsp-server - ] - ) ++ ( - [ - cargo - cargo-watch - clippy - rust-analyzer - rustc - rustfmt - ] - ) ++ ( - [ - nodePackages.bash-language-server - ] - ) ++ ( - [ - aspell - aspellDicts.en - aspellDicts.en-computers - aspellDicts.en-science - aspellDicts.it - ] - ); - -in -{ - home.sessionVariables = { - EDITOR = "kak"; - VISUAL = "kak"; - }; - programs.bash.shellAliases = { k = "kak"; }; - programs.zsh.shellAliases = { k = "kak"; }; - home.packages = packages; - programs.kakoune = { - enable = true; - config = { - colorScheme = "nord"; - tabStop = 2; - indentWidth = 2; - alignWithTabs = true; - scrollOff = { - lines = 5; - columns = 3; - }; - ui = { - setTitle = true; - changeColors = true; - enableMouse = true; - }; - wrapLines = { - enable = true; - word = true; - }; - numberLines = { - enable = true; - highlightCursor = true; - }; - keyMappings = with pkgs; - [ - { - mode = "normal"; - docstring = "Edit file"; - key = ""; - effect = ":edit"; - } - { - mode = "user"; - docstring = "Code actions"; - key = "a"; - effect = ":lsp-code-actions"; - } - { - mode = "user"; - docstring = "Comment block"; - key = "b"; - effect = ":comment-block"; - } - { - mode = "user"; - docstring = "Comment line"; - key = "l"; - effect = ":comment-line"; - } - { - mode = "user"; - docstring = "Copy to clipboard"; - key = "y"; - effect = "${xclip}/bin/xclip -i -selection clipboard"; - } - { - mode = "user"; - docstring = "Format code with formatter"; - key = "f"; - effect = ":format"; - } - { - mode = "user"; - docstring = "Format code with LSP"; - key = "F"; - effect = ":lsp-formatting-sync"; - } - { - mode = "user"; - docstring = "Jump to definition"; - key = "d"; - effect = ":lsp-definition"; - } - { - mode = "user"; - docstring = "Rename object"; - key = "r"; - effect = ":lsp-rename-prompt"; - } - { - mode = "user"; - docstring = "Jump to type definition"; - key = "t"; - effect = ":lsp-type-definition"; - } - { - mode = "user"; - docstring = "List project diagnostics"; - key = "i"; - effect = ":lsp-diagnostics"; - } - { - mode = "user"; - docstring = "Paste from clipboard (after)"; - key = "P"; - effect = "${xclip}/bin/xclip -selection clipboard -o"; - } - { - mode = "user"; - docstring = "Paste from clipboard (before)"; - key = "p"; - effect = "!${xclip}/bin/xclip -selection clipboard -o"; - } - { - mode = "user"; - docstring = "Show hover info"; - key = "q"; - effect = ":lsp-hover"; - } - { - mode = "user"; - docstring = "Spellcheck English"; - key = "S"; - effect = ":spell en"; - } - { - mode = "user"; - docstring = "Spellcheck"; - key = "s"; - effect = ":spell "; - } - { - mode = "normal"; - docstring = "Try next snippet placeholder"; - key = ""; - effect = ": insert-c-n"; - } - # { - # mode = "normal"; - # docstring = "Search"; - # key = "/"; - # effect = "/(?i)"; - # } - # { - # mode = "normal"; - # docstring = "Reverse search"; - # key = ""; - # effect = "(?i)"; - # } - ]; - hooks = with pkgs; - [ - { - name = "BufCreate"; - option = ".*"; - commands = "editorconfig-load"; - } - # { - # name = "ModuleLoaded"; - # option = "auto-pairs"; - # commands = "auto-pairs-enable"; - # } - { - name = "ModuleLoaded"; - option = "powerline"; - commands = builtins.concatStringsSep "\n" [ "powerline-enable" ]; - } - ] ++ ( - [ - { - name = "BufSetOption"; - option = "filetype=latex"; - commands = "set-option buffer formatcmd ${texlive.bin.latexindent}/bin/latexindent"; - } - ] - ) ++ ( - [ - { - name = "BufSetOption"; - option = "filetype=python"; - commands = "set-option buffer formatcmd '${python3.pkgs.black}/bin/black -'"; - } - ] - ) ++ ( - [ - { - name = "BufSetOption"; - option = "filetype=(markdown|html|json|yaml|css|scss|less)"; - commands = "set-option buffer formatcmd ${nodePackages.prettier}/bin/prettier"; - } - ] - ); - # TODO add more formatters from https://github.com/mawww/kakoune/wiki/Format - }; - extraConfig = builtins.concatStringsSep "\n" [ - "# Custom commands" - "add-highlighter global/ regex \\h+$ 0:Error # Highlight trailing spaces" - "eval %sh{kak-lsp --kakoune -s $kak_session}" - "lsp-enable" - '' - def -hidden insert-c-n %{ - try %{ - lsp-snippets-select-next-placeholders - exec 'd' - } catch %{ - exec -with-hooks '' - } - } - '' - "require-module powerline" - "powerline-start" - "require-module connect-broot" - "require-module connect-lf" - "require-module connect-rofi" - ]; - plugins = with pkgs.kakounePlugins; [ - prelude-kak - kak-lsp - auto-pairs-kak - powerline-kak - connect-kak - ]; - }; - xdg.configFile."kak/colors/nord.kak".text = with strPalette; '' - set-face global value rgb:${normal.magenta},default - set-face global type rgb:${bright.white},default - set-face global identifier rgb:${normal.cyan},default - set-face global string rgb:${normal.green},default - set-face global error rgb:${normal.red},default - set-face global keyword rgb:${normal.blue},default - set-face global operator rgb:${normal.blue},default - set-face global attribute rgb:${bright.blue},default - set-face global comment rgb:${bright.blue},default - set-face global meta rgb:${normal.yellow},default - set-face global Default rgb:${normal.white},default - set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow} - set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white} - set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow} - set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white} - set-face global MenuForeground rgb:${normal.white},rgb:${bright.black} - set-face global MenuBackground default,rgb:${normal.black} - set-face global MenuInfo default,rgb:${normal.black} - set-face global Information rgb:${dark.black},rgb:${normal.cyan} - set-face global StatusLine rgb:${normal.white},rgb:${normal.black} - set-face global StatusLineMode rgb:${normal.blue},rgb:${normal.black} - set-face global StatusLineInfo rgb:${normal.blue},rgb:${normal.black} - set-face global StatusLineValue rgb:${normal.blue},rgb:${normal.black} - set-face global StatusCursor rgb:${dark.black},rgb:${normal.yellow} - set-face global Prompt rgb:${normal.cyan},rgb:${normal.black} - set-face global BufferPadding default,default - ''; - xdg.configFile."kak-lsp/kak-lsp.toml".text = with pkgs; builtins.concatStringsSep "\n" - [ - '' - snippet_support = false - verbosity = 2 - [server] - timeout = 1800 # seconds = 30 minutes - '' - '' - [language.c_cpp] - filetypes = ["c", "cpp"] - roots = ["compile_commands.json", ".clangd"] - command = "${clang-tools}/bin/clangd" - offset_encoding = "utf-8" - '' - '' - [language.json] - filetypes = ["json"] - roots = ["package.json"] - command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-json-language-server" - args = ["--stdio"] - [language.yaml] - filetypes = ["yaml"] - roots = [".git"] - command = "${yaml-language-server}/bin/yaml-language-server" - args = ["--stdio"] - [language.yaml.settings] - # See https://github.com/redhat-developer/yaml-language-server#language-server-settings - # Defaults are at https://github.com/redhat-developer/yaml-language-server/blob/master/src/yamlSettings.ts - yaml.format.enable = true - '' - '' - [language.go] - filetypes = ["go"] - roots = ["Gopkg.toml", "go.mod", ".git", ".hg"] - command = "gopls" - offset_encoding = "utf-8" - settings_section = "gopls" - [language.go.settings.gopls] - # See https://github.com/golang/tools/blob/master/gopls/doc/settings.md - # "build.buildFlags" = [] - '' - '' - [language.html] - filetypes = ["html"] - roots = ["package.json"] - command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-html-language-server" - args = ["--stdio"] - [language.css] - filetypes = ["css"] - roots = ["package.json", ".git"] - command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server" - args = ["--stdio"] - [language.less] - filetypes = ["less"] - roots = ["package.json", ".git"] - command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server" - args = ["--stdio"] - [language.scss] - filetypes = ["scss"] - roots = ["package.json", ".git"] - command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server" - args = ["--stdio"] - '' - '' - [language.javascript] - filetypes = ["javascript"] - roots = [".flowconfig"] - command = "${flow}/bin/flow" - args = ["lsp"] - '' - '' - [language.latex] - filetypes = ["latex"] - roots = [".git"] - command = "${texlab}/bin/texlab" - settings_section = "texlab" - [language.latex.settings.texlab] - # See https://github.com/latex-lsp/texlab/blob/master/src/options.rs - # bibtexFormatter = "${texlab}/bin/texlab" - '' - '' - [language.nix] - filetypes = ["nix"] - roots = ["flake.nix", "shell.nix", ".git"] - command = "${rnix-lsp}/bin/rnix-lsp" - '' - '' - [language.python] - filetypes = ["python"] - roots = ["requirements.txt", "setup.py", ".git", ".hg"] - command = "${python3.pkgs.python-lsp-server}/bin/pylsp" - offset_encoding = "utf-8" - [language.python.settings] - # See https://github.com/palantir/python-language-server#configuration - # and https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json - # "pyls.configurationSources" = ["flake8"] - '' - '' - [language.rust] - filetypes = ["rust"] - roots = ["Cargo.toml"] - command = "${rust-analyzer}/bin/rust-analyzer" - settings_section = "rust-analyzer" - [language.rust.settings.rust-analyzer] - hoverActions.enable = false # kak-lsp doesn't support this at the moment - # cargo.features = [] - # See https://rust-analyzer.github.io/manual.html#configuration - # If you get 'unresolved proc macro' warnings, you have two options - # 1. The safe choice is two disable the warning: - diagnostics.disabled = ["unresolved-proc-macro"] - # 2. Or you can opt-in for proc macro support - procMacro.enable = true - cargo.loadOutDirsFromCheck = true - # See https://github.com/rust-analyzer/rust-analyzer/issues/6448 - '' - '' - [language.bash] - filetypes = ["sh"] - roots = [".git", ".hg"] - command = "${nodePackages.bash-language-server}/bin/bash-language-server" - args = ["start"] - '' - ]; -} diff --git a/modules/latex.nix b/modules/latex.nix deleted file mode 100644 index 3756dd5..0000000 --- a/modules/latex.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, lib, ...}: -{ - home.packages = [ - pkgs.texlive.combined.scheme-full - ]; -} diff --git a/odin/base.nix b/odin/common_configuration.nix similarity index 99% rename from odin/base.nix rename to odin/common_configuration.nix index d25993d..456e0ae 100644 --- a/odin/base.nix +++ b/odin/common_configuration.nix @@ -4,7 +4,7 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.initrd.checkJournalingFS = true; - boot.kernelPackages = pkgs.linuxKernel.packages.linux_5_16; + boot.kernelPackages = pkgs.linuxKernel.packages.linux_5_17; boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; # # Cross-build arm @@ -117,7 +117,7 @@ # List packages installed in system profile. To search, run: # $ nix search wget - environment.systemPackages = with pkgs; [ tmux firefox kakoune vim ]; + environment.systemPackages = with pkgs; [ tmux firefox kakoune vim git ]; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. diff --git a/odin/odin-intel.nix b/odin/configuration-intel.nix similarity index 100% rename from odin/odin-intel.nix rename to odin/configuration-intel.nix diff --git a/odin/odin-nvidia.nix b/odin/configuration-nvidia.nix similarity index 100% rename from odin/odin-nvidia.nix rename to odin/configuration-nvidia.nix diff --git a/thor/flake.lock b/thor/flake.lock deleted file mode 100644 index 407ba3e..0000000 --- a/thor/flake.lock +++ /dev/null @@ -1,65 +0,0 @@ -{ - "nodes": { - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1648834319, - "narHash": "sha256-i5Aj4Aw64D/A0X6XW5LxSS4XBnYj7gMz+kN4dpsbdk8=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "0bdbdea2e26c984b096f4f7d10e3c88536a980b0", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-21.11", - "repo": "home-manager", - "type": "github" - } - }, - "nixos-hardware": { - "locked": { - "lastModified": 1648141026, - "narHash": "sha256-h8e3+5EZFbYHTMb0DN2ACuQTJBNHpqigvmEV1w2WIuE=", - "owner": "NixOS", - "repo": "nixos-hardware", - "rev": "feceb4d24f582817d8f6e737cd40af9e162dee05", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixos-hardware", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1649024309, - "narHash": "sha256-AWbvj/NHZXVwAnHaVOFlxg7tcNerEKrKBmgGfztSHWM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "af0a9bc0e5341855518e9c1734d7ef913e5138b9", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-21.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "home-manager": "home-manager", - "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/thor/flake.nix b/thor/flake.nix deleted file mode 100644 index 8063860..0000000 --- a/thor/flake.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - description = "Thor system configuration"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - home-manager.url = "github:nix-community/home-manager/release-21.11"; - nixos-hardware.url = "github:NixOS/nixos-hardware"; - # nixos-hardware.inputs.nixpkgs.follows = "nixpkgs"; - }; - - outputs = { self, nixpkgs, home-manager, nixos-hardware }: - let - system = "x86_64-linux"; - pkgs = import nixpkgs { - inherit system; - config = { allowUnfree = true; }; - }; - lib = nixpkgs.lib; - in - { - nixosConfigurations = { - thor = lib.nixosSystem { - inherit system; - - modules = [ - nixos-hardware.nixosModules.common-cpu-amd - nixos-hardware.nixosModules.common-pc-ssd - ./configuration.nix - ]; - }; - }; - }; - -}