68 lines
1.5 KiB
Nix
68 lines
1.5 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
|
|
let
|
|
name = "shell";
|
|
cfg = config.nixowos.defaults.${name};
|
|
in
|
|
{
|
|
options.nixowos.defaults.${name} = {
|
|
enable = lib.mkEnableOption name;
|
|
|
|
extraPackages = lib.mkOption {
|
|
type = lib.types.listOf lib.types.package;
|
|
default =
|
|
with pkgs;
|
|
[
|
|
trash-cli
|
|
killall
|
|
|
|
fd
|
|
ripgrep
|
|
|
|
dust
|
|
compsize
|
|
|
|
ffmpeg
|
|
]
|
|
++ (
|
|
if config.nixowos.nvidia.enable then
|
|
[
|
|
btop-cuda
|
|
nvtopPackages.nvidia
|
|
]
|
|
else
|
|
[
|
|
btop-rocm
|
|
]
|
|
);
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
# use Fish, the nicest shell :)
|
|
programs.fish.enable = lib.mkIf config.nixowos.allowAddingPackages true;
|
|
users.defaultUserShell = lib.mkIf config.nixowos.allowAddingPackages pkgs.fish;
|
|
|
|
environment.shellAliases = {
|
|
# make nix-shell preserve the user's $SHELL
|
|
nix-shell = /* sh */ ''nix-shell --command "export SHELL=$SHELL; $SHELL"'';
|
|
|
|
nixos-rebuild = /* sh */ "nixos-rebuild --ask-sudo-password";
|
|
};
|
|
|
|
environment.systemPackages = lib.mkIf config.nixowos.allowAddingPackages cfg.extraPackages;
|
|
|
|
# enter dev env on cd
|
|
programs.direnv = {
|
|
enable = lib.mkIf config.nixowos.allowAddingPackages (lib.mkDefault true);
|
|
# hide extra logging, that isn't particularly useful
|
|
# (for only using nix at least)
|
|
settings.global.hide_env_diff = lib.mkDefault true;
|
|
};
|
|
};
|
|
}
|