summaryrefslogtreecommitdiffstats
path: root/makefu/3modules
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/3modules')
-rw-r--r--makefu/3modules/awesome-extra.nix9
-rw-r--r--makefu/3modules/default.nix1
-rw-r--r--makefu/3modules/sane-extra.nix45
3 files changed, 53 insertions, 2 deletions
diff --git a/makefu/3modules/awesome-extra.nix b/makefu/3modules/awesome-extra.nix
index 81c42cba7..0561c15a8 100644
--- a/makefu/3modules/awesome-extra.nix
+++ b/makefu/3modules/awesome-extra.nix
@@ -28,10 +28,15 @@ let
# TODO: configure display manager as well
nixpkgs.config.packageOverrides = pkgs: rec {
awesome = pkgs.stdenv.lib.overrideDerivation pkgs.awesome (oldAttrs : {
- postFixup = let
+ postFixup = let
rclua = pkgs.substituteAll {
src = cfg.baseConfig;
- inherit (cfg) modkey;
+ modkey = cfg.modkey;
+ # inherit (cfg) modkey;
+ amixer = "${pkgs.alsaUtils}/bin/amixer";
+ xlock = "${pkgs.xlockmore}/bin/xlock";
+ xbacklight = "${pkgs.xorg.xbacklight}/bin/xbacklight";
+
};
in "cp ${rclua} $out/etc/xdg/awesome/rc.lua";
});
diff --git a/makefu/3modules/default.nix b/makefu/3modules/default.nix
index 2981e0fa3..00df56bee 100644
--- a/makefu/3modules/default.nix
+++ b/makefu/3modules/default.nix
@@ -9,6 +9,7 @@ _:
./opentracker.nix
./ps3netsrv.nix
./logging-config.nix
+ ./sane-extra.nix
./server-config.nix
./snapraid.nix
./torrent.nix
diff --git a/makefu/3modules/sane-extra.nix b/makefu/3modules/sane-extra.nix
new file mode 100644
index 000000000..2e0ce8f2f
--- /dev/null
+++ b/makefu/3modules/sane-extra.nix
@@ -0,0 +1,45 @@
+{ config, lib, pkgs, ... }:
+# https://github.com/michalrus/dotfiles/blob/d943be3089aa436e07cea5f22d829402936a9229/.nixos-config.symlink/modules/sane-extra-config.nix
+# via https://github.com/NixOS/nixpkgs/issues/17411
+# via https://unix.stackexchange.com/questions/321954/install-epson-v39-on-nixos
+with lib;
+
+let
+
+ cfg = config.hardware.sane;
+
+ pkg = if cfg.snapshot
+ then pkgs.sane-backends-git
+ else pkgs.sane-backends;
+
+ backends = [ pkg ] ++ cfg.extraBackends;
+
+ saneConfig = pkgs.mkSaneConfig { paths = backends; };
+
+ saneExtraConfig = pkgs.runCommand "sane-extra-config" {} ''
+ cp -Lr '${pkgs.mkSaneConfig { paths = [ pkgs.sane-backends ]; }}'/etc/sane.d $out
+ chmod +w $out
+ ${concatMapStrings (c: ''
+ f="$out/${c.name}.conf"
+ [ ! -e "$f" ] || chmod +w "$f"
+ cat ${builtins.toFile "" (c.value + "\n")} >>"$f"
+ chmod -w "$f"
+ '') (mapAttrsToList nameValuePair cfg.extraConfig)}
+ chmod -w $out
+ '';
+
+in
+
+{
+ options = {
+ hardware.sane.extraConfig = mkOption {
+ type = types.attrsOf types.lines;
+ default = {};
+ example = { "some-backend" = "# some lines to add to its .conf"; };
+ };
+ };
+
+ config = mkIf (cfg.enable && cfg.extraConfig != {}) {
+ hardware.sane.configDir = saneExtraConfig.outPath;
+ };
+}