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.

fix(homes): ctx.hm-user owned config was not being included. (#258)

Test from #254 fixed at #257 was failing before it.

authored by

Victor Borja and committed by
GitHub
5c4ce7ae 101b08a2

+132
+132
templates/ci/modules/features/deadbugs/issue-254-ctx-hm-user-includes.nix
··· 1 + # See https://github.com/vic/den/issues/254 2 + { denTest, ... }: 3 + { 4 + flake.tests.deadbugs-issue-254.hm-user-includes = { 5 + 6 + test-hm-user = denTest ( 7 + { 8 + den, 9 + lib, 10 + igloo, # igloo = nixosConfigurations.igloo.config 11 + tuxHm, # tuxHm = igloo.home-manager.users.tux 12 + ... 13 + }: 14 + { 15 + den.default.homeManager.home.stateVersion = "25.11"; 16 + den.hosts.x86_64-linux.igloo.users.tux = { }; 17 + 18 + den.ctx.hm-user = { 19 + includes = [ 20 + { 21 + homeManager = { 22 + programs.nix-index.enable = true; 23 + }; 24 + } 25 + ]; 26 + }; 27 + 28 + den.aspects.tux.homeManager = { 29 + # Dont enable this, it should be set via den.ctx.hm-user 30 + # programs.nix-index.enable = true; 31 + }; 32 + 33 + expr = tuxHm.programs.nix-index.enable; 34 + expected = true; 35 + } 36 + ); 37 + 38 + test-user = denTest ( 39 + { 40 + den, 41 + lib, 42 + igloo, # igloo = nixosConfigurations.igloo.config 43 + tuxHm, # tuxHm = igloo.home-manager.users.tux 44 + ... 45 + }: 46 + { 47 + den.default.homeManager.home.stateVersion = "25.11"; 48 + den.hosts.x86_64-linux.igloo.users.tux = { }; 49 + 50 + den.ctx.user = { 51 + includes = [ 52 + { 53 + homeManager = { 54 + programs.nix-index.enable = true; 55 + }; 56 + } 57 + ]; 58 + }; 59 + 60 + expr = tuxHm.programs.nix-index.enable; 61 + expected = true; 62 + } 63 + ); 64 + 65 + test-hm-host = denTest ( 66 + { 67 + den, 68 + lib, 69 + igloo, # igloo = nixosConfigurations.igloo.config 70 + tuxHm, # tuxHm = igloo.home-manager.users.tux 71 + ... 72 + }: 73 + { 74 + den.default.homeManager.home.stateVersion = "25.11"; 75 + den.hosts.x86_64-linux.igloo.users.tux = { }; 76 + 77 + den.ctx.hm-host = { 78 + includes = [ 79 + { 80 + nixos = { 81 + home-manager.useGlobalPkgs = true; 82 + }; 83 + } 84 + ]; 85 + }; 86 + 87 + expr = igloo.home-manager.useGlobalPkgs; 88 + expected = true; 89 + } 90 + ); 91 + 92 + # ensure the same issue occurs for other home-like classes (hjem) 93 + test-hjem-user = denTest ( 94 + { 95 + den, 96 + lib, 97 + igloo, 98 + ... 99 + }: 100 + { 101 + den.hosts.x86_64-linux.igloo.users.tux.classes = [ "hjem" ]; 102 + 103 + # hijack a minimal module so hostConf doesn't complain about missing 104 + # inputs.hjem. A plain empty attrset is enough for our test. 105 + den.hosts.x86_64-linux.igloo.hjem.module = { 106 + options.hjem.users = lib.mkOption { 107 + type = lib.types.lazyAttrsOf ( 108 + lib.types.submodule { 109 + options.foo = lib.mkOption { 110 + type = lib.types.str; 111 + default = "<notset>"; 112 + }; 113 + } 114 + ); 115 + }; 116 + }; 117 + 118 + den.ctx.hjem-user = { 119 + includes = [ 120 + { 121 + hjem.foo = "bar"; 122 + } 123 + ]; 124 + }; 125 + 126 + expr = igloo.hjem.users.tux.foo; 127 + expected = "bar"; 128 + } 129 + ); 130 + 131 + }; 132 + }