Skip to content

Latest commit

 

History

551 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NixOS-config

Stargazers NIXOS Version

This repo stores some cc's NixOS and home-manager configurations.

Hint: this repo contains my hardware configuration, you shouldn't directly use the config to build your system.

.
├── flake.lock      # lock file for the flake
├── flake.nix       # main entry point of the flake
├── home            # home-manager configurations
│   ├── apps/       # auto-imported app-specific configurations
│   ├── modules/    # reusable modules for home-manager
│   ├── common.nix  # common configuration for home-manager
│   └── default.nix # default configuration for home-manager
├── hosts           # host-specific configurations
│   ├── <machine>/  # configurations for a specific machine
│   ├── default.nix # import configuration for all hosts
│   └── vars.nix    # shared variables used in the host configurations
├── LICENSE         # license file
├── modules/        # reusable top-level modules for different purposes
└── README.md       # this file

System theme is built via stylix

Other Configurations

License

GLWTS

Below are some miscellaneous notes.


Rebuild and switch the system configuration:

nh os switch ."#$(hostname)"

Rebuild the system configuration but not switch:

nh os boot ."#$(hostname)"

Pass envrionment variables to nix-daemon (superuser permission required):

#!/usr/bin/env bash
mkdir /run/systemd/system/nix-daemon.service.d
cat > /run/systemd/system/nix-daemon.service.d/override.conf << EOF
[Service]
Environment="<ENV_VAR_NAME>=<ENV_VAR_VALUE>"
EOF
systemctl daemon-reload
systemctl restart nix-daemon

Clean the machine:

sudo nh clean all

This nixos config is designed to build remote nixos system on a local machine and push it to the remote machine, use with ssh config:

# Note that it required no sudo permission on the local machine
nixos-rebuild --target-host "<remote-host>" --sudo switch --flake ."#<remote-host>" |& nom

With the ssh config like:

Host <remote-host>
  User <username>
  Hostname <ip-address/domain>

Emergency rollback to the previous boot entry (for grub):

sudo grub-reboot '1>1'
sudo reboot

About

❄️ @chillcicada's nixos config

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages