From 1b65ba7a838e422c9bf16ddcaf796a996fa51b6b Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Fri, 27 Dec 2024 08:45:34 +0100 Subject: refactor: introduce profiles --- nixos/profiles/common/sanix.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 nixos/profiles/common/sanix.nix (limited to 'nixos/profiles/common/sanix.nix') diff --git a/nixos/profiles/common/sanix.nix b/nixos/profiles/common/sanix.nix new file mode 100644 index 0000000..a20db24 --- /dev/null +++ b/nixos/profiles/common/sanix.nix @@ -0,0 +1,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 }" + "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; +} -- cgit v1.2.3