diff options
author | Martin Fischer <martin@push-f.com> | 2024-11-29 07:10:07 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2024-12-11 08:32:27 +0100 |
commit | 112c101c7308ddd710d0936ad8d1c010ae0dfb28 (patch) | |
tree | 5d50d6f9ba2274b154b2be8253f16b4dddfcf63e /nixos/sanix.nix | |
parent | 10ef42ae9d4a60dea161bae495ec1f09c8388617 (diff) |
refactor: make configuration.nix main entry point
Diffstat (limited to 'nixos/sanix.nix')
-rw-r--r-- | nixos/sanix.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/nixos/sanix.nix b/nixos/sanix.nix new file mode 100644 index 0000000..4895127 --- /dev/null +++ b/nixos/sanix.nix @@ -0,0 +1,29 @@ +{ lib, pkgs, config, ... }: { + 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 <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; +} |