https://github.com/d-sacre/nixos-dotfiles
A collection of dotfiles to configure NixOS
https://github.com/d-sacre/nixos-dotfiles
linux linux-dotfiles nixos nixos-configuration nixos-dotfiles nixos-flake
Last synced: about 1 month ago
JSON representation
A collection of dotfiles to configure NixOS
- Host: GitHub
- URL: https://github.com/d-sacre/nixos-dotfiles
- Owner: d-sacre
- License: gpl-3.0
- Created: 2024-04-14T12:12:24.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-05T14:40:48.000Z (10 months ago)
- Last Synced: 2024-07-05T19:35:49.791Z (10 months ago)
- Topics: linux, linux-dotfiles, nixos, nixos-configuration, nixos-dotfiles, nixos-flake
- Language: Nix
- Homepage:
- Size: 95.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nixos-dotfiles
A collection of dotfiles to configure NixOS# Things to do after new Installation
- Setup git
```sh
git config --global user.name "USER_NAME"
git config --global user.email "USER_EMAIL"
```# Useful Things to Know
## Enable Flakes by Default
```nix
# DESCRIPTION: Enable flakes in
# SOURCE: https://www.youtube.com/watch?v=ACybVzRvDhs&t=543s
nix.settings.experimental-feautres = [ "nix-command" "flakes" ];
```
### REMARKS:
Requires execution of
```sh
sudo nixos-rebuild switch
```
to take effect.## Change NixOS Configuration to the one Specified in Flake
```sh
sudo nixos-rebuild switch --flake #
```
### REMARKS:
- If the system's hostname is identical to `` specified in the Flake, `#` can be omitted.
- If the Flake file name is `flake.nix`, one does not have to give a full file path, but only needs to specify the directory where the Flake is located.**SOURCE:**
Youtube Video: Libre Phoenix: You Should Use Flakes Right Away in NixOS!
[https://www.youtube.com/watch?v=ACybVzRvDhs&t=1346s](https://www.youtube.com/watch?v=ACybVzRvDhs&t=1346s)## Activate Home Manager of Stable Branch in Standalone Mode
1. Open Terminal and add `nix-channel` for stable Home Manager Release
```sh
nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager
nix-channel --update
```
2. Install Home Manager
```sh
nix-shell '' -A install
```## Running Home Manager
This flake requires the home manager to be run as follows:
```sh
home-manager switch --flake #
```
For example:
```sh
home-manager switch --flake .#nixos
```Eventhough the username was identical with the name of the configuration, the configuration would otherwise not be found.
## Permission Issue with Flake.lock
While running `home-manager switch --flake`, there might be an error that the `flake.lock` file cannot be opened. This might happen if at some point in time a `sudo nixos-rebuild switch --flake` command has been run.
In some cases, it is sufficient to run `sudo nixos-rebuild switch --flake` to update all the flake settings properly. This should work for changes required by NixOS and/or Home Manager. If not, the other option is to set the permissions:
```sh
sudo chown flake.lock
sudo chgrp users flake.lock
```
**Source:** https://youtu.be/IiyBeR-Guqw?si=j4Jk_bOjpTWtI_SA&t=1001## Warning: Option will be overwritten
Some changes like in the Firefox configuration will not work unless the backup option is set
```sh
home-manager switch -b backup --flake #
```## Problems with hardware-configuration.nix
If the hardware configuration is faulty or will not be regenerate properly to take into account recent change, the file can be also forced to be recreated:
```sh
sudo nixos-generate-config
```
This creates `/etc/nixos/hardware-configuration.nix`. If the nixos-rebuild should be done with this flake located in the `~/.dotfiles directory, it has to be copied.
. The hardware configuration file is absolutely necessary; if deleted, one will only obtain an error message, and the file will not automatically be created.## Mounted Devices might be no longer accessible after nixos-rebuild
Before running
```sh
sudo nixos-rebuild switch
```
one should make sure that there are no devices mounted. Otherwise it might occur that the device will be unmountable after the rebuild due to ownership errors. Occured with ntfs formatted harddrive.General Inspiration:
https://gitlab.com/Oglo12/nixos-configSpecific Inspiration (Power Saving, Greeter BG, Garbage Collection):
https://github.com/AlexCKunze/NixOS-build/blob/main/etc/nixos/configuration.nixCustom Firefox Config:
https://github.com/NapoleonWils0n/nixos-dotfiles/blob/master/nixos-dotfiles.org
https://github.com/mahmoudk1000/nix-config