Modular, context-aware and aspect-oriented dendritic Nix configurations. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/ den.oeiuwq.com
configurations den dendritic nix aspect oriented
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

simpler code

+8 -35
+8 -35
modules/aspects/provides/unfree/unfree-predicate-builder.nix
··· 14 14 15 15 ''; 16 16 17 - unfreeOption.options.unfree = { 18 - packages = lib.mkOption { 19 - type = lib.types.listOf lib.types.str; 20 - default = [ ]; 21 - }; 22 - }; 23 - 24 17 unfreeModule = 25 18 { config, ... }@args: 26 19 let ··· 28 21 globalPkgs = args.osConfig.home-manager.useGlobalPkgs or false; 29 22 in 30 23 { 31 - nixpkgs = lib.mkIf (!globalPkgs) { 24 + options.unfree.packages = lib.mkOption { 25 + type = lib.types.listOf lib.types.str; 26 + default = [ ]; 27 + }; 28 + config.nixpkgs = lib.mkIf (!globalPkgs) { 32 29 config.allowUnfreePredicate = (pkg: builtins.elem (lib.getName pkg) config.unfree.packages); 33 30 }; 34 31 }; 35 32 36 - osAspect = 37 - { OS, host }: 38 - take.unused OS { 39 - ${host.class}.imports = [ 40 - unfreeOption 41 - unfreeModule 42 - ]; 43 - }; 33 + osAspect = { OS, host }: take.unused OS { ${host.class}.imports = [ unfreeModule ]; }; 44 34 45 35 userAspect = 46 36 { ··· 48 38 user, 49 39 host, 50 40 }: 51 - take.unused 52 - [ 53 - HM 54 - host 55 - ] 56 - { 57 - ${user.class}.imports = [ 58 - unfreeOption 59 - unfreeModule 60 - ]; 61 - }; 41 + take.unused [ HM host ] { ${user.class}.imports = [ unfreeModule ]; }; 62 42 63 - homeAspect = 64 - { HM, home }: 65 - take.unused HM { 66 - ${home.class}.imports = [ 67 - unfreeOption 68 - unfreeModule 69 - ]; 70 - }; 43 + homeAspect = { HM, home }: take.unused HM { ${home.class}.imports = [ unfreeModule ]; }; 71 44 72 45 aspect = parametric.exactly { 73 46 inherit description;