Skip to content

afermg/nix-configs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nix Configuration

Overview

This is my NixOS + MacOS Nix shared configuration. It is based on merging two configurations:

  • nixos-config: This facilitates sharing packages between computers, I strongly recommend it as a base configuration to use as a base.
  • neusis: This is the config used for multiple servers in at the Broad Institute’s Imaging Platform. I use it to support multiple users on NixOS alongside Darwin.

Set up

I haven’t set it up from scratch in a new set of computers, but I will update it once I do.

Usage

Both require superuser permissions, but in Darwin will be asked for when installing brew-based packages.

Replace moby or darwin001 with the file you want to use on machines/

NixOS

sudo nixos-rebuild switch --flake .#moby

Update home only

If you just want to update your home configuration and packages use this command.

home-manager --flake .#your-username@your-hostname

Darwin

If darwin-rebuild is not available run this

nix run nix-darwin -- switch --flake .#darwin001

Otherwise

darwin-rebuild switch --flake .#darwin001

Where should I add packages?

Relative to the root folder of the repo.

System-widehome
NixOSmodules/nixos/packages.nixhomes/$USER/packages.nix
Darwinmodules/darwin/packages.nix
Bothmodules/shared/packages.nix[WIP] modules/shared/home-manager.nix

System-wide Darwin packages is not supported yet.

File structure

├── flake.lock
├── flake.nix
├── homes
│   ├── amunoz
│   │   ├── home.nix
│   │   ├── id_ed25519.pub
│   │   ├── moby.nix
│   │   └── packages.nix
│   ├── common # shared between users
│   │   └── vscode.nix
│   ├── $USER # per-user specific config
│   │   ├── home.nix
│   │   ├── id_rsa.pub
│   │   ├── moby.nix
│   │   └── packages.nix
│   ├── darwin001
│   │   └── default.nix
│   └── moby # per-server specific config
│       ├── default.nix
│       ├── disko.nix
│       ├── filesystem.nix
│       └── hardware-configuration.nix
├── modules # Shared packages and config files
│   ├── darwin
│   │   └── packages.nix
│   ├── home-manager
│   │   └── default.nix
│   ├── nixos
│   │   ├── default.nix
│   │   └── packages.nix
│   └── shared
│       ├── config
│       │   └── emacs
│       │       ├── config.org
│       │       ├── init.el
│       ├── home-manager.nix
│       └── packages.nix
└── shell.nix
  

Current work

  • Trimming the fat
  • Isolate GPU packages and services
  • Getting a deeper understanding of the system
  • Add secrets
  • Manage firefox from nix