Skip to content

d-hain/NixOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

290 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My NixOS Configuration

Here lies my NixOS configuration.

Neovim

To access my neovim configuration on a system that has Nix installed, use this:

nix run git+https://git.doceys.computer/NixOS#neovim

File Structure

.
├── dotfiles
├── flake.lock
├── flake.nix
├── hosts
│   ├── laptop
│   │   └── dotfiles
│   ├── pc
│   │   └── dotfiles
│   └── servarr
├── lib
├── modules
└── secrets
  • dotfiles A directory for all shared non-nix dotfiles.
  • hosts All subdirectories of hosts are all files specific to one host.
    • dotfiles Non-nix dotfiles that are specific to that host.
  • lib Nix functions used throughout the config.
  • modules Somewhat coherently organized files that many systems use.
  • secrets Agenix secrets mostly used for my home server.

Manual Steps for a new system

  • Before running nixos-install

    • If needed generate the system SSH Key
      sudo mkdir -p /mnt/etc/ssh
      sudo ssh-keygen -t ed25519 -N "" -f /mnt/etc/ssh/ssh_host_ed25519_key
  • Copy my SSH Keys to ~/.ssh

  • Add the SSH Keys to the GPG-Agent

    ssh-add ~/.ssh/<private-key-name>
  • Restore my GPG Keys

    # For each key:
    gpg --import public.gpg
    gpg --import private.gpg

(I hope that's all)

How to rebuild the system

After cloning this repo to your home directory just run this command:

sudo nixos-rebuild switch --flake /home/<USER>/NixOS#<SYSTEM>

Replace <USER> and <SYSTEM> with something that makes sense. Options for <SYSTEM>: pc laptop servarr

How to add a secret

  • Add an entry to secrets/secrets.nix with its keys.
  • Write whatever it is in the env file using agenix -e <SECRET_NAME>.age. (to get agenix use nix develop)
  • To use that secret add it in the hosts/<HOST>/secrets.nix file.
  • Then in the configuration use config.age.secrets.<SECRET_NAME>.path to get the path of the file.

Git docs

How to make a new repository

  • Create the repo directory with sudo -u git mkdir -p /home/git/<repository>.git
  • Initialize the bare repository with git-sys init --bare /home/git/<repository>.git

How to make a repository public (cloneable over HTTP/S)

sudo -u git touch /home/git/<repository>.git/git-daemon-export-ok

And to make it private again remove that file.

About

My NixOS configuration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors