aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2026-01-06 22:54:41 +0100
committerMartin Fischer <martin@push-f.com>2026-01-06 23:28:28 +0100
commit1c0fb275f3f302d6abc3ef560a80ceec8a8e6b8c (patch)
treee06201a62fa7fe8fff13d2919fa5b822bd79356f /nixos
parentd788e8e4eea02ba6a7ebdec54aa9120b82d05410 (diff)
refactor: move scripts to cmd50
Diffstat (limited to 'nixos')
-rw-r--r--nixos/npins/sources.json12
-rw-r--r--nixos/profiles/workstation/default.nix11
-rw-r--r--nixos/profiles/workstation/dev.nix3
-rw-r--r--nixos/profiles/workstation/graphical.nix20
-rwxr-xr-xnixos/profiles/workstation/scripts/deploy-dir17
-rw-r--r--nixos/profiles/workstation/scripts/reset-bg4
-rw-r--r--nixos/profiles/workstation/scripts/set-bg5
7 files changed, 20 insertions, 52 deletions
diff --git a/nixos/npins/sources.json b/nixos/npins/sources.json
index 73b3165..b011c48 100644
--- a/nixos/npins/sources.json
+++ b/nixos/npins/sources.json
@@ -27,6 +27,18 @@
"url": null,
"hash": "1mdgv6jfbjs3xsqk9dxli6w345jws8j5qgzqf6wljmxlvibbic6y"
},
+ "my-cmd50": {
+ "type": "Git",
+ "repository": {
+ "type": "Git",
+ "url": "https://git.push-f.com/cmd50"
+ },
+ "branch": "main",
+ "submodules": false,
+ "revision": "222b4dc884892d5927dabbab2b2b6e64d3244002",
+ "url": null,
+ "hash": "0md1n8rvbblqgi4bygp5hsw7nfp0xsjbac5jskkgsjwmj0lmygl3"
+ },
"my-geopos-link": {
"type": "Git",
"repository": {
diff --git a/nixos/profiles/workstation/default.nix b/nixos/profiles/workstation/default.nix
index 38b4723..3b24674 100644
--- a/nixos/profiles/workstation/default.nix
+++ b/nixos/profiles/workstation/default.nix
@@ -3,6 +3,7 @@
let
cfg = config.workstation;
sources = import <top/npins>;
+ cmd50 = (pkgs.callPackage sources.my-cmd50 {});
in
{
options.workstation = {
@@ -42,12 +43,16 @@ in
(callPackage "${sources.agenix}/pkgs/agenix.nix" {})
(callPackage sources.my-vdf {})
nixfmt-rfc-style
- restic
vim-full
- skim
- (writeShellScriptBin "ed" (builtins.readFile ./scripts/ed))
+ cmd50
+ (writeShellScriptBin "xdg-open" ''
+ ${cmd50}/bin/open "$@"
+ '')
+ (writeShellScriptBin "ed" (builtins.readFile ./scripts/ed))
+ restic
+ skim
unzip
# Android
diff --git a/nixos/profiles/workstation/dev.nix b/nixos/profiles/workstation/dev.nix
index 262c55e..e73309d 100644
--- a/nixos/profiles/workstation/dev.nix
+++ b/nixos/profiles/workstation/dev.nix
@@ -11,7 +11,6 @@
nix-direnv
# CLI tools
- skim
docker-compose
gnumake
jq
@@ -22,8 +21,6 @@
fastmod
license-generator
- (writeShellScriptBin "deploy-dir" (builtins.readFile ./scripts/deploy-dir))
-
gcc # rustc fails if cc linker isn't found
chromium
diff --git a/nixos/profiles/workstation/graphical.nix b/nixos/profiles/workstation/graphical.nix
index 3100e8a..c2a835e 100644
--- a/nixos/profiles/workstation/graphical.nix
+++ b/nixos/profiles/workstation/graphical.nix
@@ -53,11 +53,6 @@
grim
libnotify # for notify-send
- # When I ssh into a server my terminal changes to a host-specific background color via
- # a LocalCommand configured in ~/.ssh/config and a ZSH function to reset the color on exit.
- (writeShellScriptBin "set-bg" (builtins.readFile ./scripts/set-bg))
- (writeShellScriptBin "reset-bg" (builtins.readFile ./scripts/reset-bg))
-
# graphical tools
foot
imv
@@ -75,21 +70,6 @@
poweralertd
];
- # This generates /etc/xdg/mimeapps.list. The XDG spec and xdg-open don't support wildcards in MIME types.
- # TODO: use an xdg-open alternative that supports wildcards in MIME types and doesn't use mimeapps.list
- xdg.mime.defaultApplications =
- let
- defaultBrowser = "firefox.desktop";
- in
- {
- "text/html" = defaultBrowser;
- "application/pdf" = "org.pwmt.zathura.desktop";
-
- "x-scheme-handler/http" = defaultBrowser;
- "x-scheme-handler/https" = defaultBrowser;
- "x-scheme-handler/mailto" = "thunderbird.desktop";
- };
-
programs.thunderbird = {
enable = true;
};
diff --git a/nixos/profiles/workstation/scripts/deploy-dir b/nixos/profiles/workstation/scripts/deploy-dir
deleted file mode 100755
index f90a4ae..0000000
--- a/nixos/profiles/workstation/scripts/deploy-dir
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env bash
-# Replaces the contents of a remote directory with the contents of a local directory.
-
-if [ "$#" -ne 3 ]; then
- echo "usage: $0 <local_dir> <ssh_dest> <remote_dir>"
- exit 1
-fi
-printf -v remote_dir %q $3
-
-cd $1
-tar cf - . | ssh $2 "set -xe
-TEMP_DIR=\$(mktemp -d)
-cd \$TEMP_DIR
-tar xvf -
-rm -rf $remote_dir
-mv \$TEMP_DIR $remote_dir
-"
diff --git a/nixos/profiles/workstation/scripts/reset-bg b/nixos/profiles/workstation/scripts/reset-bg
deleted file mode 100644
index 049954d..0000000
--- a/nixos/profiles/workstation/scripts/reset-bg
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env bash
-# Resets the background color of the current foot terminal to the default.
-
-echo -en "\033]111\007"
diff --git a/nixos/profiles/workstation/scripts/set-bg b/nixos/profiles/workstation/scripts/set-bg
deleted file mode 100644
index 2ed0a78..0000000
--- a/nixos/profiles/workstation/scripts/set-bg
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-# Sets the background color of the current foot terminal to the given hex color.
-
-rgb_with_slashes=$(echo "$1" | sed -r 's,(..)(..),\1/\2/,')
-echo -en "\033]11;rgb:$rgb_with_slashes\007"