diff --git a/flake.lock b/flake.lock index b2ef5c9..209ec64 100644 --- a/flake.lock +++ b/flake.lock @@ -155,17 +155,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1708976249, - "narHash": "sha256-bA0rrmxj5K1W/EWgzpk1NUvEIyAk1hqsmxcRCmmXFuw=", - "owner": "NixOS", + "lastModified": 1708984720, + "narHash": "sha256-gJctErLbXx4QZBBbGp78PxtOOzsDaQ+yw1ylNQBuSUY=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "d8e0944e6d2ce0f326040e654c07a410e2617d47", + "rev": "13aff9b34cc32e59d35c62ac9356e4a41198a538", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", - "rev": "d8e0944e6d2ce0f326040e654c07a410e2617d47", "type": "github" } }, @@ -181,11 +181,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1709054170, - "narHash": "sha256-er3hOsSa6nOiOYHpCUukLZcbaORSdifxpzAmMBLT1HM=", + "lastModified": 1709109026, + "narHash": "sha256-gW1UIlzNnk9F6M04GAqF9sctGAz0CZrGlIPy7IDqAQI=", "owner": "nix-community", "repo": "nixvim", - "rev": "81f20bd2f5f53883d4fb386752196ea0a3ddd053", + "rev": "bb9d56087dda932274e25702ce32b725295d926d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 2385ce4..f1fa477 100644 --- a/flake.nix +++ b/flake.nix @@ -2,9 +2,9 @@ description = "Nixos config flake"; inputs = { - # nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nixpkgs.url = "github:NixOS/nixpkgs/d8e0944e6d2ce0f326040e654c07a410e2617d47"; + # nixpkgs.url = "github:NixOS/nixpkgs/d8e0944e6d2ce0f326040e654c07a410e2617d47"; home-manager = { url = "github:nix-community/home-manager"; diff --git a/hosts/default/home.nix b/hosts/default/home.nix index 43ff2f6..9721366 100644 --- a/hosts/default/home.nix +++ b/hosts/default/home.nix @@ -1,102 +1,104 @@ { config, pkgs, inputs, ... }: { - imports = - [ - inputs.nixvim.homeManagerModules.nixvim - ]; - # Home Manager needs a bit of information about you and the paths it should - # manage. - home.username = "noa"; - home.homeDirectory = "/home/noa"; + imports = + [ + inputs.nixvim.homeManagerModules.nixvim + ]; + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "noa"; + home.homeDirectory = "/home/noa"; - # This value determines the Home Manager release that your configuration is - # compatible with. This helps avoid breakage when a new Home Manager release - # introduces backwards incompatible changes. - # - # You should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "23.11"; # Please read the comment before changing. + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "23.11"; # Please read the comment before changing. - nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfree = true; - # The home.packages option allows you to install Nix packages into your - # environment. - home.packages = [ - pkgs.file - pkgs.unzip - pkgs.zip + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = with pkgs; [ + file + unzip + zip - pkgs.dig - pkgs.mtr + dig + mtr - pkgs.firefox - (pkgs.writeShellScriptBin "spotify" '' - exec ${pkgs.spotify}/bin/spotify --enable-features=UseOzonePlatform --ozone-platform=wayland + firefox + (writeShellScriptBin "spotify" '' + exec ${pkgs.spotify}/bin/spotify --enable-features=UseOzonePlatform --ozone-platform=wayland '') - pkgs.hyprland - pkgs.dunst - pkgs.waybar + hyprland + dunst + waybar + wl-clipboard - (pkgs.writeShellScriptBin "discord" '' - exec ${pkgs.discord}/bin/discord --enable-features=UseOzonePlatform --ozone-platform=wayland + (writeShellScriptBin "discord" '' + exec ${pkgs.discord}/bin/discord --enable-features=UseOzonePlatform --ozone-platform=wayland '') - pkgs.kitty - pkgs.wofi - pkgs.pipewire - pkgs.lsd - ]; + kitty + wofi + pipewire + lsd + ]; - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. - home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - }; + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. If you don't want to manage your shell through Home - # Manager then you have to manually source 'hm-session-vars.sh' located at - # either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/noa/etc/profile.d/hm-session-vars.sh - # - home.sessionVariables = { - EDITOR = "nvim"; - TERM = "kitty"; - }; + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. If you don't want to manage your shell through Home + # Manager then you have to manually source 'hm-session-vars.sh' located at + # either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/noa/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + EDITOR = "nvim"; + TERM = "kitty"; + }; - xdg.userDirs.enable = true; - xdg.userDirs.createDirectories = true; + xdg.userDirs.enable = true; + xdg.userDirs.createDirectories = true; - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; - # TODO move to seperate file - programs.zsh = { + # TODO move to seperate file + programs.zsh = { enable=true; shellAliases = { ll = "lsd -l"; - update = "sudo nixos-rebuild switch --flake /etc/nixos#default"; + lt = "lsd -l --tree"; + update = "sudo nixos-rebuild switch --flake $HOME/nixos#default"; }; history = { path = "${config.xdg.dataHome}/zsh/history"; @@ -107,7 +109,7 @@ plugins = [ "git" ]; theme = "frisk"; }; - }; + }; programs.kitty = { enable = true; @@ -185,8 +187,8 @@ style = ../../styles/waybar.css; }; - # TODO extend and move to seperate file - programs.git = { + # TODO extend and move to seperate file + programs.git = { enable = true; userName = "Noa Aarts"; userEmail = "itepastra@gmail.com"; @@ -194,84 +196,211 @@ init = { defaultBranch = "main"; }; safe.directory = "/etc/nixos"; }; - }; + }; - # TODO move to seperate file - # TODO create neovim config - programs.nixvim = { - enable = true; - vimAlias = true; + # TODO move to seperate file + programs.nixvim = { + enable = true; + vimAlias = true; + globals = { + mapleader = " "; + maplocalleader = " "; + }; - # Configure neovim options... - options = { - relativenumber = true; - incsearch = true; - }; + colorschemes.catppuccin.enable = true; - # ...mappings... - keymaps = [ - { - mode = "n"; - key = ""; - action = ":w"; - } - { - mode = "n"; - key = ""; - action = ":noh"; - options.silent = true; - } - { - mode = "v"; - key = ">"; - action = ">gv"; - } - { - mode = "v"; - key = "<"; - action = "k" = "goto_prev"; - "j" = "goto_next"; - }; + plugins = { + fugitive.enable = true; + comment-nvim.enable = true; + nvim-colorizer.enable = true; + telescope = { + enable = true; + keymaps = { + "sh" = { + action = "help_tags"; + desc = "[S]earch [H]elp"; + }; + "sk" = { + action = "keymaps"; + desc = "[S]earch [K]eymaps"; + }; + "sf" = { + action = "find_files"; + desc = "[S]earch [F]iles"; + }; + "ss" = { + action = "builtin"; + desc = "[S]earch [S]elect Telescope"; + }; + "sw" = { + action = "grep_string"; + desc = "[S]earch current [W]ord"; + }; + "sg" = { + action = "live_grep"; + desc = "[S]earch by [G]rep"; + }; + "sd" = { + action = "diagnostics"; + desc = "[S]earch [D]iagnostics"; + }; + "sr" = { + action = "resume"; + desc = "[S]earch [R]esume"; + }; + "s." = { + action = "oldfiles"; + desc = "[S]earch recent files (\".\" for repeat)"; + }; + "" = { + action = "buffers"; + desc = "[ ] Find existing buffers"; + }; + }; + }; + treesitter = { + enable = true; + indent = true; + }; + lsp = { + enable = true; + enabledServers = [ + "lua_ls" + ]; + keymaps = { + silent = true; + diagnostic = { + "[d" = { + action = "goto_prev"; + desc = "Go to previous [D]iagnostic message"; + }; + "]d" = { + action = "goto_next"; + desc = "Go to next [D]iagnostic message"; + }; + "e" = { + action = "open_float"; + desc = "Show diagnostic [E]rror messages"; + }; + "q" = { + action = "setloclist"; + desc = "Open diagnostic [Q]uickfix list"; + }; + }; + }; + }; + gitsigns = { + enable = true; + signs = { + add = { text = "+"; }; + change = { text = "~"; }; + delete = { text = "_"; }; + topdelete = { text = "T"; }; + changedelete = { text = "~"; }; + }; + }; + }; + match.ExtraWhitespace = "\\s\\+$"; + autoCmd = [ + { + event = "FileType"; + pattern = "nix"; + command = "setlocal tabstop=2 shiftwidth=2"; + } + { + event = "LspAttach"; + callback = '' + function (event) + local map = function(keys, func, desc) + vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) + end + ''; + } + ]; + extraPlugins = with pkgs.vimPlugins; [ + ]; + }; - lspBuf = { - gd = "definition"; - K = "hover"; - }; - }; - servers = { - bashls.enable = true; - clangd.enable = true; - nil_ls.enable = true; - }; - }; - }; - - # ... and even highlights and autocommands ! - highlight.ExtraWhitespace.bg = "red"; - match.ExtraWhitespace = "\\s\\+$"; - autoCmd = [ - { - event = "FileType"; - pattern = "nix"; - command = "setlocal tabstop=2 shiftwidth=2"; - } - ]; - }; - - # TODO move to seperate file - wayland.windowManager.hyprland = { - enable = true; + # TODO move to seperate file + wayland.windowManager.hyprland = { + enable = true; settings = { monitor = [ "DP-3,2560x1440@144,1920x0,1" @@ -362,6 +491,6 @@ "$mod,mouse:273,resizewindow" ]; }; - }; + }; }