diff options
author | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-11-16 07:30:27 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2024-11-29 05:49:48 +0100 |
commit | 2ae50cc68e42b9d790dfba26a8c42219e7ae8f6a (patch) | |
tree | d6330dd49c89fe94f0ecd4fc0900f747aa341865 /nixos/root.nix |
import https://github.com/infinisil/sanix
I (Martin) squashed the commits up to the currently latest
(37b7f370e36f1a1e90f746e0a4f80582058f7d55).
Diffstat (limited to 'nixos/root.nix')
-rw-r--r-- | nixos/root.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/nixos/root.nix b/nixos/root.nix new file mode 100644 index 0000000..b23e091 --- /dev/null +++ b/nixos/root.nix @@ -0,0 +1,34 @@ +{ lib, pkgs, config, ... }: { + imports = [ + # Import your main configuration + ./configuration.nix + ]; + + environment.systemPackages = with pkgs; [ + # We're using niv to manage the systems Nixpkgs version, install it globally for ease + niv + ]; + + # Use the Nixpkgs config and overlays from the local files for this NixOS build + nixpkgs = { + config = import ./nixpkgs/config.nix; + overlays = import ./nixpkgs/overlays.nix; + }; + + # Makes commands default to the same Nixpkgs, config, overlays and NixOS configuration + nix.nixPath = [ + "nixpkgs=${pkgs.path}" + "nixos-config=${toString ./root.nix}" + "nixpkgs-overlays=${toString ./nixpkgs/overlays.nix}" + ]; + environment.variables.NIXPKGS_CONFIG = lib.mkForce (toString ./nixpkgs/config.nix); + + # Remove the stateful nix-channel command + environment.extraSetup = '' + rm --force $out/bin/nix-channel + ''; + + # This option is broken when set false, prevent people from setting it to false + # And we implement the important bit above ourselves + nix.channel.enable = true; +} |