Configuration files for my NixOS machines and home configurations.
- Clone this repo into the home directory of a NixOS-system and change into it.
- Run the following command when initially setting up the system:
sudo nixos-rebuild switch --flake .#<<machine>> - If there is a
justfiledefined by the machine's user, it will be automatically created in thenix-configdirectory. It leveragesjustto define simple commands for doing NixOS housekeeping, like switching configurations and updating the system.
- Clone this repo into the home directory of a NixOS-system and change into it.
- Run the following command when initially setting up Home Manager:
nix run nixpkgs#home-manager -- switch --flake .#<<home config>> # --impure could be necessary - If there is a
justfiledefined by the user, it will be automatically created in thenix-configdirectory. It leveragesjustto define simple commands for doing Home Manager housekeeping, like switching configurations and updating the setup.
Utilities and helper functions.
Configurations and hardware configurations specific to the respective machine.
Note: The config sets a static IPv4 address and other network options. Check that the IP address is not already in used in your network. For step 4 you will need to use this IP address.
- Run a graphical NixOS-installer image (the permissions/authentication can be a problem on the minimal ISOs).
- Set a password for the
nixosuser viapasswd. - Run the following command from the root of this repository and use the just created password when promted.
Note: If there is already an existing
hardware-configuration.nix, you don't need the corresponding options.nix run github:nix-community/nixos-anywhere -- \ --flake .#orville \ --build-on-remote \ --generate-hardware-config \ nixos-generate-config \ machines/orville/hardware-configuration.nix \ --target-host nixos@<IP address of the remote host>
- The setup is complete. To apply changes in the future, run the following command.
Note: You can use the user
steve(and set--use-remote-sudo) instead of therootuser but this will cause multiple password prompts.NIX_SSHOPTS="-i /home/steve/.ssh/id_ed25519_orville" nixos-rebuild switch \ --flake .#orville \ --target-host root@<IP address of the remote host>
NixOS modules.
Home Manger modules.
Home Manager configuration for a specific user. That's the place where to use the previously defined Home Manager modules of the applications.