Last active
July 6, 2023 21:33
-
-
Save hugosenari/eb8dbd032e36ec8f421c9938a206a45e to your computer and use it in GitHub Desktop.
NixOS Flake Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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"; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.