aboutsummaryrefslogtreecommitdiffstats
path: root/modules/by-name
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/by-name/at/atuin/module.nix1
-rw-r--r--modules/by-name/au/ausweisapp/module.nix18
-rw-r--r--modules/by-name/ba/backup/module.nix4
-rw-r--r--modules/by-name/bo/boot/iso_entry/archlive_iso.nix86
-rw-r--r--modules/by-name/bo/boot/iso_entry/signing_key.nix27
-rw-r--r--modules/by-name/bo/boot/module.nix281
-rw-r--r--modules/by-name/di/direnv/module.nix8
-rw-r--r--modules/by-name/di/disks/module.nix85
-rw-r--r--modules/by-name/lf/lf/commands/default.nix15
-rwxr-xr-xmodules/by-name/lf/lf/commands/scripts/cd_lf_make_map.sh27
-rw-r--r--modules/by-name/lf/lf/ctpv/prev/application/archive/default.nix2
-rw-r--r--modules/by-name/lf/lf/keybindings/default.nix18
-rw-r--r--modules/by-name/lf/lf/module.nix17
-rwxr-xr-xmodules/by-name/lf/lf/wrappers/ll/ll.sh14
-rw-r--r--modules/by-name/lo/locale/module.nix3
-rw-r--r--modules/by-name/ni/nix/module.nix82
-rw-r--r--modules/by-name/qu/qutebrowser/include/redirects.py2
17 files changed, 351 insertions, 339 deletions
diff --git a/modules/by-name/at/atuin/module.nix b/modules/by-name/at/atuin/module.nix
index 6cf8a396..78a4332c 100644
--- a/modules/by-name/at/atuin/module.nix
+++ b/modules/by-name/at/atuin/module.nix
@@ -10,7 +10,6 @@
{
config,
lib,
- pkgs,
...
}: let
cfg = config.soispha.programs.atuin;
diff --git a/modules/by-name/au/ausweisapp/module.nix b/modules/by-name/au/ausweisapp/module.nix
new file mode 100644
index 00000000..3a89db9d
--- /dev/null
+++ b/modules/by-name/au/ausweisapp/module.nix
@@ -0,0 +1,18 @@
+{
+ config,
+ lib,
+ libraries,
+ ...
+}: let
+ cfg = config.soispha.programs.ausweisapp;
+in {
+ options.soispha.programs.ausweisapp = {
+ enable = libraries.base.options.mkEnable "AusweisApp";
+ };
+
+ config = lib.mkIf cfg.enable {
+ soispha.impermanence.userDirectories = [
+ ".config/AusweisApp"
+ ];
+ };
+}
diff --git a/modules/by-name/ba/backup/module.nix b/modules/by-name/ba/backup/module.nix
index 7a788764..dd0dfac7 100644
--- a/modules/by-name/ba/backup/module.nix
+++ b/modules/by-name/ba/backup/module.nix
@@ -186,7 +186,7 @@ in {
# 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.
+ # As such, the value does not matter and must only be parse-able by restic.
repository = "rclone: ";
timerConfig = {
@@ -209,7 +209,7 @@ in {
# 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.
+ # As such, the value does not matter and must only be parse-able by restic.
repository = "rclone: ";
timerConfig = null;
diff --git a/modules/by-name/bo/boot/iso_entry/archlive_iso.nix b/modules/by-name/bo/boot/iso_entry/archlive_iso.nix
deleted file mode 100644
index d0ae8457..00000000
--- a/modules/by-name/bo/boot/iso_entry/archlive_iso.nix
+++ /dev/null
@@ -1,86 +0,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>.
-{pkgs ? (builtins.getFlake "nixpkgs").legacyPackages."x86_64-linux"}: let
- signing_key = import ./signing_key.nix {inherit pkgs;};
-
- checked_iso = pkgs.stdenv.mkDerivation {
- pname = "archlinux-iso";
- version = "2024.05.01";
-
- srcs = [
- (pkgs.fetchurl {
- url = "https://archlinux.org/iso/2024.05.01/archlinux-2024.05.01-x86_64.iso.sig";
- hash = "sha256-QOGYng6a7zA5EJKGotDccJ7fD2MmPPXQEdVr1kjJvi4=";
- })
- (pkgs.fetchurl {
- url = "https://mirror.informatik.tu-freiberg.de/arch/iso/latest/archlinux-2024.05.01-x86_64.iso";
- hash = "sha256-G0oE74pzUIUqEwcO5JhEKwh6YHoYhAtN19mYZ+tfakw=";
- })
- (pkgs.fetchurl {
- url = "https://archlinux.org/iso/2024.05.01/b2sums.txt";
- hash = "sha256-HSMS13hHXFKKQsCA8spa7XtirHCBTmePwhOsStVPbHw=";
- })
- ];
-
- dontUnpack = true;
-
- nativeBuildInputs = with pkgs; [
- sequoia-sq
- ];
-
- buildPhase =
- /*
- bash
- */
- ''
- cp -r "${signing_key}" ./release-key.pgp
- for src in $srcs; do
- cp -r "$src" "$(stripHash "$src")"
- done
-
- sed '2d;3d;4d' b2sums.txt > b2sums_clean.txt
-
- # As per the directions from: https://archlinux.org/download/
-
- # blake hash check
- b2sum -c ./b2sums_clean.txt
-
- # pgp signature check
- sq verify --signer-file release-key.pgp --detached archlinux-2024.05.01-x86_64.iso.sig archlinux-2024.05.01-x86_64.iso
- '';
-
- installPhase = ''
- cp archlinux-2024.05.01-x86_64.iso "$out";
- '';
- };
-in
- pkgs.stdenv.mkDerivation {
- name = "live_iso_boot_entry";
-
- src = checked_iso;
-
- dontUnpack = true;
-
- nativeBuildInputs = with pkgs; [
- libarchive # for bsdtar
- ];
-
- buildPhase = ''
- mkdir iso
- bsdtar -xf "$src" -C iso
- '';
-
- installPhase = ''
- install -D ./iso/arch/boot/x86_64/initramfs-linux.img "$out/live/initramfs-linux.img"
- install -D ./iso/arch/boot/x86_64/vmlinuz-linux "$out/live/vmlinuz-linux"
-
- install -D "$src" "$out/archlinux.iso"
- '';
- }
diff --git a/modules/by-name/bo/boot/iso_entry/signing_key.nix b/modules/by-name/bo/boot/iso_entry/signing_key.nix
deleted file mode 100644
index d9268d75..00000000
--- a/modules/by-name/bo/boot/iso_entry/signing_key.nix
+++ /dev/null
@@ -1,27 +0,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>.
-{pkgs ? (builtins.getFlake "nixpkgs").legacyPackages."x86_64-linux"}:
-pkgs.stdenv.mkDerivation {
- name = "archlinux_signing_keys";
-
- outputHash = "sha256-evGWzkxMaZw3rlixKsyWCS/ZvNuZ+OfXQb6sgiHz9XY=";
- outputHashAlgo = "sha256";
- NIX_SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
-
- nativeBuildInputs = with pkgs; [
- sequoia-sq
- ];
-
- dontUnpack = true;
-
- buildPhase = ''
- sq --verbose --no-cert-store --no-key-store network wkd fetch pierre@archlinux.org --output "$out"
- '';
-}
diff --git a/modules/by-name/bo/boot/module.nix b/modules/by-name/bo/boot/module.nix
index 4b95aedf..2667b385 100644
--- a/modules/by-name/bo/boot/module.nix
+++ b/modules/by-name/bo/boot/module.nix
@@ -12,139 +12,204 @@
lib,
pkgs,
modules,
+ modulesPath,
+ system,
+ specialArgs,
...
}: let
cfg = config.soispha.boot;
+
+ tails = let
+ tailsPrefix = "/EFI/tails";
+ in {
+ root = "${tailsPrefix}/tails.iso";
+ initrd = "${tailsPrefix}/initrd.img";
+ vmlinuz = "${tailsPrefix}/vmlinuz-linux";
+ };
+
+ iso = pkgs.tails-iso;
+
+ # From:
+ # - The extracted ISO's boot dir
+ # - Reverse engineered from:
+ # - `<tails iso squashfs>/usr/share/initramfs-tools/init`
+ # - `<tails iso squashfs>/usr/lib/live/boot/`
+ iso_options =
+ ## General options?
+ [
+ "initrd=${tails.initrd}"
+ "noprompt"
+ "timezone=Etc/UTC"
+ "config"
+ "noautologin"
+ "slab_nomerge"
+ "slub_debug=FZ"
+ "mce=0"
+ "vsyscall=none"
+ "init_on_free=1"
+ "mds=full,nosmt"
+ "page_alloc.shuffle=1"
+ "randomize_kstack_offset=on"
+ "efi_pstore.pstore_disable=1"
+ "erst_disable"
+ "spec_store_bypass_disable=on"
+ "systemd.condition_needs_update=no"
+ ]
+ ## Options for the first `init` script
+ ++ [
+ # Use the `*-live` scripts
+ "boot=live"
+
+ # "splash"
+ "plymouth.enable=0"
+
+ # "quiet"
+ "debug"
+ ]
+ ## Options for the `*-live` `init` scripts
+ ++ [
+ "module=Tails"
+
+ # TODO: RO-makes the fromiso not work <2026-06-08>
+ # "live-boot.read-only=/dev/nvme0*"
+
+ # Don't store things persistently
+ "nopersistence"
+
+ "fromiso=/dev/nvme0n1p1/${tails.root}"
+ ];
in {
options.soispha.boot = {
enable = lib.mkEnableOption "Bootloader configuration";
- # TODO: Add this option <2024-05-16>
- # enableIsoEntry = lib.mkEnableOption "an tails iso boot entry";
+ 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;
- # inherit (config.boot.loader) efi;
- #
- # esa = n: lib.strings.escapeShellArg n;
- #
- # bootMountPoint =
- # if cfg.xbootldrMountPoint != null
- # then cfg.xbootldrMountPoint
- # else efi.efiSysMountPoint;
- #
- # nixosDir = "/EFI/nixos";
- #
- # # FIXME: This system has two big problems:
- # # 1. It does not updated files, which still have the same name
- # # 2. It forgets about files, which were 'deleted' in this configuration (these just
- # # stay on disk forever) <2024-05-11>
- # copyExtraFiles = ''
- # echo "[systemd-boot] copying files to ${bootMountPoint}"
- # empty_file=$(mktemp boot_empty_file_XXX)
- #
- # ${lib.concatStrings (lib.mapAttrsToList (n: v:
- # /*
- # bash
- # */
- # ''
- # if ! [ -e ${esa "${bootMountPoint}/${n}"} ]; then
- # install -Dp "${v}" ${esa "${bootMountPoint}/${n}"}
- # install -D "$empty_file" ${esa "${bootMountPoint}/${nixosDir}/.extra-files/${n}"}
- # fi
- # '')
- # cfg.extraFiles)}
- #
- # ${lib.concatStrings (lib.mapAttrsToList (n: v:
- # /*
- # bash
- # */
- # ''
- # # if ! [ -e ${esa "${bootMountPoint}/loader/entries/${n}"} ]; then
- # install -Dp "${pkgs.writeText n v}" ${esa "${bootMountPoint}/loader/entries/${n}"}
- # install -D "$empty_file" ${esa "${bootMountPoint}/${nixosDir}/.extra-files/loader/entries/${n}"}
- # # fi
- # '')
- # cfg.extraEntries)}
- # '';
- # in
- {
- # FIXME: Reactviate this whole iso thing when a disko redeploy is done.
- # (and switch to tails instead of arch) <2024-05-12>
- #
- # system.activationScripts = {
- # copyExtraFilesForBoot = copyExtraFiles;
- # };
+ config = lib.mkIf cfg.enable {
+ # This should only be necessary for `lanzaboote`, but that is the current default in
+ # this module.
+ soispha.impermanence.directories = [
+ "/var/lib/sbctl"
+ ];
+
+ boot = {
+ initrd = {
+ kernelModules = ["nvme" "btrfs"];
+ };
+
+ kernelPackages = pkgs.linuxPackages_latest;
- # This should only be necessary for `lanzaboote`, but that is the current default in
- # this module.
- soispha.impermanence.directories = [
- "/var/lib/sbctl"
- ];
+ lanzaboote = {
+ enable = true;
+ pkiBundle = "/var/lib/sbctl";
- boot = {
- initrd = {
- kernelModules = ["nvme" "btrfs"];
+ settings = {
+ # Disable editing the kernel command line (which could allow someone to become root)
+ editor = false;
+ default = "@saved";
};
+ };
- kernelPackages = pkgs.linuxPackages_latest;
+ loader = {
+ external = lib.mkIf cfg.enableIsoEntry {
+ installHook = lib.mkForce (let
+ lanzabooteCfg = config.boot.lanzaboote;
- lanzaboote = {
- enable = true;
- pkiBundle = "/var/lib/sbctl";
+ lanzabooteInstallHook = import "${modulesPath}/../lib/eval-config.nix" {
+ inherit system specialArgs;
+ modules = [
+ modules.lanzaboote.nixosModules.lanzaboote
- settings = {
- # Disable editing the kernel command line (which could allow someone to become root)
- editor = false;
- default = "@saved";
- };
+ {
+ # Copy the relevant config into the eval-module context.
+ boot = {
+ inherit (config.boot) kernelPackages;
+
+ lanzaboote = {
+ inherit (lanzabooteCfg) enable pkiBundle;
+ settings = {
+ inherit (lanzabooteCfg.settings) editor default;
+ };
+ };
+
+ loader = {
+ inherit (config.boot.loader) timeout efi systemd-boot;
+ };
+ };
+ systemd.package = config.systemd.package;
+ }
+ ];
+ };
+
+ install = pkgs.writeShellScript "wrapped-install-tails-iso-marker" ''
+ echo "[Wrapped bootloader install] Copying tails iso..."
+ ${copyExtraFiles}
+
+ echo "[Wrapped bootloader install] Running original lanzaboote install..."
+ ${lanzabooteInstallHook.config.boot.loader.external.installHook}
+ '';
+
+ copyExtraFiles = let
+ systemdCfg = config.boot.loader.systemd-boot;
+ nixosDir = "EFI/nixos";
+
+ bootMountPoint = config.boot.loader.efi.efiSysMountPoint;
+ install = lib.getExe' pkgs.coreutils "install";
+
+ inherit (lib) mapAttrsToList;
+ inherit (lib.strings) escapeShellArg concatStrings;
+ in
+ pkgs.writeShellScript "copy-extra-files" ''
+ ${concatStrings (
+ mapAttrsToList (n: v: ''
+ ${install} -Dp "${v}" "${bootMountPoint}/"${escapeShellArg n}
+ ${install} -D /dev/null "${bootMountPoint}/${nixosDir}/.extra-files/"${escapeShellArg n}
+ '')
+ systemdCfg.extraFiles
+ )}
+
+ ${lib.getExe pkgs.sbctl} sign "${bootMountPoint}/${tails.vmlinuz}"
+
+ ${concatStrings (
+ mapAttrsToList (n: v: ''
+ ${install} -Dp "${pkgs.writeText n v}" "${bootMountPoint}/loader/entries/"${escapeShellArg n}
+ ${install} -D /dev/null "${bootMountPoint}/${nixosDir}/.extra-files/loader/entries/"${escapeShellArg n}
+ '')
+ systemdCfg.extraEntries
+ )}
+ '';
+ in
+ install);
};
- loader = {
- systemd-boot = {
- # Lanzaboote currently replaces the systemd-boot module.
- # This setting is usually set to true in configuration.nix
- # generated at installation time. So we force it to false
- # for now.
- enable = false;
+ systemd-boot = lib.mkIf cfg.enableIsoEntry {
+ # Lanzaboote currently replaces the systemd-boot module.
+ enable = false;
- # extraEntries = {
- # "live.conf" = ''
- # title Archlinux Live ISO
- # linux /live/vmlinuz-linux
- # initrd /live/initramfs-linux.img
- # options img_dev=${config.soispha.disks.disk} img_loop=/archlinux.iso copytoram
- # '';
- # };
- #
- # extraFiles = let
- # iso = import ./archlive_iso.nix {inherit pkgs;};
- # in {
- # "archlinux.iso" = "${iso}/archlinux.iso";
- # "live/initramfs-linux.img" = "${iso}/live/initramfs-linux.img";
- # "live/vmlinuz-linux" = "${iso}/live/vmlinuz-linux";
- # };
+ extraEntries = {
+ "live.conf" = ''
+ title Tails ${iso.passthru.version} Live ISO
+ linux ${tails.vmlinuz}
+ initrd ${tails.initrd}
+ options ${builtins.concatStringsSep " " iso_options}
+ '';
};
- grub = {
- enable = false;
- # theme = pkgs.nixos-grub2-theme;
- splashImage = ./boot_pictures/gnu.png;
- efiSupport = true;
- device = "nodev"; # only for efi
+ extraFiles = {
+ "${tails.root}" = "${iso}/tails.iso";
+ "${tails.vmlinuz}" = "${iso}/live/vmlinuz-linux";
+ "${tails.initrd}" = "${iso}/live/initrd.img";
};
+ };
- efi = {
- canTouchEfiVariables = true;
- efiSysMountPoint = "/boot";
- };
+ efi = {
+ canTouchEfiVariables = true;
+ efiSysMountPoint = "/boot";
};
};
- }
- );
+ };
+ };
}
diff --git a/modules/by-name/di/direnv/module.nix b/modules/by-name/di/direnv/module.nix
index 7c81e671..363f5cea 100644
--- a/modules/by-name/di/direnv/module.nix
+++ b/modules/by-name/di/direnv/module.nix
@@ -10,6 +10,7 @@
{
config,
lib,
+ pkgs,
...
}: let
cfg = config.soispha.programs.direnv;
@@ -20,7 +21,12 @@ in {
config.home-manager.users.soispha.programs.direnv = lib.mkIf cfg.enable {
enable = true;
- nix-direnv.enable = true;
+
+ nix-direnv = {
+ enable = true;
+ package = pkgs.nix-direnv.override {nix = config.nix.package;};
+ };
+
config = {
warn_timeout = 0;
# strict_env = true;
diff --git a/modules/by-name/di/disks/module.nix b/modules/by-name/di/disks/module.nix
index 3e9d4614..ed5c939a 100644
--- a/modules/by-name/di/disks/module.nix
+++ b/modules/by-name/di/disks/module.nix
@@ -14,10 +14,9 @@
modules,
...
}: let
- # FIXME: The iso redeploy requires a bigger efi partition <2024-05-12>
cfg = config.soispha.disks;
defaultMountOptions = [
- "compress=zstd:3" # This saves disk space, at a performance cost
+ "compress-force=zstd:15" # This saves disk space, at a performance cost
"noatime" # should have some performance upsides, and I don't use it anyways
"lazytime" # make time changes in memory
];
@@ -34,15 +33,10 @@ in {
ssd = lib.mkEnableOption "ssd specific improvements, like trim";
swap = {
- uuid = lib.mkOption {
+ ram_size = lib.mkOption {
type = lib.types.str;
- example = lib.literalExpression "d1d20ae7-3d8a-44da-86da-677dbbb10c89";
- description = "The uuid of the swapfile";
- };
- resumeOffset = lib.mkOption {
- type = lib.types.str;
- example = lib.literalExpression "134324224";
- description = "The resume offset of the swapfile";
+ example = lib.literalExpression "16G";
+ description = "The size of the ram (translates to the swapfile size)";
};
};
};
@@ -54,6 +48,12 @@ in {
config = lib.mkIf cfg.enable {
systemd = lib.recursiveUpdate (import ./hibernate.nix {inherit pkgs;}) (import ./fstrim.nix {inherit pkgs lib cfg;});
+ services.btrfs.autoScrub = {
+ enable = true;
+ fileSystems = ["/srv" "/nix"];
+ interval = "monthly";
+ };
+
disko.devices = {
disk = {
main = {
@@ -61,21 +61,44 @@ in {
content = {
type = "gpt";
partitions = {
+ ESP = {
+ # 2GiB plus 512MiB for tails ISO and normal boot stuff
+ size = "2600M";
+
+ type = "EF00";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ mountOptions = ["umask=0077"];
+ };
+ };
+
+ nix = {
+ size = "30G";
+ content = {
+ type = "luks";
+ name = "nixos-store";
+ extraOpenArgs = ["--allow-discards"];
+ content = {
+ type = "btrfs";
+ extraArgs = ["-f" "--label nixos-store"]; # Override existing partitions
+ mountpoint = "/nix";
+ mountOptions = defaultMountOptions;
+ };
+ };
+ };
+
root = {
size = "100%";
- name = "root";
content = {
type = "luks";
- name = "nixos";
+ name = "nixos-root";
extraOpenArgs = ["--allow-discards"];
content = {
type = "btrfs";
- extraArgs = ["-f" "--label nixos"]; # Override existing partitions
+ extraArgs = ["-f" "--label nixos-root"]; # Override existing partitions
subvolumes = {
- "nix" = {
- mountpoint = "/nix";
- mountOptions = defaultMountOptions;
- };
"persistent-storage" = {
mountpoint = "/srv";
mountOptions = defaultMountOptions;
@@ -90,21 +113,17 @@ in {
"noatime" # should have some performance upsides, and I don't use it anyways
"lazytime" # make time changes in memory
];
+ swap = {
+ swapfile = {
+ priority = -1; # lower than zramSwap, just in case
+ size = cfg.swap.ram_size;
+ };
+ };
};
};
};
};
};
- boot = {
- type = "EF00";
- size = "512M";
- name = "boot";
- content = {
- type = "filesystem";
- format = "vfat";
- mountpoint = "/boot";
- };
- };
};
};
};
@@ -130,6 +149,9 @@ in {
};
};
fileSystems = {
+ "/nix" = {
+ neededForBoot = true;
+ };
"/srv" = {
neededForBoot = true;
};
@@ -137,23 +159,14 @@ in {
neededForBoot = true;
};
};
- swapDevices = [
- #{
- # device = "/swap/swapfile";
- # priority = 1; # lower than zramSwap, just in case
- # # size = 2048; # TODO: can nixos create a btrfs swapfile correctly?
- #}
- ];
zramSwap = {
enable = true;
priority = 10; # needs to be higher than hardware-swap
};
boot = {
kernelParams = [
- "resume_offset=${cfg.swap.resumeOffset}"
"zswap.enabled=0" # zswap and zram are not really compatible
];
- resumeDevice = "/dev/disk/by-uuid/${cfg.swap.uuid}";
};
};
}
diff --git a/modules/by-name/lf/lf/commands/default.nix b/modules/by-name/lf/lf/commands/default.nix
index e8230556..42dc548e 100644
--- a/modules/by-name/lf/lf/commands/default.nix
+++ b/modules/by-name/lf/lf/commands/default.nix
@@ -16,7 +16,14 @@
pkgs.writeShellApplication {
inherit name;
text = builtins.readFile ./base.sh + builtins.readFile ./scripts/${name}.sh;
- runtimeInputs = [pkgs.lf pkgs.mktemp pkgs.coreutils] ++ dependencies;
+ runtimeInputs =
+ [
+ pkgs.lf
+ pkgs.mktemp
+ pkgs.coreutils
+ pkgs.gnused
+ ]
+ ++ dependencies;
inheritPath = keepPath;
}
+ "/bin/${name}";
@@ -72,6 +79,12 @@ in {
name = "cd_project_root";
dependencies = [pkgs.git];
};
+ cd_lf_make_map = shell {
+ name = "cd_lf_make_map";
+ dependencies = [
+ pkgs.lf-make-map
+ ];
+ };
chmod = pipe {
name = "chmod";
diff --git a/modules/by-name/lf/lf/commands/scripts/cd_lf_make_map.sh b/modules/by-name/lf/lf/commands/scripts/cd_lf_make_map.sh
new file mode 100755
index 00000000..00befd3f
--- /dev/null
+++ b/modules/by-name/lf/lf/commands/scripts/cd_lf_make_map.sh
@@ -0,0 +1,27 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You 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
+f="$f"
+# shellcheck disable=SC2269
+fx="$fx"
+# shellcheck disable=SC2269
+fs="$fs"
+# shellcheck disable=SC2269
+id="$id"
+
+root="$(lf-make-map --depth 4 interactive ~/media ~/repos ~/documents ~/.config ~/.local)"
+if [ "$root" ]; then
+ lf_cmd cd "$root" || die "Bug: Failed to cd to selected path at '$root'"
+fi
+
+# vim: ft=sh
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 d64c9572..dc34d5de 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
@@ -94,6 +94,8 @@
pkgs.xz
pkgs.zip
+ pkgs.coreutils
+
# Unfree stuff
# pkgs.lha
# pkgs.rar
diff --git a/modules/by-name/lf/lf/keybindings/default.nix b/modules/by-name/lf/lf/keybindings/default.nix
index fbc33f6f..b6b7a548 100644
--- a/modules/by-name/lf/lf/keybindings/default.nix
+++ b/modules/by-name/lf/lf/keybindings/default.nix
@@ -82,22 +82,16 @@
ch = "chmod";
bg = "set_wallpaper";
r = ":rename; cmd-end";
- H = "cd_project_root";
R = "reload";
C = "clear";
U = "unselect";
# Movement
- gjr = "cd ~/.local/share/Trash/files";
- gus = "cd /run/user/${builtins.toString uid}";
+ nu = "cd /run/user/${builtins.toString uid}";
+ ne = "cd /etc";
+ nd = "cd ${downloadDir}";
+ nt = "cd /tmp";
+ nh = "cd_project_root";
- gc = "cd ~/.config";
- gl = "cd ~/.local";
- gE = "cd /etc";
- gD = "cd ${downloadDir}";
-
- "gU." = "cd /usr";
- gUs = " cd /usr/share";
-
- gt = "cd /tmp";
+ g = "cd_lf_make_map";
}
diff --git a/modules/by-name/lf/lf/module.nix b/modules/by-name/lf/lf/module.nix
index 8dfd0c52..daa236e6 100644
--- a/modules/by-name/lf/lf/module.nix
+++ b/modules/by-name/lf/lf/module.nix
@@ -85,7 +85,6 @@ in {
drawbox = true;
- # errorfmt = "\\033[1;91m==> ERROR:\\033[0m\\033[1;93m%s\\033[0m";
errorfmt = "\\033[1;91m%s\\033[0m";
hidden = true; # show hidden files
icons = true;
@@ -94,22 +93,6 @@ in {
shell = "${lib.getExe pkgs.dash}";
shellopts = "-eu"; # e: exit on error; u: error for unset variables
};
- extraConfig = ''
- # Dynamically generate the cd mappings.
- # This code dependends on the fact, that the lf server was started previously
- # and keep running through `autoquit = false`.
- # (Otherwise, the remote command is silently dropped: https://github.com/gokcehan/lf/issues/495)
- &{{
- tmp="$(mktemp -t lf_make_map_dynamic_mapping_source_XXXXX)"
- ${lib.getExe pkgs.lf-make-map} --depth 4 generate ~/media ~/repos ~/documents >"$tmp"
-
- lf -remote "send $id source $tmp"
- sleep 1
- lf -remote "send $id source $tmp"
-
- rm "$tmp"
- }}
- '';
};
};
};
diff --git a/modules/by-name/lf/lf/wrappers/ll/ll.sh b/modules/by-name/lf/lf/wrappers/ll/ll.sh
index ce29fd97..9bb314c6 100755
--- a/modules/by-name/lf/lf/wrappers/ll/ll.sh
+++ b/modules/by-name/lf/lf/wrappers/ll/ll.sh
@@ -10,20 +10,14 @@
# You 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 -t ll_last_directory_XXXXXXX)"
-cleanup() {
- rm "$last_directory"
-}
-trap cleanup EXIT
+[ -d "$XDG_RUNTIME_DIR/ll" ] || mkdir "$XDG_RUNTIME_DIR/ll"
+last_directory="$XDG_RUNTIME_DIR/ll/last_directory"
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!"
+if ! cd "$dir"; then
+ die "ll: Failed to cd to '$dir'. Does it exist?"
fi
# vim: ft=sh
diff --git a/modules/by-name/lo/locale/module.nix b/modules/by-name/lo/locale/module.nix
index 3c9c646c..0aa812ec 100644
--- a/modules/by-name/lo/locale/module.nix
+++ b/modules/by-name/lo/locale/module.nix
@@ -43,6 +43,9 @@ in {
LC_TIME = "sv_SE.UTF-8";
LC_COLLATE = "C.UTF-8";
};
+ extraLocales = [
+ "fr_FR.UTF-8/UTF-8"
+ ];
};
# Layout
diff --git a/modules/by-name/ni/nix/module.nix b/modules/by-name/ni/nix/module.nix
index ed4462f4..65b6ed5c 100644
--- a/modules/by-name/ni/nix/module.nix
+++ b/modules/by-name/ni/nix/module.nix
@@ -9,63 +9,71 @@
# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{
pkgs,
+ libraries,
+ config,
+ lib,
# flakes
sources,
self,
system,
externalDependencies,
...
-}:
-let
+}: let
nixpkgs = sources.loadFlake "nixpkgs";
+
+ cfg = config.soispha.nix;
in {
- # TODO(@bpeetz): Modularize <2025-02-08>
+ options.soispha.nix = {
+ enable = libraries.base.options.mkEnable "nix";
+ };
- nix = {
- package = pkgs.lixPackageSets.latest.lix;
+ config = lib.mkIf cfg.enable {
+ nix = {
+ package = pkgs.lixPackageSets.latest.lix;
- # Disable nix channels (this is a remnant of old days)
- channel.enable = false;
+ # Disable nix channels (this is a remnant of old days)
+ channel.enable = false;
- registry = {
- nixpkgs.flake = nixpkgs;
- n.flake =
- nixpkgs
- // {
- # Otherwise nixpkgs's config and overlays are not available:
+ registry = {
+ nixpkgs.flake = nixpkgs;
+ n.flake =
+ nixpkgs
+ // {
+ # Otherwise nixpkgs's config and overlays are not available:
- # Both attrs exists, so we just override both and hope
- outputs.legacyPackages."${system}" = pkgs;
- legacyPackages."${system}" = pkgs;
- };
+ # Both attrs exists, so we just override both and hope
+ outputs.legacyPackages."${system}" = pkgs;
+ legacyPackages."${system}" = pkgs;
+ };
- t.flake = externalDependencies.templates;
+ t.flake = externalDependencies.templates;
- my_flake.flake = self;
- m.flake = self;
- };
+ my_flake.flake = self;
+ m.flake = self;
+ };
- gc = {
- automatic = true;
- dates = "weekly";
- options = "--delete-older-than 7d";
- };
+ gc = {
+ automatic = true;
+ dates = "weekly";
+ options = "--delete-older-than 7d";
+ };
- settings = {
- auto-optimise-store = true;
- experimental-features = [
- "nix-command"
- "flakes"
- ];
+ settings = {
+ auto-optimise-store = true;
+ experimental-features = [
+ "nix-command"
+ "flakes"
+ ];
- use-xdg-base-directories = true;
+ use-xdg-base-directories = true;
- fallback = true; # Build from source, if binary can't be substituted
+ fallback = true; # Build from source, if binary can't be substituted
- keep-failed = false; # keep failed tmp build dirs
- pure-eval = true; # restrict file system and network access to hash
+ keep-failed = false; # keep failed tmp build dirs
+ pure-eval = true; # restrict file system and network access to hash
- sandbox-fallback = false; # Don't disable the sandbox, if the kernel doesn't support it
+ sandbox-fallback = false; # Don't disable the sandbox, if the kernel doesn't support it
+ };
};
};
}
diff --git a/modules/by-name/qu/qutebrowser/include/redirects.py b/modules/by-name/qu/qutebrowser/include/redirects.py
index 63a44ecf..2588b9e0 100644
--- a/modules/by-name/qu/qutebrowser/include/redirects.py
+++ b/modules/by-name/qu/qutebrowser/include/redirects.py
@@ -34,7 +34,7 @@ def farside_redir(target: str, url: QUrl) -> bool:
# Any return value other than a literal 'False' means we redirect
REDIRECT_MAP: typing.Dict[str, typing.Callable[..., typing.Optional[bool]]] = {
- "reddit.com": operator.methodcaller("setHost", "redlib.vhack.eu"),
+ "reddit.com": partial(farside_redir, "redlib"),
# Source: https://libredirect.github.io/
"medium.com": partial(farside_redir, "scribe"),
"stackoverflow.com": partial(farside_redir, "anonymousoverflow"),