Compare commits
51 commits
Author | SHA1 | Date | |
---|---|---|---|
Trolli Schmittlauch | f56bfa0eb4 | ||
Trolli Schmittlauch | f0e979adf8 | ||
Trolli Schmittlauch | 9ad6106e29 | ||
Trolli Schmittlauch | 0d8df74f86 | ||
Trolli Schmittlauch | 356a7ee689 | ||
Trolli Schmittlauch | 49c7a042fd | ||
Trolli Schmittlauch | f1d32128da | ||
Trolli Schmittlauch | cf81c30762 | ||
Trolli Schmittlauch | 6ffb11e473 | ||
Trolli Schmittlauch | 869d1c2942 | ||
Trolli Schmittlauch | 5f212fed8c | ||
Trolli Schmittlauch | a5a2d755ec | ||
Trolli Schmittlauch | 02baadae0d | ||
Trolli Schmittlauch | adcfb11f72 | ||
Trolli Schmittlauch | e6b13ad7b6 | ||
Trolli Schmittlauch | b5ac576fa9 | ||
Trolli Schmittlauch | ff5e044ea0 | ||
Trolli Schmittlauch | e1f16f2c71 | ||
Trolli Schmittlauch | 13a6dc0f66 | ||
Trolli Schmittlauch | e84b06a09e | ||
Trolli Schmittlauch | 25794fd364 | ||
Trolli Schmittlauch | f5b29c30dc | ||
Trolli Schmittlauch | f2917af591 | ||
Trolli Schmittlauch | 651b93da89 | ||
Trolli Schmittlauch | 3724058439 | ||
Trolli Schmittlauch | a9a7f2bd6b | ||
Trolli Schmittlauch | 68ccdd1b00 | ||
Trolli Schmittlauch | 09cad34457 | ||
Trolli Schmittlauch | 62c250097a | ||
Trolli Schmittlauch | ce31103112 | ||
Trolli Schmittlauch | 02da74da11 | ||
Trolli Schmittlauch | 2f9d4529d3 | ||
Trolli Schmittlauch | 24bd8861d5 | ||
Trolli Schmittlauch | 4514333301 | ||
Trolli Schmittlauch | 8c92ac91da | ||
Trolli Schmittlauch | 6070ae7425 | ||
Trolli Schmittlauch | db997a2eb0 | ||
Trolli Schmittlauch | 61af7f0a99 | ||
Trolli Schmittlauch | 5f27edbd21 | ||
Trolli Schmittlauch | ac4e42652e | ||
Trolli Schmittlauch | c43157c5c8 | ||
Trolli Schmittlauch | a83bfaed3f | ||
Trolli Schmittlauch | d531c0e1a8 | ||
Trolli Schmittlauch | d74fd749d0 | ||
Trolli Schmittlauch | ba828329a9 | ||
Trolli Schmittlauch | 94aa73b2c0 | ||
Trolli Schmittlauch | 847196e0a3 | ||
Trolli Schmittlauch | 7fcba96288 | ||
Trolli Schmittlauch | 8c50e3a074 | ||
Trolli Schmittlauch | 0d8baaf276 | ||
Trolli Schmittlauch | 4b35e44873 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.DS_Store
|
29
darwin/darwin-configuration.nix
Normal file
29
darwin/darwin-configuration.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# List packages installed in system profile. To search by name, run:
|
||||||
|
# $ nix-env -qaP | grep wget
|
||||||
|
environment.systemPackages =
|
||||||
|
[ pkgs.vim
|
||||||
|
];
|
||||||
|
|
||||||
|
# Use a custom configuration.nix location.
|
||||||
|
# $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
|
||||||
|
# environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix";
|
||||||
|
|
||||||
|
# Auto upgrade nix package and the daemon service.
|
||||||
|
services.nix-daemon.enable = true;
|
||||||
|
# nix.package = pkgs.nix;
|
||||||
|
|
||||||
|
# Create /etc/bashrc that loads the nix-darwin environment.
|
||||||
|
programs.zsh.enable = true; # default shell on catalina
|
||||||
|
|
||||||
|
# system-wide SSH configuration, used by nix-daemon for remote builders
|
||||||
|
|
||||||
|
# show hidden files
|
||||||
|
system.defaults.NSGlobalDomain.AppleShowAllFiles = true;
|
||||||
|
|
||||||
|
# Used for backwards compatibility, please read the changelog before changing.
|
||||||
|
# $ darwin-rebuild changelog
|
||||||
|
system.stateVersion = 4;
|
||||||
|
}
|
269
home/home.nix
269
home/home.nix
|
@ -1,9 +1,9 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
|
|
||||||
with pkgs;
|
with pkgs;
|
||||||
let
|
let
|
||||||
# nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
|
# nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
|
||||||
unstable = import <nixos-unstable> { };
|
#unstable = import <nixos-unstable> { };
|
||||||
# nix-channel --add https://github.com/nix-community/NUR/archive/master.tar.gz NUR
|
# nix-channel --add https://github.com/nix-community/NUR/archive/master.tar.gz NUR
|
||||||
nur = import <NUR> { inherit pkgs; };
|
nur = import <NUR> { inherit pkgs; };
|
||||||
myNur = nur.repos.schmittlauch;
|
myNur = nur.repos.schmittlauch;
|
||||||
|
@ -63,15 +63,14 @@ let
|
||||||
graphicsApps = [
|
graphicsApps = [
|
||||||
inkscape
|
inkscape
|
||||||
darktable
|
darktable
|
||||||
hugin
|
#hugin
|
||||||
luminanceHDR
|
#luminanceHDR
|
||||||
exiftool
|
exiftool
|
||||||
gimp
|
gimp
|
||||||
xournal
|
#xournal # FIXME: broken on darwin-aarch64
|
||||||
]
|
]
|
||||||
++ (
|
++ (
|
||||||
with gimpPlugins; [
|
with gimpPlugins; [
|
||||||
resynthesizer
|
|
||||||
fourier
|
fourier
|
||||||
lqrPlugin
|
lqrPlugin
|
||||||
]
|
]
|
||||||
|
@ -79,17 +78,17 @@ let
|
||||||
|
|
||||||
multimediaApps = [
|
multimediaApps = [
|
||||||
mpv
|
mpv
|
||||||
vlc
|
#vlc
|
||||||
#amarok
|
#amarok
|
||||||
clementine
|
#clementine
|
||||||
elisa
|
#elisa
|
||||||
yt-dlp
|
yt-dlp
|
||||||
#sonic-pi
|
#sonic-pi
|
||||||
musescore
|
#musescore
|
||||||
audacity
|
#audacity
|
||||||
avidemux
|
#avidemux
|
||||||
#linphone
|
#linphone
|
||||||
soundkonverter
|
#soundkonverter
|
||||||
];
|
];
|
||||||
|
|
||||||
cliApps = [
|
cliApps = [
|
||||||
|
@ -103,9 +102,10 @@ let
|
||||||
lsof
|
lsof
|
||||||
mosh
|
mosh
|
||||||
openssh
|
openssh
|
||||||
sshfsFuse
|
sshfs-fuse
|
||||||
cryfs
|
cryfs
|
||||||
smbnetfs # for FUSE smb mounting
|
#smbnetfs # for FUSE smb mounting
|
||||||
|
openssh
|
||||||
sshuttle
|
sshuttle
|
||||||
thefuck
|
thefuck
|
||||||
gnupg
|
gnupg
|
||||||
|
@ -114,22 +114,29 @@ let
|
||||||
p7zip
|
p7zip
|
||||||
pwgen
|
pwgen
|
||||||
pandoc
|
pandoc
|
||||||
agrep
|
#agrep # FIXME: broken on darwin-aarch64
|
||||||
pdfgrep
|
pdfgrep
|
||||||
torsocks
|
#torsocks # FIXME: broken on darwin-aarch64
|
||||||
ncdu
|
# zig dependency breaks occasionally, stay on C version for now
|
||||||
psmisc # for killall
|
ncdu_1
|
||||||
|
#psmisc # for killall
|
||||||
dos2unix
|
dos2unix
|
||||||
reptyr # re-bind running program to other tty
|
#reptyr # re-bind running program to other tty
|
||||||
xclip
|
xclip
|
||||||
unzip
|
unzip
|
||||||
myNur.lolcommits # from NUR
|
fswatch
|
||||||
|
#myNur.lolcommits # from NUR
|
||||||
|
jq
|
||||||
|
age
|
||||||
|
_1password
|
||||||
|
lnav
|
||||||
];
|
];
|
||||||
|
|
||||||
nixHelpers = [
|
nixHelpers = [
|
||||||
lorri
|
nixpkgs-review
|
||||||
nix-review
|
nixfmt
|
||||||
nixpkgs-fmt
|
nix-top
|
||||||
|
statix
|
||||||
];
|
];
|
||||||
|
|
||||||
kdeTools = with plasma5Packages; with kdeGear; [
|
kdeTools = with plasma5Packages; with kdeGear; [
|
||||||
|
@ -171,16 +178,19 @@ let
|
||||||
devTools = [
|
devTools = [
|
||||||
curl
|
curl
|
||||||
httpie
|
httpie
|
||||||
gdb
|
#gdb
|
||||||
strace
|
#strace
|
||||||
ltrace
|
#ltrace
|
||||||
valgrind
|
#valgrind
|
||||||
zeal
|
#zeal
|
||||||
gcc
|
gcc
|
||||||
shellcheck
|
shellcheck
|
||||||
mtr
|
mtr
|
||||||
ripgrep
|
ripgrep
|
||||||
gitui
|
gitui
|
||||||
|
lazygit
|
||||||
|
pre-commit
|
||||||
|
scriv
|
||||||
|
|
||||||
# Haskell
|
# Haskell
|
||||||
ghc
|
ghc
|
||||||
|
@ -230,6 +240,8 @@ let
|
||||||
numpy
|
numpy
|
||||||
matplotlib
|
matplotlib
|
||||||
jedi
|
jedi
|
||||||
|
jedi-language-server
|
||||||
|
black
|
||||||
flake8
|
flake8
|
||||||
mypy
|
mypy
|
||||||
];
|
];
|
||||||
|
@ -238,16 +250,23 @@ let
|
||||||
fonts = [
|
fonts = [
|
||||||
comic-neue
|
comic-neue
|
||||||
source-sans-pro
|
source-sans-pro
|
||||||
|
source-code-pro
|
||||||
source-serif-pro
|
source-serif-pro
|
||||||
fira-code
|
|
||||||
ubuntu_font_family
|
ubuntu_font_family
|
||||||
twemoji-color-font
|
twemoji-color-font
|
||||||
opensans-ttf
|
open-sans
|
||||||
(iosevka-bin.override {
|
(iosevka-bin.override {
|
||||||
variant = "curly-slab";
|
variant = "curly-slab";
|
||||||
})
|
})
|
||||||
myNur.vollkorn
|
myNur.vollkorn
|
||||||
# TODO: humor-sans
|
# TODO: humor-sans
|
||||||
|
|
||||||
|
# fcio corporate design, TODO module
|
||||||
|
fira-code
|
||||||
|
fira-mono
|
||||||
|
# TODO fira-sans + condensed
|
||||||
|
# TODO museo 500
|
||||||
|
# also TODO: color schemes nix-darwin
|
||||||
];
|
];
|
||||||
|
|
||||||
games = [
|
games = [
|
||||||
|
@ -255,30 +274,45 @@ let
|
||||||
#hedgewars
|
#hedgewars
|
||||||
];
|
];
|
||||||
|
|
||||||
|
macosTools = [
|
||||||
|
wireshark # on NixOS systems enabled via system config
|
||||||
|
];
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
home.packages =
|
home.packages =
|
||||||
desktopApps
|
cliApps
|
||||||
++ latexApps
|
#++ desktopApps
|
||||||
|
#++ latexApps
|
||||||
++ pythonApps
|
++ pythonApps
|
||||||
++ graphicsApps
|
++ graphicsApps
|
||||||
++ cliApps
|
|
||||||
++ multimediaApps
|
++ multimediaApps
|
||||||
++ devTools
|
++ devTools
|
||||||
++ kdeTools
|
#++ kdeTools
|
||||||
++ fonts
|
++ fonts
|
||||||
++ nixHelpers
|
++ nixHelpers
|
||||||
++ games
|
#++ games
|
||||||
|
++ macosTools
|
||||||
;
|
;
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||||
|
"1password-cli"
|
||||||
|
];
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
programs.home-manager.path = "$HOME/.nix-defexpr/channels/home-manager";
|
#programs.home-manager.path = "$HOME/.nix-defexpr/channels/home-manager";
|
||||||
home.stateVersion = "18.09";
|
home.stateVersion = "22.05";
|
||||||
|
|
||||||
|
# Home Manager needs a bit of information about you and the
|
||||||
|
# paths it should manage.
|
||||||
|
home.username = "os";
|
||||||
|
home.homeDirectory = "/Users/os";
|
||||||
|
|
||||||
programs.direnv =
|
programs.direnv =
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = true;
|
||||||
|
nix-direnv.enable = true;
|
||||||
enableZshIntegration = true;
|
enableZshIntegration = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -286,21 +320,135 @@ in
|
||||||
# { enable = true;
|
# { enable = true;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
programs.bat.enable = true;
|
programs.vscode = {
|
||||||
|
enable = true;
|
||||||
services.gpg-agent =
|
package = pkgs.vscodium;
|
||||||
{
|
extensions = with pkgs.vscode-extensions; [
|
||||||
enable = true;
|
ms-python.python
|
||||||
enableSshSupport = true;
|
vscodevim.vim
|
||||||
pinentryFlavor = "qt";
|
yzhang.markdown-all-in-one
|
||||||
|
bungcip.better-toml
|
||||||
|
eamodio.gitlens
|
||||||
|
jnoortheen.nix-ide
|
||||||
|
mkhl.direnv
|
||||||
|
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||||
|
{
|
||||||
|
name = "Sync-Rsync";
|
||||||
|
publisher = "vscode-ext";
|
||||||
|
version = "0.36.0";
|
||||||
|
sha256 = "sha256-0b/OHLZfXo0NAVAVkzZSqMGDzF0uvPRoiqsZtW1iOdA";
|
||||||
|
}
|
||||||
|
# TODO: probably available in nixpkgs soonish?
|
||||||
|
{
|
||||||
|
name = "mypy-type-checker";
|
||||||
|
publisher = "ms-python";
|
||||||
|
version = "2023.3.12681020";
|
||||||
|
sha256 = "sha256-rhed7CQlvxksVCGc9nPU2oYQWtXcAV5TzuG63e8Y3zM=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "black-formatter";
|
||||||
|
publisher = "ms-python";
|
||||||
|
version = "2023.5.12771008";
|
||||||
|
sha256 = "sha256-lJG0RRUUMhQGs2a6oBtoqt+uY1kSJ0+cbmaP07hNh2o=";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "vscode-pets";
|
||||||
|
publisher = "tonybaloney";
|
||||||
|
version = "1.25.1";
|
||||||
|
sha256 = "sha256-as3e2LzKBSsiGs/UGIZ06XqbLh37irDUaCzslqITEJQ=";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
userSettings = let
|
||||||
|
defaultPython = pkgs.python3.withPackages (ps: [
|
||||||
|
ps.jedi ps.jedi-language-server
|
||||||
|
ps.pip ps.setuptools # for pkg_resources
|
||||||
|
ps.black ps.mypy
|
||||||
|
]);
|
||||||
|
in {
|
||||||
|
"editor.fontLigatures" = true;
|
||||||
|
"window.autoDetectColorScheme" = true;
|
||||||
|
"workbench.preferredDarkColorTheme" = "Default Dark Modern";
|
||||||
|
"workbench.preferredLightColorTheme" = "Default Light Modern";
|
||||||
|
"[nix]" = {
|
||||||
|
"editor.insertSpaces" = true;
|
||||||
|
"editor.tabSize" = 2;
|
||||||
|
# for now, disable automatic formatting to prevent disruption of existing code bases
|
||||||
|
"editor.formatOnPaste" = false;
|
||||||
|
"editor.formatOnSave" = false;
|
||||||
|
"editor.formatOnType" = false;
|
||||||
|
};
|
||||||
|
"nix.formatterPath" = "${pkgs.nixfmt}/bin/nixfmt";
|
||||||
|
"editor.fontSize" = 13;
|
||||||
|
"editor.fontWeight" = "normal";
|
||||||
|
"git.detectSubmodulesLimit" = 30;
|
||||||
|
"[python]" = {
|
||||||
|
"breadcrumbs.showClasses" = true;
|
||||||
|
"breadcrumbs.showFunctions" = true;
|
||||||
|
"gitlens.codeLens.symbolScopes" = [
|
||||||
|
"!Module"
|
||||||
|
];
|
||||||
|
"editor.defaultFormatter" = "ms-python.black-formatter";
|
||||||
|
"editor.formatOnSave" = true;
|
||||||
|
};
|
||||||
|
"python.languageServer" = "Jedi"; # don't use proprietary pylance server
|
||||||
|
"python.defaultInterpreterPath" = "${defaultPython}/bin/python";
|
||||||
|
"black-formatter.path" = ["${pkgs.python3Packages.black}/bin/black"];
|
||||||
|
"black-formatter.importStrategy" = "fromEnvironment";
|
||||||
|
"mypy-type-checker.path" = ["${pkgs.python3Packages.mypy}/bin/mypy"];
|
||||||
|
"mypy-type-checker.importStrategy" = "fromEnvironment";
|
||||||
|
"mypy-type-checker.args" = [
|
||||||
|
"--ignore-missing-imports"
|
||||||
|
];
|
||||||
|
"gitlens.telemetry.enabled" = false;
|
||||||
|
"vim.highlightedyank.enable" = true;
|
||||||
|
"vim.history" = 500;
|
||||||
|
"vim.neovimUseConfigFile" = true;
|
||||||
|
"vim.enableNeovim" = true;
|
||||||
|
"git.suggestSmartCommit" = false;
|
||||||
|
"editor.rulers" = [ 79 ];
|
||||||
|
"vim.useSystemClipboard" = true;
|
||||||
|
"vim.smartRelativeLine" = true;
|
||||||
|
"diffEditor.ignoreTrimWhitespace" = false;
|
||||||
|
"files.associations" = {
|
||||||
|
"*.py" = "python";
|
||||||
|
};
|
||||||
|
"editor.renderWhitespace" = "all";
|
||||||
|
"editor.fontFamily" = "Iosevka Curly Slab, Menlo, Monaco, 'Courier New', monospace";
|
||||||
|
"vim.neovimPath" = "/Users/os/.nix-profile/bin/nvim";
|
||||||
|
"sync-rsync.options" = [];
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.bat = {
|
||||||
|
enable = true;
|
||||||
|
# pinning theme is necessary until iTerm 3.5, because despite the dark terminal background, bat detects light mode and adapts theme
|
||||||
|
config.theme = "Visual Studio Dark+";
|
||||||
|
};
|
||||||
|
|
||||||
|
# services.gpg-agent =
|
||||||
|
# {
|
||||||
|
# enable = true;
|
||||||
|
# enableSshSupport = true;
|
||||||
|
# pinentryFlavor = "qt";
|
||||||
|
# };
|
||||||
|
|
||||||
programs.ssh =
|
programs.ssh =
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = true;
|
||||||
# ssh host config
|
# ssh host config
|
||||||
matchBlocks =
|
matchBlocks = {
|
||||||
import ./secrets/ssh_hosts.nix;
|
"hydra01" = {
|
||||||
|
hostname = "hydra01.fe.whq.fcio.net";
|
||||||
|
user = "os";
|
||||||
|
};
|
||||||
|
"fcio-whq-jump" = {
|
||||||
|
hostname = "vpn-whq.services.fcio.net";
|
||||||
|
extraOptions.LogLevel = "Verbose";
|
||||||
|
};
|
||||||
|
"fcio-rzob-jump" = {
|
||||||
|
hostname = "vpn-rzob.services.fcio.net";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.tmux = {
|
programs.tmux = {
|
||||||
|
@ -319,12 +467,12 @@ in
|
||||||
terminal = "screen-256color";
|
terminal = "screen-256color";
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.startServices = true;
|
#systemd.user.startServices = true;
|
||||||
|
|
||||||
services.lorri.enable = true;
|
#services.lorri.enable = true;
|
||||||
|
|
||||||
# media button control support from Bluetooth devices
|
# media button control support from Bluetooth devices
|
||||||
services.mpris-proxy.enable = true;
|
#services.mpris-proxy.enable = true;
|
||||||
|
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
|
@ -375,21 +523,30 @@ in
|
||||||
*.swo
|
*.swo
|
||||||
'');
|
'');
|
||||||
core.whitespace = "-blank-at-eol,blank-at-eof,space-before-tab";
|
core.whitespace = "-blank-at-eol,blank-at-eof,space-before-tab";
|
||||||
|
rerere.enabled = true;
|
||||||
};
|
};
|
||||||
lfs.enable = true;
|
lfs.enable = true;
|
||||||
|
delta = {
|
||||||
|
enable = true;
|
||||||
|
options = {
|
||||||
|
line-numbers = true;
|
||||||
|
side-by-side = true;
|
||||||
|
#dark = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# shell config
|
# shell config
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableSyntaxHighlighting = true;
|
syntaxHighlighting.enable = true;
|
||||||
history.ignoreSpace = true;
|
history.ignoreSpace = true;
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
# Uncomment following line if you want red dots to be displayed while waiting for completion
|
# Uncomment following line if you want red dots to be displayed while waiting for completion
|
||||||
COMPLETION_WAITING_DOTS="true"
|
COMPLETION_WAITING_DOTS="true"
|
||||||
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
|
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
|
||||||
pasteinit() {
|
pasteinit() {
|
||||||
OLD_SELF_INSERT=$\{$\{(s.:.)widgets[self-insert]}[2,3]}
|
OLD_SELF_INSERT=''${''${(s.:.)widgets[self-insert]}[2,3]}
|
||||||
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
|
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,7 +583,9 @@ in
|
||||||
binpath() {
|
binpath() {
|
||||||
realpath $(${pkgs.which}/bin/which $1)
|
realpath $(${pkgs.which}/bin/which $1)
|
||||||
}
|
}
|
||||||
'';
|
''
|
||||||
|
+ (import ./scripts/reporsync.nix {inherit pkgs;})
|
||||||
|
+ (import ./scripts/ssh-loop-fc.nix {inherit pkgs;});
|
||||||
|
|
||||||
|
|
||||||
oh-my-zsh = {
|
oh-my-zsh = {
|
||||||
|
@ -440,8 +599,10 @@ in
|
||||||
ipb = "ip --color --brief";
|
ipb = "ip --color --brief";
|
||||||
ll = "ls -l";
|
ll = "ls -l";
|
||||||
wavesynth = "nix-shell -p sox --run 'play -n synth brownnoise synth pinknoise mix synth 0 0 0 15 40 80 trapezium amod 0.2 20'";
|
wavesynth = "nix-shell -p sox --run 'play -n synth brownnoise synth pinknoise mix synth 0 0 0 15 40 80 trapezium amod 0.2 20'";
|
||||||
|
vim = "nvim";
|
||||||
};
|
};
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = "vim";
|
EDITOR = "nvim";
|
||||||
|
BATOU_AGE_IDENTITY_PASSPHRASE="op://Private/SSH key/password";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,8 @@
|
||||||
(
|
(
|
||||||
self: super:
|
self: super:
|
||||||
rec {
|
rec {
|
||||||
#jami-ring-daemon = super.qt5.callPackage ./ov/jami/ring-daemon.nix {};
|
myVim = with super; neovim.override { configure = {
|
||||||
myVim = with super; (vim_configurable.override { python = python3; }).customize {
|
packages.myVimPackage = with pkgs.vimPlugins; {
|
||||||
# executable/ package name
|
|
||||||
name = "vim";
|
|
||||||
vimrcConfig.packages.myVimPackage = with pkgs.vimPlugins; {
|
|
||||||
# loaded on start
|
# loaded on start
|
||||||
start = [
|
start = [
|
||||||
ale
|
ale
|
||||||
|
@ -27,124 +24,11 @@
|
||||||
vim-jinja
|
vim-jinja
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
vimrcConfig.customRC = ''
|
customRC = builtins.readFile ./vimrc;
|
||||||
" disable vim modelines for security reasons
|
};};
|
||||||
set modelines=0
|
# pyopenssl is broken upstream for py3.9
|
||||||
set nomodeline
|
# inspired by https://github.com/montchr/dotfield/commit/9ec0f1d7cf4f6e3c0079c4656bf76e0daf55c5ea
|
||||||
|
httpie = self.python310Packages.httpie;
|
||||||
" Uncomment the following to have Vim jump to the last position when
|
|
||||||
" reopening a file
|
|
||||||
if has("autocmd")
|
|
||||||
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
set nocompatible
|
|
||||||
set hidden
|
|
||||||
|
|
||||||
" automatically close preview window after suggestion
|
|
||||||
autocmd CompleteDone * pclose
|
|
||||||
|
|
||||||
" Pathogen
|
|
||||||
"execute pathogen#infect()
|
|
||||||
"call pathogen#infect()
|
|
||||||
"call pathogen#helptags()
|
|
||||||
|
|
||||||
set statusline=%<\ %n:%f\ %m%r%y%=%-35.(line:\ %l\ of\ %L,\ col:\ %c%V\ (%P)%)
|
|
||||||
filetype plugin indent on
|
|
||||||
|
|
||||||
syntax on
|
|
||||||
|
|
||||||
set number
|
|
||||||
set mouse=a
|
|
||||||
set mousehide
|
|
||||||
|
|
||||||
set backspace=indent,eol,start
|
|
||||||
|
|
||||||
set hlsearch
|
|
||||||
set showmatch
|
|
||||||
set incsearch
|
|
||||||
set autoindent
|
|
||||||
set history=1000
|
|
||||||
" set cursorline
|
|
||||||
if has("unnamedplus")
|
|
||||||
set clipboard=unnamedplus
|
|
||||||
elseif has("clipboard")
|
|
||||||
set clipboard=unnamed
|
|
||||||
endif
|
|
||||||
|
|
||||||
" set expandtab
|
|
||||||
set shiftwidth=4
|
|
||||||
set tabstop=4
|
|
||||||
set softtabstop=4
|
|
||||||
|
|
||||||
" enable truecolor support
|
|
||||||
"let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
|
|
||||||
"let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
|
|
||||||
"set termguicolors
|
|
||||||
"
|
|
||||||
"let base16colorspace=256
|
|
||||||
|
|
||||||
"colorscheme base16-tomorrow-night
|
|
||||||
"colorscheme Tomorrow-Night
|
|
||||||
"colorscheme base16-default-dark
|
|
||||||
|
|
||||||
set background=dark
|
|
||||||
|
|
||||||
" Use the same symbols as TextMate for tabstops and EOLs
|
|
||||||
set listchars=tab:▸\ ,eol:¬
|
|
||||||
|
|
||||||
" default tab completion with supertab
|
|
||||||
let g:SuperTabDefaultCompletionType = "context"
|
|
||||||
|
|
||||||
|
|
||||||
" LanguageClient
|
|
||||||
" Required for operations modifying multiple buffers like rename.
|
|
||||||
set hidden
|
|
||||||
nnoremap <F5> :call LanguageClient_contextMenu()<CR>
|
|
||||||
let g:LanguageClient_serverCommands = { 'haskell': ['hie-wrapper', '--lsp'] }
|
|
||||||
|
|
||||||
" enable LanguageClient functions only if a server mapping exists
|
|
||||||
function LC_maps()
|
|
||||||
if has_key(g:LanguageClient_serverCommands, &filetype)
|
|
||||||
nnoremap <buffer> <silent> K :call LanguageClient#textDocument_hover()<cr>
|
|
||||||
nnoremap <buffer> <silent> gd :call LanguageClient#textDocument_definition()<CR>
|
|
||||||
nnoremap <buffer> <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
|
|
||||||
set omnifunc=LanguageClient#complete
|
|
||||||
set completefunc=LanguageClient#complete
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
autocmd FileType * call LC_maps()
|
|
||||||
|
|
||||||
au FileType python setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4
|
|
||||||
au FileType haskell setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4
|
|
||||||
" haskell-vim
|
|
||||||
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
|
|
||||||
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
|
|
||||||
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`
|
|
||||||
let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern`
|
|
||||||
let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles
|
|
||||||
let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static`
|
|
||||||
let g:haskell_backpack = 1 " to enable highlighting of backpack keywords
|
|
||||||
au FileType markdown setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4
|
|
||||||
au FileType nix setlocal tabstop=2 expandtab shiftwidth=2 softtabstop=2
|
|
||||||
set ofu=syntaxcomplete#Complete
|
|
||||||
" nmap <C-V> "+gP
|
|
||||||
" imap <C-V> <ESC><C-V>a
|
|
||||||
vmap <C-C> "+y
|
|
||||||
|
|
||||||
" ALE linter settings
|
|
||||||
let g:ale_linters = { 'python': ['flake8'] }
|
|
||||||
|
|
||||||
" vim-pandoc settings
|
|
||||||
let g:pandoc#modules#disabled = ["spell"]
|
|
||||||
set textwidth=0
|
|
||||||
set wrapmargin=0
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
# build with debug symbols and in debug mode (less optimized)
|
|
||||||
opencvDebug = with super; enableDebugging ((opencv3.override { enablePython = true; enableGtk3 = true; enableDocs = true; pythonPackages = pkgs.python3Packages; }).overrideAttrs (oldAttrs: rec { cmakeBuildType = "Debug"; }));
|
|
||||||
#gnutls = super.callPackage ./ov/gnutls {inherit (super.darwin.apple_sdk.frameworks) Security;};
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
79
home/scripts/reporsync.nix
Normal file
79
home/scripts/reporsync.nix
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
{pkgs, ...}:
|
||||||
|
''
|
||||||
|
# rsync -rlptzv --progress --delete --exclude=.git --exclude=.vscode --exclude=result --exclude=channels/ /Users/os/src/fc.qemu os@hydra01:
|
||||||
|
# rsync -rlptzv --progress --rsh="ssh -J fcio-whq-jump" --delete --exclude=.git --exclude=.vscode --exclude=result --exclude=channels/ /Users/os/src/fc-nixos/ os@patty:fc-nixos/
|
||||||
|
|
||||||
|
|
||||||
|
DEFAULT_JUMPHOST="fcio-whq-jump"
|
||||||
|
|
||||||
|
_parse_rsync_args() {
|
||||||
|
# reset pre-defined variables that are read and manipulated throughout this function
|
||||||
|
unset JUMPHOST
|
||||||
|
# arrays are bash or zsh specific
|
||||||
|
RSYNC_OPTS=("-rlptzv" "--progress" "--delete" "--exclude=.git" "--exclude=.vscode" "--exclude=result" "--exclude=channels/" "--exclude=.mypy_cache")
|
||||||
|
|
||||||
|
while getopts ':Jj:' OPT; do
|
||||||
|
case $OPT in
|
||||||
|
j)
|
||||||
|
if [ -n "$JUMPHOST" ]; then
|
||||||
|
echo "-j and -J are conflicting arguments" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
JUMPHOST="$OPTARG"
|
||||||
|
;;
|
||||||
|
J)
|
||||||
|
if [ -n "$JUMPHOST" ]; then
|
||||||
|
echo "-j and -J are conflicting arguments" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
JUMPHOST="$DEFAULT_JUMPHOST"
|
||||||
|
;;
|
||||||
|
?)
|
||||||
|
echo "rsyncrepo [-J] [-j <jumphost>] <directory> <hostname>"
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# trim CLI parameters
|
||||||
|
shift "$(($OPTIND -1))"
|
||||||
|
|
||||||
|
RR_FROM="$1"
|
||||||
|
RR_TO="$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
_do_rsync() {
|
||||||
|
# parameter check
|
||||||
|
if [ -z "$1" ] || [ -z "$2" ]; then
|
||||||
|
echo "Missing arguments, required: <directory> <hostname>" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$JUMPHOST" ]; then
|
||||||
|
RSYNC_OPTS+=("--rsh=/Users/os/.nix-profile/bin/ssh -J ''${JUMPHOST}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
for OPTI in "''${RSYNC_OPTS[@]}"; do
|
||||||
|
echo "$OPTI"
|
||||||
|
done
|
||||||
|
|
||||||
|
# we always sync /path/to/dir/ to hostname:dir
|
||||||
|
RR_DEST="''${2}:$(basename $(realpath "''${1}"))"
|
||||||
|
|
||||||
|
echo "Syncing ''${1} to ''${RR_DEST}…"
|
||||||
|
|
||||||
|
# ensure trailing slash for src to avoid recreating directory
|
||||||
|
${pkgs.rsync}/bin/rsync "''${RSYNC_OPTS[@]}" "''${1}/" "''${RR_DEST}"
|
||||||
|
}
|
||||||
|
|
||||||
|
rsyncrepo() {
|
||||||
|
_parse_rsync_args "$@"
|
||||||
|
# inherits parsed arguments through variables
|
||||||
|
_do_rsync "$RR_FROM" "$RR_TO"
|
||||||
|
}
|
||||||
|
|
||||||
|
rsynchydra() {
|
||||||
|
_parse_rsync_args "$@"
|
||||||
|
_do_rsync "$RR_FROM" "hydra01"
|
||||||
|
}
|
||||||
|
''
|
19
home/scripts/ssh-loop-fc.nix
Normal file
19
home/scripts/ssh-loop-fc.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{pkgs, ...}:
|
||||||
|
''
|
||||||
|
ssh-loop () {
|
||||||
|
setopt shwordsplit
|
||||||
|
local hosts=$1
|
||||||
|
local cmd=$2
|
||||||
|
|
||||||
|
for x in $1; do echo $x; ${pkgs.openssh}/bin/ssh $x.fcio.net -o StrictHostKeyChecking=no -C "$2"; done
|
||||||
|
}
|
||||||
|
|
||||||
|
ssh-loop-parallel () {
|
||||||
|
setopt shwordsplit
|
||||||
|
local hosts=$1
|
||||||
|
local cmd=$2
|
||||||
|
|
||||||
|
for x in $1; do echo $x; ${pkgs.openssh}/bin/ssh $x.fcio.net -o StrictHostKeyChecking=no -C "$2" 2>&1 | sed -e "s/^/$x: /;" & done
|
||||||
|
wait
|
||||||
|
}
|
||||||
|
''
|
112
home/vimrc
Normal file
112
home/vimrc
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
" disable vim modelines for security reasons
|
||||||
|
set modelines=0
|
||||||
|
set nomodeline
|
||||||
|
|
||||||
|
" Uncomment the following to have Vim jump to the last position when
|
||||||
|
" reopening a file
|
||||||
|
if has("autocmd")
|
||||||
|
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
set nocompatible
|
||||||
|
set hidden
|
||||||
|
|
||||||
|
" automatically close preview window after suggestion
|
||||||
|
autocmd CompleteDone * pclose
|
||||||
|
|
||||||
|
" Pathogen
|
||||||
|
"execute pathogen#infect()
|
||||||
|
"call pathogen#infect()
|
||||||
|
"call pathogen#helptags()
|
||||||
|
|
||||||
|
set statusline=%<\ %n:%f\ %m%r%y%=%-35.(line:\ %l\ of\ %L,\ col:\ %c%V\ (%P)%)
|
||||||
|
filetype plugin indent on
|
||||||
|
|
||||||
|
syntax on
|
||||||
|
|
||||||
|
set number
|
||||||
|
set mouse=a
|
||||||
|
set mousehide
|
||||||
|
|
||||||
|
set cursorline
|
||||||
|
|
||||||
|
set backspace=indent,eol,start
|
||||||
|
|
||||||
|
set hlsearch
|
||||||
|
set showmatch
|
||||||
|
set incsearch
|
||||||
|
set autoindent
|
||||||
|
set history=1000
|
||||||
|
" use system clipboard as default buffer
|
||||||
|
" unnamedplus corresponds to the + register on Linux,
|
||||||
|
" representing system clipboard (not X11 clipboard)
|
||||||
|
set clipboard=unnamedplus
|
||||||
|
|
||||||
|
" set expandtab
|
||||||
|
set shiftwidth=4
|
||||||
|
set tabstop=4
|
||||||
|
set softtabstop=4
|
||||||
|
|
||||||
|
" enable truecolor support
|
||||||
|
"let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
|
||||||
|
"let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
|
||||||
|
"set termguicolors
|
||||||
|
"
|
||||||
|
"let base16colorspace=256
|
||||||
|
|
||||||
|
"colorscheme base16-tomorrow-night
|
||||||
|
"colorscheme Tomorrow-Night
|
||||||
|
"colorscheme base16-default-dark
|
||||||
|
|
||||||
|
set background=dark
|
||||||
|
|
||||||
|
" Use the same symbols as TextMate for tabstops and EOLs
|
||||||
|
set listchars=tab:▸\ ,eol:¬
|
||||||
|
|
||||||
|
" default tab completion with supertab
|
||||||
|
let g:SuperTabDefaultCompletionType = "context"
|
||||||
|
|
||||||
|
|
||||||
|
" LanguageClient
|
||||||
|
" Required for operations modifying multiple buffers like rename.
|
||||||
|
set hidden
|
||||||
|
nnoremap <F5> :call LanguageClient_contextMenu()<CR>
|
||||||
|
let g:LanguageClient_serverCommands = { 'haskell': ['hie-wrapper', '--lsp'] }
|
||||||
|
|
||||||
|
" enable LanguageClient functions only if a server mapping exists
|
||||||
|
function LC_maps()
|
||||||
|
if has_key(g:LanguageClient_serverCommands, &filetype)
|
||||||
|
nnoremap <buffer> <silent> K :call LanguageClient#textDocument_hover()<cr>
|
||||||
|
nnoremap <buffer> <silent> gd :call LanguageClient#textDocument_definition()<CR>
|
||||||
|
nnoremap <buffer> <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
|
||||||
|
set omnifunc=LanguageClient#complete
|
||||||
|
set completefunc=LanguageClient#complete
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
autocmd FileType * call LC_maps()
|
||||||
|
|
||||||
|
au FileType python setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4
|
||||||
|
au FileType haskell setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
|
" haskell-vim
|
||||||
|
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
|
||||||
|
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
|
||||||
|
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`
|
||||||
|
let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern`
|
||||||
|
let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles
|
||||||
|
let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static`
|
||||||
|
let g:haskell_backpack = 1 " to enable highlighting of backpack keywords
|
||||||
|
au FileType markdown setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4
|
||||||
|
au FileType nix setlocal tabstop=2 expandtab shiftwidth=2 softtabstop=2
|
||||||
|
set ofu=syntaxcomplete#Complete
|
||||||
|
" nmap <C-V> "+gP
|
||||||
|
" imap <C-V> <ESC><C-V>a
|
||||||
|
"vmap <C-C> "+y
|
||||||
|
|
||||||
|
" ALE linter settings
|
||||||
|
let g:ale_linters = { 'python': ['flake8'] }
|
||||||
|
|
||||||
|
" vim-pandoc settings
|
||||||
|
let g:pandoc#modules#disabled = ["spell"]
|
||||||
|
set textwidth=0
|
||||||
|
set wrapmargin=0
|
Loading…
Reference in a new issue