From 96bf5aa00bbf2499c47c887b2217570657d0011d Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 23 May 2024 18:24:03 +0200 Subject: refactor(nixpkgs): Configure nixpkgs via the module system --- modules/system/default.nix | 1 + modules/system/nixpkgs/default.nix | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 modules/system/nixpkgs/default.nix (limited to 'modules') diff --git a/modules/system/default.nix b/modules/system/default.nix index 0eef0b7f..6a1fe03a 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -11,6 +11,7 @@ in { ./impermanence ./locale ./networking + ./nixpkgs ./polkit ./power ./secrets diff --git a/modules/system/nixpkgs/default.nix b/modules/system/nixpkgs/default.nix new file mode 100644 index 00000000..ca28c7bd --- /dev/null +++ b/modules/system/nixpkgs/default.nix @@ -0,0 +1,40 @@ +{ + lib, + config, + myPkgs, + pkgs, + ... +}: let + cfg = config.soispha.nixpkgs; + + myPkgsOverlay = self: super: myPkgs; +in { + options.soispha.nixpkgs = { + enable = lib.mkEnableOption "Nixpkgs config"; + systemName = lib.mkOption { + description = "The name of the system."; + example = "x86_64-linux"; + type = lib.types.str; + }; + }; + config = { + nixpkgs = lib.mkIf cfg.enable { + hostPlatform = cfg.systemName; + config = { + hostSystem = cfg.systemName; + overlays = [ + myPkgsOverlay + ]; + config = { + # TODO: this fails because of the root tempsize, which should be increased + # contentAddressedByDefault = true; + + allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "pypemicro" # required by pynitrokey + ]; + }; + }; + }; + }; +} -- cgit 1.4.1