From 6305c0675ff4c0cc963c25228e631f1a2a685d69 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan <daiderd@gmail.com> Date: Mon, 2 Jan 2017 08:21:27 +0100 Subject: [PATCH] move write-text submodule --- modules/programs/tmux.nix | 2 +- modules/programs/vim.nix | 2 +- modules/system/activation-scripts.nix | 2 +- modules/system/etc.nix | 2 +- modules/system/launchd.nix | 2 +- modules/system/write-text.nix | 55 --------------------------- 6 files changed, 5 insertions(+), 60 deletions(-) delete mode 100644 modules/system/write-text.nix diff --git a/modules/programs/tmux.nix b/modules/programs/tmux.nix index 259a2043..524b307b 100644 --- a/modules/programs/tmux.nix +++ b/modules/programs/tmux.nix @@ -22,7 +22,7 @@ let --add-flags -f --add-flags /etc/tmux.conf ''; - text = import ../system/write-text.nix { + text = import ../lib/write-text.nix { inherit lib; mkTextDerivation = name: text: pkgs.writeText "tmux-options-${name}" text; }; diff --git a/modules/programs/vim.nix b/modules/programs/vim.nix index 3319c918..67b557d5 100644 --- a/modules/programs/vim.nix +++ b/modules/programs/vim.nix @@ -12,7 +12,7 @@ let vimrcConfig.vam.pluginDictionaries = cfg.plugins; }; - text = import ../system/write-text.nix { + text = import ../lib/write-text.nix { inherit lib; mkTextDerivation = name: text: pkgs.writeText "vim-options-${name}" text; }; diff --git a/modules/system/activation-scripts.nix b/modules/system/activation-scripts.nix index 209b7583..4e240982 100644 --- a/modules/system/activation-scripts.nix +++ b/modules/system/activation-scripts.nix @@ -8,7 +8,7 @@ let cfg = config.system; - script = import ./write-text.nix { + script = import ../lib/write-text.nix { inherit lib; mkTextDerivation = name: text: pkgs.writeScript "activate-${name}" text; }; diff --git a/modules/system/etc.nix b/modules/system/etc.nix index 4ac4a0dd..4b92dc0c 100644 --- a/modules/system/etc.nix +++ b/modules/system/etc.nix @@ -4,7 +4,7 @@ with lib; let - text = import ./write-text.nix { + text = import ../lib/write-text.nix { inherit lib; mkTextDerivation = name: text: pkgs.writeText "etc-${name}" text; }; diff --git a/modules/system/launchd.nix b/modules/system/launchd.nix index 4083353a..a79c0ddb 100644 --- a/modules/system/launchd.nix +++ b/modules/system/launchd.nix @@ -6,7 +6,7 @@ let cfg = config.system; - text = import ../system/write-text.nix { + text = import ../lib/write-text.nix { inherit lib; mkTextDerivation = pkgs.writeText; }; diff --git a/modules/system/write-text.nix b/modules/system/write-text.nix deleted file mode 100644 index 4ffc0818..00000000 --- a/modules/system/write-text.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ lib, mkTextDerivation }: - -{ config, name, ... }: - -with lib; - -let - - sourceDrv = mkTextDerivation name config.text; - -in - -{ - options = { - - enable = mkOption { - type = types.bool; - default = true; - description = '' - Whether this file should be generated. - This option allows specific files to be disabled. - ''; - }; - - text = mkOption { - type = types.lines; - default = ""; - description = '' - Text of the file. - ''; - }; - - target = mkOption { - type = types.str; - default = name; - description = '' - Name of symlink. Defaults to the attribute name. - ''; - }; - - source = mkOption { - type = types.path; - description = '' - Path of the source file. - ''; - }; - - }; - - config = { - - source = mkIf (config.text != "") (mkDefault sourceDrv); - - }; -}