mirror of
https://github.com/librephoenix/nixos-config
synced 2025-04-20 17:24:35 +05:30
update install.sh
This commit is contained in:
parent
25fc7fdd76
commit
105b2f9c02
15
install.sh
15
install.sh
|
@ -3,13 +3,12 @@
|
|||
# Automated script to install my dotfiles
|
||||
|
||||
# Clone dotfiles
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
if [ $# -gt 0 ]; then
|
||||
SCRIPT_DIR=$1
|
||||
else
|
||||
SCRIPT_DIR=~/.dotfiles
|
||||
fi
|
||||
nix-shell -p git --command "git clone https://gitlab.com/librephoenix/nixos-config $SCRIPT_DIR"
|
||||
nix-shell -p git --command "git clone https://github.com/ponymushama/nixos-config.git $SCRIPT_DIR"
|
||||
|
||||
# Generate hardware config for new system
|
||||
sudo nixos-generate-config --show-hardware-config >$SCRIPT_DIR/system/hardware-configuration.nix
|
||||
|
@ -31,15 +30,15 @@ sed -i "s+~/.dotfiles+$SCRIPT_DIR+g" $SCRIPT_DIR/flake.nix
|
|||
|
||||
# Open up editor to manually edit flake.nix before install
|
||||
if [ -z "$EDITOR" ]; then
|
||||
EDITOR=nano;
|
||||
EDITOR=nano
|
||||
fi
|
||||
$EDITOR $SCRIPT_DIR/flake.nix;
|
||||
$EDITOR $SCRIPT_DIR/flake.nix
|
||||
|
||||
# Permissions for files that should be owned by root
|
||||
sudo $SCRIPT_DIR/harden.sh $SCRIPT_DIR;
|
||||
sudo $SCRIPT_DIR/harden.sh $SCRIPT_DIR
|
||||
|
||||
# Rebuild system
|
||||
sudo nixos-rebuild switch --flake $SCRIPT_DIR#system;
|
||||
sudo nixos-rebuild switch --flake $SCRIPT_DIR#system
|
||||
|
||||
# Install and build home-manager configuration
|
||||
nix run home-manager/master --extra-experimental-features nix-command --extra-experimental-features flakes -- switch --flake $SCRIPT_DIR#user;
|
||||
nix run home-manager/master --extra-experimental-features nix-command --extra-experimental-features flakes -- switch --flake $SCRIPT_DIR#user
|
||||
|
|
Loading…
Reference in a new issue