From 83f0daa6c54c26ad240c46722d3ad84f853f517a Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 2 Nov 2026 19:55:32 +0100 Subject: modules/*: Fix various name mistakes and other issues --- modules/common/default.nix | 244 --------------------- modules/common/hooks/default.nix | 17 -- modules/common/hooks/scripts/sync-git-repo.sh | 23 -- modules/common/projects.json | 71 ------ modules/common/projects.json.license | 9 - modules/common/soispha/default.nix | 241 ++++++++++++++++++++ modules/common/soispha/hooks/default.nix | 17 ++ .../common/soispha/hooks/scripts/sync-git-repo.sh | 23 ++ modules/common/soispha/projects.json | 71 ++++++ modules/common/soispha/projects.json.license | 9 + 10 files changed, 361 insertions(+), 364 deletions(-) delete mode 100644 modules/common/default.nix delete mode 100644 modules/common/hooks/default.nix delete mode 100755 modules/common/hooks/scripts/sync-git-repo.sh delete mode 100644 modules/common/projects.json delete mode 100644 modules/common/projects.json.license create mode 100644 modules/common/soispha/default.nix create mode 100644 modules/common/soispha/hooks/default.nix create mode 100755 modules/common/soispha/hooks/scripts/sync-git-repo.sh create mode 100644 modules/common/soispha/projects.json create mode 100644 modules/common/soispha/projects.json.license (limited to 'modules/common') diff --git a/modules/common/default.nix b/modules/common/default.nix deleted file mode 100644 index facc9e9f..00000000 --- a/modules/common/default.nix +++ /dev/null @@ -1,244 +0,0 @@ -# nixos-config - My current NixOS configuration -# -# Copyright (C) 2025 Benedikt Peetz -# SPDX-License-Identifier: GPL-3.0-or-later -# -# This file is part of my nixos-config. -# -# You should have received a copy of the License along with this program. -# If not, see . -# This file contains common configuration applied to every host. -# It should only `enable` options defined in the `modules/by-name` directory. -{ - config, - pkgs, - lib, - ... -}: { - # TODO(@bpeetz): Move this file to default options in their respective modules. <2025-05-31> - - home-manager.users = { - soispha.home = { - username = "soispha"; - homeDirectory = config.users.users.soispha.home; - stateVersion = "23.05"; - enableNixpkgsReleaseCheck = true; - }; - - root.home = { - username = "root"; - homeDirectory = config.users.users.root.home; - stateVersion = "23.05"; - enableNixpkgsReleaseCheck = true; - }; - }; - - soispha = { - age.enable = true; - boot.enable = true; - cleanup.enable = true; - documentation.enable = true; - - fonts = { - enable = true; - enableEmoji = true; - }; - - hardware = { - enable = lib.mkDefault true; - }; - home-manager.enable = true; - impermanence = { - enable = true; - - directories = [ - "/etc/nixos" - "/var/lib/systemd" - ]; - }; - - polkit.enable = true; - xdg.enable = true; - - services = { - adb = { - enable = true; - user = "soispha"; - }; - backup = { - storagebox = { - enable = lib.mkDefault true; - user = "u459143-sub1"; - }; - local = { - enable = lib.mkDefault true; - }; - }; - fwupd.enable = true; - mako.enable = true; - mpd = { - enable = true; - directories = let - data = "${config.home-manager.users.soispha.xdg.dataHome}/mpd"; - in { - inherit data; - playlists = "${data}/playlists"; - runtime = "/run/user/${builtins.toString config.users.users.soispha.uid}/mpd"; - music = config.home-manager.users.soispha.programs.beets.settings.directory; - }; - mpc = { - enable = true; - beetsPkg = config.home-manager.users.soispha.programs.beets.package; - }; - }; - ollama.enable = false; - postgresql.enable = false; - printing.enable = true; - scanning.enable = true; - snapper.enable = true; - water-reminder.enable = true; - systemDiff.enable = true; - unison = { - enable = lib.mkDefault true; - - foreign.userName = "soispha"; - dataDir = "${config.home-manager.users.soispha.xdg.dataHome}/unison"; - userSourceDir = "/srv/home/soispha"; - pathsToIgnore = let - extractTarget = attr: "~/${attr.target}"; - homeManagerSymlinks = - builtins.map extractTarget - (builtins.attrValues - config.home-manager.users.soispha.home.file); - in - [ - # TODO(@bpeetz): Move that to its respective module (after migrating it to - # by-name) <2025-05-09> - # Already synchronized by mbsync - "~/.local/share/maildir" - ] - ++ homeManagerSymlinks; - - pathsToSync = [ - "~/.local/share" - "~/.local/.Trash-1000" - - "~/media" - "~/documents" - "~/repos" - ]; - }; - }; - - programs = { - i3bar-river.enable = true; - i3status-rust.enable = true; - - qutebrowser = { - enable = true; - }; - - nvim = { - enable = true; - shell = pkgs.zsh; - }; - atuin = { - enable = true; - enableAge = lib.mkDefault true; - }; - direnv.enable = true; - git.enable = true; - imv.enable = true; - less.enable = true; - lf.enable = true; - ly.enable = lib.mkDefault true; - gpg.enable = true; - river = { - enable = lib.mkDefault true; - init = { - rules = [ - { - app-id = "float"; - title = "*"; - action = "float"; - } - { - app-id = "mpv"; - title = "*"; - action = "float"; - } - { - app-id = "ModernGL"; - title = "*"; - action = "float"; - } - { - app-id = "*"; - title = "Manim Slides"; - action = "float"; - } - { - app-id = "*"; - title = "floating please"; - action = "float"; - } - - { - app-id = "*"; - title = "*"; - action = "ssd"; - } - # # This remove the focus border around Firefox (which is useful because the Firefox is nearly always in its own tag.) - # { - # app-id = "firefox"; - # title = "*"; - # action = "csd"; - # } - ]; - generalSettings = { - # background - background-color = "0x002b36"; - border-color-focused = "0x93a1a1"; - border-color-unfocused = "0x586e75"; - - # keyboard repeat rate - set-repeat = ["50" "300"]; - - # Cursor - focus-follows-cursor = "normal"; - # hide-cursor = ["timeout" "2000"]; - hide-cursor = ["when-typing" "enabled"]; - set-cursor-warp = "on-output-change"; - xcursor-theme = ["Nordzy-cursors" "24"]; - }; - inputs = { - pointer-1133-49970-Logitech_Gaming_Mouse_G502 = [["pointer-accel" "0"] ["accel-profile" "none"]]; - pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I = [["pointer-accel" "0"] ["accel-profile" "none"]]; - }; - }; - }; - mpv.enable = true; - steam.enable = true; - ssh.enable = true; - swaylock.enable = true; - timewarrior.enable = true; - taskwarrior = { - enable = true; - enableAge = lib.mkDefault true; - - hooks = import ./hooks {inherit pkgs lib config;}; - }; - tskm = { - enable = true; - projects = builtins.fromJSON (builtins.readFile ./projects.json); - }; - nix-index.enable = true; - yt.enable = true; - zathura.enable = true; - zsh.enable = true; - fish.enable = true; - }; - - version.enable = true; - }; -} diff --git a/modules/common/hooks/default.nix b/modules/common/hooks/default.nix deleted file mode 100644 index 5b694039..00000000 --- a/modules/common/hooks/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -# nixos-config - My current NixOS configuration -# -# Copyright (C) 2025 Benedikt Peetz -# SPDX-License-Identifier: GPL-3.0-or-later -# -# This file is part of my nixos-config. -# -# You should have received a copy of the License along with this program. -# If not, see . -{ - pkgs, - lib, - config, -}: { - sync-git-repos = config.lib.taskwarrior.mkHook "on-add" [pkgs.git] ./scripts/sync-git-repo.sh; - sync-git-repos-mod = config.lib.taskwarrior.mkHook "on-modify" [pkgs.git] ./scripts/sync-git-repo.sh; -} diff --git a/modules/common/hooks/scripts/sync-git-repo.sh b/modules/common/hooks/scripts/sync-git-repo.sh deleted file mode 100755 index fe0d0085..00000000 --- a/modules/common/hooks/scripts/sync-git-repo.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env sh - -# nixos-config - My current NixOS configuration -# -# Copyright (C) 2025 Benedikt Peetz -# SPDX-License-Identifier: GPL-3.0-or-later -# -# This file is part of my nixos-config. -# -# You should have received a copy of the License along with this program. -# If not, see . - -task_data="$(task _get rc.data.location)" -[ "$task_data" ] || die "Taskwarrior should have a location set" - -cd "$task_data" || die "(BUG?): Your data.location path is not accessable" - -[ -d ./.git/ ] || git init - -git add . -git commit --message="chore: Update" --no-gpg-sign - -# vim: ft=sh diff --git a/modules/common/projects.json b/modules/common/projects.json deleted file mode 100644 index ea14d6e4..00000000 --- a/modules/common/projects.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "aoc": { - "prefix": "programming/advent_of_code" - }, - "book": { - "prefix": "book" - }, - "buy": { - "prefix": "buy", - "subprojects": { - "books": {}, - "pc": {} - } - }, - "esc": {}, - "latex": { - "prefix": "programming/latex" - }, - "me": { - "subprojects": { - "bank": {}, - "google": {}, - "health": {}, - "job": {}, - "shop": {}, - "sweden": {} - } - }, - "server": { - "prefix": "config", - "subprojects": { - "b-peetz": {}, - "blog": {}, - "ci": {}, - "email": {}, - "nix-sync": {}, - "sudo-less": {} - } - }, - "smartphone": { - "prefix": "hardware" - }, - "system": { - "prefix": "config", - "subprojects": { - "backup": {}, - "bar": {}, - "email": {}, - "firefox": {}, - "gpg": {}, - "keyboard": {}, - "laptop": {}, - "music": {}, - "nvim": {}, - "rss": {}, - "shell": {}, - "task": {}, - "wm": {}, - "youtube": {} - } - }, - "timesinks": { - "subprojects": { - "games": {}, - "music": {}, - "netflix": {}, - "youtube": {} - } - }, - "uni": {} -} diff --git a/modules/common/projects.json.license b/modules/common/projects.json.license deleted file mode 100644 index eae6a84c..00000000 --- a/modules/common/projects.json.license +++ /dev/null @@ -1,9 +0,0 @@ -nixos-config - My current NixOS configuration - -Copyright (C) 2025 Benedikt Peetz -SPDX-License-Identifier: GPL-3.0-or-later - -This file is part of my nixos-config. - -You should have received a copy of the License along with this program. -If not, see . diff --git a/modules/common/soispha/default.nix b/modules/common/soispha/default.nix new file mode 100644 index 00000000..9d6038cb --- /dev/null +++ b/modules/common/soispha/default.nix @@ -0,0 +1,241 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see . +# This file contains common configuration applied to every host. +# It should only `enable` options defined in the `modules/by-name` directory. +{ + config, + pkgs, + lib, + ... +}: { + # TODO(@bpeetz): Move this file to default options in their respective modules. <2025-05-31> + + home-manager.users.soispha.home = { + username = "soispha"; + homeDirectory = config.users.users.soispha.home; + stateVersion = "23.05"; + enableNixpkgsReleaseCheck = true; + }; + + vhack = { + postgresql.enable = false; + persist = { + enable = true; + + directories = [ + "/etc/nixos" + "/var/lib/systemd" + "/var/log" + ]; + }; + + services.backup = { + storagebox = { + enable = lib.mkDefault true; + user = "u459143-sub1"; + sshHostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIICf9svRenC/PLKIL9nk6K/pxQgoiFC41wTNvoIncOxs"; + }; + local = { + enable = lib.mkDefault true; + }; + }; + }; + + soispha = { + age.enable = true; + boot.enable = true; + cleanup.enable = true; + documentation.enable = true; + + fonts = { + enable = true; + enableEmoji = true; + }; + + hardware = { + enable = lib.mkDefault true; + }; + home-manager.enable = true; + + polkit.enable = true; + xdg.enable = true; + + services = { + adb = { + enable = true; + user = "soispha"; + }; + fwupd.enable = true; + mako.enable = true; + mpd = { + enable = true; + directories = let + data = "${config.home-manager.users.soispha.xdg.dataHome}/mpd"; + in { + inherit data; + playlists = "${data}/playlists"; + runtime = "/run/user/${builtins.toString config.users.users.soispha.uid}/mpd"; + music = config.home-manager.users.soispha.programs.beets.settings.directory; + }; + mpc = { + enable = true; + beetsPkg = config.home-manager.users.soispha.programs.beets.package; + }; + }; + ollama.enable = false; + printing.enable = true; + scanning.enable = true; + snapper.enable = true; + water-reminder.enable = true; + systemDiff.enable = true; + unison = { + enable = lib.mkDefault true; + + foreign.userName = "soispha"; + dataDir = "${config.home-manager.users.soispha.xdg.dataHome}/unison"; + userSourceDir = "/srv/home/soispha"; + pathsToIgnore = let + extractTarget = attr: "~/${attr.target}"; + homeManagerSymlinks = + builtins.map extractTarget + (builtins.attrValues + config.home-manager.users.soispha.home.file); + in + [ + # TODO(@bpeetz): Move that to its respective module (after migrating it to + # by-name) <2025-05-09> + # Already synchronized by mbsync + "~/.local/share/maildir" + ] + ++ homeManagerSymlinks; + + pathsToSync = [ + "~/.local/share" + "~/.local/.Trash-1000" + + "~/media" + "~/documents" + "~/repos" + ]; + }; + }; + + programs = { + i3bar-river.enable = true; + i3status-rust.enable = true; + + qutebrowser = { + enable = true; + }; + + nvim = { + enable = true; + shell = pkgs.zsh; + }; + atuin = { + enable = true; + enableAge = lib.mkDefault true; + }; + direnv.enable = true; + git.enable = true; + imv.enable = true; + less.enable = true; + lf.enable = true; + ly.enable = lib.mkDefault true; + gpg.enable = true; + river = { + enable = lib.mkDefault true; + init = { + rules = [ + { + app-id = "float"; + title = "*"; + action = "float"; + } + { + app-id = "mpv"; + title = "*"; + action = "float"; + } + { + app-id = "ModernGL"; + title = "*"; + action = "float"; + } + { + app-id = "*"; + title = "Manim Slides"; + action = "float"; + } + { + app-id = "*"; + title = "floating please"; + action = "float"; + } + + { + app-id = "*"; + title = "*"; + action = "ssd"; + } + # # This remove the focus border around Firefox (which is useful because the Firefox is nearly always in its own tag.) + # { + # app-id = "firefox"; + # title = "*"; + # action = "csd"; + # } + ]; + generalSettings = { + # background + background-color = "0x002b36"; + border-color-focused = "0x93a1a1"; + border-color-unfocused = "0x586e75"; + + # keyboard repeat rate + set-repeat = ["50" "300"]; + + # Cursor + focus-follows-cursor = "normal"; + # hide-cursor = ["timeout" "2000"]; + hide-cursor = ["when-typing" "enabled"]; + set-cursor-warp = "on-output-change"; + xcursor-theme = ["Nordzy-cursors" "24"]; + }; + inputs = { + pointer-1133-49970-Logitech_Gaming_Mouse_G502 = [["pointer-accel" "0"] ["accel-profile" "none"]]; + pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I = [["pointer-accel" "0"] ["accel-profile" "none"]]; + }; + }; + }; + mpv.enable = true; + steam.enable = true; + ssh.enable = true; + swaylock.enable = true; + timewarrior.enable = true; + taskwarrior = { + enable = true; + enableAge = lib.mkDefault true; + + hooks = import ./hooks {inherit pkgs lib config;}; + }; + tskm = { + enable = true; + projects = builtins.fromJSON (builtins.readFile ./projects.json); + }; + nix-index.enable = true; + yt.enable = true; + zathura.enable = true; + zsh.enable = true; + fish.enable = true; + }; + + version.enable = true; + }; +} diff --git a/modules/common/soispha/hooks/default.nix b/modules/common/soispha/hooks/default.nix new file mode 100644 index 00000000..5b694039 --- /dev/null +++ b/modules/common/soispha/hooks/default.nix @@ -0,0 +1,17 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see . +{ + pkgs, + lib, + config, +}: { + sync-git-repos = config.lib.taskwarrior.mkHook "on-add" [pkgs.git] ./scripts/sync-git-repo.sh; + sync-git-repos-mod = config.lib.taskwarrior.mkHook "on-modify" [pkgs.git] ./scripts/sync-git-repo.sh; +} diff --git a/modules/common/soispha/hooks/scripts/sync-git-repo.sh b/modules/common/soispha/hooks/scripts/sync-git-repo.sh new file mode 100755 index 00000000..fe0d0085 --- /dev/null +++ b/modules/common/soispha/hooks/scripts/sync-git-repo.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see . + +task_data="$(task _get rc.data.location)" +[ "$task_data" ] || die "Taskwarrior should have a location set" + +cd "$task_data" || die "(BUG?): Your data.location path is not accessable" + +[ -d ./.git/ ] || git init + +git add . +git commit --message="chore: Update" --no-gpg-sign + +# vim: ft=sh diff --git a/modules/common/soispha/projects.json b/modules/common/soispha/projects.json new file mode 100644 index 00000000..ea14d6e4 --- /dev/null +++ b/modules/common/soispha/projects.json @@ -0,0 +1,71 @@ +{ + "aoc": { + "prefix": "programming/advent_of_code" + }, + "book": { + "prefix": "book" + }, + "buy": { + "prefix": "buy", + "subprojects": { + "books": {}, + "pc": {} + } + }, + "esc": {}, + "latex": { + "prefix": "programming/latex" + }, + "me": { + "subprojects": { + "bank": {}, + "google": {}, + "health": {}, + "job": {}, + "shop": {}, + "sweden": {} + } + }, + "server": { + "prefix": "config", + "subprojects": { + "b-peetz": {}, + "blog": {}, + "ci": {}, + "email": {}, + "nix-sync": {}, + "sudo-less": {} + } + }, + "smartphone": { + "prefix": "hardware" + }, + "system": { + "prefix": "config", + "subprojects": { + "backup": {}, + "bar": {}, + "email": {}, + "firefox": {}, + "gpg": {}, + "keyboard": {}, + "laptop": {}, + "music": {}, + "nvim": {}, + "rss": {}, + "shell": {}, + "task": {}, + "wm": {}, + "youtube": {} + } + }, + "timesinks": { + "subprojects": { + "games": {}, + "music": {}, + "netflix": {}, + "youtube": {} + } + }, + "uni": {} +} diff --git a/modules/common/soispha/projects.json.license b/modules/common/soispha/projects.json.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/common/soispha/projects.json.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz +SPDX-License-Identifier: GPL-3.0-or-later + +This file is part of my nixos-config. + +You should have received a copy of the License along with this program. +If not, see . -- cgit v1.3.1