Add support for CLI env
This commit is contained in:
@@ -31,6 +31,8 @@ case $main_menu in
|
|||||||
# Install Home-manager
|
# Install Home-manager
|
||||||
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||||
nix-channel --update
|
nix-channel --update
|
||||||
|
mkdir -p $HOME/.pre-nix-backup/
|
||||||
|
mv $HOME/.bashrc $HOME/.profile $HOME/.pre-nix-backup/
|
||||||
nix-shell '<home-manager>' -A install
|
nix-shell '<home-manager>' -A install
|
||||||
|
|
||||||
# Apply config
|
# Apply config
|
||||||
@@ -38,7 +40,7 @@ case $main_menu in
|
|||||||
rm $HOME/.config/home-manager/home.nix
|
rm $HOME/.config/home-manager/home.nix
|
||||||
cp ./nix/home.nix $HOME/.config/home-manager/home.nix
|
cp ./nix/home.nix $HOME/.config/home-manager/home.nix
|
||||||
|
|
||||||
home-manager -b backup switch
|
home-manager switch -b backup
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
sudo cp -rf ./nix/nixos/* /etc/nixos/
|
sudo cp -rf ./nix/nixos/* /etc/nixos/
|
||||||
|
|||||||
11
nix/home.nix
11
nix/home.nix
@@ -5,6 +5,7 @@ let
|
|||||||
inherit (lib) mkIf optionals;
|
inherit (lib) mkIf optionals;
|
||||||
inherit (pkgs.stdenv) isLinux isDarwin; #GNOME on Linux
|
inherit (pkgs.stdenv) isLinux isDarwin; #GNOME on Linux
|
||||||
userName = "trude";
|
userName = "trude";
|
||||||
|
isDesktop = false; # Disable for servers and WSL
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# =======================================================================
|
# =======================================================================
|
||||||
@@ -18,9 +19,7 @@ in
|
|||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
google-chrome
|
|
||||||
gh unzip fastfetch
|
gh unzip fastfetch
|
||||||
prismlauncher
|
|
||||||
|
|
||||||
# Override nerdfont to install JetBrains only.
|
# Override nerdfont to install JetBrains only.
|
||||||
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
|
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
|
||||||
@@ -72,8 +71,10 @@ in
|
|||||||
fi
|
fi
|
||||||
'')
|
'')
|
||||||
]
|
]
|
||||||
|
# Desktop-only apps
|
||||||
|
++ optionals isDesktop [google-chrome prismlauncher]
|
||||||
# Linux-only apps
|
# Linux-only apps
|
||||||
++ optionals isLinux [newsflash eyedropper gnome-terminal epiphany gnome-podcasts impression gnome-boxes adw-gtk3 gnomeExtensions.vitals gnomeExtensions.appindicator gnomeExtensions.caffeine gnomeExtensions.search-light]
|
++ optionals (isDesktop && isLinux) [newsflash eyedropper gnome-terminal epiphany gnome-podcasts impression gnome-boxes adw-gtk3 gnomeExtensions.vitals gnomeExtensions.appindicator gnomeExtensions.caffeine gnomeExtensions.search-light]
|
||||||
# macOS-only apps
|
# macOS-only apps
|
||||||
++ optionals isDarwin [];
|
++ optionals isDarwin [];
|
||||||
|
|
||||||
@@ -85,7 +86,7 @@ in
|
|||||||
} else {});
|
} else {});
|
||||||
|
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "code";
|
||||||
};
|
};
|
||||||
|
|
||||||
# =====================================================
|
# =====================================================
|
||||||
@@ -641,7 +642,7 @@ in
|
|||||||
initExtra = "set completion-ignore-case On";
|
initExtra = "set completion-ignore-case On";
|
||||||
bashrcExtra = ''
|
bashrcExtra = ''
|
||||||
set -o vi
|
set -o vi
|
||||||
export EDITOR="nvim";
|
export EDITOR="code";
|
||||||
export PS1="\n[\[\e[37m\]\u\[\e[0m\]@\[\e[37;2m\]\h\[\e[0m\]] \[\e[1m\]\w \[\e[0;2m\]J:\[\e[0m\]\j\n\$ ";
|
export PS1="\n[\[\e[37m\]\u\[\e[0m\]@\[\e[37;2m\]\h\[\e[0m\]] \[\e[1m\]\w \[\e[0;2m\]J:\[\e[0m\]\j\n\$ ";
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user