feature(starship): move to a module

This commit is contained in:
Serĉanto de Scio 2024-09-23 19:31:53 +10:00
parent 561fe2f602
commit 593809a474
Signed by: sercanto
GPG key ID: A4122FF3971B6865
8 changed files with 50 additions and 12 deletions

28
modules/default.nix Normal file
View file

@ -0,0 +1,28 @@
{
self,
inputs,
nixpkgs,
ragenix,
...
}: let
nixosSystem = nixpkgs.lib.makeOverridable nixpkgs.lib.nixosSystem;
customModules = import ./module-list.nix;
baseModules = [
{
imports = [
({pkgs, ...}: {
nix.nixPath = [
"nixpkgs=${pkgs.path}"
];
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
documentation.info.enable = false;
})
];
}
];
defaultModules = baseModules ++ customModules;
in {
imports = defaultModules;
}

3
modules/module-list.nix Normal file
View file

@ -0,0 +1,3 @@
[
./profiles/starship.nix
]

View file

@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.profiles.starship;
in {
options.profiles.starship = {
enable = mkEnableOption "to enable the starship prompt.";
};
config = mkIf (cfg.enable) {
programs.starship.enable = true;
};
}

View file

@ -36,7 +36,10 @@ in {
};
};
defaults = {
imports = [./modules];
# make flake inputs accessible in NixOS
_module.args.inputs = inputs;
profiles.starship.enable = true;
};
# Comment out deployment line when building the SD Image.
airgead = {

View file

@ -6,9 +6,6 @@
export TERM="xterm-256color"
test -r ~/.dir_colors && eval $(dircolors ~/.dir_colors)
'';
promptInit = ''
eval "$(starship init bash)"
'';
vteIntegration = true;
};
}

View file

@ -10,7 +10,6 @@
./chrony.nix
../profiles/neovim.nix
../profiles/logrotate.nix
../profiles/starship.nix
./tmux.nix
./zsh.nix
];

View file

@ -1,5 +0,0 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
starship # A minimal, blazing fast, and extremely customizable prompt for any shell
];
}

View file

@ -25,9 +25,6 @@
enable = true;
plugins = ["fzf" "git"];
};
promptInit = ''
eval "$(starship init zsh)"
'';
vteIntegration = true;
};