mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 19:51:34 +01:00
Use the nix-helper for the nix aliases
This commit is contained in:
parent
30faa1f2bf
commit
9a4b64345d
2 changed files with 25 additions and 11 deletions
|
|
@ -2,11 +2,22 @@
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: let
|
||||||
options.myConfig.shell.nixAliases.enable = lib.mkEnableOption "";
|
cfg = config.myConfig.shell.nixAliases;
|
||||||
|
in {
|
||||||
|
options.myConfig.shell.nixAliases = {
|
||||||
|
enable = lib.mkEnableOption "";
|
||||||
|
nh.enable = lib.mkEnableOption "";
|
||||||
|
};
|
||||||
|
|
||||||
config.home.shellAliases = lib.mkIf config.myConfig.shell.nixAliases.enable {
|
config.home.shellAliases = let
|
||||||
nr = "sudo -v && nixos-rebuild --flake $FLAKE --use-remote-sudo";
|
rebuild =
|
||||||
|
if cfg.nh.enable
|
||||||
|
then "nh os"
|
||||||
|
else "nixos-rebuild --flake $FLAKE --use-remote-sudo";
|
||||||
|
in
|
||||||
|
lib.mkIf cfg.enable {
|
||||||
|
nr = "sudo -v && ${rebuild}";
|
||||||
nrs = "nr switch";
|
nrs = "nr switch";
|
||||||
nrt = "nr test";
|
nrt = "nr test";
|
||||||
nrb = "nr boot";
|
nrb = "nr boot";
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,10 @@
|
||||||
shell = {
|
shell = {
|
||||||
bash.enable = true;
|
bash.enable = true;
|
||||||
starship.enable = true;
|
starship.enable = true;
|
||||||
nixAliases.enable = true;
|
nixAliases = {
|
||||||
|
enable = true;
|
||||||
|
nh.enable = osConfig.nh.enable;
|
||||||
|
};
|
||||||
enhancedCommands.enable = true;
|
enhancedCommands.enable = true;
|
||||||
direnv.enable = true;
|
direnv.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue