Merge pull request #6 from tomasriveral/laptop

PR from laptop to main
This commit is contained in:
2026-05-15 16:03:06 +02:00
committed by GitHub
12 changed files with 257 additions and 31 deletions
Generated
+19 -19
View File
@@ -11,11 +11,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1777726295, "lastModified": 1778125502,
"narHash": "sha256-Db9B3uTLDSj7zjQ4L3tIk9RcxHXbWRKw5fw8JozikyI=", "narHash": "sha256-QAAO9RCR6byVJi50l8RMVJWzrsNYbXonfR6tqU93vIQ=",
"owner": "caelestia-dots", "owner": "caelestia-dots",
"repo": "cli", "repo": "cli",
"rev": "a00e71d6b7572a8dbbb7945a45b79acf2401ad56", "rev": "7b8a4281aa8b2b12745de531cce0c65d87aea2e5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -33,11 +33,11 @@
"quickshell": "quickshell" "quickshell": "quickshell"
}, },
"locked": { "locked": {
"lastModified": 1777891103, "lastModified": 1778381004,
"narHash": "sha256-/b87CUV9NEh4YYtG6tGGbbSJurqkfwZQ5rZNiIBJWYw=", "narHash": "sha256-JwIlrajiY74obxyTMu/Ym6wOEQaCjpHwfziPK+E5u3Q=",
"owner": "caelestia-dots", "owner": "caelestia-dots",
"repo": "shell", "repo": "shell",
"rev": "54cdd80c1b7671deeb057cc554f83e436765596a", "rev": "2ca4ad4a434e91e73504debd5225e66dc5ebb2b6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -53,11 +53,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1777851538, "lastModified": 1778606796,
"narHash": "sha256-Gp8qwTEYNoy2yvmErVGlvLOQvrtEECCAKbonW7VJef8=", "narHash": "sha256-P2krpSkFVYJ89bgsnAZ9RtQiGwiTW77sfSJp9SEDscM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "cc09c0f9b7eaa95c2d9827338a5eb03d32505ca5", "rev": "e1fd7350f4410972bcb8c42a697d8c924ffe642a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -119,11 +119,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1777826146, "lastModified": 1778794387,
"narHash": "sha256-wQ/iN5Zp5VIa3ebBibijPnLyKhor+xEbDy4d0goa9Zs=", "narHash": "sha256-BL04pOS9453Awkeb9f90XBJXBSkWxN+vB7HIgnL0iMM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "73c703c22422b8951895a960959dbbaca7296492", "rev": "8a1b0127302ea51e05bf4ea5a291743fac442406",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -135,11 +135,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1777673416, "lastModified": 1778737229,
"narHash": "sha256-5c2POKPOjU40Kh0MirOdScBLG0bu9TAuPYAtPRNZMBs=", "narHash": "sha256-6xWoytx8jFW4PF1GjRm/i/53trbpKGfz6zjzQGBr4cI=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "26ef669cffa904b6f6832ab57b77892a37c1a671", "rev": "d7a713c0b7e47c908258e71cba7a2d77cc8d71d5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -157,11 +157,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1777706159, "lastModified": 1778222427,
"narHash": "sha256-TuD8hw9lkRCEb+6v93iB7HDvcmvH8R0qyD6wBmPGfv8=", "narHash": "sha256-6GFiP611nEJvtm+m03sMyfaVIJ9QOCi//hS+PPKyyPA=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "8db8ca1fecfcce8def1f9265fa1742baa0e0c271", "rev": "d1760ed1f31c02a95b37a9bf4084129c829ebe7f",
"revCount": 813, "revCount": 817,
"type": "git", "type": "git",
"url": "https://git.outfoxxed.me/outfoxxed/quickshell" "url": "https://git.outfoxxed.me/outfoxxed/quickshell"
}, },
+19 -5
View File
@@ -22,7 +22,8 @@
../../hostsModules/laptop/nixos/disk.nix ../../hostsModules/laptop/nixos/disk.nix
../../modules/nixos/printer.nix ../../modules/nixos/printer.nix
../../hostsModules/laptop/nixos/ollama.nix # llm config ../../hostsModules/laptop/nixos/ollama.nix # llm config
../../modules/nixos/mullvad.nix # vpn config ../../modules/nixos/mullvad.nix # vpn config
../../hostsModules/laptop/nixos/autoUpdate.nix # auto update the flakes. Handles notification via libnotify and matrix-commander-rs
]; ];
@@ -162,6 +163,20 @@
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
# removes need for password for nixos-rebuild
security.sudo.extraRules = [
{
users = [ "tomasr" ];
commands = [
{
command = "/run/current-system/sw/bin/nixos-rebuild";
options = [ "NOPASSWD" ];
}
];
}
];
#adds nixos experimental features: #adds nixos experimental features:
nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings.experimental-features = ["nix-command" "flakes"];
@@ -235,7 +250,7 @@
networkx networkx
scipy scipy
])) ]))
iamb # matrix client fluffychat matrix-commander-rs # matrix client
direnv direnv
# utils for dev # utils for dev
pkg-config pkg-config
@@ -268,10 +283,9 @@
papirus-folders papirus-folders
inkscape inkscape
birdtray # thunderbird tray app birdtray # thunderbird tray app
#vivify # for NoteWrapper
# this is more up to date # this is more up to date
(callPackage ../../modules/packages/vivify.nix {}) #(callPackage ../../modules/packages/vivify.nix {})
(callPackage ../../modules/packages/sbb-tui.nix {}) #(callPackage ../../modules/packages/sbb-tui.nix {})
pkgs-unstable.nixpkgs-review pkgs-unstable.nixpkgs-review
pkgs-unstable.nixfmt-tree pkgs-unstable.nixfmt-tree
pkgs-unstable.treefmt pkgs-unstable.treefmt
+4
View File
@@ -68,6 +68,10 @@
(pkgs.callPackage ../../modules/scripts/dontkillsteam.nix {}) # kill app (if it is steam put it in some background (pkgs.callPackage ../../modules/scripts/dontkillsteam.nix {}) # kill app (if it is steam put it in some background
(pkgs.callPackage ../../hostsModules/laptop/scripts/batterynotify.nix {}) (pkgs.callPackage ../../hostsModules/laptop/scripts/batterynotify.nix {})
(pkgs.callPackage ../../hostsModules/laptop/scripts/batterywarning.nix {}) (pkgs.callPackage ../../hostsModules/laptop/scripts/batterywarning.nix {})
# checks if matrix-commander-rs is installed and logged in
(pkgs.callPackage ../../hostsModules/laptop/scripts/checkMatrix.nix {})
(pkgs.callPackage ../../modules/scripts/weather.nix {}) (pkgs.callPackage ../../modules/scripts/weather.nix {})
(pkgs.callPackage ../../modules/scripts/wallpaper.nix {}) (pkgs.callPackage ../../modules/scripts/wallpaper.nix {})
(pkgs.callPackage ../../modules/scripts/mountkdrive.nix {}) (pkgs.callPackage ../../modules/scripts/mountkdrive.nix {})
+2 -2
View File
@@ -5,8 +5,8 @@
}: { }: {
programs.zsh = { programs.zsh = {
shellAliases = { shellAliases = {
snrt = "git add -A && sudo nixos-rebuild test --flake ~/nixos/#laptop"; snrt = "git add -A && time sudo nixos-rebuild test --flake ~/nixos/#laptop";
snrs = "git add -A && sudo nixos-rebuild switch --flake ~/nixos/#laptop"; snrs = "git add -A && time sudo nixos-rebuild switch --flake ~/nixos/#laptop";
}; };
}; };
} }
+47
View File
@@ -0,0 +1,47 @@
{ pkgs, ... }:
{
# Ensure your script is available system-wide
environment.systemPackages = [
(pkgs.callPackage ../scripts/autoUpdate.nix {})
];
users.users.tomasr = {
linger = true; # lingering is required
};
systemd.user.services.custom-autoupdate = {
description = "NixOS flake auto update";
serviceConfig = {
Type = "oneshot";
ExecStart = "/run/current-system/sw/bin/custom-autoupdate";
# safety for long rebuilds
TimeoutStartSec = "45min";
TimeoutStopSec = "10min";
# avoid overlap
RemainAfterExit = true;
# tweaks that should make the system run normally during the rebuilds
Nice = 10;
IOSchedulingClass = "best-effort";
IOSchedulingPriority = 7;
};
};
# Systemd USER timer
systemd.user.timers.custom-autoupdate = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "Fri *-*-* 20:00:00"; # runs friday night. If for whatever reason something breaks. I have whole week-end to fix it.
Persistent = true; # if it happens during shutted down
# avoids thundering herd on boot
RandomizedDelaySec = "2h";
};
};
}
@@ -0,0 +1,63 @@
{
pkgs,
...
}:
pkgs.writeShellApplication {
name = "custom-autoupdate";
runtimeInputs = with pkgs; [
git
nixos-rebuild
matrix-commander-rs
libnotify
];
text = ''
set -e
FLAKE_DIR="/home/tomasr/nixos"
FLAKE="$FLAKE_DIR#laptop"
TIME=$(date -u +"%Y-%m-%dT%H-%M-%SZ")
ERROR_FILE=$(mktemp)
# snapshot current state
git -C "$FLAKE_DIR" add -A
git -C "$FLAKE_DIR" commit --allow-empty -m "snapshot pre-autoupdate-$TIME"
git -C "$FLAKE_DIR" tag "pre-autoupdate-$TIME" HEAD
# update lock only
nix flake update --flake "$FLAKE_DIR"
if sudo nixos-rebuild switch --flake "$FLAKE" 2> "$ERROR_FILE"; then
if ! git -C "$FLAKE_DIR" diff --quiet -- flake.lock; then
git -C "$FLAKE_DIR" add flake.lock
git -C "$FLAKE_DIR" commit -m "flake.lock: autoupdate-$TIME"
git -C "$FLAKE_DIR" push
notify-send "Flake autoupdate" "Rebuild OK"
matrix-commander-rs --verbose -m "Flake rebuild succesfull.<br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
--html \
-r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU"
else
notify-send "Flake autoupdate" "No changes"
git -C "$FLAKE_DIR" push
fi
else
ERROR_MSG=$(cat "$ERROR_FILE")
notify-send -u critical "Flake autoupdate" "FAILED"
matrix-commander-rs --verbose -m "Flake rebuild failed.<br>Error: <pre>$ERROR_MSG</pre><br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
--html \
-r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU"
git -C "$FLAKE_DIR" reset --hard "pre-autoupdate-$TIME"
fi
rm -f "$ERROR_FILE"
'';
}
@@ -0,0 +1,21 @@
{ pkgs }:
pkgs.writeShellApplication {
name = "custom-checkMatrix";
runtimeInputs = [
pkgs.matrix-commander-rs
pkgs.libnotify
];
text = ''
expected="@totorile1:unredacted.org"
current="$(matrix-commander-rs --whoami | tr -d '\n')"
if [ "$current" != "$expected" ]; then
notify-send "matrix-commander-rs" \
"You are not logged in as @totorile1:unredacted.org\nLog:\n$current"
fi
'';
}
+2 -1
View File
@@ -218,6 +218,7 @@ in {
"custom-mountkdrive" "custom-mountkdrive"
#"waybar" #"waybar"
"custom-gitnotify" "custom-gitnotify"
"custom-checkMatrix" # checks if matrix-commander-rs is connected which is important for other stuff
#"custom-obsidianbackup" # backups the obsidian notes to kdrive and to a timed hidden dir (~/.Notes.backup/) #"custom-obsidianbackup" # backups the obsidian notes to kdrive and to a timed hidden dir (~/.Notes.backup/)
#"QS-notifycache" # builds the cache that will be used for the notification history #"QS-notifycache" # builds the cache that will be used for the notification history
"sleep 4 & caelestia-shell" #works better if it sleeps a bit before "sleep 4 & caelestia-shell" #works better if it sleeps a bit before
@@ -234,7 +235,7 @@ in {
###################### ######################
*/ */
]; ];
splash = false; # remove default background on startup splash = true; # remove default background on startup
# gestures (also keybindings) # gestures (also keybindings)
gesture = [ gesture = [
"3, right, move, +col" "3, right, move, +col"
+12
View File
@@ -314,6 +314,18 @@
keyword = "AI writing"; keyword = "AI writing";
url = "https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing"; url = "https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing";
} }
{
name = "nixpkgs-review-gha";
tags = [ "nixpkgs-review" "gha" ];
keyword = "nixpkgs-review";
url = "https://github.com/tomasriveral/nixpkgs-review-gha/actions/workflows/review.yml";
}
{
name = "nixpkgs tracker";
tags = [ "nixpkgs" "tracker" ];
keyword = "nixpkgs tracker";
url = "https://nixpk.gs/pr-tracker.html";
}
]; ];
}; };
search = { search = {
+4 -2
View File
@@ -1,6 +1,5 @@
{ {
config, pkgs-unstable,
pkgs,
... ...
}: { }: {
home.file.".config/vivify/config.json" = { home.file.".config/vivify/config.json" = {
@@ -13,6 +12,9 @@
} }
}''; }'';
}; };
home.packages = [
pkgs-unstable.vivify
];
programs.qutebrowser = { programs.qutebrowser = {
enable = true; enable = true;
settings = { settings = {
+62
View File
@@ -0,0 +1,62 @@
{ pkgs, ... }:
{
# Ensure your script is available system-wide
environment.systemPackages = [
(pkgs.callPackage ./custom-autoupdate.nix {})
];
# ----------------------------
# 🔥 Enable lingering for user services (IMPORTANT)
# ----------------------------
users.users.tomasr = {
isNormalUser = true;
# other config...
linger = true; # <-- declarative equivalent of `loginctl enable-linger`
};
# ----------------------------
# ✅ 2. Systemd USER service
# ----------------------------
systemd.user.services.custom-autoupdate = {
description = "NixOS flake auto update";
serviceConfig = {
Type = "oneshot";
ExecStart = "/run/current-system/sw/bin/custom-autoupdate";
# safety for long rebuilds
TimeoutStartSec = "45min";
TimeoutStopSec = "10min";
# avoid overlap
RemainAfterExit = true;
# 🔥 recommended reliability tweaks
Nice = 10;
IOSchedulingClass = "best-effort";
IOSchedulingPriority = 7;
};
};
# ----------------------------
# ⏱️ 3. Systemd USER timer
# ----------------------------
systemd.user.timers.custom-autoupdate = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "10min"; # run after boot
OnUnitActiveSec = "6h"; # every 6 hours
# 🔥 ensures missed runs after shutdown happen
Persistent = true;
# avoids thundering herd on boot
RandomizedDelaySec = "30min";
};
};
}
+2 -2
View File
@@ -8,13 +8,13 @@
buildGoModule (finalAttrs: { buildGoModule (finalAttrs: {
pname = "sbb-tui"; pname = "sbb-tui";
version = "1.14.1"; version = "1.14.2";
__structuredAttrs = true; __structuredAttrs = true;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Necrom4"; owner = "Necrom4";
repo = "sbb-tui"; repo = "sbb-tui";
tag = "v${finalAttrs.version}"; tag = "v${finalAttrs.version}";
hash = "sha256-nXkzy5PDR3MRrA0Hsh6/icjAbYyBR2q7oBn74ir1O3E="; hash = lib.fakeHash;
}; };
vendorHash = "sha256-K4DOu3rfSlKAa5JNKCzWWpnWZlXXxtN5Po7p1Spqe1w="; vendorHash = "sha256-K4DOu3rfSlKAa5JNKCzWWpnWZlXXxtN5Po7p1Spqe1w=";