This is my personal nix-config. It is always a work in progress as I love tweaking.
host | profile | system |
---|---|---|
thinkpad-t480 | zshen@thinkpad-t480 | x86_64-linux |
framework-16 | zshen@framework-16 | x86_64-linux |
Zhongjies-MacBook-Pro | [email protected] | aarch64-darwin |
- install nix (https://zero-to-nix.com/start/install)
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
- clone this repo
- setup keys.txt (for sops-nix)
age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
# first time setup
nix run nix-darwin --extra-experimental-features 'nix-command flakes' -- switch --flake .#mac-m1-max
# switch
darwin-rebuild switch --flake .#mac-m1-max
darwin-rebuild --list-generations
darwin-rebuild switch --switch-generation 41
- switch NixOS (TBD)
- test NixOS (TBD)
# useful nix cmds
nix run github:zhongjis/nix-update-input # upgrade specific input
nix search nixpkgs <package-name> # search nixpkgs
# rebuild system use nix-helper
oswitch # os switch
hswitch # home-manager switch
I use sops-nix's home-manager module.
nix run nixpkgs#sops -- secrets.yaml # view secrets
more about sops see https://github.com/getsops/sops#2usage
NOTE: most of the changes (like for neovim) are changed on the way while im using it. this list just for later in case I have nothing to do.
see here
adding inputs
inputs = {
trouble-nvim = {
url = "github:folke/trouble.nvim";
flake = false;
};
}
override in overlays
modifications = final: prev: rec {
vimPlugins =
prev.vimPlugins
// {
trouble-nvim =
prev.vimUtils.buildVimPlugin
{
name = "trouble.nvim";
src = inputs.trouble-nvim;
};
};
};