mirror of
https://github.com/librephoenix/nixos-config
synced 2025-01-18 22:55:52 +05:30
17 lines
769 B
Bash
Executable file
17 lines
769 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# Automated script to install my dotfiles
|
|
|
|
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
|
|
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
|
|
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;
|
|
sudo ~/.dotfiles/harden.sh;
|