diff options
author | tv <tv@krebsco.de> | 2017-09-19 09:00:54 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2017-09-19 09:00:54 +0200 |
commit | 8af7112c5f69ffb9ca0c29e42fbb5c7f7e4700a6 (patch) | |
tree | 500c860cd2d6f6708909d9e17f394d8329c07c33 | |
parent | 59e75df87cd6ea919cd0d8a4037c6d753e0fab6e (diff) |
tv nixpkgs-overlays: init
This module allows to have per-system nixpkgs-overlays and is required
because at the moment of committing, only xu has an up-to-date stockholm
development directory in /home/tv/stockholm.
-rw-r--r-- | tv/1systems/xu/config.nix | 5 | ||||
-rw-r--r-- | tv/2configs/default.nix | 6 | ||||
-rw-r--r-- | tv/3modules/default.nix | 1 | ||||
-rw-r--r-- | tv/3modules/nixpkgs-overlays.nix | 23 |
4 files changed, 30 insertions, 5 deletions
diff --git a/tv/1systems/xu/config.nix b/tv/1systems/xu/config.nix index 0abd544..d4a10fe 100644 --- a/tv/1systems/xu/config.nix +++ b/tv/1systems/xu/config.nix @@ -155,5 +155,10 @@ with import <stockholm/lib>; # The NixOS release to be compatible with for stateful data such as databases. system.stateVersion = "15.09"; + tv.nixpkgs-overlays = { + krebs = "/home/tv/stockholm/krebs/5pkgs"; + tv = "/home/tv/stockholm/tv/5pkgs"; + }; + virtualisation.virtualbox.host.enable = true; } diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix index 241a16b..9ad0253 100644 --- a/tv/2configs/default.nix +++ b/tv/2configs/default.nix @@ -90,11 +90,7 @@ with import <stockholm/lib>; environment.variables = { NIX_PATH = mkForce (concatStringsSep ":" [ "secrets=/var/src/stockholm/null" - "nixpkgs-overlays=${pkgs.runCommand "nixpkgs-overlays" {} '' - mkdir $out - ln -s /home/tv/stockholm/krebs/5pkgs $out/krebs - ln -s /home/tv/stockholm/tv/5pkgs $out/tv - ''}" + "nixpkgs-overlays=${config.tv.nixpkgs-overlays}" "/var/src" ]); }; diff --git a/tv/3modules/default.nix b/tv/3modules/default.nix index 83dc212..57ffbfa 100644 --- a/tv/3modules/default.nix +++ b/tv/3modules/default.nix @@ -6,6 +6,7 @@ _: ./ejabberd ./hosts.nix ./iptables.nix + ./nixpkgs-overlays.nix ./x0vncserver.nix ]; } diff --git a/tv/3modules/nixpkgs-overlays.nix b/tv/3modules/nixpkgs-overlays.nix new file mode 100644 index 0000000..4eb7a86 --- /dev/null +++ b/tv/3modules/nixpkgs-overlays.nix @@ -0,0 +1,23 @@ +with import <stockholm/lib>; +{ config, pkgs, ... }: { + + options.tv.nixpkgs-overlays = mkOption { + apply = src: + pkgs.runCommand "nixpkgs-overlays" {} '' + mkdir $out + ${concatStringsSep "\n" (mapAttrsToList (name: path: + "ln -s ${shell.escape path} $out/${shell.escape name}" + ) src)} + '' // { + inherit src; + }; + type = types.attrsOf types.absolute-pathname; + }; + + config = { + tv.nixpkgs-overlays = { + krebs = mkDefault "/var/src/stockholm/krebs/5pkgs"; + tv = mkDefault "/var/src/stockholm/tv/5pkgs"; + }; + }; +} |