2023-06-11 20:56:47 +05:30
#+title : Install
#+author : Emmet
These are just some simple install notes for myself (in-case I have to reinstall unexpectedly).
** Install Notes for Myself
2023-10-29 00:20:27 +05:30
To get this running on a NixOS system, start by cloning the repo:
2023-06-11 20:56:47 +05:30
#+BEGIN_SRC sh :noeval
2023-06-29 22:01:35 +05:30
git clone https://gitlab.com/librephoenix/nixos-config.git ~/ .dotfiles
2023-06-11 20:56:47 +05:30
#+END_SRC
2023-10-29 00:20:27 +05:30
To get the hardware configuration on a new system, either copy from =/etc/nixos/hardware-configuration.nix= or run:
2023-06-11 20:56:47 +05:30
#+BEGIN_SRC sh :noeval
2023-06-29 22:01:35 +05:30
cd ~/.dotfiles
sudo nixos-generate-config --show-hardware-config > system/hardware-configuration.nix
2023-06-11 20:56:47 +05:30
#+END_SRC
2023-10-29 00:20:27 +05:30
Also, if you have a differently named user account than my default (=emmet= ), you /must/ update the following lines in the let binding near the top of the [[./flake.nix ][flake.nix ]]:
#+BEGIN_SRC nix :noeval
...
# ----- USER SETTINGS ----- #
username = "YOURUSERNAME"; # username
name = "YOURNAME"; # name/identifier
...
#+END_SRC
There are many more config options there that you may also want to change as well.
Once the variables are set, then switch into the system configuration by running:
2023-06-11 20:56:47 +05:30
#+BEGIN_SRC sh :noeval
2023-06-29 22:01:35 +05:30
cd ~/.dotfiles
sudo nixos-rebuild switch --flake .#system
2023-06-11 20:56:47 +05:30
#+END_SRC
Home manager can be installed with:
#+BEGIN_SRC sh :noeval
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update
nix-shell '<home-manager >' -A install
#+END_SRC
If home-manager starts to not cooperate, it may be because the unstable branch of nixpkgs is in the Nix channel list. This can be fixed via:
#+BEGIN_SRC sh :noeval
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
#+END_SRC
Home-manager may also not work without re-logging back in after it has been installed.
Once home-manager is running, my home-manager configuration can be installed with:
#+BEGIN_SRC sh :noeval
2023-06-29 22:01:35 +05:30
cd ~/.dotfiles
home-manager switch --flake .#user
2023-06-11 20:56:47 +05:30
#+END_SRC
2023-10-29 00:20:27 +05:30
This loads in my convenience script =phoenix= (still a WIP), which replaces frequently used nix and nixos commands with more user friendly ones, namely:
2023-06-11 20:56:47 +05:30
- =phoenix sync= to build and switch system and home configuration
- =phoenix sync system= to build and switch only system configuration
- =phoenix sync user= to build and switch only home configuration
- =phoenix update= to update flake inputs
- =phoenix gc= to garbage collect
- If no argument is given, it cleans anything older than 30 days
- If a time argument is supplied (i.e. 10d), it cleans stuff older than that (10 days in this example)
- If the argument =full= is given, it deletes /all/ previous generations