diff options
Diffstat (limited to '')
| -rw-r--r-- | modules/by-name/ni/nix/module.nix | 82 | ||||
| -rw-r--r-- | modules/by-name/ni/nixpkgs/module.nix | 12 |
2 files changed, 52 insertions, 42 deletions
diff --git a/modules/by-name/ni/nix/module.nix b/modules/by-name/ni/nix/module.nix index ed4462f4..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, ... -}: -let +}: let nixpkgs = sources.loadFlake "nixpkgs"; + + cfg = config.soispha.nix; in { - # TODO(@bpeetz): Modularize <2025-02-08> + options.soispha.nix = { + enable = libraries.base.options.mkEnable "nix"; + }; - nix = { - package = pkgs.lixPackageSets.latest.lix; + config = lib.mkIf cfg.enable { + nix = { + package = pkgs.lixPackageSets.latest.lix; - # Disable nix channels (this is a remnant of old days) - channel.enable = false; + # Disable nix channels (this is a remnant of old days) + channel.enable = false; - registry = { - nixpkgs.flake = nixpkgs; - n.flake = - nixpkgs - // { - # Otherwise nixpkgs's config and overlays are not available: + registry = { + nixpkgs.flake = nixpkgs; + n.flake = + nixpkgs + // { + # Otherwise nixpkgs's config and overlays are not available: - # Both attrs exists, so we just override both and hope - outputs.legacyPackages."${system}" = pkgs; - legacyPackages."${system}" = pkgs; - }; + # Both attrs exists, so we just override both and hope + outputs.legacyPackages."${system}" = pkgs; + legacyPackages."${system}" = pkgs; + }; - t.flake = externalDependencies.templates; + t.flake = externalDependencies.templates; - my_flake.flake = self; - m.flake = self; - }; + my_flake.flake = self; + m.flake = self; + }; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; - settings = { - auto-optimise-store = true; - experimental-features = [ - "nix-command" - "flakes" - ]; + settings = { + auto-optimise-store = true; + experimental-features = [ + "nix-command" + "flakes" + ]; - use-xdg-base-directories = true; + 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 + }; }; }; } diff --git a/modules/by-name/ni/nixpkgs/module.nix b/modules/by-name/ni/nixpkgs/module.nix index 84d8e074..1ded8444 100644 --- a/modules/by-name/ni/nixpkgs/module.nix +++ b/modules/by-name/ni/nixpkgs/module.nix @@ -22,7 +22,13 @@ in { example = "x86_64-linux"; type = lib.types.str; }; + unfreePackageNames = lib.mkOption { + description = "Names of unfree packages to allow"; + example = "[ steam steam-unwrapped ]"; + type = lib.types.listOf lib.types.str; + }; }; + config = let myPkgsOverlay = self: super: packageSets.soispha; in @@ -39,11 +45,7 @@ in { hostSystem = cfg.systemName; allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - # the plugin is lacking an license and is thus unfree, effectively - # its okay though (TODO: investigate <2026-05-11>)? - "cmp-calc" - ]; + builtins.elem (lib.getName pkg) cfg.unfreePackageNames; }; }; }; |
