diff --git a/Makefile b/Makefile deleted file mode 100644 index 7e9c2509..00000000 --- a/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -.PHONY: update clean -update: - home-manager switch --flake .#functionalhacker - -clean: - nix-collect-garbage -d diff --git a/flake.nix b/flake.nix index b5779311..2df7ebe8 100644 --- a/flake.nix +++ b/flake.nix @@ -11,24 +11,21 @@ }; outputs = { nixpkgs, home-manager, ... }: - let - system = "x86_64-linux"; - pkgs = import nixpkgs { inherit system; }; - in { nixosConfigurations.Mirkwood = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./common.nix ./hosts/Mirkwood/configuration.nix - ]; - }; + ./nixos_common.nix - homeConfigurations = { - functionalhacker = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ ./users/functionalhacker/home.nix ]; - }; + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.functionalhacker = + import ./users/functionalhacker/home.nix; + } + ]; }; }; } diff --git a/gpg.nix b/gpg.nix index 9161c53a..b7046d0f 100644 --- a/gpg.nix +++ b/gpg.nix @@ -15,10 +15,4 @@ pkgs.yubikey-personalization ]; }; - - environment.shellInit = '' - gpg-connect-agent /bye - export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) - export MARKON_MUUTTUJA="test" - ''; } diff --git a/hosts/Mirkwood/hardware-configuration.nix b/hosts/Mirkwood/hardware-configuration.nix index 3c105ff4..fa60be88 100644 --- a/hosts/Mirkwood/hardware-configuration.nix +++ b/hosts/Mirkwood/hardware-configuration.nix @@ -1,7 +1,7 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ config, lib, modulesPath, ... }: { imports = diff --git a/common.nix b/nixos_common.nix similarity index 86% rename from common.nix rename to nixos_common.nix index 03519a6d..515eba41 100644 --- a/common.nix +++ b/nixos_common.nix @@ -64,16 +64,17 @@ enable = true; nativeMessagingHosts.packages = [ pkgs.browserpass ]; }; - zsh = { enable = true; }; + zsh.enable = true; }; - environment.systemPackages = with pkgs; [ - git - gnumake - home-manager - neovim - telegram-desktop - usbutils - wl-clipboard - ]; + environment = { + shells = [ pkgs.zsh ]; + systemPackages = with pkgs; + [ + neovim + telegram-desktop + usbutils + wl-clipboard + ]; + }; } diff --git a/users/functionalhacker/home.nix b/users/functionalhacker/home.nix index ee2f93f3..b0cc916c 100644 --- a/users/functionalhacker/home.nix +++ b/users/functionalhacker/home.nix @@ -1,6 +1,64 @@ { config, pkgs, ... }: { + home = { + username = "functionalhacker"; + homeDirectory = "/home/functionalhacker"; + stateVersion = "24.05"; + + packages = with pkgs; [ + bat + cargo + fd + gcc + neovide + nerdfonts + nodejs + pass + ripgrep + tree-sitter + yarn + ]; + + sessionVariables = { + + # key timeout + KEYTIMEOUT = 1; + + # prompt customization + PURE_PROMPT_SYMBOL = "λ"; + PURE_PROMPT_VICMD_SYMBOL = "y"; + + # history settings + HISTFILE = "~/.zsh_history"; + HISTSIZE = 10000; + SAVEHIST = 10000; + + # fzf settings + FD_COMMAND = "fd -HLt"; + FZF_DEFAULT_COMMAND = "fd -HLt f"; + FZF_ALT_C_COMMAND = "fd -HLt d"; + FZF_ALT_C_OPTS = "--preview 'eza -l {}'"; + FZF_DEFAULT_OPTS = "-m --ansi --bind ctrl-a:toggle-all,ctrl-d:deselect-all,ctrl-t:toggle-all"; + FZF_COMPLETION_TRIGGER = "**"; + FZF_CTRL_T_COMMAND = "fd -HLt f --strip-cwd-prefix"; + FZF_CTRL_T_OPTS = "--preview 'bat --color=always --style=numbers --line-range=:500 {}'"; + + # nvim ftw! + PAGER = "nvim -R +\"lua require 'pager'\""; + GIT_PAGER = "nvim -c 'set ft=git' -R +\"lua require 'pager'\""; + MANPAGER = "nvim +\"lua require 'pager'\" +Man!"; + SYSTEMD_PAGER = "less"; + + MARKON_NIXOS = "cool"; + }; + + # Just symlink neovim configuration for now. + # Declarative configuration coming soon™ + file.".config/nvim".source = + config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/git/dotfiles/home/.config/nvim"; + }; + programs = { neovim = { enable = true; @@ -9,6 +67,8 @@ zsh = { enable = true; + syntaxHighlighting.enable = true; + enableCompletion = false; zplug = { enable = true; plugins = [ @@ -21,33 +81,20 @@ { name = "zsh-users/zsh-history-substring-search"; } { name = "wfxr/forgit"; } { name = "zsh-users/zsh-completions"; } - { name = "zdharma-continuum/fast-syntax-highlighting"; } { name = "RobSis/zsh-completion-generator"; } ]; }; }; - }; - home = { - username = "functionalhacker"; - homeDirectory = "/home/functionalhacker"; - stateVersion = "24.05"; + fzf = { + enable = true; + enableZshIntegration = true; + }; - file.".config/nvim".source = - config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/git/dotfiles/home/.config/nvim"; - - packages = with pkgs; [ - cargo - fd - fzf - gcc - neovide - nerdfonts - nodejs - pass - ripgrep - tree-sitter - yarn - ]; + git = { + enable = true; + userName = "Marko Korhonen"; + userEmail = "marko@korhonen.cc"; + }; }; }