move home-manager config to a dedicated location

This commit is contained in:
Motiejus Jakštys 2023-10-06 11:24:00 +03:00 committed by Motiejus Jakštys
parent ed11b05c37
commit b98d1bb9c8
6 changed files with 71 additions and 48 deletions

2
.envrc
View File

@ -1,3 +1,5 @@
export GIT_AUTHOR_EMAIL=motiejus@jakstys.lt
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then 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=" source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi fi

View File

@ -247,6 +247,13 @@
// flake-utils.lib.eachDefaultSystem (system: let // flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;}; pkgs = import nixpkgs {inherit system;};
in { in {
homeConfigurations.motiejus = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
shared/home
];
};
devShells.default = pkgs.mkShellNoCC { devShells.default = pkgs.mkShellNoCC {
packages = [ packages = [
pkgs.rage pkgs.rage

View File

@ -60,56 +60,18 @@ in {
}; };
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.users.motiejus = {pkgs, ...}: { home-manager.users.motiejus = {pkgs, ...}:
home.stateVersion = config.mj.stateVersion; import ../../../shared/home/default.nix {
home.packages = lib.mkIf cfg.devEnvironment [pkgs.go]; inherit pkgs;
inherit (config.mj) stateVersion;
programs.direnv.enable = true; programs.bash = {
enable = true;
programs.neovim = { shellAliases = {
enable = true; "l" = "echo -n ł | xclip -selection clipboard";
vimAlias = true; "gp" = "${pkgs.git}/bin/git remote | ${pkgs.parallel}/bin/parallel --verbose git push";
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.gpg = {
enable = true;
mutableKeys = false;
mutableTrust = false;
publicKeys = [
{
source = ./motiejus-gpg.txt;
trust = "ultimate";
}
];
};
};
}; };
} }

52
shared/home/default.nix Normal file
View File

@ -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";
}
];
};
}