Nix configuration (not my actual config I tried to make it a little bit more modular) template for managing both macOS and NixOS Linux PC.
I currently have two systems I provision with this config:
- macOS: Macbook Pro 14" M1 Pro 16GB RAM, 1TB SSD
- NixOS: 32GB RAM, i7 CPU, 2TB SSD, 1080 NVIDIA GPU (For GPU passtrough you need to update
nix/hosts/desktop/gpu/*.nix
with your actual GPU info but it should be quite similar)
nix/
: nix confignix/flake.nix
: nix flakesnix/home/default.nix
: nix home managernix/hosts/common/default.nix
: shared config for all systemsnix/hosts/mac/default.nix
: macOS confignix/hosts/desktop/default.nix
: nixos desktop pc confignix/hosts/desktop/gpu/normal.nix
: nixos desktop pc normal gpu modenix/hosts/desktop/gpu/passtrough.nix
: nixos desktop pc gpu passtrough modenix/hosts/desktop/hardware.nix
: replace it with your own nixos hardware confignix/scripts/start-with-tmux.sh
: starts tmuxnix/scripts/desktop/switch-gpu-mode.sh
: switches gpu modes on pcnix/programs/*
: config that's going to be copied to the corresponding location as per home manager.
sh <(curl -L https://nixos.org/nix/install)
git clone git@github.com:s4m1nd/persops.git
cd persops
# see ./nix README.md for more details after
find . -type f -exec sed -i 's/s4m1nd/YOURUSERNAME/g' {} +
find . -type f -exec sed -i '' 's/s4m1nd/YOURUSERNAME/g' {} +
If you have a clever way to do it automatically or via a startup script feel free to open a PR.
grep -rn "/path/to/" .