diff options
Diffstat (limited to '')
299 files changed, 4884 insertions, 1081 deletions
diff --git a/modules/by-name/ad/adb/module.nix b/modules/by-name/ad/adb/module.nix index ec5d4be6..71bd3c9b 100644 --- a/modules/by-name/ad/adb/module.nix +++ b/modules/by-name/ad/adb/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/by-name/ag/age/module.nix b/modules/by-name/ag/age/module.nix new file mode 100644 index 00000000..9a498ab6 --- /dev/null +++ b/modules/by-name/ag/age/module.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + modules, + pkgs, + ... +}: let + cfg = config.soispha.age; +in { + options.soispha.age = { + enable = lib.mkEnableOption "secret management with age"; + }; + + imports = [ + modules.agenix.nixosModules.default + ]; + + config = lib.mkIf cfg.enable { + age = { + # TODO(@bpeetz): Set once <https://github.com/ryantm/agenix/pull/317/files> is merged. <2025-05-16> + # enable = true; + ageBin = lib.getExe pkgs.rage; + }; + }; +} diff --git a/modules/by-name/at/atuin/atuin.zsh b/modules/by-name/at/atuin/atuin.zsh index 60fb74fe..72dd7fa0 100644 --- a/modules/by-name/at/atuin/atuin.zsh +++ b/modules/by-name/at/atuin/atuin.zsh @@ -1,4 +1,15 @@ #! /usr/bin/env zsh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2034,SC2153,SC2086,SC2155 # Above line is because shellcheck doesn't support zsh, per diff --git a/modules/by-name/at/atuin/module.nix b/modules/by-name/at/atuin/module.nix index 2061fd71..700f50fb 100644 --- a/modules/by-name/at/atuin/module.nix +++ b/modules/by-name/at/atuin/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -8,10 +17,12 @@ in { options.soispha.programs.atuin = { enable = lib.mkEnableOption "atuin"; + + enableAge = lib.mkEnableOption "atuin with age keys"; }; config = lib.mkIf cfg.enable { - age.secrets.atuin_encryption_key = { + age.secrets.atuin_encryption_key = lib.mkIf cfg.enableAge { file = ./secrets/encryption_key.age; mode = "700"; owner = "soispha"; @@ -28,12 +39,18 @@ in { # We can do this on our own. enableZshIntegration = false; settings = { - key_path = "${config.age.secrets.atuin_encryption_key.path}"; + key_path = lib.mkMerge [ + (lib.mkIf cfg.enableAge "${config.age.secrets.atuin_encryption_key.path}") + (lib.mkIf (!cfg.enableAge) + "${config.home-manager.users.soispha.xdg.dataHome}/atuin/atuin_secret_key.key") + ]; - # TODO: Setup a self-hosted sync server. <2024-10-18> - session_path = ""; - auto_sync = false; - sync_address = ""; + sync = lib.mkIf cfg.enableAge { + # The v2 sync API + records = true; + }; + auto_sync = lib.mkIf cfg.enableAge true; + sync_address = lib.mkIf cfg.enableAge "https://atuin-sync.vhack.eu"; # Use the rather reasonable syntax of `skim` to search. search_mode = "skim"; diff --git a/modules/by-name/at/atuin/secrets/encryption_key.age.license b/modules/by-name/at/atuin/secrets/encryption_key.age.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/at/atuin/secrets/encryption_key.age.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/ba/backup/module.nix b/modules/by-name/ba/backup/module.nix index 92700bf2..d0805092 100644 --- a/modules/by-name/ba/backup/module.nix +++ b/modules/by-name/ba/backup/module.nix @@ -1,51 +1,207 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, - pkgs, config, + pkgs, ... }: let - backup-script = pkgs.writeShellScriptBin "backsnap" '' - set -xeu; - - ${pkgs.util-linux}/bin/mount --mkdir "/dev/disk/by-uuid/${cfg.backupDiskUuid}" "/run/media/${cfg.backupDiskUuid}"; - ${pkgs.snap-sync-forked}/bin/snap-sync-forked --UUID "${cfg.backupDiskUuid}" --noconfirm; - ${pkgs.util-linux}/bin/umount "/run/media/${cfg.backupDiskUuid}"; - ''; - cfg = config.soispha.services.backup; + + snapshotDir = "/srv/last_snapshot"; in { options.soispha.services.backup = { - enable = lib.mkEnableOption "backups with my forked snap-sync"; - backupDiskUuid = lib.mkOption { - type = lib.types.str; - example = lib.literalExpression "d1d20ae7-3d8a-44da-86da-677dbbb10c89"; - description = "The UUID of the backup disk"; + storagebox = { + enable = lib.mkEnableOption "remote backups"; + user = lib.mkOption { + type = lib.types.str; + description = "The storagebox-user to use"; + example = "u384702-sub2"; + }; + + sshKey = lib.mkOption { + type = lib.types.path; + description = "The age-encrypted ssh-key, passed to agenix"; + default = ./secrets/storagebox/ssh_key.age; + }; + + repositoryPassword = lib.mkOption { + type = lib.types.path; + description = "The age-encrypted restic password, passed to agenix"; + default = ./secrets/storagebox/repository_password.age; + }; + }; + + local = { + enable = lib.mkEnableOption "local backups"; + + repositoryPassword = lib.mkOption { + type = lib.types.path; + description = "The age-encrypted restic password, passed to agenix"; + default = ./secrets/local/repository_password.age; + }; + + backupMountPoint = lib.mkOption { + type = lib.types.path; + description = "The path where to expect the mounted backup disk"; + default = "/mnt/backup"; + }; }; }; - config = lib.mkIf cfg.enable { - systemd = { - services.backup = { - wantedBy = lib.mkForce []; - unitConfig = { - Description = "Backup the last snapshots of the persitent-storage subvolume."; - }; + config = { + age.secrets = { + resticStorageboxSshKey = lib.mkIf cfg.storagebox.enable { + file = cfg.storagebox.sshKey; + mode = "0700"; + owner = "root"; + group = "root"; + }; + resticStorageboxRepositoryPassword = lib.mkIf cfg.storagebox.enable { + file = cfg.storagebox.repositoryPassword; + mode = "0700"; + owner = "root"; + group = "root"; + }; + resticLocalRepositoryPassword = lib.mkIf cfg.local.enable { + file = cfg.local.repositoryPassword; + mode = "0700"; + owner = "root"; + group = "root"; + }; + }; + + soispha.programs.ssh = lib.mkIf cfg.storagebox.enable { + enable = true; + rootKnownHosts = { + "[u459143-sub1.your-storagebox.de]:23" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIICf9svRenC/PLKIL9nk6K/pxQgoiFC41wTNvoIncOxs"; + }; + }; + + systemd.services = { + prepare-backup = { + requires = []; + after = []; + + description = "Prepare a backup by snapshotting the system."; + serviceConfig = { + ExecStart = lib.getExe (pkgs.writeShellApplication { + name = "prepareBackup"; + text = '' + set -x + + [ -d "${snapshotDir}" ] && btrfs subvolume delete "${snapshotDir}" + + # -r := Make the snapshot read-only + btrfs subvolume snapshot -r /srv "${snapshotDir}"; + ''; + + inheritPath = false; + runtimeInputs = [ + pkgs.btrfs-progs + ]; + }); + Type = "oneshot"; - ExecStart = "${backup-script}/bin/backsnap"; + + User = "root"; + Group = "root"; + + # TODO: Hardening <2025-05-04> }; }; - timers.backup = { - wantedBy = ["timers.target"]; - unitConfig = { - Description = "Backup 15min after boot and every 8 hours"; + restic-backups-storagebox = lib.mkIf cfg.storagebox.enable { + requires = ["prepare-backup.service"]; + after = ["prepare-backup.service"]; + }; + + restic-backups-local = lib.mkIf cfg.local.enable { + requires = ["prepare-backup.service"]; + after = ["prepare-backup.service"]; + + serviceConfig = { + ConditionPathIsDirectory = "${cfg.local.backupMountPoint}"; }; + }; + }; + + services.restic.backups = let + homeDir = "${snapshotDir}/home"; + + paths = [ + snapshotDir + ]; + exclude = [ + "${homeDir}/soispha/.cache" + ]; + extraBackupArgs = [ + "--verbose=2" + ]; + in { + local = lib.mkIf cfg.local.enable { + inhibitsSleep = true; + initialize = true; + + inherit paths exclude extraBackupArgs; + + passwordFile = config.age.secrets.resticLocalRepositoryPassword.path; + + repository = "${cfg.local.backupMountPoint}/restic-backup-data/"; + + # Start on demand. + timerConfig = null; + }; + + storagebox = lib.mkIf cfg.storagebox.enable { + inhibitsSleep = true; + initialize = true; + + inherit paths exclude extraBackupArgs; + + passwordFile = config.age.secrets.resticStorageboxRepositoryPassword.path; + extraOptions = [ + "rclone.program='ssh -p 23 ${cfg.storagebox.user}@${cfg.storagebox.user}.your-storagebox.de -i ${config.age.secrets.resticStorageboxSshKey.path} command_forced_on_remote'" + ]; + + # This setting is normally passed to rclone, but we force + # the command on the remote. + # As such, the value does not matter and must only be parseable by restic. + repository = "rclone: "; + timerConfig = { - OnBootSec = "15min"; - OnUnitActiveSec = "8h"; + Requires = "network-online.target"; + OnActiveSec = "30m"; + OnUnitInactiveSec = "2h"; + Persistent = true; }; }; + + # This is only for listing, pruning and such stuff. + storagebox-admin = lib.mkIf cfg.storagebox.enable { + inhibitsSleep = false; + initialize = false; + + passwordFile = config.age.secrets.resticStorageboxRepositoryPassword.path; + extraOptions = [ + "rclone.program='ssh -p 23 ${cfg.storagebox.user}@${cfg.storagebox.user}.your-storagebox.de command_forced_on_remote'" + ]; + + # This setting is normally passed to rclone, but we force + # the command on the remote. + # As such, the value does not matter and must only be parseable by restic. + repository = "rclone: "; + + timerConfig = null; + }; }; }; } diff --git a/modules/by-name/ba/backup/secrets/local/repository_password.age b/modules/by-name/ba/backup/secrets/local/repository_password.age new file mode 100644 index 00000000..b1508e49 --- /dev/null +++ b/modules/by-name/ba/backup/secrets/local/repository_password.age @@ -0,0 +1,20 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBqVCtBZzNBWFlxQnhlb3c2 +NG0xMjV3V2hQUWhNb01ROGpFbzM0c3NjRWlvCjRqMTdxNlNsY1lDM2VCUGRjcldZ +SUhScGRSejY3TFlwVjlweTRERkU4ZTQKLT4gc3NoLWVkMjU1MTkgelpFb25nIGtj +cVN4RzFseTJCVXhOc0tEWi96ckpGQjhNdUZrb1FVWnJ6TU1vSHZCMUkKc1JwM2Ir +TzNzZEV5VEE4QUp4cDdTNWZvTFlZR0tUbUFZTnNEZE1McnhISQotPiBzc2gtZWQy +NTUxOSA3SGZGVXcgYVQzRHdaa1NYUUpLODUyL0orV3d4Z1o1V2hhekZXVWFzNW50 +enhSYnlWbwpzbnZwK1dSczJ5SGZsRjNyRWZraUcreWlBakZOZkVyZ01CWml5V0E4 +TzY4Ci0+ICpMUC1ncmVhc2UgV0IKUTZVMzR1QTVGdWRyNWprVVpjaWhCTTFSRzY3 +bHVtdHpJQXlWQVFHZ3FzbkZncHRsQnJIaHlEekl5ZE15Sko0YQpSVEUKLS0tIGFy +N1Y2OUREY1NOL2xPODd4Y3Y4Wk83NFJ5ZVBpNnJYelo3RmZPL1V4Q28KcA+6qt2d +LrL0FS279XL1uqSeXiDdBBBh5i951dRx9ML33g7IoQxaGqSWU0yP/y7fcSp3B/rT +/alQGRL/uYnCS2z8zCngr2YCQBXAI8bOgf+th7fzc15FXNB14WMGvrCVRB8Rr6JZ +itTxcAebY192xeINJG269iL6Ef0YrmZLUufKQ9lcVob/G32tG0vxSbSBBx3asf7y +toiNdlXpxJPrIpFx5mc3dnkaXCTSRuXjiAqnncW/HNxovCI90sY3dyL+XRC8iEOD +sql7C7jUUvLubptk1gGW5pHmGvqeCLr+fJ6XrVqXE5VxOSbzvSUsdS84WOBInLiO +V36aUtthEzdRXd81P/n7U26O93GWpIwzctu0WwSHHHsPKhxqFY4RuWa3mO4Zk6fu +O6fsYnpAqYiCUd/k2zKrDtLosTnwuwc7Vm1glm4DEEtvteVibw47SR1LLfUds5XL +j1OR7Z6/ljIEKPjE1a81pQjYRfHDUtceXUvrlL6iCID30zU= +-----END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/ba/backup/secrets/storagebox/repository_password.age b/modules/by-name/ba/backup/secrets/storagebox/repository_password.age new file mode 100644 index 00000000..a2aa984a --- /dev/null +++ b/modules/by-name/ba/backup/secrets/storagebox/repository_password.age @@ -0,0 +1,14 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBzbnJ5Z3NXRFRtdEdCNk1z +NG9Cb2FUTEZ2U2hTdUptWGpneHd2RGxGQlY0ClhqcHlMSUZlLzBPZko4a2hKdnE1 +Q1hnc3ErWlJiSk1HVXFLcSswQlV0WTAKLT4gc3NoLWVkMjU1MTkgelpFb25nIG5I +cFpMY21ZdU9TUHY5VksraG1xeFByQlM1WE1INEk0SWFJQzIvSXhZbXMKSWxiNlIr +NjZ6bEgySUJGdnpoZTY2MmxxajJMaUVTM3RkTmhpdkxaRnNCQQotPiBzc2gtZWQy +NTUxOSA3SGZGVXcgRGtLMHFORm9mUDUwZnBXM0djcFlxTExJbWVDeDJmbVVSRi9l +QTFmekpROApZY3Z0Zlc1SUdCcllKQ01ZNmdFQkI3UnViVGxzNTJNUkhqc2hOejY3 +MndrCi0+IG1Hbi1ncmVhc2UgUDJJdgpGUmVHa1NPWGtzUmZmMXM3eWkxVnJkek1h +MUxZeS9qMlArendXZ1ltdFgvMTBabTlPM2hzSjhuVXBQNktHKzc1ClF6bjZob09B +Ci0tLSB3dEZpbnpVR0pPdGpFVmNyM0JzUGl6eGcreXpkTG9xQUc5S09ndUthaEpR +CuHgXCIq/AUCuIQWepBRapAab6zczOwxEBpDv5R2kw2mw34UVRLuFs7hB1cHE79y +7Fc= +-----END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/ba/backup/secrets/storagebox/ssh_key.age b/modules/by-name/ba/backup/secrets/storagebox/ssh_key.age new file mode 100644 index 00000000..a7f30c7c --- /dev/null +++ b/modules/by-name/ba/backup/secrets/storagebox/ssh_key.age @@ -0,0 +1,22 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBJOTFaQVpnQ2VJN1pJbmdu +STF2UTF1Y3lyU2p3OUJlcWRFWlg3Mm9vSEFFCjg4RklaZ0hqdWdZSlJ0dGx0ckJN +eHE4R1QyTEJEVkZudnVQV2VpblBYTW8KLT4gc3NoLWVkMjU1MTkgelpFb25nIDR0 +Z2RwTXJGV1VYT2Y1OUcxbXpnOGNEbG9BWmFxeWUzZ1huNW1YQk5BM3cKK1hLNnYx +VnNvRDZWM3Y4VUpCQTRtbHJOcDJLdTBOUXJ1ak52Mkp3TE9OcwotPiBzc2gtZWQy +NTUxOSA3SGZGVXcgSHFSOXM1Vm1lY0ErRkZobndEU0xvQjVXbnhDbUlGNmE2dStY +SEFqSk9TMAo2VU5UbW9rc29kendvcHNuU3hFQ2lBQWNjRUxUSE10RmtjbkdwWGlv +cTRVCi0+IDwtZ3JlYXNlIHNPT3N1IHNkZzcoQzUgLUM3Ml1Tcgorb3FQcWlDSkJQ +L1g4WisydkYxdnJMeDNISVVDTGlZdmUyRkV0TkFUdW4ycXZBSlF3UWM2R3FTYjRs +ckEyaTg2ClVrbwotLS0gdHF5Q3BqV3h2TzEySCs4OFNIYmx1U0hsTWo1RDlTV3VC +T1RmelZaWXh4YwoeRkYbirDGX9aZj6OVxZ8sVsm2Sz23ikcBhAdTIXKErM7eQcdp +Y2nA5kUebPVznbSq/XSQNbqvCfSv9wVVTZWww7AqkrltjFS8yxQVMKB37IfnJsZI +92OCjJKArxAbvS7ERKY51Cf9oY/VqGk5WqxExH5ZvdbL144UI8JzrxhDopVXBWNd +fCrHirRAdlu3wgVILXV3vk1kmE69sspuV4cer5f/kOBKT1w09s2NFFHH4TO3cLTJ +Obgi/HWYHBjqGSgwd4bDtNOW2UDE1LN3YeUhloutWhuX8yt+NFzZJtl+CBrRqLKA +0CK+ZPKPWWKYPCNlzKT4vDF9BZeyCfoEj9dTXvxrNPEB6YYi16aQ8DhI8wxADl41 +ShrULlEmB8rfz7V+8TFmERKISBRSSH0p+XJi8e2DWh2dSco16rizmbFFNDdcYiGT +WWbXYCFNzj+kNFI/vEtt9dEWmfXlgg01khnyoOuRLedtoCDSuF+8z7YYy6oYt/2h +gmf4NHOUgyxK56c17JMQ3xT97d2odgqmwB+YZQ13IJCjt3M3pmSssD4sTgmA5alH +vtUlci6dZdO801h5vOesbAJplXCEyw== +-----END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/bl/bluetooth/module.nix b/modules/by-name/bl/bluetooth/module.nix index 486f6e6f..7750e70d 100644 --- a/modules/by-name/bl/bluetooth/module.nix +++ b/modules/by-name/bl/bluetooth/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/bo/boot/boot_pictures/gnu.png.license b/modules/by-name/bo/boot/boot_pictures/gnu.png.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/bo/boot/boot_pictures/gnu.png.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/bo/boot/boot_pictures/gnulin_emb_1.png.license b/modules/by-name/bo/boot/boot_pictures/gnulin_emb_1.png.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/bo/boot/boot_pictures/gnulin_emb_1.png.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/bo/boot/boot_pictures/gnulin_emb_2.png.license b/modules/by-name/bo/boot/boot_pictures/gnulin_emb_2.png.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/bo/boot/boot_pictures/gnulin_emb_2.png.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/bo/boot/iso_entry/archlive_iso.nix b/modules/by-name/bo/boot/iso_entry/archlive_iso.nix index d19a4a87..d0ae8457 100644 --- a/modules/by-name/bo/boot/iso_entry/archlive_iso.nix +++ b/modules/by-name/bo/boot/iso_entry/archlive_iso.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs ? (builtins.getFlake "nixpkgs").legacyPackages."x86_64-linux"}: let signing_key = import ./signing_key.nix {inherit pkgs;}; diff --git a/modules/by-name/bo/boot/iso_entry/signing_key.nix b/modules/by-name/bo/boot/iso_entry/signing_key.nix index 788447be..d9268d75 100644 --- a/modules/by-name/bo/boot/iso_entry/signing_key.nix +++ b/modules/by-name/bo/boot/iso_entry/signing_key.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs ? (builtins.getFlake "nixpkgs").legacyPackages."x86_64-linux"}: pkgs.stdenv.mkDerivation { name = "archlinux_signing_keys"; diff --git a/modules/by-name/bo/boot/module.nix b/modules/by-name/bo/boot/module.nix index 8b71ce65..404352ac 100644 --- a/modules/by-name/bo/boot/module.nix +++ b/modules/by-name/bo/boot/module.nix @@ -1,7 +1,17 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, pkgs, + modules, ... }: let cfg = config.soispha.boot; @@ -12,6 +22,10 @@ in { # enableIsoEntry = lib.mkEnableOption "an tails iso boot entry"; }; + imports = [ + modules.lanzaboote.nixosModules.lanzaboote + ]; + config = lib.mkIf cfg.enable ( # let # cfg = config.boot.loader.systemd-boot; diff --git a/modules/by-name/ca/cargo/module.nix b/modules/by-name/ca/cargo/module.nix index f7153509..980ebcba 100644 --- a/modules/by-name/ca/cargo/module.nix +++ b/modules/by-name/ca/cargo/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/cl/cleanup/module.nix b/modules/by-name/cl/cleanup/module.nix index f8307b73..98c699eb 100644 --- a/modules/by-name/cl/cleanup/module.nix +++ b/modules/by-name/cl/cleanup/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/dc/dconf/module.nix b/modules/by-name/dc/dconf/module.nix index e4a1c7a9..ec055a6f 100644 --- a/modules/by-name/dc/dconf/module.nix +++ b/modules/by-name/dc/dconf/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { # needed to make home-manager play nice with some apps. See: # https://nix-community.github.io/home-manager/index.xhtml#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal diff --git a/modules/by-name/di/direnv/module.nix b/modules/by-name/di/direnv/module.nix index 1ddf3d5d..7c81e671 100644 --- a/modules/by-name/di/direnv/module.nix +++ b/modules/by-name/di/direnv/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/di/disks/fstrim.nix b/modules/by-name/di/disks/fstrim.nix index 6daeb65e..0fbb6c83 100644 --- a/modules/by-name/di/disks/fstrim.nix +++ b/modules/by-name/di/disks/fstrim.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, diff --git a/modules/by-name/di/disks/hibernate.nix b/modules/by-name/di/disks/hibernate.nix index a50e5b57..e983f9c7 100644 --- a/modules/by-name/di/disks/hibernate.nix +++ b/modules/by-name/di/disks/hibernate.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs}: { services = { hibernate-preparation = { diff --git a/modules/by-name/di/disks/module.nix b/modules/by-name/di/disks/module.nix index c0e5bcfd..d88fa3df 100644 --- a/modules/by-name/di/disks/module.nix +++ b/modules/by-name/di/disks/module.nix @@ -1,7 +1,17 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, pkgs, + modules, ... }: let # FIXME: The iso redeploy requires a bigger efi partition <2024-05-12> @@ -37,6 +47,10 @@ in { }; }; + imports = [ + modules.disko.nixosModules.default + ]; + config = lib.mkIf cfg.enable { systemd = lib.recursiveUpdate (import ./hibernate.nix {inherit pkgs;}) (import ./fstrim.nix {inherit pkgs lib cfg;}); diff --git a/modules/by-name/do/documentation/module.nix b/modules/by-name/do/documentation/module.nix index 4616a991..e4e51409 100644 --- a/modules/by-name/do/documentation/module.nix +++ b/modules/by-name/do/documentation/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/fi/firefox/extensions.json b/modules/by-name/fi/firefox/extensions.json index 062f1a5e..cc098acd 100644 --- a/modules/by-name/fi/firefox/extensions.json +++ b/modules/by-name/fi/firefox/extensions.json @@ -3,17 +3,17 @@ "addonId": "addon@darkreader.org", "default_area": "navbar", "pname": "darkreader", - "sha256": "sha256:f565b2263a71626a0310380915b7aef90be8cc6fe16ea43ac1a0846efedc2e4c", - "url": "https://addons.mozilla.org/firefox/downloads/file/4439735/darkreader-4.9.103.xpi", - "version": "4.9.103" + "sha256": "sha256:23c94085063aa6b57fae40ca9111ab049fffca5476c29e9990db3aa1a3fe1f10", + "url": "https://addons.mozilla.org/firefox/downloads/file/4488139/darkreader-4.9.106.xpi", + "version": "4.9.106" }, "keepassxc-browser": { "addonId": "keepassxc-browser@keepassxc.org", "default_area": "navbar", "pname": "keepassxc-browser", - "sha256": "sha256:f4ecad9cabe70511fbff42fe4fe831c560cc3a0b6da10a740ce670f4f6597f42", - "url": "https://addons.mozilla.org/firefox/downloads/file/4441759/keepassxc_browser-1.9.7.xpi", - "version": "1.9.7" + "sha256": "sha256:7629ee8fe6a8bace5d0f12c3aef41803c2ab01407a22ad8803633992a6c4eda2", + "url": "https://addons.mozilla.org/firefox/downloads/file/4477789/keepassxc_browser-1.9.8.xpi", + "version": "1.9.8" }, "torproject-snowflake": { "addonId": "{b11bea1f-a888-4332-8d8a-cec2be7d24b9}", @@ -35,9 +35,9 @@ "addonId": "uBlock0@raymondhill.net", "default_area": "menupanel", "pname": "ublock-origin", - "sha256": "sha256:d93176cef4dc042e41ba500aa2a90e5d57b5be77449cbd522111585e3a0cd158", - "url": "https://addons.mozilla.org/firefox/downloads/file/4458450/ublock_origin-1.63.2.xpi", - "version": "1.63.2" + "sha256": "sha256:b9e1c868bd1ac1defcabf2e01776d1a90effba34b07fe6a21350d45f022e0e9f", + "url": "https://addons.mozilla.org/firefox/downloads/file/4492375/ublock_origin-1.64.0.xpi", + "version": "1.64.0" }, "vhack-libredirect": { "addonId": "vhack-libredirect@addons.vhack.eu", diff --git a/modules/by-name/fi/firefox/extensions.json.license b/modules/by-name/fi/firefox/extensions.json.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/fi/firefox/extensions.json.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/fi/firefox/module.nix b/modules/by-name/fi/firefox/module.nix index 17bfa049..b5c1ff9a 100644 --- a/modules/by-name/fi/firefox/module.nix +++ b/modules/by-name/fi/firefox/module.nix @@ -1,7 +1,17 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, pkgs, + modules, ... }: let cfg = config.soispha.programs.firefox; @@ -194,6 +204,10 @@ in { }; home-manager.users.soispha = { + imports = [ + modules.arkenfox-nixos.hmModules.arkenfox + ]; + home.sessionVariables = { # Improve touch input and make scrolling smother MOZ_USE_XINPUT2 = "1"; diff --git a/modules/by-name/fi/firefox/profile.nix b/modules/by-name/fi/firefox/profile.nix index 195c2075..d82bfafa 100644 --- a/modules/by-name/fi/firefox/profile.nix +++ b/modules/by-name/fi/firefox/profile.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, pkgs, diff --git a/modules/by-name/fi/firefox/search_engines/default.nix b/modules/by-name/fi/firefox/search_engines/default.nix index 51a447e1..f36be0a7 100644 --- a/modules/by-name/fi/firefox/search_engines/default.nix +++ b/modules/by-name/fi/firefox/search_engines/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { # DEFAULT brave-search = { diff --git a/modules/by-name/fi/firefox/search_engines/logos/arch_linux.svg.license b/modules/by-name/fi/firefox/search_engines/logos/arch_linux.svg.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/fi/firefox/search_engines/logos/arch_linux.svg.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/fi/firefox/search_engines/logos/brave.svg.license b/modules/by-name/fi/firefox/search_engines/logos/brave.svg.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/fi/firefox/search_engines/logos/brave.svg.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/fi/firefox/search_engines/logos/google_scholar.ico.license b/modules/by-name/fi/firefox/search_engines/logos/google_scholar.ico.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/fi/firefox/search_engines/logos/google_scholar.ico.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/fi/firefox/search_engines/logos/rust_std.svg.license b/modules/by-name/fi/firefox/search_engines/logos/rust_std.svg.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/fi/firefox/search_engines/logos/rust_std.svg.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/fi/firefox/search_engines/logos/rust_tokio.png.license b/modules/by-name/fi/firefox/search_engines/logos/rust_tokio.png.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/fi/firefox/search_engines/logos/rust_tokio.png.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/fi/firefox/search_engines/logos/wikipedia.svg.license b/modules/by-name/fi/firefox/search_engines/logos/wikipedia.svg.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/fi/firefox/search_engines/logos/wikipedia.svg.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/fi/firefox/update_extensions.sh b/modules/by-name/fi/firefox/update_extensions.sh index efcc83c6..588a7530 100755 --- a/modules/by-name/fi/firefox/update_extensions.sh +++ b/modules/by-name/fi/firefox/update_extensions.sh @@ -1,5 +1,15 @@ #!/usr/bin/env sh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # The `generate_extensions` binary is provided in the devshell. generate_extensions \ diff --git a/modules/by-name/fi/firefox/userChrome.css b/modules/by-name/fi/firefox/userChrome.css index 0b3aff77..6e0d705d 100644 --- a/modules/by-name/fi/firefox/userChrome.css +++ b/modules/by-name/fi/firefox/userChrome.css @@ -1,3 +1,15 @@ +/* + * nixos-config - My current NixOS configuration + * + * Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> + * 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + */ + /* thickness of tab when you have too many open tabs */ .tabbrowser-tab:not([pinned="true"]) { min-width: 10px !important; diff --git a/modules/by-name/fo/fonts/emoji_font.xml b/modules/by-name/fo/fonts/emoji_font.xml index f3f6bb3e..8a922f61 100644 --- a/modules/by-name/fo/fonts/emoji_font.xml +++ b/modules/by-name/fo/fonts/emoji_font.xml @@ -1,4 +1,17 @@ <?xml version="1.0"?> + +<!-- +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. +--> + <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <alias binding="weak"> diff --git a/modules/by-name/fo/fonts/module.nix b/modules/by-name/fo/fonts/module.nix index 057c3f36..f8752ae6 100644 --- a/modules/by-name/fo/fonts/module.nix +++ b/modules/by-name/fo/fonts/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/fw/fwupd/module.nix b/modules/by-name/fw/fwupd/module.nix index 5ad4f467..0c4a7bf3 100644 --- a/modules/by-name/fw/fwupd/module.nix +++ b/modules/by-name/fw/fwupd/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/gi/git/aliases.nix b/modules/by-name/gi/git/aliases.nix index 96456bea..bc30ea40 100644 --- a/modules/by-name/gi/git/aliases.nix +++ b/modules/by-name/gi/git/aliases.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, defaultBranchName, diff --git a/modules/by-name/gi/git/git_ignore.git.license b/modules/by-name/gi/git/git_ignore.git.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/gi/git/git_ignore.git.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/gi/git/git_template.git.license b/modules/by-name/gi/git/git_template.git.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/gi/git/git_template.git.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/gi/git/module.nix b/modules/by-name/gi/git/module.nix index 8e413e8a..a70c38d7 100644 --- a/modules/by-name/gi/git/module.nix +++ b/modules/by-name/gi/git/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/home.legacy/conf/gpg/keys/key_1.asc b/modules/by-name/gp/gpg/keys/key_1.asc index 795f82af..f29184d8 100644 --- a/modules/home.legacy/conf/gpg/keys/key_1.asc +++ b/modules/by-name/gp/gpg/keys/key_1.asc @@ -1,3 +1,13 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + -----BEGIN PGP PUBLIC KEY BLOCK----- Comment: 8321 ED3A 8DB9 99A5 1F3B F80F F268 2914 EA42 DE26 Comment: Benedikt Peetz <benedikt.peetz@b-peetz.de> diff --git a/modules/home.legacy/conf/gpg/keys/key_2.asc b/modules/by-name/gp/gpg/keys/key_2.asc index 47188da7..7433a3f2 100644 --- a/modules/home.legacy/conf/gpg/keys/key_2.asc +++ b/modules/by-name/gp/gpg/keys/key_2.asc @@ -1,3 +1,13 @@ +// nixos-config - My current NixOS configuration +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + -----BEGIN PGP PUBLIC KEY BLOCK----- Comment: 2FEA 7BDB 9171 70A7 B8E7 2001 DF18 78E6 D9C3 B27F Comment: Silas <sils@sils.li> diff --git a/modules/by-name/gp/gpg/module.nix b/modules/by-name/gp/gpg/module.nix new file mode 100644 index 00000000..89d7b356 --- /dev/null +++ b/modules/by-name/gp/gpg/module.nix @@ -0,0 +1,90 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. +# TODO: Migrate to squoia-sq <2025-04-25> +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.soispha.programs.gpg; + homeConfig = config.home-manager.users.soispha; +in { + options.soispha.programs.gpg = { + enable = lib.mkEnableOption "gpg"; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + programs.gpg = { + enable = true; + homedir = "${homeConfig.xdg.dataHome}/gnupg"; + mutableKeys = true; + mutableTrust = true; + + settings = { + default-key = "Benedikt Peetz <benedikt.peetz@b-peetz.de>"; + # TODO: add more + }; + + publicKeys = [ + { + source = ./keys/key_1.asc; + trust = "ultimate"; + } + { + source = ./keys/key_2.asc; + trust = "full"; + } + ]; + }; + services = { + gpg-agent = { + enable = true; + enableZshIntegration = true; + enableScDaemon = true; # smartcards and such things + + # Cache the key passwords + defaultCacheTtl = 60 * 50; + defaultCacheTtlSsh = 60 * 50; + maxCacheTtl = 60 * 50; + maxCacheTtlSsh = 60 * 50; + + pinentry = { + package = pkgs.pinentry-curses; + # package = pkgs.pinentry-tty; + }; + + enableSshSupport = true; + sshKeys = let + removeSpace = str: builtins.replaceStrings [" "] [""] str; + in [ + (removeSpace "8321 ED3A 8DB9 99A5 1F3B F80F F268 2914 EA42 DE26") + ]; + }; + }; + }; + + soispha.programs.zsh.integrations.gpg = '' + export GPG_TTY=$(tty) + + # Magic copied from the gpg-agent manual + unset SSH_AGENT_PID + if [ "''${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + fi + + + # Ensure that get gpg agent is started (necessary because ssh does not start it + # automatically and has it's tty updated) + gpg-connect-agent /bye + ''; + }; +} diff --git a/modules/by-name/ha/hardware/module.nix b/modules/by-name/ha/hardware/module.nix index 850416b7..599f5d23 100644 --- a/modules/by-name/ha/hardware/module.nix +++ b/modules/by-name/ha/hardware/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/ho/home-manager/module.nix b/modules/by-name/ho/home-manager/module.nix index 5da40834..d7eccbd6 100644 --- a/modules/by-name/ho/home-manager/module.nix +++ b/modules/by-name/ho/home-manager/module.nix @@ -1,22 +1,17 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, - pkgsStable, - nixpkgs_open_prs, - sysLib, - # extra information system, - # bins - # TODO: Integrate these <2024-05-22> - shell_library, - qmk_firmware, - # external deps - user_js, - # modules - impermanence, - nix-index-database, - nixVim, - arkenfox-nixos, + modules, ... }: let cfg = config.soispha.home-manager; @@ -25,6 +20,10 @@ in { enable = lib.mkEnableOption "home-manager with custom config."; }; + imports = [ + modules.home-manager.nixosModules.home-manager + ]; + # TODO: Find a way to throw this error below, when a user `enable`s a home-manager # module, but not this module. Without having to plaster all the `home-manager` modules # with `assert`s. <2024-10-18> @@ -33,24 +32,12 @@ in { home-manager = { useGlobalPkgs = true; useUserPackages = true; + + # TODO(@bpeetz): Remove this once the legacy -> by-name migration is done. <2025-05-16> users.soispha = import ../../../home.legacy; extraSpecialArgs = { inherit - nixpkgs_open_prs - pkgsStable - sysLib - # extra information system - # bins - shell_library - qmk_firmware - # external deps - user_js - # modules - impermanence - nixVim - nix-index-database - arkenfox-nixos ; }; }; diff --git a/modules/by-name/i3/i3bar-river/module.nix b/modules/by-name/i3/i3bar-river/module.nix new file mode 100644 index 00000000..b32ec6a5 --- /dev/null +++ b/modules/by-name/i3/i3bar-river/module.nix @@ -0,0 +1,197 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.programs.i3bar-river; + + toColor = color: + if builtins.isString color + then lib.trivial.fromHexString color + else color; + + substractColor = color_a: color_b: let + saturatingSub = a: b: + if a < b + then 0 + else a - b; + in { + red = saturatingSub color_a.red color_b.red; + green = saturatingSub color_a.green color_b.green; + blue = saturatingSub color_a.blue color_b.blue; + alpha = saturatingSub color_a.alpha color_b.alpha; + inherit (color_a) __toString; + }; + + colorOption = red: green: blue: alpha: + lib.mkOption { + type = lib.types.submodule { + options = { + red = lib.mkOption { + type = lib.types.ints.between 0 255; + description = "The amount of red in this color"; + default = toColor red; + }; + green = lib.mkOption { + type = lib.types.ints.between 0 255; + description = "The amount of green in this color"; + default = toColor green; + }; + blue = lib.mkOption { + type = lib.types.ints.between 0 255; + description = "The amount of blue in this color"; + default = toColor blue; + }; + alpha = lib.mkOption { + type = lib.types.ints.between 0 255; + description = "The amount of alpha in this color"; + default = toColor alpha; + }; + + __toString = lib.mkOption { + internal = true; + + default = self: let + tH = num: let + converted = lib.trivial.toHexString num; + in + if builtins.stringLength converted == 1 + then "0${converted}" + else assert (builtins.stringLength converted) == 2; converted; + + output = "#${tH self.red}${tH self.green}${tH self.blue}${tH self.alpha}"; + in + output; + + description = "Convert this type to a string before use"; + }; + }; + }; + + default = { + red = toColor red; + green = toColor green; + blue = toColor blue; + alpha = toColor alpha; + }; + + description = "The specific color to use for this name."; + }; +in { + options.soispha.programs.i3bar-river = { + enable = lib.mkEnableOption "i3bar-river"; + + package = lib.mkPackageOption pkgs "i3bar-river-patched" {}; + + colors = { + none = colorOption 00 00 00 00; + + white = colorOption "ff" "ff" "ff" "ff"; + + blue = colorOption "99" "d1" "db" "ff"; + green = colorOption "a6" "e3" "a1" "dd"; + lavendar = colorOption "b4" "be" "fe" "dd"; + mauve = colorOption "cb" "a6" "f7" "dd"; + normal = colorOption "c6" "ce" "ef" "ff"; + peach = colorOption "fa" "b3" "87" "dd"; + sapphire = colorOption "74" "c7" "ec" "dd"; + teal = colorOption "94" "e2" "d5" "dd"; + + light_gray = colorOption "58" "5b" "70" "ff"; + gray = colorOption "45" "47" "5a" "ff"; + dark_gray = colorOption "30" "34" "46" "ff"; + bright_red = colorOption "e7" "82" "84" "ff"; + + vivid_burgundy = colorOption "9f" "1d" "35" "ff"; + + unfocused_offset = colorOption "33" "33" "33" "00"; + }; + }; + + config = lib.mkIf cfg.enable { + soispha.programs.river.init.backgroundStart = [cfg.package]; + + home-manager.users.soispha = { + programs.i3bar-river = { + enable = true; + inherit (cfg) package; + + settings = { + theme = { + palette = { + # Colors + background = toString cfg.colors.none; + color = toString cfg.colors.white; # Only used, if blocks do not specify one + separator = toString cfg.colors.vivid_burgundy; + + # Tag is set (but not focused or urgent) + tag_fg = toString cfg.colors.white; + tag_bg = toString cfg.colors.light_gray; + + tag_urgent_fg = toString cfg.colors.white; + tag_urgent_bg = toString cfg.colors.bright_red; + + tag_focused_fg = toString cfg.colors.white; + tag_focused_bg = toString cfg.colors.teal; + + tag_inactive_fg = toString cfg.colors.white; + tag_inactive_bg = toString cfg.colors.none; + + # Shop options + blend = true; # whether tags/blocks colors should blend with bar's background + hide_inactive_tags = false; + show_layout_name = false; + show_mode = true; + show_tags = true; + }; + + unfocused_palette = { + hide_inactive_tags = true; + + color = toString (substractColor cfg.colors.white cfg.colors.unfocused_offset); + separator = toString (substractColor cfg.colors.vivid_burgundy cfg.colors.unfocused_offset); + + tag_fg = toString (substractColor cfg.colors.white cfg.colors.unfocused_offset); + tag_bg = toString (substractColor cfg.colors.light_gray cfg.colors.unfocused_offset); + + tag_urgent_fg = toString (substractColor cfg.colors.white cfg.colors.unfocused_offset); + tag_urgent_bg = toString (substractColor cfg.colors.bright_red cfg.colors.unfocused_offset); + + tag_focused_fg = toString (substractColor cfg.colors.white cfg.colors.unfocused_offset); + tag_focused_bg = toString cfg.colors.vivid_burgundy; + + tag_inactive_fg = toString (substractColor cfg.colors.white cfg.colors.unfocused_offset); + tag_inactive_bg = toString (substractColor cfg.colors.none cfg.colors.unfocused_offset); + }; + }; + + # The font and various sizes + font = "SauceCodePro Nerd Font Mono:pixelsize=26"; + height = 24; + margin_top = 10; + margin_bottom = 0; + margin_left = 0; + margin_right = 0; + separator_width = 0; + tags_r = 10.0; + tags_padding = 10.0; + tags_margin = 5.0; + blocks_r = 6.0; + blocks_overlap = 0.0; + + # Misc + position = "top"; # either "top" or "bottom" + layer = "overlay"; # one of "top", "overlay", "bottom" or "background" + invert_touchpad_scrolling = true; + start_hidden = false; # whether the bar is initially in the 'hidden' state + + # WM-specific options + wm.river = { + max_tag = 9; # Show only the first nine tags + }; + }; + }; + }; + }; +} diff --git a/modules/by-name/i3/i3status-rust/module.nix b/modules/by-name/i3/i3status-rust/module.nix new file mode 100644 index 00000000..5bd911d8 --- /dev/null +++ b/modules/by-name/i3/i3status-rust/module.nix @@ -0,0 +1,152 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.programs.i3status-rust; + + mkScript = name: deps: + lib.getExe (pkgs.writeShellApplication { + inherit name; + text = builtins.readFile ./scripts/${name}; + + inheritPath = false; + runtimeInputs = deps; + }); +in { + options.soispha.programs.i3status-rust = { + enable = lib.mkEnableOption "i3status-rust"; + + package = lib.mkPackageOption pkgs "i3status-rust-patched" {}; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + programs.i3status-rust = { + enable = true; + inherit (cfg) package; + + bars.default = { + settings = { + icons = { + icons = "material-nf"; + + overrides = { + cpu = [ + "" # nf-md-memory + ]; + memory_mem = ""; # nf-fa-bars + }; + }; + + theme = { + theme = "slick"; + + overrides = { + separator = "native"; + alternating_tint_bg = "none"; + alternating_tint_fg = "none"; + }; + }; + }; + + blocks = [ + { + block = "time"; + format = " $timestamp.datetime(format:'%d/%m/%y (%a) %H:%M %:z') "; + interval = 60; + } + + { + # TODO(@bpeetz): Switch to “music” when mpd gets mpris support <2025-05-20> + block = "custom"; + interval = "once"; + persistent = true; + command = mkScript "mpd_song_name.sh" [pkgs.mpc pkgs.coreutils]; + hide_when_empty = true; + shell = "${lib.getExe pkgs.dash}"; + format = " $text.str(max_width:60,rot_interval:0.5) "; + } + + { + block = "sound"; + driver = "pulseaudio"; + headphones_indicator = true; + } + + # System info + { + block = "cpu"; + } + { + block = "memory"; + format = " $icon $mem_used_percents {($swap_used_percents.eng(range:1..)) | }"; + } + { + block = "amd_gpu"; + format = " $icon $utilization (^icon_memory_mem $vram_used_percents) "; + } + + { + block = "net"; + format = " ^icon_net_down $speed_down.eng(prefix:Ki) ^icon_net_up $speed_up.eng(prefix:Ki) "; + } + { + block = "privacy"; + driver = [ + {name = "v4l";} + {name = "pipewire";} + ]; + } + + { + block = "disk_space"; + path = "/srv"; + info_type = "used"; + format = " $icon $used.eng(prefix:Gi) ($percentage) "; + backend = "btrfs"; + + # warn if 80 % is used, alert after 90 % used. + warning = 80; + alert = 90; + } + { + block = "backlight"; + missing_format = ""; + } + { + block = "battery"; + missing_format = ""; + } + + # { + # block = "calendar"; + # + # source = { + # calendars = ["user/calendar"]; + # auth = { + # type = "unauthenticated"; + # }; + # }; + # } + # { + # block = "focused_window"; + # driver = "wlr_toplevel_management"; + # } + # { + # block = "maildir"; + # display_type = "new"; + # inboxes = ["~/.local/share/maildir/soispha/*"]; + # interval = 60; + # threshold_critical = 10; + # threshold_warning = 1; + # } + ]; + }; + }; + + programs.i3bar-river.settings.command = "${lib.getExe cfg.package} config-default.toml"; + }; + }; +} diff --git a/modules/by-name/i3/i3status-rust/scripts/mpd_song_name.sh b/modules/by-name/i3/i3status-rust/scripts/mpd_song_name.sh new file mode 100755 index 00000000..28921520 --- /dev/null +++ b/modules/by-name/i3/i3status-rust/scripts/mpd_song_name.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env dash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + +while true; do + state="$(mpc status '%state%')" + + if [ "$state" = "playing" ]; then + song="$(mpc --format '[[%artist% - ]%title%]|[%file%]' current)" + progress="$(mpc status "%currenttime%/%totaltime%")" + + echo "$song :: $progress" + else + # The song has stopped, we are done displaying it. + echo "" + + # Wait for a new song. (Or in this case for a new event.) + mpc idle + fi + + sleep 1 +done + +# vim: ft=sh diff --git a/modules/by-name/im/impermanence/module.nix b/modules/by-name/im/impermanence/module.nix index 94789755..4ce86b25 100644 --- a/modules/by-name/im/impermanence/module.nix +++ b/modules/by-name/im/impermanence/module.nix @@ -1,6 +1,16 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, + modules, ... }: let cfg = config.soispha.impermanence; @@ -23,6 +33,10 @@ in { }; }; + imports = [ + modules.impermanence.nixosModules.impermanence + ]; + config = lib.mkIf cfg.enable { environment.persistence = { "/srv" = { @@ -39,7 +53,6 @@ in { ".local/state/wireplumber" ".config/Signal" - ".config/Element" ".config/iamb/profiles" ".cache" diff --git a/modules/by-name/im/imv/module.nix b/modules/by-name/im/imv/module.nix index 0a324e01..fdf95982 100644 --- a/modules/by-name/im/imv/module.nix +++ b/modules/by-name/im/imv/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/is/issue_file/module.nix b/modules/by-name/is/issue_file/module.nix index d8b6faa8..f9a7b58a 100644 --- a/modules/by-name/is/issue_file/module.nix +++ b/modules/by-name/is/issue_file/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, self, diff --git a/modules/by-name/la/laptop/module.nix b/modules/by-name/la/laptop/module.nix index f70230ad..dd8935b9 100644 --- a/modules/by-name/la/laptop/module.nix +++ b/modules/by-name/la/laptop/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/by-name/le/less/command.less.license b/modules/by-name/le/less/command.less.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/le/less/command.less.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/le/less/env.less.license b/modules/by-name/le/less/env.less.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/le/less/env.less.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/le/less/line-edit.less.license b/modules/by-name/le/less/line-edit.less.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/le/less/line-edit.less.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/le/less/module.nix b/modules/by-name/le/less/module.nix index f2475b73..0dd45a90 100644 --- a/modules/by-name/le/less/module.nix +++ b/modules/by-name/le/less/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/lf/lf/colors.license b/modules/by-name/lf/lf/colors.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/lf/lf/colors.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/lf/lf/commands/base.sh b/modules/by-name/lf/lf/commands/base.sh index 61b59a7b..99852c3e 100755 --- a/modules/by-name/lf/lf/commands/base.sh +++ b/modules/by-name/lf/lf/commands/base.sh @@ -1,5 +1,15 @@ #!/usr/bin/env sh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 id="$id" diff --git a/modules/by-name/lf/lf/commands/default.nix b/modules/by-name/lf/lf/commands/default.nix index 0c42607b..f953834b 100644 --- a/modules/by-name/lf/lf/commands/default.nix +++ b/modules/by-name/lf/lf/commands/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: let functionCall = { name, @@ -116,6 +125,7 @@ in { dependencies = with pkgs; [ river # for `riverctl` swaybg + procps ]; }; @@ -124,22 +134,17 @@ in { dependencies = [pkgs.gnused]; }; - open = async { - name = "open"; - dependencies = [pkgs.handlr-regex]; - }; - trash = pipe { name = "trash"; dependencies = [pkgs.trash-cli]; }; trash_clear = shell { name = "trash_clear"; - dependencies = with pkgs; [conceal fzf gawk trashy]; + dependencies = with pkgs; [conceal fzf gawk trashy gnused]; }; trash_restore = shell { name = "trash_restore"; - dependencies = with pkgs; [conceal fzf gawk trashy]; + dependencies = with pkgs; [conceal fzf gawk trashy gnused]; }; view_file = async { diff --git a/modules/by-name/lf/lf/commands/run.sh b/modules/by-name/lf/lf/commands/run.sh index 6a9b8cab..06106aed 100755 --- a/modules/by-name/lf/lf/commands/run.sh +++ b/modules/by-name/lf/lf/commands/run.sh @@ -1,5 +1,15 @@ #!/usr/bin/env sh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Run one of the commands for debugging purposes. [ "$#" -gt 1 ] || { diff --git a/modules/by-name/lf/lf/commands/scripts/archive_compress.sh b/modules/by-name/lf/lf/commands/scripts/archive_compress.sh index c3776a80..b42688bf 100755 --- a/modules/by-name/lf/lf/commands/scripts/archive_compress.sh +++ b/modules/by-name/lf/lf/commands/scripts/archive_compress.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh b/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh index 08374176..11d634b1 100755 --- a/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh +++ b/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/cd_project_root.sh b/modules/by-name/lf/lf/commands/scripts/cd_project_root.sh index 19100947..c2de61e6 100755 --- a/modules/by-name/lf/lf/commands/scripts/cd_project_root.sh +++ b/modules/by-name/lf/lf/commands/scripts/cd_project_root.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/chmod.sh b/modules/by-name/lf/lf/commands/scripts/chmod.sh index 3dc5f19c..757f3c9c 100755 --- a/modules/by-name/lf/lf/commands/scripts/chmod.sh +++ b/modules/by-name/lf/lf/commands/scripts/chmod.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/cow_cp.sh b/modules/by-name/lf/lf/commands/scripts/cow_cp.sh index 98675b9e..dbe00654 100755 --- a/modules/by-name/lf/lf/commands/scripts/cow_cp.sh +++ b/modules/by-name/lf/lf/commands/scripts/cow_cp.sh @@ -1,5 +1,15 @@ #!/usr/bin/env bash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH diff --git a/modules/by-name/lf/lf/commands/scripts/dragon.sh b/modules/by-name/lf/lf/commands/scripts/dragon.sh index 916c09ee..a4a52c72 100755 --- a/modules/by-name/lf/lf/commands/scripts/dragon.sh +++ b/modules/by-name/lf/lf/commands/scripts/dragon.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh b/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh index c6b3b2a6..370e9753 100755 --- a/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh +++ b/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh b/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh index 7296a6b9..86a19370 100755 --- a/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh +++ b/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/execute.sh b/modules/by-name/lf/lf/commands/scripts/execute.sh index 1d5dc87f..ce62dfa0 100755 --- a/modules/by-name/lf/lf/commands/scripts/execute.sh +++ b/modules/by-name/lf/lf/commands/scripts/execute.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/follow_link.sh b/modules/by-name/lf/lf/commands/scripts/follow_link.sh index 509fc2e0..71fa6825 100755 --- a/modules/by-name/lf/lf/commands/scripts/follow_link.sh +++ b/modules/by-name/lf/lf/commands/scripts/follow_link.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/mk_directory.sh b/modules/by-name/lf/lf/commands/scripts/mk_directory.sh index 58921ccd..f3bd6d29 100755 --- a/modules/by-name/lf/lf/commands/scripts/mk_directory.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_directory.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/mk_file.sh b/modules/by-name/lf/lf/commands/scripts/mk_file.sh index 5dafe30d..78271aaa 100755 --- a/modules/by-name/lf/lf/commands/scripts/mk_file.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_file.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/mk_link.sh b/modules/by-name/lf/lf/commands/scripts/mk_link.sh index 40b2099d..35f49c38 100755 --- a/modules/by-name/lf/lf/commands/scripts/mk_link.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_link.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/mk_script.sh b/modules/by-name/lf/lf/commands/scripts/mk_script.sh index bbdf6d39..a708825d 100755 --- a/modules/by-name/lf/lf/commands/scripts/mk_script.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_script.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/open.sh b/modules/by-name/lf/lf/commands/scripts/open.sh deleted file mode 100755 index b494074f..00000000 --- a/modules/by-name/lf/lf/commands/scripts/open.sh +++ /dev/null @@ -1,15 +0,0 @@ -# shellcheck shell=sh - -# shellcheck disable=SC2269 -f="$f" -# shellcheck disable=SC2269 -fx="$fx" -# shellcheck disable=SC2269 -fs="$fs" -# shellcheck disable=SC2269 -id="$id" - -# TODO: For some reason, `xdg-utils` tries to open firefox with it's default profile for -# _everything_. Using `handlr-regex` sort-of solves this. <2025-04-04> -handlr open "$f" -# vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/set_clipboard_path.sh b/modules/by-name/lf/lf/commands/scripts/set_clipboard_path.sh index 893452e1..f4cb5115 100755 --- a/modules/by-name/lf/lf/commands/scripts/set_clipboard_path.sh +++ b/modules/by-name/lf/lf/commands/scripts/set_clipboard_path.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/set_wallpaper.sh b/modules/by-name/lf/lf/commands/scripts/set_wallpaper.sh index 4387cd9a..6311031e 100755 --- a/modules/by-name/lf/lf/commands/scripts/set_wallpaper.sh +++ b/modules/by-name/lf/lf/commands/scripts/set_wallpaper.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 @@ -9,8 +19,8 @@ fs="$fs" # shellcheck disable=SC2269 id="$id" -pid="$(pgrep swaybg)" -[ -n "$pid" ] && kill "$pid" +# Kill all previous instances +pkill swaybg # We cannot control the available commands for river. # Thus we ensure that it can correctly start `swaybg` diff --git a/modules/by-name/lf/lf/commands/scripts/stripspace.sh b/modules/by-name/lf/lf/commands/scripts/stripspace.sh index 95f8f742..9253b6de 100755 --- a/modules/by-name/lf/lf/commands/scripts/stripspace.sh +++ b/modules/by-name/lf/lf/commands/scripts/stripspace.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/trash.sh b/modules/by-name/lf/lf/commands/scripts/trash.sh index 958bc3f9..68b36774 100755 --- a/modules/by-name/lf/lf/commands/scripts/trash.sh +++ b/modules/by-name/lf/lf/commands/scripts/trash.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/trash_clear.sh b/modules/by-name/lf/lf/commands/scripts/trash_clear.sh index a41dce27..597995f9 100755 --- a/modules/by-name/lf/lf/commands/scripts/trash_clear.sh +++ b/modules/by-name/lf/lf/commands/scripts/trash_clear.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh while IFS="$(printf '\n')" read -r file; do diff --git a/modules/by-name/lf/lf/commands/scripts/trash_restore.sh b/modules/by-name/lf/lf/commands/scripts/trash_restore.sh index cc2d4890..7b078c26 100755 --- a/modules/by-name/lf/lf/commands/scripts/trash_restore.sh +++ b/modules/by-name/lf/lf/commands/scripts/trash_restore.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/commands/scripts/view_file.sh b/modules/by-name/lf/lf/commands/scripts/view_file.sh index 38e6b778..48cdd85e 100755 --- a/modules/by-name/lf/lf/commands/scripts/view_file.sh +++ b/modules/by-name/lf/lf/commands/scripts/view_file.sh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck shell=sh # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/default.nix b/modules/by-name/lf/lf/ctpv/default.nix index 98438fba..6f9988b9 100644 --- a/modules/by-name/lf/lf/ctpv/default.nix +++ b/modules/by-name/lf/lf/ctpv/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/by-name/lf/lf/ctpv/helpers.sh b/modules/by-name/lf/lf/ctpv/helpers.sh index 30e4483a..71524082 100644 --- a/modules/by-name/lf/lf/ctpv/helpers.sh +++ b/modules/by-name/lf/lf/ctpv/helpers.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 cache_f="$cache_f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/any.sh b/modules/by-name/lf/lf/ctpv/prev/any.sh index 0b0ee573..01c31e2b 100644 --- a/modules/by-name/lf/lf/ctpv/prev/any.sh +++ b/modules/by-name/lf/lf/ctpv/prev/any.sh @@ -1,13 +1,23 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 w="$w" # shellcheck disable=SC2269 -e="$e" +e="${e:-[missing extension]}" # shellcheck disable=SC2269 -m="$m" +m="${m:-[missing mime type]}" # shellcheck disable=SC2269 h="$h" diff --git a/modules/by-name/lf/lf/ctpv/prev/application/archive/atool.sh b/modules/by-name/lf/lf/ctpv/prev/application/archive/atool.sh index 3aebfbb3..2bf8a89f 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/archive/atool.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/archive/atool.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/application/archive/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/archive/default.nix index febacb7d..aee5c732 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/archive/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/archive/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { atool = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/dll/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/dll/default.nix index 00c7e389..121f419d 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/dll/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/dll/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { dll = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh b/modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh index e365fe0a..6ec68d55 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/dll/dll.sh @@ -1,13 +1,23 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 w="$w" # shellcheck disable=SC2269 -e="$e" +e="${e:-[missing extension]}" # shellcheck disable=SC2269 -m="$m" +m="${m:-[missing mime type]}" # shellcheck disable=SC2269 h="$h" diff --git a/modules/by-name/lf/lf/ctpv/prev/application/epub/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/epub/default.nix index b4df845a..d28503e2 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/epub/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/epub/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { epub = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh b/modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh index cad95860..87c33dff 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/epub/epub.sh @@ -1,13 +1,23 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 w="$w" # shellcheck disable=SC2269 -e="$e" +e="${e:-[missing extension]}" # shellcheck disable=SC2269 -m="$m" +m="${m:-[missing mime type]}" # shellcheck disable=SC2269 h="$h" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/application/pdf/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/pdf/default.nix index 24112737..e30aab3e 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/pdf/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/pdf/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { pdf = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/pdf/pdf.sh b/modules/by-name/lf/lf/ctpv/prev/application/pdf/pdf.sh index 4d99f4b0..2c2e5ff9 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/pdf/pdf.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/pdf/pdf.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/application/pgp/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/pgp/default.nix index 32f42783..c9001176 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/pgp/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/pgp/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { pgp = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/pgp/pgp.sh b/modules/by-name/lf/lf/ctpv/prev/application/pgp/pgp.sh index 4747a8c4..cfe359ea 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/pgp/pgp.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/pgp/pgp.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/application/sqlite/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/sqlite/default.nix index 54b8c29e..ab200dd9 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/sqlite/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/sqlite/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { sqlite = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/sqlite/sqlite.sh b/modules/by-name/lf/lf/ctpv/prev/application/sqlite/sqlite.sh index 62c1abec..2d3a45fe 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/sqlite/sqlite.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/sqlite/sqlite.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/default.nix index 504623a0..dfd6911b 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { torrent = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/torrent.sh b/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/torrent.sh index f1da355a..38838d2e 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/torrent.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/x-bittorrent/torrent.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/default.nix index a6a32808..fb82aa8a 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { pem = { diff --git a/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/pem.sh b/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/pem.sh index 76ee3002..2948e25a 100644 --- a/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/pem.sh +++ b/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/pem.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/audio/audio.sh b/modules/by-name/lf/lf/ctpv/prev/audio/audio.sh index 2e9e147c..324a2170 100644 --- a/modules/by-name/lf/lf/ctpv/prev/audio/audio.sh +++ b/modules/by-name/lf/lf/ctpv/prev/audio/audio.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/audio/default.nix b/modules/by-name/lf/lf/ctpv/prev/audio/default.nix index 20df04b3..7ae5d7fd 100644 --- a/modules/by-name/lf/lf/ctpv/prev/audio/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/audio/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { audio = { diff --git a/modules/by-name/lf/lf/ctpv/prev/default.nix b/modules/by-name/lf/lf/ctpv/prev/default.nix index 3e54e88a..d7e420d0 100644 --- a/modules/by-name/lf/lf/ctpv/prev/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, diff --git a/modules/by-name/lf/lf/ctpv/prev/font/default.nix b/modules/by-name/lf/lf/ctpv/prev/font/default.nix index 48bcb7ad..76a284f4 100644 --- a/modules/by-name/lf/lf/ctpv/prev/font/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/font/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { font = { diff --git a/modules/by-name/lf/lf/ctpv/prev/font/font.sh b/modules/by-name/lf/lf/ctpv/prev/font/font.sh index 9e5ef3c1..49e12ec7 100644 --- a/modules/by-name/lf/lf/ctpv/prev/font/font.sh +++ b/modules/by-name/lf/lf/ctpv/prev/font/font.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/image/default.nix b/modules/by-name/lf/lf/ctpv/prev/image/default.nix index 87fba00c..79037d5a 100644 --- a/modules/by-name/lf/lf/ctpv/prev/image/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/image/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { image = { diff --git a/modules/by-name/lf/lf/ctpv/prev/image/image.sh b/modules/by-name/lf/lf/ctpv/prev/image/image.sh index 42c99c23..d021cbf6 100644 --- a/modules/by-name/lf/lf/ctpv/prev/image/image.sh +++ b/modules/by-name/lf/lf/ctpv/prev/image/image.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/default.nix b/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/default.nix index 90915c84..25bd6f77 100644 --- a/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { svg = { diff --git a/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/svg.sh b/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/svg.sh index ce588ada..b16e4fc5 100644 --- a/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/svg.sh +++ b/modules/by-name/lf/lf/ctpv/prev/image/svg+xml/svg.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/default.nix b/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/default.nix index a3394ef4..5af6c501 100644 --- a/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { xcf = { diff --git a/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/xcf.sh b/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/xcf.sh index abb83a89..4ad4b34b 100644 --- a/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/xcf.sh +++ b/modules/by-name/lf/lf/ctpv/prev/image/x-xcf/xcf.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/inode/default.nix b/modules/by-name/lf/lf/ctpv/prev/inode/default.nix index eaade0f1..fe5ee3e1 100644 --- a/modules/by-name/lf/lf/ctpv/prev/inode/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/inode/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { ls = { diff --git a/modules/by-name/lf/lf/ctpv/prev/inode/ls.sh b/modules/by-name/lf/lf/ctpv/prev/inode/ls.sh index f5b95d13..73e036eb 100644 --- a/modules/by-name/lf/lf/ctpv/prev/inode/ls.sh +++ b/modules/by-name/lf/lf/ctpv/prev/inode/ls.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/inode/symlink.sh b/modules/by-name/lf/lf/ctpv/prev/inode/symlink.sh index fb0dea8f..2629f62a 100644 --- a/modules/by-name/lf/lf/ctpv/prev/inode/symlink.sh +++ b/modules/by-name/lf/lf/ctpv/prev/inode/symlink.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/libreoffice.sh b/modules/by-name/lf/lf/ctpv/prev/libreoffice.sh index 9407aade..ade1038e 100644 --- a/modules/by-name/lf/lf/ctpv/prev/libreoffice.sh +++ b/modules/by-name/lf/lf/ctpv/prev/libreoffice.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/remove_default_previews.nix b/modules/by-name/lf/lf/ctpv/prev/remove_default_previews.nix index 1407386b..6614fa8d 100644 --- a/modules/by-name/lf/lf/ctpv/prev/remove_default_previews.nix +++ b/modules/by-name/lf/lf/ctpv/prev/remove_default_previews.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { soispha.programs.lf.ctpv.extraConfigPre = '' remove any diff --git a/modules/by-name/lf/lf/ctpv/prev/text/bat.sh b/modules/by-name/lf/lf/ctpv/prev/text/bat.sh index a466c9c7..b20e9cea 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/bat.sh +++ b/modules/by-name/lf/lf/ctpv/prev/text/bat.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/text/default.nix b/modules/by-name/lf/lf/ctpv/prev/text/default.nix index 14e74a4d..edb6e09d 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/text/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { glow = { diff --git a/modules/by-name/lf/lf/ctpv/prev/text/diff/default.nix b/modules/by-name/lf/lf/ctpv/prev/text/diff/default.nix index e0fa15bb..f21acd5e 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/diff/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/text/diff/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { delta = { diff --git a/modules/by-name/lf/lf/ctpv/prev/text/diff/delta.sh b/modules/by-name/lf/lf/ctpv/prev/text/diff/delta.sh index 3f8b5631..d30565df 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/diff/delta.sh +++ b/modules/by-name/lf/lf/ctpv/prev/text/diff/delta.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/text/glow.sh b/modules/by-name/lf/lf/ctpv/prev/text/glow.sh index 30f2af78..2e8d9f58 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/glow.sh +++ b/modules/by-name/lf/lf/ctpv/prev/text/glow.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/ctpv/prev/text/json/default.nix b/modules/by-name/lf/lf/ctpv/prev/text/json/default.nix index 7e2ef090..9538c365 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/json/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/text/json/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { jq = { diff --git a/modules/by-name/lf/lf/ctpv/prev/text/json/jq.sh b/modules/by-name/lf/lf/ctpv/prev/text/json/jq.sh index c7090ccb..fa7c47b6 100644 --- a/modules/by-name/lf/lf/ctpv/prev/text/json/jq.sh +++ b/modules/by-name/lf/lf/ctpv/prev/text/json/jq.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" diff --git a/modules/by-name/lf/lf/ctpv/prev/video/default.nix b/modules/by-name/lf/lf/ctpv/prev/video/default.nix index f38f61c7..d500fbd9 100644 --- a/modules/by-name/lf/lf/ctpv/prev/video/default.nix +++ b/modules/by-name/lf/lf/ctpv/prev/video/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs, ...}: { soispha.programs.lf.ctpv.previewers = { video = { diff --git a/modules/by-name/lf/lf/ctpv/prev/video/video.sh b/modules/by-name/lf/lf/ctpv/prev/video/video.sh index d1972187..dac75205 100644 --- a/modules/by-name/lf/lf/ctpv/prev/video/video.sh +++ b/modules/by-name/lf/lf/ctpv/prev/video/video.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 diff --git a/modules/by-name/lf/lf/icons.license b/modules/by-name/lf/lf/icons.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/lf/lf/icons.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/lf/lf/keybindings/default.nix b/modules/by-name/lf/lf/keybindings/default.nix index c5d6427d..d4c2a6a3 100644 --- a/modules/by-name/lf/lf/keybindings/default.nix +++ b/modules/by-name/lf/lf/keybindings/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { uid, downloadDir, diff --git a/modules/by-name/lf/lf/module.nix b/modules/by-name/lf/lf/module.nix index 6dc8e919..ea9970ef 100644 --- a/modules/by-name/lf/lf/module.nix +++ b/modules/by-name/lf/lf/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, @@ -10,6 +19,8 @@ commands = import ./commands {inherit pkgs sysLib shell_library system;}; keybindings = import ./keybindings {inherit (cfg.keymaps) uid downloadDir;}; + packages = import ./wrappers {inherit pkgs;}; + cfg = config.soispha.programs.lf; in { imports = [ @@ -49,6 +60,11 @@ in { "lf/colors".source = ./colors; }; + programs.zsh.shellAliases = { + ll = ". ${lib.getExe packages.ll}"; + lm = ". ${lib.getExe packages.lm}"; + }; + programs.lf = { enable = true; @@ -75,7 +91,7 @@ in { icons = true; ifs = "\\n"; # internal field separator for shell commands #info = "size"; # show the size of a directory - shell = "sh"; + shell = "${lib.getExe pkgs.dash}"; shellopts = "-eu"; # e: exit on error; u: error for unset variables }; extraConfig = '' diff --git a/modules/by-name/lf/lf/wrappers/default.nix b/modules/by-name/lf/lf/wrappers/default.nix new file mode 100644 index 00000000..7257a66e --- /dev/null +++ b/modules/by-name/lf/lf/wrappers/default.nix @@ -0,0 +1,4 @@ +{pkgs}: { + ll = pkgs.callPackage ./ll {}; + lm = pkgs.callPackage ./lm {}; +} diff --git a/modules/by-name/lf/lf/wrappers/ll/default.nix b/modules/by-name/lf/lf/wrappers/ll/default.nix new file mode 100644 index 00000000..6e4ee336 --- /dev/null +++ b/modules/by-name/lf/lf/wrappers/ll/default.nix @@ -0,0 +1,18 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. +{writeShellApplication}: +writeShellApplication { + name = "ll"; + text = builtins.readFile ./ll.sh; + + # This is sourced in the shell + inheritPath = true; + bashOptions = []; +} diff --git a/modules/by-name/lf/lf/wrappers/ll/ll.sh b/modules/by-name/lf/lf/wrappers/ll/ll.sh new file mode 100755 index 00000000..e012cffa --- /dev/null +++ b/modules/by-name/lf/lf/wrappers/ll/ll.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env dash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + +last_directory="$(mktemp)" +cleanup() { + rm "$last_directory" +} +trap cleanup EXIT + +command lf -last-dir-path="$last_directory" "$@" + +dir="$(cat "$last_directory")" +if cd "$dir"; then + [ -d "$XDG_RUNTIME_DIR/ll" ] || mkdir "$XDG_RUNTIME_DIR/ll" + echo "$dir" >"$XDG_RUNTIME_DIR/ll/last_directory" +else + die "$dir does not exist!" +fi + +# vim: ft=sh diff --git a/modules/by-name/lf/lf/wrappers/lm/default.nix b/modules/by-name/lf/lf/wrappers/lm/default.nix new file mode 100644 index 00000000..42bdc687 --- /dev/null +++ b/modules/by-name/lf/lf/wrappers/lm/default.nix @@ -0,0 +1,18 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. +{writeShellApplication}: +writeShellApplication { + name = "lm"; + text = builtins.readFile ./lm.sh; + + # This is sourced in the shell + inheritPath = true; + bashOptions = []; +} diff --git a/modules/by-name/lf/lf/wrappers/lm/lm.sh b/modules/by-name/lf/lf/wrappers/lm/lm.sh new file mode 100755 index 00000000..71213721 --- /dev/null +++ b/modules/by-name/lf/lf/wrappers/lm/lm.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env dash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + +die() { + echo "ERROR: $1" + exit 1 +} + +msg() { + echo "$1" +} + +if [ -f "$XDG_RUNTIME_DIR/ll/last_directory" ]; then + last_dir="$(cat "$XDG_RUNTIME_DIR/ll/last_directory")" + cd "$last_dir" || die "$last_dir does not exist!" +else + msg "No last directory saved (try using ll instead)." +fi +# vim: ft=sh diff --git a/modules/by-name/li/libvirtd/module.nix b/modules/by-name/li/libvirtd/module.nix index 3481ef3b..ba1cc2e1 100644 --- a/modules/by-name/li/libvirtd/module.nix +++ b/modules/by-name/li/libvirtd/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { # FIXME(@bpeetz): Do something with this module. <2025-04-04> diff --git a/modules/by-name/lo/locale/keymaps/dvorak_modified.xkb.license b/modules/by-name/lo/locale/keymaps/dvorak_modified.xkb.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/lo/locale/keymaps/dvorak_modified.xkb.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/lo/locale/module.nix b/modules/by-name/lo/locale/module.nix index eda707af..17096731 100644 --- a/modules/by-name/lo/locale/module.nix +++ b/modules/by-name/lo/locale/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/ma/mako/module.nix b/modules/by-name/ma/mako/module.nix new file mode 100644 index 00000000..1630d2d0 --- /dev/null +++ b/modules/by-name/ma/mako/module.nix @@ -0,0 +1,81 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.services.mako; + + iconPath = "${pkgs.gruvbox-dark-icons-gtk.overrideAttrs (prev: final: { + # Remove unused dependencies + propagatedBuildInputs = []; + })}/share/icons/oomox-gruvbox-dark"; +in { + options.soispha.services.mako = { + enable = lib.mkEnableOption "mako"; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + services.mako = { + enable = true; + + # See mako(5) + settings = { + max-history = 5; + sort = "-time"; + + background-color = "#2e3440"; + border-color = "#88c0d0"; + border-radius = 25; + border-size = 2; + default-timeout = 5000; + font = "Source Code Pro 10"; + group-by = "body"; + height = 500; + icon-path = iconPath; + icons = true; + ignore-timeout = false; + layer = "overlay"; + markup = true; + max-icon-size = 64; + width = 500; + + "urgency=low" = { + border-color = "#cccccc"; + }; + + "urgency=normal" = { + border-color = "#d08770"; + }; + + "urgency=high" = { + border-size = 3; + border-color = "#bf616a"; + default-timeout = 0; + }; + + "urgency=critical" = { + border-size = 4; + border-color = "#bf616a"; + default-timeout = 0; + }; + + "category=mpd" = { + default-timeout = 2000; + group-by = "category"; + }; + }; + }; + }; + }; +} diff --git a/modules/by-name/mp/mpd/module.nix b/modules/by-name/mp/mpd/module.nix index 6f045f9f..b7c7ab5a 100644 --- a/modules/by-name/mp/mpd/module.nix +++ b/modules/by-name/mp/mpd/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, pkgs, diff --git a/modules/by-name/mp/mpd/mpc.nix b/modules/by-name/mp/mpd/mpc.nix index 031465fe..cd4a4ec0 100644 --- a/modules/by-name/mp/mpd/mpc.nix +++ b/modules/by-name/mp/mpd/mpc.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -5,7 +14,6 @@ ... }: let cfg = config.soispha.services.mpd.mpc; - parentCfg = config.soispha.services.mpd; in { options.soispha.services.mpd.mpc = { enable = lib.mkEnableOption "mpc with extensions"; @@ -29,9 +37,7 @@ in { beets = cfg.beetsPkg; }) # Displays the lyrics of the currently playing song - (pkgs.mpp-lyrics.override { - mpd_music_dir = parentCfg.directories.music; - }) + pkgs.mpp-lyrics ]; }; } diff --git a/modules/by-name/mp/mpd/mpdconf.example.license b/modules/by-name/mp/mpd/mpdconf.example.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/mp/mpd/mpdconf.example.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/mp/mpv/module.nix b/modules/by-name/mp/mpv/module.nix index 49a97c3c..7c8435d5 100644 --- a/modules/by-name/mp/mpv/module.nix +++ b/modules/by-name/mp/mpv/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -20,11 +29,8 @@ in { "Shift+q" = "quit-watch-later 1"; }; config = { - # uosc provides seeking & volume indicators (via flash-timeline and flash-volume commands) - # if you decide to use them, you don't need osd-bar - osd-bar = false; + osd-bar = true; - # uosc will draw its own window controls and border if you disable window border border = false; }; scriptOpts = { @@ -32,272 +38,6 @@ in { scalewindowed = 0.8; hidetimeout = 300; }; - uosc = { - # Display style of current position. available: line, bar - timeline_style = "line"; - - # Line display style config - timeline_line_width = 2; - - # Timeline size when fully expanded, in pixels, 0 to disable - timeline_size = 40; - - # Comma separated states when element should always be fully visible. - # Available: paused, audio, image, video, idle, windowed, fullscreen - timeline_persistency = ""; - - # Top border of background color to help visually separate timeline from video - timeline_border = 1; - - # When scrolling above timeline, wheel will seek by this amount of seconds. - # Default uses fast seeking. Add `!` suffix to enable exact seeks. Example: `5!` - timeline_step = 5; - - # Render cache indicators for streaming content - timeline_cache = true; - - # When to display an always visible progress bar (minimized timeline). Can be: windowed, fullscreen, always, never - # Can also be toggled on demand with `toggle-progress` command. - progress = "windowed"; - progress_size = 2; - progress_line_width = 20; - - # A comma delimited list of controls above the timeline. Set to `never` to disable. - # Parameter spec: enclosed in `{}` means value, enclosed in `[]` means optional - # Full item syntax: `[<[!]{disposition1}[,[!]{dispositionN}]>]{element}[:{paramN}][#{badge}[>{limit}]][?{tooltip}]` - # Common properties: - # `{icon}` - parameter used to specify an icon name (example: `face`) - # - pick here: https://fonts.google.com/icons?icon.platform=web&icon.set=Material+Icons&icon.style=Rounded - # `{element}`s and their parameters: - # `{shorthand}` - preconfigured shorthands: - # `play-pause`, `menu`, `subtitles`, `audio`, `video`, `playlist`, - # `chapters`, `editions`, `stream-quality`, `open-file`, `items`, - # `next`, `prev`, `first`, `last`, `audio-device`, `fullscreen`, - # `loop-playlist`, `loop-file`, `shuffle`, `autoload` - # `speed[:{scale}]` - display speed slider, [{scale}] - factor of controls_size, default: 1.3 - # `command:{icon}:{command}` - button that executes a {command} when pressed - # `toggle:{icon}:{prop}[@{owner}]` - button that toggles mpv property. shorthand for yes/no cycle below - # `cycle:{default_icon}:{prop}[@{owner}]:{value1}[={icon1}][!]/{valueN}[={iconN}][!]` - # - button that cycles mpv property between values, each optionally having different icon and active flag - # - presence of `!` at the end will style the button as active - # - `{owner}` is the name of a script that manages this property if any. Set to `uosc` to tap into uosc options. - # `gap[:{scale}]` - display an empty gap - # {scale} - factor of controls_size, default: 0.3 - # `space` - fills all available space between previous and next item, useful to align items to the right - # - multiple spaces divide the available space among themselves, which can be used for centering - # `button:{name}` - button whose state, look, and click action are managed by external script - # Item visibility control: - # `<[!]{disposition1}[,[!]{dispositionN}]>` - optional prefix to control element's visibility - # - `{disposition}` can be one of: - # - `idle` - true if mpv is in idle mode (no file loaded) - # - `image` - true if current file is a single image - # - `audio` - true for audio only files - # - `video` - true for files with a video track - # - `has_many_video` - true for files with more than one video track - # - `has_image` - true for files with a cover or other image track - # - `has_audio` - true for files with an audio track - # - `has_many_audio` - true for files with more than one audio track - # - `has_sub` - true for files with an subtitle track - # - `has_many_sub` - true for files with more than one subtitle track - # - `has_many_edition` - true for files with more than one edition - # - `has_chapter` - true for files with chapter list - # - `stream` - true if current file is read from a stream - # - `has_playlist` - true if current playlist has 2 or more items in it - # - prefix with `!` to negate the required disposition - # Examples: - # - `<stream>stream-quality` - show stream quality button only for streams - # - `<has_audio,!audio>audio` - show audio tracks button for all files that have - # an audio track, but are not exclusively audio only files - # Place `#{badge}[>{limit}]` after the element params to give it a badge. Available badges: - # `sub`, `audio`, `video` - track type counters - # `{mpv_prop}` - any mpv prop that makes sense to you: https://mpv.io/manual/master/#property-list - # - if prop value is an array it'll display its size - # `>{limit}` will display the badge only if it's numerical value is above this threshold. - # Example: `#audio>1` - # Place `?{tooltip}` after the element config to give it a tooltip. - # Example implementations: - # menu = command:menu:script-binding uosc/menu-blurred?Menu - # subtitles = command:subtitles:script-binding uosc/subtitles#sub?Subtitles - # fullscreen = cycle:crop_free:fullscreen:no/yes=fullscreen_exit!?Fullscreen - # loop-playlist = cycle:repeat:loop-playlist:no/inf!?Loop playlist - # toggle:{icon}:{prop} = cycle:{icon}:{prop}:no/yes! - controls = "menu,gap,subtitles,<has_many_audio>audio,<has_many_video>video,<has_many_edition>editions,<stream>stream-quality,gap,space,speed,space,shuffle,loop-playlist,loop-file,gap,prev,items,next,gap,fullscreen"; - controls_size = 32; - controls_margin = 8; - controls_spacing = 2; - controls_persistency = ""; - - # Where to display volume controls: none, left, right - volume = "right"; - volume_size = 40; - volume_border = 1; - volume_step = 1; - volume_persistency = ""; - - # Playback speed widget: mouse drag or wheel to change, click to reset - speed_step = 0.1; - speed_step_is_factor = false; - speed_persistency = ""; - - # Controls all menus, such as context menu, subtitle loader/selector, etc - menu_item_height = 36; - menu_min_width = 260; - menu_padding = 4; - - # Determines if `/` or `ctrl+f` is required to activate the search, or if typing - # any text is sufficient. - # When enabled, you can no longer toggle a menu off with the same key that opened it, if the key is a unicode character. - menu_type_to_search = true; - - # Top bar with window controls and media title - # Can be: never, no-border, always - top_bar = "never"; - top_bar_size = 40; - # Can be: `no` (hide), left or right - top_bar_controls = false; - # Can be: `no` (hide), `yes` (inherit title from mpv.conf), or a custom template string - top_bar_title = false; - # Template string to enable alternative top bar title. If alt title matches main title, - # it'll be hidden. Tip: use `${media-title}` for main, and `${filename}` for alt title. - top_bar_alt_title = ""; - # Can be: - # `below` => display alt title below the main one - # `toggle` => toggle the top bar title text between main and alt by clicking - # the top bar, or calling `toggle-title` binding - top_bar_alt_title_place = "below"; - # Flash top bar when any of these file types is loaded. Available: audio,video,image,chapter - top_bar_flash_on = "video,audio"; - top_bar_persistency = ""; - - # Window border drawn in no-border mode - window_border_size = 1; - - # If there's no playlist and file ends, load next file in directory - # Uses `load_types` config below to determine what type of file to load next. - # When enabled, usoc will set mpv config `keep-open` to `yes`, and `keep-open-pause` to `no`. - autoload = false; - # Enable uosc's playlist/directory shuffle mode - # This simply makes the next selected playlist or directory item be random, just - # like any other player in the world. It also has an easily togglable control button. - shuffle = false; - - # Scale the interface by this factor - scale = 1; - # Scale in fullscreen - scale_fullscreen = 1.3; - # Adjust the text scaling to fit your font - font_scale = 1; - # Border of text and icons when drawn directly on top of video - text_border = 1.2; - # Border radius of buttons, menus, and all other rectangles - border_radius = 4; - # A comma delimited list of color overrides in RGB HEX format. Defaults: - # foreground=ffffff,foreground_text=000000,background=000000,background_text=ffffff,curtain=111111,success=a5e075,error=ff616e - color = ""; - # A comma delimited list of opacity overrides for various UI element backgrounds and shapes. - # This does not affect any text, which is always rendered fully opaque. Defaults: - # timeline=0.9,position=1,chapters=0.8,slider=0.9,slider_gauge=1,controls=0,speed=0.6,menu=1,submenu=0.4,border=1,title=1,tooltip=1,thumbnail=1,curtain=0.8,idle_indicator=0.8,audio_indicator=0.5,buffering_indicator=0.3,playlist_position=0.8 - opacity = ""; - - # A comma delimited list of features to refine at a cost of some performance impact. - # text_width - Use a more accurate text width measurement that measures each text string individually - # instead of just measuring the width of known letters once and adding them up. - # sorting - Use filename sorting that handles non-english languages better, especially asian ones. - # At the moment, this is only available on windows, and has no effect on other platforms. - refine = ""; - - # Duration of animations in milliseconds - animation_duration = 100; - - # Execute command for background clicks shorter than this number of milliseconds, 0 to disable - # Execution always waits for `input-doubleclick-time` to filter out double-clicks - click_threshold = 0; - click_command = "cycle pause; script-binding uosc/flash-pause-indicator"; - - # Flash duration in milliseconds used by `flash-{element}` commands - flash_duration = 1000; - - # Distances in pixels below which elements are fully faded in/out - proximity_in = 40; - proximity_out = 120; - - # Use only bold font weight throughout the whole UI - font_bold = false; - - # One of `total`, `playtime-remaining` (scaled by the current speed), `time-remaining` (remaining length of file) - destination_time = "playtime-remaining"; - - # Display sub second fraction in timestamps up to this precision - time_precision = 0; - - # Display stream's buffered time in timeline if it's lower than this amount of seconds, 0 to disable - buffered_time_threshold = 60; - - # Hide UI when mpv autohides the cursor. Timing is controlled by `cursor-autohide` in `mpv.conf` (in milliseconds). - autohide = true; - - # Can be: flash, static, manual (controlled by flash-pause-indicator and decide-pause-indicator commands) - pause_indicator = "static"; - - # Sizes to list in stream quality menu - stream_quality_options = "4320,2160,1440,1080,720,480,360,240,144"; - - # Types to identify media files - video_types = "3g2,3gp,asf,avi,f4v,flv,h264,h265,m2ts,m4v,mkv,mov,mp4,mp4v,mpeg,mpg,ogm,ogv,rm,rmvb,ts,vob,webm,wmv,y4m"; - audio_types = "aac,ac3,aiff,ape,au,cue,dsf,dts,flac,m4a,mid,midi,mka,mp3,mp4a,oga,ogg,opus,spx,tak,tta,wav,weba,wma,wv"; - image_types = "apng,avif,bmp,gif,j2k,jp2,jfif,jpeg,jpg,jxl,mj2,png,svg,tga,tif,tiff,webp"; - subtitle_types = "aqt,ass,gsub,idx,jss,lrc,mks,pgs,pjs,psb,rt,sbv,slt,smi,sub,sup,srt,ssa,ssf,ttxt,txt,usf,vt,vtt"; - playlist_types = "m3u,m3u8,pls,url,cue"; - - # Type pools used by file navigation and `autoload` to determine what type of file to load next - # Available: video,audio,image,playlist,same. `same` means the same type pool (not just extension) as currently open file. - load_types = "video,audio,image"; - - # Default open-file menu directory. Use `{drives}` to open drives menu on windows (defaults to `/` on unix). - default_directory = "~/"; - - # List hidden files when reading directories. Due to environment limitations, this currently only hides - # files starting with a dot. Doesn't hide hidden files on windows (we have no way to tell they're hidden). - show_hidden_files = false; - - # Move files to trash (recycle bin) when deleting files. Dependencies: - # - Linux: `sudo apt install trash-cli` - # - MacOS: `brew install trash` - use_trash = false; - - # Adjusted osd margins based on the visibility of UI elements - adjust_osd_margins = true; - - # Adds chapter range indicators to some common chapter types. - # Additionally to displaying the start of the chapter as a diamond icon on top of the timeline, - # the portion of the timeline of that chapter range is also colored based on the config below. - # - # The syntax is a comma-delimited list of `{type}:{color}` pairs, where: - # `{type}` => range type. Currently supported ones are: - # - `openings`, `endings` => anime openings/endings - # - `intros`, `outros` => video intros/outros - # - `ads` => segments created by sponsor-block software like https://github.com/po5/mpv_sponsorblock - # `{color}` => an RGB(A) HEX color code (`rrggbb`, or `rrggbbaa`) - # - # To exclude marking any of the range types, simply remove them from the list. - chapter_ranges = "openings:30abf964,endings:30abf964,ads:c54e4e80"; - - # Add alternative lua patterns to identify beginnings of simple chapter ranges (except for `ads`) - # Syntax: `{type}:{pattern}[,{patternN}][;{type}:{pattern}[,{patternN}]]` - chapter_range_patterns = "openings:オープニング;endings:エンディング"; - - # Localization language priority from highest to lowest. - # Also controls what languages are fetched by `download-subtitles` menu. - # Built in languages can be found in `uosc/intl`. - # `slang` is a keyword to inherit values from `--slang` mpv config. - # Supports paths to custom json files: `languages=~~/custom.json,slang,en` - languages = "slang,en"; - - # A comma separated list of element IDs to disable. Available IDs: - # window_border, top_bar, timeline, controls, volume, - # idle_indicator, audio_indicator, buffering_indicator, pause_indicator - disable_elements = ""; - }; thumbfast = { hwdec = true; network = false; @@ -307,7 +47,6 @@ in { }; }; scripts = with pkgs.mpvScripts; [ - uosc thumbfast ]; }; diff --git a/modules/by-name/ne/networking/module.nix b/modules/by-name/ne/networking/module.nix index 8448e9b3..6f8633e8 100644 --- a/modules/by-name/ne/networking/module.nix +++ b/modules/by-name/ne/networking/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/zs/zsh/config/command_not_found/command_not_found.sh b/modules/by-name/ni/nix-index/command_not_found.sh index fb21b676..f650cf7b 100644 --- a/modules/by-name/zs/zsh/config/command_not_found/command_not_found.sh +++ b/modules/by-name/ni/nix-index/command_not_found.sh @@ -1,5 +1,15 @@ #!/usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # This was taken from the # `${pkgs.nix-index}/etc/profile.d/command-not-found.sh` file on 2024-02-28 @@ -48,7 +58,7 @@ EOF The program '$cmd' is currently not installed. It is provided by several packages. You can run it once with: EOF - awk --assign=toplevel="$toplevel" 'BEGIN{counter=0} {printf("%3s)", counter); printf(" nix shell %s#%s\n", toplevel, $1); counter+=1}' "$(ptmp "$attrs")" + echo "$attrs" | awk --assign=toplevel="$toplevel" 'BEGIN{counter=0} {printf("%3s)", counter); printf(" nix shell %s#%s\n", toplevel, $1); counter+=1}' ;; esac diff --git a/modules/by-name/ni/nix-index/module.nix b/modules/by-name/ni/nix-index/module.nix new file mode 100644 index 00000000..06acfc8a --- /dev/null +++ b/modules/by-name/ni/nix-index/module.nix @@ -0,0 +1,44 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + modules, + ... +}: let + cfg = config.soispha.programs.nix-index; +in { + options.soispha.programs.nix-index = { + enable = lib.mkEnableOption "nix-index"; + }; + + config = lib.mkIf cfg.enable { + soispha.programs.zsh.integrations.nix-index = ./command_not_found.sh; + home-manager.users.soispha = { + imports = [ + modules.nix-index-database.hmModules.nix-index + ]; + + programs.nix-index = { + enable = true; + symlinkToCacheHome = true; + + # Handled by myself (and the script is overridden) + enableBashIntegration = false; + enableZshIntegration = false; + enableFishIntegration = false; + }; + + programs.nix-index-database = { + comma.enable = false; + }; + }; + }; +} diff --git a/modules/by-name/ni/nix/module.nix b/modules/by-name/ni/nix/module.nix index 48834b2d..2b91f59b 100644 --- a/modules/by-name/ni/nix/module.nix +++ b/modules/by-name/ni/nix/module.nix @@ -1,24 +1,32 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, # flakes - nixpkgs_as_input, - templates, self, system, + externalDependencies, ... }: { # TODO(@bpeetz): Modularize <2025-02-08> nix = { - package = pkgs.lix; + package = pkgs.lixPackageSets.latest.lix; # Disable nix channels (this is a remnant of old days) channel.enable = false; registry = { - nixpkgs.flake = nixpkgs_as_input; + nixpkgs.flake = self.inputs.nixpkgs; n.flake = - nixpkgs_as_input + self.inputs.nixpkgs // { # Otherwise nixpkgs's config and overlays are not available: @@ -27,7 +35,7 @@ legacyPackages."${system}" = pkgs; }; - t.flake = templates; + t.flake = externalDependencies.templates; my_flake.flake = self; m.flake = self; diff --git a/modules/by-name/ni/nixos-shell/module.nix b/modules/by-name/ni/nixos-shell/module.nix new file mode 100644 index 00000000..219f080d --- /dev/null +++ b/modules/by-name/ni/nixos-shell/module.nix @@ -0,0 +1,128 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Jörg Thalheim and contributors +# SPDX-License-Identifier: MIT +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + lib, + config, + pkgs, + self, + ... +}: let + cfg = config.soispha.nixos-shell; +in { + options.soispha.nixos-shell = { + enable = lib.mkEnableOption "nixos-shell"; + + user_name = lib.mkOption { + type = lib.types.str; + default = "soispha"; + description = "The user to auto-login into the vm."; + }; + + configuration = { + specialArgs = lib.mkOption { + type = lib.types.attrsOf lib.types.anything; + default = {}; + description = '' + The arguments to pass to the `specialArgs` attribute set. + ''; + }; + value = lib.mkOption { + type = lib.types.deferredModule; + default = {}; + description = '' + Additional NixOS configuration to load into the VM's config. + ''; + }; + }; + + mounts = lib.mkOption { + type = lib.types.attrsOf (lib.types.submodule ({config, ...}: { + options = { + target = lib.mkOption { + type = lib.types.path; + description = "Target on the guest."; + }; + + cache_mode = lib.mkOption { + type = lib.types.enum ["none" "loose" "fscache" "mmap"]; + default = "loose"; # bad idea? Well, at least it is fast!1!! + description = "9p caching policy"; + }; + + readOnly = + (lib.mkEnableOption "mount this disk in read-only mode") + // { + default = true; + }; + + tag = lib.mkOption { + type = lib.types.str; + internal = true; + }; + }; + + config.tag = lib.mkDefault ( + builtins.substring 0 31 ( # tags must be shorter than 32 bytes + "a" + + # tags must not begin with a digit + builtins.hashString "md5" config._module.args.name + ) + ); + })); + default = {}; + description = '' + Extra paths to make available in the vm. + These will be mounted ro to their `target.` + ''; + }; + }; + + config = let + vmSystem = self.inputs.nixpkgs.lib.nixosSystem { + inherit (cfg.configuration) specialArgs; + + modules = [ + { + # TODO(@bpeetz): This should be bumped each release. <2025-05-17> + system.stateVersion = "25.05"; + } + + cfg.configuration.value + + (import ./shell_setup.nix {inherit cfg;}) + ]; + }; + + nixos-shell = pkgs.writeShellApplication { + name = "nixos-shell"; + text = builtins.readFile ./nixos-shell.sh; + + # We need to keep the PATH, as we otherwise can't pass it along. + inheritPath = true; + + runtimeInputs = [ + vmSystem.config.system.build.vm + pkgs.mktemp + pkgs.coreutils + pkgs.moreutils # for sponge + ]; + runtimeEnv = { + HOST_NAME = vmSystem.config.system.name; + }; + }; + in + lib.mkIf cfg.enable { + environment.systemPackages = [ + nixos-shell + ]; + + system.build.nixos-shell = vmSystem.config.system.build.vm; + }; +} diff --git a/modules/by-name/ni/nixos-shell/nixos-shell.sh b/modules/by-name/ni/nixos-shell/nixos-shell.sh new file mode 100755 index 00000000..390e60b1 --- /dev/null +++ b/modules/by-name/ni/nixos-shell/nixos-shell.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env dash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Jörg Thalheim and contributors +# SPDX-License-Identifier: MIT +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +SHARED_DIR="$(mktemp --directory)" +cleanup() { + rm --recursive "$SHARED_DIR" +} +trap cleanup EXIT +export SHARED_DIR + +TMPDIR="$SHARED_DIR" +export TMPDIR + +cat <<EOF >"$SHARED_DIR/.env_variables" +{ + "pwd": "$PWD", + "term": "$TERM", + "path": "$PATH" +} +EOF + +mk_tag() { + additional_path="$1" + + # tags must be shorter than 32 bytes + # and must not begin with a digit. + { + printf "a" + echo "$additional_path" | sha256sum | head -c 30 + } +} + +for raw_additional_path in "$@"; do + additional_path="$(realpath "$raw_additional_path")" + tag="$(mk_tag "$additional_path")" + + if [ "$(jq --arg mount "$tag" '.mount.[$mount]' "$SHARED_DIR/.env_variables")" != "null" ]; then + echo "Path '$additional_path' alread added." + shift 1 + continue + fi + + jq --arg mount "$tag" --arg target "$additional_path" \ + '. + {mount: {$mount: $target}}' "$SHARED_DIR/.env_variables" | sponge "$SHARED_DIR/.env_variables" + + set -- "$@" -virtfs "local,path=$additional_path,security_model=none,readonly=on,mount_tag=$tag" + shift 1 +done + +# Do not exec here, as we don't want to lose our cleanup hooks. +"run-$HOST_NAME-vm" "$@" diff --git a/modules/by-name/ni/nixos-shell/shell_setup.nix b/modules/by-name/ni/nixos-shell/shell_setup.nix new file mode 100644 index 00000000..75af0678 --- /dev/null +++ b/modules/by-name/ni/nixos-shell/shell_setup.nix @@ -0,0 +1,191 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Jörg Thalheim and contributors +# SPDX-License-Identifier: MIT +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +# This file contains the code that is used to setup the VM shell. +{cfg}: { + lib, + config, + pkgs, + modulesPath, + ... +}: let + mkVMDefault = lib.mkOverride 970; + + env_file = "/tmp/shared/.env_variables"; +in { + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + (modulesPath + "/virtualisation/qemu-vm.nix") + ]; + + config = { + assertions = [ + { + assertion = builtins.elem cfg.user_name (lib.mapAttrsToList (name: value: name) config.users.users); + message = '' + Your user ${cfg.user_name} is not a recorded user in `config.users.users`. + Auto-login will not work. + ''; + } + ]; + + # Lock root login. + users.users.root.hashedPassword = ""; + + # Remove unneeded clutter. + system.switch.enable = false; + + virtualisation = { + # See https://wiki.qemu.org/Documentation/9psetup#Performance_Considerations. + # It is effectively a balance between ram and IO speed. + msize = let + kib = x: x * 1024; + in + mkVMDefault (kib 512); + + graphics = mkVMDefault false; + memorySize = mkVMDefault 1700; # in MB + cores = mkVMDefault 16; + + # Do not persist this VM. + diskImage = mkVMDefault null; + + fileSystems = + lib.mapAttrs' + (_: mount: { + name = mount.target; + + value = { + device = mount.tag; + fsType = "9p"; + options = + [ + "trans=virtio" + "version=9p2000.L" + "cache=${mount.cache_mode}" + "msize=${toString config.virtualisation.msize}" + ] + ++ lib.optionals mount.readOnly ["ro"]; + }; + }) + cfg.mounts; + + qemu = { + consoles = lib.mkIf (!config.virtualisation.graphics) ["tty0" "hvc0"]; + + options = let + mkMount = options: "-virtfs " + (builtins.concatStringsSep "," options); + in + lib.optionals (!config.virtualisation.graphics) [ + "-serial null" + "-device virtio-serial" + "-chardev stdio,mux=on,id=char0,signal=off" + "-mon chardev=char0,mode=readline" + "-device virtconsole,chardev=char0,nr=0" + ] + ++ (lib.mapAttrsToList + (hostPath: mount: + mkMount [ + "local" + "path=${builtins.toString hostPath}" + "security_model=none" + "readonly=on" + "mount_tag=${mount.tag}" + ]) + cfg.mounts); + }; + }; + + services = { + getty.helpLine = '' + If you are connect via serial console: + Type Ctrl-a c to switch to the qemu console + and `quit` to stop the VM. + ''; + + getty.autologinUser = cfg.user_name; + }; + + system.activationScripts = { + mountAdditionalPaths = + # bash + '' + PATH="${pkgs.jq}/bin:${pkgs.util-linux}/bin:$PATH" + export PATH + + max_index="$(jq '.mount | keys | length' --raw-output ${env_file})" + index=0 + + mount --mkdir --type=tmpfs none "/.rw" --options=rw,relatime,mode=0755 + while [ "$index" -lt "$max_index" ]; do + what="$(jq --argjson index "$index" '.mount | keys | map(.)[$index]' --raw-output ${env_file})" + where="$(jq --argjson index "$index" '.mount | map(.)[$index]' --raw-output ${env_file})" + + mkdir "/.rw/$what" + mount --mkdir "$what" "/.ro/$what" \ + --type=9p \ + --options=ro,trans=virtio,version=9p2000.L,msize=${toString config.virtualisation.msize},x-systemd.requires=modprobe@9pnet_virtio.service + + mkdir "/.rw/work-$what" + mount --mkdir --type=overlay overlay \ + --options=rw,relatime,lowerdir="/.ro/$what",upperdir="/.rw/$what",workdir="/.rw/work-$what",uuid=on \ + "/.ov/$what" + + index="$((index + 1))" + done + ''; + }; + + systemd.services.mountAdditionalPaths = { + after = ["local-fs.target"]; + wantedBy = ["multi-user.target"]; + path = [pkgs.jq]; + script = + # bash + '' + max_index="$(jq '.mount | keys | length' --raw-output ${env_file})" + index=0 + + while [ "$index" -lt "$max_index" ]; do + what="$(jq --argjson index "$index" '.mount | keys | map(.)[$index]' --raw-output ${env_file})" + where="$(jq --argjson index "$index" '.mount | map(.)[$index]' --raw-output ${env_file})" + + systemd-mount --type none "/.ov/$what" "$where" --options=bind + + # HACK(@bpeetz): Nearly all of the paths are in $HOME anyways. So simply avoid + # the permission issue. + # Ideally, we would pass the original owners along with the mount. <2025-05-17> + chown --recursive soispha:users "/home/soispha" + + index="$((index + 1))" + done + ''; + }; + + environment = { + systemPackages = [ + pkgs.jq + ]; + + sessionVariables = { + IN_NIXOS_SHELL = "true"; + }; + + loginShellInit = + # bash + '' + cd "$(jq '.pwd' --raw-output ${env_file})" + export TERM="$(jq '.term' --raw-output ${env_file})" + export PATH="$(jq '.path' --raw-output ${env_file}):$PATH" + ''; + }; + + networking.firewall.enable = mkVMDefault true; + }; +} diff --git a/modules/by-name/ni/nixpkgs/config.nix b/modules/by-name/ni/nixpkgs/config.nix index 1a24444d..ea8f3c45 100644 --- a/modules/by-name/ni/nixpkgs/config.nix +++ b/modules/by-name/ni/nixpkgs/config.nix @@ -1,10 +1,19 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { cfg, - myPkgs, lib, + packageSets, ... }: let - myPkgsOverlay = self: super: myPkgs; + myPkgsOverlay = self: super: packageSets.soispha; in { nixpkgs = { hostPlatform = cfg.systemName; @@ -22,6 +31,12 @@ in { allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "pypemicro" # required by pynitrokey + + # TODO(@bpeetz): Allow moving them to their respective module. <2025-04-25> + "steam" + "steam-unwrapped" + "steam-original" + "steam-run" ]; }; }; diff --git a/modules/by-name/ni/nixpkgs/module.nix b/modules/by-name/ni/nixpkgs/module.nix index eda3ac89..fcde9505 100644 --- a/modules/by-name/ni/nixpkgs/module.nix +++ b/modules/by-name/ni/nixpkgs/module.nix @@ -1,8 +1,18 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, + packageSets, ... -} @ args: let +}: let cfg = config.soispha.nixpkgs; in { options.soispha.nixpkgs = { @@ -13,5 +23,35 @@ in { type = lib.types.str; }; }; - config = lib.mkIf cfg.enable (import ./config.nix (args // {inherit cfg;})); + config = let + myPkgsOverlay = self: super: packageSets.soispha; + in + lib.mkIf cfg.enable + { + nixpkgs = { + hostPlatform = cfg.systemName; + + overlays = [ + myPkgsOverlay + ]; + + config = { + # TODO: this fails because of the root tempsize, which should be increased + # contentAddressedByDefault = true; + + hostSystem = cfg.systemName; + + allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "pypemicro" # required by pynitrokey + + # TODO(@bpeetz): Allow moving them to their respective module. <2025-04-25> + "steam" + "steam-unwrapped" + "steam-original" + "steam-run" + ]; + }; + }; + }; } diff --git a/modules/by-name/nv/nvim/autocmds/default.nix b/modules/by-name/nv/nvim/autocmds/default.nix index 54fd6831..706f1bbd 100644 --- a/modules/by-name/nv/nvim/autocmds/default.nix +++ b/modules/by-name/nv/nvim/autocmds/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/clipboard/default.nix b/modules/by-name/nv/nvim/clipboard/default.nix index 4cc3bd8a..f6348e44 100644 --- a/modules/by-name/nv/nvim/clipboard/default.nix +++ b/modules/by-name/nv/nvim/clipboard/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/mappings/default.nix b/modules/by-name/nv/nvim/mappings/default.nix index 4b6344c2..4997f66c 100644 --- a/modules/by-name/nv/nvim/mappings/default.nix +++ b/modules/by-name/nv/nvim/mappings/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -18,34 +27,6 @@ in { action = "<cmd>noh<CR><Esc>"; options.desc = "Disable the search highlighting and send Escape"; } - { - key = "hh"; - mode = ["i"]; - action.__raw = '' - function() - local cmp = require('cmp'); - local luasnip = require('luasnip'); - - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end - ''; - options.desc = "completion trigger/ forward in completen menu"; - } - { - key = "uu"; - mode = ["i"]; - action.__raw = '' - function() - local cmp = require('cmp'); - cmp.confirm() - end - ''; - options.desc = "confirm the selected item"; - } { key = "<C-Tab>"; diff --git a/modules/by-name/nv/nvim/module.nix b/modules/by-name/nv/nvim/module.nix index 0eb416f6..819646d6 100644 --- a/modules/by-name/nv/nvim/module.nix +++ b/modules/by-name/nv/nvim/module.nix @@ -1,7 +1,17 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, config, + modules, ... }: let cfg = config.soispha.programs.nvim; @@ -24,6 +34,10 @@ in { config = lib.mkIf cfg.enable { home-manager.users.soispha = { + imports = [ + modules.nixvim.homeManagerModules.nixvim + ]; + home.sessionVariables = { EDITOR = "nvim"; VISUAL = "nvim"; diff --git a/modules/by-name/nv/nvim/options/default.nix b/modules/by-name/nv/nvim/options/default.nix index be475b13..301f0ac0 100644 --- a/modules/by-name/nv/nvim/options/default.nix +++ b/modules/by-name/nv/nvim/options/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -23,7 +32,6 @@ in { confirm = true; # confirm to save changes before closing modified buffer colorcolumn = "+1"; # show a +1 before the 'textwidth' - completeopt = ["menuone" "noselect"]; # have a better completion experience # https://www.compart.com/en/unicode/U+XXXX (unicode character code) fillchars = { diff --git a/modules/by-name/nv/nvim/plgs/colorscheme/default.nix b/modules/by-name/nv/nvim/plgs/colorscheme/default.nix index ebc26826..f8cd5892 100644 --- a/modules/by-name/nv/nvim/plgs/colorscheme/default.nix +++ b/modules/by-name/nv/nvim/plgs/colorscheme/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, diff --git a/modules/by-name/nv/nvim/plgs/colorscheme/lua/mk_todos_readable.lua b/modules/by-name/nv/nvim/plgs/colorscheme/lua/mk_todos_readable.lua index d02171b5..44c76084 100644 --- a/modules/by-name/nv/nvim/plgs/colorscheme/lua/mk_todos_readable.lua +++ b/modules/by-name/nv/nvim/plgs/colorscheme/lua/mk_todos_readable.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + local opts = { bg = "NONE", bold = true } ---@param hl_group string: The name of the hl group diff --git a/modules/by-name/nv/nvim/plgs/colorscheme/lua/nightfox.lua b/modules/by-name/nv/nvim/plgs/colorscheme/lua/nightfox.lua index 4c502153..38f6f0a1 100644 --- a/modules/by-name/nv/nvim/plgs/colorscheme/lua/nightfox.lua +++ b/modules/by-name/nv/nvim/plgs/colorscheme/lua/nightfox.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + require("nightfox").setup({ options = { -- Compiled file's destination location diff --git a/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix b/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix index bd70c5c2..b404843e 100644 --- a/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix +++ b/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/debugprint/default.nix b/modules/by-name/nv/nvim/plgs/debugprint/default.nix index 4a3af1c5..79e557bd 100644 --- a/modules/by-name/nv/nvim/plgs/debugprint/default.nix +++ b/modules/by-name/nv/nvim/plgs/debugprint/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, diff --git a/modules/by-name/nv/nvim/plgs/debugprint/lua/debugprint.lua b/modules/by-name/nv/nvim/plgs/debugprint/lua/debugprint.lua index da7e1735..b934d619 100644 --- a/modules/by-name/nv/nvim/plgs/debugprint/lua/debugprint.lua +++ b/modules/by-name/nv/nvim/plgs/debugprint/lua/debugprint.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + require("debugprint").setup({ create_keymaps = false, }) diff --git a/modules/by-name/nv/nvim/plgs/default.nix b/modules/by-name/nv/nvim/plgs/default.nix index 991bc315..aaebb3b1 100644 --- a/modules/by-name/nv/nvim/plgs/default.nix +++ b/modules/by-name/nv/nvim/plgs/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { imports = [ diff --git a/modules/by-name/nv/nvim/plgs/femaco/default.nix b/modules/by-name/nv/nvim/plgs/femaco/default.nix index adf0ba63..a30bb59f 100644 --- a/modules/by-name/nv/nvim/plgs/femaco/default.nix +++ b/modules/by-name/nv/nvim/plgs/femaco/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, diff --git a/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua b/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua index c113e4c7..1371a825 100644 --- a/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua +++ b/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + local clip_val = require("femaco.utils").clip_val require("femaco").setup({ -- should prepare a new buffer and return the winid diff --git a/modules/by-name/nv/nvim/plgs/flatten-nvim/default.nix b/modules/by-name/nv/nvim/plgs/flatten-nvim/default.nix index 48fcd8a6..8d61d859 100644 --- a/modules/by-name/nv/nvim/plgs/flatten-nvim/default.nix +++ b/modules/by-name/nv/nvim/plgs/flatten-nvim/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, diff --git a/modules/by-name/nv/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua b/modules/by-name/nv/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua index 2cdbcdde..0c86cd27 100644 --- a/modules/by-name/nv/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua +++ b/modules/by-name/nv/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + ---Types: -- -- Passed to callbacks that handle opening files diff --git a/modules/by-name/nv/nvim/plgs/goto-preview/default.nix b/modules/by-name/nv/nvim/plgs/goto-preview/default.nix index 5c56fe8c..93761dfd 100644 --- a/modules/by-name/nv/nvim/plgs/goto-preview/default.nix +++ b/modules/by-name/nv/nvim/plgs/goto-preview/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, diff --git a/modules/by-name/nv/nvim/plgs/goto-preview/lua/goto-preview.lua b/modules/by-name/nv/nvim/plgs/goto-preview/lua/goto-preview.lua index 9687a5a0..ad285033 100644 --- a/modules/by-name/nv/nvim/plgs/goto-preview/lua/goto-preview.lua +++ b/modules/by-name/nv/nvim/plgs/goto-preview/lua/goto-preview.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + require("goto-preview").setup({ width = 120, -- Width of the floating window height = 15, -- Height of the floating window diff --git a/modules/by-name/nv/nvim/plgs/harpoon/default.nix b/modules/by-name/nv/nvim/plgs/harpoon/default.nix index 05a40d9f..c85c7c80 100644 --- a/modules/by-name/nv/nvim/plgs/harpoon/default.nix +++ b/modules/by-name/nv/nvim/plgs/harpoon/default.nix @@ -1,100 +1,53 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { - pkgs, - config, lib, + config, ... }: let - numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9"]; - mkNumberedCommand = { - command_template, - prefix, - number, - desc_template, - }: { - key = "${prefix}${number}"; - action.__raw = '' - function() - ${command_template number} - end - ''; - options.desc = "${desc_template number}"; - }; - mkGotoTerminalCommand = number: let - desc_template = number: "Goto terminal number ${number}"; - command_template = number: ''require("harpoon.term").gotoTerminal(${number})''; - prefix = "gt"; - in - mkNumberedCommand {inherit desc_template command_template prefix number;}; - mkGotoFileCommand = number: let - desc_template = number: "Goto Buffer number ${number}"; - command_template = number: ''require("harpoon.ui").nav_file(${number})''; - prefix = "gf"; - in - mkNumberedCommand {inherit desc_template command_template prefix number;}; - - gotoTerminalMappings = builtins.map mkGotoTerminalCommand numbers; - gotoFileMappings = builtins.map mkGotoFileCommand numbers; cfg = config.soispha.programs.nvim; in { home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - plugins.harpoon = { - enable = true; - package = pkgs.vimPlugins.harpoon; - enableTelescope = true; - # menu.width = "vim.api.nvim_win_get_width(0) - 4"; # TODO: integrate that - keymaps = { - tmuxGotoTerminal = null; # TODO: - }; - }; + plugins.harpoon.enable = true; + keymaps = - [ - { - key = "-"; - action.__raw = '' + lib.mapAttrsToList + (key: action: { + mode = "n"; + inherit key; + action.__raw = builtins.elemAt action 0; + options.silent = true; + options.desc = builtins.elemAt action 1; + }) + { + # add current file + "<leader><leader>" = [ + # lua + '' function() - require("harpoon.ui").nav_next() - end - ''; - options.desc = "go to the next marked file"; - } - { - key = "_"; - action.__raw = '' - function() - require("harpoon.ui").nav_prev() - end - ''; - options.desc = "go to the previous marked file"; - } - { - key = "<leader><leader>"; - action.__raw = '' - function() - require("harpoon.mark").add_file() - end - ''; - options.desc = "add a mark to the open file in harpoon."; - } - { - key = "gqc"; - action.__raw = '' - function() - require("harpoon.cmd-ui").toggle_quick_menu() + require("harpoon"):list():add() end - ''; - options.desc = "toggle the harpoon command quick menu to see all commands."; - } - { - key = "<leader>q"; - action.__raw = '' + '' + "Add a mark to the open file in harpoon." + ]; + + # open menu + "<leader>q" = [ + # lua + '' function() - require("harpoon.ui").toggle_quick_menu() + require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end - ''; - options.desc = "toggle the harpoon normal quick menu to see all marks."; - } - ] - ++ gotoFileMappings - ++ gotoTerminalMappings; + '' + "Toggle the harpoon normal quick menu to see all marks." + ]; + }; }; } diff --git a/modules/by-name/nv/nvim/plgs/leap/default.nix b/modules/by-name/nv/nvim/plgs/leap/default.nix index 57e78879..e5c42d2f 100644 --- a/modules/by-name/nv/nvim/plgs/leap/default.nix +++ b/modules/by-name/nv/nvim/plgs/leap/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix b/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix index 1e7c91e3..3a1c6bf9 100644 --- a/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix +++ b/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix @@ -1,23 +1,28 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, config, - nixpkgs_open_prs, - system, ... }: let cfg = config.soispha.programs.nvim; in { + # TODO: package lf-nvim though a module + # TODO: change the nvim path, when I change the path with lf home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { - # TODO: package lf-nvim though a module - # FIXME: change the nvim path, when I change the path with lf extraConfigLuaPost = '' ${lib.strings.fileContents ./lua/lf-nvim.lua} ''; extraPlugins = [ - nixpkgs_open_prs.nixpkgs-lf.legacyPackages."${system}".vimPlugins.lf-nvim - - pkgs.vimPlugins.toggleterm-nvim # required by lf-nvim + pkgs.vimPlugins.lf-nvim ]; }; } diff --git a/modules/by-name/nv/nvim/plgs/lf-nvim/lua/lf-nvim.lua b/modules/by-name/nv/nvim/plgs/lf-nvim/lua/lf-nvim.lua index 1eadf375..8c40ab50 100644 --- a/modules/by-name/nv/nvim/plgs/lf-nvim/lua/lf-nvim.lua +++ b/modules/by-name/nv/nvim/plgs/lf-nvim/lua/lf-nvim.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + local fn = vim.fn -- Defaults diff --git a/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/default.nix b/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/default.nix index 1a2fb6eb..85458310 100644 --- a/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua b/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua index 5a2cff26..2886d821 100644 --- a/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua +++ b/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + --- @type table<string, any> require("lsp-progress").setup({ -- Spinning icons. diff --git a/modules/by-name/nv/nvim/plgs/lsp/default.nix b/modules/by-name/nv/nvim/plgs/lsp/default.nix index d97f2f0a..27a6f909 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix b/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix index 903e8c17..7cc9f6d5 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix index 605046d4..8ff130fe 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { imports = [ # ./servers/pylyzer.nix diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix index 5a37e133..8d2b0d03 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix index 9f3195fa..eed7f349 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix index 03b7d4c1..e55cf377 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix index 39e4b989..9350cd37 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix index 94ca99ce..3b7e2523 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix index 94f7b067..fba1113f 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/pylyzer.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/pylyzer.nix index 3ac66102..47e8de7a 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/pylyzer.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/pylyzer.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix index 48a3a71c..82d3b5a9 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix index 57cb8366..4f9834ee 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix index 093f5250..fd344c50 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix index 1fe3c764..5f001177 100644 --- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/lspkind/default.nix b/modules/by-name/nv/nvim/plgs/lspkind/default.nix index 078d607d..6e966ad1 100644 --- a/modules/by-name/nv/nvim/plgs/lspkind/default.nix +++ b/modules/by-name/nv/nvim/plgs/lspkind/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix b/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix index c37a7591..a01d5653 100644 --- a/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix +++ b/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, diff --git a/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua b/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua index d532428a..883b22c4 100644 --- a/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua +++ b/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + require("ltex_extra").setup({ -- table <string> : languages for witch dictionaries will be loaded, e.g. { "es-AR", "en-US" } -- https://valentjn.github.io/ltex/supported-languages.html#natural-languages diff --git a/modules/by-name/nv/nvim/plgs/lualine/default.nix b/modules/by-name/nv/nvim/plgs/lualine/default.nix index 2f3bb552..7a69519b 100644 --- a/modules/by-name/nv/nvim/plgs/lualine/default.nix +++ b/modules/by-name/nv/nvim/plgs/lualine/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/luasnip/default.nix b/modules/by-name/nv/nvim/plgs/luasnip/default.nix index f67c9899..222b5070 100644 --- a/modules/by-name/nv/nvim/plgs/luasnip/default.nix +++ b/modules/by-name/nv/nvim/plgs/luasnip/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, @@ -7,14 +16,81 @@ cfg = config.soispha.programs.nvim; in { home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + keymaps = [ + { + key = "<C-K>"; + mode = ["i"]; + action.__raw = '' + function() + require('luasnip').expand() + end + ''; + options = { + # silent = true; + desc = "Expand the snippet"; + }; + } + { + key = "<C-L>"; + mode = ["i" "s"]; + action.__raw = '' + function() + require('luasnip').jump(1) + end + ''; + options = { + # silent = true; + desc = "Jump forward in snippet insert nodes"; + }; + } + { + key = "<C-J>"; + mode = ["i" "s"]; + action.__raw = '' + function() + require('luasnip').jump(-1) + end + ''; + options = { + # silent = true; + desc = "Jump backwards in snippet insert nodes"; + }; + } + { + key = "<C-E>"; + mode = ["i" "s"]; + action.__raw = '' + function() + if require('luasnip').choice_active() then + require('luasnip').change_choice(1) + end + end + ''; + options = { + # silent = true; + desc = "Cycle through the snippets choice nodes"; + }; + } + ]; plugins.luasnip = { enable = true; + + settings = { + # Enable auto triggered snippets. + enable_autosnippets = true; + + # Use Tab to trigger visual selection. + store_selection_keys = "<Tab>"; + }; + + fromLua = [ + { + paths = ./snippets; + lazyLoad = true; + } + ]; }; - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/luasnip.lua}; - require("luasnip.loaders.from_lua").load({paths = "${./lua/snippets}"}); - require("luasnip.loaders.from_lua").lazy_load({paths = "${./lua/snippets}"}); - ''; + extraPlugins = [ # needed for the todo-comments snippets pkgs.vimPlugins.comment-nvim diff --git a/modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua deleted file mode 100644 index a05fa57f..00000000 --- a/modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua +++ /dev/null @@ -1,7 +0,0 @@ -require("luasnip").config.set_config({ - -- Enable auto triggered snippets - enable_autosnippets = true, - - -- Use Tab (or some other key if you prefer) to trigger visual selection - store_selection_keys = "<Tab>", -}) diff --git a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/all.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/all.lua deleted file mode 100644 index 2b923f20..00000000 --- a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/all.lua +++ /dev/null @@ -1,211 +0,0 @@ -local ls = require("luasnip") --- auto_pairs {{{ -local get_visual = function(args, parent) - if #parent.snippet.env.SELECT_RAW > 0 then - return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) - else - return sn(nil, i(1, "")) - end -end -local function char_count_same(c1, c2) - local line = vim.api.nvim_get_current_line() - -- '%'-escape chars to force explicit match (gsub accepts patterns). - -- second return value is number of substitutions. - local _, ct1 = string.gsub(line, "%" .. c1, "") - local _, ct2 = string.gsub(line, "%" .. c2, "") - return ct1 == ct2 -end - -local function even_count(c, ...) - local line = vim.api.nvim_get_current_line() - local _, ct = string.gsub(line, c, "") - return ct % 2 == 0 -end - --- This makes creation of pair-type snippets easier. -local function pair(pair_begin, pair_end, file_types, condition_function) - -- FIXME(@Soispha): This only works if file_types == nil, otherwise the snippet does not expand. - -- It would be nice, if it would support both an empty array (`{}`) and nil <2023-08-27> - -- file_types = file_types or {}; - - return s( - { trig = pair_begin, wordTrig = false, snippetType = "autosnippet" }, - { t({ pair_begin }), d(1, get_visual), t({ pair_end }) }, - { - condition = function() - local filetype_check = true - if file_types ~= nil then filetype_check = file_types[vim.bo.filetype] or false end - return (not condition_function(pair_begin, pair_end)) and filetype_check - end, - } - ) -end - -local auto_pairs = { - pair("(", ")", nil, char_count_same), - pair("{", "}", nil, char_count_same), - pair("[", "]", nil, char_count_same), - pair("<", ">", { ["rust"] = true, ["tex"] = true }, char_count_same), - pair("'", "'", nil, even_count), - pair("\"", "\"", nil, even_count), - pair("`", "`", nil, even_count), -} - -ls.add_snippets("all", auto_pairs, { type = "snippets", key = "auto_pairs" }) --- }}} - --- todo_comments {{{ -local calculate_comment_string = require("Comment.ft").calculate -local utils = require("Comment.utils") - -local read_git_config = function(config_value) - local command = string.format("git config \"%s\"", config_value) - local handle = io.popen(command) - if handle == nil then return error(string.format("Failed to call `%s`.", command)) end - local result = handle:read("*a") - handle:close() - -- stripped = string.gsub(str, '%s+', '') - return string.gsub(result, "\n", "") -end - -local name_to_handle = function(name) - -- from: https://stackoverflow.com/a/7615129 - local split = function(inputstr, sep) - local t = {} - for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do - table.insert(t, str) - end - return t - end - - local parts = split(name, "%s") - - local output_name = "" - if #parts > 2 then - for _, val in ipairs(parts) do - output_name = string.format("%s%s", output_name, val:sub(1, 1)) - end - elseif #parts == 2 then - output_name = string.format("%s%s", parts[1]:sub(1, 1), parts[2]) - elseif #parts == 1 then - output_name = parts[1] - else - -- parts is 0 - output_name = "<NoName>" - end - return string.format("@%s", output_name:lower()) -end - -_G.luasnip = {} -_G.luasnip.vars = { - username = function() return name_to_handle(read_git_config("user.name")) end, - email = function() return read_git_config("user.email") end, -} - ---- Get the comment string {beg,end} table ----@param ctype integer 1 for `line`-comment and 2 for `block`-comment ----@return table comment_strings {begcstring, endcstring} -local get_cstring = function(ctype) - -- use the `Comments.nvim` API to fetch the comment string for the region (eq. '--%s' or '--[[%s]]' for `lua`) - local cstring = calculate_comment_string({ ctype = ctype, range = utils.get_region() }) or vim.bo.commentstring - -- as we want only the strings themselves and not strings ready for using `format` we want to split the left and right side - local left, right = utils.unwrap_cstr(cstring) - -- create a `{left, right}` table for it - return { left, right } -end - ---- Options for marks to be used in a TODO comment ----@return table,table: The first table contains a node for the date, the second for the signature -local marks = { - signature = function() return t("(" .. _G.luasnip.vars:username() .. ")"), t("") end, - date_signature = function() return t("<" .. os.date("%Y-%m-%d") .. ">"), t("(" .. _G.luasnip.vars:username() .. ")") end, - date = function() return t("<" .. os.date("%Y-%m-%d") .. ">"), t("") end, - empty = function() return t(""), t("") end, -} - ----@param alias string ----@param opts table ----@param mark_function function: This function should return two nodes ----@return table: Returns the comment node -local todo_snippet_nodes = function(alias, opts, mark_function) - local date_node, signature_node = mark_function() - -- format them into the actual snippet - local comment_node = fmta("<> <><>: <> <> <>", { - f(function() - return get_cstring(opts.ctype)[1] -- get <comment-string[1]> - end), - t(alias), -- [name-of-comment] - signature_node, - i(0), -- {comment-text} - date_node, - f(function() - return get_cstring(opts.ctype)[2] -- get <comment-string[2]> - end), - }) - return comment_node -end - ---- Generate a TODO comment snippet with an automatic description and docstring ----@param context table merged with the generated context table `trig` must be specified ----@param alias string of aliases for the todo comment (ex.: {FIX, ISSUE, FIXIT, BUG}) ----@param opts table merged with the snippet opts table ----@param mark_function function: The function used to get the marks -local todo_snippet = function(context, alias, opts, mark_function) - opts = opts or {} - context = context or {} - if not context.trig then - return error("context doesn't include a `trig` key which is mandatory", 2) -- all we need from the context is the trigger - end - opts.ctype = opts.ctype or 1 -- comment type can be passed in the `opts` table, but if it is not, we have to ensure, it is defined - local alias_string = alias -- `choice_node` documentation - context.name = context.name or (alias_string .. " comment") -- generate the `name` of the snippet if not defined - context.dscr = context.dscr or (alias_string .. " comment with a signature-mark") -- generate the `dscr` if not defined - context.docstring = context.docstring or (" {1:" .. alias_string .. "}: {3} <{2:mark}>{0} ") -- generate the `docstring` if not defined - local comment_node = todo_snippet_nodes(alias, opts, mark_function) - return s(context, comment_node, opts) -- the final todo-snippet constructed from our parameters -end - ----@param context table: The luasnip context ----@param opts table: The luasnip opts table, needs to have a ctype set ----@param aliases string: All aliases for a name ----@param marks table: Possible marks to account in snipped generation ----@return table: All possible snippets build from the marks -local process_marks = function(context, aliases, opts, marks) - local output = {} - for mark_name, mark_function in pairs(marks) do - local contex_trig_local = context.trig - context.trig = context.trig .. "-" .. mark_name - output[#output + 1] = todo_snippet(context, aliases, opts, mark_function) - context.trig = contex_trig_local - end - return output -end - -local todo_snippet_specs = { - { { trig = "todo" }, { "TODO" }, { ctype = 1 } }, - { { trig = "fix" }, { "FIXME", "ISSUE" }, { ctype = 1 } }, - { { trig = "hack" }, { "HACK" }, { ctype = 1 } }, - { { trig = "warn" }, { "WARNING" }, { ctype = 1 } }, - { { trig = "perf" }, { "PERFORMANCE", "OPTIMIZE" }, { ctype = 1 } }, - { { trig = "note" }, { "NOTE", "INFO" }, { ctype = 1 } }, - - -- NOTE: Block commented todo-comments - { { trig = "todob" }, { "TODO" }, { ctype = 2 } }, - { { trig = "fixb" }, { "FIXME", "ISSUE" }, { ctype = 2 } }, - { { trig = "hackb" }, { "HACK" }, { ctype = 2 } }, - { { trig = "warnb" }, { "WARNING" }, { ctype = 2 } }, - { { trig = "perfb" }, { "PERF", "PERFORMANCE", "OPTIM", "OPTIMIZE" }, { ctype = 2 } }, - { { trig = "noteb" }, { "NOTE", "INFO" }, { ctype = 2 } }, -} - -local todo_comment_snippets = {} -for _, v in ipairs(todo_snippet_specs) do - local snippets = process_marks(v[1], v[2][1], v[3], marks) - for _, value in pairs(snippets) do - table.insert(todo_comment_snippets, value) - end -end - -ls.add_snippets("all", todo_comment_snippets, { type = "snippets", key = "todo_comments" }) - --- }}} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/html/html.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/html/html.lua deleted file mode 100644 index 568c97ec..00000000 --- a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/html/html.lua +++ /dev/null @@ -1,102 +0,0 @@ -local get_visual = function(args, parent) - if #parent.snippet.env.SELECT_RAW > 0 then - return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) - else - return sn(nil, i(1)) - end -end - -local line_begin = require("luasnip.extras.expand_conditions").line_begin - -return { - -- HEADER - s( - { - trig = "h([123456])", - regTrig = true, - wordTrig = false, - snippetType = "autosnippet", - }, - fmt( - [[ - <h{}>{}</h{}> - ]], - { - f(function(_, snip) return snip.captures[1] end), - d(1, get_visual), - f(function(_, snip) return snip.captures[1] end), - } - ), - { condition = line_begin } - ), -- PARAGRAPH - s( - { trig = "pp", snippetType = "autosnippet" }, - fmt( - [[ - <p>{}</p> - ]], - { d(1, get_visual) } - ), - { condition = line_begin } - ), -- UNORDERED LIST - s( - { trig = "itt", snippetType = "autosnippet" }, - fmt( - [[ - <ul> - <li>{}</li>{} - </ul> - ]], - { i(1), i(0) } - ), - { condition = line_begin } - ), -- LIST ITEM - s( - { trig = "ii", snippetType = "autosnippet" }, - fmt( - [[ - <li>{}</li> - ]], - { d(1, get_visual) } - ), - { condition = line_begin } - ), - -- DOCUMENT TEMPLATE - s( - { trig = "base" }, - fmt( - [[ - <!doctype HTML> - <html lang="en"> - <head> - <meta charset="UTF-8"> - <title>{}</title> - </head> - <body> - {} - </body> - </html> - ]], - { i(1, "FooBar"), i(0) } - ), - { condition = line_begin } - ), -- ANCHOR TAG - s( - { - trig = "([^%l])aa", - regTrig = true, - wordTrig = false, - snippetType = "autosnippet", - }, - fmt( - [[ - {}<a href="{}">{}</a> - ]], - { - f(function(_, snip) return snip.captures[1] end), - i(1), - d(2, get_visual), - } - ) - ), -} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua deleted file mode 100644 index ef453973..00000000 --- a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua +++ /dev/null @@ -1,28 +0,0 @@ -local get_visual = function(args, parent) - if #parent.snippet.env.SELECT_RAW > 0 then - return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) - else - return sn(nil, i(1, "")) - end -end - -local translation_table = { ["("] = ")", ["{"] = "}", ["["] = "]" } - --- Return snippet tables -return { - -- LEFT/RIGHT ALL BRACES - s( - { - trig = "([^%a])l([%(%[%{])", - regTrig = true, - wordTrig = false, - snippetType = "autosnippet", - }, - fmta("<>\\left<><>\\right<>", { - f(function(_, snip) return snip.captures[1] end), - f(function(_, snip) return snip.captures[2] end), - d(1, get_visual), - f(function(_, snip) return translation_table[snip.captures[2]] end), - }) - ), -} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/greek.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/greek.lua deleted file mode 100644 index ebf4f9d7..00000000 --- a/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/greek.lua +++ /dev/null @@ -1,37 +0,0 @@ --- Return snippet tables -return { - s({ trig = ";a", snippetType = "autosnippet" }, { t("\\alpha") }), - s({ trig = ";b", snippetType = "autosnippet" }, { t("\\beta") }), - s({ trig = ";g", snippetType = "autosnippet" }, { t("\\gamma") }), - s({ trig = ";G", snippetType = "autosnippet" }, { t("\\Gamma") }), - s({ trig = ";d", snippetType = "autosnippet" }, { t("\\delta") }), - s({ trig = ";D", snippetType = "autosnippet" }, { t("\\Delta") }), - s({ trig = ";e", snippetType = "autosnippet" }, { t("\\epsilon") }), - s({ trig = ";ve", snippetType = "autosnippet" }, { t("\\varepsilon") }), - s({ trig = ";z", snippetType = "autosnippet" }, { t("\\zeta") }), - s({ trig = ";h", snippetType = "autosnippet" }, { t("\\eta") }), - s({ trig = ";o", snippetType = "autosnippet" }, { t("\\theta") }), - s({ trig = ";vo", snippetType = "autosnippet" }, { t("\\vartheta") }), - s({ trig = ";O", snippetType = "autosnippet" }, { t("\\Theta") }), - s({ trig = ";k", snippetType = "autosnippet" }, { t("\\kappa") }), - s({ trig = ";l", snippetType = "autosnippet" }, { t("\\lambda") }), - s({ trig = ";L", snippetType = "autosnippet" }, { t("\\Lambda") }), - s({ trig = ";m", snippetType = "autosnippet" }, { t("\\mu") }), - s({ trig = ";n", snippetType = "autosnippet" }, { t("\\nu") }), - s({ trig = ";x", snippetType = "autosnippet" }, { t("\\xi") }), - s({ trig = ";X", snippetType = "autosnippet" }, { t("\\Xi") }), - s({ trig = ";i", snippetType = "autosnippet" }, { t("\\pi") }), - s({ trig = ";I", snippetType = "autosnippet" }, { t("\\Pi") }), - s({ trig = ";r", snippetType = "autosnippet" }, { t("\\rho") }), - s({ trig = ";s", snippetType = "autosnippet" }, { t("\\sigma") }), - s({ trig = ";S", snippetType = "autosnippet" }, { t("\\Sigma") }), - s({ trig = ";t", snippetType = "autosnippet" }, { t("\\tau") }), - s({ trig = ";f", snippetType = "autosnippet" }, { t("\\phi") }), - s({ trig = ";vf", snippetType = "autosnippet" }, { t("\\varphi") }), - s({ trig = ";F", snippetType = "autosnippet" }, { t("\\Phi") }), - s({ trig = ";c", snippetType = "autosnippet" }, { t("\\chi") }), - s({ trig = ";p", snippetType = "autosnippet" }, { t("\\psi") }), - s({ trig = ";P", snippetType = "autosnippet" }, { t("\\Psi") }), - s({ trig = ";w", snippetType = "autosnippet" }, { t("\\omega") }), - s({ trig = ";W", snippetType = "autosnippet" }, { t("\\Omega") }), -} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/snippets/all.lua b/modules/by-name/nv/nvim/plgs/luasnip/snippets/all.lua new file mode 100644 index 00000000..371f5539 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/luasnip/snippets/all.lua @@ -0,0 +1,338 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + +local ls = require("luasnip") +local fmt = require("luasnip.extras.fmt").fmt + +--- Get the comment string {begin,end} table +--- +---@param comment_type integer 1 for `line`-comment and 2 for `block`-comment +---@return table comment_strings {["begin"]=begin_comment_string, ["end"]=end_comment_string} +local get_comment_string = function(comment_type) + local calculate_comment_string = require("Comment.ft").calculate + local utils = require("Comment.utils") + + -- use the `Comments.nvim` API to fetch the comment string for the region (eq. '--%s' or '--[[%s]]' for `lua`) + local cstring = + calculate_comment_string({ ctype = comment_type; range = utils.get_region(); }) + + if cstring == nil then + -- TODO: Use `vim.bo.commentstring` <2025-05-02> + + -- Use some useful default values. + return { ["begin"] = "#"; ["end"] = ""; } + end + + -- as we want only the strings themselves and not strings ready for using `format` we want to split the left and right side + local left, right = utils.unwrap_cstr(cstring) + + -- create a `{left, right}` table for it + return { ["begin"] = left; ["end"] = right; } +end + +--- Wraps a table of snippet nodes in two comment function nodes. +--- +---@param comment_type integer 1 for `line`-comment and 2 for `block`-comment +---@param nodes table The nodes that should be wrapped +---@return table wrapped_nodes The now wrapped `nodes` table. +local wrap_snippet_in_comments = function(comment_type, nodes) + local output = {} + + table.insert(output, ls.function_node(function() + return get_comment_string(comment_type)["begin"] + end)) + + + for _, v in ipairs(nodes) do + table.insert(output, v) + end + + table.insert(output, ls.function_node(function() + return get_comment_string(comment_type)["end"] + end)) + + return output +end + +-- auto_pairs {{{ +local get_visual = function(_, parent) + if #parent.snippet.env.SELECT_RAW > 0 then + return ls.snippet_node(nil, ls.insert_node(1, parent.snippet.env.SELECT_RAW)) + else + return ls.snippet_node(nil, ls.insert_node(1, "")) + end +end + +local function char_count_same(c1, c2) + local line = vim.api.nvim_get_current_line() + -- '%'-escape chars to force explicit match (gsub accepts patterns). + -- second return value is number of substitutions. + local _, ct1 = string.gsub(line, "%" .. c1, "") + local _, ct2 = string.gsub(line, "%" .. c2, "") + return ct1 == ct2 +end + +local function even_count(c, ...) + local line = vim.api.nvim_get_current_line() + local _, ct = string.gsub(line, c, "") + return ct % 2 == 0 +end + +-- This makes creation of pair-type snippets easier. +local function pair(pair_begin, pair_end, file_types, condition_function) + -- FIXME(@Soispha): This only works if file_types == nil, otherwise the snippet does not expand. + -- It would be nice, if it would support both an empty array (`{}`) and nil <2023-08-27> + -- file_types = file_types or {}; + + return ls.snippet( + { + trig = pair_begin; + wordTrig = false; + snippetType = "autosnippet"; + }, + { + ls.text_node({ pair_begin; }); + ls.dynamic_node(1, get_visual); + ls.text_node({ pair_end; }); + }, + { + condition = function() + local filetype_check = true + + if file_types ~= nil then + filetype_check = file_types[vim.bo.filetype] or false + end + + return (not condition_function(pair_begin, pair_end)) and filetype_check + end; + } + ) +end + +local auto_pairs = { + pair("(", ")", nil, char_count_same); + pair("{", "}", nil, char_count_same); + pair("[", "]", nil, char_count_same); + pair("<", ">", { ["rust"] = true; ["tex"] = true; }, char_count_same); + pair("'", "'", nil, even_count); + pair("\"", "\"", nil, even_count); + pair("`", "`", nil, even_count); +} + +ls.add_snippets("all", auto_pairs, { type = "snippets"; key = "auto_pairs"; }) +-- }}} + +-- todo_comments {{{ +local read_git_config = function(config_value) + local command = string.format("git config \"%s\"", config_value) + + local handle = io.popen(command) + if handle == nil then + return error(string.format("Failed to call `%s`.", command)) + end + + local result = handle:read("*a") + handle:close() + + -- stripped = string.gsub(str, '%s+', '') + return string.gsub(result, "\n", "") +end + +--- Create a @handle from a full name. +--- +--- Example: +--- “Benedikt Peetz” -> “@bpeetz” +local handle_from_name = function(name) + -- from: https://stackoverflow.com/a/7615129 + local split = function(inputstr, sep) + local t = {} + for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do + table.insert(t, str) + end + return t + end + + -- Split on spaces + local parts = split(name, "%s") + + local output_name = "" + + if #parts > 2 then + -- Only use the first chars. + -- + -- Example: + -- “Richard Matthew Stallman” -> “rms” + for _, val in ipairs(parts) do + output_name = string.format("%s%s", output_name, val:sub(1, 1)) + end + elseif #parts == 2 then + output_name = string.format("%s%s", parts[1]:sub(1, 1), parts[2]) + elseif #parts == 1 then + output_name = parts[1] + elseif #parts == 0 then + output_name = "<NoName>" + end + + return string.format("@%s", output_name:lower()) +end + +--- Generate a comment snippet +--- +---@param trig string The trigger +---@param name string name for the comment (ex.: {FIX, ISSUE, FIXIT, BUG}) +---@param comment_type integer The comment type. +---@param mark_function function: The function used to get the marks +local todo_snippet = function(trig, name, comment_type, mark_function) + assert(trig, "context doesn't include a `trig` key which is mandatory") + assert(comment_type == 1 or comment_type == 2) + + local context = {} + context.name = name .. " comment" + context.trig = trig + + local date_node, signature_node = mark_function() + + local nodes = fmt("{} {}{}: {} {} {}", wrap_snippet_in_comments(comment_type, { + ls.text_node(name); + signature_node; + ls.insert_node(1, "content"); + date_node; + })) + + return ls.snippet(context, nodes, { ctype = comment_type; }) +end + +---@param trigger string: The luasnip trigger +---@param comment_type integer: The luasnip comment type +---@param name string: All aliases for a name +---@return table: All possible snippets build from the marks +local process_marks = function(trigger, name, comment_type) + local username = function() + return handle_from_name(read_git_config("user.name")) + end + + local marks = { + signature = function() + return ls.text_node("(" .. username() .. ")"), ls.text_node("") + end; + + date_signature = function() + return ls.text_node("<" .. os.date("%Y-%m-%d") .. ">"), ls.text_node("(" .. username() .. ")") + end; + + date = function() + return ls.text_node("<" .. os.date("%Y-%m-%d") .. ">"), ls.text_node("") + end; + + empty = function() + return ls.text_node(""), ls.text_node("") + end; + } + + local output = {} + for mark_name, mark_function in pairs(marks) do + local trig = trigger .. "-" .. mark_name + + output[#output + 1] = todo_snippet(trig, name, comment_type, mark_function) + end + + return output +end + +local todo_snippet_specs = { + { { trig = "todo"; }; { "TODO"; }; { ctype = 1; }; }; + { { trig = "fix"; }; { "FIXME"; "ISSUE"; }; { ctype = 1; }; }; + { { trig = "hack"; }; { "HACK"; }; { ctype = 1; }; }; + { { trig = "warn"; }; { "WARNING"; }; { ctype = 1; }; }; + { { trig = "perf"; }; { "PERFORMANCE"; "OPTIMIZE"; }; { ctype = 1; }; }; + { { trig = "note"; }; { "NOTE"; "INFO"; }; { ctype = 1; }; }; + + -- NOTE: Block commented todo-comments + { { trig = "todob"; }; { "TODO"; }; { ctype = 2; }; }; + { { trig = "fixb"; }; { "FIXME"; "ISSUE"; }; { ctype = 2; }; }; + { { trig = "hackb"; }; { "HACK"; }; { ctype = 2; }; }; + { { trig = "warnb"; }; { "WARNING"; }; { ctype = 2; }; }; + { { trig = "perfb"; }; { "PERF"; "PERFORMANCE"; "OPTIM"; "OPTIMIZE"; }; { ctype = 2; }; }; + { { trig = "noteb"; }; { "NOTE"; "INFO"; }; { ctype = 2; }; }; +} + +local todo_comment_snippets = {} +for _, v in ipairs(todo_snippet_specs) do + local snippets = process_marks(v[1].trig, v[2][1], v[3].ctype) + for _, value in pairs(snippets) do + table.insert(todo_comment_snippets, value) + end +end + +ls.add_snippets("all", todo_comment_snippets, { type = "snippets"; key = "todo_comments"; }) +-- }}} + +-- spdx snippets {{{ +local generate_spdx_snippet = function(comment_type, spdx_license_expr, trigger) + assert(trigger, "context doesn't include a `trig` key which is mandatory") + assert(comment_type == 1 or comment_type == 2) + + local context = {} + context.name = trigger .. " spdx snippet expr" + context.trig = trigger + + + local nodes = { + fmt("{} SPDX-SnippetBegin {}", wrap_snippet_in_comments(comment_type, {})); + + fmt("{} SPDX-SnippetCopyrightText: {} {} <{}> {}", + wrap_snippet_in_comments(comment_type, { + ls.insert_node(1, "year"); + ls.insert_node(2, "author"); + ls.insert_node(3, "email"); + }) + ); + + fmt("{} SPDX-License-Identifier: {} {}", wrap_snippet_in_comments(comment_type, { + ls.text_node(spdx_license_expr); + })); + + { ls.insert_node(4, "content"); }; + + fmt("{} SPDX-SnippetEnd {}", wrap_snippet_in_comments(comment_type, {})); + + { ls.insert_node(0); }; + } + + local newline_nodes = {} + for _, sub_nodes in ipairs(nodes) do + for _, node in ipairs(sub_nodes) do + table.insert(newline_nodes, node) + end + + -- luasnip requires newlines to be encoded like this: + table.insert(newline_nodes, ls.text_node({ ""; ""; })) + end + + return ls.snippet(context, newline_nodes, { ctype = comment_type; }) +end + +local spdx = { + { trigger = "spdx-AGPL3+"; license = "AGPL-3.0-or-later"; }; + { trigger = "spdx-GPL3+"; license = "GPL-3.0-or-later"; }; + { trigger = "spdx-MIT"; license = "MIT"; }; +} + +local spdx_snippets = {} +for _, value in ipairs(spdx) do + local snippet = generate_spdx_snippet(1, value.license, value.trigger) + table.insert(spdx_snippets, snippet) + + snippet = generate_spdx_snippet(2, value.license, value.trigger .. "-block") + table.insert(spdx_snippets, snippet) +end + +ls.add_snippets("all", spdx_snippets, { type = "snippets"; key = "spdx_snippets"; }) +-- }}} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/delimiter.lua b/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/delimiter.lua new file mode 100644 index 00000000..bcd128f7 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/delimiter.lua @@ -0,0 +1,41 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + +local ls = require("luasnip") +local fmt = require("luasnip.extras.fmt").fmt + +local get_visual = function(_, parent) + if #parent.snippet.env.SELECT_RAW > 0 then + return ls.snippet_node(nil, ls.insert_node(1, parent.snippet.env.SELECT_RAW)) + else + return ls.snippet_node(nil, ls.insert_node(1, "")) + end +end + +local translation_table = { ["("] = ")"; ["{"] = "}"; ["["] = "]"; } + +-- Return snippet tables +return { + -- LEFT/RIGHT ALL BRACES + ls.snippet( + { + trig = "([^%a])l([%(%[%{])"; + regTrig = true; + wordTrig = false; + snippetType = "autosnippet"; + }, + fmt("{}\\left{}{}\\right{}", { + ls.function_node(function(_, snip) return snip.captures[1] end); + ls.function_node(function(_, snip) return snip.captures[2] end); + ls.dynamic_node(1, get_visual); + ls.function_node(function(_, snip) return translation_table[snip.captures[2]] end); + }) + ); +} diff --git a/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/greek.lua b/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/greek.lua new file mode 100644 index 00000000..21aa7414 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/luasnip/snippets/tex/greek.lua @@ -0,0 +1,49 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + +local ls = require("luasnip") + +-- Return snippet tables +return { + ls.snippet({ trig = ";a"; snippetType = "autosnippet"; }, { ls.text_node("\\alpha"); }); + ls.snippet({ trig = ";b"; snippetType = "autosnippet"; }, { ls.text_node("\\beta"); }); + ls.snippet({ trig = ";g"; snippetType = "autosnippet"; }, { ls.text_node("\\gamma"); }); + ls.snippet({ trig = ";G"; snippetType = "autosnippet"; }, { ls.text_node("\\Gamma"); }); + ls.snippet({ trig = ";d"; snippetType = "autosnippet"; }, { ls.text_node("\\delta"); }); + ls.snippet({ trig = ";D"; snippetType = "autosnippet"; }, { ls.text_node("\\Delta"); }); + ls.snippet({ trig = ";e"; snippetType = "autosnippet"; }, { ls.text_node("\\epsilon"); }); + ls.snippet({ trig = ";ve"; snippetType = "autosnippet"; }, { ls.text_node("\\varepsilon"); }); + ls.snippet({ trig = ";z"; snippetType = "autosnippet"; }, { ls.text_node("\\zeta"); }); + ls.snippet({ trig = ";h"; snippetType = "autosnippet"; }, { ls.text_node("\\eta"); }); + ls.snippet({ trig = ";o"; snippetType = "autosnippet"; }, { ls.text_node("\\theta"); }); + ls.snippet({ trig = ";vo"; snippetType = "autosnippet"; }, { ls.text_node("\\vartheta"); }); + ls.snippet({ trig = ";O"; snippetType = "autosnippet"; }, { ls.text_node("\\Theta"); }); + ls.snippet({ trig = ";k"; snippetType = "autosnippet"; }, { ls.text_node("\\kappa"); }); + ls.snippet({ trig = ";l"; snippetType = "autosnippet"; }, { ls.text_node("\\lambda"); }); + ls.snippet({ trig = ";L"; snippetType = "autosnippet"; }, { ls.text_node("\\Lambda"); }); + ls.snippet({ trig = ";m"; snippetType = "autosnippet"; }, { ls.text_node("\\mu"); }); + ls.snippet({ trig = ";n"; snippetType = "autosnippet"; }, { ls.text_node("\\nu"); }); + ls.snippet({ trig = ";x"; snippetType = "autosnippet"; }, { ls.text_node("\\xi"); }); + ls.snippet({ trig = ";X"; snippetType = "autosnippet"; }, { ls.text_node("\\Xi"); }); + ls.snippet({ trig = ";i"; snippetType = "autosnippet"; }, { ls.text_node("\\pi"); }); + ls.snippet({ trig = ";I"; snippetType = "autosnippet"; }, { ls.text_node("\\Pi"); }); + ls.snippet({ trig = ";r"; snippetType = "autosnippet"; }, { ls.text_node("\\rho"); }); + ls.snippet({ trig = ";s"; snippetType = "autosnippet"; }, { ls.text_node("\\sigma"); }); + ls.snippet({ trig = ";S"; snippetType = "autosnippet"; }, { ls.text_node("\\Sigma"); }); + ls.snippet({ trig = ";t"; snippetType = "autosnippet"; }, { ls.text_node("\\tau"); }); + ls.snippet({ trig = ";f"; snippetType = "autosnippet"; }, { ls.text_node("\\phi"); }); + ls.snippet({ trig = ";vf"; snippetType = "autosnippet"; }, { ls.text_node("\\varphi"); }); + ls.snippet({ trig = ";F"; snippetType = "autosnippet"; }, { ls.text_node("\\Phi"); }); + ls.snippet({ trig = ";c"; snippetType = "autosnippet"; }, { ls.text_node("\\chi"); }); + ls.snippet({ trig = ";p"; snippetType = "autosnippet"; }, { ls.text_node("\\psi"); }); + ls.snippet({ trig = ";P"; snippetType = "autosnippet"; }, { ls.text_node("\\Psi"); }); + ls.snippet({ trig = ";w"; snippetType = "autosnippet"; }, { ls.text_node("\\omega"); }); + ls.snippet({ trig = ";W"; snippetType = "autosnippet"; }, { ls.text_node("\\Omega"); }); +} diff --git a/modules/by-name/nv/nvim/plgs/neorg/default.nix b/modules/by-name/nv/nvim/plgs/neorg/default.nix index 03afb16c..ea451d3a 100644 --- a/modules/by-name/nv/nvim/plgs/neorg/default.nix +++ b/modules/by-name/nv/nvim/plgs/neorg/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -44,11 +53,7 @@ in { __empty = null; }; "core.dirman".config = { - workspaces = { - general = "~/repos/notes/general"; - journal = "~/repos/notes/journal"; - projects = "~/repos/notes/projects"; - }; + workspaces = { }; }; "core.export".config = { __empty = null; diff --git a/modules/by-name/nv/nvim/plgs/neorg/key_mappings.lua b/modules/by-name/nv/nvim/plgs/neorg/key_mappings.lua index e2ebb653..5391bf0b 100644 --- a/modules/by-name/nv/nvim/plgs/neorg/key_mappings.lua +++ b/modules/by-name/nv/nvim/plgs/neorg/key_mappings.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + -- Override some of my default key mappings to better integrate into neorg. -- They still to the same conceptual thing. diff --git a/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix b/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix index 8d61dbd7..315f3fc7 100644 --- a/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix +++ b/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, @@ -5,49 +14,82 @@ }: let cfg = config.soispha.programs.nvim; in { - home-manager.users.soispha.programs.nixvim.plugins.cmp = lib.mkIf cfg.enable { - /* - TODO: integrate this: - ```lua - enabled = { - function() - -- disable completion in comments - local context = require 'cmp.config.context' - -- keep command mode completion enabled when cursor is in a comment - -- te - if vim.api.nvim_get_mode().mode == 'c' then - return true - else - return not context.in_treesitter_capture("comment") - and not context.in_syntax_group("Comment") + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + opts.completeopt = [ + "menu" # Show completions in a menu + "menuone" # Also open menu, when only one completion exists + "noselect" # Do not pre select one of the completions + ]; + + keymaps = [ + { + key = "hh"; + mode = ["i"]; + action.__raw = '' + function() + require('cmp').select_next_item() end - end - }, - ``` - */ - enable = true; - autoEnableSources = true; - settings = { - mapping = { - # TODO: add support for desc and which key here - "<C-d>" = "cmp.mapping.scroll_docs(-4)"; # desc = "Scroll up by four lines" - "<C-f>" = "cmp.mapping.scroll_docs(4)"; # desc = "Scroll down by four lines" - "HH" = "cmp.mapping.complete()"; # desc = "Confirm snipped" - }; + ''; + options.desc = "go forward in completion menu"; + } + { + key = "uu"; + mode = ["i"]; + action.__raw = '' + function() + require('cmp').confirm() + end + ''; + options.desc = "confirm the selected item"; + } + + { + key = "<C-d>"; + mode = ["i"]; + action.__raw = '' + function() + require('cmp').mapping.scroll_docs(-4) + end + ''; + options.desc = "Scroll up by four lines"; + } + { + key = "<C-f>"; + mode = ["i"]; + action.__raw = '' + function() + require('cmp').mapping.scroll_docs(4) + end + ''; + options.desc = "Scroll down by four lines"; + } + ]; + + plugins.cmp = { + enable = true; + autoEnableSources = true; - snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + settings = { + mapping = {}; - sources = [ - {name = "nvim_lsp";} - {name = "luasnip";} - {name = "path";} - {name = "git";} # TODO: I might want to add config to allow all issues/prs <2023-10-16> - # {name = "convertionalcommits";} # TODO: Useless without commitlint [https://commitlint.js.org/] <2023-10-16> - # {name = "rg";} # TODO: This might really RIP-grep my system <2023-10-16> - # {name = "buffer";} - # {name = "digraphs";} - {name = "calc";} - ]; + snippet.expand.__raw = '' + function(args) + require('luasnip').lsp_expand(args.body) + end + ''; + + sources = [ + {name = "nvim_lsp";} + {name = "luasnip";} + {name = "path";} + {name = "git";} # TODO: I might want to add config to allow all issues/prs <2023-10-16> + # {name = "convertionalcommits";} # TODO: Useless without commitlint [https://commitlint.js.org/] <2023-10-16> + # {name = "rg";} # TODO: This might really RIP-grep my system <2023-10-16> + # {name = "buffer";} + # {name = "digraphs";} + {name = "calc";} + ]; + }; }; }; } diff --git a/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix b/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix index ee057a9b..90e81832 100644 --- a/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix +++ b/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, diff --git a/modules/by-name/nv/nvim/plgs/nvim-lint/lua/nvim-lint.lua b/modules/by-name/nv/nvim/plgs/nvim-lint/lua/nvim-lint.lua index 770c3bb5..5b5fd4b8 100644 --- a/modules/by-name/nv/nvim/plgs/nvim-lint/lua/nvim-lint.lua +++ b/modules/by-name/nv/nvim/plgs/nvim-lint/lua/nvim-lint.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + require("lint").linters_by_ft = { -- text markdown = {}, diff --git a/modules/by-name/nv/nvim/plgs/raw_plugins/default.nix b/modules/by-name/nv/nvim/plgs/raw_plugins/default.nix index e5d401a0..c981ee08 100644 --- a/modules/by-name/nv/nvim/plgs/raw_plugins/default.nix +++ b/modules/by-name/nv/nvim/plgs/raw_plugins/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/telescope/default.nix b/modules/by-name/nv/nvim/plgs/telescope/default.nix index 193ee1ac..b2c66edc 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix b/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix index 11d04304..7cfe9698 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix index 8eee9a27..693db974 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {config, ...}: let cfg = config.soispha.programs.nvim; in { diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/tex.lua b/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/tex.lua index 4107a7c5..fbe7c993 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/tex.lua +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/tex.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + -- local used = false; -- vim.keymap.set('n', '<leader>t', function() -- used = not used; diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix index 0b1e033a..0b0ed0f6 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { imports = [ ./bibtex diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix index f4e3d116..3d5eae99 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix index 4194e688..7a2fc164 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix index 6153b063..4d91e988 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua b/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua index 48a8588d..b6542429 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua @@ -1,3 +1,13 @@ +-- nixos-config - My current NixOS configuration +-- +-- Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +-- 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + -- Taken from: https://github.com/desdic/telescope-rooter.nvim/blob/69423216c75a5f1f1477bbf8faf6b0dc8af04099/lua/telescope/_extensions/rooter.lua local has_telescope, telescope = pcall(require, "telescope") if not has_telescope then diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix index adbb466a..1f82523d 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, config, diff --git a/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix b/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix index a474f097..d5cc55f5 100644 --- a/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/todo-comments/default.nix b/modules/by-name/nv/nvim/plgs/todo-comments/default.nix index ddbe367d..cd1a7dbf 100644 --- a/modules/by-name/nv/nvim/plgs/todo-comments/default.nix +++ b/modules/by-name/nv/nvim/plgs/todo-comments/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/treesitter/default.nix b/modules/by-name/nv/nvim/plgs/treesitter/default.nix index 02088d0a..c8b48cd1 100644 --- a/modules/by-name/nv/nvim/plgs/treesitter/default.nix +++ b/modules/by-name/nv/nvim/plgs/treesitter/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, pkgs, @@ -6,15 +15,17 @@ }: let cfg = config.soispha.programs.nvim; in { - home-manager.users.soispha. programs.nixvim = lib.mkIf cfg.enable { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + # NOTE: These are required to build grammars, but I already use the nix grammars <2024-07-13> + dependencies = { + tree-sitter.enable = false; + nodejs.enable = false; + gcc.enable = false; + }; + plugins.treesitter = { enable = true; - # NOTE: These are required to build grammars, but I already use the nix grammars <2024-07-13> - gccPackage = null; - nodejsPackage = null; - treesitterPackage = null; - # inject nixvim specific highlighting (eg in extraConfigLua). nixvimInjections = true; diff --git a/modules/by-name/nv/nvim/plgs/vim-tex/default.nix b/modules/by-name/nv/nvim/plgs/vim-tex/default.nix index 680f169a..739b69d9 100644 --- a/modules/by-name/nv/nvim/plgs/vim-tex/default.nix +++ b/modules/by-name/nv/nvim/plgs/vim-tex/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/nv/nvim/plgs/which-key/default.nix b/modules/by-name/nv/nvim/plgs/which-key/default.nix index 20004bb1..e5bca546 100644 --- a/modules/by-name/nv/nvim/plgs/which-key/default.nix +++ b/modules/by-name/nv/nvim/plgs/which-key/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/ol/ollama/module.nix b/modules/by-name/ol/ollama/module.nix index 7a4e8038..f819c035 100644 --- a/modules/by-name/ol/ollama/module.nix +++ b/modules/by-name/ol/ollama/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/op/openssh/module.nix b/modules/by-name/op/openssh/module.nix index b733dbe7..97cf7fd7 100644 --- a/modules/by-name/op/openssh/module.nix +++ b/modules/by-name/op/openssh/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. {...}: { services.openssh = { enable = true; diff --git a/modules/by-name/pi/printing/module.nix b/modules/by-name/pi/printing/module.nix index 85d15b16..cfcd2154 100644 --- a/modules/by-name/pi/printing/module.nix +++ b/modules/by-name/pi/printing/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/po/polkit/module.nix b/modules/by-name/po/polkit/module.nix index fb13505b..c6d1c750 100644 --- a/modules/by-name/po/polkit/module.nix +++ b/modules/by-name/po/polkit/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/po/postgresql/module.nix b/modules/by-name/po/postgresql/module.nix index 62233e96..5cdf6c77 100644 --- a/modules/by-name/po/postgresql/module.nix +++ b/modules/by-name/po/postgresql/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/po/power/module.nix b/modules/by-name/po/power/module.nix index 13013879..3489853c 100644 --- a/modules/by-name/po/power/module.nix +++ b/modules/by-name/po/power/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/ri/river/init_base.sh b/modules/by-name/ri/river/init_base.sh index 938b46b1..b68d147b 100755 --- a/modules/by-name/ri/river/init_base.sh +++ b/modules/by-name/ri/river/init_base.sh @@ -1,7 +1,17 @@ #!/usr/bin/env sh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # NOTE: Keep this in sync with the file from `river-start` <2025-02-03> -RIVER_LOG_FILE="$HOME/.local/share/river/log" +RIVER_LOG_FILE="$HOME/.cache/river/log" err_fail() { if ! "$@"; then diff --git a/modules/by-name/ri/river/module.nix b/modules/by-name/ri/river/module.nix index 139e8b66..38d4bdef 100644 --- a/modules/by-name/ri/river/module.nix +++ b/modules/by-name/ri/river/module.nix @@ -1,9 +1,18 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, - qmk_firmware, system, pkgs, + externalBinaries, ... }: let cfg = config.soispha.programs.river; @@ -167,7 +176,7 @@ in { }; config = lib.mkIf cfg.enable { - services.udev.packages = lib.mkIf cfg.unicodeInput.enable [qmk_firmware.packages.${system}.qmk_unicode_type]; + services.udev.packages = lib.mkIf cfg.unicodeInput.enable [externalBinaries.qmk_firmware.packages.${system}.qmk_unicode_type]; home-manager.users.soispha = { home.sessionVariables = { @@ -184,7 +193,7 @@ in { }; home.packages = [ - pkgs.river-start + (pkgs.callPackage ./river-start/package.nix {}) ]; xdg.configFile."river/init" = { diff --git a/modules/by-name/ri/river/river-start/package.nix b/modules/by-name/ri/river/river-start/package.nix new file mode 100644 index 00000000..10957cc0 --- /dev/null +++ b/modules/by-name/ri/river/river-start/package.nix @@ -0,0 +1,23 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + writeShellApplication, + river, +}: +writeShellApplication { + name = "river-start"; + text = builtins.readFile ./river-start.sh; + runtimeInputs = [ + river + ]; + meta = { + mainProgram = "river-start"; + }; +} diff --git a/modules/by-name/ri/river/river-start/river-start.sh b/modules/by-name/ri/river/river-start/river-start.sh new file mode 100755 index 00000000..b4c5b0a6 --- /dev/null +++ b/modules/by-name/ri/river/river-start/river-start.sh @@ -0,0 +1,20 @@ +#! /usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# NOTE: Keep this in sync with the file from `base_init.sh` <2025-02-03> +RIVER_LOG_FILE="$HOME/.cache/river/log" + +[ -d "$(dirname "$RIVER_LOG_FILE")" ] || mkdir --parents "$(dirname "$RIVER_LOG_FILE")" + +exec river -log-level info >"$RIVER_LOG_FILE" 2>&1 + +# vim: ft=sh diff --git a/modules/by-name/sc/scanning/module.nix b/modules/by-name/sc/scanning/module.nix index dda507fa..30e99bd1 100644 --- a/modules/by-name/sc/scanning/module.nix +++ b/modules/by-name/sc/scanning/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/se/serverphone/certificates/ca.crt.license b/modules/by-name/se/serverphone/certificates/ca.crt.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/se/serverphone/certificates/ca.crt.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/se/serverphone/certificates/server.crt.license b/modules/by-name/se/serverphone/certificates/server.crt.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/se/serverphone/certificates/server.crt.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/se/serverphone/module.currently_ignored.nix b/modules/by-name/se/serverphone/module.currently_ignored.nix index aaa818c2..f7280bed 100644 --- a/modules/by-name/se/serverphone/module.currently_ignored.nix +++ b/modules/by-name/se/serverphone/module.currently_ignored.nix @@ -1,13 +1,33 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, serverphone, system, lib, + modules, ... -}: { +}: let + cfg = config.soispha.serverphone; +in { # FIXME: Reactive this module, when serverphone is working again <2024-05-11> - config = lib.mkIf config.soispha.secrets.enable { + options.soispha.serverphone = { + enable = lib.mkEnableOption "serverphone"; + }; + + imports = [ + modules.serverphone.nixosModules.default + ]; + + config = lib.mkIf cfg.enable { age.secrets = { serverphoneCa = { file = ./private_keys/ca.key; diff --git a/modules/by-name/se/serverphone/private_keys/ca.key.license b/modules/by-name/se/serverphone/private_keys/ca.key.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/se/serverphone/private_keys/ca.key.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/se/serverphone/private_keys/server.key.license b/modules/by-name/se/serverphone/private_keys/server.key.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/se/serverphone/private_keys/server.key.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/sn/snapper/module.nix b/modules/by-name/sn/snapper/module.nix index bf8201a4..c232a177 100644 --- a/modules/by-name/sn/snapper/module.nix +++ b/modules/by-name/sn/snapper/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/so/sound/module.nix b/modules/by-name/so/sound/module.nix index 8b519f09..622cc01d 100644 --- a/modules/by-name/so/sound/module.nix +++ b/modules/by-name/so/sound/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/ss/ssh/module.nix b/modules/by-name/ss/ssh/module.nix new file mode 100644 index 00000000..91cc4aeb --- /dev/null +++ b/modules/by-name/ss/ssh/module.nix @@ -0,0 +1,55 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.programs.ssh; +in { + options.soispha.programs.ssh = { + enable = lib.mkEnableOption "ssh config"; + rootKnownHosts = lib.mkOption { + type = lib.types.attrsOf lib.types.str; + description = '' + An attrset of keys (the domain) and values (the host key.) + These are only applied to the root user. + ''; + default = {}; + apply = value: + builtins.concatStringsSep "\n" + (lib.attrsets.mapAttrsToList (hostName: hostKey: "${hostName} ${hostKey}") value); + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users = { + root.programs.ssh = { + enable = true; + compression = true; + hashKnownHosts = false; + serverAliveInterval = 240; + userKnownHostsFile = builtins.toString (pkgs.writeTextFile { + name = "root-known-hosts"; + text = cfg.rootKnownHosts; + }); + }; + + soispha.programs.ssh = { + enable = true; + compression = true; + hashKnownHosts = false; + serverAliveInterval = 240; + userKnownHostsFile = "${config.home-manager.users.soispha.xdg.dataHome}/ssh/known_hosts"; + }; + }; + }; +} diff --git a/modules/by-name/st/steam/module.nix b/modules/by-name/st/steam/module.nix index 49149cd7..a02b2e4b 100644 --- a/modules/by-name/st/steam/module.nix +++ b/modules/by-name/st/steam/module.nix @@ -1,23 +1,42 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, pkgs, ... }: let - cfg = config.soispha.services.steam; + cfg = config.soispha.programs.steam; in { - options.soispha.services.steam = { + options.soispha.programs.steam = { enable = lib.mkEnableOption "Steam"; }; config = lib.mkIf cfg.enable { + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + # NOTE: These are not really applied. Look at + # <modules/by-name/ni/nixpkgs/config.nix> instead. <2025-04-25> + "steam" + "steam-unwrapped" + "steam-original" + "steam-run" + ]; + programs.steam = { enable = true; }; environment.systemPackages = [ # TODO: Why is this package needed? <2024-05-16> - pkgs.wineWowPackages.waylandFull + # pkgs.wineWowPackages.waylandFull ]; }; } diff --git a/modules/by-name/sw/swaylock/images/GTDcanonical.png.license b/modules/by-name/sw/swaylock/images/GTDcanonical.png.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/sw/swaylock/images/GTDcanonical.png.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/sw/swaylock/images/commands.jpg.license b/modules/by-name/sw/swaylock/images/commands.jpg.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/sw/swaylock/images/commands.jpg.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/sw/swaylock/images/duwon-lee-tempano-port.jpg.license b/modules/by-name/sw/swaylock/images/duwon-lee-tempano-port.jpg.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/sw/swaylock/images/duwon-lee-tempano-port.jpg.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/sw/swaylock/images/gnu.png.license b/modules/by-name/sw/swaylock/images/gnu.png.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/sw/swaylock/images/gnu.png.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/sw/swaylock/module.nix b/modules/by-name/sw/swaylock/module.nix index fc296de7..ab18f41b 100644 --- a/modules/by-name/sw/swaylock/module.nix +++ b/modules/by-name/sw/swaylock/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/sy/system_diff/module.nix b/modules/by-name/sy/system_diff/module.nix index 052ffae2..cc2ec75c 100644 --- a/modules/by-name/sy/system_diff/module.nix +++ b/modules/by-name/sy/system_diff/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/ta/taskwarrior/module.nix b/modules/by-name/ta/taskwarrior/module.nix index c5549ac9..bb881768 100644 --- a/modules/by-name/ta/taskwarrior/module.nix +++ b/modules/by-name/ta/taskwarrior/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, @@ -67,6 +76,8 @@ in { options.soispha.programs.taskwarrior = { enable = lib.mkEnableOption "taskwarrior"; + enableAge = lib.mkEnableOption "taskwarrior with age keys"; + includeFiles = lib.mkOption { type = lib.types.attrsOf lib.types.path; description = "Extra files to include in the taskwarrior config"; @@ -99,8 +110,17 @@ in { inherit mkHook; }; + age.secrets.taskwarrior_sync_server_encryption_key = lib.mkIf (cfg.enable && cfg.enableAge) { + file = ./secrets/sync_server_encryption_key.age; + mode = "700"; + owner = "soispha"; + group = "users"; + }; + + soispha.programs.taskwarrior.includeFiles.syncServerSecret = lib.mkIf (cfg.enable && cfg.enableAge) config.age.secrets.taskwarrior_sync_server_encryption_key.path; + home-manager.users.soispha = lib.mkIf cfg.enable { - services.taskwarrior-sync = { + services.taskwarrior-sync = lib.mkIf cfg.enableAge { enable = true; package = pkgs.taskwarrior3; }; @@ -118,6 +138,8 @@ in { tags = true; }; + news.version = "3.4.1"; + regex = true; weekstart = "Monday"; @@ -128,6 +150,11 @@ in { }; }; + sync.server = lib.mkIf cfg.enableAge { + client_id = "a3619d43-031f-4f85-848f-5512804f9a1d"; + url = "https://taskchampion.vhack.eu"; + }; + alias = { mod = "modify"; }; diff --git a/modules/by-name/ta/taskwarrior/nord.theme.license b/modules/by-name/ta/taskwarrior/nord.theme.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/ta/taskwarrior/nord.theme.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/ta/taskwarrior/secrets/sync_server_encryption_key.age b/modules/by-name/ta/taskwarrior/secrets/sync_server_encryption_key.age new file mode 100644 index 00000000..1e1a252e --- /dev/null +++ b/modules/by-name/ta/taskwarrior/secrets/sync_server_encryption_key.age @@ -0,0 +1,41 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBhUEkzOWlvdU00NnVYcVN1 +TjZMMWUwY3l1c1JEbUFHZFZtcmZ2YWU2VVRnCjYzS3ZrNC9Nc2J2d1Nxc0FtbHM1 +WGJjenE5UFhROGxOdVhka2ZCcm04TUEKLT4gc3NoLWVkMjU1MTkgelpFb25nIEpk +LysxejJOcnNJNEpxWnQzcEd5YWlhTEUreS90R1hiNlRYNmJQTGRYSE0KeU0yVEZy +WTcrZVRiUjZyWFdQWTVTak9Ua3dwZ3pKZXBCRHJhMXN1UElXRQotPiBzc2gtZWQy +NTUxOSA3SGZGVXcgUHlFZnkrd3RuN3ROK1lmdG1hcGJHZmFPMENOTjNMdndsSEJL +VDRNL0pCdwo0MmZIRTlTeWFNM2Q5NW1ja1hwY0dCOUg5YUhHYzVkWGlta2ZSTWI3 +aHVvCi0+IFkrRC1ncmVhc2UgNGZkCk5KSzd2RjhIaUFnMHFFeVhOcFM3MktEWERI +cUY1dlY4SDA0Ci0tLSBtSi9zUkdQV0xWMlA4SUtEeGJCeTRGZmFpbC9EMUN3ZVRQ +YXIzaXNWS3lJCitm6obeMX9iJ9HZ48/kS0qt6PjOI5iWfag3oiBVhUAaab3P42KM +KS3Vi1nTKXR5FHigy84Z10uV2apxq73g9uwD97IPH7APyeQsibs6q5aJXmntBYLi +bROu9pSHSYHUrOMHL3hrzs/9bbmS0TXPm1q9ixem2Zm93z96AJQ95IunaeNtA1ya +UooQ2MtYWtLkbj7Z78PydKzqMYsk1zBehBFfHbdyVenDAoaTXpzhRBCGgRmDvvNA +vL/7GKOXLg7Djh8DR4sPXYt3d07DXkrFsxF9GgA+dmhCIMmS6KCldyAfRLHQaYjb +5WQ/Xmx0MpZwdMNF8AWNX7U2/ZlfJwH4zSZ1SMPYgKqbk4FxzktY5BVsGCyq7aqz +fU8EgoIAU3wio6GLWnvwI6AA0evowooUkHncmBDIFTfNY64wD8KeYyz0EiLOfOLd +tjnnzzl2u6aWN8nOToRDDTzVIJg3mQNJjgxZF8G7iJh4WtGYyhrldgcefrGfFRP9 +ZoNj5JhWsNA96KrfdFZPTH1RKZsDd631UEpkP5aA3wv1mzK4D+R0tuttc6AD5Gk7 +QlwSz86OUN4hDGbUEGtRt9WBt34VkFLeH4WgPP6trkXGr8gtGHBnxLzl1JgssmC1 +evoz/jHUDT2f3/gFfe6mZFIMgEuibmL18vQ9FUYfZsigMzvkOTnpIbKX8FXm4Hfy +/4qi8q6rqrwRttDuzX1mK0frqx7MIIUp45UvemfJVN7qDB4IrKBfjw5ICy3gifx3 +7dVgjXBmGAzGkzXk2PtRUscSHW9r21cMICwRsDRM4dawTF1Rk0pkkkureZ0fnLNv +krhmv5SQEEWILm+hkg2963a4osbeHIMQnRiPd3wgfhTcd0peNq+E+S1+w5/3+R5M +Cc4JbHbYiHxCcfhFNI5iPkQVm4lMWi53YvPrweLw09+IGpUwTVB4jN3q2qvlCGeF +7n615QH8xchMxKfB4fwa7uXo5T8phYo31KguPBYX94vJPK/R6mR9WUnq8//+m6VD +n9SDSrSYUq/ckCbQkPAWnBzwUzm9Ykok9XKPbdMfeeyMc8wQ/FaXNoofvkWiCTDp +BVYNrlQUnRavmjTW6r8CMz/PIRCk3MzTeMX8nvpxeMALBTJjKGt1ZPaCTiObAcBh +QDrohH6c/iRQu1ZmaKwtcDfwJKNAnsqnZWWwfFayV/PXvVl5jgwYpwJYbC/Pu7Km +ssdrpCcW/O48L861lw7wF5f4Fneo/ZbSx0erGTviYqiaoRgLaeEhMBZZFhdENHbS +MDJ24qu3qHl/h725edpmiAMziD5jeE9oBUvh7JkhVobc87dFpBHC6znseRlIpr+J +8csSU8mQEAHy7tW9PGK4wZLVGQr9mpADyYgYpow3X6HNuX/DHqzs0GDHanG4uOiF +vSeW2YADEU7O1focnfFGBhEMzbbNVfSBmvcU0avGa2ZajW1h6S2JpfDPsyQfC6Xr +4LmRL+myH0V9i72m9kChsDuQPHGRYBW+iQctoYalXzPFrU7Kpl+/yURecV7JI/v5 +ujHtGPgzvfqTEama/PGbjxC0kVQ9TayPB7ymIjjJquBYKTW74S/exvpYbZz8vN1B +xcwyd7TeMdRYI2nfuI82Q13WoLdLUEW1O5VXPxTm+5pnYbvxfipR4S45+U3tbaaE +YNy26DiZEKUXdyL5Jd+LlArXJXSLd5lzJXs+h8YeogxjtJ7PMmUqmtUDj6PCDrsF +54T5sTGjO2w7QSanwsXgALRgBQpvPTniFpFBllSH44Nj9B2LybmbWIyph67FeIeM +p+YedymnlewwiM2nGcjY/Zs/abdrQwnnKsgkWRGRAHHxhV0pamXfdoZJZEHzebWU +u5iGa9slaCAJxuLs5DQ940e8VFESEwM+e0AECwRmCf+1YazXemiJ+w== +-----END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/ti/timewarrior/module.nix b/modules/by-name/ti/timewarrior/module.nix index f33d02be..90a541d8 100644 --- a/modules/by-name/ti/timewarrior/module.nix +++ b/modules/by-name/ti/timewarrior/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/ti/timewarrior/nord.theme.license b/modules/by-name/ti/timewarrior/nord.theme.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/ti/timewarrior/nord.theme.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-timewarrior.py b/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-timewarrior.py index 0bef8bc2..3b42b3f2 100755 --- a/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-timewarrior.py +++ b/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-timewarrior.py @@ -1,30 +1,15 @@ #!/usr/bin/env python3 -############################################################################### +# nixos-config - My current NixOS configuration # +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> # Copyright 2016 - 2021, 2023, Gothenburg Bit Factory +# SPDX-License-Identifier: GPL-3.0-or-later # -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: +# This file is part of my nixos-config. # -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# https://www.opensource.org/licenses/mit-license.php -# -############################################################################### +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. import json import subprocess diff --git a/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-total-active-time.py b/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-total-active-time.py index 0b6be082..303a5c57 100755 --- a/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-total-active-time.py +++ b/modules/by-name/ti/timewarrior/taskwarrior_hooks/on-modify.track-total-active-time.py @@ -1,8 +1,17 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +# nixos-config - My current NixOS configuration +# # Copyright (C) 2016-present Arctic Ice Studio <development@arcticicestudio.com> # Copyright (C) 2016-present Sven Greb <development@svengreb.de> +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. # Project: igloo # Repository: https://github.com/arcticicestudio/igloo diff --git a/modules/by-name/ts/tskm/module.nix b/modules/by-name/ts/tskm/module.nix index 51be48fe..9bf2b389 100644 --- a/modules/by-name/ts/tskm/module.nix +++ b/modules/by-name/ts/tskm/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, @@ -110,7 +119,7 @@ in { home-manager.users.soispha = { home.sessionVariables = { # TODO: Remove this hard-coded path with a reference. <2025-04-04> - "TSKM_PROJECT_FILE" = "/home/soispha/repos/nix/config/modules/common/projects.json"; + "TSKM_PROJECT_FILE" = "/home/soispha/repos/nix/own/config/modules/common/projects.json"; }; programs.nixvim = { diff --git a/modules/by-name/ts/tskm/taskwarrior_hooks/enforce-projects.sh b/modules/by-name/ts/tskm/taskwarrior_hooks/enforce-projects.sh index 217e6052..c3e377c0 100755 --- a/modules/by-name/ts/tskm/taskwarrior_hooks/enforce-projects.sh +++ b/modules/by-name/ts/tskm/taskwarrior_hooks/enforce-projects.sh @@ -1,5 +1,15 @@ #!/usr/bin/env sh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + new_task="$1" project="$(echo "$new_task" | jq '.project' --raw-output)" diff --git a/modules/by-name/un/unison/module.nix b/modules/by-name/un/unison/module.nix index 9de27c0f..8d156b00 100644 --- a/modules/by-name/un/unison/module.nix +++ b/modules/by-name/un/unison/module.nix @@ -1,13 +1,21 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, config, pkgs, - sysLib, ... }: let cfg = config.soispha.services.unison; - script = import ./shellScript.nix {inherit sysLib lib pkgs cfg;}; + script = import ./shellScript.nix {inherit lib pkgs cfg;}; in { options.soispha.services.unison = let homePath = lib.types.strMatching "^~.*"; diff --git a/modules/by-name/un/unison/shellScript.nix b/modules/by-name/un/unison/shellScript.nix index 4618ae8e..df373805 100644 --- a/modules/by-name/un/unison/shellScript.nix +++ b/modules/by-name/un/unison/shellScript.nix @@ -1,5 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { - sysLib, lib, pkgs, cfg, @@ -60,7 +68,7 @@ lib.strings.concatStringsSep " " [ "unison" "${serialiseArgs cfg.unisonOptions}" - "$EXTRA_OPTIONS" + "\"$@\"" "${getIgnored cfg.pathsToIgnore path}" "${esa path}" (esa "ssh://${cfg.foreign.userName}@${cfg.foreign.address}/${path}") @@ -68,24 +76,18 @@ script = lib.strings.concatStringsSep "\n" (builtins.map mkScriptLine cfg.pathsToSync); in - sysLib.writeShellScript { + pkgs.writeShellApplication { name = "unison-sync"; - src = builtins.toFile "unison-backup" ('' - #!/usr/bin/env dash + text = script; - # shellcheck source=/dev/null - SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - - export UNISON=${esa cfg.dataDir}; - - EXTRA_OPTIONS="$UNISON_EXTRA_OPTIONS $*" - '' - + script); + runtimeEnv = { + UNISON = cfg.dataDir; + }; - dependencies = with pkgs; [ - unison - openssh # needed to connect to the other server - less # needed to show diffs - diffutils # needed to compute diffs + runtimeInputs = [ + pkgs.unison + pkgs.openssh # needed to connect to the other server + pkgs.less # needed to show diffs + pkgs.diffutils # needed to compute diffs ]; } diff --git a/modules/by-name/us/users/module.nix b/modules/by-name/us/users/module.nix index a44df7e8..555e61f9 100644 --- a/modules/by-name/us/users/module.nix +++ b/modules/by-name/us/users/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, pkgs, @@ -8,6 +17,7 @@ in { options.soispha.users = { enable = lib.mkEnableOption "user set-up for soispha"; + hashedPassword = lib.mkOption { type = lib.types.str; example = lib.literalExpression "$y$jFT$ONrCqZIJKB7engmfA4orD/$0GO58/wV5wrYWj0cyONhyujZPjFmbT0XKtx2AvXLG0B"; @@ -31,19 +41,42 @@ in { users = { mutableUsers = false; - users.soispha = { - isNormalUser = true; - home = "/home/soispha"; - createHome = true; - shell = pkgs.zsh; - initialHashedPassword = cfg.hashedPassword; - extraGroups = cfg.groups ++ lib.optional cfg.enableDeprecatedPlugdev "plugdev"; - - uid = 1000; - openssh.authorizedKeys.keys = [ - # TODO: This should be parameterized. <2024-05-16> - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIME4ZVa+IoZf6T3U08JG93i6QIAJ4amm7mkBzO14JSkz" - ]; + users = { + soispha = { + isNormalUser = true; + home = "/home/soispha"; + createHome = true; + shell = pkgs.zsh; + initialHashedPassword = cfg.hashedPassword; + extraGroups = cfg.groups ++ lib.optional cfg.enableDeprecatedPlugdev "plugdev"; + + uid = 1000; + openssh.authorizedKeys.keys = [ + # TODO: This should be parameterized. <2024-05-16> + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIME4ZVa+IoZf6T3U08JG93i6QIAJ4amm7mkBzO14JSkz" + ]; + }; + + root = { + hashedPassword = lib.mkForce null; # to lock root + openssh.authorizedKeys.keys = lib.mkForce []; + }; + }; + }; + + 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; }; }; }; diff --git a/modules/by-name/ve/version/module.nix b/modules/by-name/ve/version/module.nix index 77cada14..fc03b107 100644 --- a/modules/by-name/ve/version/module.nix +++ b/modules/by-name/ve/version/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/wa/water-reminder/module.nix b/modules/by-name/wa/water-reminder/module.nix new file mode 100644 index 00000000..76e5aafa --- /dev/null +++ b/modules/by-name/wa/water-reminder/module.nix @@ -0,0 +1,66 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.services.water-reminder; +in { + options.soispha.services.water-reminder = { + enable = lib.mkEnableOption "periodic reminder for water intake"; + + frequency = lib.mkOption { + type = lib.types.str; + default = "*-*-* *:00/30:00"; # Every 30 minutes + description = '' + How often to remind. This value is passed to the systemd + timer configuration as the `OnCalendar` option. See + {manpage}`systemd.time(7)` for more information about the format. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + systemd.user.services.water-reminder = { + Unit = {Description = "Water reminder";}; + Service = { + CPUSchedulingPolicy = "idle"; + IOSchedulingClass = "idle"; + ExecStart = lib.getExe ( + pkgs.writeShellApplication { + name = "water-reminder"; + + inheritPath = false; + runtimeInputs = [pkgs.libnotify]; + + text = + # bash + '' + notify-send 'Seek fluid intake' 'Water intake required' --wait --expire-time=0 --urgency=critical + ''; + } + ); + }; + }; + + systemd.user.timers.water-reminder = { + Unit = {Description = "periodic reminder for water intake";}; + Timer = { + Unit = "water-reminder.service"; + OnCalendar = cfg.frequency; + }; + Install = {WantedBy = ["timers.target"];}; + }; + }; + }; +} diff --git a/modules/by-name/wa/waydroid/module.nix b/modules/by-name/wa/waydroid/module.nix index 58bce7d1..a55ccf90 100644 --- a/modules/by-name/wa/waydroid/module.nix +++ b/modules/by-name/wa/waydroid/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/xd/xdg/module.nix b/modules/by-name/xd/xdg/module.nix index f1781d86..94c5a975 100644 --- a/modules/by-name/xd/xdg/module.nix +++ b/modules/by-name/xd/xdg/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { pkgs, lib, @@ -38,6 +47,8 @@ in { config = lib.mkIf cfg.enable { home-manager.users.soispha = { xdg = { + configFile."xdg-desktop-portal-termfilechooser/config".source = tfcConfigFile; + desktopEntries = { url-handler = { name = "url-handler"; @@ -107,8 +118,6 @@ in { }; }; - environment.etc."xdg/xdg-desktop-portal-termfilechooser/config".source = tfcConfigFile; - systemd.user.services.xdg-desktop-portal-termfilechooser = { serviceConfig.ExecStart = [ "" diff --git a/modules/by-name/xd/xdg/scripts/lf-wrapper.sh b/modules/by-name/xd/xdg/scripts/lf-wrapper.sh index f85f7bac..6a5c5295 100755 --- a/modules/by-name/xd/xdg/scripts/lf-wrapper.sh +++ b/modules/by-name/xd/xdg/scripts/lf-wrapper.sh @@ -1,4 +1,15 @@ #!/usr/bin/env sh + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # This wrapper script is invoked by xdg-desktop-portal-termfilechooser. # # For more information about input/output arguments read `xdg-desktop-portal-termfilechooser(5)` diff --git a/modules/by-name/xd/xdg/scripts/url-handler.sh b/modules/by-name/xd/xdg/scripts/url-handler.sh index 5aa01a48..b3563349 100755 --- a/modules/by-name/xd/xdg/scripts/url-handler.sh +++ b/modules/by-name/xd/xdg/scripts/url-handler.sh @@ -1,8 +1,18 @@ #!/usr/bin/env sh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + project="$({ tskm projects list - echo nvim zathura + printf "%s\n" nvim zathura } | rofi -sep "$(printf "\n")" -dmenu)" if [ "$project" = "nvim" ]; then @@ -10,9 +20,10 @@ if [ "$project" = "nvim" ]; then elif [ "$project" = "zathura" ]; then zathura "$1" elif [ "$project" ]; then - tskm open "$project" "$1" + tskm open project "$project" "$1" else - notify-send "(URL HANDLER) No project selected"; exit 1 + notify-send "(URL HANDLER) No project selected" + exit 1 fi # vim: ft=sh diff --git a/modules/by-name/ya/yambar/config/config.yml b/modules/by-name/ya/yambar/config/config.yml index 442135aa..14da18fd 100644 --- a/modules/by-name/ya/yambar/config/config.yml +++ b/modules/by-name/ya/yambar/config/config.yml @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + --- # Config file for yambar # Note that this may be version-dependent, this file is written for v1.8.0 diff --git a/modules/by-name/ya/yambar/module.nix b/modules/by-name/ya/yambar/module.nix index 2d0f1e97..40edf978 100644 --- a/modules/by-name/ya/yambar/module.nix +++ b/modules/by-name/ya/yambar/module.nix @@ -1,6 +1,14 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, - sysLib, pkgs, lib, ... @@ -12,12 +20,11 @@ dependencies, ... }: - sysLib.writeShellScript { + lib.getExe (pkgs.writeShellApplication { inherit name; - src = ./scripts/${name}.sh; - dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;}); - } - + "/bin/${name}"; + text = builtins.readFile ./scripts/${name}.sh; + runtimeInputs = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;}); + }); mkWrapper = bin: cmd: pkgs.writeShellScript cmd '' diff --git a/modules/by-name/ya/yambar/scripts/disk.sh b/modules/by-name/ya/yambar/scripts/disk.sh index a5547a74..4efe1384 100755 --- a/modules/by-name/ya/yambar/scripts/disk.sh +++ b/modules/by-name/ya/yambar/scripts/disk.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH diff --git a/modules/by-name/ya/yambar/scripts/mpd_song_name.sh b/modules/by-name/ya/yambar/scripts/mpd_song_name.sh index 7d294781..5c288d1a 100755 --- a/modules/by-name/ya/yambar/scripts/mpd_song_name.sh +++ b/modules/by-name/ya/yambar/scripts/mpd_song_name.sh @@ -1,5 +1,15 @@ #!/usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH diff --git a/modules/by-name/ya/yambar/scripts/network.sh b/modules/by-name/ya/yambar/scripts/network.sh index adfc93df..d642e6c7 100755 --- a/modules/by-name/ya/yambar/scripts/network.sh +++ b/modules/by-name/ya/yambar/scripts/network.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH diff --git a/modules/by-name/ya/yambar/scripts/sound-volume.sh b/modules/by-name/ya/yambar/scripts/sound-volume.sh index 8a98daf7..9d9f7be8 100755 --- a/modules/by-name/ya/yambar/scripts/sound-volume.sh +++ b/modules/by-name/ya/yambar/scripts/sound-volume.sh @@ -1,5 +1,15 @@ #! /usr/bin/env dash +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH diff --git a/modules/by-name/ya/yambar/settings/default.nix b/modules/by-name/ya/yambar/settings/default.nix index 52c3d1f7..ebe17261 100644 --- a/modules/by-name/ya/yambar/settings/default.nix +++ b/modules/by-name/ya/yambar/settings/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. # TODO: This should not do something depending on whether the host is a laptop or not. It # should instead match on monitor-width or scale factor. <2024-11-29> { diff --git a/modules/by-name/yt/yt/config.toml b/modules/by-name/yt/yt/config.toml index 981481d9..aecb74ba 100644 --- a/modules/by-name/yt/yt/config.toml +++ b/modules/by-name/yt/yt/config.toml @@ -1,2 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + [download] max_cache_size = "5 GiB" diff --git a/modules/by-name/yt/yt/input.conf.license b/modules/by-name/yt/yt/input.conf.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/yt/yt/input.conf.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/yt/yt/module.nix b/modules/by-name/yt/yt/module.nix index b93feeb5..4e7e90fe 100644 --- a/modules/by-name/yt/yt/module.nix +++ b/modules/by-name/yt/yt/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/yt/yt/mpv.conf.license b/modules/by-name/yt/yt/mpv.conf.license new file mode 100644 index 00000000..eae6a84c --- /dev/null +++ b/modules/by-name/yt/yt/mpv.conf.license @@ -0,0 +1,9 @@ +nixos-config - My current NixOS configuration + +Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +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 <https://www.gnu.org/licenses/gpl-3.0.txt>. diff --git a/modules/by-name/za/zathura/module.nix b/modules/by-name/za/zathura/module.nix index 1c55be54..a332e313 100644 --- a/modules/by-name/za/zathura/module.nix +++ b/modules/by-name/za/zathura/module.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, diff --git a/modules/by-name/zs/zsh/config/command_not_found/command_not_found_insult.sh b/modules/by-name/zs/zsh/config/command_not_found/command_not_found_insult.sh index 5126845a..a5d71939 100644 --- a/modules/by-name/zs/zsh/config/command_not_found/command_not_found_insult.sh +++ b/modules/by-name/zs/zsh/config/command_not_found/command_not_found_insult.sh @@ -1,4 +1,15 @@ #! /usr/bin/env bash + +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + print_message() { local messages diff --git a/modules/by-name/zs/zsh/config/custom_cursor.zsh b/modules/by-name/zs/zsh/config/custom_cursor.zsh index 071bb5fe..aa137173 100644 --- a/modules/by-name/zs/zsh/config/custom_cursor.zsh +++ b/modules/by-name/zs/zsh/config/custom_cursor.zsh @@ -1,5 +1,15 @@ #!/usr/bin/env zsh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + autoload -U add-zsh-hook autoload -U add-zle-hook-widget diff --git a/modules/by-name/zs/zsh/config/edit_command_line.zsh b/modules/by-name/zs/zsh/config/edit_command_line.zsh index 1d51a4e8..e14da5c6 100644 --- a/modules/by-name/zs/zsh/config/edit_command_line.zsh +++ b/modules/by-name/zs/zsh/config/edit_command_line.zsh @@ -1,5 +1,15 @@ #! /usr/bin/env zsh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + autoload -Uz edit-command-line wrapped_edit-command-line() { diff --git a/modules/by-name/zs/zsh/config/keymaps/.safe.zsh b/modules/by-name/zs/zsh/config/keymaps/.safe.zsh index ee3bfa32..b37d22f2 100644 --- a/modules/by-name/zs/zsh/config/keymaps/.safe.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/.safe.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + bindkey -M .safe "^J" .accept-line bindkey -M .safe "^M" .accept-line bindkey -R -M .safe "^@"-"^I" .self-insert diff --git a/modules/by-name/zs/zsh/config/keymaps/command.zsh b/modules/by-name/zs/zsh/config/keymaps/command.zsh index 81ae6dda..e195ed4c 100644 --- a/modules/by-name/zs/zsh/config/keymaps/command.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/command.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Keymap used in the vicmd `execute-named-cmd` mode bindkey -N command diff --git a/modules/by-name/zs/zsh/config/keymaps/emacs.zsh b/modules/by-name/zs/zsh/config/keymaps/emacs.zsh index b789faf5..1cbf77e9 100644 --- a/modules/by-name/zs/zsh/config/keymaps/emacs.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/emacs.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + bindkey -N emacs bindkey -M emacs "^[A" accept-and-hold diff --git a/modules/by-name/zs/zsh/config/keymaps/isearch.zsh b/modules/by-name/zs/zsh/config/keymaps/isearch.zsh index db80bae8..d5e68f1b 100644 --- a/modules/by-name/zs/zsh/config/keymaps/isearch.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/isearch.zsh @@ -1,2 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Nothing? bindkey -N isearch diff --git a/modules/by-name/zs/zsh/config/keymaps/vicmd.zsh b/modules/by-name/zs/zsh/config/keymaps/vicmd.zsh index ceb4f348..acf3746d 100644 --- a/modules/by-name/zs/zsh/config/keymaps/vicmd.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/vicmd.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + bindkey -N vicmd # Bind in string to out string diff --git a/modules/by-name/zs/zsh/config/keymaps/viins.zsh b/modules/by-name/zs/zsh/config/keymaps/viins.zsh index d215d190..3353956c 100644 --- a/modules/by-name/zs/zsh/config/keymaps/viins.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/viins.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + bindkey -N viins # Completion Debugging diff --git a/modules/by-name/zs/zsh/config/keymaps/viopp.zsh b/modules/by-name/zs/zsh/config/keymaps/viopp.zsh index 8b291d00..3dd900f8 100644 --- a/modules/by-name/zs/zsh/config/keymaps/viopp.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/viopp.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + bindkey -N viopp bindkey -M viopp "t" down-line diff --git a/modules/by-name/zs/zsh/config/keymaps/visual.zsh b/modules/by-name/zs/zsh/config/keymaps/visual.zsh index c09cd578..73191d94 100644 --- a/modules/by-name/zs/zsh/config/keymaps/visual.zsh +++ b/modules/by-name/zs/zsh/config/keymaps/visual.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + bindkey -N visual bindkey -M visual "^[" deactivate-region diff --git a/modules/by-name/zs/zsh/config/keymaps_end.zsh b/modules/by-name/zs/zsh/config/keymaps_end.zsh index 2e973de4..2ce403a5 100644 --- a/modules/by-name/zs/zsh/config/keymaps_end.zsh +++ b/modules/by-name/zs/zsh/config/keymaps_end.zsh @@ -1,2 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Use the vi imitation keymap as default bindkey -A viins main diff --git a/modules/by-name/zs/zsh/config/keymaps_start.zsh b/modules/by-name/zs/zsh/config/keymaps_start.zsh index 2504e799..dfae8dcc 100644 --- a/modules/by-name/zs/zsh/config/keymaps_start.zsh +++ b/modules/by-name/zs/zsh/config/keymaps_start.zsh @@ -1,3 +1,13 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Delete all default keymaps (with the exception of .safe) bindkey -D command emacs isearch main vicmd viins viopp visual diff --git a/modules/by-name/zs/zsh/config/zsh-init.zsh b/modules/by-name/zs/zsh/config/zsh-init.zsh index aac344dc..740fc44b 100644 --- a/modules/by-name/zs/zsh/config/zsh-init.zsh +++ b/modules/by-name/zs/zsh/config/zsh-init.zsh @@ -1,5 +1,15 @@ #!/usr/bin/env zsh +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. + # Display current tasks [ -z "$NVIM" ] && task next diff --git a/modules/by-name/zs/zsh/module.nix b/modules/by-name/zs/zsh/module.nix index b50e72ac..bf7e2a71 100644 --- a/modules/by-name/zs/zsh/module.nix +++ b/modules/by-name/zs/zsh/module.nix @@ -1,8 +1,17 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, lib, - shell_library, system, + pkgs, ... }: let cfg = config.soispha.programs.zsh; @@ -12,7 +21,10 @@ sourceFile = path: "source ${path}\n"; extraFiles = builtins.concatStringsSep "\n" ( - builtins.map sourceFile ( + builtins.map (value: + if builtins.isPath value + then (sourceFile value) + else value) ( builtins.attrValues cfg.integrations ) ); @@ -21,7 +33,7 @@ in { enable = lib.mkEnableOption "zsh"; integrations = lib.mkOption { - type = lib.types.attrsOf lib.types.path; + type = lib.types.attrsOf (lib.types.either lib.types.path lib.types.str); example = '' { atuin = ./integrations/atuin.zsh; @@ -91,23 +103,18 @@ in { setopt VI ''; - initExtraFirst = - sourceFile ./config/zsh-init.zsh - + '' - SHELL_LIBRARY_VERSION="2.1.2" source ${shell_library.rawLib.${system}} - ''; - - initExtra = let + initContent = let start = lib.modules.mkBefore ( - # NOTE: This must be before the insult, as we otherwise override the previous handler <2024-02-28> - sourceFile ./config/command_not_found/command_not_found.sh - + sourceFile ./config/command_not_found/command_not_found_insult.sh + sourceFile ./config/zsh-init.zsh + sourceFile ./config/custom_cursor.zsh + sourceFile ./config/edit_command_line.zsh + sourceFile ./plugins/zsh-history-substring-search.zsh ); end = lib.modules.mkAfter ( - sourceFile ./config/keymaps_start.zsh + # NOTE(@bpeetz): Put this here, so that command handler in `extraFiles` + # are not overriding this. <2025-05-16> + sourceFile ./config/command_not_found/command_not_found_insult.sh + + sourceFile ./config/keymaps_start.zsh + sourceFile ./config/keymaps/command.zsh + sourceFile ./config/keymaps/emacs.zsh + sourceFile ./config/keymaps/isearch.zsh @@ -131,11 +138,6 @@ in { HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND = "bg=cyan,fg=white"; HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND = "fg=red,underline,standout,bold"; }; - - shellAliases = { - ll = ". ll"; - lm = ". lm"; - }; }; }; }; diff --git a/modules/by-name/zs/zsh/plugins/zsh-history-substring-search.zsh b/modules/by-name/zs/zsh/plugins/zsh-history-substring-search.zsh index 4314b784..cc2b6e98 100644 --- a/modules/by-name/zs/zsh/plugins/zsh-history-substring-search.zsh +++ b/modules/by-name/zs/zsh/plugins/zsh-history-substring-search.zsh @@ -1,46 +1,25 @@ #!/usr/bin/env zsh -############################################################################## -# Original Source before 2024 modifications: -# https://github.com/zsh-users/zsh-history-substring-search/blob/87ce96b1862928d84b1afe7c173316614b30e301/zsh-history-substring-search.zsh + +# nixos-config - My current NixOS configuration # # Copyright (c) 2009 Peter Stephenson # Copyright (c) 2011 Guido van Steen -# Copyright (c) 2011 Suraj N. Kurapati # Copyright (c) 2011 Sorin Ionescu +# Copyright (c) 2011 Suraj N. Kurapati # Copyright (c) 2011 Vincent Guerci # Copyright (c) 2016 Geza Lore # Copyright (c) 2017 Bengt Brodersen -# Copyright (c) 2024 Benedikt Peetz -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: +# Copyright (c) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later # -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. +# This file is part of my nixos-config. # -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# -# * Neither the name of the FIZSH nor the names of its contributors -# may be used to endorse or promote products derived from this -# software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################## +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +# Original Source before 2024 modifications: +# https://github.com/zsh-users/zsh-history-substring-search/blob/87ce96b1862928d84b1afe7c173316614b30e301/zsh-history-substring-search.zsh #----------------------------------------------------------------------------- # declare global configuration variables |