https://github.com/luochen1990/nixos-config
LC's personal NixOS Configuration
https://github.com/luochen1990/nixos-config
Last synced: about 1 year ago
JSON representation
LC's personal NixOS Configuration
- Host: GitHub
- URL: https://github.com/luochen1990/nixos-config
- Owner: luochen1990
- Created: 2022-01-30T07:07:23.000Z (over 4 years ago)
- Default Branch: public
- Last Pushed: 2024-09-26T12:57:29.000Z (almost 2 years ago)
- Last Synced: 2025-04-03T18:52:48.076Z (about 1 year ago)
- Language: Nix
- Size: 196 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
My NixOS
========
Suppose you choosed to use a profile named "pocket-nixos":
```sh
cd /path/of/dir/which/contains/flake-dot-nix
nixos-rebuild switch --flake .#pocket-nixos
```
Bootstrap
---------
Since flake is not supported by default yet, we might need to build a NixOS version which support flake first.
```sh
ln -s /path/to/this/repo/profiles/bootstrap/configuration.nix /etc/nixos/configuration.nix
```
To be more complete, this bootstrap NixOS provides following supports:
1. offline nixos & nixpkgs manual
2. nix flake support so you can run `nixos-rebuild switch --flake`
3. visit Internet to download packages and clone repos
4. debug network issue
5. IM (telegram) client to get help from community
Directory Structure
-------------------
```
├── flake.nix # entrypoint as a Nix Flake
├── profiles/ # each subdirectory of `profiles/` contains a profile
│ ├── example-nixos/ # the directory name implies `profileName`
│ │ ├── configuration.nix # this file import mods from `common/` and `facts/` to get a full configuration of NixOS
│ │ └── hardware-configuration.nix # the file generated by `sudo nixos-generate-config --show-hardware-config`
├── fact/ # each subdirectory of fact/ contains facts of a specific aspect
│ ├── user/ # config for specific user
│ ├── network/ # config for specific network environment
│ ├── device/ # config for specific hardware device (monitor, cpu, gpu etc.)
│ └── storage/ # config for specific disk
├── common/ # general things that works for everyone
└── README.md
```
naming rules:
- `configuration.nix`: NixOS Configuration (See `man configuration.nix`)
- `*.mod.nix`: NixOS Module (See `man configuration.nix`) to be imported by `configuration.nix`
- `*.drv.nix`: Nix Derivation to be used by `nix-build`
- `*.pkg.nix`: argument of callPackage
Troubleshooting
---------------
If there is problem when logging into GUI system, try add this line to disable wayland:
```
programs.sway.enable = false
```
And also try to disable sddm to use lightdm
```
services.xserver.displayManager.sddm.enable = false;
```
If there is following error message when you type a command which havn't installed yet:
unable to open database file at /run/current-system/sw/bin/command-not-found
type execute following command to fix it:
```sh
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos
sudo nix-channel --update
```
and confirm it with:
```sh
command-not-found hello
```
(or replace hello with some else command which haven't installed yet)