Skip to content

Instantly share code, notes, and snippets.

@hugosenari
Last active July 6, 2023 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugosenari/eb8dbd032e36ec8f421c9938a206a45e to your computer and use it in GitHub Desktop.
Save hugosenari/eb8dbd032e36ec8f421c9938a206a45e to your computer and use it in GitHub Desktop.
NixOS Flake Template
{
description = "NixOS Flakes Template";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = inputs: {
nixosConfigurations.HOSTNAME = inputs.nixpkgs.lib.nixosSystem {
modules = [ ./configuration.nix ];
system = "x86_64-linux";
};
};
}
@hugosenari
Copy link
Author

hugosenari commented Jul 6, 2023

Enable flakes https://nixos.wiki/wiki/Flakes#Enable_flakes
Copy this file as flake.nix
Add all your *.nix file to git
And change HOSTNAME by your actual hostname (run hostname command if you don't know your host name)
run sudo nixos-rebuild switch --flake .#$(hostname) to update your system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment