initial
This commit is contained in:
commit
b4c9b055fb
20 changed files with 1540 additions and 0 deletions
38
cli/shell.nix
Normal file
38
cli/shell.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
name = "shell";
|
||||
cfg = config.nixowos.cli.${name};
|
||||
|
||||
# use a more verbose output style for nix than default
|
||||
# only lix supports log-format = multiline-with-logs
|
||||
logFormat = if config.nixowos.system.lix.enable then "multiline-with-logs" else "bar-with-logs";
|
||||
in
|
||||
{
|
||||
options.nixowos.cli.${name} = {
|
||||
enable = lib.mkEnableOption name;
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# use Fish, the nicest shell :)
|
||||
programs.fish.enable = true;
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
# avoid generating caches (enabled by fish) due to slowdowns during nixos-rebuild
|
||||
# this may degrade autocompletion
|
||||
documentation.man.generateCaches = false;
|
||||
|
||||
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 --log-format ${logFormat}";
|
||||
|
||||
nix = /* sh */ "nix --log-format ${logFormat}";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue