feature(starship): move to a module
This commit is contained in:
parent
561fe2f602
commit
e3d22e6206
28
modules/default.nix
Normal file
28
modules/default.nix
Normal 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
3
modules/module-list.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
[
|
||||
./profiles/starship.nix
|
||||
]
|
17
modules/profiles/starship.nix
Normal file
17
modules/profiles/starship.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
# A minimal, blazing fast, and extremely customizable prompt for any shell
|
||||
{
|
||||
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;
|
||||
};
|
||||
}
|
|
@ -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 = {
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
export TERM="xterm-256color"
|
||||
test -r ~/.dir_colors && eval $(dircolors ~/.dir_colors)
|
||||
'';
|
||||
promptInit = ''
|
||||
eval "$(starship init bash)"
|
||||
'';
|
||||
vteIntegration = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
./chrony.nix
|
||||
../profiles/neovim.nix
|
||||
../profiles/logrotate.nix
|
||||
../profiles/starship.nix
|
||||
./tmux.nix
|
||||
./zsh.nix
|
||||
];
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
starship # A minimal, blazing fast, and extremely customizable prompt for any shell
|
||||
];
|
||||
}
|
|
@ -25,9 +25,6 @@
|
|||
enable = true;
|
||||
plugins = ["fzf" "git"];
|
||||
};
|
||||
promptInit = ''
|
||||
eval "$(starship init zsh)"
|
||||
'';
|
||||
vteIntegration = true;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue