Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): routine update #141

Merged
merged 13 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# shellcheck shell=bash

if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url \
'https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc' \
'sha256-0EVQVNSRQWsln+rgPW3mXVmnF5sfcmKEYOmOSfLYxHg='
fi

use flake

# list anything that requires re-generating .pre-commit-config.yaml
watch_file nix/style.nix
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
flake:
strategy:
matrix:
runners: [ubuntu-latest, macos-latest, macos-13]
runners: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.runners }}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/.direnv
/.pre-commit-config.yaml
/result
/result-*
/update-git-commits.txt
Expand Down
1 change: 1 addition & 0 deletions ansible/.envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# shellcheck shell=bash
use flake '..#ansible'
use vim
34 changes: 17 additions & 17 deletions files/.config/Code/User/settings.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
// Telemetry
"telemetry.enableTelemetry": false,
"telemetry.enableCrashReporter": false,
"update.channel": "none",
// Telemetry
"telemetry.enableTelemetry": false,
"telemetry.enableCrashReporter": false,
"update.channel": "none",

"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": true,
"editor.minimap.enabled": true,
"editor.minimap.renderCharacters": false,
"editor.renderIndentGuides": true,
"workbench.colorTheme": "Monokai",
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": true,
"editor.minimap.enabled": true,
"editor.minimap.renderCharacters": false,
"editor.renderIndentGuides": true,
"workbench.colorTheme": "Monokai",

"[cpp]": {
"editor.quickSuggestions": false
},
"[c]": {
"editor.quickSuggestions": false
}
"[cpp]": {
"editor.quickSuggestions": false
},
"[c]": {
"editor.quickSuggestions": false
}
}
4 changes: 1 addition & 3 deletions files/.config/nixpkgs/config.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
allowUnfree = true;
}
{ allowUnfree = true; }
15 changes: 8 additions & 7 deletions files/.config/ranger/scope.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
# Meaningful aliases for arguments:
path="$1" # Full path of the selected file
width="$2" # Width of the preview pane (number of fitting characters)
height="$3" # Height of the preview pane (number of fitting characters)
cached="$4" # Path that should be used to cache image previews
# height="$3" # Height of the preview pane (number of fitting characters)
# cached="$4" # Path that should be used to cache image previews
preview_images="$5" # "True" if image previews are enabled, "False" otherwise.

maxln="${LINES:-200}" # Stop after $maxln lines. Can be used like ls | head -n $maxln

# Find out something about the file:
mimetype="$(file --mime-type -Lb "$path")"
extension="$(echo "${path##*.}")"
extension="${path##*.}"
extension="$(echo "$extension" | awk '{print tolower($0)}')"
basename="${path##*/}"
basename="${basename%.*}"
Expand All @@ -48,6 +48,7 @@ dump() { echo "$output"; }
trim() { head -n "$maxln"; }

# wraps highlight to treat exit code 141 (killed by SIGPIPE) as success
# shellcheck disable=SC2317
safepipe() { "$@"; test $? = 0 -o $? = 141; }

# Image previews, if enabled in ranger.
Expand Down Expand Up @@ -84,7 +85,7 @@ case "$extension" in
# PDF documents:
pdf)
try pdftotext -l 10 -nopgbrk -q "$path" - && \
{ dump | trim | fmt -s -w $width; exit 0; } || exit 1;;
{ dump | trim | fmt -s -w "$width"; exit 0; } || exit 1;;
# BitTorrent Files
torrent)
try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;;
Expand All @@ -93,9 +94,9 @@ case "$extension" in
try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;;
# HTML Pages:
htm|html|xhtml)
try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
try lynx -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
try elinks -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
try w3m -dump "$path" && { dump | trim | fmt -s -w "$width"; exit 4; }
try lynx -dump "$path" && { dump | trim | fmt -s -w "$width"; exit 4; }
try elinks -dump "$path" && { dump | trim | fmt -s -w "$width"; exit 4; }
;; # fall back to highlight/cat if the text browsers fail
# TXT Files
txt)
Expand Down
2 changes: 1 addition & 1 deletion files/.local/opt/tldr
Submodule tldr updated 3235 files
99 changes: 81 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-compat.follows = "flake-compat";
};
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
Expand All @@ -33,7 +40,6 @@
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
};
Expand Down
1 change: 0 additions & 1 deletion nix/darwin/machines/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ in
# By default Nix-Darwin would look for a configuration whose name matches
# its hostname.
ci = importDarwin ./ci.nix { pkgs = pkgsFor "aarch64-darwin"; };
ci-amd64 = importDarwin ./ci.nix { pkgs = pkgsFor "x86_64-darwin"; };
};
}
23 changes: 2 additions & 21 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ let
(importApply ./config.nix { inherit inputs; })
(importApply ./nixpkgs.nix { inherit inputs; })
(importApply ./lib/flake-module.nix { inherit inputs; })
(importApply ./packages/flake-modules.nix { inherit inputs; })
];
checks = ./checks.nix;
style = ./style.nix;
};
in
{
imports = lib.attrValues flakeModules ++ [
inputs.flake-parts.flakeModules.flakeModules
inputs.treefmt-nix.flakeModule
./apps
./darwin
./devshells
Expand All @@ -35,24 +36,4 @@ in
flake = {
inherit flakeModules;
};

perSystem =
{ pkgs, ... }:
{
treefmt = {
projectRootFile = "flake.nix";
programs = {
nixfmt-rfc-style.enable = true;
shellcheck.enable = true;
prettier = {
enable = true;
settings.proseWrap = "always";
};
};
settings.formatter.shellcheck.options = [
"--external-sources"
"--source-path=SCRIPTDIR"
];
};
};
}
4 changes: 1 addition & 3 deletions nix/devshells/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
}:
{
devShells = {
default = pkgs.callPackage ./shell.nix {
formatters = [ self'.formatter ] ++ (lib.attrValues config.treefmt.build.programs);
};
default = pkgs.callPackage ./shell.nix { inherit config; };

ansible = pkgs.callPackage ./ansible.nix { };

Expand Down
7 changes: 5 additions & 2 deletions nix/devshells/shell.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{ mkShellNoCC, formatters }:
{ config, mkShellNoCC }:

mkShellNoCC { nativeBuildInputs = formatters; }
mkShellNoCC {
inherit (config.treefmt.build.devShell) nativeBuildInputs;
shellHook = config.pre-commit.installationScript;
}
Loading