NixOS system configuration: Difference between revisions
m →Flake-specific tips: update code snippets |
|||
Line 182: | Line 182: | ||
A NixOS config flake could be as follows (replace <hostname> with your hostname): | A NixOS config flake could be as follows (replace <hostname> with your hostname): | ||
{{file| | {{file|3=<nowiki> | ||
{ | { | ||
description = "NixOS configuration with two or more channels"; | description = "NixOS configuration with two or more channels"; | ||
Line 214: | Line 214: | ||
}; | }; | ||
} | } | ||
</nowiki> | </nowiki>|name=/etc/nixos/flake.nix|lang=nix}} | ||
}} | |||
{{file| | {{file|3=<nowiki> | ||
# can now use "pkgs.package" or "pkgs.unstable.package" | # can now use "pkgs.package" or "pkgs.unstable.package" | ||
{ pkgs, ... }: | { pkgs, ... }: | ||
Line 227: | Line 226: | ||
# ... | # ... | ||
} | } | ||
</nowiki> | </nowiki>|name=/etc/nixos/configuration.nix|lang=nix}} | ||
}} | |||
If the variable <code>nixpkgs</code> points to the flake, you can also define <code>pkgs</code> with overlays with: | If the variable <code>nixpkgs</code> points to the flake, you can also define <code>pkgs</code> with overlays with: |