FFFF GitHub - jrrom/nixos-jrrom: My Linux configurations · GitHub
[go: up one dir, main page]

Skip to content

About

My Linux configurations

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

154 Commits

Folders and files

Repository files navigation

nixos-jrrom

jrrom’s NixOS configuration.

Layout

Note that * means it produces both nixosModules and homeModules.

PathProducesHolds
modules/base*.base & flake helpersEvery machine
modules/desktop*.desktopScreen stuff
modules/servernixosModules.server & nixosModules.selfHostedServer stuff
modules/infraterraform configSelf explanatory
modules/users/{name}*.{name}One person
modules/hosts/{host}nixosConfigurations.{host}One machine
secrets/{host}SOPS secretsOne file per host

Oddities

  • Note that files named _{fileName} are not pulled in automatically and are manually imported.
  • Note that the Tailscale key needs to be regenerated every 90 days, so probably regenerate it before installing a new device!

General Rules

1 : Relating to creation

  • Is it about one person (identity, personal apps, autostart)? → users/<name>.nix
  • Is it about one machine (hardware, disks, hostId, time zone)? → hosts/<host>/
  • Does every machine need it? → base/
  • Does every machine with a screen need it? → desktop/
  • Does every headless machine need it or web service? → server/
  • None of these → it’s a new module: make a new folder (rule 9).

2 : Relating to convention

  • The folder names the module (except in base). Every file in modules/{module} adds to flake.nixosModules.{module} and/or flake.homeModules.{module}. Never define a module named after the file.
  • Constants are for values shared between files or used in config.org.
  • One file per topic, not per option.
  • Each nixosModule pulls in their own other half (homeModule), the hosts should list only NixOS modules.
home-manager.sharedModules = [ self.homeModules.desktop ];
  • Each file has the same shape
{ inputs, self, config, lib, ... }:   # only the arguments you use
let
  c = config.constants;              # only if you use constants
in
{
  flake.nixosModules.<aspect> = { pkgs, ... }: {
    ...
  };

  flake.homeModules.<aspect> = { config, pkgs, ... }: {
    ...
  };
}

3 : Relating to continuation

New module
Make modules/{module}/{module}.nix, add it to the hosts who want it.
New user
Refer to users/gamer.nix, add {name}-{password} to the hosts’ SOPS file, and the host modules.
New host
make modules/hosts/<host>/<host>.nix + _hardware.nix (from nixos-generate-config) + _disk.nix. Name the nixosConfigurations attribute after the hostName. Add secrets/<hostName>.yaml and a creation rule in .sops.yaml.

About

My Linux configurations

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0