summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-01-02 08:21:27 +0100
committerDaiderd Jordan <daiderd@gmail.com>2017-01-02 08:21:54 +0100
commit6305c0675ff4c0cc963c25228e631f1a2a685d69 (patch)
tree8b6668f18d57c695b7642cd9e3184c84dd81d5ad /modules
parenta85194aa3364b184e1ee27f4b081958efd6cdab1 (diff)
move write-text submodule
Diffstat (limited to 'modules')
-rw-r--r--modules/programs/tmux.nix2
-rw-r--r--modules/programs/vim.nix2
-rw-r--r--modules/system/activation-scripts.nix2
-rw-r--r--modules/system/etc.nix2
-rw-r--r--modules/system/launchd.nix2
-rw-r--r--modules/system/write-text.nix55
6 files changed, 5 insertions, 60 deletions
diff --git a/modules/programs/tmux.nix b/modules/programs/tmux.nix
index 259a204..524b307 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 3319c91..67b557d 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 209b758..4e24098 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 4ac4a0d..4b92dc0 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 4083353..a79c0dd 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 4ffc081..0000000
--- 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);
-
- };
-}