Merge branch 'main' of gh:greg-hellings/nixos-config

This commit is contained in:
Greg Hellings
2023-03-07 22:55:05 +00:00
27 changed files with 743 additions and 429 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
#pattern filter=crypt diff=crypt
**/*.crypt filter=crypt diff=crypt
hosts/linode/synapse.nix.crypt filter=crypt diff=crypt
home/ssh/id_rsa* filter=crypt diff=crypt
modules/ssh/id_* filter=crypt diff=crypt
Generated
+86 -16
View File
@@ -25,11 +25,11 @@
]
},
"locked": {
"lastModified": 1665392861,
"narHash": "sha256-bCd8fYJMAb0LzabsiXl4nxECDoz483bJOCa2hjox7N0=",
"lastModified": 1668784520,
"narHash": "sha256-gGgVAMwYPPmrfnvnoRi6OkEB5KRsNTb9uYzEceLdO/g=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "ef56fd8979b5f4e800c4716f62076e00600b1172",
"rev": "6349b99bc2b96ded34d068a88c7c5ced406b7f7f",
"type": "github"
},
"original": {
@@ -44,11 +44,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1667610227,
"narHash": "sha256-2olA2HYnz07rjDq3lMqCmDRlSegp1WL4OqR3KSy3Hy4=",
"lastModified": 1672274978,
"narHash": "sha256-Ui3WNLr/WsXwZ/GM1RI9PuBJj8nKr0DZLkBX/BHpJT4=",
"owner": "bandithedoge",
"repo": "nixpkgs-firefox-darwin",
"rev": "78d9f25b7816f5711f80093721cf6618cda3e1c0",
"rev": "b147ba53ff19743066e4f8c7c15422e710164b9c",
"type": "github"
},
"original": {
@@ -57,6 +57,52 @@
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -112,11 +158,11 @@
},
"nixunstable": {
"locked": {
"lastModified": 1667991831,
"narHash": "sha256-DHgEsLZI044B9T4AjA3K6+yB9/DqLr4dyA7OIx0FG7o=",
"lastModified": 1677932085,
"narHash": "sha256-+AB4dYllWig8iO6vAiGGYl0NEgmMgGHpy9gzWJ3322g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "872fceeed60ae6b7766cc0a4cd5bf5901b9098ec",
"rev": "3c5319ad3aa51551182ac82ea17ab1c6b0f0df89",
"type": "github"
},
"original": {
@@ -128,11 +174,11 @@
},
"nurpkgs": {
"locked": {
"lastModified": 1665979830,
"narHash": "sha256-0xcqP+Pr2zeX8A2BpqodcPwN5sR0TfC8twuXUjzG2g4=",
"lastModified": 1677243766,
"narHash": "sha256-a+2V68cLjb951pYBEGbQGEVBcgti40uWtxTVnzvGFhY=",
"owner": "nix-community",
"repo": "NUR",
"rev": "704e1ef5bdb1af57b4f7988abf2ef80c897dfc9b",
"rev": "9bde3171aeb5954b7955fcb09b231f53caf76b54",
"type": "github"
},
"original": {
@@ -146,19 +192,21 @@
"agenix": "agenix",
"darwin": "darwin",
"ffmac": "ffmac",
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"nixunstable": "nixunstable",
"nurpkgs": "nurpkgs",
"stable": "stable"
"stable": "stable",
"wsl": "wsl"
}
},
"stable": {
"locked": {
"lastModified": 1665927063,
"narHash": "sha256-2oImLqwQqVOQhTXsGUahqrYpe+Pufq+8XTsceYwBfJs=",
"lastModified": 1672580127,
"narHash": "sha256-3lW3xZslREhJogoOkjeZtlBtvFMyxHku7I/9IVehhT8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8de8b98839d1f20089582cfe1a81207258fcc1f1",
"rev": "0874168639713f547c05947c76124f78441ea46c",
"type": "github"
},
"original": {
@@ -167,6 +215,28 @@
"repo": "nixpkgs",
"type": "github"
}
},
"wsl": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixunstable"
]
},
"locked": {
"lastModified": 1678115114,
"narHash": "sha256-O9BmYOgIVuUSU9iEPSW/tmy8T7V6DmQHXudAHw0uDKU=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "53089d5cc92713ce549ba6ee87ea2b123d6c26e9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NixOS-WSL",
"type": "github"
}
}
},
"root": "root",
+15 -16
View File
@@ -8,6 +8,7 @@
stable.url = "github:nixos/nixpkgs/nixos-22.05";
nixunstable.url = "github:nixos/nixpkgs/nixos-unstable";
agenix.url = "github:ryantm/agenix";
flake-utils.url = "github:numtide/flake-utils";
home-manager = {
url = "github:nix-community/home-manager/release-22.05";
inputs.nixpkgs.follows = "stable";
@@ -16,11 +17,15 @@
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixunstable";
};
wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixunstable";
};
nurpkgs.url = "github:nix-community/NUR";
ffmac.url = "github:bandithedoge/nixpkgs-firefox-darwin";
};
outputs = {stable, nixunstable, agenix, home-manager, nurpkgs, self, ...}@inputs:
outputs = {stable, nixunstable, agenix, home-manager, nurpkgs, self, wsl, flake-utils, ...}@inputs:
let
local_overlay = import ./overlays;
overlays = [
@@ -42,6 +47,7 @@
modules = [
{ nixpkgs.overlays = overlays; }
agenix.nixosModule
wsl.nixosModules.wsl
./modules-all
./modules-linux
./hosts/${name}
@@ -61,21 +67,15 @@
in {
nixosConfigurations = {
"2maccabees" = machine {
system = "aarch64-linux";
name = "2maccabees";
channel = nixunstable;
};
jude = machine {
name = "jude";
channel = nixunstable;
};
"2maccabees" = machine { system = "aarch64-linux"; name = "2maccabees"; channel = nixunstable; };
jude = machine { name = "jude"; channel = nixunstable; };
"linode" = machine { name = "linode"; };
"lappy" = machine { name = "lappy"; };
"iso" = machine { name = "iso"; };
# nix build '.#nixosConfigurations.wsl.config.system.build.installer'
"nixos" = machine { name = "wsl"; system = "aarch64-linux"; channel = nixunstable; };
# nix build '.#nixosConfigurations.wsl-aarch.config.system.build.installer'
"nixos-arm" = machine { name = "wsl"; system = "aarch64-linux"; channel = nixunstable; };
};
darwinConfigurations =
@@ -99,12 +99,11 @@
};
};
defaultPackage."x86_64-linux" = inputs.self.nixosConfigurations.iso.config.system.build.isoImage;
defaultPackage."x86_64-darwin" = inputs.self.darwinConfigurations.C02G48H8MD6R.system;
defaultPackage = flake-utils.lib.eachDefaultSystemMap (system: inputs.self.homeConfigurations.gui."${system}".activationPackage);
homeConfigurations = (
import ./home {
inherit nixunstable agenix home-manager overlays;
inherit nixunstable agenix home-manager overlays flake-utils;
nixpkgs = nixunstable;
}
);
+4 -4
View File
@@ -1,11 +1,11 @@
builds:
include:
- '*.x86_64-linux.*'
- '*.aarch64-linux.*'
- nixosConfigurations.*
- defaultPackage.x86_64-linux
- homeConfigurations.x86_64-gui
- homeConfigurations.x86_64-nogui
- darwinConfigurations.*
- defaultPackage.aarch64-linux
- defaultPackage.x86_64-darwin
- defaultPackage.aarch64-darwin
exclude:
- nixosConfigurations.linode # Requires decrypted files
#- nixosConfigurations.2maccabees # Raspberry Pi 4
+36 -14
View File
@@ -2,23 +2,31 @@
nixpkgs,
overlays,
home-manager,
username ? builtins.getEnv "USER",
flake-utils,
...
}:
let
home = system:
# I'm "greg" everywhere except Darwin where I'm "gregory.hellings"
user = system:
( if ( nixpkgs.lib.hasSuffix "-darwin" system ) then "gregory.hellings" else "greg" );
home = system: username:
if username == "root" then "/root" else
( if ( nixpkgs.lib.hasSuffix "-darwin" system ) then "/Users/${username}" else "/home/${username}" );
mkhome = system: gui:
mkhome = {
system,
gui,
gnome,
username
}:
let
homeDirectory = home system;
homeDirectory = home system username;
configDir = "${homeDirectory}/.config";
pkgs = import nixpkgs {
inherit overlays;
inherit overlays system;
config.allowUnfree = true;
config.xdg.configHome = configDir;
};
@@ -26,15 +34,29 @@ let
in home-manager.lib.homeManagerConfiguration rec {
inherit pkgs system username homeDirectory;
stateVersion = "22.05";
configuration = import ./home.nix username {
inherit pkgs gui;
configuration = import ./home.nix {
inherit pkgs gui gnome;
inherit (pkgs) config lib stdenv;
};
};
in {
"aarch64-gui" = mkhome "aarch64-linux" true;
"aarch64-nogui" = mkhome "aarch64-linux" false;
"x86_64-gui" = mkhome "x86_64-linux" true;
"x86_64-nogui" = mkhome "x86_64-linux" false;
"x86_64-darwin" = mkhome "x86_64-darwin" true;
}
in flake-utils.lib.eachDefaultSystem (system: {
gui = mkhome {
inherit system;
gui = true;
gnome = false;
username = user system;
};
gdm = mkhome {
inherit system;
gui = true;
gnome = true;
username = user system;
};
cli = mkhome {
inherit system;
gui = false;
gnome = false;
username = user system;
};
})
+1
View File
@@ -22,6 +22,7 @@
init.defaultBranch = "main";
push.default = "upstream";
pull.rebase = "false";
tag.sort = "version:refname";
};
};
}
+14 -5
View File
@@ -1,10 +1,19 @@
{ pkgs, lib, ... }:
{
home.packages = with pkgs; ( if ( lib.hasSuffix "-darwin" pkgs.system) then
[] else
[
let
darwinPkgs = [];
x86Pkgs = with pkgs; [
discord
element-desktop
slack
]);
];
armPkgs = with pkgs; [
element-desktop
];
in {
home.packages = ( if ( pkgs.stdenv.hostPlatform.isDarwin ) then darwinPkgs else
( if ( lib.hasPrefix "aarch64" pkgs.system ) then armPkgs else
( if ( lib.hasPrefix "x86_64" pkgs.system ) then x86Pkgs else [] )
)
);
}
+10 -55
View File
@@ -3,74 +3,29 @@
{
imports = [
./chat.nix
./gnome.nix
./firefox.nix
./terminal.nix
];
home.packages = with pkgs; [
bazel
bazel-buildtools
bitwarden
cargo # Rustc
cdrtools
ffmpeg
gcc
gnucash
go
gopls
handbrake
jdk11
libtheora
onlyoffice-bin
synology-drive-client
vlc
x265
zoom-us
] ++ ( if pkgs.system != "x86_64-darwin" then
] ++ ( if ( pkgs.system != "x86_64-darwin" && pkgs.system != "aarch64-linux" ) then
[
jellyfin-media-player
libreoffice
nextcloud-client
]
] else []
) ++ ( if ( pkgs.system != "aarch64-linux" ) then
[
bitwarden
onlyoffice-bin
synology-drive-client
zoom-us
] else []
);
programs = {
vscode = let
codepkg = pkgs.vscode-with-extensions.override {
vscodeExtensions = with pkgs.vscode-extensions; [
eamodio.gitlens
file-icons.file-icons
formulahendry.auto-rename-tag
github.vscode-pull-request-github
golang.go
johnpapa.vscode-peacock
jnoortheen.nix-ide
kamikillerto.vscode-colorize
ms-azuretools.vscode-docker
ms-python.python
redhat.java
redhat.vscode-yaml
ritwickdey.liveserver
streetsidesoftware.code-spell-checker
vscodevim.vim
yzhang.markdown-all-in-one
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "vscode-bazel";
publisher = "BazelBuild";
version = "0.5.0";
sha256 = "sha256-JJQSwU3B5C2exENdNsWEcxFSgWHnImYas4t/KLsgTj4=";
}
];
};
in {
enable = true;
# userSettings = {
# "update.channel" = "none";
# "editor.renderWhitespace" = "all";
# "editor.tabWidth" = "8";
# };
package = codepkg;
};
};
}
+2 -2
View File
@@ -2,7 +2,7 @@
let
# For now, we ignore this and don't install it
ffPkgs = if ( lib.hasSuffix "-darwin" pkgs.system )
ffPkgs = if ( pkgs.stdenv.hostPlatform.isDarwin )
then pkgs.firefox-bin
else pkgs.firefox-wayland.override { cfg.enableGnomeExtensions = true; };
@@ -13,7 +13,7 @@ let
in with lib;
{
programs.firefox = {
enable = true;
enable = (! pkgs.stdenv.hostPlatform.isDarwin);
package = ffPkgs;
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
bitwarden
-47
View File
@@ -1,47 +0,0 @@
{ pkgs, lib, ... }:
let
gv = lib.hm.gvariant;
in {
dconf.settings = lib.mkIf ( lib.hasSuffix "-linux" pkgs.system ) {
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
};
"org/gnome/desktop/wm/keybindings" = {
switch-applications = [];
switch-applications-backward = [];
switch-windows = ["<Alt>Tab"];
switch-windows-backward = [ "<Shift><Alt>Tab" ];
};
"org/gnome/nautilus/preferences" = {
default-folder-viewer = "icon-view";
search-filter-time-type = "last_modified";
search-view = "list-view";
};
"org/gnome/shell/window-switcher" = {
app-icon-mode = "both";
current-workspace-only = true;
};
"org/gnome/shell" = {
favorite-apps = [
"org.gnome.Calendar.desktop"
"org.gnome.Nautilus.desktop"
"org.gnome.Console.desktop"
"firefox.desktop"
"vlc.desktop"
];
};
"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/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu://session" "qemu://system" ];
uris = [ "qemu://session" "qemu://system" ];
};
};
}
-13
View File
@@ -1,13 +0,0 @@
{ lib, pkgs, ... }:
{
programs.gnome-terminal = lib.mkIf ( pkgs.system != "x86_64-darwin") {
enable = true;
showMenubar = true;
themeVariant = "dark";
profile.default = {
default = true;
visibleName = "greg";
};
};
}
+6 -11
View File
@@ -1,10 +1,6 @@
name: { pkgs, lib, gui, config, ...}:
{ pkgs, lib, gui, gnome, ...}:
let
guiImports = if gui then
[ ./gui ] else [];
in {
{
imports = [
./modules
./ansible.nix
@@ -15,9 +11,11 @@ in {
./templates.nix
./vim.nix
./xonsh.nix
] ++ guiImports;
] ++ ( if gui then [ ./gui ] else []);
greg.gnome = gnome;
programs.tmux = {
enable = true;
keyMode = "vi";
@@ -35,21 +33,18 @@ in {
bitwarden-cli
diffutils
findutils
gh
git
gnupatch
gregpy
hms
htop
jq
nmap
nano
nmap
openssl
tmux
transcrypt
unzip
wget
yamllint
#yawsso
];
}
+1
View File
@@ -2,6 +2,7 @@
{
imports = [
./gnome.nix
./xonsh.nix
];
}
+62
View File
@@ -0,0 +1,62 @@
{ config, pkgs, lib, ... }:
let
gv = lib.hm.gvariant;
cfg = config.greg.gnome;
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.default = {
default = true;
visibleName = "greg";
};
};
dconf.settings = {
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
};
"org/gnome/desktop/wm/keybindings" = {
switch-applications = [];
switch-applications-backward = [];
switch-windows = ["<Alt>Tab"];
switch-windows-backward = [ "<Shift><Alt>Tab" ];
};
"org/gnome/nautilus/preferences" = {
default-folder-viewer = "icon-view";
search-filter-time-type = "last_modified";
search-view = "list-view";
};
"org/gnome/shell/window-switcher" = {
app-icon-mode = "both";
current-workspace-only = true;
};
"org/gnome/shell" = {
favorite-apps = [
"org.gnome.Calendar.desktop"
"org.gnome.Nautilus.desktop"
"org.gnome.Console.desktop"
"firefox.desktop"
"vlc.desktop"
];
};
"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/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu://session" "qemu://system" ];
uris = [ "qemu://session" "qemu://system" ];
};
};
});
}
+32 -155
View File
@@ -10,177 +10,54 @@ let
sha256 = "0hi1c5zv38hwxbyrf11fz97r728jgbppz4is7fwzwhfrzhwbw0ga";
};
};
vim-xonsh = pkgs.vimUtils.buildVimPlugin {
name = "vim-xonsh";
src = pkgs.fetchFromGitHub {
owner = "meatballs";
repo = "vim-xonsh";
rev = "2028aac";
sha256 = "sha256-0+dqtlz8LeyOoSiS12rv8aLdzOMj31PuYAyDYWnpNzw=";
};
};
in
{
programs.vim = {
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
plugins = with pkgs.vimPlugins; [
ansible-vim
bufexplorer
coc-cmake
coc-css
coc-go
coc-highlight
coc-html
coc-java
coc-json
coc-lists
coc-markdownlint
coc-nvim
coc-pyright
coc-tslint
coc-vimtex
coc-yaml
context-vim
direnv-vim
fzf-vim
nerdtree
vim-airline
vim-gitgutter
vim-flake8
vim-fugitive
vim-indent-guides
vim-packer
vim-rooter
vim-xonsh
gruvbox
syntastic
];
settings = {
background = "dark";
copyindent = true;
expandtab = false;
hidden = true;
ignorecase = true;
mouse = "a";
number = true;
relativenumber = true;
shiftwidth = 4;
smartcase = true;
tabstop = 4;
};
extraConfig = ''
syntax enable
set preserveindent
set softtabstop=0
set nowrap
set showcmd
set cursorline
set lazyredraw
set showmatch
set hlsearch
" Shows non-printing characters
set listchars=tab:\ ,extends:,precedes:,trail:·,eol:¬
set list
" Set filetype to the way I want it
let g:nix_recommended_style = 0
" Highlights bad whitespace
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
" Settings for CtrlP
set wildignore+=*.swp,*.pyc,*.class,.tox
" Settings for NerdTree
let NERDTreeIgnore = ['\.pyc$', '\.o$', '\.class$']
" indent guides
let g:indent_guides_enable_on_vim_startup = 1
autocmd! BufWritePost .vimrc source $MYVIMRC
" Tell syntastic to use yamllint
let g:syntastic_yaml_checkers = ['yamllint']
let g:syntastic_yaml_yamllint_args = []
let g:syntastic_shell = "${pkgs.bash}/bin/bash"
" Shortcuts for resolving git diff conflicts
let g:diffget_local_map = 'gl'
let g:diffget_upstream_map = 'gu'
" Key mappings
map <F2> <Esc>\be
map <F4> <Esc>:NERDTreeToggle<Cr>
silent !${pkgs.git}/bin/git rev-parse --is-inside-work-tree
if v:shell_error == 0
map <C-p> :GFiles --cached --others --exclude-standard<CR>
map <C-o> :GFiles?
else
map <C-p> :Files<CR>
endif
map <F6> <Esc>:Files<Cr>
" Allows navigating splits
map <C-j> <C-w>j<C-w><Cr>
map <C-k> <C-w>k<C-w><Cr>
map <C-h> <C-w>h<C-w><Cr>
map <C-l> <C-w>l<C-w><Cr>
colorscheme gruvbox
" ============================================================================
" User functions to just make life easier
" ============================================================================
" Toggle absolute line numbers when we don't have focus, and hybrid when
" we do have it
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
" syntax highlighting for Vagrantfiles
augroup vagrant
au!
au BufRead,BufNewFile Vagrantfile set filetype=ruby
augroup END
" Creates the directory for a file if it doesn't already exist.
function! s:MkNonExDir(file, buf)
if empty(getbufvar(a:buf, '&buftype')) && a:file!~#'\v^\w+\:\/'
let dir=fnamemodify(a:file, ':h')
if !isdirectory(dir)
call mkdir(dir, 'p')
endif
endif
endfunction
augroup BWCCreateDir
autocmd!
autocmd BufWritePre * :call s:MkNonExDir(expand('<afile>'), +expand('<abuf>'))
augroup END
" Return indent (all whitespace at start of a line), converted from
" tabs to spaces if what = 1, or from spaces to tabs otherwise.
" When converting to tabs, result has no redundant spaces.
function! Indenting(indent, what, cols)
let spccol = repeat(' ', a:cols)
let result = substitute(a:indent, spccol, '\t', 'g')
let result = substitute(result, ' \+\ze\t', ''', 'g')
if a:what == 1
let result = substitute(result, '\t', spccol, 'g')
endif
return result
endfunction
" Convert whitespace used for indenting (before first non-whitespace).
" what = 0 (convert spaces to tabs), or 1 (convert tabs to spaces).
" cols = string with number of columns per tab, or empty to use 'tabstop'.
" The cursor position is restored, but the cursor will be in a different
" column when the number of characters in the indent of the line is changed.
function! IndentConvert(line1, line2, what, cols)
let savepos = getpos('.')
let cols = empty(a:cols) ? &tabstop : a:cols
execute a:line1 . ',' . a:line2 . 's/^\s\+/\=Indenting(submatch(0), a:what, cols)/e'
call histdel('search', -1)
call setpos('.', savepos)
endfunction
command! -nargs=? -range=% Space2Tab call IndentConvert(<line1>,<line2>,0,<q-args>)
command! -nargs=? -range=% Tab2Space call IndentConvert(<line1>,<line2>,1,<q-args>)
command! -nargs=? -range=% RetabIndent call IndentConvert(<line1>,<line2>,&et,<q-args>)
"""""""""
""" Unused, but kept in case I end up on a system where I can't use my preferred plugins
"""""""""
" Base of search is ordered as
" r - searching up from here to the nearest marker (.git, .hg, .svn, etc)
" a - dir of current file, unless that's a subdirectory of CWD
" c - dir of current file
let g:ctrlp_working_path_mode = 'arc'
let g:ctrlp_switch_buffer = 0
let g:ctrlp_cmd = 'CtrlPMixed'
let g:ctrlp_show_hidden = 1
let g:ctrlp_user_command = {
\'types': {
\1: ['.git', '${pkgs.git}/bin/git ls-files --cached --exclude-standard --others' ],
\},
\'fallback': '${pkgs.findutils}/bin/find . -type f | ${pkgs.gnugrep}/bin/grep -v -e "\.tox/" -e "\.git/"',
\}
" let g:ctrpl_match_func = { 'match': 'pymatcher#PyMatch' }
" map <F6> <Esc>:CtrlP<Cr>
'';
extraConfig = builtins.readFile ./vimrc;
};
}
+304
View File
@@ -0,0 +1,304 @@
set background=dark
set copyindent
set noexpandtab
set hidden
set ignorecase
set mouse="a"
set number
set relativenumber
set shiftwidth=4
set smartcase
set tabstop=4
syntax enable
set preserveindent
set softtabstop=0
set nowrap
set showcmd
set cursorline
set lazyredraw
set showmatch
set hlsearch
set nobackup
set nowritebackup
set signcolumn=yes
" Milliseconds between updates
set updatetime=300
" Shows non-printing characters
set listchars=tab:→\ ,extends:→,precedes:←,trail,eol
set list
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""" coc.nnim configuration """""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" https://github.com/neoclide/coc.nvim
" Use tab for trigger completion with characters ahead and navigate.
" NOTE: There's always complete item selected by default, you may want to enable
" no select by `"suggest.noselect": true` in your configuration file.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice.
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
" Use `[g` and `]g` to navigate diagnostics
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window.
nnoremap <silent> K :call ShowDocumentation()<CR>
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code.
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder.
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap keys for applying codeAction to the current buffer.
nmap <leader>ac <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" Run the Code Lens action on the current line.
nmap <leader>cl <Plug>(coc-codelens-action)
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Remap <C-f> and <C-b> for scroll float windows/popups.
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
" Use CTRL-S for selections ranges.
" Requires 'textDocument/selectionRange' support of language server.
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)
" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocActionAsync('format')
" Add `:Fold` command to fold current buffer.
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" Add `:OR` command for organize imports of the current buffer.
command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport')
" Add (Neo)Vim's native statusline support.
" NOTE: Please see `:h coc-status` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline.
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Mappings for CoCList
" Show all diagnostics.
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
" Manage extensions.
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
" Show commands.
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
" Find symbol of current document.
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols.
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""" END coc.nnim configuration """""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set filetype to the way I want it
let g:nix_recommended_style = 0
" Highlights bad whitespace
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
" Settings for CtrlP
set wildignore+=*.swp,*.pyc,*.class,.tox
" Settings for NerdTree
let NERDTreeIgnore = ['\.pyc$', '\.o$', '\.class$']
" indent guides
let g:indent_guides_enable_on_vim_startup = 1
autocmd! BufWritePost .vimrc source $MYVIMRC
" Tell syntastic to use yamllint
let g:syntastic_yaml_checkers = ['yamllint']
let g:syntastic_yaml_yamllint_args = []
let g:syntastic_shell = "${pkgs.bash}/bin/bash"
" Shortcuts for resolving git diff conflicts
let g:diffget_local_map = 'gl'
let g:diffget_upstream_map = 'gu'
" Key mappings
map <F2> <Esc>\be
map <F4> <Esc>:NERDTreeToggle<Cr>
silent !git rev-parse --is-inside-work-tree
if v:shell_error == 0
map <C-p> :GFiles --cached --others --exclude-standard<CR>
map <C-o> :GFiles?
else
map <C-p> :Files<CR>
endif
map <F6> <Esc>:Files<Cr>
" Allows navigating splits
map <C-j> <C-w>j<C-w><Cr>
map <C-k> <C-w>k<C-w><Cr>
map <C-h> <C-w>h<C-w><Cr>
map <C-l> <C-w>l<C-w><Cr>
colorscheme gruvbox
" ============================================================================
" User functions to just make life easier
" ============================================================================
" Toggle absolute line numbers when we don't have focus, and hybrid when
" we do have it
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
" syntax highlighting for Vagrantfiles
augroup vagrant
au!
au BufRead,BufNewFile Vagrantfile set filetype=ruby
augroup END
" Creates the directory for a file if it doesn't already exist.
function! s:MkNonExDir(file, buf)
if empty(getbufvar(a:buf, '&buftype')) && a:file!~#'\v^\w+\:\/'
let dir=fnamemodify(a:file, ':h')
if !isdirectory(dir)
call mkdir(dir, 'p')
endif
endif
endfunction
augroup BWCCreateDir
autocmd!
autocmd BufWritePre * :call s:MkNonExDir(expand('<afile>'), +expand('<abuf>'))
augroup END
" Return indent (all whitespace at start of a line), converted from
" tabs to spaces if what = 1, or from spaces to tabs otherwise.
" When converting to tabs, result has no redundant spaces.
function! Indenting(indent, what, cols)
let spccol = repeat(' ', a:cols)
let result = substitute(a:indent, spccol, '\t', 'g')
let result = substitute(result, ' \+\ze\t', ''', 'g')
if a:what == 1
let result = substitute(result, '\t', spccol, 'g')
endif
return result
endfunction
" Convert whitespace used for indenting (before first non-whitespace).
" what = 0 (convert spaces to tabs), or 1 (convert tabs to spaces).
" cols = string with number of columns per tab, or empty to use 'tabstop'.
" The cursor position is restored, but the cursor will be in a different
" column when the number of characters in the indent of the line is changed.
function! IndentConvert(line1, line2, what, cols)
let savepos = getpos('.')
let cols = empty(a:cols) ? &tabstop : a:cols
execute a:line1 . ',' . a:line2 . 's/^\s\+/\=Indenting(submatch(0), a:what, cols)/e'
call histdel('search', -1)
call setpos('.', savepos)
endfunction
command! -nargs=? -range=% Space2Tab call IndentConvert(<line1>,<line2>,0,<q-args>)
command! -nargs=? -range=% Tab2Space call IndentConvert(<line1>,<line2>,1,<q-args>)
command! -nargs=? -range=% RetabIndent call IndentConvert(<line1>,<line2>,&et,<q-args>)
"""""""""
""" Unused, but kept in case I end up on a system where I can't use my preferred plugins
"""""""""
" Base of search is ordered as
" r - searching up from here to the nearest marker (.git, .hg, .svn, etc)
" a - dir of current file, unless that's a subdirectory of CWD
" c - dir of current file
let g:ctrlp_working_path_mode = 'arc'
let g:ctrlp_switch_buffer = 0
let g:ctrlp_cmd = 'CtrlPMixed'
let g:ctrlp_show_hidden = 1
let g:ctrlp_user_command = {
\'types': {
\1: ['.git', '${pkgs.git}/bin/git ls-files --cached --exclude-standard --others' ],
\},
\'fallback': '${pkgs.findutils}/bin/find . -type f | ${pkgs.gnugrep}/bin/grep -v -e "\.tox/" -e "\.git/"',
\}
" let g:ctrpl_match_func = { 'match': 'pymatcher#PyMatch' }
" map <F6> <Esc>:CtrlP<Cr>
+28 -23
View File
@@ -21,25 +21,6 @@ let
];
extraConfig = builtins.concatStringsSep "\n" [
"expand-hosts"
"domain=thehellings.lan"
"log-dhcp"
"log-queries"
"addn-hosts=/etc/adblock_hosts"
# "dhcp-range=eth0,10.42.0.1,10.42.1.255,255.255.0.0,static"
"dhcp-range=eth0,10.42.2.1,10.42.2.255,255.255.0.0,12h"
"dhcp-option=eth0,option:router,10.42.1.1"
"dhcp-option=eth0,option:dns-server,10.42.1.2,1.1.1.1"
"dhcp-option=eth0,option:domain-search,thehellings.lan"
"dhcp-range=vlan66@eth0,192.168.66.3,192.168.66.150,255.255.255.0,12h"
"dhcp-option=vlan66@eth0,option:router,192.168.66.1"
"dhcp-option=vlan66@eth0,option:dns-server,192.168.66.2"
"dhcp-range=vlan67@eth0,192.168.67.3,192.168.67.150,12h"
"dhcp-option=vlan67@eth0,option:router,192.168.67.1"
"dhcp-option=vlan67@eth0,option:dns-server,192.168.67.2"
];
in
{
@@ -47,10 +28,34 @@ in
services.dnsmasq = {
enable = true;
# Public AdGuard DNS servers
servers = [
"94.140.14.14"
"94.140.15.15"
];
settings = {
domain = "thehellings.lan";
dhcp-range = [
# "eth0,10.42.0.1,10.42.1.255,255.255.0.0,static"
"eth0,10.42.2.1,10.42.2.255,255.255.0.0,12h"
"vlan66@eth0,192.168.66.3,192.168.66.150,255.255.255.0,12h"
"vlan67@eth0,192.168.67.3,192.168.67.150,12h"
];
dhcp-option = [
"eth0,option:router,10.42.1.1"
"eth0,option:dns-server,10.42.1.2,1.1.1.1"
"eth0,option:domain-search,thehellings.lan"
"vlan66@eth0,option:router,192.168.66.1"
"vlan66@eth0,option:dns-server,192.168.66.2"
"vlan67@eth0,option:router,192.168.67.1"
"vlan67@eth0,option:dns-server,192.168.67.2"
];
expand-hosts = true;
log-dhcp = true;
log-queries = true;
addn-hosts = "/etc/adblock_hosts";
server = [
"94.140.14.14"
"94.140.15.15"
];
};
extraConfig = "${extraConfig}";
};
environment.systemPackages = [ pkgs.curl ];
+2
View File
@@ -17,6 +17,8 @@ in
"eufy"
"lovelace"
"nextcloud"
"smart_meter_texas"
"solaredge"
"tplink"
"wiz"
"zwave_js"
+103 -12
View File
@@ -1,12 +1,103 @@
U2FsdGVkX18oPFqz6C36wMep7NFLW1+gHEgSX2ltuQVRFUV5inWVu20TxSbwr5Lf
51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foAvvcEim8iyPk4lldyfW6tR3PCz/I0gTKK5K5h/cMbDKdgq8
APHfv1Y39fgNGnzGAjqcZHvUtxvSqs1n8tqGdht9wubkrLmiwTk/l+mRJ9RJJ3Dc
YTgAI4D1mnl6RfWjP55Prx9FTqy/y17FmLobcwsK1bkjsrCebFvh1es3JHCgArxb
KgkPfbe9h7l1K/khDWLdSvXPHfTeTbKio/5H0O56z9fYZgPfR1fxOKpRKv8v7j6m
VRFDToXd2KWcT0gzbdhp29kU7N6I9MMdBDyIxczhqfqm/387jzLPujEsU6rDa42y
bTgeeONDJhA+JVUrqLHd8qZPjC5sN2hJ0aRGdRXpEwPj/naQN2G5F0MPcGmYRmm7
1lLJD0JD08U26ONbX5uWZKOgBmNZyF+jMdX6AHtSlF0qJyCN6Kdiu3RIIrsa52Rq
eGkFVBH3hznyiriM9CgISYhNCIsT+MxL0fUb974OY7ykhP1jD00LWKHVumUsGdV2
s4k+9LAzOquTmlhKTOh85asLSfPqT0m5r6UQ3JXPdRFlCdyww/+sXZ2ds3bwkS5B
djP0OAqRxC2kIxGIWfQcfAs4dOAVCnlM+MHa18K4ztySoxnnOBs7Y2fUbraGnQpp
Q9cwVLa0h0dxvN8aIL765kXtTln8qLK/5kgfuLXqHWucfSj7IdIgRyexql7oQfH2
VBTk18bQQNLmFo7Fp5pi3soe0OF76j5wLUJD/rCm5nXsvxpICll6Zk7ESehnMPTV
k93Hi/jyHRLVUDxibNFBjoPKLRxEOFyNTVrHhT+NaetENFj4gWPfeMOq1jf9auEn
+0DLpO7zqO7dNbMHKTwRziRxu2S5flgNj4nwhO81iXqrIAZ3vi1k7QqXf009kl6X
ksyTVqvLxP73CCujwch/+g==
+10
View File
@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
wsl = {
enable = true;
wslConf.automount.root = "/mnt";
defaultUser = "greg";
startMenuLaunchers = true;
};
}
+11
View File
@@ -4,6 +4,17 @@
# Enable flakes
nix = {
package = pkgs.nixFlakes;
buildMachines = [
{
hostName = "dns.me.ts";
system = "aarch64-linux";
}
{
hostName = "jude.me.ts";
system = "x86_64-linux";
}
];
settings = {
experimental-features = "nix-command flakes";
+1
View File
@@ -14,6 +14,7 @@
hms # My own home manager switcher
home-manager
htop
killall
nano
pwgen
transcrypt
-1
View File
@@ -1 +0,0 @@
modules
-1
View File
@@ -2,7 +2,6 @@
{
imports = [
./syncthing.nix
./users.nix
];
}
-46
View File
@@ -1,46 +0,0 @@
{ ... }:
let
syncs = [
"nas"
"dns"
"linode"
];
in
{
services.syncthing = {
enable = true;
user = "greg";
group = "users";
dataDir = "/home/greg/sync";
devices = {
nas = {
addresses = [
"tcp://nas.thehellings.lan:22000"
"tcp://chronicles.greg-hellings.gmail.com.beta.tailscale.net:22000"
];
id = "74JUTZG-77EPGO3-FEYCL2P-CHDWP5G-6EXWZVB-XTAH6O5-TUXCVY2-QNRHSQ4";
};
dns = {
addresses = [
"tcp://dns.thehellings.lan:22000"
"tcp://2maccabees.greg-hellings.gmail.com.beta.tailscale.net:22000"
];
id = "C4XJCH7-3ZNW6XZ-R5DB2EU-OEGVVT2-WPHQAG7-UDWER36-6NO5KZR-4MN5VAK";
};
linode = {
addresses = [
"tcp://linode.thehellings.com:22000"
];
id = "ROZPUG5-G4IAXYA-JNRQXRD-5PFU2BQ-WVJTOGZ-DFMGJ5E-Q4IGXCJ-JHSNDQ6";
};
};
folders = {
"mkrvy-tc6x9" = {
path = "/home/greg/drive";
enable = true;
devices = syncs;
};
};
};
}
+3
View File
@@ -11,6 +11,9 @@ let
dateutil
flake8
ipython
jedi
mypy
pylint
pyyaml
responses
ruamel-yaml
+11 -7
View File
@@ -6,22 +6,25 @@ arch="$(uname -m)"
if [ "$(uname -s)" == "Darwin" ]; then
# On macOS
src="${HOME}/.config/nix/"
target="${arch}-darwin"
flavor="gui"
elif [ x"${WSL_DISTRO_NAME}" != "x" ]; then
src=/etc/nixos
flavor="cli"
else
# On Linux/WSL2 systems
# On Linux systems
if [ -z "${DISPLAY}" ]; then
target="${arch}-nogui"
flavor="cli"
else
target="${arch}-gui"
flavor="gdm"
fi
src=/etc/nixos
fi
# Build and switch
echo "Building ${target}"
echo "Building ${flavor}.${arch}"
dest=$(mktemp -d)
pushd "${dest}" > /dev/null
nix build --impure "${src}#homeConfigurations.${target}.activationPackage"
nix build "${src}#homeConfigurations.${flavor}.${arch}.activationPackage"
./result/activate
popd > /dev/null
rm -r "${dest}"
@@ -30,9 +33,10 @@ if [ "$(uname -s)" == "Darwin" ]; then
cd ~/.nix-profile/Applications
for app in *.app; do
echo "Updating permissions on '${app}'"
mkdir -p "${HOME}/Applications/${app}"
chmod -R u+w "${HOME}/Applications/${app}" || true
echo "Copying new version to Applications"
cp -r "${app}" "${HOME}/Applications" 2>&1 > /dev/null || true
rsync -rptgoDv "${app}/" "${HOME}/Applications/${app}/" 2>&1 > /dev/null || true
if [ "$?" != "0" ]; then
echo "An error occurred, proceeding anyway"
fi