diff options
Diffstat (limited to 'modules/by-name/ni/nix')
| -rw-r--r-- | modules/by-name/ni/nix/module.nix | 86 |
1 files changed, 47 insertions, 39 deletions
diff --git a/modules/by-name/ni/nix/module.nix b/modules/by-name/ni/nix/module.nix index 2b91f59b..65b6ed5c 100644 --- a/modules/by-name/ni/nix/module.nix +++ b/modules/by-name/ni/nix/module.nix @@ -9,63 +9,71 @@ # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, + libraries, + config, + lib, # flakes + sources, self, system, externalDependencies, ... -}: { - # TODO(@bpeetz): Modularize <2025-02-08> +}: let + nixpkgs = sources.loadFlake "nixpkgs"; - nix = { - package = pkgs.lixPackageSets.latest.lix; + cfg = config.soispha.nix; +in { + options.soispha.nix = { + enable = libraries.base.options.mkEnable "nix"; + }; - # Disable nix channels (this is a remnant of old days) - channel.enable = false; + config = lib.mkIf cfg.enable { + nix = { + package = pkgs.lixPackageSets.latest.lix; - registry = { - nixpkgs.flake = self.inputs.nixpkgs; - n.flake = - self.inputs.nixpkgs - // { - # Otherwise nixpkgs's config and overlays are not available: + # Disable nix channels (this is a remnant of old days) + channel.enable = false; - # Both attrs exists, so we just override both and hope - outputs.legacyPackages."${system}" = pkgs; - legacyPackages."${system}" = pkgs; - }; + registry = { + nixpkgs.flake = nixpkgs; + n.flake = + nixpkgs + // { + # Otherwise nixpkgs's config and overlays are not available: - t.flake = externalDependencies.templates; + # Both attrs exists, so we just override both and hope + outputs.legacyPackages."${system}" = pkgs; + legacyPackages."${system}" = pkgs; + }; - my_flake.flake = self; - m.flake = self; - }; + t.flake = externalDependencies.templates; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; + my_flake.flake = self; + m.flake = self; + }; - settings = { - auto-optimise-store = true; - experimental-features = [ - "nix-command" - "flakes" - #"ca-derivations" - ]; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; - use-xdg-base-directories = true; + settings = { + auto-optimise-store = true; + experimental-features = [ + "nix-command" + "flakes" + ]; - #substituters = ["https://cache.ngi0.nixos.org/"]; - #trusted-public-keys = ["cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA="]; + use-xdg-base-directories = true; - fallback = true; # Build from source, if binary can't be substituted + fallback = true; # Build from source, if binary can't be substituted - keep-failed = false; # keep failed tmp build dirs - pure-eval = true; # restrict file system and network access to hash + keep-failed = false; # keep failed tmp build dirs + pure-eval = true; # restrict file system and network access to hash - sandbox-fallback = false; # Don't disable the sandbox, if the kernel doesn't support it + sandbox-fallback = false; # Don't disable the sandbox, if the kernel doesn't support it + }; }; }; } |
