aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-02-24 21:45:28 +0100
committerAdrian Kummerlaender2019-02-24 21:45:28 +0100
commit52b136997fbe7243f508522bf0239932be80deb8 (patch)
tree9190e7c504d714f02c845b7256da71d81e97523a
parent224ac2ea3e7585bc732397b9bf39a8e0fd24fbc3 (diff)
downloadnixos_home-52b136997fbe7243f508522bf0239932be80deb8.tar
nixos_home-52b136997fbe7243f508522bf0239932be80deb8.tar.gz
nixos_home-52b136997fbe7243f508522bf0239932be80deb8.tar.bz2
nixos_home-52b136997fbe7243f508522bf0239932be80deb8.tar.lz
nixos_home-52b136997fbe7243f508522bf0239932be80deb8.tar.xz
nixos_home-52b136997fbe7243f508522bf0239932be80deb8.tar.zst
nixos_home-52b136997fbe7243f508522bf0239932be80deb8.zip
Move Tasker into module folder
-rw-r--r--gui/default.nix6
-rw-r--r--gui/pkgs/tasker.nix55
-rw-r--r--home.nix5
-rw-r--r--module/tasker.nix59
4 files changed, 62 insertions, 63 deletions
diff --git a/gui/default.nix b/gui/default.nix
index 93cf8c3..baf68bb 100644
--- a/gui/default.nix
+++ b/gui/default.nix
@@ -25,10 +25,4 @@ in {
Xft.antialias: 1
Xft.rgba: rgb
'';
-
-# desktop shortcuts for project specific tasks
- home.packages = pkgs.callPackage ./pkgs/tasker.nix {
- inherit pkgs;
- tasks = config.custom.tasks;
- };
}
diff --git a/gui/pkgs/tasker.nix b/gui/pkgs/tasker.nix
deleted file mode 100644
index 6bad2d6..0000000
--- a/gui/pkgs/tasker.nix
+++ /dev/null
@@ -1,55 +0,0 @@
-{ pkgs, tasks, ... }:
-
-pkgs.lib.mapAttrsToList (name: conf: let
-
- command = pkgs.writeTextFile {
- name = "tasker_cmd_" + name;
- executable = true;
- destination = "/bin/tasker_cmd_" + name;
- text = pkgs.lib.attrByPath [ conf.type ] "" {
- launcher = ''
- #!/bin/sh
- pushd ${conf.directory}
- exec ${conf.command}
- popd
- '';
- terminal = ''
- #!/bin/sh
- exec ${pkgs.kitty}/bin/kitty -d ${conf.directory} ${conf.command}
- '';
- local-shell = ''
- #!/bin/sh
- exec ${pkgs.kitty}/bin/kitty -d ${conf.directory} nix-shell --command fish
- '';
- local-editor = ''
- #!/bin/sh
- pushd ${conf.directory}
- exec nix-shell --run 'nvim-qt --no-ext-tabline'
- popd
- '';
- environment = ''
- #!/bin/sh
- exec ${pkgs.kitty}/bin/kitty -d ${conf.directory} nix-shell \
- ${builtins.unsafeDiscardStringContext conf.environment.drvPath} --command fish
- '';
- };
- };
-
- shortcut = pkgs.writeTextFile {
- name = "tasker_shortcut_" + name;
- executable = false;
- destination = "/share/applications/tasker_shortcut_" + name + ".desktop";
- text = ''
- [Desktop Entry]
- Type=Application
- Name=${conf.description}
- GenericName=Tasker
- Exec=${command}/bin/tasker_cmd_${name}
- Terminal=false
- '';
- };
-
-in pkgs.symlinkJoin {
- name = "tasker_task_" + name;
- paths = [ shortcut ];
-}) tasks
diff --git a/home.nix b/home.nix
index d0dbb69..88f6dba 100644
--- a/home.nix
+++ b/home.nix
@@ -1,4 +1,4 @@
-{ pkgs, ... }:
+{ pkgs, config, ... }:
{
programs.home-manager = {
@@ -11,7 +11,8 @@
./custom.nix
# load host specific stuff
./host/current.nix
- # task shortcuts common to all setups
+ # task shortcuts
+ ./module/tasker.nix
./tasks/default.nix
];
diff --git a/module/tasker.nix b/module/tasker.nix
new file mode 100644
index 0000000..8b51d94
--- /dev/null
+++ b/module/tasker.nix
@@ -0,0 +1,59 @@
+{ pkgs, config, ... }:
+
+let
+ taskivations = pkgs.lib.mapAttrsToList (name: conf: let
+ command = pkgs.writeTextFile {
+ name = "tasker_cmd_" + name;
+ executable = true;
+ destination = "/bin/tasker_cmd_" + name;
+ text = pkgs.lib.attrByPath [ conf.type ] "" {
+ launcher = ''
+ #!/bin/sh
+ pushd ${conf.directory}
+ exec ${conf.command}
+ popd
+ '';
+ terminal = ''
+ #!/bin/sh
+ exec ${pkgs.kitty}/bin/kitty -d ${conf.directory} ${conf.command}
+ '';
+ local-shell = ''
+ #!/bin/sh
+ exec ${pkgs.kitty}/bin/kitty -d ${conf.directory} nix-shell --command fish
+ '';
+ local-editor = ''
+ #!/bin/sh
+ pushd ${conf.directory}
+ exec nix-shell --run 'nvim-qt --no-ext-tabline'
+ popd
+ '';
+ environment = ''
+ #!/bin/sh
+ exec ${pkgs.kitty}/bin/kitty -d ${conf.directory} nix-shell \
+ ${builtins.unsafeDiscardStringContext conf.environment.drvPath} --command fish
+ '';
+ };
+ };
+
+ shortcut = pkgs.writeTextFile {
+ name = "tasker_shortcut_" + name;
+ executable = false;
+ destination = "/share/applications/tasker_shortcut_" + name + ".desktop";
+ text = ''
+ [Desktop Entry]
+ Type=Application
+ Name=${conf.description}
+ GenericName=Tasker
+ Exec=${command}/bin/tasker_cmd_${name}
+ Terminal=false
+ '';
+ };
+
+ in pkgs.symlinkJoin {
+ name = "tasker_task_" + name;
+ paths = [ shortcut ];
+ }) config.custom.tasks;
+
+in {
+ home.packages = taskivations;
+}