diff --git a/.envrc b/.envrc index 4c92382..65a6ca3 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,5 @@ +export GIT_AUTHOR_EMAIL=motiejus@jakstys.lt + if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" fi diff --git a/flake.nix b/flake.nix index 6240d30..539324e 100644 --- a/flake.nix +++ b/flake.nix @@ -247,6 +247,13 @@ // flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs {inherit system;}; in { + homeConfigurations.motiejus = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [ + shared/home + ]; + }; + devShells.default = pkgs.mkShellNoCC { packages = [ pkgs.rage diff --git a/modules/base/users/default.nix b/modules/base/users/default.nix index 6f6d7ee..48bea13 100644 --- a/modules/base/users/default.nix +++ b/modules/base/users/default.nix @@ -60,56 +60,18 @@ in { }; home-manager.useGlobalPkgs = true; - home-manager.users.motiejus = {pkgs, ...}: { - home.stateVersion = config.mj.stateVersion; - home.packages = lib.mkIf cfg.devEnvironment [pkgs.go]; + home-manager.users.motiejus = {pkgs, ...}: + import ../../../shared/home/default.nix { + inherit pkgs; + inherit (config.mj) stateVersion; - programs.direnv.enable = true; - - programs.neovim = { - enable = true; - vimAlias = true; - vimdiffAlias = true; - defaultEditor = true; - plugins = lib.mkIf cfg.devEnvironment [ - pkgs.vimPlugins.fugitive - pkgs.vimPlugins.vim-go - pkgs.vimPlugins.zig-vim - ]; - extraConfig = builtins.readFile ./vimrc; - }; - - programs.git = { - enable = true; - userEmail = "motiejus@jakstys.lt"; - userName = "Motiejus Jakštys"; - aliases.yolo = "commit --amend --no-edit -a"; - extraConfig = { - rerere.enabled = true; - pull.ff = "only"; - merge.conflictstyle = "diff3"; + programs.bash = { + enable = true; + shellAliases = { + "l" = "echo -n ł | xclip -selection clipboard"; + "gp" = "${pkgs.git}/bin/git remote | ${pkgs.parallel}/bin/parallel --verbose git push"; + }; }; }; - - programs.bash = { - enable = true; - shellAliases = { - "l" = "echo -n ł | xclip -selection clipboard"; - "gp" = "${pkgs.git}/bin/git remote | ${pkgs.parallel}/bin/parallel --verbose git push"; - }; - }; - - programs.gpg = { - enable = true; - mutableKeys = false; - mutableTrust = false; - publicKeys = [ - { - source = ./motiejus-gpg.txt; - trust = "ultimate"; - } - ]; - }; - }; }; } diff --git a/shared/home/default.nix b/shared/home/default.nix new file mode 100644 index 0000000..2307da4 --- /dev/null +++ b/shared/home/default.nix @@ -0,0 +1,52 @@ +{ + pkgs, + #stateVersion ? "23.05", + ... +}: { + home = { + #inherit stateVersion; + stateVersion = "23.05"; + + username = "motiejus"; + homeDirectory = "/home/motiejus"; + }; + + #home.packages = lib.mkIf cfg.devEnvironment [pkgs.go]; + + programs.direnv.enable = true; + + programs.neovim = { + enable = true; + vimAlias = true; + vimdiffAlias = true; + defaultEditor = true; + plugins = with pkgs.vimPlugins; [ + fugitive + ]; + extraConfig = builtins.readFile ./vimrc; + }; + + programs.git = { + enable = true; + userEmail = "motiejus@jakstys.lt"; + userName = "Motiejus Jakštys"; + aliases.yolo = "commit --amend --no-edit -a"; + extraConfig = { + rerere.enabled = true; + pull.ff = "only"; + merge.conflictstyle = "diff3"; + }; + }; + + programs.gpg = { + enable = true; + mutableKeys = false; + mutableTrust = false; + publicKeys = [ + { + source = ./motiejus-gpg.txt; + trust = "ultimate"; + } + ]; + }; +} diff --git a/modules/base/users/motiejus-gpg.txt b/shared/home/motiejus-gpg.txt similarity index 100% rename from modules/base/users/motiejus-gpg.txt rename to shared/home/motiejus-gpg.txt diff --git a/modules/base/users/vimrc b/shared/home/vimrc similarity index 100% rename from modules/base/users/vimrc rename to shared/home/vimrc