apply nix-fmt

This commit is contained in:
John Bowdre 2024-12-19 19:30:06 -06:00
parent 1c79db0b42
commit 24472642b0
Signed by: john
SSH key fingerprint: SHA256:cZYnOxaLdo+MhBNMX38ihO/p2Kek6fBykSFoJwHBhUo
60 changed files with 335 additions and 451 deletions

View file

@ -47,8 +47,7 @@
systems = [ "x86_64-linux" "aarch64-linux" ];
forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys});
pkgsFor = nixpkgs.legacyPackages;
in
{
in {
inherit lib;
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;

View file

@ -1,7 +1,6 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
../modules/tui
] ++ (builtins.attrValues outputs.homeManagerModules);
{ outputs, lib, config, pkgs, ... }: {
imports = [ ../modules/tui ]
++ (builtins.attrValues outputs.homeManagerModules);
nixpkgs = {
overlays = builtins.attrValues outputs.overlays;
@ -24,9 +23,7 @@
homeDirectory = lib.mkDefault "/home/${config.home.username}";
stateVersion = lib.mkDefault "24.11";
sessionVariables = {
EDITOR = "nvim";
};
sessionVariables = { EDITOR = "nvim"; };
};
programs = {

View file

@ -1,10 +1,6 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
../global
];
{ ... }: {
imports = [ ../global ];
# packages
home.packages = with pkgs; [
];
# home.packages = with pkgs; [ ];
}

View file

@ -1,4 +1,4 @@
{ pkgs, lib, config, ... }: {
{ ... }: {
imports = [
../global
../modules/tui/extras
@ -7,6 +7,5 @@
];
# packages
home.packages = with pkgs; [
];
# home.packages = with pkgs; [ ];
}

View file

@ -1,13 +1,10 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
../global
../modules/tui/extras
../modules/gui
../lib/chromeos.nix
];
{ pkgs, ... }: {
imports =
[ ../global ../modules/tui/extras ../modules/gui ../lib/chromeos.nix ];
# extra packages
home.packages = with pkgs; [
home.packages = with pkgs;
[
dive # Explore docker images
];
}

View file

@ -1,4 +1,4 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
{ pkgs, ... }: {
imports = [
../global
../modules/tui/extras
@ -7,7 +7,5 @@
];
# packages
home.packages = with pkgs; [
vagrant
];
home.packages = with pkgs; [ vagrant ];
}

View file

@ -1,5 +1 @@
{ pkgs, inputs, outputs, lib, ... }: {
home.packages = with pkgs; [
google-chrome
];
}
{ pkgs, ... }: { home.packages = with pkgs; [ google-chrome ]; }

View file

@ -1,14 +1,6 @@
{ pkgs, ... }: {
# Common GUI apps
imports = [
./firefox.nix
./vscode.nix
];
imports = [ ./firefox.nix ./vscode.nix ];
home.packages = with pkgs; [
gimp-with-plugins
lagrange
qFlipper
remmina
];
home.packages = with pkgs; [ gimp-with-plugins lagrange qFlipper remmina ];
}

View file

@ -1,4 +1,4 @@
{ pkgs, lib, inputs, ... }:
{ pkgs, inputs, ... }:
let
addons = inputs.firefox-addons.packages.${pkgs.system};

View file

@ -1,15 +1,14 @@
{ config, outputs, pkgs, lib, ... }: {
{ config, pkgs, ... }: {
home.packages = with pkgs; [
hadolint
];
home.packages = with pkgs; [ hadolint ];
programs.vscode = {
enable = true;
enableExtensionUpdateCheck = false;
enableUpdateCheck = false;
package = pkgs.vscode;
extensions = with pkgs.vscode-extensions; [
extensions = with pkgs.vscode-extensions;
[
# extensions available as nix packages
bbenoist.nix
github.vscode-github-actions
@ -73,17 +72,20 @@
globalSnippets = {
"Insert datestamp" = {
prefix = [ "date" ];
body = ["\"\${CURRENT_YEAR}-\${CURRENT_MONTH}-\${CURRENT_DATE}\""];
body = [ ''"''${CURRENT_YEAR}-''${CURRENT_MONTH}-''${CURRENT_DATE}"'' ];
description = "Insert date";
};
"Insert timestamp" = {
prefix = [ "datetime" ];
body = ["\"\${CURRENT_YEAR}-\${CURRENT_MONTH}-\${CURRENT_DATE}T\${CURRENT_HOUR}:\${CURRENT_MINUTE}:\${CURRENT_SECOND}Z\""];
body = [
''
"''${CURRENT_YEAR}-''${CURRENT_MONTH}-''${CURRENT_DATE}T''${CURRENT_HOUR}:''${CURRENT_MINUTE}:''${CURRENT_SECOND}Z"''
];
description = "Insert date and time";
};
"Torchlight line number markup" = {
prefix = [ "torchlight" ];
body = ["torchlight! {\"lineNumbers\":true}"];
body = [ ''torchlight! {"lineNumbers":true}'' ];
description = "Enable Torchlight line numbers";
};
};
@ -91,62 +93,74 @@
{
key = "backspace";
command = "-markdown.extension.onBackspaceKey";
when = "editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && vim.mode != 'CommandlineInProgress' && vim.mode != 'EasyMotionInputMode' && vim.mode != 'EasyMotionMode' && vim.mode != 'Normal' && vim.mode != 'Replace' && vim.mode != 'SearchInProgressMode' && vim.mode != 'SurroundInputMode' && vim.mode != 'Visual' && vim.mode != 'VisualBlock' && vim.mode != 'VisualLine' && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
when =
"editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && vim.mode != 'CommandlineInProgress' && vim.mode != 'EasyMotionInputMode' && vim.mode != 'EasyMotionMode' && vim.mode != 'Normal' && vim.mode != 'Replace' && vim.mode != 'SearchInProgressMode' && vim.mode != 'SurroundInputMode' && vim.mode != 'Visual' && vim.mode != 'VisualBlock' && vim.mode != 'VisualLine' && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
}
{
key = "ctrl+shift+alt+down";
command = "-markdown.extension.onCopyLineDown";
when = "editorTextFocus && !editorReadonly && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
when =
"editorTextFocus && !editorReadonly && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
}
{
key = "ctrl+shift+alt+up";
command = "-markdown.extension.onCopyLineUp";
when = "editorTextFocus && !editorReadonly && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
when =
"editorTextFocus && !editorReadonly && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
}
{
key = "ctrl+enter";
command = "-markdown.extension.onCtrlEnterKey";
when = "editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
when =
"editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
}
{
key = "enter";
command = "-markdown.extension.onEnterKey";
when = "editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && vim.mode != 'CommandlineInProgress' && vim.mode != 'EasyMotionInputMode' && vim.mode != 'EasyMotionMode' && vim.mode != 'Normal' && vim.mode != 'Replace' && vim.mode != 'SearchInProgressMode' && vim.mode != 'SurroundInputMode' && vim.mode != 'Visual' && vim.mode != 'VisualBlock' && vim.mode != 'VisualLine' && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
when =
"editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && vim.mode != 'CommandlineInProgress' && vim.mode != 'EasyMotionInputMode' && vim.mode != 'EasyMotionMode' && vim.mode != 'Normal' && vim.mode != 'Replace' && vim.mode != 'SearchInProgressMode' && vim.mode != 'SurroundInputMode' && vim.mode != 'Visual' && vim.mode != 'VisualBlock' && vim.mode != 'VisualLine' && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
}
{
key = "ctrl+]";
command = "-markdown.extension.onIndentLines";
when = "editorTextFocus && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
when =
"editorTextFocus && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
}
{
key = "alt+down";
command = "-markdown.extension.onMoveLineDown";
when = "editorTextFocus && !editorReadonly && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
when =
"editorTextFocus && !editorReadonly && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
}
{
key = "alt+up";
command = "-markdown.extension.onMoveLineUp";
when = "editorTextFocus && !editorReadonly && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
when =
"editorTextFocus && !editorReadonly && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
}
{
key = "ctrl+[";
command = "-markdown.extension.onOutdentLines";
when = "editorTextFocus && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
when =
"editorTextFocus && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
}
{
key = "shift+enter";
command = "-markdown.extension.onShiftEnterKey";
when = "editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
when =
"editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
}
{
key = "shift+tab";
command = "-markdown.extension.onShiftTabKey";
when = "editorTextFocus && markdown.extension.editor.cursor.inList && !editorHasMultipleSelections && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
when =
"editorTextFocus && markdown.extension.editor.cursor.inList && !editorHasMultipleSelections && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
}
{
key = "tab";
command = "-markdown.extension.onTabKey";
when = "editorTextFocus && markdown.extension.editor.cursor.inList && !editorHasMultipleSelections && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !inlineSuggestionVisible && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
when =
"editorTextFocus && markdown.extension.editor.cursor.inList && !editorHasMultipleSelections && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !inlineSuggestionVisible && !markdown.extension.editor.cursor.inFencedCodeBlock && !markdown.extension.editor.cursor.inMathEnv && !suggestWidgetVisible && editorLangId =~ /^markdown$|^rmd$|^quarto$/";
}
];
languageSnippets = {
@ -154,37 +168,20 @@
"Insert SLS header" = {
isFileTemplate = true;
prefix = [ "sls" ];
body = [
"# -*- coding: utf-8 -*-"
"# vim: ft=yaml"
"---"
"\$0"
];
body = [ "# -*- coding: utf-8 -*-" "# vim: ft=yaml" "---" "$0" ];
};
};
jinja-html = {
"Insert jinja header" = {
isFileTemplate = true;
prefix = [ "jinja" ];
body = [
"# -*- coding: utf-8 -*-"
"# vim: ft=jinja"
"\$0"
];
body = [ "# -*- coding: utf-8 -*-" "# vim: ft=jinja" "$0" ];
};
};
};
userSettings = {
"autoalign.moveableItems" = [
"="
":"
"+="
"-="
];
"autoalign.nonMoveableItemsAdditional" = [
"ks="
"ds="
];
"autoalign.moveableItems" = [ "=" ":" "+=" "-=" ];
"autoalign.nonMoveableItemsAdditional" = [ "ks=" "ds=" ];
"diffEditor.ignoreTrimWhitespace" = false;
"editor.acceptSuggestionOnCommitCharacter" = false;
"editor.acceptSuggestionOnEnter" = "off";
@ -219,19 +216,15 @@
"powershell.promptToUpdatePowerShell" = false;
"security.workspace.trust.untrustedFiles" = "open";
"update.mode" = "none";
"vim.normalModeKeyBindings" = [
{
"vim.normalModeKeyBindings" = [{
"after" = [ "@q" ];
"before" = [ "Q" ];
}
];
}];
"vim.statusBarColorControl" = false;
"vim.useCtrlKeys" = false;
"window.restoreWindows" = "none";
"workbench.startupEditor" = "none";
"yaml.customTags" = [
"!reference sequence"
];
"yaml.customTags" = [ "!reference sequence" ];
"[markdown]" = {
"editor.defaultFormatter" = "yzhang.markdown-all-in-one";
"editor.quickSuggestions" = {

View file

@ -1,14 +1,7 @@
{ pkgs, ... }: {
# Core CLI apps
imports = [
./git.nix
./shell
./nix-index.nix
./neovim
./tmux.nix
./vim.nix
];
imports = [ ./git.nix ./shell ./nix-index.nix ./neovim ./tmux.nix ./vim.nix ];
home.packages = with pkgs; [
apg # Automatic password generator

View file

@ -1,10 +1,7 @@
{ pkgs, ... }: {
# Extra CLI apps
imports = [
../default.nix
./go.nix
];
imports = [ ../default.nix ./go.nix ];
home.packages = with pkgs; [
android-tools # Android SDK
@ -20,12 +17,8 @@
];
programs.fish = {
shellAbbrs = rec {
k = "kubectl";
};
shellAbbrs = rec { k = "kubectl"; };
functions = {
nugo = "hugo new content/posts/$argv/index.md";
};
functions = { nugo = "hugo new content/posts/$argv/index.md"; };
};
}

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }: {
{ pkgs, ... }: {
programs.go = {
enable = true;
package = pkgs.go;

View file

@ -1,8 +1,6 @@
{ lib, ... }:
let
email = lib.concatStringsSep "" [ "john@bo" "wdre.net" ];
in
{
let email = lib.concatStringsSep "" [ "john@bo" "wdre.net" ];
in {
programs.git = {
enable = lib.mkDefault true;
delta.enable = true;

View file

@ -16,18 +16,14 @@
# Enable spellcheck for some filetypes
{
event = "FileType";
pattern = [
"markdown"
];
pattern = [ "markdown" ];
command = "setlocal spell spelllang=en";
}
# Enable wrap for some filetypes
{
event = "FileType";
pattern = [
"markdown"
];
pattern = [ "markdown" ];
command = "setlocal wrap linebreak";
}
];

View file

@ -25,7 +25,8 @@
enable = true;
settings = {
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
snippet.expand =
"function(args) require('luasnip').lsp_expand(args.body) end";
mapping = {
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
@ -33,7 +34,8 @@
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.close()";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<S-Tab>" =
"cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<CR>" = "cmp.mapping.confirm({ select = true })";
};

View file

@ -17,10 +17,7 @@
performance = {
combinePlugins = {
enable = true;
standalonePlugins = [
"hmts.nvim"
"nvim-treesitter"
];
standalonePlugins = [ "hmts.nvim" "nvim-treesitter" ];
};
byteCompileLua.enable = true;
};

View file

@ -6,13 +6,10 @@
};
keymaps = let
normal =
lib.mapAttrsToList
(key: action: {
normal = lib.mapAttrsToList (key: action: {
mode = "n";
inherit action key;
})
{
}) {
"<Space>" = "<NOP>";
# Esc to clear search results
@ -46,13 +43,10 @@
"<M-k>" = ":move-2<CR>";
"<M-j>" = ":move+<CR>";
};
visual =
lib.mapAttrsToList
(key: action: {
visual = lib.mapAttrsToList (key: action: {
mode = "v";
inherit action key;
})
{
}) {
# better indenting
">" = ">gv";
"<" = "<gv";
@ -66,19 +60,14 @@
# sort
"<leader>s" = ":sort<CR>";
};
insert =
lib.mapAttrsToList
(key: action: {
insert = lib.mapAttrsToList (key: action: {
mode = "i";
inherit action key;
})
{
}) {
# Save by Ctrl+s
"<C-s>" = "<Esc>:w<CR>";
};
in
config.lib.nixvim.keymaps.mkKeymaps
{options.silent = true;}
in config.lib.nixvim.keymaps.mkKeymaps { options.silent = true; }
(normal ++ visual ++ insert);
};
}

View file

@ -1,9 +1,7 @@
{
programs.nixvim = {
clipboard = {
providers = {
xsel.enable = true;
};
providers = { xsel.enable = true; };
register = "unnamed";
};
@ -14,11 +12,15 @@
cursorline = true; # highlight the screen line of the cursor
expandtab = true; # expand <Tab> to spaces in Insert mode
fileencoding = "utf-8"; # file-content encoding for the current buffer
foldlevel = 99; # folds with a level higher than this number will be closed
foldlevel =
99; # folds with a level higher than this number will be closed
hidden = true; # Keep closed buffer open in the background
ignorecase = true; # when search query is lowercase match both lower and upper patterns
inccommand = "split"; # search and replace: preview changes in quickfix list
incsearch = true; # incremental search: show match for partly typed search command
ignorecase =
true; # when search query is lowercase match both lower and upper patterns
inccommand =
"split"; # search and replace: preview changes in quickfix list
incsearch =
true; # incremental search: show match for partly typed search command
laststatus = 3; # when to use a status line for the last window
modeline = true; # tags such as 'vim:ft=sh'
modelines = 5; # check first and last five lines for modelines
@ -29,14 +31,16 @@
scrolloff = 8; # number of lines to show around the cursor
shiftwidth = 2; # number of spaces used for each step of (auto)indent
signcolumn = "yes"; # whether to show the signcolumn
smartcase = true; # override ignorecase if search pattern containers upper case
smartcase =
true; # override ignorecase if search pattern containers upper case
spell = false; # highlight spelling mistakes
splitbelow = true; # A new window is put below the current one
splitright = true; # A new window is put right of the corrent one
swapfile = false; # Disable the swap file
tabstop = 2; # number of spaces a <Tab> in the text stands for
termguicolors = true; # enables 24-bit colors
textwidth = 0; # maximum width of text that is being inserted, a longer line will be broken after whitespace to this width
textwidth =
0; # maximum width of text that is being inserted, a longer line will be broken after whitespace to this width
undofile = true; # save and restore undo history
updatetime = 100; # Faster completion
wrap = false; # prevent wrapping text

View file

@ -1,7 +1,6 @@
{
programs.nixvim.plugins.comment = {
enable = true;
settings = {
opleader.line = "<C-_>";
toggler.line = "<C-_>";

View file

@ -1,12 +1,9 @@
{
programs.nixvim.plugins.floaterm = {
enable = true;
width = 0.8;
height = 0.8;
title = "";
keymaps.toggle = "<leader>,";
};
}

View file

@ -9,12 +9,10 @@
};
};
files."after/ftplugin/markdown.lua".keymaps = [
{
files."after/ftplugin/markdown.lua".keymaps = [{
mode = "n";
key = "<leader>m";
action = ":MarkdownPreview<cr>";
}
];
}];
};
}

View file

@ -4,13 +4,8 @@
settings = {
highlight = false;
trim_last_line = false;
ft_blocklist = [
"checkhealth"
"floaterm"
"lsipinfo"
"neo-tree"
"TelescopePrompt"
];
ft_blocklist =
[ "checkhealth" "floaterm" "lsipinfo" "neo-tree" "TelescopePrompt" ];
};
};
}

View file

@ -1,10 +1,10 @@
{ pkgs, lib, config, ... }:
{ lib, config, ... }:
let
inherit (lib) mkIf;
hasPackage = pname: lib.any (p: p ? pname && p.name == pname) config.home.packages;
hasPackage = pname:
lib.any (p: p ? pname && p.name == pname) config.home.packages;
hasFish = hasPackage "fish";
in
{
in {
programs.nix-index = {
enable = true;
enableFishIntegration = mkIf hasFish true;

View file

@ -1,6 +1,6 @@
{
cat = "bat";
ccat = "egrep -v '^\s*(#|\\$)'";
ccat = "egrep -v '^s*(#|\\$)'";
g = "git";
gg = "git graph";
gs = "git status";

View file

@ -1,12 +1,7 @@
{
imports = [
./eza.nix
./fish
];
imports = [ ./eza.nix ./fish ];
home = {
shellAliases = import ./aliases.nix;
};
home = { shellAliases = import ./aliases.nix; };
programs = {
zoxide = {
@ -23,9 +18,7 @@
bat = {
enable = true;
config = {
theme = "gruvbox-dark";
};
config = { theme = "gruvbox-dark"; };
};
};
}

View file

@ -2,9 +2,7 @@
programs.eza = {
enable = true;
enableFishIntegration = false;
extraOptions = [
"--group-directories-first"
];
extraOptions = [ "--group-directories-first" ];
git = true;
};

View file

@ -1,9 +1,5 @@
{ pkgs, ... }: {
imports = [
./abbrs.nix
./functions.nix
./shell-init.nix
];
imports = [ ./abbrs.nix ./functions.nix ./shell-init.nix ];
programs = {
fish = {
@ -27,9 +23,7 @@
enableTransience = true;
settings = {
container.disabled = true;
nix_shell = {
format = "via [$symbol]($style) ";
};
nix_shell = { format = "via [$symbol]($style) "; };
};
};
};

View file

@ -5,15 +5,20 @@
# Disable greeting
fish_greeting = "";
get-local-ip = "ip addr show $(ip route | grep default | awk '{print $5}') | grep 'inet ' | awk '{print $2}' | cut -d/ -f1";
get-local-ip =
"ip addr show $(ip route | grep default | awk '{print $5}') | grep 'inet ' | awk '{print $2}' | cut -d/ -f1";
ssh = "TERM=xterm command ssh $argv";
# Rebuild home-manager
switch-home = "home-manager switch -b backup --flake ${config.home.homeDirectory}/.dotfiles#$USER@$(hostname -s)";
switch-nix = "sudo nixos-rebuild switch --flake ${config.home.homeDirectory}/.dotfiles";
upgrade-nix = "nix-channel --update; nix-env --install --attr nixpkgs.nix nixpkgs.cacert";
switch-home =
"home-manager switch -b backup --flake ${config.home.homeDirectory}/.dotfiles#$USER@$(hostname -s)";
switch-nix =
"sudo nixos-rebuild switch --flake ${config.home.homeDirectory}/.dotfiles";
upgrade-nix =
"nix-channel --update; nix-env --install --attr nixpkgs.nix nixpkgs.cacert";
# Trees
tt = "cbonsai -S -t 0.25 -c \"&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,🌸,🌺,💮\"";
tt = ''
cbonsai -S -t 0.25 -c "&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,&,🌸,🌺,💮"'';
};
}

View file

@ -10,9 +10,7 @@
historyLimit = 100000;
keyMode = "vi";
mouse = true;
plugins = with pkgs.tmuxPlugins; [
tokyo-night-tmux
];
plugins = with pkgs.tmuxPlugins; [ tokyo-night-tmux ];
extraConfig = ''
# new panes inherit current working directory
bind '%' split-window -h -c '#{pane_current_path}'

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }: {
{ pkgs, ... }: {
programs.vim = {
enable = true;
# defaultEditor = true;

View file

@ -12,9 +12,7 @@
nixpkgs = {
overlays = builtins.attrValues outputs.overlays;
config = {
allowUnfree = true;
};
config = { allowUnfree = true; };
};
environment.enableAllTerminfo = true;

View file

@ -1,5 +1,4 @@
{ inputs, lib, ... }:
{
{ inputs, lib, ... }: {
nix = {
settings = {
trusted-users = [ "root" "@wheel" ];

View file

@ -1,5 +1,4 @@
{ lib, ... }:
{
{ lib, ... }: {
services.tailscale = {
enable = true;
useRoutingFeatures = lib.mkDefault "client";

View file

@ -1,5 +1 @@
{
virtualisation.docker = {
enable = true;
};
}
{ virtualisation.docker = { enable = true; }; }

View file

@ -9,9 +9,7 @@
wayland = true;
};
};
desktopManager = {
gnome.enable = true;
};
desktopManager = { gnome.enable = true; };
xkb.layout = "us";
xkb.variant = "";
};

View file

@ -1,5 +1 @@
{
virtualisation.libvirtd = {
enable = true;
};
}
{ virtualisation.libvirtd = { enable = true; }; }

View file

@ -1,5 +1 @@
{
services.printing = {
enable = true;
};
}
{ services.printing = { enable = true; }; }

View file

@ -1,3 +1 @@
{
services.sshd.enable = true;
}
{ services.sshd.enable = true; }

View file

@ -1,6 +1,4 @@
{
imports = [ ../global/tailscale.nix ];
services.tailscale = {
useRoutingFeatures = "both";
};
services.tailscale = { useRoutingFeatures = "both"; };
}

View file

@ -1,5 +1 @@
{
programs.wireshark = {
enable = true;
};
}
{ programs.wireshark = { enable = true; }; }

View file

@ -1,15 +1,12 @@
{ pkgs, config, ... }:
let ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in
{
let
ifTheyExist = groups:
builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in {
users.users.john = {
isNormalUser = true;
shell = pkgs.fish;
extraGroups = [
"audio"
"video"
"wheel"
] ++ ifTheyExist [
extraGroups = [ "audio" "video" "wheel" ] ++ ifTheyExist [
"docker"
"libvirtd"
"mysql"
@ -22,6 +19,7 @@ in
packages = [ pkgs.home-manager ];
};
home-manager.users.john = import ../../../../home/${config.networking.hostName}.nix;
home-manager.users.john =
import ../../../../home/${config.networking.hostName}.nix;
}

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: {
{ inputs, ... }: {
imports = [
inputs.hardware.nixosModules.common-cpu-intel
inputs.hardware.nixosModules.common-pc-ssd

View file

@ -1,13 +1,12 @@
{ config, lib, pkgs, modulesPath, ... }:
{ config, lib, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
availableKernelModules = [ "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
availableKernelModules =
[ "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
kernelModules = [ ];
};
kernelModules = [ "kvm-intel" ];
@ -21,7 +20,6 @@
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/b2c7656b-2292-4dc9-94f2-a66690a14969";
@ -33,13 +31,13 @@
};
};
swapDevices = [{
device = "/dev/disk/by-uuid/9cd48b44-07e5-4d0f-aaf0-7ca07e7b7945";
}];
swapDevices =
[{ device = "/dev/disk/by-uuid/9cd48b44-07e5-4d0f-aaf0-7ca07e7b7945"; }];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,8 +1,9 @@
# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file
# This is useful to avoid using channels when using legacy nix commands
let lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
in
import (fetchTarball {
let
lock =
(builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
in import (fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
})

View file

@ -1,13 +1,13 @@
# This file defines overlays
{ inputs, ... }:
{
{ inputs, ... }: {
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs { pkgs = final; };
# This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays
modifications = final: prev: {
modifications = final: prev:
{
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });

View file

@ -1,6 +1,7 @@
# Custom packages, that can be defined similarly to ones from nixpkgs
# You can build them using 'nix build .#example' or (legacy) 'nix-build -A example'
{ pkgs ? (import ../nixpkgs.nix) { } }: {
{ pkgs ? (import ../nixpkgs.nix) { } }:
{
# example = pkgs.callPackage ./example { };
}

View file

@ -1,8 +1,6 @@
{ lib, stdenv, fetchFromGitHub }:
let
pname = "trekscii";
in
stdenv.mkDerivation {
let pname = "trekscii";
in stdenv.mkDerivation {
inherit pname;
version = "unstable-2022-06-27";
@ -17,7 +15,5 @@ stdenv.mkDerivation {
install -Dm 0755 bin/trekscii $out/bin/trekscii
'';
meta = with lib; {
platforms = platforms.all;
};
meta = with lib; { platforms = platforms.all; };
}