1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat: add overlays, write TOML

This commit is contained in:
Kierán Meinhardt
2019-11-05 21:59:51 +01:00
parent ff99bfcb5a
commit e296de9ed1
5 changed files with 171 additions and 153 deletions

6
overlays/overlays.nix Normal file
View File

@@ -0,0 +1,6 @@
self: super:
with super.lib;
let
eval = import <nixpkgs/nixos/lib/eval-config.nix>;
paths = (eval {modules = [(import <nixos-config>)];}).config.nixpkgs.overlays;
in foldl' (flip extends) (_: super) paths self

6
overlays/toml.nix Normal file
View File

@@ -0,0 +1,6 @@
(self: super: {
writeTOML = object: super.runCommand "writeTOML" {} ''
echo '${builtins.toJSON object}' | ${super.remarshal}/bin/json2toml > $out
'';
toTOML = object: builtins.readFile (self.writeTOML object);
})