nixos-config/install.sh

17 lines
781 B
Bash
Raw Normal View History

#!/bin/sh
# Automated script to install my dotfiles
2024-02-26 00:34:02 +05:30
nix-shell -p git --command "git clone https://gitlab.com/librephoenix/nixos-config ~/.dotfiles"
sudo nixos-generate-config --show-hardware-config > ~/.dotfiles/system/hardware-configuration.nix
2024-02-27 08:05:27 +05:30
sed -i "0,/emmet/s//$(whoami)/" ~/.dotfiles/flake.nix
sed -i "0,/Emmet/s//$(getent passwd $(whoami) | cut -d ':' -f 5 | cut -d ',' -f 1)/" ~/.dotfiles/flake.nix
sed -i "s/emmet@librephoenix.com//" ~/.dotfiles/flake.nix
2024-02-26 00:34:02 +05:30
if [ -z "$EDITOR" ]; then
EDITOR=nano;
fi
$EDITOR ~/.dotfiles/flake.nix;
sudo nixos-rebuild switch --flake ~/.dotfiles#system;
nix run home-manager/master --extra-experimental-features nix-command --extra-experimental-features flakes -- switch --flake ~/.dotfiles#user;
2024-02-27 08:09:34 +05:30
sudo ~/.dotfiles/harden.sh ~/.dotfiles;