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

Fix usage of obsolete options and remove passthru requirement (#169) (#171)

Changes:
- Remove need to define `passthru` attribute for hosts
- Remove usage of obsolete nixpkgs options
- Add descriptive error message if `flake`'s attributes are defined
multiple times

authored by

Janne Hakonen and committed by
GitHub
f8cb8c61 5478f8e9

+43 -3
+43 -1
modules/output.nix
··· 5 5 { 6 6 # NOTE: Currently Den needs a top-level attribute where to place configurations, 7 7 # by default it is the `flake` attribute, even if Den uses no flake-parts at all. 8 + 9 + # This definitions has been adapted from https://github.com/hercules-ci/flake-parts 10 + # project which is licensed with: 11 + # 12 + # MIT License 13 + # 14 + # Copyright (c) 2021 Hercules CI 15 + # 16 + # Permission is hereby granted, free of charge, to any person obtaining a copy 17 + # of this software and associated documentation files (the "Software"), to deal 18 + # in the Software without restriction, including without limitation the rights 19 + # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 20 + # copies of the Software, and to permit persons to whom the Software is 21 + # furnished to do so, subject to the following conditions: 22 + # 23 + # The above copyright notice and this permission notice shall be included in all 24 + # copies or substantial portions of the Software. 25 + # 26 + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 + # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 + # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 29 + # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 30 + # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 31 + # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 32 + # SOFTWARE. 8 33 options.flake = lib.mkOption { 9 - type = lib.types.submodule { freeformType = lib.types.anything; }; 34 + type = lib.types.submoduleWith { 35 + modules = [ 36 + { 37 + freeformType = lib.types.lazyAttrsOf ( 38 + lib.types.unique { 39 + message = '' 40 + No option has been declared for this flake output attribute, so its definitions can't be merged automatically. 41 + Possible solutions: 42 + - Load a module that defines this flake output attribute 43 + - Declare an option for this flake output attribute 44 + - Make sure the output attribute is spelled correctly 45 + - Define the value only once, with a single definition in a single module 46 + ''; 47 + } lib.types.raw 48 + ); 49 + } 50 + ]; 51 + }; 10 52 }; 11 53 }
-1
templates/minimal/modules/den.nix
··· 10 10 { pkgs, ... }: 11 11 { 12 12 environment.systemPackages = [ pkgs.hello ]; 13 - passthru = { }; 14 13 }; 15 14 }; 16 15
-1
templates/noflake/modules/den.nix
··· 17 17 nixos = 18 18 { pkgs, ... }: 19 19 { 20 - passthru = { }; 21 20 environment.systemPackages = [ 22 21 pkgs.vim 23 22 ];