My NixOS setup
This is my NixOS config. There are many like it but this
one is mine.
The repository splits apart hardware configuration, machines roles and various
snippets. The appropriate files are included in the installer-generatedconfiguration.nix
like such:
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
./hardware/thinkpad_x250.nix
./modules/laptop.nix
];
networking.hostName = "woodstock";
[...]
nix-build -E "with import <nixpkgs> {}; callPackage ./default.nix {}"
nix-channel --list
nix-channel --add https://nixos.org/channels/nixos-20.09 nixos
nix-channel --update
nixos-rebuild boot --upgrade
nix-shell -p node2nix
node2nix -i <(echo '["clubhouse-cli"]')
nix-env -f default.nix -iA clubhouse-cli
Install generator:
nix-env -f https://github.com/nix-community/nixos-generators/archive/master.tar.gz -i
Build:
nixos-generate -f lxc -c /etc/nixos/configuration-sandnix.nix
nixos-generate -f lxc-metadata -c /etc/nixos/configuration-sandnix.nix
lxc image import $(nixos-generate -f lxc-metadata) $(nixos-generate -f lxc)