Installation
- Add the following to
/etc/configuration.nix
:
nix.settings.experimental-features = [ "nix-command" "flakes" ];
-
nixos-rebuild switch
-
Remove content of
/etc/configuration.nix
until it looks like:
{ config, pkgs, ... }:
{
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
}
- Create
/etc/nixos/flake.nix
:
{
inputs.nixos-config.url = "github:LAK132/nixos-config";
outputs = { self, nixpkgs, nixos-config }: {
nixosConfigurations = let
args = { modules = [ ./configuration.nix ]; };
in {
minfilia = nixos-config.minfilia args;
ryne = nixos-config.ryne args;
yshtola = nixos-config.yshtola args;
};
};
}
nixos-rebuild switch
Tips
Use inputs.nixos-config.url = "github:LAK132/nixos-config/dev";
for dev branch.
Use inputs.nixos-config.url = "git+file:/home/lak132/repos/nixos-config?branch=dev";
for local clone of dev branch.
Use nix-rebuild switch --flake "/etc/nixos#XYZW"
to change to the configuration for XYZW
.
Use nix flake lock --update-input nixos-config
in /etc/nixos
to update the lock file.