Compare commits

91 Commits

Author SHA1 Message Date
bc405d562b Update flake.lock 2025-04-28 2025-07-13 00:30:45 +00:00
ceea87ad5b Update flake.lock 2025-04-27 2025-07-13 00:30:45 +00:00
851c8c797d Update flake.lock 2025-04-26 2025-07-13 00:30:45 +00:00
f542f84b38 Update flake.lock 2025-04-25 2025-07-13 00:30:45 +00:00
ed5b4cbd14 Update flake.lock 2025-04-24 2025-07-13 00:30:45 +00:00
761015b478 Update flake.lock 2025-04-23 2025-07-13 00:30:45 +00:00
20eaa0dae3 Update flake.lock 2025-04-22 2025-07-13 00:30:45 +00:00
f5dd2ecc82 Update flake.lock 2025-04-21 2025-07-13 00:30:45 +00:00
f9b71edc81 Update flake.lock 2025-04-20 2025-07-13 00:30:45 +00:00
7719c812bd Update flake.lock 2025-04-19 2025-07-13 00:30:45 +00:00
3c027501c5 Update flake.lock 2025-04-18 2025-07-13 00:30:45 +00:00
d65b916d40 Update flake.lock 2025-04-17 2025-07-13 00:30:45 +00:00
a1cde5ef34 Update flake.lock 2025-04-16 2025-07-13 00:30:45 +00:00
686906cf77 Update flake.lock 2025-04-15 2025-07-13 00:30:45 +00:00
37f986cefc Update flake.lock 2025-04-14 2025-07-13 00:30:45 +00:00
1dcef60e92 Update flake.lock 2025-04-13 2025-07-13 00:30:45 +00:00
5970fcabc8 Update flake.lock 2025-04-12 2025-07-13 00:30:45 +00:00
766d18ad52 Update flake.lock 2025-04-11 2025-07-13 00:30:45 +00:00
47c02828e3 Update flake.lock 2025-04-10 2025-07-13 00:30:45 +00:00
5fff601b29 Update flake.lock 2025-04-09 2025-07-13 00:30:45 +00:00
04236cf485 Update flake.lock 2025-04-08 2025-07-13 00:30:45 +00:00
fcf95d1430 Update flake.lock 2025-04-07 2025-07-13 00:30:45 +00:00
12798ff1a1 Update flake.lock 2025-04-06 2025-07-13 00:30:45 +00:00
01572c6f3d Update flake.lock 2025-04-05 2025-07-13 00:30:45 +00:00
cde1265492 Update flake.lock 2025-04-04 2025-07-13 00:30:45 +00:00
225743b432 Update flake.lock 2025-04-03 2025-07-13 00:30:45 +00:00
ac5a7b1954 Update flake.lock 2025-04-02 2025-07-13 00:30:45 +00:00
b1ba5f6dfc Update flake.lock 2025-04-01 2025-07-13 00:30:45 +00:00
c36161b19e Update flake.lock 2025-03-31 2025-07-13 00:30:45 +00:00
593cb43662 Update flake.lock 2025-03-30 2025-07-13 00:30:45 +00:00
a9045fe86a Update flake.lock 2025-03-29 2025-07-13 00:30:45 +00:00
b001afa40d Update flake.lock 2025-03-28 2025-07-13 00:30:45 +00:00
d54beba986 Update flake.lock 2025-03-27 2025-07-13 00:30:45 +00:00
784fdf8af1 Update flake.lock 2025-03-26 2025-07-13 00:30:45 +00:00
536120fadc Update flake.lock 2025-03-25 2025-07-13 00:30:45 +00:00
ac47c73bf1 Update flake.lock 2025-03-24 2025-07-13 00:30:45 +00:00
2d1109d012 Update flake.lock 2025-03-23 2025-07-13 00:30:45 +00:00
c543bc13ea hm: disable warn-dirty
Some checks failed
Update Nix Flake / update-flake (push) Failing after 14s
2025-07-12 15:52:17 +02:00
b4d1681b99 hyprland: fix waybar by running it with exec-once 2025-07-12 15:51:43 +02:00
6c32ffbe94 frajul-auto-upgrade: only run once a day
Some checks failed
Update Nix Flake / update-flake (push) Failing after 14s
2025-07-11 16:22:17 +02:00
6787243414 flake: update 2025-07-11 13:15:42 +02:00
d350807e8c builder: do enable auto-upgrades 2025-07-11 13:15:25 +02:00
f872c8db0c aspi: enable frajul auto upgrade module and integrate into waybar 2025-07-11 13:15:02 +02:00
8c53c66c4d Add frajul-auto-upgrade module 2025-07-11 13:14:48 +02:00
0f07029660 Add openconnect plugin to networkmanager
Some checks failed
Update Nix Flake / update-flake (push) Failing after 17s
2025-07-10 17:50:34 +02:00
8010d771a1 builder: add gitlab-runner
Some checks failed
Update Nix Flake / update-flake (push) Failing after 17s
2025-07-09 21:34:52 +02:00
7f4c41429e update flake
Some checks failed
Update Nix Flake / update-flake (push) Failing after 15s
2025-07-04 14:44:51 +02:00
6d21fe4262 format code 2025-07-04 14:44:31 +02:00
c081f95aaf open-messaging: adapt to new telegram program name 2025-07-04 14:44:01 +02:00
452a34c7e8 Neovim: add clangd 2025-07-04 14:43:51 +02:00
15c4616b91 Fix emacs not having TERMINAL env var 2025-07-04 14:43:45 +02:00
07274a0364 Update alacritty config, use as default 2025-07-04 14:41:58 +02:00
3bb8db1349 Fix builder using itself as remote subsituter 2025-07-04 14:40:58 +02:00
65a3dcdc08 Use ghostty as primary terminal
Some checks failed
Update Nix Flake / update-flake (push) Failing after 16s
2025-06-30 08:37:24 +02:00
9fe40bfd13 package rtklib 2025-05-26 21:51:07 +02:00
07943d4f95 format file
Some checks failed
Update Nix Flake / update-flake (push) Failing after 12s
2025-05-23 09:59:30 +02:00
815a79ff41 kardorf: fix seahorse and plasma6 config conflict 2025-05-23 09:58:59 +02:00
32ddceba8f kardorf: use i3 instead of hyprland 2025-05-23 09:58:38 +02:00
55ba4125d6 add latex packages to fix org mode exporting
Some checks failed
Update Nix Flake / update-flake (push) Failing after 11s
2025-05-21 23:01:09 +02:00
b9274f546f update flake 2025-05-21 23:01:03 +02:00
fd246d7daf Add hydra-auto-upgrade module, still wip
Some checks failed
Update Nix Flake / update-flake (push) Failing after 16s
2025-05-16 13:13:47 +02:00
edae0d2bb0 Delete i3 scripts also available in my nix pkgs 2025-05-16 12:56:22 +02:00
1cb23dd0a4 Add todo 2025-05-16 12:53:20 +02:00
ab1052193a rename deprecated options 2025-05-16 12:12:22 +02:00
6dadb2008c kardorf: enable ssh access 2025-05-16 12:11:45 +02:00
18f9cc3fa8 Add user julian to dialout for serial port access 2025-05-16 08:27:45 +02:00
9295ad7010 add kardorf ssh key to common secrets.yaml 2025-05-16 08:27:45 +02:00
e3cf2379ab yazi: update config to new version 2025-05-16 08:27:45 +02:00
f6c3f676b2 update flake 2025-05-16 08:27:45 +02:00
d57017382a v3ms: add /snap/bin to path
Some checks failed
Update Nix Flake / update-flake (push) Failing after 14s
2025-05-09 11:41:21 +02:00
1d7690eab4 Fix mako settings
Some checks failed
Update Nix Flake / update-flake (push) Failing after 14s
2025-05-06 07:50:35 +02:00
67d68a9946 Fix waybar not visible on second monitor after toggling mirroring twice
Some checks failed
Update Nix Flake / update-flake (push) Failing after 15s
2025-05-05 15:10:07 +02:00
9af362b5c8 hyprland: quick and dirty screen mirroring 2025-05-05 14:56:22 +02:00
a0ae09452f hyprland: install hyprpicker 2025-05-05 08:24:26 +02:00
711859e660 hyprland: fix cursor theme not applied 2025-05-05 08:24:09 +02:00
1c1e496425 use NH_FLAKE instead of FLAKE for nh 2025-05-05 07:11:28 +02:00
97229a521f Add discord to open-messaging 2025-05-05 07:11:02 +02:00
7d8190210b Mako: disable usage of deprecated config value
Some checks failed
Update Nix Flake / update-flake (push) Failing after 15s
2025-05-04 20:42:53 +02:00
a1dfeff98b topgrade: disable "update flake" step 2025-05-04 20:29:11 +02:00
9e512c2863 Update flake 2025-05-04 20:29:06 +02:00
136653b0fa Use hashed password for julian 2025-05-04 13:52:36 +02:00
75fb0f54ec Delete unused hyprland nixos config 2025-05-04 13:52:27 +02:00
a3282f3eb3 Configure kardorf host config 2025-05-04 13:52:13 +02:00
843dfb986d Fix type of monitor.workspaces 2025-05-04 13:51:54 +02:00
3eba0fe092 Make nvidia on kardorf work 2025-05-04 13:51:44 +02:00
fdc8b03d9b Add user wolfi 2025-05-04 13:51:22 +02:00
d86321cfe6 Add monitor configuration to aspi and kardorf homes 2025-05-04 13:51:00 +02:00
881c930fdb Fix wrong architectures used for v3ms and kardorf 2025-05-04 13:50:36 +02:00
dc3f9fe681 Add kardorf ssh key to sops 2025-05-04 13:50:23 +02:00
d73ff17327 Delete deprecated .dotter files 2025-05-04 13:49:24 +02:00
67468ba6fa Fix kardorf using aspi config 2025-05-01 22:09:02 +02:00
56 changed files with 1555 additions and 360 deletions

View File

@ -1,61 +0,0 @@
[helpers]
[default]
depends = []
[manjaro.files]
manjaro = "~"
[mc.files]
mc = "~/.config/mc"
[vim.files]
# type symbolic prevents interpreting '{{' as template
"vim/.vimrc" = { target = "~/.vimrc", type = "symbolic" }
[nvim.files]
"vim/init.vim" = { target = "~/.config/nvim/init.vim", type = "symbolic" }
[i3.files]
"i3/i3" = "~/.config/i3"
"i3/i3blocks" = { target = "~/.config/i3blocks", type = "symbolic" }
"i3/rofi" = "~/.config/rofi"
"i3/i3-scrot.conf" = "~/.config/i3-scrot.conf"
"i3/i3status-rust" = "~/.config/i3status-rust"
"i3/.profile" = "~/.profile"
[i3.variables]
monitor-primary = "not-specified"
monitor-secondary = "not-specified"
screenlayout-script = "echo screenlayout-script not specified"
bar-font-size = 15
tray-output = "tray_output primary"
[emacs.files]
"emacs/doom" = "~/.config/doom"
# "emacs/spacemacs/.spacemacs" = "~/.spacemacs"
# "emacs/chemacs/.emacs-profiles.el" = "~/.emacs-profiles.el"
[alacritty.files]
alacritty = "~/.config/alacritty"
[starship.files]
starship = "~/.config/"
[zsh.files]
"zsh/.zshrc" = "~/.zshrc"
"zsh/custom-plugins" = "~/.oh-my-zsh/custom"
[polybar.files]
polybar = "~/.config/polybar"
[leftwm.files]
leftwm = "~/.config/leftwm"
[xmonad.files]
xmonad = "~/.xmonad"
[nix.files]
"direnvrc" = "~/.config/direnv/direnvrc"
"nix/configuration.nix" = "/etc/nixos/configuration.nix"
"nix/flake.nix" = "/etc/nixos/flake.nix"

View File

@ -1,6 +0,0 @@
[i3.variables]
monitor-primary = "DVI-D-0"
monitor-secondary = "DVI-D-1"
screenlayout-script = "~/.screenlayout/2desktop-dvi.sh"
bar-font-size = 15
tray-output = "tray_output DVI-D-1"

View File

@ -1,4 +0,0 @@
[i3.variables]
monitor-primary = "HDMI-1"
monitor-secondary = "eDP-1"
screenlayout-script = "~/.screenlayout/laptop-at-home.sh"

View File

@ -1,5 +0,0 @@
[i3.variables]
monitor-primary = "HDMI-1"
monitor-secondary = "eDP-1"
tray-output = "tray_output eDP-1"
screenlayout-script = "$scripts/display-layoutpicker"

View File

@ -1,2 +0,0 @@
includes = [".dotter/kardorf.toml"]
packages = ["i3", "emacs", "alacritty", "zsh", "starship", "nix"]

View File

@ -1,2 +0,0 @@
includes = [".dotter/laptop.toml"]
packages = []

View File

@ -3,6 +3,8 @@ keys:
- &aspi-ssh age1q8lc5340gz5xw2f57nglrss68wv0j0hf36py2pdtrl6ky3yrq9qqk0njr4
- &pianonix-ssh age1hsmfz8fjxu83sax9lr487h8xr6cyge0apdq4zpge4c8jpcjj2cksj825ct
- &builder-ssh age1kw4kmdm45zprvdkrrpvgq966l7585vhusmum083qlwnr0xxgd3uqatcyja
- &kardorf-ssh age15lxw97z03q40xrdscnxqqugh5ky5aqrerg2t2rphkcqm6rnllurq8v98q5
creation_rules:
- path_regex: hosts/common/secrets.yaml$
key_groups:
@ -10,6 +12,7 @@ creation_rules:
- *primary
- *aspi-ssh
- *pianonix-ssh
- *kardorf-ssh
- path_regex: hosts/builder/secrets.yaml$
key_groups:

893
flake.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -28,10 +28,6 @@
};
# Various flakes
alacritty-theme = {
url = "github:alacritty/alacritty-theme";
flake = false;
};
yazi-flavors = {
url = "github:yazi-rs/flavors";
flake = false;
@ -106,7 +102,7 @@
};
};
kardorf = lib.nixosSystem {
modules = [./hosts/pianonix];
modules = [./hosts/kardorf];
specialArgs = {
inherit inputs outputs;
};
@ -148,7 +144,7 @@
./homes/julian/kardorf.nix
./homes/julian/hm-standalone-config.nix
];
pkgs = pkgsFor.aarch64-linux;
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = {
inherit inputs outputs;
};
@ -158,7 +154,7 @@
./homes/julian/v3ms
./homes/julian/hm-standalone-config.nix
];
pkgs = pkgsFor.aarch64-linux;
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = {
inherit inputs outputs;
};

View File

@ -6,8 +6,9 @@
./features/direnv
./features/topgrade
./features/neovim
./features/kitty
./features/ghostty
./features/wezterm
./features/alacritty
./features/yazi
./features/emacs
@ -20,5 +21,36 @@
hostName = "aspi";
is-nixos = true;
terminal = "kitty";
terminal = "alacritty";
# ------- ----------
# | eDP-1 | | HDMI-A-1 |
# ------- ----------
monitors = [
{
name = "HDMI-A-1";
# width = 1680;
# height = 1050;
workspaces = [
"1"
"2"
"3"
"4"
"5"
];
primary = true;
}
{
name = "eDP-1";
# width = 1680;
# height = 1050;
workspaces = [
"6"
"7"
"8"
"9"
"10"
];
}
];
}

View File

@ -1,3 +0,0 @@
import = [
"~/.config/alacritty/theme/themes/smoooooth.toml"
]

View File

@ -1,15 +1,12 @@
{
lib,
pkgs,
inputs,
config,
...
}: {
home.packages = with pkgs; [alacritty];
home.file = {
".config/alacritty/theme".source = "${inputs.alacritty-theme}";
".config/alacritty/alacritty.toml".source = ./alacritty.toml;
programs.alacritty = {
enable = true;
settings = {};
theme = "smoooooth";
};
home.sessionVariables.TERMINAL = lib.mkIf (config.terminal == "alacritty") "alacritty";

View File

@ -0,0 +1,16 @@
{
lib,
config,
...
}: {
programs.ghostty = {
enable = true;
enableFishIntegration = true;
settings = {
theme = "catppuccin-mocha";
font-size = 12;
};
};
home.sessionVariables.TERMINAL = lib.mkIf (config.terminal == "ghostty") "ghostty";
}

View File

@ -24,8 +24,10 @@ in {
};
cursorTheme = {
package = pkgs.apple-cursor;
name = "macOS-BigSur";
name = "macOS";
size = 24;
};
};
xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-gtk];
}

View File

@ -40,15 +40,29 @@ in {
programs.imv.enable = true; # TODO: what is that
home.packages = with pkgs; [
# hyprpicker # TODO
# hyprcursor # TODO
hyprpicker
brightnessctl
# grimblast
frajul.hyprshot-gui
frajul.wl-ocr
wf-recorder
wl-clipboard
(pkgs.writeShellScriptBin "toggle-screen-mirroring" (
builtins.readFile ./toggle-screen-mirroring.sh
))
(pkgs.writeShellScriptBin "correct-workspace-locations" (
lib.concatStringsSep "\n" (
builtins.concatLists (
map (
monitor:
map (ws: "hyprctl dispatch moveworkspacetomonitor ${ws} ${monitor.name}") monitor.workspaces
)
config.monitors
)
)
))
];
services.cliphist = {
@ -141,11 +155,17 @@ in {
settings = {
"$mod" = "SUPER";
# Environment variables programs like emacs have access to
env = "TERMINAL,${config.terminal}";
# Monitors
monitor = ",preferred,auto,auto";
monitor = ",preferred,auto,1";
# Autostart
exec-once = ["firefox"];
exec-once = [
(lib.getExe pkgs.firefox)
(lib.getExe pkgs.waybar)
];
# Look and Feel
general = {
@ -196,6 +216,7 @@ in {
exec = [
"hyprctl setcursor ${config.gtk.cursorTheme.name} ${toString config.gtk.cursorTheme.size}"
"correct-workspace-locations"
];
misc = {
@ -231,23 +252,17 @@ in {
];
# Workspace rules
workspace = [
"1, monitor:HDMI-A-1"
"2, monitor:HDMI-A-1"
"3, monitor:HDMI-A-1"
"4, monitor:HDMI-A-1"
"5, monitor:HDMI-A-1"
"6, monitor:eDP-1"
"7, monitor:eDP-1"
"8, monitor:eDP-1"
"9, monitor:eDP-1"
"10, monitor:eDP-1"
# smart gaps (none when only one window in workspace)
"w[t1], gapsin:0, gapsout:0, border:1"
"w[tg1], gapsin:0, gapsout:0, border:1"
"f[1], gapsin:0, gapsout:0, border:1"
];
workspace =
[
# smart gaps (none when only one window in workspace)
"w[t1], gapsin:0, gapsout:0, border:1"
"w[tg1], gapsin:0, gapsout:0, border:1"
"f[1], gapsin:0, gapsout:0, border:1"
]
# builds like "1, e-DP1" "2, HDMI-1" etc.
++ builtins.concatLists (
map (monitor: map (ws: "${ws}, monitor:${monitor.name}") monitor.workspaces) config.monitors
);
# Mouse binds
bindm = [
@ -269,7 +284,7 @@ in {
# opening applications
"$mod, D, exec, wofi --show drun,run"
"$mod, E, exec, pcmanfm"
"$mod, Return, exec, kitty"
"$mod, Return, exec, ${config.terminal}"
"$mod, B, exec, firefox"
"$mod, C, exec, qalculate-gtk"
@ -277,7 +292,9 @@ in {
"$mod SHIFT, E, exec, wlogout -p layer-shell"
"$mod, Escape, exec, wlogout -p layer-shell"
"$mod SHIFT, R, exec, hyprctl reload"
"$mod, Print, exec, hyprshot-gui"
", Print, exec, hyprshot-gui"
"$mod, P, exec, toggle-screen-mirroring; correct-workspace-locations"
# "$mod SHIFT, E, exec, pkill Hyprland"
# "$mod, G, togglegroup,"

View File

@ -15,14 +15,16 @@ in {
services.mako = {
enable = true;
defaultTimeout = 5000; # milliseconds, can be overwritten by notification sender
# backgroundColor = "#${palette.base00}"; TODO fix
# textColor = "#${palette.base05}";
# borderColor = "#${palette.base0D}";
# progressColor = "over #${palette.base02}";
# extraConfig = ''
# [urgency=high]
# border-color=#${palette.base09}
# '';
settings = {
defaultTimeout = "5000"; # milliseconds, can be overwritten by notification sender
backgroundColor = "#${palette.base00}";
textColor = "#${palette.base05}";
borderColor = "#${palette.base0D}";
progressColor = "over #${palette.base02}";
extraConfig = ''
[urgency=high]
border-color=#${palette.base09}
# '';
};
};
}

View File

@ -0,0 +1,67 @@
#! /usr/bin/env sh
# A hyprland script for a laptop-external-monitor setup, toggling between which is in use
# Launch at startup to make hyprland disable the internal monitor if an external monitor is detected and enabled
# Additionally it's called with a keybind to switch between a laptop monitor and an external display
# Ideally the conditional monitor behaviour was instead done directly in hyprland.conf, but I'm not sure whether that's possible
#
# Relevant info:
# - hyprctl monitors: identifies currently enabled monitors
# - hyprctl monitors all: identifies ALL connected monitors - including those not in use
#
# Suggested use:
# Add this line somewhere after the regular monitor configuration in hyprland.conf:
# exec = /path/to/hyprland-monitors-toggle.sh
# Add a keybind to run this script on demand:
# bind =,SomeKeyHere, exec, /path/to/hyprland-monitors-toggle.sh
#move_all_workspaces_to_monitor() {
# TARGET_MONITOR="$1"
# hyprctl workspaces | grep ^workspace | cut --delimiter ' ' --fields 3 | xargs -I '{}' hyprctl dispatch moveworkspacetomonitor '{}' "$TARGET_MONITOR"
# # Previous approach
# #hyprctl swapactiveworkspaces $EXTERNAL_MONITOR $INTERNAL_MONITOR
#}
# TODO: Detect these instead of hardcoding them
INTERNAL_MONITOR="eDP-1"
EXTERNAL_MONITOR="HDMI-A-1"
# NUM_MONITORS=$(hyprctl monitors all | grep --count Monitor)
# NUM_MONITORS_ACTIVE=$(hyprctl monitors | grep --count Monitor)
# Make sure all
# if [ "$NUM_MONITORS_ACTIVE" -eq 1 ]; then
# move_all_workspaces_to_monitor $INTERNAL_MONITOR
# exit
# fi
MIRROR_SETTING=$(hyprctl monitors all -j | jq -r '.[] | select(.name == "HDMI-A-1") | .mirrorOf')
# # For dynamically toggling which monitor is active later via a keybind
# if [ "$NUM_MONITORS" -gt 1 ]; then # Handling multiple monitors
# if hyprctl monitors | cut --delimiter ' ' --fields 2 | grep --quiet ^$EXTERNAL_MONITOR; then
# hyprctl keyword monitor $INTERNAL_MONITOR,preferred,0x0,1
# move_all_workspaces_to_monitor $INTERNAL_MONITOR
# hyprctl keyword monitor "$EXTERNAL_MONITOR, disable"
# else
# hyprctl keyword monitor $EXTERNAL_MONITOR,preferred,0x0,1
# move_all_workspaces_to_monitor $EXTERNAL_MONITOR
# hyprctl keyword monitor "$INTERNAL_MONITOR, disable"
# fi
# else # If the external monitor is disconnected without running this script first, it might become the case that no monitor is on - therefore turn on the laptop monitor!
# hyprctl keyword monitor $INTERNAL_MONITOR,preferred,0x0,1
# move_all_workspaces_to_monitor $INTERNAL_MONITOR
# fi
echo setting:
echo $MIRROR_SETTING
if [ "$MIRROR_SETTING" = "none" ]; then
echo "mirroring..."
hyprctl keyword monitor "$EXTERNAL_MONITOR, preferred, auto, 1, mirror, $INTERNAL_MONITOR"
else
hyprctl keyword monitor "$EXTERNAL_MONITOR, disable" # shortly disable monitor so waybar recognizes the new monitor again # TODO: find better solution
hyprctl keyword monitor "$EXTERNAL_MONITOR, preferred, auto, 1"
fi

View File

@ -12,7 +12,14 @@
"modules-center": [],
"modules-right": ["idle_inhibitor", "disk", "cpu", "memory", "pulseaudio", "battery", "clock", "tray"],
"modules-right": ["idle_inhibitor", "custom/nixos-update", "disk", "cpu", "memory", "pulseaudio", "battery", "clock", "tray"],
"custom/nixos-update": {
"exec": "frajul-auto-upgrade-status",
"return-type": "json",
"interval": 2,
"on-click-right": "frajul-auto-upgrade-toggle"
},
"hyprland/workspaces": {
"on-scroll-up": "hyprctl dispatch workspace m+1",
@ -35,6 +42,7 @@
},
"idle_inhibitor": {
"start-activated": true,
"format": "{icon}",
"format-icons": {
"activated": "",

View File

@ -10,7 +10,7 @@
in {
programs.waybar = {
enable = true;
systemd.enable = true;
# systemd.enable = true;
settings.mainBar = builtins.fromJSON (builtins.readFile ./config.json);
};

View File

@ -142,8 +142,8 @@ bindsym $mod+Shift+9 move container to workspace number $ws9; workspace $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10; workspace $ws10
# Monitor config
set $monitor_left "DVI-D-0"
set $monitor_right "DVI-D-1"
set $monitor_left "DVI-D-1"
set $monitor_right "DVI-D-2"
workspace $ws1 output $monitor_left
workspace $ws2 output $monitor_left

View File

@ -1,27 +0,0 @@
#!/bin/sh
start_if_not_running()
{
program=$1
pidof -sq $program
if [ "$?" -eq "1" ]; then
start_program $1
else
echo "$program is already running"
fi
}
start_program()
{
program=$1
echo "Starting $program..."
$program & > /dev/null
}
i3-msg 'workspace 9; append_layout ~/.config/i3/workspace-messaging.json'
start_program nheko
sleep 0.1
start_program telegram-desktop
sleep 0.1
start_program thunderbird
sleep 0.1

View File

@ -1,20 +0,0 @@
#!/bin/sh
HDMI_SINK="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_3__sink"
LAPTOP_SINK="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink"
HDMI_ICON=$(pactl info | grep -q $HDMI_SINK && echo "checkbox")
LAPTOP_ICON=$(pactl info | grep -q $LAPTOP_SINK && echo "checkbox")
HDMI_VOLUME=$(pactl get-sink-volume $HDMI_SINK | head -n 1 | awk '{print $5}')
LAPTOP_VOLUME=$(pactl get-sink-volume $LAPTOP_SINK | head -n 1 | awk '{print $5}')
read -r -d '' CONF <<EOF
Open Pavucontrol,pavucontrol,pavucontrol
^sep()
HDMI - $HDMI_VOLUME,pactl set-default-sink $HDMI_SINK,$HDMI_ICON
Laptop - $LAPTOP_VOLUME,pactl set-default-sink $LAPTOP_SINK,$LAPTOP_ICON
EOF
echo "$CONF" | jgmenu --simple

View File

@ -151,6 +151,7 @@
pyright.enable = true;
dockerls.enable = true;
lua_ls.enable = true;
clangd.enable = true;
};
};
};

View File

@ -1,6 +1,6 @@
{pkgs, ...}: {
home.sessionVariables = {
FLAKE = "/home/julian/.dotfiles";
NH_FLAKE = "/home/julian/.dotfiles";
};
home.shellAliases = {

View File

@ -34,7 +34,7 @@
# geogebra
cheese
handbrake
kitty # Terminal
# kitty # Terminal, already available as feature
libnotify
libreoffice
mate.engrampa

View File

@ -29,6 +29,10 @@
standalone
amsmath
preview
# needed for org mode export
wrapfig
capt-of
biblatex
;
})
matlab # Using nix-matlab overlay defined in flake
@ -58,6 +62,7 @@
## My scripts
frajul.deploy-to-pianopi
frajul.rtklib
(pkgs.writeShellScriptBin "matlab-rsp" ''
matlab -desktop -sd "/home/julian/git/uwa-channel-model" -softwareopengl

View File

@ -7,7 +7,7 @@
misc.assume_yes = true;
misc.no_retry = true;
pre_commands."Update flake" = "git -C /home/julian/.dotfiles checkout origin/flake-updates -- flake.lock";
# pre_commands."Update flake" = "git -C /home/julian/.dotfiles checkout origin/flake-updates -- flake.lock";
linux.nix_arguments = "--flake /home/julian/.dotfiles";
linux.home_manager_arguments = [

View File

@ -26,7 +26,7 @@
programs.yazi.enable = true;
programs.yazi.enableFishIntegration = true;
programs.yazi.settings.manager = {
sort_by = "modified";
sort_by = "mtime";
sort_reverse = true;
show_hidden = true;
};

View File

@ -20,7 +20,7 @@
"flakes"
"ca-derivations"
];
# warn-dirty = false; # TODO: do I want it? also for systems
warn-dirty = false; # TODO: do I want it? also for systems
};
};

View File

@ -6,12 +6,13 @@
./features/direnv
./features/topgrade
./features/neovim
./features/kitty
./features/ghostty
./features/wezterm
./features/yazi
./features/emacs
./features/hyprland
# ./features/hyprland
./features/i3
./features/suites/cli
./features/suites/desktop
@ -20,5 +21,36 @@
hostName = "kardorf";
is-nixos = true;
terminal = "kitty";
terminal = "ghostty";
# --------- ---------
# | DVI-D-1 | | DVI-D-2 |
# --------- ---------
monitors = [
{
name = "DVI-D-1";
width = 1680;
height = 1050;
workspaces = [
"1"
"2"
"3"
"4"
"5"
];
primary = true;
}
{
name = "DVI-D-2";
width = 1680;
height = 1050;
workspaces = [
"6"
"7"
"8"
"9"
"10"
];
}
];
}

View File

@ -19,6 +19,8 @@
is-nixos = false;
# terminal = "kitty";
home.sessionPath = ["/snap/bin"];
home.packages =
lib.lists.concatMap (packages-list-file: import packages-list-file {inherit pkgs;})
[

View File

@ -4,6 +4,7 @@
../common/global
../common/users/julian
../common/optional/binarycaches.nix
../common/optional/remote-builder.nix
../common/optional/boot-efi.nix
@ -31,6 +32,10 @@
enable = true;
overrideSettings = false;
};
frajulAutoUpgrade = {
enable = true;
flakePath = "/home/julian/.dotfiles";
};
};
services.blueman.enable = true;

View File

@ -17,6 +17,7 @@
extraGroups = [
"networkmanager"
"wheel"
"docker"
];
};
@ -30,14 +31,27 @@
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
"https://hyprland.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="];
trusted-users = ["nix"];
max-jobs = "auto";
cores = 0;
};
system.autoUpgrade = {
enable = true;
flake = "git+https://gitlab.julian-mutter.de/julian/dotfiles";
flags = [
"--recreate-lock-file" # update lock file
];
dates = "02:13";
};
# optimize store by hardlinking store files
nix.optimise.automatic = true;
nix.optimise.dates = ["03:15"];
@ -241,4 +255,17 @@
};
};
};
services.gitlab-runner.enable = true;
# runner for everything else
#
sops.secrets."gitlab_runner_token".sopsFile = ./secrets.yaml;
services.gitlab-runner.services.default = {
# File should contain at least these two variables:
authenticationTokenConfigFile = config.sops.secrets."gitlab_runner_token".path;
dockerImage = "alpine:latest";
dockerVolumes = [
"/var/run/docker.sock:/var/run/docker.sock"
];
};
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,16 @@
{
inputs,
config,
...
}: {
system.hydraAutoUpgrade = {
# Only enable if not dirty
enable = inputs.self ? rev;
dates = "*:0/10"; # Every 10 minutes
instance = "http://hydra.julian-mutter.de";
project = "dotfiles";
jobset = "main";
job = "hosts.${config.networking.hostName}";
oldFlakeRef = "self";
};
}

View File

@ -2,6 +2,7 @@
{
inputs,
outputs,
pkgs,
...
}: {
imports =
@ -22,7 +23,12 @@
hardware.enableRedistributableFirmware = true;
# Networking
networking.networkmanager.enable = true;
networking.networkmanager = {
enable = true;
plugins = with pkgs; [
networkmanager-openconnect
];
};
services.resolved.enable = true;
programs.dconf.enable = true;

View File

@ -8,6 +8,7 @@
# TODO: apply this to hm and nixos without duplicate code
overlays = builtins.attrValues outputs.overlays;
config = {
nvidia.acceptLicense = true;
allowUnfree = true;
allowUnfreePredicate = _: true; # TODO: what is this
warn-dirty = false;
@ -25,26 +26,6 @@
];
# warn-dirty = false;
# Setup binary caches
nix.settings = {
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
"https://hyprland.cachix.org"
"http://binarycache.julian-mutter.de"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"binarycache.julian-mutter.de:oJ67uRFwRhNPKL58CHzy3QQLv38Kx7OA1K+6xlEPu7E="
];
trusted-users = [
"root"
"@wheel"
]; # needed for devenv to add custom caches
};
nix.gc = {
automatic = true;
dates = "weekly";

View File

@ -15,7 +15,7 @@ in {
# TODO: remove? only rely on ssh or pgp keys (e.g. ubikey like misterio is using!!!)
keyFile = "/home/julian/.config/sops/age/keys.txt";
# Generate key if none of the above worked. With this, building will still work, just without secrets
generateKey = true;
generateKey = false; # TODO: building should not work without secrets!?
};
sops.defaultSopsFile = ../secrets.yaml;

View File

@ -1,8 +1,14 @@
{pkgs, ...}: {
{
pkgs,
lib,
...
}: {
# Make programs like nextcloud client access saved passwords
programs.seahorse.enable = true;
services.gnome.gnome-keyring.enable = true;
programs.seahorse.enable = true;
programs.ssh.askPassword = lib.mkForce "${pkgs.seahorse}/libexec/seahorse/ssh-askpass"; # Solve conflicting definition in seahorse and plasma6
# Make authentication work for e.g. gparted
security.polkit.enable = true;
systemd = {

View File

@ -0,0 +1,25 @@
{
lib,
outputs,
...
}: {
# Setup binary caches
nix.settings = {
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
"https://hyprland.cachix.org"
"http://binarycache.julian-mutter.de"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"binarycache.julian-mutter.de:oJ67uRFwRhNPKL58CHzy3QQLv38Kx7OA1K+6xlEPu7E="
];
trusted-users = [
"root"
"@wheel"
]; # needed for devenv to add custom caches
};
}

View File

@ -1,13 +0,0 @@
{
config,
lib,
pkgs,
inputs,
...
}: {
programs.hyprland.enable = true;
programs.hyprland.package = inputs.hyprland.packages.${pkgs.system}.hyprland; # does only work with nixos-unstable
programs.hyprland.xwayland.enable = true;
security.pam.services.hyprlock = {};
services.displayManager.defaultSession = "hyprland";
}

View File

@ -13,7 +13,7 @@ in {
PasswordAuthentication = false;
PermitRootLogin = "no";
# TODO: what does this d
# TODO: what does this do
# Let WAYLAND_DISPLAY be forwarded
AcceptEnv = "WAYLAND_DISPLAY";
X11Forwarding = true;
@ -34,7 +34,7 @@ in {
# publicKeyFile = ../../${hostname}/ssh_host_ed25519_key.pub;
# extraHostNames =
# [
# "${hostname}.m7.rs"
# # "${hostname}.m7.rs"
# ]
# ++
# # Alias for localhost if it's the same host

View File

@ -14,29 +14,38 @@ sops:
- recipient: age1ee5udznhadk6m7jtglu4709rep080yjyd2ukzdl8jma4mm92y3psv0slpg
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBTY3lFZlIyRnZOMzNQdnJ2
Z0xQQnY1eHFYekVMV3M0UE5hK2xkbStveFRnCncwVVduSEFFQkpwME5XQzF2Z0tK
MnhFQ3ZZMk51aGJHUmJFbHA4d1dmdkEKLS0tIHBkVEhaZEY5ZGtYcXRkZzREa0xR
eUNsNjE2VS9MTjNtYWluUjJhYXVuTmcKq175s9vx1tPVS+voO+HSkyaT+GbjC/Z+
PyKVKyqFAJCRcNP2byaFgAHjXtDFZdipt/0lbw+4UfHrZGpn+9B59Q==
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBxV2IzcEZ6eGYxbXAvaEta
c3RLbmZubnVEL1EwSlNNY3ZNbkVSUXN5ZDBZClRTYWwzbHhDK1VsMzVVL0VMVzZF
SEQ0ZHVMdytrY0xXUEppQkpNZEZ3VFkKLS0tIG95ZkJLWTZBWWpIOEQ4bHpBNWEx
QXVpMTNSNzU1dTBPYjlsc1BvNHZ3dDgKMHrT9DCC5W6UwC1Mfq6YCwkvZtDs3I7j
vKlnanFp8hMMyYONRVlkvh+vOGQdbgXco4Z5nr02LQDu6Rwm4jSp9g==
-----END AGE ENCRYPTED FILE-----
- recipient: age1q8lc5340gz5xw2f57nglrss68wv0j0hf36py2pdtrl6ky3yrq9qqk0njr4
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSByRmxCNUE4MTdZNWlOcmxX
RmhDS2NpQ0hoWG83SDlIeVhXaFdxNE4yTUVzCkRxS3M5aU5mdWZkYnpNeC9YR3BX
N1NEdzlyTm9YT3NQSnowWTZUc1FvYWsKLS0tICs2OVo2djNjUW0yOG41ZTJQeFFB
djFENU5USG1QSnRVdlErN1h5bXJhYzQKPDvAHIMR/vT47zbeK3NsS+jSl4HSFRIA
NbSKwTbEGn963metTh4HJItdWBAOyiCc3l1Ye49ms9JhYM8n4wHLRQ==
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBKTnpqclVmVHR3M1ZvMDZ0
eEtrbnhpTW5uZlhOYWFxbktxcTJ3bXZISkhzClpud2tNVzUvT2N2SkRadWk5aVpE
S2VkTFlIVUhFclA0WEh5cEp0Qjg3ejgKLS0tIDNXY0lpKys4Q3NBRFcya2RoSG1F
YW0raHlNekdWT3p0WHpGMk9xMmgzWFUKCue4GvgmH3nJBa7ny7rqft5MuSWHqAsP
5HnaAudL+rh2j1swm635QUrf9UnpUznE5NSOGrQDmA6RCBypNM4rsw==
-----END AGE ENCRYPTED FILE-----
- recipient: age1hsmfz8fjxu83sax9lr487h8xr6cyge0apdq4zpge4c8jpcjj2cksj825ct
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBVeHJ3NmMzaTh0Zm13Vm1r
RmNtMi9FYmJGUmxXeEppM3Fnazl1NTl3ajJjCjFrbXM4WGdOV05qckhkbjlSODZR
a0VuakllVTdOc2Uxd3BqRmtsN3NJdHcKLS0tIHRRMXFEcWNZOFE4dFJycGdGTzdP
WittUTFFNU5kUWdGcncwdWRQSi9STTgK3GuwolsItCEt3Dh5Lycb8TjfaHTuV/JB
P2KSuVsbgjYuCJSknYmSZ+9gdTYC8cVqDnKo7HYFNrCDHZ0P4QwGSg==
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBESlZOeHY0T01ra0gwMS8z
R3c1eW45WVkyeTBuRlFMRngrb2NFL1hkcmhRCitwZ3lweXM0di9EdEdQZmF4ZUZr
M1hqNkM3Q1Jrb09Kb2M0ZkhTcFZPYkkKLS0tIHpCTEFCV0JlRzQwK3hndDJ4aHVC
S1o0QVlXSVl0dmlpWUQ3ZXdqUU5maTgKY4UJPx37CU5OUgkqYWlz9+0rA+dQkrH9
+/kTT/2qZ2Op67WKtlas7arC7BjU8uygM208q+nr48Lic5n1fMtnXA==
-----END AGE ENCRYPTED FILE-----
- recipient: age15lxw97z03q40xrdscnxqqugh5ky5aqrerg2t2rphkcqm6rnllurq8v98q5
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAvYkdwSy9vc0lEWXJIdWRw
VmJ2NStaZDVxaG1LNU1NQlErdElPdkQvY3pjCkJyL1BRR2w1dmpqYnk5Tys3eHpX
c0FJdzA1bU5GWWhrUWhOK1Jqa2lTaU0KLS0tIDMzMEQwL3I0ckVyYWFubU9VNlAr
NlBud3VHczNnMm5wOGhHdEoxTG5CNDgK4s7cFGvUCeztjjIAWtMW7TUqFP+YEQIg
So5A7DGxVsUcqarTUPazpIBBlO4n9zj79Qe+eQd6ti0EZG6sYX6+2Q==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-04-23T07:00:17Z"
mac: ENC[AES256_GCM,data:JgaTIRbzD0hs2o86xUlQrPN2cPXvsuTH/zKG5xbQIDaYcEvD/mkuVa3hfnYKrA91kWg2Y1DgEi9583+o6UCl/+ldY4ptu+xpnYfyQFdhM4rB+KoP/pDt8vQKQ3zAX8fpAkugCgTTbuvm3TfQ1nt98V8boyhCn4JHNC1T0j7ZtZI=,iv:G3YJOLeDWDKuANo2mxS2JAdrRaonD87CU9BpCZZrlRs=,tag:mcKIdP5cSQUwNL2tcv/o6g==,type:str]

View File

@ -23,12 +23,14 @@ in {
"docker"
"git"
"gamemode"
"dialout"
];
openssh.authorizedKeys.keys = lib.splitString "\n" (
builtins.readFile ../../../../homes/julian/ssh.pub
);
hashedPasswordFile = config.sops.secrets.julian-password.path;
# hashedPasswordFile = config.sops.secrets.julian-password.path;
hashedPassword = "$y$j9T$N33kLJQbV8soUoCbDkpwA1$r/yahJDgOPo4GGOrAi6BUG5zLTzmaBrA5NQ4nno561A";
packages = [pkgs.home-manager];
};
users.groups.julian = {

View File

@ -0,0 +1,30 @@
{
pkgs,
config,
...
}: let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in {
users.mutableUsers = false;
users.users.wolfi = {
description = "Wolfi";
group = "wolfi";
isNormalUser = true;
shell = pkgs.fish;
extraGroups = ifTheyExist [
"networkmanager"
"wheel"
"audio"
"network"
"video"
"podman"
"docker"
"git"
"gamemode"
];
hashedPassword = "$y$j9T$ifzWjoZaRtPUOOfMYnbJ20$uFOO1EyDApL52vRUicZYgupaTA/a6sGNUj3imZ/lcb6";
packages = [pkgs.home-manager];
};
users.groups.wolfi = {};
}

View File

@ -4,11 +4,20 @@
../common/global
../common/users/julian
../common/users/wolfi
../common/optional/binarycaches.nix
../common/optional/xserver.nix
../common/optional/remote-builder.nix
../common/optional/boot-efi.nix
../common/optional/greetd.nix
# ../common/optional/greetd.nix
../common/optional/gdm.nix
../common/optional/i3.nix
../common/optional/openssh.nix
../common/optional/authentication.nix
../common/optional/pcmanfm.nix
../common/optional/pipewire.nix
@ -20,12 +29,17 @@
networking.hostName = "kardorf";
system.stateVersion = "22.11";
services.xserver.videoDrivers = ["nvidia"];
# Not using the drivers leads to way better results
# services.xserver.videoDrivers = [ "nvidia" ];
programs.kdeconnect.enable = true;
services.desktopManager.plasma6.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
services.printing.browsing = true;
services.printing.drivers = with pkgs; [gutenprint];
services.libinput.enable = true;
}

View File

@ -12,11 +12,12 @@
"xhci_pci"
"usbhid"
"uas"
"usb_storage"
"sd_mod"
"sr_mod"
];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot.loader.efi.efiSysMountPoint = "/boot/efi";
@ -79,6 +80,10 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470;
# hardware.nvidia.modesetting.enable = true; # for wayland
# Use latest version of driver
# hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470;
hardware.nvidia.modesetting.enable = true; # produces errors, display manager fails to start
hardware.nvidia.nvidiaSettings = true;
hardware.nvidia.open = false;
}

View File

@ -15,6 +15,7 @@
../common/global
../common/users/julian
../common/optional/binarycaches.nix
../common/optional/pipewire.nix
../common/optional/remote-builder.nix

View File

@ -37,8 +37,8 @@ in {
type = types.bool;
default = true;
};
workspace = mkOption {
type = types.nullOr types.str;
workspaces = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
};

View File

@ -1,9 +1,4 @@
{
config,
lib,
pkgs,
...
}: {
{lib, ...}: {
options.terminal = lib.mkOption {
type = lib.types.str;
example = "alacritty";

View File

@ -1,4 +1,5 @@
{
# hydra-auto-upgrade = import ./hydra-auto-upgrade.nix;
syncthing = import ./syncthing.nix;
frajulAutoUpgrade = import ./frajul-auto-upgrade.nix;
}

View File

@ -0,0 +1,154 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.modules.frajulAutoUpgrade;
flagFile = "/var/lib/frajul-auto-upgrade/flag";
lockFile = "/var/lib/frajul-auto-upgrade/lock";
lastStatusFile = "/var/lib/frajul-auto-upgrade/last-status";
lastAttemptFile = "/var/lib/frajul-auto-upgrade/last-attempt";
in {
options.modules.frajulAutoUpgrade = {
enable = lib.mkEnableOption "NixOS auto-upgrade on boot";
user = lib.mkOption {
type = lib.types.str;
default = "root";
description = "User account to run the upgrade service as.";
};
flakePath = lib.mkOption {
type = lib.types.path;
description = "The path to your flake";
};
};
config = lib.mkIf cfg.enable {
# Ensure the flag directory exists
systemd.tmpfiles.rules = [
"d /var/lib/frajul-auto-upgrade 0755 root root -"
"f ${flagFile} 0766 root root -"
"f ${lastStatusFile} 0644 root root -"
"f ${lastAttemptFile} 0644 root root -"
];
environment.systemPackages = [
(pkgs.writeShellScriptBin "frajul-auto-upgrade" ''
#!/bin/sh
FLAG_FILE="${flagFile}"
LOCK_FILE="${lockFile}"
LAST_STATUS_FILE="${lastStatusFile}"
LAST_ATTEMPT_FILE="${lastAttemptFile}"
TODAY=$(date +%Y-%m-%d)
if [ ! -f "$FLAG_FILE" ] || [ "$(cat "$FLAG_FILE")" != "enabled" ]; then
echo "Auto upgrade disabled. Exiting."
exit 0
fi
# Check if already attempted today
if [ -f "$LAST_ATTEMPT_FILE" ]; then
LAST_ATTEMPT_DATE=$(cut -d' ' -f1 "$LAST_ATTEMPT_FILE")
if [ "$LAST_ATTEMPT_DATE" = "$TODAY" ]; then
echo "Update already attempted today. Skipping."
exit 0
fi
fi
if [ -f "$LOCK_FILE" ]; then
echo "Already running"
exit 1
fi
echo $$ > "$LOCK_FILE"
trap 'rm -f "$LOCK_FILE"' EXIT
if nix flake update --flake "${cfg.flakePath}" && nixos-rebuild switch --flake "${cfg.flakePath}"; then
echo "success" > "$LAST_STATUS_FILE"
else
echo "failure" > "$LAST_STATUS_FILE"
fi
# Write full timestamp
date '+%Y-%m-%d %H:%M:%S' > "$LAST_ATTEMPT_FILE"
'')
(pkgs.writeShellScriptBin "frajul-auto-upgrade-status" ''
#!/bin/sh
FLAG_FILE="${flagFile}"
LOCK_FILE="${lockFile}"
LAST_STATUS_FILE="${lastStatusFile}"
LAST_ATTEMPT_FILE="${lastAttemptFile}"
if [ -f "$LOCK_FILE" ]; then
ICON=" "
STATUS="running"
elif [ -f "$FLAG_FILE" ] && [ "$(cat "$FLAG_FILE")" == "enabled" ]; then
LAST_STATUS="unknown"
LAST_ATTEMPT="never"
if [ -f "$LAST_STATUS_FILE" ]; then
LAST_STATUS=$(cat "$LAST_STATUS_FILE")
fi
if [ -f "$LAST_ATTEMPT_FILE" ]; then
LAST_ATTEMPT=$(cat "$LAST_ATTEMPT_FILE")
fi
if [ "$LAST_STATUS" = "success" ]; then
ICON=""
elif [ "$LAST_STATUS" = "failure" ]; then
ICON=""
else
ICON=""
fi
STATUS="enabled (last attempt: $LAST_ATTEMPT, $LAST_STATUS)"
else
ICON=" "
STATUS="disabled"
fi
echo "{\"text\": \"$ICON\", \"tooltip\": \"NixOS Auto Update: $STATUS\"}"
'')
(pkgs.writeShellScriptBin "frajul-auto-upgrade-toggle" ''
#!/bin/sh
FLAG_FILE="${flagFile}"
LOCK_FILE="${lockFile}"
if [ ! -f "$FLAG_FILE" ] || [ "$(cat "$FLAG_FILE")" != "enabled" ]; then
echo "enabled" > "$FLAG_FILE"
else
echo "disabled" > "$FLAG_FILE"
if [ -f "$LOCK_FILE" ]; then
kill -TERM "$(cat "$LOCK_FILE")"
fi
fi
'')
];
systemd.services.frajul-auto-upgrade = {
description = "Frajul's NixOS Auto Upgrade";
after = ["network-online.target"];
restartIfChanged = false; # Do not start service on nixos switch
serviceConfig = {
Type = "oneshot";
User = cfg.user;
ExecStart = "/run/current-system/sw/bin/frajul-auto-upgrade";
};
};
systemd.timers.frajul-auto-upgrade = {
description = "Run Frajul's NixOS Auto Upgrade at boot";
wantedBy = ["timers.target"];
timerConfig = {
OnBootSec = "1min";
AccuracySec = "10s";
Unit = "frajul-auto-upgrade.service";
};
};
};
}

View File

@ -0,0 +1,129 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.system.hydraAutoUpgrade;
in {
# Taken from Misterio
options = {
system.hydraAutoUpgrade = {
enable = lib.mkEnableOption "periodic hydra-based auto upgrade";
operation = lib.mkOption {
type = lib.types.enum ["switch" "boot"];
default = "switch";
};
dates = lib.mkOption {
type = lib.types.str;
default = "04:40";
example = "daily";
};
instance = lib.mkOption {
type = lib.types.str;
example = "http://hydra.julian-mutter.de";
};
project = lib.mkOption {
type = lib.types.str;
example = "dotfiles";
};
jobset = lib.mkOption {
type = lib.types.str;
example = "main";
};
job = lib.mkOption {
type = lib.types.str;
default = config.networking.hostName;
};
oldFlakeRef = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = ''
Current system's flake reference
If non-null, the service will only upgrade if the new config is newer
than this one's.
'';
};
};
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = cfg.enable -> !config.system.autoUpgrade.enable;
message = ''
hydraAutoUpgrade and autoUpgrade are mutually exclusive.
'';
}
];
systemd.services.nixos-upgrade = {
description = "NixOS Upgrade";
restartIfChanged = false;
unitConfig.X-StopOnRemoval = false;
serviceConfig.Type = "oneshot";
path = with pkgs; [
config.nix.package.out
config.programs.ssh.package
coreutils
curl
gitMinimal
gnutar
gzip
jq
nvd
];
script = let
buildUrl = "${cfg.instance}/job/${cfg.project}/${cfg.jobset}/${cfg.job}/latest";
in
(lib.optionalString (cfg.oldFlakeRef != null) ''
eval="$(curl -sLH 'accept: application/json' "${buildUrl}" | jq -r '.jobsetevals[0]')"
flake="$(curl -sLH 'accept: application/json' "${cfg.instance}/eval/$eval" | jq -r '.flake')"
echo "New flake: $flake" >&2
new="$(nix flake metadata "$flake" --json | jq -r '.lastModified')"
echo "Modified at: $(date -d @$new)" >&2
echo "Current flake: ${cfg.oldFlakeRef}" >&2
current="$(nix flake metadata "${cfg.oldFlakeRef}" --json | jq -r '.lastModified')"
echo "Modified at: $(date -d @$current)" >&2
if [ "$new" -le "$current" ]; then
echo "Skipping upgrade, not newer" >&2
exit 0
fi
'')
+ ''
profile="/nix/var/nix/profiles/system"
path="$(curl -sLH 'accept: application/json' ${buildUrl} | jq -r '.buildoutputs.out.path')"
if [ "$(readlink -f "$profile")" = "$path" ]; then
echo "Already up to date" >&2
exit 0
fi
echo "Building $path" >&2
nix build --no-link "$path"
echo "Comparing changes" >&2
nvd --color=always diff "$profile" "$path"
echo "Activating configuration" >&2
"$path/bin/switch-to-configuration" test
echo "Setting profile" >&2
nix build --no-link --profile "$profile" "$path"
echo "Adding to bootloader" >&2
"$path/bin/switch-to-configuration" boot
'';
startAt = cfg.dates;
after = ["network-online.target"];
wants = ["network-online.target"];
};
};
}

View File

@ -12,4 +12,5 @@
acer-battery-health-mode = pkgs.callPackage ./acer-battery-health-mode {};
pob2 = pkgs.callPackage ./pob2 {};
wl-ocr = pkgs.callPackage ./wl-ocr {};
rtklib = pkgs.qt6Packages.callPackage ./rtklib {};
}

View File

@ -3,6 +3,7 @@
nheko,
telegram-desktop,
thunderbird,
discord, # TODO: discord not available for aarch64, this leads to flake evaluation for this arch fail.
}:
writeShellApplication {
name = "open-messaging";
@ -11,6 +12,7 @@ writeShellApplication {
nheko
telegram-desktop
thunderbird
discord
];
text = ''
@ -18,6 +20,8 @@ writeShellApplication {
sleep 0.1
nheko &
sleep 0.1
telegram-desktop &
Telegram &
sleep 0.1
discord &
'';
}

40
pkgs/rtklib/default.nix Normal file
View File

@ -0,0 +1,40 @@
{
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
qtbase,
wrapQtAppsHook,
qtserialport,
qttools,
...
}:
stdenv.mkDerivation rec {
pname = "RTKLIB";
version = "b34L";
src = fetchFromGitHub {
owner = "rtklibexplorer";
repo = "${pname}";
rev = "${version}";
hash = "sha256-bQcia3aRQNcZ55fvJViAxpo2Ev276HFTZ28SEXJD5Ds=";
};
nativeBuildInputs = [
cmake
pkg-config
wrapQtAppsHook
];
buildInputs = [
qtbase
qtserialport
qttools
];
cmakeFlags = [
"-DCMAKE_INSTALL_DATAROOTDIR=share"
];
doCheck = true;
}