workhorse done and nixpkgs-fmt
This commit is contained in:
parent
87be340dfa
commit
fc33e57a54
124 changed files with 3142 additions and 2590 deletions
|
@ -45,92 +45,104 @@ let
|
|||
backupFile = "${homeBackup}.tar.lzma";
|
||||
rolloutFile = "${home}.tar.lzma";
|
||||
lockFile = "${home}-lock";
|
||||
in pkgs.writeShellScriptBin "${name}-clean" # sh
|
||||
''
|
||||
sudo killall -9 -u ${name}
|
||||
sudo rm -f ${lockFile}
|
||||
sudo rm -rf ${home}
|
||||
'';
|
||||
in
|
||||
pkgs.writeShellScriptBin "${name}-clean" # sh
|
||||
''
|
||||
sudo killall -9 -u ${name}
|
||||
sudo rm -f ${lockFile}
|
||||
sudo rm -rf ${home}
|
||||
'';
|
||||
|
||||
createBrowser = name: user: browser: home: homeBackup:
|
||||
let
|
||||
backupFile = "${homeBackup}.tar.lzma";
|
||||
rolloutFile = "${home}.tar.lzma";
|
||||
lockFile = "${home}-lock";
|
||||
in pkgs.writeShellScriptBin "${name}" # sh
|
||||
''
|
||||
# set -x
|
||||
if [[ ! -e ${lockFile} ]]
|
||||
then
|
||||
# rollout backup
|
||||
if [[ -e ${backupFile} ]]
|
||||
then
|
||||
if [[ ! -d ${home} ]]
|
||||
then
|
||||
# todo : use make user
|
||||
sudo mkdir -p ${home}
|
||||
sudo chown -R ${user}:users ${home}
|
||||
fi
|
||||
cp ${backupFile} ${rolloutFile}
|
||||
sudo -u ${user} ${tarBin} xf ${rolloutFile} --directory ${home}
|
||||
rm ${rolloutFile}
|
||||
touch ${lockFile}
|
||||
fi
|
||||
fi
|
||||
in
|
||||
pkgs.writeShellScriptBin "${name}" # sh
|
||||
''
|
||||
# set -x
|
||||
if [[ ! -e ${lockFile} ]]
|
||||
then
|
||||
# rollout backup
|
||||
if [[ -e ${backupFile} ]]
|
||||
then
|
||||
if [[ ! -d ${home} ]]
|
||||
then
|
||||
# todo : use make user
|
||||
sudo mkdir -p ${home}
|
||||
sudo chown -R ${user}:users ${home}
|
||||
fi
|
||||
cp ${backupFile} ${rolloutFile}
|
||||
sudo -u ${user} ${tarBin} xf ${rolloutFile} --directory ${home}
|
||||
rm ${rolloutFile}
|
||||
touch ${lockFile}
|
||||
fi
|
||||
fi
|
||||
|
||||
sudo -u ${user} ${browser}
|
||||
'';
|
||||
sudo -u ${user} ${browser}
|
||||
'';
|
||||
|
||||
browserExecutableList = let
|
||||
allBrowser = flip mapAttrsToList cfg.configList (name: config:
|
||||
let
|
||||
browser = if config.browserType == "chrome" then
|
||||
''${chromiumBin} "$@"''
|
||||
else if config.browserType == "google" then
|
||||
''${chromeBin} "$@"''
|
||||
else
|
||||
''${firefoxBin} "$@"'';
|
||||
in createBrowser name config.user browser config.home config.homeBackup);
|
||||
xclipBrowser = [
|
||||
(pkgs.writeShellScriptBin "copy-to-xclip" # sh
|
||||
''
|
||||
echo "$*" | ${pkgs.xclip}/bin/xclip
|
||||
'')
|
||||
];
|
||||
in allBrowser ++ xclipBrowser;
|
||||
browserExecutableList =
|
||||
let
|
||||
allBrowser = flip mapAttrsToList cfg.configList (name: config:
|
||||
let
|
||||
browser =
|
||||
if config.browserType == "chrome" then
|
||||
''${chromiumBin} "$@"''
|
||||
else if config.browserType == "google" then
|
||||
''${chromeBin} "$@"''
|
||||
else
|
||||
''${firefoxBin} "$@"'';
|
||||
in
|
||||
createBrowser name config.user browser config.home config.homeBackup);
|
||||
xclipBrowser = [
|
||||
(pkgs.writeShellScriptBin "copy-to-xclip" # sh
|
||||
''
|
||||
echo "$*" | ${pkgs.xclip}/bin/xclip
|
||||
'')
|
||||
];
|
||||
in
|
||||
allBrowser ++ xclipBrowser;
|
||||
|
||||
createBackupScript = name: home: backupHome:
|
||||
pkgs.writeShellScriptBin "${name}-backup" # sh
|
||||
''
|
||||
sudo -u ${name} \
|
||||
${tarBin} \
|
||||
--exclude=.cache \
|
||||
--exclude=Downloads \
|
||||
--create \
|
||||
--verbos \
|
||||
--lzma \
|
||||
--file ${home}.tar.lzma \
|
||||
--directory ${home} \
|
||||
.
|
||||
''
|
||||
sudo -u ${name} \
|
||||
${tarBin} \
|
||||
--exclude=.cache \
|
||||
--exclude=Downloads \
|
||||
--create \
|
||||
--verbos \
|
||||
--lzma \
|
||||
--file ${home}.tar.lzma \
|
||||
--directory ${home} \
|
||||
.
|
||||
|
||||
cp ${home}.tar.lzma ${backupHome}.tar.lzma
|
||||
'';
|
||||
cp ${home}.tar.lzma ${backupHome}.tar.lzma
|
||||
'';
|
||||
|
||||
allBackupScripts = let
|
||||
filteredConfigs =
|
||||
filterAttrs (name: browserConfig: browserConfig.homeBackup != null)
|
||||
cfg.configList;
|
||||
in mapAttrsToList (name: browserConfig:
|
||||
createBackupScript name browserConfig.home browserConfig.homeBackup)
|
||||
filteredConfigs;
|
||||
allBackupScripts =
|
||||
let
|
||||
filteredConfigs =
|
||||
filterAttrs (name: browserConfig: browserConfig.homeBackup != null)
|
||||
cfg.configList;
|
||||
in
|
||||
mapAttrsToList
|
||||
(name: browserConfig:
|
||||
createBackupScript name browserConfig.home browserConfig.homeBackup)
|
||||
filteredConfigs;
|
||||
|
||||
allCleanScripts = let
|
||||
filteredConfigs =
|
||||
filterAttrs (name: browserConfig: browserConfig.homeBackup != null)
|
||||
cfg.configList;
|
||||
in mapAttrsToList (name: browserConfig:
|
||||
cleanBrowser name name browserConfig.home browserConfig.homeBackup)
|
||||
filteredConfigs;
|
||||
allCleanScripts =
|
||||
let
|
||||
filteredConfigs =
|
||||
filterAttrs (name: browserConfig: browserConfig.homeBackup != null)
|
||||
cfg.configList;
|
||||
in
|
||||
mapAttrsToList
|
||||
(name: browserConfig:
|
||||
cleanBrowser name name browserConfig.home browserConfig.homeBackup)
|
||||
filteredConfigs;
|
||||
|
||||
allKillScripts = mapAttrsToList (name: _: killBrowser name) cfg.configList;
|
||||
|
||||
|
@ -153,7 +165,8 @@ let
|
|||
$BIN "$@"
|
||||
'';
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.browser = {
|
||||
enable = mkEnableOption "enable browsers";
|
||||
|
@ -214,18 +227,22 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
|
||||
# add sudo rights
|
||||
security.sudo.extraConfig = let
|
||||
extraRules = flip mapAttrsToList cfg.configList (name: values:
|
||||
concatStringsSep "" (map (sudoUser: ''
|
||||
# sudo configuration to control browser
|
||||
${sudoUser} ALL=(${values.user}) NOPASSWD: ALL
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/mkdir -p ${values.home}
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/chown -R ${values.user}\:users ${values.home}
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/killall -9 -u ${name}
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/rm -rf ${values.home}
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/rm -f ${values.home}-lock
|
||||
'') values.sudoUsers));
|
||||
in lib.concatStringsSep "\n" extraRules;
|
||||
security.sudo.extraConfig =
|
||||
let
|
||||
extraRules = flip mapAttrsToList cfg.configList (name: values:
|
||||
concatStringsSep "" (map
|
||||
(sudoUser: ''
|
||||
# sudo configuration to control browser
|
||||
${sudoUser} ALL=(${values.user}) NOPASSWD: ALL
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/mkdir -p ${values.home}
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/chown -R ${values.user}\:users ${values.home}
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/killall -9 -u ${name}
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/rm -rf ${values.home}
|
||||
${sudoUser} ALL=(root) NOPASSWD: /run/current-system/sw/bin/rm -f ${values.home}-lock
|
||||
'')
|
||||
values.sudoUsers));
|
||||
in
|
||||
lib.concatStringsSep "\n" extraRules;
|
||||
|
||||
# create users
|
||||
users.users = flip mapAttrs cfg.configList (name: config: {
|
||||
|
|
|
@ -19,7 +19,8 @@ let
|
|||
scriptAxel = citateScript (toString ../../assets/sprueche-axel) "axel";
|
||||
scriptSiw = citateScript (toString ../../assets/sprueche-siw) "siw";
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.citate = {
|
||||
enable = mkEnableOption "enable programs.custom.citate";
|
||||
|
|
|
@ -18,7 +18,8 @@ let
|
|||
|
||||
cfg = config.programs.custom.curlScripts;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.curlScripts.enable =
|
||||
mkEnableOption "enable curl scripts";
|
||||
|
|
|
@ -6,7 +6,8 @@ let
|
|||
|
||||
cfg = config.programs.custom.easytag;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.easytag.enable =
|
||||
mkEnableOption "install easytag with dependencies";
|
||||
|
|
|
@ -6,7 +6,8 @@ let
|
|||
|
||||
cfg = config.programs.custom.elm;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.elm.enable = mkEnableOption "enable elm stack";
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@ let
|
|||
|
||||
cfg = config.programs.custom.espeak;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.espeak.enable =
|
||||
mkEnableOption "enable espeak scripts";
|
||||
|
|
|
@ -5,8 +5,13 @@ let
|
|||
cfg = config.programs.custom.ffmpeg;
|
||||
|
||||
ffmpegTemplate = name:
|
||||
{ profile, preset, tune ? null, width ? 1280, height ? 720
|
||||
, resolution ? "720p" }:
|
||||
{ profile
|
||||
, preset
|
||||
, tune ? null
|
||||
, width ? 1280
|
||||
, height ? 720
|
||||
, resolution ? "720p"
|
||||
}:
|
||||
pkgs.writeShellScriptBin "ffmpeg-${name}" ''
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
|
@ -99,48 +104,53 @@ let
|
|||
];
|
||||
tunes = [ "film" "animation" "grain" "stillimage" "fastdecode" ];
|
||||
|
||||
ffmpegs = let
|
||||
ffmpegs =
|
||||
let
|
||||
|
||||
configurations = lib.cartesianProductOfSets {
|
||||
profile = profiles;
|
||||
preset = presets;
|
||||
};
|
||||
|
||||
p720 = { profile, preset }:
|
||||
ffmpegTemplate "${profile}-${preset}-720p" { inherit profile preset; };
|
||||
|
||||
p1080 = { profile, preset }:
|
||||
ffmpegTemplate "${profile}-${preset}-1080p" {
|
||||
inherit profile preset;
|
||||
height = 1080;
|
||||
width = 1920;
|
||||
resolution = "1080p";
|
||||
};
|
||||
in (map p720 configurations) ++ (map p1080 configurations);
|
||||
|
||||
ffmpegsTune = let
|
||||
configurations = lib.cartesianProductOfSets {
|
||||
profile = profiles;
|
||||
preset = presets;
|
||||
tune = tunes;
|
||||
};
|
||||
|
||||
p720 = { profile, preset, tune }:
|
||||
ffmpegTemplate "${profile}-${preset}-${tune}-720p" {
|
||||
inherit profile preset tune;
|
||||
configurations = lib.cartesianProductOfSets {
|
||||
profile = profiles;
|
||||
preset = presets;
|
||||
};
|
||||
|
||||
p1080 = { profile, preset, tune }:
|
||||
ffmpegTemplate "${profile}-${preset}-${tune}-1080p" {
|
||||
inherit profile preset tune;
|
||||
height = 1080;
|
||||
width = 1920;
|
||||
resolution = "1080p";
|
||||
p720 = { profile, preset }:
|
||||
ffmpegTemplate "${profile}-${preset}-720p" { inherit profile preset; };
|
||||
|
||||
p1080 = { profile, preset }:
|
||||
ffmpegTemplate "${profile}-${preset}-1080p" {
|
||||
inherit profile preset;
|
||||
height = 1080;
|
||||
width = 1920;
|
||||
resolution = "1080p";
|
||||
};
|
||||
in
|
||||
(map p720 configurations) ++ (map p1080 configurations);
|
||||
|
||||
ffmpegsTune =
|
||||
let
|
||||
configurations = lib.cartesianProductOfSets {
|
||||
profile = profiles;
|
||||
preset = presets;
|
||||
tune = tunes;
|
||||
};
|
||||
|
||||
in (map p720 configurations) ++ (map p1080 configurations);
|
||||
p720 = { profile, preset, tune }:
|
||||
ffmpegTemplate "${profile}-${preset}-${tune}-720p" {
|
||||
inherit profile preset tune;
|
||||
};
|
||||
|
||||
in {
|
||||
p1080 = { profile, preset, tune }:
|
||||
ffmpegTemplate "${profile}-${preset}-${tune}-1080p" {
|
||||
inherit profile preset tune;
|
||||
height = 1080;
|
||||
width = 1920;
|
||||
resolution = "1080p";
|
||||
};
|
||||
|
||||
in
|
||||
(map p720 configurations) ++ (map p1080 configurations);
|
||||
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.ffmpeg = {
|
||||
enable = mkEnableOption "enable programs.custom.ffmpeg";
|
||||
|
|
|
@ -6,7 +6,8 @@ let
|
|||
|
||||
cfg = config.programs.custom.git;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.git.enable =
|
||||
mkEnableOption "install git and all its tools";
|
||||
|
|
|
@ -29,7 +29,8 @@ let
|
|||
|
||||
cfg = config.programs.custom.shellTools;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.shellTools.enable =
|
||||
mkEnableOption "enable shell tools";
|
||||
|
|
|
@ -6,7 +6,8 @@ let
|
|||
|
||||
cfg = config.programs.custom.zsh;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.zsh = {
|
||||
enable = mkEnableOption "enable zsh";
|
||||
|
|
|
@ -14,47 +14,51 @@ let
|
|||
# ---------------------------
|
||||
command = "${pkgs.slack}/bin/slack";
|
||||
|
||||
desktopFile = let
|
||||
name = program;
|
||||
comment = "Chat Programm";
|
||||
in pkgs.writeTextFile {
|
||||
name = "${name}.desktop";
|
||||
destination = "/share/applications/${name}.desktop";
|
||||
text = ''
|
||||
[Desktop Entry]
|
||||
Categories=Application;Utility;
|
||||
Comment=${comment}
|
||||
Encoding=UTF-8
|
||||
Exec=${bin}/bin/${name}
|
||||
Icon=gnome-lockscreen
|
||||
Name=${name}
|
||||
Terminal=false
|
||||
Type=Application
|
||||
'';
|
||||
};
|
||||
desktopFile =
|
||||
let
|
||||
name = program;
|
||||
comment = "Chat Programm";
|
||||
in
|
||||
pkgs.writeTextFile {
|
||||
name = "${name}.desktop";
|
||||
destination = "/share/applications/${name}.desktop";
|
||||
text = ''
|
||||
[Desktop Entry]
|
||||
Categories=Application;Utility;
|
||||
Comment=${comment}
|
||||
Encoding=UTF-8
|
||||
Exec=${bin}/bin/${name}
|
||||
Icon=gnome-lockscreen
|
||||
Name=${name}
|
||||
Terminal=false
|
||||
Type=Application
|
||||
'';
|
||||
};
|
||||
|
||||
# the script
|
||||
# ----------
|
||||
bin = let
|
||||
backupFile = "${cfg.homeBackup}.tar.lzma";
|
||||
rolloutFile = "${cfg.home}.tar.lzma";
|
||||
lockFile = "${cfg.home}-lock";
|
||||
in pkgs.writeShellScriptBin "${program}" ''
|
||||
# set -x
|
||||
if [[ ! -e ${lockFile} ]]
|
||||
then
|
||||
# rollout backup
|
||||
if [[ -e ${backupFile} ]]
|
||||
bin =
|
||||
let
|
||||
backupFile = "${cfg.homeBackup}.tar.lzma";
|
||||
rolloutFile = "${cfg.home}.tar.lzma";
|
||||
lockFile = "${cfg.home}-lock";
|
||||
in
|
||||
pkgs.writeShellScriptBin "${program}" ''
|
||||
# set -x
|
||||
if [[ ! -e ${lockFile} ]]
|
||||
then
|
||||
cp ${backupFile} ${rolloutFile}
|
||||
sudo -u ${program} ${tarBin} xf ${rolloutFile} --directory ${cfg.home}
|
||||
rm ${rolloutFile}
|
||||
touch ${lockFile}
|
||||
# rollout backup
|
||||
if [[ -e ${backupFile} ]]
|
||||
then
|
||||
cp ${backupFile} ${rolloutFile}
|
||||
sudo -u ${program} ${tarBin} xf ${rolloutFile} --directory ${cfg.home}
|
||||
rm ${rolloutFile}
|
||||
touch ${lockFile}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
sudo -u ${program} ${command}
|
||||
'';
|
||||
sudo -u ${program} ${command}
|
||||
'';
|
||||
|
||||
backupScript = pkgs.writeShellScriptBin "${program}-backup" ''
|
||||
sudo -u ${program} \
|
||||
|
@ -75,7 +79,8 @@ let
|
|||
|
||||
cfg = config.programs.custom.slack;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.slack = {
|
||||
enable = mkEnableOption "install slack";
|
||||
|
|
|
@ -14,7 +14,8 @@ let
|
|||
|
||||
cfg = config.programs.custom.steam;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.steam.enable = mkEnableOption "enable steam";
|
||||
|
||||
|
|
|
@ -34,7 +34,8 @@ let
|
|||
});
|
||||
#vit = pkgs.vit;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.taskwarrior.enable =
|
||||
mkEnableOption "Enable Taskwarrior services";
|
||||
|
|
|
@ -6,7 +6,8 @@ let
|
|||
|
||||
cfg = config.programs.custom.urxvt;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.urxvt = {
|
||||
|
||||
|
@ -63,24 +64,26 @@ in {
|
|||
URxvt.fading: 0
|
||||
'';
|
||||
|
||||
"X11/Xresource.d/urxvt-font".source = let
|
||||
fontFamily = "terminus";
|
||||
normalFont = fontSize:
|
||||
"-*-${fontFamily}-medium-*-*-*-${toString fontSize}-*-*-*-*-*-*-*";
|
||||
boldFont = fontSize:
|
||||
"-*-${fontFamily}-bold-*-*-*-${toString fontSize}-*-*-*-*-*-*-*";
|
||||
italicFont = normalFont;
|
||||
itallicBoldFont = boldFont;
|
||||
backupFont = fontSize:
|
||||
"xft:TerminessTTF Nerd Font:pixelsize=${toString fontSize}";
|
||||
"X11/Xresource.d/urxvt-font".source =
|
||||
let
|
||||
fontFamily = "terminus";
|
||||
normalFont = fontSize:
|
||||
"-*-${fontFamily}-medium-*-*-*-${toString fontSize}-*-*-*-*-*-*-*";
|
||||
boldFont = fontSize:
|
||||
"-*-${fontFamily}-bold-*-*-*-${toString fontSize}-*-*-*-*-*-*-*";
|
||||
italicFont = normalFont;
|
||||
itallicBoldFont = boldFont;
|
||||
backupFont = fontSize:
|
||||
"xft:TerminessTTF Nerd Font:pixelsize=${toString fontSize}";
|
||||
|
||||
fontCommand = key: fontSize: ''
|
||||
URxvt.keysym.M-${key}: command:\033]710;${normalFont fontSize},${
|
||||
backupFont fontSize
|
||||
}\007\033]711;${boldFont fontSize},${backupFont fontSize}\007
|
||||
'';
|
||||
fontCommand = key: fontSize: ''
|
||||
URxvt.keysym.M-${key}: command:\033]710;${normalFont fontSize},${
|
||||
backupFont fontSize
|
||||
}\007\033]711;${boldFont fontSize},${backupFont fontSize}\007
|
||||
'';
|
||||
|
||||
in pkgs.writeText "Xresource-urxvt-font" ''
|
||||
in
|
||||
pkgs.writeText "Xresource-urxvt-font" ''
|
||||
|
||||
URxvt.allow_bold: true
|
||||
URxvt.xftAntialias: true
|
||||
|
@ -110,28 +113,31 @@ in {
|
|||
${fontCommand "F4" (cfg.fontSize + 20)}
|
||||
'';
|
||||
|
||||
"X11/Xresource.d/urxvt-colors".source = let
|
||||
colorTheme = if (cfg.colorTheme == "dark") then ''
|
||||
#define S_base03 #002b36
|
||||
#define S_base02 #073642
|
||||
#define S_base01 #586e75
|
||||
#define S_base00 #657b83
|
||||
#define S_base0 #839496
|
||||
#define S_base1 #93a1a1
|
||||
#define S_base2 #eee8d5
|
||||
#define S_base3 #fdf6e3
|
||||
'' else ''
|
||||
#define S_base03 #fdf6e3
|
||||
#define S_base02 #eee8d5
|
||||
#define S_base01 #93a1a1
|
||||
#define S_base00 #839496
|
||||
#define S_base0 #657b83
|
||||
#define S_base1 #586e75
|
||||
#define S_base2 #073642
|
||||
#define S_base3 #002b36
|
||||
'';
|
||||
"X11/Xresource.d/urxvt-colors".source =
|
||||
let
|
||||
colorTheme =
|
||||
if (cfg.colorTheme == "dark") then ''
|
||||
#define S_base03 #002b36
|
||||
#define S_base02 #073642
|
||||
#define S_base01 #586e75
|
||||
#define S_base00 #657b83
|
||||
#define S_base0 #839496
|
||||
#define S_base1 #93a1a1
|
||||
#define S_base2 #eee8d5
|
||||
#define S_base3 #fdf6e3
|
||||
'' else ''
|
||||
#define S_base03 #fdf6e3
|
||||
#define S_base02 #eee8d5
|
||||
#define S_base01 #93a1a1
|
||||
#define S_base00 #839496
|
||||
#define S_base0 #657b83
|
||||
#define S_base1 #586e75
|
||||
#define S_base2 #073642
|
||||
#define S_base3 #002b36
|
||||
'';
|
||||
|
||||
in pkgs.writeText "Xresource-urxvt-colors" ''
|
||||
in
|
||||
pkgs.writeText "Xresource-urxvt-colors" ''
|
||||
|
||||
!! Common
|
||||
!! ------
|
||||
|
|
|
@ -9,24 +9,27 @@ let
|
|||
# show keyboard input on desktop for screencasts
|
||||
screenKey = pkgs.symlinkJoin {
|
||||
name = "screen-keys";
|
||||
paths = let
|
||||
screenKeyScript = { position ? "bottom", size ? "small", ... }:
|
||||
pkgs.writeShellScriptBin "screenkeys-${position}-${size}" # sh
|
||||
''
|
||||
${pkgs.screenkey}/bin/screenkey \
|
||||
--no-detach \
|
||||
--bg-color '#fdf6e3' \
|
||||
--font-color '#073642' \
|
||||
-p ${position} \
|
||||
-s ${size} \
|
||||
"$@"
|
||||
'';
|
||||
in lib.flatten (lib.flip map [ "large" "small" "medium" ] (size:
|
||||
lib.flip map [ "top" "center" "bottom" ]
|
||||
(position: screenKeyScript { inherit size position; })));
|
||||
paths =
|
||||
let
|
||||
screenKeyScript = { position ? "bottom", size ? "small", ... }:
|
||||
pkgs.writeShellScriptBin "screenkeys-${position}-${size}" # sh
|
||||
''
|
||||
${pkgs.screenkey}/bin/screenkey \
|
||||
--no-detach \
|
||||
--bg-color '#fdf6e3' \
|
||||
--font-color '#073642' \
|
||||
-p ${position} \
|
||||
-s ${size} \
|
||||
"$@"
|
||||
'';
|
||||
in
|
||||
lib.flatten (lib.flip map [ "large" "small" "medium" ] (size:
|
||||
lib.flip map [ "top" "center" "bottom" ]
|
||||
(position: screenKeyScript { inherit size position; })));
|
||||
};
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.video.enable = mkEnableOption "enable video tools";
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ let
|
|||
|
||||
}).env
|
||||
|
||||
'';
|
||||
'';
|
||||
};
|
||||
|
||||
# active plugins
|
||||
|
@ -200,7 +200,8 @@ let
|
|||
|
||||
'';
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
# no options
|
||||
options.programs.custom.vim.enable = lib.mkEnableOption "vim";
|
||||
|
|
|
@ -6,7 +6,8 @@ let
|
|||
|
||||
cfg = config.programs.custom.xterm;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.programs.custom.xterm = {
|
||||
enable = mkEnableOption "configure and enable urxvt";
|
||||
|
@ -41,17 +42,19 @@ in {
|
|||
|
||||
'';
|
||||
|
||||
"X11/Xresource.d/xterm-font".source = let
|
||||
fontFamily = "terminus";
|
||||
normalFont = fontSize:
|
||||
"-*-${fontFamily}-medium-*-*-*-${toString fontSize}-*-*-*-*-*-*-*";
|
||||
boldFont = fontSize:
|
||||
"-*-${fontFamily}-bold-*-*-*-${toString fontSize}-*-*-*-*-*-*-*";
|
||||
italicFont = normalFont;
|
||||
itallicBoldFont = boldFont;
|
||||
backupFont = fontSize:
|
||||
"xft:TerminessTTF Nerd Font:pixelsize=${toString fontSize}";
|
||||
in pkgs.writeText "Xresource-xterm-font" ''
|
||||
"X11/Xresource.d/xterm-font".source =
|
||||
let
|
||||
fontFamily = "terminus";
|
||||
normalFont = fontSize:
|
||||
"-*-${fontFamily}-medium-*-*-*-${toString fontSize}-*-*-*-*-*-*-*";
|
||||
boldFont = fontSize:
|
||||
"-*-${fontFamily}-bold-*-*-*-${toString fontSize}-*-*-*-*-*-*-*";
|
||||
italicFont = normalFont;
|
||||
itallicBoldFont = boldFont;
|
||||
backupFont = fontSize:
|
||||
"xft:TerminessTTF Nerd Font:pixelsize=${toString fontSize}";
|
||||
in
|
||||
pkgs.writeText "Xresource-xterm-font" ''
|
||||
|
||||
XTerm.allow_bold: true
|
||||
XTerm.xftAntialias: true
|
||||
|
@ -76,29 +79,32 @@ in {
|
|||
XTerm.*.bolditalicFont: ${itallicBoldFont cfg.fontSize}
|
||||
'';
|
||||
|
||||
"X11/Xresource.d/xterm-colors".source = let
|
||||
colorTheme = if (cfg.colorTheme == "dark") then ''
|
||||
#define S_base03 #002b36
|
||||
#define S_base02 #073642
|
||||
#define S_base01 #586e75
|
||||
#define S_base00 #657b83
|
||||
#define S_base0 #839496
|
||||
#define S_base1 #93a1a1
|
||||
#define S_base2 #eee8d5
|
||||
#define S_base3 #fdf6e3
|
||||
"X11/Xresource.d/xterm-colors".source =
|
||||
let
|
||||
colorTheme =
|
||||
if (cfg.colorTheme == "dark") then ''
|
||||
#define S_base03 #002b36
|
||||
#define S_base02 #073642
|
||||
#define S_base01 #586e75
|
||||
#define S_base00 #657b83
|
||||
#define S_base0 #839496
|
||||
#define S_base1 #93a1a1
|
||||
#define S_base2 #eee8d5
|
||||
#define S_base3 #fdf6e3
|
||||
|
||||
'' else ''
|
||||
#define S_base03 #fdf6e3
|
||||
#define S_base02 #eee8d5
|
||||
#define S_base01 #93a1a1
|
||||
#define S_base00 #839496
|
||||
#define S_base0 #657b83
|
||||
#define S_base1 #586e75
|
||||
#define S_base2 #073642
|
||||
#define S_base3 #002b36
|
||||
'';
|
||||
'' else ''
|
||||
#define S_base03 #fdf6e3
|
||||
#define S_base02 #eee8d5
|
||||
#define S_base01 #93a1a1
|
||||
#define S_base00 #839496
|
||||
#define S_base0 #657b83
|
||||
#define S_base1 #586e75
|
||||
#define S_base2 #073642
|
||||
#define S_base3 #002b36
|
||||
'';
|
||||
|
||||
in pkgs.writeText "Xresource-xterm-colors" ''
|
||||
in
|
||||
pkgs.writeText "Xresource-xterm-colors" ''
|
||||
|
||||
!! Color Configuration
|
||||
!! -------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue