1.3 KiB
1.3 KiB
iiogama's Personal NixOS/Home-Manager Configuration
How to build existing system with flake
cd <build repo>
sudo nixos-rebuild switch --flake ".#<hostname>"
How to update existing system's packages
sudo nixos-rebuild switch --flake ".#<hostname>" --update-input nixpkgs --commit-lock-file
How to install new system with flake
Method 1
- Boot into live NixOS disk and run the following commands:
sudo su
nix-env -iA nixos.git
git clone <repo url> /mnt/etc/nixos
nixos-install --flake ".#<host>"
- Reboot machine, log in, and run the following commands:
sudo rm -r /etc/nixos/configuration.nix
- Move build to desired location.
Method 2
- Boot into live NixOS disk
- Install NixOS
- Add the following changes:
environment.systemPackages = with pkgs; [
git
];
services.openssh.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
- Run the following command:
sudo nixos-rebuild switch
- Grab the IP address with the following command:
ip addr
- Copy a flake repo from the host machine:
rsync -avz <repo directory> <user>@<ip addr>:
Nix commands to remember
nix flake update
nix run nixpkgs#<package>