aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-02-22 20:34:18 +0100
committerAdrian Kummerlaender2019-02-22 20:34:18 +0100
commit4bda7bcd1eb2410ff7466fd4da2b5345ece6763f (patch)
tree167e374e350978c175747de0b7b522dc27543ae1
parent0b2cde8591776d58333b07062748606d91a9f1db (diff)
downloadnixos_home-4bda7bcd1eb2410ff7466fd4da2b5345ece6763f.tar
nixos_home-4bda7bcd1eb2410ff7466fd4da2b5345ece6763f.tar.gz
nixos_home-4bda7bcd1eb2410ff7466fd4da2b5345ece6763f.tar.bz2
nixos_home-4bda7bcd1eb2410ff7466fd4da2b5345ece6763f.tar.lz
nixos_home-4bda7bcd1eb2410ff7466fd4da2b5345ece6763f.tar.xz
nixos_home-4bda7bcd1eb2410ff7466fd4da2b5345ece6763f.tar.zst
nixos_home-4bda7bcd1eb2410ff7466fd4da2b5345ece6763f.zip
Declare tasks as attribute option
This way it is easy to support e.g. host specific tasks
-rw-r--r--custom.nix12
-rw-r--r--gui/default.nix9
-rw-r--r--home.nix4
-rw-r--r--tasks/default.nix (renamed from gui/tasker.nix)8
4 files changed, 23 insertions, 10 deletions
diff --git a/custom.nix b/custom.nix
index 266a37e..acc8f0e 100644
--- a/custom.nix
+++ b/custom.nix
@@ -1,8 +1,14 @@
{ pkgs, ... }:
{
- options.custom.hidpi = pkgs.lib.mkOption {
- type = pkgs.lib.types.bool;
- description = "Configure UI for high DPI displays";
+ options.custom = {
+ hidpi = pkgs.lib.mkOption {
+ type = pkgs.lib.types.bool;
+ description = "Configure UI for high DPI displays";
+ };
+
+ tasks = pkgs.lib.mkOption {
+ type = pkgs.lib.types.attrs;
+ };
};
}
diff --git a/gui/default.nix b/gui/default.nix
index 6948139..93cf8c3 100644
--- a/gui/default.nix
+++ b/gui/default.nix
@@ -9,14 +9,13 @@ in {
./kitty.nix
./vim.nix
./zathura.nix
- # desktop shortcuts for project specific tasks
- ./tasker.nix
# applications grouped by purpose
./apps/file.nix
./apps/web.nix
./apps/dev.nix
];
+# hidpi specific xorg flags
xresources.extraConfig = pkgs.lib.mkIf hidpi ''
Xft.dpi: 160
Xft.autohint: 0
@@ -26,4 +25,10 @@ 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/home.nix b/home.nix
index 3cc427d..d0dbb69 100644
--- a/home.nix
+++ b/home.nix
@@ -7,8 +7,12 @@
};
imports = [
+ # define options custom to this config
./custom.nix
+ # load host specific stuff
./host/current.nix
+ # task shortcuts common to all setups
+ ./tasks/default.nix
];
home = {
diff --git a/gui/tasker.nix b/tasks/default.nix
index e7092ba..9fbee61 100644
--- a/gui/tasker.nix
+++ b/tasks/default.nix
@@ -1,7 +1,7 @@
-{ pkgs, ... }:
+{ ... }:
-let
- tasks = {
+{
+ custom.tasks = {
"bsc_edit" = {
description = "Grid refinement BSc thesis editor";
directory = "~/university/documents/bachelor/arbeit";
@@ -33,6 +33,4 @@ let
command = "nix-shell --command fish";
};
};
-in {
- home.packages = pkgs.callPackage ./pkgs/tasker.nix { inherit pkgs; inherit tasks; };
}