summaryrefslogtreecommitdiff
path: root/nixos/profiles/common/sanix.nix
blob: a20db249753e4037428d4df354418192789dce2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{ lib, pkgs, config, ... }: {
  # 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 <nixos-config>}"
    "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;
}