users/foo-dogsquared: modularize shell setup

This commit is contained in:
Gabriel Arazas 2023-12-12 09:14:35 +08:00
parent 77139559a9
commit a70b8ad5d6
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
3 changed files with 44 additions and 26 deletions

View File

@ -17,6 +17,7 @@
git.enable = true;
keys.gpg.enable = true;
keys.ssh.enable = true;
shell.enable = true;
};
services.desktop.enable = true;
@ -31,19 +32,6 @@
};
};
# My user shell of choice because I'm not a hipster.
programs.bash = {
enable = true;
historyControl = [ "erasedups" "ignoredups" "ignorespace" ];
historyIgnore = [
"cd"
"exit"
"lf"
"ls"
"nvim"
];
};
# Set nixpkgs config both outside and inside of home-manager.
nixpkgs.config = import ./config/nixpkgs/config.nix;
xdg.configFile."nixpkgs/config.nix".source = ./config/nixpkgs/config.nix;
@ -69,13 +57,6 @@
};
# My custom modules.
profiles = {
dev = {
enable = true;
shell.enable = true;
extras.enable = true;
shaders.enable = true;
servers.enable = true;
};
editors = {
emacs.enable = true;
vscode.enable = true;
@ -89,12 +70,6 @@
research.enable = true;
};
systemd.user.sessionVariables = {
MANPAGER = "nvim +Man!";
EDITOR = "nvim";
};
home.stateVersion = "23.11";
xdg.userDirs = {

View File

@ -8,6 +8,7 @@
./programs/email.nix
./programs/git.nix
./programs/keys.nix
./programs/shell.nix
./services/desktop.nix
];

View File

@ -0,0 +1,42 @@
# My user shell of choice because I'm not a hipster.
{ config, lib, pkgs, ... }:
let
userCfg = config.users.foo-dogsquared;
cfg = userCfg.programs.shell;
in
{
options.users.foo-dogsquared.programs.shell.enable = lib.mkEnableOption "configuration of foo-dogsquared's shell of choice and its toolbelt";
config = lib.mkIf cfg.enable {
# Add the dev home-manager profiles to be more of a hipster.
profiles.dev = {
enable = true;
extras.enable = true;
shell.enable = true;
servers.enable = true;
};
programs.bash = {
enable = true;
historyControl = [ "erasedups" "ignoredups" "ignorespace" ];
historyIgnore = [
"cd"
"exit"
"lf"
"ls"
"nvim"
];
};
# Set up with these variables.
systemd.user.sessionVariables = {
PAGER = "moar";
MANPAGER = "nvim +Man!";
EDITOR = "nvim";
};
# Add it to the laundry list.
services.bleachbit.cleaners = [ "bash.history" ];
};
}