├── LICENSE ├── README.md ├── createFlakeNix.sh ├── default.nix ├── dirtyFlake.nix ├── flake.lock ├── flake.nix └── nix ├── default.nix ├── sources.json └── sources.nix /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Erik Oosting 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Niv Flakes 2 | 3 | Nix flakes for the stubborn niv user 4 | 5 | ## Introduction 6 | 7 | [Nix flakes](https://nixos.wiki/wiki/Flakes) is becoming more popular in the nix community, despite the feature still being work in progress. 8 | It brings with it many advantages, mostly when considering discovery of new packages. `nix flake show` can give people a brief overview of what is in 9 | a nix-related project, and allows someone to quickly figure out if the project contains something they need. However, it comes with some issues... 10 | 11 | Flakes aren't the first solution to the problem of non-replicatable builds. There are also [Git Submodules](https://git-scm.com/docs/git-submodule), [Niv](https://github.com/nmattia/niv) and [Nix-Thunk](https://github.com/obsidiansystems/nix-thunk). 12 | These options all have their own upsides and drawbacks, but one thing they all share is that they are not quite compatible with nix flakes. This project tries to integrate the second option, *Niv*. 13 | 14 | ## The problem 15 | 16 | A `flake.nix` file is quite stingy when it comes to what can and can't go into it. 17 | If you were to try and involve other files in the inclusion of your imports, you'd get an error, as nix doesn't see your dynamically generated attribute set as an attribute set, but as a *thunk*. 18 | This means that we can't do anything other than typing out the attribute set by hand. This can be done declaratively. 19 | When we try to import github repositories in nix flakes, we usually do this by using an input url in the form of "github:{name}/{repo}/{branch?}". 20 | The problem with this is that when debugging a flake with a lot of inputs with this url scheme, you could accidentally exceed the rate limits imposed by the github api, 21 | as flakes use GitHub's [Rest API](https://docs.github.com/en/rest) to resolve github urls. 22 | 23 | ## The solution (i hope) 24 | 25 | Instead of using git or github urls to resolve github repositories, we instead use niv to find URLs to tarballs of repositories on a certain commit. This does have some drawbacks, however. 26 | For one, niv works best when the repository is on github, which means that other git forges may not get the auto-updating benefits that github-hosted repositories have. 27 | 28 | ## Usage 29 | 30 | ### Installation 31 | 32 | This is a template repository. 33 | To use this flake you either fork this repository to your own account, clone it, or use `nix flake new -t github:crazazy/niv-flakes ` to get a new version of this flake working 34 | 35 | ### Updating/Installing new github repositories 36 | 37 | Dependent repositories are read from `nix/sources.json`. To edit it, its highly advisable to use niv. 38 | 39 | - To add a new dependency, use `niv add [username]/[reponame]`. If your new dependency is a flake, you can use it as one by doing `niv modify [username]/[reponame] -a flake=true` 40 | - To update all your dependencies, use `niv update` 41 | 42 | After this, you should execute ./createFlakeNix.sh to generate a new flake.nix, followed by `nix flake update` do update your lockfile 43 | 44 | ### Changing what your flake does 45 | 46 | Most of the actual flake logic is put in [./dirtyFlake.nix](./dirtyFlake.nix). 47 | This is where you'll find a sample outputs function and an example description of the flake. Do with it what you want, and after modification make sure to do `nix flake check` to see if your flake still works. 48 | -------------------------------------------------------------------------------- /createFlakeNix.sh: -------------------------------------------------------------------------------- 1 | # run this in nix-unstable 2 | evalNix(){ 3 | if nix --version | grep -F '2.3' > /dev/null; then 4 | nix eval $* 5 | else 6 | nix --experimental-features nix-command eval $* 7 | fi 8 | } 9 | inputs=$(evalNix -f dirtyFlake.nix inputs | sed 's/;/;\n/g' | nix-shell -p nixpkgs-fmt --run nixpkgs-fmt) 10 | description=$(evalNix -f dirtyFlake.nix description) 11 | getInputs(){ 12 | if nix --version | grep -F '2.3' > /dev/null; then 13 | nix eval -f dirtyFlake.nix inputs | sed 's/;/;\n/g' | nix run nixpkgs.nixpkgs-fmt -c nixpkgs-fmt 14 | else 15 | nix --experimental-features nix-command eval -f dirtyFlake.nix inputs | sed 's/;/;\n/g' | nix-shell -p nixpkgs-fmt --run nixpkgs-fmt 16 | fi 17 | } 18 | 19 | cat > ./flake.nix << EOF 20 | { 21 | description = $description; 22 | inputs = $inputs; 23 | outputs = args: (import ./dirtyFlake.nix).outputs args; 24 | } 25 | EOF 26 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | if builtins ? getFlake then (builtins.getFlake "path:./.").outputs else import ./nix 2 | -------------------------------------------------------------------------------- /dirtyFlake.nix: -------------------------------------------------------------------------------- 1 | 2 | { 3 | description = "A way to transport niv inputs to flake inputs"; 4 | inputs = let 5 | inherit (builtins) readFile attrNames fromJSON listToAttrs; 6 | packageSources = fromJSON (readFile ./nix/sources.json); 7 | mapAttrs = f: attrs: listToAttrs (map (k: { name = k; value = f k (attrs.${k}); }) (attrNames attrs)); 8 | in mapAttrs (k: v: { 9 | inherit (v) url; 10 | flake = v.flake or false; 11 | }) packageSources; 12 | outputs = { self, nixpkgs, flake-utils, nixos-config, ... }: 13 | let 14 | inherit (flake-utils.lib) eachDefaultSystem flattenTree; 15 | monoLib = (import nixos-config { pkgs = { inherit (nixpkgs) lib; }; }).lib; 16 | in 17 | { 18 | lib = { 19 | inherit (monoLib) ensureModules pkgsrc; 20 | augmentCallPackage = callPackage: defaultArgs: f: extraArgs: let 21 | fn = if builtins.isFunction f then f else import f; 22 | args = builtins.intersectAttrs defaultArgs (builtins.functionArgs fn); 23 | in 24 | callPackage fn (args // extraArgs); 25 | mkSystem = modules: nixpkgs.lib.nixosSystem { 26 | inherit modules; 27 | extraArgs.system = "x86_64-linux"; 28 | system = "x86_64-linux"; 29 | }; 30 | }; 31 | defaultTemplate = { 32 | path = ./.; 33 | description = "nix flakes for niv users"; 34 | }; 35 | } // eachDefaultSystem (system: let 36 | pkgs = nixpkgs.legacyPackages.${system}; 37 | monorepo = import nixos-config { inherit pkgs; }; 38 | in 39 | { 40 | packages = flattenTree { 41 | inherit (monorepo) nix; 42 | python = monorepo.callNixPackage ({ python3 }: python3) {}; 43 | }; 44 | }); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-utils": { 4 | "inputs": { 5 | "systems": "systems" 6 | }, 7 | "locked": { 8 | "lastModified": 1710146030, 9 | "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", 10 | "type": "tarball", 11 | "url": "https://github.com/numtide/flake-utils/archive/b1d9ab70662946ef0850d488da1c9019f3a9752a.tar.gz" 12 | }, 13 | "original": { 14 | "type": "tarball", 15 | "url": "https://github.com/numtide/flake-utils/archive/b1d9ab70662946ef0850d488da1c9019f3a9752a.tar.gz" 16 | } 17 | }, 18 | "niv": { 19 | "flake": false, 20 | "locked": { 21 | "lastModified": 1709902347, 22 | "narHash": "sha256-RKsGLMaZAh22WN+RGPEx5JZM4r1el+q+ZickBGy+fuE=", 23 | "type": "tarball", 24 | "url": "https://github.com/nmattia/niv/archive/6f6529db3a69cf3c4dd81eebcb5b46f1d34170e5.tar.gz" 25 | }, 26 | "original": { 27 | "type": "tarball", 28 | "url": "https://github.com/nmattia/niv/archive/6f6529db3a69cf3c4dd81eebcb5b46f1d34170e5.tar.gz" 29 | } 30 | }, 31 | "nixos-config": { 32 | "flake": false, 33 | "locked": { 34 | "lastModified": 1713908702, 35 | "narHash": "sha256-+yIQhLfg3KT+A7kAm8qz6WlC0wxC1I0p0vEJKyrkjVQ=", 36 | "type": "tarball", 37 | "url": "https://github.com/crazazy/nixos-config/archive/948399fbe34d18ecc2452bfbd60b68edfdc10a76.tar.gz" 38 | }, 39 | "original": { 40 | "type": "tarball", 41 | "url": "https://github.com/crazazy/nixos-config/archive/948399fbe34d18ecc2452bfbd60b68edfdc10a76.tar.gz" 42 | } 43 | }, 44 | "nixpkgs": { 45 | "locked": { 46 | "lastModified": 1651477990, 47 | "narHash": "sha256-nnY12IKDdVnnybAe44nPTTspS0KwA5SDNBo1z8K5/MU=", 48 | "type": "tarball", 49 | "url": "https://github.com/NixOS/nixpkgs/archive/345ff18c99af958afdbd57f077aae9af4000e864.tar.gz" 50 | }, 51 | "original": { 52 | "type": "tarball", 53 | "url": "https://github.com/NixOS/nixpkgs/archive/345ff18c99af958afdbd57f077aae9af4000e864.tar.gz" 54 | } 55 | }, 56 | "root": { 57 | "inputs": { 58 | "flake-utils": "flake-utils", 59 | "niv": "niv", 60 | "nixos-config": "nixos-config", 61 | "nixpkgs": "nixpkgs" 62 | } 63 | }, 64 | "systems": { 65 | "locked": { 66 | "lastModified": 1681028828, 67 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 68 | "owner": "nix-systems", 69 | "repo": "default", 70 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 71 | "type": "github" 72 | }, 73 | "original": { 74 | "owner": "nix-systems", 75 | "repo": "default", 76 | "type": "github" 77 | } 78 | } 79 | }, 80 | "root": "root", 81 | "version": 7 82 | } 83 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "A way to transport niv inputs to flake inputs"; 3 | inputs = { 4 | flake-utils = { 5 | flake = true; 6 | url = "https://github.com/numtide/flake-utils/archive/b1d9ab70662946ef0850d488da1c9019f3a9752a.tar.gz"; 7 | }; 8 | niv = { 9 | flake = false; 10 | url = "https://github.com/nmattia/niv/archive/6f6529db3a69cf3c4dd81eebcb5b46f1d34170e5.tar.gz"; 11 | }; 12 | nixos-config = { 13 | flake = false; 14 | url = "https://github.com/crazazy/nixos-config/archive/948399fbe34d18ecc2452bfbd60b68edfdc10a76.tar.gz"; 15 | }; 16 | nixpkgs = { 17 | flake = true; 18 | url = "https://github.com/NixOS/nixpkgs/archive/345ff18c99af958afdbd57f077aae9af4000e864.tar.gz"; 19 | }; 20 | }; 21 | outputs = args: (import ./dirtyFlake.nix).outputs args; 22 | } 23 | -------------------------------------------------------------------------------- /nix/default.nix: -------------------------------------------------------------------------------- 1 | let 2 | sources = import ./sources.nix; 3 | # i know, irresponsible AF 4 | flake-compat = sources.flake-compat or (builtins.fetchGit { 5 | url = "https://github.com/edolstra/flake-compat"; 6 | rev = "99f1c2157fba4bfe6211a321fd0ee43199025dbf"; 7 | }); 8 | inputs = builtins.mapAttrs (k: v: if v.flake or false then (import flake-compat { src = v; }).defaultNix else v ) sources; 9 | flake = import ../flake.nix; 10 | # don't assume that we already have this function from nixpkgs 11 | fix = f: let x = f x; in x; 12 | in 13 | fix (self: flake.outputs ({ inherit self; } // inputs)) 14 | 15 | 16 | -------------------------------------------------------------------------------- /nix/sources.json: -------------------------------------------------------------------------------- 1 | { 2 | "flake-utils": { 3 | "branch": "main", 4 | "description": "Pure Nix flake utility functions", 5 | "flake": true, 6 | "homepage": null, 7 | "owner": "numtide", 8 | "repo": "flake-utils", 9 | "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", 10 | "sha256": "1x2wwj4qib476r9ycx0rm9xnmja9r2zipijckbkry71vw3llp7j9", 11 | "type": "tarball", 12 | "url": "https://github.com/numtide/flake-utils/archive/b1d9ab70662946ef0850d488da1c9019f3a9752a.tar.gz", 13 | "url_template": "https://github.com///archive/.tar.gz" 14 | }, 15 | "niv": { 16 | "branch": "master", 17 | "description": "Easy dependency management for Nix projects", 18 | "homepage": "https://github.com/nmattia/niv", 19 | "owner": "nmattia", 20 | "repo": "niv", 21 | "rev": "6f6529db3a69cf3c4dd81eebcb5b46f1d34170e5", 22 | "sha256": "1qbyprn08917cszfm5syppi4r5p467qii4fzb2v1s0lrqqn0das4", 23 | "type": "tarball", 24 | "url": "https://github.com/nmattia/niv/archive/6f6529db3a69cf3c4dd81eebcb5b46f1d34170e5.tar.gz", 25 | "url_template": "https://github.com///archive/.tar.gz" 26 | }, 27 | "nixos-config": { 28 | "branch": "master", 29 | "description": "personal nixos config", 30 | "homepage": "https://crazazy.github.io/nixos-config", 31 | "owner": "crazazy", 32 | "repo": "nixos-config", 33 | "rev": "948399fbe34d18ecc2452bfbd60b68edfdc10a76", 34 | "sha256": "0m4dwhm2n2gis8lqvm221k9l4sg9ng59n05r0gza9p70ny2108pv", 35 | "type": "tarball", 36 | "url": "https://github.com/crazazy/nixos-config/archive/948399fbe34d18ecc2452bfbd60b68edfdc10a76.tar.gz", 37 | "url_template": "https://github.com///archive/.tar.gz" 38 | }, 39 | "nixpkgs": { 40 | "branch": "release-20.03", 41 | "description": "Nix Packages collection", 42 | "flake": true, 43 | "homepage": "", 44 | "owner": "NixOS", 45 | "repo": "nixpkgs", 46 | "rev": "345ff18c99af958afdbd57f077aae9af4000e864", 47 | "sha256": "1igwp71cyd8s6j1r80xh895jjfsdry4y67mhr7kmjxc3hbc3axly", 48 | "type": "tarball", 49 | "url": "https://github.com/NixOS/nixpkgs/archive/345ff18c99af958afdbd57f077aae9af4000e864.tar.gz", 50 | "url_template": "https://github.com///archive/.tar.gz" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /nix/sources.nix: -------------------------------------------------------------------------------- 1 | # This file has been generated by Niv. 2 | 3 | let 4 | 5 | # 6 | # The fetchers. fetch_ fetches specs of type . 7 | # 8 | 9 | fetch_file = pkgs: name: spec: 10 | let 11 | name' = sanitizeName name + "-src"; 12 | in 13 | if spec.builtin or true then 14 | builtins_fetchurl { inherit (spec) url sha256; name = name'; } 15 | else 16 | pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; 17 | 18 | fetch_tarball = pkgs: name: spec: 19 | let 20 | name' = sanitizeName name + "-src"; 21 | in 22 | if spec.builtin or true then 23 | builtins_fetchTarball { name = name'; inherit (spec) url sha256; } 24 | else 25 | pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; 26 | 27 | fetch_git = name: spec: 28 | let 29 | ref = 30 | if spec ? ref then spec.ref else 31 | if spec ? branch then "refs/heads/${spec.branch}" else 32 | if spec ? tag then "refs/tags/${spec.tag}" else 33 | abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; 34 | in 35 | builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; 36 | 37 | fetch_local = spec: spec.path; 38 | 39 | fetch_builtin-tarball = name: throw 40 | ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. 41 | $ niv modify ${name} -a type=tarball -a builtin=true''; 42 | 43 | fetch_builtin-url = name: throw 44 | ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. 45 | $ niv modify ${name} -a type=file -a builtin=true''; 46 | 47 | # 48 | # Various helpers 49 | # 50 | 51 | # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 52 | sanitizeName = name: 53 | ( 54 | concatMapStrings (s: if builtins.isList s then "-" else s) 55 | ( 56 | builtins.split "[^[:alnum:]+._?=-]+" 57 | ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) 58 | ) 59 | ); 60 | 61 | # The set of packages used when specs are fetched using non-builtins. 62 | mkPkgs = sources: system: 63 | let 64 | sourcesNixpkgs = 65 | import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; 66 | hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; 67 | hasThisAsNixpkgsPath = == ./.; 68 | in 69 | if builtins.hasAttr "nixpkgs" sources 70 | then sourcesNixpkgs 71 | else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then 72 | import {} 73 | else 74 | abort 75 | '' 76 | Please specify either (through -I or NIX_PATH=nixpkgs=...) or 77 | add a package called "nixpkgs" to your sources.json. 78 | ''; 79 | 80 | # The actual fetching function. 81 | fetch = pkgs: name: spec: 82 | 83 | if ! builtins.hasAttr "type" spec then 84 | abort "ERROR: niv spec ${name} does not have a 'type' attribute" 85 | else if spec.type == "file" then fetch_file pkgs name spec 86 | else if spec.type == "tarball" then fetch_tarball pkgs name spec 87 | else if spec.type == "git" then fetch_git name spec 88 | else if spec.type == "local" then fetch_local spec 89 | else if spec.type == "builtin-tarball" then fetch_builtin-tarball name 90 | else if spec.type == "builtin-url" then fetch_builtin-url name 91 | else 92 | abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; 93 | 94 | # If the environment variable NIV_OVERRIDE_${name} is set, then use 95 | # the path directly as opposed to the fetched source. 96 | replace = name: drv: 97 | let 98 | saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; 99 | ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; 100 | in 101 | if ersatz == "" then drv else 102 | # this turns the string into an actual Nix path (for both absolute and 103 | # relative paths) 104 | if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; 105 | 106 | # Ports of functions for older nix versions 107 | 108 | # a Nix version of mapAttrs if the built-in doesn't exist 109 | mapAttrs = builtins.mapAttrs or ( 110 | f: set: with builtins; 111 | listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) 112 | ); 113 | 114 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 115 | range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); 116 | 117 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 118 | stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); 119 | 120 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 121 | stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); 122 | concatMapStrings = f: list: concatStrings (map f list); 123 | concatStrings = builtins.concatStringsSep ""; 124 | 125 | # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 126 | optionalAttrs = cond: as: if cond then as else {}; 127 | 128 | # fetchTarball version that is compatible between all the versions of Nix 129 | builtins_fetchTarball = { url, name ? null, sha256 }@attrs: 130 | let 131 | inherit (builtins) lessThan nixVersion fetchTarball; 132 | in 133 | if lessThan nixVersion "1.12" then 134 | fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) 135 | else 136 | fetchTarball attrs; 137 | 138 | # fetchurl version that is compatible between all the versions of Nix 139 | builtins_fetchurl = { url, name ? null, sha256 }@attrs: 140 | let 141 | inherit (builtins) lessThan nixVersion fetchurl; 142 | in 143 | if lessThan nixVersion "1.12" then 144 | fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) 145 | else 146 | fetchurl attrs; 147 | 148 | # Create the final "sources" from the config 149 | mkSources = config: 150 | mapAttrs ( 151 | name: spec: 152 | if builtins.hasAttr "outPath" spec 153 | then abort 154 | "The values in sources.json should not have an 'outPath' attribute" 155 | else 156 | spec // { outPath = replace name (fetch config.pkgs name spec); } 157 | ) config.sources; 158 | 159 | # The "config" used by the fetchers 160 | mkConfig = 161 | { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null 162 | , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) 163 | , system ? builtins.currentSystem 164 | , pkgs ? mkPkgs sources system 165 | }: rec { 166 | # The sources, i.e. the attribute set of spec name to spec 167 | inherit sources; 168 | 169 | # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers 170 | inherit pkgs; 171 | }; 172 | 173 | in 174 | mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } 175 | --------------------------------------------------------------------------------