hm: clean up

This commit is contained in:
Motiejus Jakštys 2024-02-04 22:23:56 +02:00
parent a186d68041
commit b0b87e67f8
4 changed files with 124 additions and 131 deletions

View File

@ -309,6 +309,7 @@
]; ];
extraSpecialArgs = { extraSpecialArgs = {
stateVersion = "23.05"; stateVersion = "23.05";
username = "motiejus";
email = "motiejusja@wix.com"; email = "motiejusja@wix.com";
devTools = true; devTools = true;
hmOnly = true; hmOnly = true;

View File

@ -14,26 +14,15 @@
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.users.nixos = {pkgs, ...}: home-manager.users.nixos = {pkgs, ...}:
lib.mkMerge [ import ../../shared/home/default.nix {
(import ../../shared/home/default.nix { inherit lib;
inherit lib; inherit pkgs;
inherit pkgs; inherit (config.mj) stateVersion;
inherit (config.mj) stateVersion; username = "nixos";
username = "nixos"; devTools = true;
devTools = true; hmOnly = false;
hmOnly = false; email = "motiejus@jakstys.lt";
email = "motiejus@jakstys.lt"; };
})
{
programs.bash = {
enable = true;
shellAliases = {
"l" = "echo -n ł | xclip -selection clipboard";
"gp" = "${pkgs.git}/bin/git remote | ${pkgs.parallel}/bin/parallel --verbose git push";
};
};
}
];
mj = { mj = {
stateVersion = "23.11"; stateVersion = "23.11";

View File

@ -61,24 +61,13 @@ in {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.users.motiejus = {pkgs, ...}: home-manager.users.motiejus = {pkgs, ...}:
lib.mkMerge [ import ../../../shared/home/default.nix {
(import ../../../shared/home/default.nix { inherit lib;
inherit lib; inherit pkgs;
inherit pkgs; inherit (config.mj) stateVersion;
inherit (config.mj) stateVersion; inherit (cfg) devTools;
inherit (config.mj.base.users) devTools; hmOnly = false;
hmOnly = false; email = "motiejus@jakstys.lt";
email = "motiejus@jakstys.lt"; };
})
{
programs.bash = {
enable = true;
shellAliases = {
"l" = "echo -n ł | xclip -selection clipboard";
"gp" = "${pkgs.git}/bin/git remote | ${pkgs.parallel}/bin/parallel --verbose git push";
};
};
}
];
}; };
} }

View File

@ -98,105 +98,119 @@ in {
]) ])
]; ];
programs = { programs = lib.mkMerge [
direnv.enable = true; {
man = { direnv.enable = true;
enable = true; man = {
generateCaches = true; enable = true;
}; generateCaches = true;
};
firefox = lib.mkIf devTools { firefox = lib.mkIf devTools {
enable = true; enable = true;
# firefox doesn't need the wrapper on the personal laptop # firefox doesn't need the wrapper on the personal laptop
package = package =
if hmOnly if hmOnly
then (glintel pkgs.firefox-bin "firefox") then (glintel pkgs.firefox-bin "firefox")
else pkgs.firefox-bin; else pkgs.firefox-bin;
policies.DisableAppUpdate = true; policies.DisableAppUpdate = true;
profiles = { profiles = {
xdefault = { xdefault = {
isDefault = true; isDefault = true;
settings = { settings = {
"app.update.auto" = false; "app.update.auto" = false;
"browser.aboutConfig.showWarning" = false; "browser.aboutConfig.showWarning" = false;
"browser.contentblocking.category" = "strict"; "browser.contentblocking.category" = "strict";
"browser.urlbar.showSearchSuggestionsFirst" = false; "browser.urlbar.showSearchSuggestionsFirst" = false;
"layout.css.prefers-color-scheme.content-override" = 0; "layout.css.prefers-color-scheme.content-override" = 0;
"signon.management.page.breach-alerts.enabled" = false; "signon.management.page.breach-alerts.enabled" = false;
"signon.rememberSignons" = false; "signon.rememberSignons" = false;
};
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
bitwarden
ublock-origin
consent-o-matic
joplin-web-clipper
multi-account-containers
];
}; };
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
bitwarden
ublock-origin
consent-o-matic
joplin-web-clipper
multi-account-containers
];
}; };
}; };
};
neovim = lib.mkMerge [ neovim = lib.mkMerge [
{
enable = true;
vimAlias = true;
vimdiffAlias = true;
defaultEditor = true;
plugins = with pkgs.vimPlugins;
lib.mkMerge [
[fugitive]
(lib.mkIf devTools [
vim-go
zig-vim
])
];
extraConfig = builtins.readFile ./vimrc;
}
(lib.mkIf devTools {
extraLuaConfig =
builtins.readFile
(pkgs.substituteAll {
src = ./dev.lua;
inherit (pkgs) gotools ripgrep;
})
.outPath;
})
];
git = {
enable = true;
userEmail = email;
userName = "Motiejus Jakštys";
aliases.yolo = "commit --amend --no-edit -a";
extraConfig = {
rerere.enabled = true;
pull.ff = "only";
merge.conflictstyle = "diff3";
init.defaultBranch = "main";
};
};
gpg = {
enable = true;
mutableKeys = false;
mutableTrust = false;
publicKeys = [
{ {
source = ./motiejus-gpg.txt; enable = true;
trust = "ultimate"; vimAlias = true;
vimdiffAlias = true;
defaultEditor = true;
plugins = with pkgs.vimPlugins;
lib.mkMerge [
[fugitive]
(lib.mkIf devTools [
vim-go
zig-vim
])
];
extraConfig = builtins.readFile ./vimrc;
} }
(lib.mkIf devTools {
extraLuaConfig =
builtins.readFile
(pkgs.substituteAll {
src = ./dev.lua;
inherit (pkgs) gotools ripgrep;
})
.outPath;
})
]; ];
};
tmux = { git = {
enable = true; enable = true;
keyMode = "vi"; userEmail = email;
historyLimit = 1000000; userName = "Motiejus Jakštys";
extraConfig = '' aliases.yolo = "commit --amend --no-edit -a";
bind c new-window -c "#{pane_current_path}" extraConfig = {
bind % split-window -h -c "#{pane_current_path}" rerere.enabled = true;
bind '"' split-window -v -c "#{pane_current_path}" pull.ff = "only";
''; merge.conflictstyle = "diff3";
}; init.defaultBranch = "main";
}; };
};
gpg = {
enable = true;
mutableKeys = false;
mutableTrust = false;
publicKeys = [
{
source = ./motiejus-gpg.txt;
trust = "ultimate";
}
];
};
tmux = {
enable = true;
keyMode = "vi";
historyLimit = 1000000;
extraConfig = ''
bind c new-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"
'';
};
}
(
lib.mkIf (!hmOnly)
{
bash = {
enable = true;
shellAliases = {
"l" = "echo -n ł | xclip -selection clipboard";
"gp" = "${pkgs.git}/bin/git remote | ${pkgs.parallel}/bin/parallel --verbose git push";
};
};
}
)
];
} }