Completely reformat to satisfy nixfmt
This commit is contained in:
@@ -15,16 +15,18 @@
|
||||
|
||||
matchBlocks =
|
||||
let
|
||||
nas = { user = "admin"; };
|
||||
owned = { user = "greg"; };
|
||||
nas = {
|
||||
user = "admin";
|
||||
};
|
||||
owned = {
|
||||
user = "greg";
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit nas;
|
||||
|
||||
"*" = {
|
||||
dynamicForwards = [{
|
||||
port = 10240;
|
||||
}];
|
||||
dynamicForwards = [ { port = 10240; } ];
|
||||
};
|
||||
|
||||
"10.42.1.4" = lib.hm.dag.entryBefore [ "10.42.*" ] nas;
|
||||
@@ -33,7 +35,10 @@
|
||||
chronicles = nas;
|
||||
"chronicles.thehellings.lan" = lib.hm.dag.entryBefore [ "*.thehellings.lan" ] nas;
|
||||
|
||||
gh = { user = "git"; hostname = "github.com"; };
|
||||
gh = {
|
||||
user = "git";
|
||||
hostname = "github.com";
|
||||
};
|
||||
"src" = {
|
||||
user = "gitlab";
|
||||
hostname = "git.thehellings.lan";
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# The Hack font is used in the Fugitive sidebars
|
||||
fonts.fontconfig.enable = true;
|
||||
home.packages = [ (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) ];
|
||||
|
||||
programs.nixvim = (import ./vim/config.nix { inherit config pkgs lib; }) // { enable = true; };
|
||||
programs.nixvim = (import ./vim/config.nix { inherit config pkgs lib; }) // {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -67,9 +67,11 @@
|
||||
};
|
||||
|
||||
configHeader = builtins.readFile ./xonsh_header.xsh;
|
||||
configFooter = (builtins.readFile ./xonsh_footer.xsh) + (builtins.concatStringsSep "\n" [
|
||||
"with open('${pkgs.stdenv.cc}/nix-support/dynamic-linker', 'r') as fp:"
|
||||
" $NIX_LD = fp.read().strip()"
|
||||
]);
|
||||
configFooter =
|
||||
(builtins.readFile ./xonsh_footer.xsh)
|
||||
+ (builtins.concatStringsSep "\n" [
|
||||
"with open('${pkgs.stdenv.cc}/nix-support/dynamic-linker', 'r') as fp:"
|
||||
" $NIX_LD = fp.read().strip()"
|
||||
]);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
packages = with pkgs; [
|
||||
bruno # but let's not talk about it
|
||||
@@ -16,10 +21,9 @@ let
|
||||
zed-editor
|
||||
];
|
||||
in
|
||||
with lib; {
|
||||
with lib;
|
||||
{
|
||||
options.greg.development = mkEnableOption "Setup necessary development packages";
|
||||
|
||||
config = mkIf config.greg.development {
|
||||
home.packages = packages;
|
||||
};
|
||||
config = mkIf config.greg.development { home.packages = packages; };
|
||||
}
|
||||
|
||||
+122
-109
@@ -1,4 +1,9 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.greg.gnome;
|
||||
@@ -6,115 +11,123 @@ in
|
||||
{
|
||||
options.greg.gnome = lib.mkEnableOption "Enable Gnome support and settings";
|
||||
|
||||
config = (lib.mkIf cfg {
|
||||
programs.gnome-terminal = lib.mkIf (pkgs.system != "x86_64-darwin") {
|
||||
enable = true;
|
||||
showMenubar = true;
|
||||
themeVariant = "dark";
|
||||
profile."95f3c68e-82f3-4f44-ac85-6e075fed80b0" = {
|
||||
default = true;
|
||||
customCommand = "xonsh -st best";
|
||||
loginShell = true;
|
||||
scrollbackLines = 65535;
|
||||
transparencyPercent = 50;
|
||||
visibleName = "greg";
|
||||
config = (
|
||||
lib.mkIf cfg {
|
||||
programs.gnome-terminal = lib.mkIf (pkgs.system != "x86_64-darwin") {
|
||||
enable = true;
|
||||
showMenubar = true;
|
||||
themeVariant = "dark";
|
||||
profile."95f3c68e-82f3-4f44-ac85-6e075fed80b0" = {
|
||||
default = true;
|
||||
customCommand = "xonsh -st best";
|
||||
loginShell = true;
|
||||
scrollbackLines = 65535;
|
||||
transparencyPercent = 50;
|
||||
visibleName = "greg";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dconf.settings = {
|
||||
"org/gnome/Disks" = {
|
||||
image-dir-uri = "file:///home/greg/Downloads";
|
||||
dconf.settings = {
|
||||
"org/gnome/Disks" = {
|
||||
image-dir-uri = "file:///home/greg/Downloads";
|
||||
};
|
||||
"org/gnome/desktop/interface" = {
|
||||
clock-show-weekday = true;
|
||||
color-scheme = "default";
|
||||
cursor-size = 24;
|
||||
toolbar-style = "text";
|
||||
};
|
||||
"org/gnome/desktop/screensaver" = {
|
||||
lock-delay = "uint32 0";
|
||||
lock-enabled = false;
|
||||
};
|
||||
"org/gnome/desktop/wm/keybindings" = {
|
||||
switch-applications = [ ];
|
||||
switch-applications-backward = [ ];
|
||||
switch-windows = [ "<Alt>Tab" ];
|
||||
switch-windows-backward = [ "<Shift><Alt>Tab" ];
|
||||
};
|
||||
"org/gnome/desktop/wm/preferences" = {
|
||||
button-layout = "icon:minimize,maximize,close";
|
||||
};
|
||||
"org/gnome/file-roller/listing" = {
|
||||
list-mode = "as-folder";
|
||||
name-coloumn-width = 302;
|
||||
show-path = true;
|
||||
sort-method = "name";
|
||||
sort-type = "ascending";
|
||||
};
|
||||
"org/gnome/nautilus/preferences" = {
|
||||
default-folder-viewer = "icon-view";
|
||||
search-filter-time-type = "last_modified";
|
||||
search-view = "list-view";
|
||||
};
|
||||
"org/gnome/shell" = {
|
||||
enabled-extensions = [
|
||||
"appindicatorsupport@rgcjonas.gmail.com"
|
||||
"Vitals@CoreCoding.com"
|
||||
"window-list@gnome-shell-extensions.gcampax.github.com"
|
||||
"gsconnect@andyholmes.github.io"
|
||||
];
|
||||
favorite-apps = [
|
||||
"org.gnome.Calendar.desktop"
|
||||
"org.gnome.Nautilus.desktop"
|
||||
"org.gnome.Terminal.desktop"
|
||||
"firefox.desktop"
|
||||
"vlc.desktop"
|
||||
];
|
||||
remember-mount-password = true;
|
||||
};
|
||||
"org/gnome/shell/extensions/vitals" = {
|
||||
hot-sensors = [
|
||||
"_memory_usage_"
|
||||
"_system_load_1m_"
|
||||
"__network-rx_max__"
|
||||
"_temperature_k10temp_tccd1_"
|
||||
"_temperature_k10temp_tctl_"
|
||||
];
|
||||
};
|
||||
"org/gnome/shell/overrides" = {
|
||||
attach-modal-dialogs = true;
|
||||
dynamic-workspaces = true;
|
||||
edge-tiling = true;
|
||||
focus-change-on-pointer-rest = true;
|
||||
workspaces-only-on-primary = true;
|
||||
};
|
||||
"org/gnome/shell/weather" = {
|
||||
automation-location = true;
|
||||
locations = "[<(uint32 2, <('Midlothian / Waxahachie, Mid-Way Regional Airport', 'KJWY', false, [(0.5664611473274288, -1.691437359323684)], @a(dd) [])>)>]";
|
||||
};
|
||||
"org/gnome/shell/window-switcher" = {
|
||||
app-icon-mode = "both";
|
||||
current-workspace-only = true;
|
||||
};
|
||||
"org/gtk/settings/file-chooser" = {
|
||||
location-mode = "path-bar";
|
||||
show-hidden = false;
|
||||
show-size-column = true;
|
||||
sort-column = "modified";
|
||||
sort-directories-first = false;
|
||||
sort-order = "descending";
|
||||
};
|
||||
"org/virt-manager/virt-manager/confirm" = {
|
||||
delete-storage = true;
|
||||
forcepoweroff = false;
|
||||
};
|
||||
"org/virt-manager/virt-manager/details" = {
|
||||
show-toolbar = true;
|
||||
};
|
||||
"org/virt-manager/virt-manager/connections" = {
|
||||
autoconnect = [
|
||||
"qemu:///session"
|
||||
"qemu:///system"
|
||||
];
|
||||
uris = [
|
||||
"qemu:///session"
|
||||
"qemu:///system"
|
||||
];
|
||||
};
|
||||
};
|
||||
"org/gnome/desktop/interface" = {
|
||||
clock-show-weekday = true;
|
||||
color-scheme = "default";
|
||||
cursor-size = 24;
|
||||
toolbar-style = "text";
|
||||
};
|
||||
"org/gnome/desktop/screensaver" = {
|
||||
lock-delay = "uint32 0";
|
||||
lock-enabled = false;
|
||||
};
|
||||
"org/gnome/desktop/wm/keybindings" = {
|
||||
switch-applications = [ ];
|
||||
switch-applications-backward = [ ];
|
||||
switch-windows = [ "<Alt>Tab" ];
|
||||
switch-windows-backward = [ "<Shift><Alt>Tab" ];
|
||||
};
|
||||
"org/gnome/desktop/wm/preferences" = {
|
||||
button-layout = "icon:minimize,maximize,close";
|
||||
};
|
||||
"org/gnome/file-roller/listing" = {
|
||||
list-mode = "as-folder";
|
||||
name-coloumn-width = 302;
|
||||
show-path = true;
|
||||
sort-method = "name";
|
||||
sort-type = "ascending";
|
||||
};
|
||||
"org/gnome/nautilus/preferences" = {
|
||||
default-folder-viewer = "icon-view";
|
||||
search-filter-time-type = "last_modified";
|
||||
search-view = "list-view";
|
||||
};
|
||||
"org/gnome/shell" = {
|
||||
enabled-extensions = [
|
||||
"appindicatorsupport@rgcjonas.gmail.com"
|
||||
"Vitals@CoreCoding.com"
|
||||
"window-list@gnome-shell-extensions.gcampax.github.com"
|
||||
"gsconnect@andyholmes.github.io"
|
||||
];
|
||||
favorite-apps = [
|
||||
"org.gnome.Calendar.desktop"
|
||||
"org.gnome.Nautilus.desktop"
|
||||
"org.gnome.Terminal.desktop"
|
||||
"firefox.desktop"
|
||||
"vlc.desktop"
|
||||
];
|
||||
remember-mount-password = true;
|
||||
};
|
||||
"org/gnome/shell/extensions/vitals" = {
|
||||
hot-sensors = [
|
||||
"_memory_usage_"
|
||||
"_system_load_1m_"
|
||||
"__network-rx_max__"
|
||||
"_temperature_k10temp_tccd1_"
|
||||
"_temperature_k10temp_tctl_"
|
||||
];
|
||||
};
|
||||
"org/gnome/shell/overrides" = {
|
||||
attach-modal-dialogs = true;
|
||||
dynamic-workspaces = true;
|
||||
edge-tiling = true;
|
||||
focus-change-on-pointer-rest = true;
|
||||
workspaces-only-on-primary = true;
|
||||
};
|
||||
"org/gnome/shell/weather" = {
|
||||
automation-location = true;
|
||||
locations = "[<(uint32 2, <('Midlothian / Waxahachie, Mid-Way Regional Airport', 'KJWY', false, [(0.5664611473274288, -1.691437359323684)], @a(dd) [])>)>]";
|
||||
};
|
||||
"org/gnome/shell/window-switcher" = {
|
||||
app-icon-mode = "both";
|
||||
current-workspace-only = true;
|
||||
};
|
||||
"org/gtk/settings/file-chooser" = {
|
||||
location-mode = "path-bar";
|
||||
show-hidden = false;
|
||||
show-size-column = true;
|
||||
sort-column = "modified";
|
||||
sort-directories-first = false;
|
||||
sort-order = "descending";
|
||||
};
|
||||
"org/virt-manager/virt-manager/confirm" = {
|
||||
delete-storage = true;
|
||||
forcepoweroff = false;
|
||||
};
|
||||
"org/virt-manager/virt-manager/details" = {
|
||||
show-toolbar = true;
|
||||
};
|
||||
"org/virt-manager/virt-manager/connections" = {
|
||||
autoconnect = [ "qemu:///session" "qemu:///system" ];
|
||||
uris = [ "qemu:///session" "qemu:///system" ];
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.greg.pypackage = lib.mkOption {
|
||||
description = "Enable Gnome support and settings";
|
||||
|
||||
+91
-82
@@ -1,4 +1,9 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.greg.sway;
|
||||
@@ -9,98 +14,102 @@ let
|
||||
term = "${pkgs.alacritty}/bin/alacritty";
|
||||
msg = "${pkgs.sway}/bin/swaymsg";
|
||||
sleep = "${pkgs.coreutils}/bin/sleep";
|
||||
workstation1 = pkgs.writeScriptBin "workstation1" (builtins.concatStringsSep "\n" [
|
||||
"${msg} \"workspace 1 ; exec ${pkgs.firefox}/bin/firefox ; split horizontal ; exec ${pkgs.element-desktop}/bin/element-desktop \""
|
||||
"${sleep} 1"
|
||||
"${msg} '[app_id=\"firefox\"]' move left"
|
||||
"${msg} '[instance=\"element\"]' \"layout tabbed ; exec ${term} \""
|
||||
"${msg} '[app_id=\"firefox\"]' move left"
|
||||
"${sleep} 0.3"
|
||||
"${msg} '[app_id=\"Alacritty\" workspace=\"1\"]' move right"
|
||||
"${msg} '[app_id=\"firefox\"]' resize grow width 300 px"
|
||||
]);
|
||||
workstation2 = pkgs.writeScriptBin "workstation2" (builtins.concatStringsSep "\n" [
|
||||
"${sleep} 5"
|
||||
"${msg} \"workspace 2 ; exec ${term} ; layout tabbed\""
|
||||
]);
|
||||
workstation1 = pkgs.writeScriptBin "workstation1" (
|
||||
builtins.concatStringsSep "\n" [
|
||||
"${msg} \"workspace 1 ; exec ${pkgs.firefox}/bin/firefox ; split horizontal ; exec ${pkgs.element-desktop}/bin/element-desktop \""
|
||||
"${sleep} 1"
|
||||
"${msg} '[app_id=\"firefox\"]' move left"
|
||||
"${msg} '[instance=\"element\"]' \"layout tabbed ; exec ${term} \""
|
||||
"${msg} '[app_id=\"firefox\"]' move left"
|
||||
"${sleep} 0.3"
|
||||
"${msg} '[app_id=\"Alacritty\" workspace=\"1\"]' move right"
|
||||
"${msg} '[app_id=\"firefox\"]' resize grow width 300 px"
|
||||
]
|
||||
);
|
||||
workstation2 = pkgs.writeScriptBin "workstation2" (
|
||||
builtins.concatStringsSep "\n" [
|
||||
"${sleep} 5"
|
||||
"${msg} \"workspace 2 ; exec ${term} ; layout tabbed\""
|
||||
]
|
||||
);
|
||||
in
|
||||
{
|
||||
options.greg.sway = lib.mkEnableOption "Enable Sway support and settings";
|
||||
|
||||
config = (lib.mkIf cfg {
|
||||
programs.swaylock.enable = true;
|
||||
config = (
|
||||
lib.mkIf cfg {
|
||||
programs.swaylock.enable = true;
|
||||
|
||||
wayland.windowManager.sway =
|
||||
let
|
||||
mod = config.wayland.windowManager.sway.config.modifier;
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
config = rec {
|
||||
#fonts.size = 10.0;
|
||||
keybindings = lib.mkOptionDefault {
|
||||
"Mod4+l" = "exec ${pkgs.swaylock}/bin/swaylock -c 000000";
|
||||
"Mod4+h" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/headphones.qpwgraph -m";
|
||||
"Mod4+m" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/monitor.qpwgraph -m";
|
||||
"Mod4+b" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/both.qpwgraph -m";
|
||||
wayland.windowManager.sway =
|
||||
let
|
||||
mod = config.wayland.windowManager.sway.config.modifier;
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
config = rec {
|
||||
#fonts.size = 10.0;
|
||||
keybindings = lib.mkOptionDefault {
|
||||
"Mod4+l" = "exec ${pkgs.swaylock}/bin/swaylock -c 000000";
|
||||
"Mod4+h" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/headphones.qpwgraph -m";
|
||||
"Mod4+m" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/monitor.qpwgraph -m";
|
||||
"Mod4+b" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/both.qpwgraph -m";
|
||||
|
||||
"${mod}+Shift+Return" = file_browser.path;
|
||||
};
|
||||
modifier = "Mod1";
|
||||
output = {
|
||||
"Samsung Electric Company S24E650 H4ZN600985" = {
|
||||
mode = "1920x1200";
|
||||
transform = "90";
|
||||
pos = "0 0";
|
||||
"${mod}+Shift+Return" = file_browser.path;
|
||||
};
|
||||
"ViewSonic Corporation VA2252 Series VMT201800925" = {
|
||||
mode = "1920x1080";
|
||||
pos = "200 1920";
|
||||
modifier = "Mod1";
|
||||
output = {
|
||||
"Samsung Electric Company S24E650 H4ZN600985" = {
|
||||
mode = "1920x1200";
|
||||
transform = "90";
|
||||
pos = "0 0";
|
||||
};
|
||||
"ViewSonic Corporation VA2252 Series VMT201800925" = {
|
||||
mode = "1920x1080";
|
||||
pos = "200 1920";
|
||||
};
|
||||
};
|
||||
terminal = term;
|
||||
startup = [
|
||||
{ command = "${workstation1}/bin/workstation1"; }
|
||||
{ command = "${workstation2}/bin/workstation2"; }
|
||||
];
|
||||
};
|
||||
extraOptions = [ "--unsupported-gpu" ];
|
||||
extraSessionCommands = ''
|
||||
export WLR_NO_HARDWARE_CURSORS=1
|
||||
'';
|
||||
systemd.enable = true;
|
||||
wrapperFeatures = {
|
||||
base = true;
|
||||
gtk = true;
|
||||
};
|
||||
terminal = term;
|
||||
startup = [
|
||||
{ command = "${workstation1}/bin/workstation1"; }
|
||||
{ command = "${workstation2}/bin/workstation2"; }
|
||||
];
|
||||
};
|
||||
extraOptions = [
|
||||
"--unsupported-gpu"
|
||||
];
|
||||
extraSessionCommands = ''
|
||||
export WLR_NO_HARDWARE_CURSORS=1
|
||||
'';
|
||||
systemd.enable = true;
|
||||
wrapperFeatures = {
|
||||
base = true;
|
||||
gtk = true;
|
||||
|
||||
home.pointerCursor = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.gnome.adwaita-icon-theme;
|
||||
size = 12;
|
||||
x11 = {
|
||||
enable = true;
|
||||
defaultCursor = "Adwaita";
|
||||
};
|
||||
};
|
||||
|
||||
home.pointerCursor = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.gnome.adwaita-icon-theme;
|
||||
size = 12;
|
||||
x11 = {
|
||||
enable = true;
|
||||
defaultCursor = "Adwaita";
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
arj
|
||||
dpkg
|
||||
kate
|
||||
kget
|
||||
krename
|
||||
file_browser.pkg
|
||||
p7zip
|
||||
plocate
|
||||
rpm
|
||||
qpwgraph
|
||||
xorg.xev
|
||||
xorg.xmodmap
|
||||
xxdiff
|
||||
];
|
||||
});
|
||||
home.packages = with pkgs; [
|
||||
arj
|
||||
dpkg
|
||||
kate
|
||||
kget
|
||||
krename
|
||||
file_browser.pkg
|
||||
p7zip
|
||||
plocate
|
||||
rpm
|
||||
qpwgraph
|
||||
xorg.xev
|
||||
xorg.xmodmap
|
||||
xxdiff
|
||||
];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
+36
-36
@@ -4,7 +4,8 @@ let
|
||||
cfg = config.programs.xonsh;
|
||||
|
||||
in
|
||||
with lib; {
|
||||
with lib;
|
||||
{
|
||||
options = {
|
||||
programs.xonsh = {
|
||||
enable = mkEnableOption "Enable the xonsh program";
|
||||
@@ -12,34 +13,36 @@ with lib; {
|
||||
sessionVariables = mkOption {
|
||||
type = types.attrs;
|
||||
default = { };
|
||||
example = { XONSH_TRACE_SUBPROC = true; };
|
||||
example = {
|
||||
XONSH_TRACE_SUBPROC = true;
|
||||
};
|
||||
description = ''
|
||||
Environment variables that will be set for the Xonsh session.
|
||||
'';
|
||||
Environment variables that will be set for the Xonsh session.
|
||||
'';
|
||||
};
|
||||
|
||||
aliases = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
ll = "ls -l";
|
||||
la = "ls -a";
|
||||
}
|
||||
'';
|
||||
{
|
||||
ll = "ls -l";
|
||||
la = "ls -a";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
An attribute set that maps aliases (the top level attribute names in
|
||||
this option) to command strings or directly to build outputs.
|
||||
'';
|
||||
An attribute set that maps aliases (the top level attribute names in
|
||||
this option) to command strings or directly to build outputs.
|
||||
'';
|
||||
};
|
||||
|
||||
configHeader = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = literalExpression ''
|
||||
import os
|
||||
import sys
|
||||
'';
|
||||
import os
|
||||
import sys
|
||||
'';
|
||||
description = "An arbitrary string to put at the top of the config file";
|
||||
};
|
||||
|
||||
@@ -47,11 +50,11 @@ with lib; {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = literalExpression ''
|
||||
def _some_method(args):
|
||||
do_command()
|
||||
some_other_thing()
|
||||
aliases['some_method'] = _some_method
|
||||
'';
|
||||
def _some_method(args):
|
||||
do_command()
|
||||
some_other_thing()
|
||||
aliases['some_method'] = _some_method
|
||||
'';
|
||||
description = "An arbitrary string to put at the end of the config file";
|
||||
};
|
||||
};
|
||||
@@ -59,29 +62,26 @@ with lib; {
|
||||
|
||||
config =
|
||||
let
|
||||
shortAliases = concatStringsSep "\n" (
|
||||
mapAttrsToList (k: v: "aliases['${k}']=r'${v}'") cfg.aliases
|
||||
);
|
||||
shortAliases = concatStringsSep "\n" (mapAttrsToList (k: v: "aliases['${k}']=r'${v}'") cfg.aliases);
|
||||
|
||||
listToPythonList =
|
||||
let
|
||||
listInternals = args:
|
||||
concatStringsSep "\n" (map (v: "'${v}'") args);
|
||||
listInternals = args: concatStringsSep "\n" (map (v: "'${v}'") args);
|
||||
in
|
||||
list: "[${listInternals list}]";
|
||||
|
||||
sessionVars = concatStringsSep "\n" (
|
||||
mapAttrsToList
|
||||
(k: v:
|
||||
if builtins.typeOf v == "string" then
|
||||
"\$${k} = '${v}'"
|
||||
else if builtins.typeOf v == "list" then
|
||||
"\$${k} = ${listToPythonList}"
|
||||
else if builtins.typeOf v == "int" then
|
||||
"\$${k} = ${toString v}"
|
||||
else ""
|
||||
)
|
||||
cfg.sessionVariables
|
||||
mapAttrsToList (
|
||||
k: v:
|
||||
if builtins.typeOf v == "string" then
|
||||
"\$${k} = '${v}'"
|
||||
else if builtins.typeOf v == "list" then
|
||||
"\$${k} = ${listToPythonList}"
|
||||
else if builtins.typeOf v == "int" then
|
||||
"\$${k} = ${toString v}"
|
||||
else
|
||||
""
|
||||
) cfg.sessionVariables
|
||||
);
|
||||
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user