From 2cea446f49730fb1ae1b0269dd4d06567777af13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 11 Dec 2023 22:37:58 +0100 Subject: [PATCH 01/37] Describe current partition config for curacao MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hopefully I didn't make any mistake 🤞 --- curacao/dk.nix | 183 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 curacao/dk.nix diff --git a/curacao/dk.nix b/curacao/dk.nix new file mode 100644 index 0000000..219fc52 --- /dev/null +++ b/curacao/dk.nix @@ -0,0 +1,183 @@ +{ passwordFile ? "/should_not_be_needed_in_this_context", ... }: +# FIXME Subvolumes for backup. If they're not created with the script. Add the script btw. +# FIXME Add partlabels to the partitions so disko can mount them +# FIXME Test. Somehow. +# FIXME Make it work for NixOS, duh +# TODO Not relatime everywhere, thank you +# TODO Default options +let + btrfs_args_hdd = [ + "rw" + "relatime" + "compress=zstd:3" + "space_cache" + ]; + btrfs_args_ssd = btrfs_args_hdd ++ [ "ssd" ]; +in +{ + disko.devices = { + disk = { + razmo = { + type = "disk"; + device = "/dev/disk/by-id/ata-ST1000LM048-2E7172_WKP8925H"; + content = { + type = "gpt"; + partitions = { + razswap = { + # Currently without partlabel + priority = 1; + start = "2048"; + size = "8G"; + content = { + type = "swap"; + # I don't think I really saw this one being used, maybe we + # could reduce it to get more /boot space. + randomEncryption = true; + # TODO NixOS documentation says not to use this with + # hibernation, as it can't set the partition where the + # hibernation image is saved. That's what I'm doing with Arch, + # but I'm setting resume=, should test if it actually works? + # Untranslated options from /etc/crypttab: swap,cipher=aes-xts-plain64,size=256 + # Untranslated options from /etc/fstab: defaults,pri=100 + }; + }; + razesp = { + # Currently without partlabel + priority = 2; + size = "128M"; + type = "EF00"; # EFI system partition + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/efi"; + mountOptions = [ + "rw" + "relatime" + "fmask=0022" + "dmask=0022" + "codepage=437" + "iocharset=iso8859-1" + "shortname=mixed" + "utf8" + "errors=remount-ro" + "noauto" + ]; + }; + }; + razboot = { + # Currently without partlabel + priority = 3; + size = "128M"; + content = { + type = "luks"; + name = "boot"; + initrdUnlock = false; + extraFormatArgs = [ "--type luks1" ]; + passwordFile = passwordFile; + settings = { + keyFile = "/etc/keys/boot"; + }; + content = { + type = "filesystem"; + format = "ext2"; + mountOptions = [ + "rw" + "relatime" + "stripe=4" + ]; + }; + }; + }; + razmo = { + # Currently without partlabel + priority = 4; + content = { + type = "luks"; + name = "razmo"; + initrdUnlock = false; + settings = { + keyFile = "/etc/keys/razmo"; + }; + content = { + type = "btrfs"; + # extraArgs = [ "-f" ]; + mountpoint = "/mnt/razmo"; + mountOptions = btrfs_args_hdd; + subvolumes = { + "home.razmo" = { + mountpoint = "/home.heavy"; + mountOptions = btrfs_args_hdd; + }; + }; + }; + }; + }; + }; + }; + }; + rapido = { + type = "disk"; + device = "/dev/disk/by-id/nvme-GIGABYTE_GP-GSM2NE3256GNTD_SN204508906665"; + content = { + type = "gpt"; + partitions = { + rapswap = { + # Currently without partlabel + priority = 1; + start = "2048"; + size = "8G"; + type = "8200"; # Linux swap + content = { + type = "luks"; + name = "rapswap"; + initrdUnlock = true; + settings = { + keyFile = "/etc/keys/rapswap"; + allowDiscards = true; + }; + content = { + type = "swap"; + resumeDevice = true; + # Untranslated options from /etc/fstab: defaults,pri=100 + }; + }; + }; + rapido = { + # Currently without partlabel + priority = 2; + content = { + type = "luks"; + name = "rapido"; + initrdUnlock = true; + settings = { + keyFile = "/etc/keys/rapido"; + allowDiscards = true; + }; + content = { + type = "btrfs"; + # extraArgs = [ "-f" ]; + mountpoint = "/mnt/rapido"; + mountOptions = btrfs_args_ssd; + subvolumes = { + archlinux = { + mountpoint = "/"; + mountOptions = btrfs_args_ssd; + }; + "home.rapido" = { + mountpoint = "/home"; + mountOptions = btrfs_args_ssd; + }; + nix = { + mountpoint = "/nix"; + mountOptions = btrfs_args_ssd; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} From d98be4eea538513867ede7a60e1b454551cb89ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 12 Dec 2023 20:59:31 +0100 Subject: [PATCH 02/37] Fix to curacao partition scheme --- curacao/dk.nix | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/curacao/dk.nix b/curacao/dk.nix index 219fc52..2a66f7d 100644 --- a/curacao/dk.nix +++ b/curacao/dk.nix @@ -1,7 +1,5 @@ { passwordFile ? "/should_not_be_needed_in_this_context", ... }: # FIXME Subvolumes for backup. If they're not created with the script. Add the script btw. -# FIXME Add partlabels to the partitions so disko can mount them -# FIXME Test. Somehow. # FIXME Make it work for NixOS, duh # TODO Not relatime everywhere, thank you # TODO Default options @@ -23,8 +21,7 @@ in content = { type = "gpt"; partitions = { - razswap = { - # Currently without partlabel + swap = { priority = 1; start = "2048"; size = "8G"; @@ -41,8 +38,7 @@ in # Untranslated options from /etc/fstab: defaults,pri=100 }; }; - razesp = { - # Currently without partlabel + esp = { priority = 2; size = "128M"; type = "EF00"; # EFI system partition @@ -64,8 +60,7 @@ in ]; }; }; - razboot = { - # Currently without partlabel + boot = { priority = 3; size = "128M"; content = { @@ -80,6 +75,7 @@ in content = { type = "filesystem"; format = "ext2"; + mountpoint = "/boot"; mountOptions = [ "rw" "relatime" @@ -88,8 +84,7 @@ in }; }; }; - razmo = { - # Currently without partlabel + main = { priority = 4; content = { type = "luks"; @@ -121,8 +116,7 @@ in content = { type = "gpt"; partitions = { - rapswap = { - # Currently without partlabel + swap = { priority = 1; start = "2048"; size = "8G"; @@ -142,8 +136,7 @@ in }; }; }; - rapido = { - # Currently without partlabel + main = { priority = 2; content = { type = "luks"; From 6f9de6cc4cb146038e41c53fb1fc4133d04e7fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 12 Dec 2023 22:03:36 +0100 Subject: [PATCH 03/37] First attempt at booting NixOS on curacao directly --- curacao/dk.nix | 18 +++++++++++++++--- curacao/hardware.nix | 2 ++ curacao/os.nix | 10 ++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/curacao/dk.nix b/curacao/dk.nix index 2a66f7d..3c24d91 100644 --- a/curacao/dk.nix +++ b/curacao/dk.nix @@ -75,7 +75,7 @@ in content = { type = "filesystem"; format = "ext2"; - mountpoint = "/boot"; + mountpoint = "/mnt/old/boot"; mountOptions = [ "rw" "relatime" @@ -142,6 +142,7 @@ in type = "luks"; name = "rapido"; initrdUnlock = true; + passwordFile = passwordFile; settings = { keyFile = "/etc/keys/rapido"; allowDiscards = true; @@ -153,17 +154,28 @@ in mountOptions = btrfs_args_ssd; subvolumes = { archlinux = { - mountpoint = "/"; + mountpoint = "/mnt/old"; + mountOptions = btrfs_args_ssd; + }; + # Should be temporary, to make sure we can revert to Arch anytime + "home.nixos" = { + mountpoint = "/home"; mountOptions = btrfs_args_ssd; }; "home.rapido" = { - mountpoint = "/home"; + mountpoint = "/home.old"; mountOptions = btrfs_args_ssd; }; nix = { mountpoint = "/nix"; mountOptions = btrfs_args_ssd; }; + nixosboot = { + mountpoint = "/boot"; + }; + nixos = { + mountpoint = "/"; + }; }; }; }; diff --git a/curacao/hardware.nix b/curacao/hardware.nix index 996cf10..f439fa7 100644 --- a/curacao/hardware.nix +++ b/curacao/hardware.nix @@ -10,6 +10,8 @@ grub = { enable = true; efiSupport = true; + device = "nodev"; # Don't install on MBR + # TODO Maybe we could? In case the HDD doesn't boot anymore? }; }; } diff --git a/curacao/os.nix b/curacao/os.nix index 3bd283d..3c110b9 100644 --- a/curacao/os.nix +++ b/curacao/os.nix @@ -8,4 +8,14 @@ ]; networking.hostName = "curacao"; + boot = { + initrd.secrets = { + "/etc/keys/rapido" = "/etc/keys/rapido"; + "/etc/keys/rapswap" = "/etc/keys/rapswap"; + }; + loader = { + grub.enableCryptodisk = true; + efi.efiSysMountPoint = "/efi"; + }; + }; } From 5ec571ecbd7379eb33f36e164866cccb2e8343bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 13:51:53 +0100 Subject: [PATCH 04/37] Second attempt at booting NixOS on curacao directly --- curacao/dk.nix | 33 ++++++++++++++++++--------------- curacao/os.nix | 5 ----- hm/desktop.nix | 1 - 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/curacao/dk.nix b/curacao/dk.nix index 3c24d91..ec42f2d 100644 --- a/curacao/dk.nix +++ b/curacao/dk.nix @@ -1,6 +1,5 @@ { passwordFile ? "/should_not_be_needed_in_this_context", ... }: # FIXME Subvolumes for backup. If they're not created with the script. Add the script btw. -# FIXME Make it work for NixOS, duh # TODO Not relatime everywhere, thank you # TODO Default options let @@ -22,13 +21,11 @@ in type = "gpt"; partitions = { swap = { - priority = 1; + priority = 10; start = "2048"; - size = "8G"; + size = "6G"; content = { type = "swap"; - # I don't think I really saw this one being used, maybe we - # could reduce it to get more /boot space. randomEncryption = true; # TODO NixOS documentation says not to use this with # hibernation, as it can't set the partition where the @@ -38,8 +35,17 @@ in # Untranslated options from /etc/fstab: defaults,pri=100 }; }; + nixosboot = { + priority = 15; + size = "2G"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; esp = { - priority = 2; + priority = 20; size = "128M"; type = "EF00"; # EFI system partition content = { @@ -61,7 +67,7 @@ in }; }; boot = { - priority = 3; + priority = 30; size = "128M"; content = { type = "luks"; @@ -85,7 +91,7 @@ in }; }; main = { - priority = 4; + priority = 40; content = { type = "luks"; name = "razmo"; @@ -117,14 +123,14 @@ in type = "gpt"; partitions = { swap = { - priority = 1; + priority = 10; start = "2048"; size = "8G"; type = "8200"; # Linux swap content = { type = "luks"; name = "rapswap"; - initrdUnlock = true; + initrdUnlock = false; settings = { keyFile = "/etc/keys/rapswap"; allowDiscards = true; @@ -137,7 +143,7 @@ in }; }; main = { - priority = 2; + priority = 20; content = { type = "luks"; name = "rapido"; @@ -163,16 +169,13 @@ in mountOptions = btrfs_args_ssd; }; "home.rapido" = { - mountpoint = "/home.old"; + mountpoint = "/mnt/old/home"; mountOptions = btrfs_args_ssd; }; nix = { mountpoint = "/nix"; mountOptions = btrfs_args_ssd; }; - nixosboot = { - mountpoint = "/boot"; - }; nixos = { mountpoint = "/"; }; diff --git a/curacao/os.nix b/curacao/os.nix index 3c110b9..b92c72c 100644 --- a/curacao/os.nix +++ b/curacao/os.nix @@ -9,12 +9,7 @@ networking.hostName = "curacao"; boot = { - initrd.secrets = { - "/etc/keys/rapido" = "/etc/keys/rapido"; - "/etc/keys/rapswap" = "/etc/keys/rapswap"; - }; loader = { - grub.enableCryptodisk = true; efi.efiSysMountPoint = "/efi"; }; }; diff --git a/hm/desktop.nix b/hm/desktop.nix index 926e14c..eaf6c20 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -625,7 +625,6 @@ in network = { listenAddress = "0.0.0.0"; # So it can be controlled from home # TODO ... and whoever is the Wi-Fi network I'm using, which, not great - port = 8601; # FIXME Chose a different one for testing, should revert startWhenNeeded = true; }; extraConfig = '' From c25996ed8f74d564307c32c124c3432904f1213a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 14:04:24 +0100 Subject: [PATCH 05/37] Third attempt at booting NixOS on curacao directly --- curacao/dk.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curacao/dk.nix b/curacao/dk.nix index ec42f2d..d66bd20 100644 --- a/curacao/dk.nix +++ b/curacao/dk.nix @@ -150,7 +150,7 @@ in initrdUnlock = true; passwordFile = passwordFile; settings = { - keyFile = "/etc/keys/rapido"; + # keyFile = "/etc/keys/rapido"; allowDiscards = true; }; content = { From 42ab4908df1b297ce764af5ca600ccb08067f754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 14:37:23 +0100 Subject: [PATCH 06/37] Fourth attempt at booting NixOS on curacao directly --- curacao/dk.nix | 13 +++++++------ curacao/os.nix | 1 + os/geoffrey.nix | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/curacao/dk.nix b/curacao/dk.nix index d66bd20..5f14889 100644 --- a/curacao/dk.nix +++ b/curacao/dk.nix @@ -1,5 +1,7 @@ { passwordFile ? "/should_not_be_needed_in_this_context", ... }: # FIXME Subvolumes for backup. If they're not created with the script. Add the script btw. +# Doesn't seem like it's possible to decrypt luks partition at stage2, hence why everything is with a password now +# TODO Find a way to use keys in filesystem # TODO Not relatime everywhere, thank you # TODO Default options let @@ -72,11 +74,10 @@ in content = { type = "luks"; name = "boot"; - initrdUnlock = false; extraFormatArgs = [ "--type luks1" ]; passwordFile = passwordFile; settings = { - keyFile = "/etc/keys/boot"; + # keyFile = "/etc/keys/boot"; }; content = { type = "filesystem"; @@ -95,9 +96,9 @@ in content = { type = "luks"; name = "razmo"; - initrdUnlock = false; + passwordFile = passwordFile; settings = { - keyFile = "/etc/keys/razmo"; + # keyFile = "/etc/keys/razmo"; }; content = { type = "btrfs"; @@ -130,9 +131,9 @@ in content = { type = "luks"; name = "rapswap"; - initrdUnlock = false; + passwordFile = passwordFile; settings = { - keyFile = "/etc/keys/rapswap"; + # keyFile = "/etc/keys/rapswap"; allowDiscards = true; }; content = { diff --git a/curacao/os.nix b/curacao/os.nix index b92c72c..16f476b 100644 --- a/curacao/os.nix +++ b/curacao/os.nix @@ -9,6 +9,7 @@ networking.hostName = "curacao"; boot = { + initrd.luks.reusePassphrases = true; loader = { efi.efiSysMountPoint = "/efi"; }; diff --git a/os/geoffrey.nix b/os/geoffrey.nix index cd27181..08b09a7 100644 --- a/os/geoffrey.nix +++ b/os/geoffrey.nix @@ -4,6 +4,8 @@ ]; + users.users.root.initialHashedPassword = "$y$j9T$e64bjL7iyVlniEKwKbM9g0$cCn74za0r6L9QMO20Fdxz3/SX0yvhz3Xd6.2BhtbRL1"; # Not a real password + users.users.geoffrey = { isNormalUser = true; extraGroups = [ "adbusers" "wheel" ]; From 8596d5809f071f86ec71910d044255bc257c81df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 17:03:59 +0100 Subject: [PATCH 07/37] Fix less colors --- hm/common.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hm/common.nix b/hm/common.nix index 85276af..8958216 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -54,13 +54,13 @@ in TIME_STYLE = "+%Y-%m-%d %H:%M:%S"; # Less colors LESS = "-R"; - LESS_TERMCAP_mb = "$'\E[1;31m'"; # begin blink - LESS_TERMCAP_md = "$'\E[1;36m'"; # begin bold - LESS_TERMCAP_me = "$'\E[0m'"; # reset bold/blink - LESS_TERMCAP_so = "$'\E[01;44;33m'"; # begin reverse video - LESS_TERMCAP_se = "$'\E[0m'"; # reset reverse video - LESS_TERMCAP_us = "$'\E[1;32m'"; # begin underline - LESS_TERMCAP_ue = "$'\E[0m'"; # reset underline + LESS_TERMCAP_mb = "$(echo $'\\E[1;31m')"; # begin blink + LESS_TERMCAP_md = "$(echo $'\\E[1;36m')"; # begin bold + LESS_TERMCAP_me = "$(echo $'\\E[0m')"; # reset bold/blink + LESS_TERMCAP_so = "$(echo $'\\E[01;44;33m')"; # begin reverse video + LESS_TERMCAP_se = "$(echo $'\\E[0m')"; # reset reverse video + LESS_TERMCAP_us = "$(echo $'\\E[1;32m')"; # begin underline + LESS_TERMCAP_ue = "$(echo $'\\E[0m')"; # reset underline # Fzf FZF_COMPLETION_OPTS = "${lib.strings.concatStringsSep " " config.programs.fzf.fileWidgetOptions}"; }; From 405a25e2aba190f2cf48728351045ff3d88405cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 17:04:29 +0100 Subject: [PATCH 08/37] Fix boot --- curacao/dk.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curacao/dk.nix b/curacao/dk.nix index d66bd20..fa2660b 100644 --- a/curacao/dk.nix +++ b/curacao/dk.nix @@ -85,7 +85,7 @@ in mountOptions = [ "rw" "relatime" - "stripe=4" + # "stripe=4" # For some reason doesn't work on NixOS ]; }; }; From 1840ed67c9eafe84b0dec03f137aef1cb27e148a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 17:04:59 +0100 Subject: [PATCH 09/37] Different screen names under NixOS Breaks curacao_test though --- curacao/options.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curacao/options.nix b/curacao/options.nix index 6bed395..f07bbbd 100644 --- a/curacao/options.nix +++ b/curacao/options.nix @@ -3,7 +3,7 @@ frogeye = { desktop = { xorg = true; - x11_screens = [ "HDMI-1-0" "eDP1" ]; + x11_screens = [ "HDMI-1-0" "eDP-1" ]; maxVideoHeight = 1440; numlock = true; phasesBrightness = { From 064ff2e9ab105ef2ded479c02ed6772d57e98648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 17:05:36 +0100 Subject: [PATCH 10/37] Actually, shell history is state --- hm/common.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hm/common.nix b/hm/common.nix index 8958216..6cf59d9 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -138,7 +138,7 @@ in # TODO Maybe make nixpkg wrapper instead? So it also works from dmenu # Could also accept my fate... Home-manager doesn't necessarily make it easy to put things out of the home directory historySize = 100000; - historyFile = "${config.xdg.cacheHome}/shell_history"; + historyFile = "${config.xdg.stateHome}/shell_history"; in { From 88ef6925a42f2c22c4b88b5b3dd5556bb41fda7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 17:06:04 +0100 Subject: [PATCH 11/37] Fix i3 fonts --- hm/desktop.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hm/desktop.nix b/hm/desktop.nix index eaf6c20..fda7639 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -79,9 +79,13 @@ in mode_pres_sec = "Presentation (secondary display)"; mode_screen = "Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default"; mode_temp = "Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue"; + fonts = config.stylix.fonts; in { modifier = "Mod4"; + fonts = { + names = [ fonts.sansSerif.name ]; + }; terminal = "alacritty"; colors = let ignore = "#ff00ff"; in with config.lib.stylix.colors.withHashtag; lib.mkForce { @@ -512,7 +516,7 @@ in autorandr = { enable = true; hooks.postswitch = { - background = "${pkgs.feh}/bin/feh --no-fehbg --bg-fill ${config.stylix.image}"; + background = "${pkgs.feh}/bin/feh --no-fehbg --bg-fill ${config.stylix.image}"; }; }; mpv = { From c59ee1169668165ba189a7a9a07f9fc18cc611ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 17:07:44 +0100 Subject: [PATCH 12/37] Re-add bluetooth I forgot --- hm/desktop.nix | 1 + os/desktop.nix | 30 ++++++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/hm/desktop.nix b/hm/desktop.nix index fda7639..82250f0 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -587,6 +587,7 @@ in }; }; services = { + blueman-applet.enable = true; unclutter.enable = true; dunst = { diff --git a/os/desktop.nix b/os/desktop.nix index ab3b08c..f361cc0 100644 --- a/os/desktop.nix +++ b/os/desktop.nix @@ -3,16 +3,18 @@ config = lib.mkIf config.frogeye.desktop.xorg { # Enable the X11 windowing system - services.xserver = { - enable = true; - windowManager.i3.enable = true; - displayManager.defaultSession = "none+i3"; + services = { + blueman.enable = true; + xserver = { + enable = true; + windowManager.i3.enable = true; + displayManager.defaultSession = "none+i3"; - # Keyboard layout - extraLayouts.qwerty-fr = { - description = "QWERTY-fr"; - languages = [ "fr" ]; - symbolsFile = "${pkgs.stdenv.mkDerivation { + # Keyboard layout + extraLayouts.qwerty-fr = { + description = "QWERTY-fr"; + languages = [ "fr" ]; + symbolsFile = "${pkgs.stdenv.mkDerivation { name = "qwerty-fr-keypad"; src = builtins.fetchGit { url = "https://github.com/qwerty-fr/qwerty-fr.git"; @@ -27,13 +29,17 @@ runHook postInstall ''; }}/linux/us_qwerty-fr"; + }; + layout = "qwerty-fr"; }; - layout = "qwerty-fr"; }; - # Enable sound + # Enable sound & bluetooth sound.enable = true; - hardware.pulseaudio.enable = true; + hardware = { + bluetooth.enable = true; + pulseaudio.enable = true; + }; # UPST # TODO Find a way to override packages either at NixOS level or HM level depending on what is used From a6f706d0880ad1bc4fa0944519a043d3e33c4671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 17:08:18 +0100 Subject: [PATCH 13/37] Add Signal --- hm/extra.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hm/extra.nix b/hm/extra.nix index b346f05..253266a 100644 --- a/hm/extra.nix +++ b/hm/extra.nix @@ -19,6 +19,9 @@ # android tools android-tools + # Communication + signal-desktop + # downloading # transmission TODO Collision if both transmissions are active? From 417ef5a74603f87a0c5641c77420fd62a3e605f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 17:08:29 +0100 Subject: [PATCH 14/37] Fix Wi-Fi config generation Actually the first thing I did, but last commit because... why do I bother again? --- os/wireless/import.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/os/wireless/import.py b/os/wireless/import.py index 85ac1d5..d4535be 100755 --- a/os/wireless/import.py +++ b/os/wireless/import.py @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 +#! nix-shell -p python3 python3Packages.pyaml """ Exports Wi-Fi networks configuration stored in pass into a format readable by Nix. @@ -19,7 +21,7 @@ import yaml # passpy doesn't handle encoding properly, so doing this with calls -PASSWORD_STORE = os.path.expanduser("~/.password-store") +PASSWORD_STORE = os.path.expanduser("~/.local/share/pass") SUBFOLDER = "wifi" SEPARATE_PASSWORDS = False # TODO Find a way to make then env file available at whatever time it is needed From 926e620b5e03a32d06d2e1dc40af6bcd4a165b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 17:29:34 +0100 Subject: [PATCH 15/37] Fix shell title --- hm/common.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hm/common.nix b/hm/common.nix index 6cf59d9..49d1d94 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -196,7 +196,10 @@ in duration = "$( test -n \"$__TIMER\" && echo $(( $EPOCHREALTIME - $\{__TIMER:-EPOCHREALTIME})) || echo 0 )"; # UPST Implement this properly in home-manager, would allow for bash support }; - extraUpdatePS1 = ''unset __TIMER''; + extraUpdatePS1 = '' + unset __TIMER + echo -en "\033]0; $USER@$HOST $PWD\007" + ''; }; gpg = { enable = true; From 16ca8b3b1851b3cdb1c5cfddb2b120b67aaba78f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 17:37:04 +0100 Subject: [PATCH 16/37] Fix bsh --- hm/scripts/bsh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hm/scripts/bsh b/hm/scripts/bsh index 9ad639b..45e21a7 100755 --- a/hm/scripts/bsh +++ b/hm/scripts/bsh @@ -1,6 +1,4 @@ -#!/usr/bin/env nix-shell -#! nix-shell -i bash --pure -#! nix-shell -p bash openssh coreutils gawk gnused +#!/usr/bin/env bash # TODO More integrated with current config From 2515d3e8eaf5903f0079182ad1b12e1c1a53641e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 18:58:13 +0100 Subject: [PATCH 17/37] Don't use lessopen/lesspipe Broken, will ask for strings. --- os/common.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/os/common.nix b/os/common.nix index 5719d75..bf48d7f 100644 --- a/os/common.nix +++ b/os/common.nix @@ -39,6 +39,7 @@ ccache.enable = true; # TODO Not enough, see https://nixos.wiki/wiki/CCache. # Might want to see if it's worth using on NixOS + less.lessopen = null; # Don't use lessopen gnupg.agent.enable = true; # Let users mount disks From 6f1121d731caac440e8e1e746f12167a78639444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 19:00:33 +0100 Subject: [PATCH 18/37] Properly add syncthing --- hm/common.nix | 1 - hm/extra.nix | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hm/common.nix b/hm/common.nix index 49d1d94..cb0337b 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -465,7 +465,6 @@ in khard khal todoman - syncthing # TODO Lots of redundancy with other way things are defined here diff --git a/hm/extra.nix b/hm/extra.nix index 253266a..84002cf 100644 --- a/hm/extra.nix +++ b/hm/extra.nix @@ -64,5 +64,8 @@ # https://hydra.nixos.org/job/nixos/release-23.11/nixpkgs.blender.aarch64-linux blender ]); + services = { + syncthing.enable = true; + }; }; } From 8dfaa80f96c1cda7819aa45e3e79bdbdc8846746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 19:02:59 +0100 Subject: [PATCH 19/37] Use gitFull I want gitk --- hm/common.nix | 1 + hm/dev.nix | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/hm/common.nix b/hm/common.nix index cb0337b..e8922ed 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -248,6 +248,7 @@ in less.enable = true; git = { enable = true; + package = pkgs.gitFull; aliases = { "git" = "!exec git"; # In case I write one too many git }; diff --git a/hm/dev.nix b/hm/dev.nix index f98bcf9..648d7a7 100644 --- a/hm/dev.nix +++ b/hm/dev.nix @@ -6,7 +6,6 @@ home.packages = with pkgs; [ # Common perf-tools - git jq yq universal-ctags From 740e10373068d80c69068573d899af3d33e2da03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 19:06:10 +0100 Subject: [PATCH 20/37] Review system packages --- os/common.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/os/common.nix b/os/common.nix index bf48d7f..f3d8836 100644 --- a/os/common.nix +++ b/os/common.nix @@ -25,10 +25,8 @@ environment.systemPackages = with pkgs; [ wget kexec-tools - openvpn - - # Needed for all the fetchFromGit in this repo on nixos-rebuild - git + neovim # So we have a working editor in rescue mode + git # Needed for all the fetchFromGit in this repo on nixos-rebuild ]; nixpkgs.config.allowUnfree = true; From a3552634b65d468ff02eb39476d413eba6d0841d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 22:22:14 +0100 Subject: [PATCH 21/37] Add curacao backup stuff --- build_hm.sh | 2 +- curacao/backup/backup.sh | 83 ++++++++++++++++++++++++++++++++++++++ curacao/backup/default.nix | 64 +++++++++++++++++++++++++++++ curacao/dk.nix | 1 - curacao/os.nix | 1 + 5 files changed, 149 insertions(+), 2 deletions(-) create mode 100755 curacao/backup/backup.sh create mode 100644 curacao/backup/default.nix diff --git a/build_hm.sh b/build_hm.sh index b675d9d..08a672b 100755 --- a/build_hm.sh +++ b/build_hm.sh @@ -17,7 +17,7 @@ function help { echo " -h: Display this help message." } -while getopts "hvb" OPTION +while getopts "h" OPTION do case "$OPTION" in h) diff --git a/curacao/backup/backup.sh b/curacao/backup/backup.sh new file mode 100755 index 0000000..38448c2 --- /dev/null +++ b/curacao/backup/backup.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +# Parse arguments +function help { + echo "Usage: $0 [-h|-i] volume" + echo "Backup BTRFS subvolume on rapido to razmo." + echo + echo "Arguments:" + echo " volume: Name of the subvolume to backup" + echo + echo "Options:" + echo " -h: Display this help message." + echo " -i: Don't fail if the receiving subvolume doesn't exist." +} + +init=false +while getopts "hi" OPTION +do + case "$OPTION" in + h) + help + exit 0 + ;; + i) + init=true + ;; + ?) + help + exit 2 + ;; + esac +done +shift "$((OPTIND - 1))" + +if [ "$#" -ne 1 ] +then + help + exit 2 +fi +volume="$1" + +# Assertions +[ -d "/mnt/rapido/${volume}" ] +[ -d "/mnt/rapido/${volume}.bkp" ] || "$init" +[ ! -d "/mnt/rapido/${volume}.new" ] +[ -d "/mnt/razmo/${volume}.bkp" ] || "$init" +[ -d "/mnt/razmo/${volume}" ] || "$init" +[ ! -d "/mnt/razmo/${volume}.new" ] +[ ! -d "/mnt/razmo/${volume}.snapshots" ] + +# Taking a snapshot of the running subvolume +btrfs subvolume snapshot -r "/mnt/rapido/${volume}" "/mnt/rapido/${volume}.new" + +# Sending (the difference with) the last backup to the backup disk +function error_handler() { + btrfs subvolume delete "/mnt/rapido/${volume}.new" || true + btrfs subvolume delete "/mnt/razmo/${volume}.new" || true +} +trap error_handler ERR +if [ -d "/mnt/rapido/${volume}.bkp" ] +then + btrfs send -p "/mnt/rapido/${volume}.bkp" "/mnt/rapido/${volume}.new" | btrfs receive /mnt/razmo +else + btrfs send "/mnt/rapido/${volume}.new" | btrfs receive /mnt/razmo +fi +trap - ERR + +# Removing old backups and putting the new one in place +[ ! -d "/mnt/rapido/${volume}.bkp" ] || btrfs subvolume delete "/mnt/rapido/${volume}.bkp" +mv "/mnt/rapido/${volume}.new" "/mnt/rapido/${volume}.bkp" +[ ! -d "/mnt/razmo/${volume}.bkp" ] || btrfs subvolume delete "/mnt/razmo/${volume}.bkp" +mv "/mnt/razmo/${volume}.new" "/mnt/razmo/${volume}.bkp" + +# Create a writeable clone in case we need to boot on the HDD +# Needs to move away then back the .snapshots folder +[ ! -d "/mnt/razmo/${volume}/.snapshots" ] || mv "/mnt/razmo/${volume}/.snapshots" "/mnt/razmo/${volume}.snapshots" +[ ! -d "/mnt/razmo/${volume}" ] || btrfs subvolume delete "/mnt/razmo/${volume}" +btrfs subvolume snapshot "/mnt/razmo/${volume}.bkp" "/mnt/razmo/${volume}" +[ ! -d "/mnt/razmo/${volume}.snapshots" ] || mv "/mnt/razmo/${volume}.snapshots" "/mnt/razmo/${volume}/.snapshots" + +sync diff --git a/curacao/backup/default.nix b/curacao/backup/default.nix new file mode 100644 index 0000000..5041c60 --- /dev/null +++ b/curacao/backup/default.nix @@ -0,0 +1,64 @@ +{ pkgs, lib, ... }: +# MANU Snapper is not able to create the snapshot directory, so you'll need to do this after eventually running the backup script: +# sudo btrfs subvol create /mnt/razmo/$subvolume/.snapshots +let + backup_subvolumes = [ "nixos" "home.rapido" ]; + backup_app = pkgs.writeShellApplication { + name = "backup-subvolume"; + runtimeInputs = with pkgs; [ coreutils btrfs-progs ]; + text = builtins.readFile ./backup.sh; + }; + snapper_subvolumes = [ "nixos" "home.rapido" "home.razmo" ]; +in +{ + services = + let + default = { + # filesystem type + FSTYPE = "btrfs"; + + # run daily number cleanup + NUMBER_CLEANUP = true; + NUMBER_MIN_AGE = 1800; + NUMBER_LIMIT = 25; + + # create hourly snapshots + TIMELINE_CREATE = true; + + # cleanup hourly snapshots after some time + TIMELINE_CLEANUP = true; + TIMELINE_MIN_AGE = 1800; + TIMELINE_LIMIT_HOURLY = 24; + TIMELINE_LIMIT_DAILY = 31; + TIMELINE_LIMIT_WEEKLY = 8; + TIMELINE_LIMIT_MONTHLY = 0; + TIMELINE_LIMIT_YEARLY = 0; + + # cleanup empty pre-post-pairs + EMPTY_PRE_POST_CLEANUP = true; + }; + in + { + snapper.configs = lib.attrsets.mergeAttrsList (map (s: { "${s}" = default // { SUBVOLUME = "/mnt/razmo/${s}"; }; }) snapper_subvolumes); + }; + + + systemd = { + services.bkp_rapido = { + description = "Make a snapshot of the SSD to the HDD"; + before = [ "snapper-timeline.service" ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = map (s: "${backup_app}/bin/backup-subvolume ${s}") backup_subvolumes; + }; + # TODO Harden + }; + timers.bkp_rapido = { + description = "Regular snapshot of SSD to HDD"; + timerConfig = { + OnCalendar = "hourly"; + }; + wantedBy = [ "timers.target" ]; + }; + }; +} diff --git a/curacao/dk.nix b/curacao/dk.nix index fa2660b..62323c8 100644 --- a/curacao/dk.nix +++ b/curacao/dk.nix @@ -1,5 +1,4 @@ { passwordFile ? "/should_not_be_needed_in_this_context", ... }: -# FIXME Subvolumes for backup. If they're not created with the script. Add the script btw. # TODO Not relatime everywhere, thank you # TODO Default options let diff --git a/curacao/os.nix b/curacao/os.nix index b92c72c..9e9d2ea 100644 --- a/curacao/os.nix +++ b/curacao/os.nix @@ -5,6 +5,7 @@ ./options.nix ./hardware.nix ./dk.nix + ./backup ]; networking.hostName = "curacao"; From a46e7d7bca5d1fd3830997a715f650be03693520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 22:39:11 +0100 Subject: [PATCH 22/37] Fix backlight --- curacao/options.nix | 7 ++- hm/desktop.nix | 6 ++- hm/style.nix | 4 +- options.nix | 9 ++-- pindakaas/options.nix | 7 ++- .../roles/system/files/getty.service | 2 - .../system/files/xorg/intel_backlight.conf | 5 --- .../automatrop/roles/system/tasks/main.yml | 43 ------------------- 8 files changed, 17 insertions(+), 66 deletions(-) delete mode 100644 unprocessed/config/automatrop/roles/system/files/getty.service delete mode 100644 unprocessed/config/automatrop/roles/system/files/xorg/intel_backlight.conf diff --git a/curacao/options.nix b/curacao/options.nix index f07bbbd..45ab31a 100644 --- a/curacao/options.nix +++ b/curacao/options.nix @@ -8,10 +8,9 @@ numlock = true; phasesBrightness = { enable = true; - backlight = "intel_backlight"; - jour = 40000; - crepuscule = 10000; - nuit = 1; + jour = "40000"; + crepuscule = "10000"; + nuit = "1"; }; }; dev = { diff --git a/hm/desktop.nix b/hm/desktop.nix index 82250f0..4a3eb3c 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -148,6 +148,9 @@ in "XF86AudioPrev" = "exec ${pkgs.mpc-cli}/bin/mpc prev"; "XF86AudioPlay" = "exec ${pkgs.mpc-cli}/bin/mpc toggle"; "XF86AudioNext" = "exec ${pkgs.mpc-cli}/bin/mpc next"; + # Backlight + "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set +5%"; + "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-"; # Misc "${mod}+F10" = "exec ${ pkgs.writeShellScript "show-keyboard-layout" '' @@ -641,6 +644,8 @@ in home = { packages = with pkgs; [ + pavucontrol # Because can't use Win+F1X on Pinebook 🙃 + # remote tigervnc @@ -677,7 +682,6 @@ in xclip keynav xorg.xinit - xorg.xbacklight # TODO Make this clean. Service? diff --git a/hm/style.nix b/hm/style.nix index a98707b..29a212d 100644 --- a/hm/style.nix +++ b/hm/style.nix @@ -47,12 +47,12 @@ in dconf.enable = false; # Otherwise standalone home-manager complains it can't find /etc/dbus-1/session.conf on Arch. # Symlinking it to /usr/share/dbus-1/session.conf goes further but not much. - # TODO Use xbacklight instead (pindakaas doesn't seem to support it OOTB) home.packages = map (phase: (pkgs.writeShellApplication { name = "${phase.command}"; + runtimeInputs = [ pkgs.brightnessctl ]; text = (lib.optionalString cfg.enable '' - echo ${builtins.toString (builtins.getAttr phase.command cfg)} | sudo tee /sys/class/backlight/${cfg.backlight}/brightness + brightnessctl set ${builtins.getAttr phase.command cfg} '') + '' echo ${phase.polarity} > ${polarityFile} if command -v home-manager diff --git a/options.nix b/options.nix index 4b2a554..11a0552 100644 --- a/options.nix +++ b/options.nix @@ -7,7 +7,7 @@ xorg = lib.mkEnableOption "Enable X11 support"; numlock = lib.mkEnableOption "Auto-enable numlock"; x11_screens = lib.mkOption { - default = ["UNSET1"]; + default = [ "UNSET1" ]; description = "A list of xrandr screen names from left to right."; type = lib.types.listOf lib.types.str; }; @@ -19,10 +19,9 @@ }; phasesBrightness = { enable = lib.mkEnableOption "Set a specific brightness for the screen when running phases commands"; - backlight = lib.mkOption { type = lib.types.str; description = "Name of the backlight device"; }; - jour = lib.mkOption { type = lib.types.int; description = "brightness value for phase: jour"; }; - crepuscule = lib.mkOption { type = lib.types.int; description = "brightness value for phase: crepuscule"; }; - nuit = lib.mkOption { type = lib.types.int; description = "brightness value for phase: nuit"; }; + jour = lib.mkOption { type = lib.types.str; default = "100%"; description = "brightnessctl value for phase: jour"; }; + crepuscule = lib.mkOption { type = lib.types.str; default = "50%"; description = "brightnessctl value for phase: crepuscule"; }; + nuit = lib.mkOption { type = lib.types.str; default = "1%"; description = "brightnessctl value for phase: nuit"; }; }; }; dev = { diff --git a/pindakaas/options.nix b/pindakaas/options.nix index 2f7df32..56b5eba 100644 --- a/pindakaas/options.nix +++ b/pindakaas/options.nix @@ -7,10 +7,9 @@ maxVideoHeight = 720; phasesBrightness = { enable = true; - backlight = "edp-backlight"; - jour = 3500; - crepuscule = 3000; - nuit = 700; + jour = "3500"; + crepuscule = "3000"; + nuit = "700"; }; }; } diff --git a/unprocessed/config/automatrop/roles/system/files/getty.service b/unprocessed/config/automatrop/roles/system/files/getty.service deleted file mode 100644 index 1d6b77a..0000000 --- a/unprocessed/config/automatrop/roles/system/files/getty.service +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -ExecStartPre=/bin/sh -c 'setleds +num < /dev/%I' diff --git a/unprocessed/config/automatrop/roles/system/files/xorg/intel_backlight.conf b/unprocessed/config/automatrop/roles/system/files/xorg/intel_backlight.conf deleted file mode 100644 index 36f6eb5..0000000 --- a/unprocessed/config/automatrop/roles/system/files/xorg/intel_backlight.conf +++ /dev/null @@ -1,5 +0,0 @@ -Section "Device" - Identifier "Intel Graphics" - Driver "intel" - Option "Backlight" "intel_backlight" -EndSection diff --git a/unprocessed/config/automatrop/roles/system/tasks/main.yml b/unprocessed/config/automatrop/roles/system/tasks/main.yml index 002d579..4a012d1 100644 --- a/unprocessed/config/automatrop/roles/system/tasks/main.yml +++ b/unprocessed/config/automatrop/roles/system/tasks/main.yml @@ -1,28 +1,5 @@ # Xorg configuration -- name: Check if there is Intel backlight - ansible.builtin.stat: - path: /sys/class/backlight/intel_backlight - register: intel_backlight - when: display_server == 'x11' - -- name: Install Intel video drivers (Arch based) - community.general.pacman: - name: xf86-video-intel - # state: "{{ intel_backlight.stat.exists }}" - state: present - become: true - when: display_server == 'x11' and intel_backlight.stat.exists and arch_based - # TODO With software role? Would permit other distributions - -- name: Configure Xorg Intel backlight - ansible.builtin.copy: - src: xorg/intel_backlight.conf - dest: "{{ item }}/20-intel_backlight.conf" - become: true - when: display_server == 'x11' and intel_backlight.stat.exists - loop: "{{ xorg_common_config_dirs }}" - - name: Configure Xorg joystick behaviour ansible.builtin.copy: src: xorg/joystick.conf @@ -48,23 +25,3 @@ vars: using_panfrost: "{{ 'panfrost' in (modules.content | b64decode) }}" notify: panfrost config changed - -# Numlock on boot - -- name: Set numlock on boot - ansible.builtin.copy: - src: getty.service - dest: /etc/systemd/system/getty@.service.d/override.conf - become: true - notify: - - systemd changed - when: auto_numlock - -- name: Unset numlock on boot - ansible.builtin.file: - path: /etc/systemd/system/getty@.service.d/override.conf - state: absent - become: true - notify: - - systemd changed - when: not auto_numlock From 4a1d065554fd4bd9743708967293abedf6ba4cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 23:43:01 +0100 Subject: [PATCH 23/37] Misc notes --- hm/common.nix | 2 +- hm/desktop.nix | 3 ++- install_os.sh | 8 +------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/hm/common.nix b/hm/common.nix index e8922ed..7d31ae7 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -506,7 +506,7 @@ in (builtins.toString ./scripts) ]; file = { - ".face" = { + ".face" = { # TODO Doesn't show on NixOS. See https://wiki.archlinux.org/title/LightDM#Changing_your_avatar ? source = pkgs.runCommand "face.png" { } "${pkgs.inkscape}/bin/inkscape ${./face.svg} -w 1024 -o $out"; }; }; diff --git a/hm/desktop.nix b/hm/desktop.nix index 4a3eb3c..68e5d91 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -37,7 +37,7 @@ in # lockColors = with config.lib.stylix.colors.withHashtag; { a = base00; b = base01; d = base00; }; # Black or White, depending on current theme # lockColors = with config.lib.stylix.colors.withHashtag; { a = base0A; b = base0B; d = base00; }; # Green + Yellow lockColors = { a = "#82a401"; b = "#466c01"; d = "#648901"; }; # Old - lockSvg = pkgs.writeText "lock.svg" ""; + lockSvg = pkgs.writeText "lock.svg" ""; lockPng = pkgs.runCommand "lock.png" { } "${pkgs.imagemagick}/bin/convert ${lockSvg} $out"; locker = pkgs.writeShellScript "i3-locker" '' @@ -48,6 +48,7 @@ in ${pkgs.lightdm}/bin/dm-tool lock # TODO Does that work for all DMs? + # TODO Might want to use i3lock on NixOS configs still? if [ $? -ne 0 ]; then if [ -d ${config.xdg.cacheHome}/lockpatterns ] then diff --git a/install_os.sh b/install_os.sh index 577e688..0091fa9 100755 --- a/install_os.sh +++ b/install_os.sh @@ -96,13 +96,6 @@ echo "{ ... }: { imports = [ ./hardware-configuration.nix ${nixos_config} ]; }" # Install NixOS! Or create a new generation. sudo nixos-install --no-root-password --root "$mountpoint" -# Install dotfiles. Actually not needed by nixos-install since it doesn't rewrite global paths to the mountpoint. -# Without it no nixos-rebuild from the system itself once installed though. -# Should probably be replaced with something like git-sync -# sudo mkdir -p $mountpoint/home/geoffrey/.config/ -# sudo cp -a ../dotfiles $mountpoint/home/geoffrey/.config/ -# sudo chown geoffrey:geoffrey $mountpoint/home/geoffrey -R - set +x # Signal the installation is done! @@ -113,3 +106,4 @@ echo "- Boot into the system" echo "- Transfer necessary private keys (or use ssh -A for testing)" echo "- Run git-sync-init" echo "- Check that the system can build itself" +echo "- Change root and user password" From b94e030619d7cfb25dc6f7c940421d9779c08577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 16 Dec 2023 23:55:14 +0100 Subject: [PATCH 24/37] Fix default browser --- hm/desktop.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hm/desktop.nix b/hm/desktop.nix index 68e5d91..0c70590 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -542,7 +542,7 @@ in xdg = { mimeApps = { enable = true; - associations.added = { + defaultApplications = { "text/html" = "org.qutebrowser.qutebrowser.desktop"; "x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop"; "x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop"; From 6b00a19d0c79cb61e841d0b9576f91446642ae72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 17 Dec 2023 12:37:41 +0100 Subject: [PATCH 25/37] Use specialisation to switch themes on NixOS --- hm/style.nix | 9 ++++++--- options.nix | 5 +++++ os/geoffrey.nix | 8 +++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/hm/style.nix b/hm/style.nix index 29a212d..e73c6d1 100644 --- a/hm/style.nix +++ b/hm/style.nix @@ -3,7 +3,8 @@ let # Currently last commit in https://github.com/danth/stylix/pull/194 stylix = builtins.fetchTarball "https://github.com/willemml/stylix/archive/2ed2b0086b41d582aca26e083c19c0e47c8991e3.tar.gz"; polarityFile = "${config.xdg.stateHome}/theme_polarity"; - polarity = if builtins.pathExists polarityFile then lib.strings.fileContents polarityFile else "light"; + polarityFromFile = if builtins.pathExists polarityFile then lib.strings.fileContents polarityFile else "light"; + polarity = if config.frogeye.polarity == "dynamic" then polarityFromFile else config.frogeye.polarity; phases = [ { command = "jour"; polarity = "light"; } { command = "crepuscule"; polarity = "dark"; } @@ -53,13 +54,15 @@ in runtimeInputs = [ pkgs.brightnessctl ]; text = (lib.optionalString cfg.enable '' brightnessctl set ${builtins.getAttr phase.command cfg} - '') + '' + '') + '' echo ${phase.polarity} > ${polarityFile} if command -v home-manager then home-manager switch else - sudo nixos-rebuild switch + # In two steps to get the visual changes slightly earlier + sudo /nix/var/nix/profiles/system/specialisation/${phase.polarity}/bin/switch-to-configuration test + sudo /nix/var/nix/profiles/system/specialisation/${phase.polarity}/bin/switch-to-configuration boot fi ''; }) diff --git a/options.nix b/options.nix index 11a0552..0321786 100644 --- a/options.nix +++ b/options.nix @@ -3,6 +3,11 @@ options.frogeye = { extra = lib.mkEnableOption "Big software"; gaming = lib.mkEnableOption "Games"; + polarity = lib.mkOption { + default = "dynamic"; + description = "Whether to use light theme or dark theme."; + type = lib.types.enum [ "dynamic" "light" "dark" ]; + }; desktop = { xorg = lib.mkEnableOption "Enable X11 support"; numlock = lib.mkEnableOption "Auto-enable numlock"; diff --git a/os/geoffrey.nix b/os/geoffrey.nix index cd27181..c76dde6 100644 --- a/os/geoffrey.nix +++ b/os/geoffrey.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, lib, config, ... }: { imports = [ @@ -32,6 +32,12 @@ useGlobalPkgs = true; }; + specialisation = { + dark.configuration.frogeye.polarity = "dark"; + light.configuration.frogeye.polarity = "light"; + }; + + # Because everything is encrypted and I'm the only user, this is fine. services.xserver.displayManager.autoLogin.user = "geoffrey"; } From cb22f38d1ddc263ba3347d0e1b40a7a84dbbbac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 17 Dec 2023 15:10:13 +0100 Subject: [PATCH 26/37] changes from curacao on Sun Dec 17 03:10:13 PM CET 2023 --- hm/scripts/ter | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hm/scripts/ter b/hm/scripts/ter index 01fbc3b..9fe1f59 100755 --- a/hm/scripts/ter +++ b/hm/scripts/ter @@ -2,6 +2,8 @@ #! nix-shell -i python3 --pure #! nix-shell -p python3 +# vim: set filetype=python : + import sys from math import inf @@ -14,11 +16,11 @@ if N < 2: sys.exit(1) -def trajet_str(a, b): +def trajet_str(a: int, b: int) -> str: return f"{gares[a]} → {gares[b]}" -def chemin_str(stack): +def chemin_str(stack: list[int]) -> str: return ", ".join( [trajet_str(stack[i], stack[i + 1]) for i in range(len(stack) - 1)] ) @@ -26,7 +28,7 @@ def chemin_str(stack): # Demande des prix des trajets -prices = dict() +prices: dict[int, dict[int, float]] = dict() for i in range(N): for j in range(N - 1, i, -1): @@ -50,7 +52,7 @@ maxiPrice = -inf maxiStack = None -def register_path(stack): +def register_path(stack: list[int]) -> None: price = sum([prices[stack[i]][stack[i + 1]] for i in range(len(stack) - 1)]) global miniPrice, maxiPrice, miniStack, maxiStack @@ -72,5 +74,7 @@ while stack[0] == 0: else: stack.append(stack[-1] + 1) +assert miniStack +assert maxiStack print(f"Prix minimum: {chemin_str(miniStack)} = {miniPrice:.2f} €") print(f"Prix maximum: {chemin_str(maxiStack)} = {maxiPrice:.2f} €") From 99e141d863d05dbca2634bb5d2adf93f0235a79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 17 Dec 2023 22:38:44 +0100 Subject: [PATCH 27/37] changes from curacao on Sun Dec 17 10:38:44 PM CET 2023 --- hm/common.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hm/common.nix b/hm/common.nix index 7d31ae7..7e67e5c 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -345,7 +345,7 @@ in }; # TODO Doesn't activate units by default. For now, we'll consider this as a safety feature. git-sync = { - enable = true; + enable = false; repositories = { dotfiles = { path = "${config.xdg.configHome}/dotfiles"; From b7cea97b71a11b0deabedcd5176f9eb49d886e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 17 Dec 2023 22:39:56 +0100 Subject: [PATCH 28/37] changes from curacao on Sun Dec 17 10:39:56 PM CET 2023 --- hm/common.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hm/common.nix b/hm/common.nix index 7e67e5c..1ec3e47 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -343,7 +343,7 @@ in enableZshIntegration = true; pinentryFlavor = "gtk2"; # Falls back to curses when needed }; - # TODO Doesn't activate units by default. For now, we'll consider this as a safety feature. + # TODO Syncs a bit too often, also constantly asks for password, which is annoying. git-sync = { enable = false; repositories = { From 6ba936fb61e02372ddb70c179f2053ec8f830330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 17 Dec 2023 22:40:01 +0100 Subject: [PATCH 29/37] changes from curacao on Sun Dec 17 10:40:01 PM CET 2023 --- hm/common.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hm/common.nix b/hm/common.nix index 1ec3e47..b8c7121 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -343,7 +343,7 @@ in enableZshIntegration = true; pinentryFlavor = "gtk2"; # Falls back to curses when needed }; - # TODO Syncs a bit too often, also constantly asks for password, which is annoying. + # TODO Syncs a bit too often, also constantly asks for passphrase, which is annoying. git-sync = { enable = false; repositories = { From abd9447172d93f2003e1c1cd3cda0b7c0ed9aa88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 17 Dec 2023 22:53:54 +0100 Subject: [PATCH 30/37] Use PATH-using names for common variables Otherwise it uses the unwrapped package, which doesn't have the plugins and stuff. Also if upgrade, environment variables don't get updated, so it would use old stuff. --- hm/common.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hm/common.nix b/hm/common.nix index b8c7121..da45364 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -475,8 +475,8 @@ in ]; sessionVariables = { # Favourite commands - PAGER = "${pkgs.less}/bin/less"; - EDITOR = "${pkgs.neovim}/bin/nvim"; + PAGER = "less"; + EDITOR = "nvim"; # Extra config BOOT9_PATH = "${config.xdg.dataHome}/citra-emu/sysdata/boot9.bin"; @@ -492,7 +492,7 @@ in YARN_DISABLE_SELF_UPDATE_CHECK = "true"; # This also disable the creation of a ~/.yarnrc file } // lib.optionalAttrs config.frogeye.desktop.xorg { # Favourite commands - VISUAL = "${pkgs.neovim}/bin/nvim"; + VISUAL = "nvim"; BROWSER = "${config.programs.qutebrowser.package}/bin/qutebrowser"; # Extra config From a250cd0f4222b75922abdcc54ad87c9a13037bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 18 Dec 2023 15:21:38 +0100 Subject: [PATCH 31/37] Add file --- hm/common.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hm/common.nix b/hm/common.nix index da45364..6cf4489 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -412,6 +412,7 @@ in powerline-go # terminal essentials + file moreutils man unzip From 9b3564f20e30ed97cfa45d59844e5e7cfe0b82a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 18 Dec 2023 19:32:16 +0100 Subject: [PATCH 32/37] Hardware accelerate mpv --- hm/desktop.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hm/desktop.nix b/hm/desktop.nix index 0c70590..e5796c2 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -528,12 +528,17 @@ in config = { audio-display = false; save-position-on-quit = true; - osc = false; # # Required by thumbnail script + osc = false; # Required by thumbnail script + # Hardware acceleration (from https://nixos.wiki/wiki/Accelerated_Video_Playback#MPV) + hwdec = "auto-safe"; + vo = "gpu"; + profile = "gpu-hq"; }; scripts = with pkgs.mpvScripts; [ thumbnail ]; scriptOpts = { mpv_thumbnail_script = { cache_directory = "/tmp/mpv_thumbs_${config.home.username}"; + mpv_hwdec = "auto-safe"; }; }; }; From 6b07cc0cbeaf4c3dd00860c1bddb5c6cb16bc4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 18 Dec 2023 19:50:13 +0100 Subject: [PATCH 33/37] Clean some OS stuff --- os/common.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/os/common.nix b/os/common.nix index f3d8836..e4dd9a1 100644 --- a/os/common.nix +++ b/os/common.nix @@ -4,8 +4,7 @@ time.timeZone = "Europe/Amsterdam"; - # Might fill emptiness? - boot.consoleLogLevel = 6; # KERN_INFO + boot.tmp.cleanOnBoot = true; # TODO qwerty-fr for console @@ -38,7 +37,6 @@ # TODO Not enough, see https://nixos.wiki/wiki/CCache. # Might want to see if it's worth using on NixOS less.lessopen = null; # Don't use lessopen - gnupg.agent.enable = true; # Let users mount disks udevil.enable = true; @@ -63,9 +61,6 @@ # TODO Hibernation? - # TEST - system.copySystemConfiguration = true; - # Use defaults from system.stateVersion = "23.11"; From c14580388152e153efc6b5062f6644b9dbf778f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 18 Dec 2023 20:59:05 +0100 Subject: [PATCH 34/37] bsh: Hide base64 string from process list --- hm/scripts/bsh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hm/scripts/bsh b/hm/scripts/bsh index 45e21a7..be6ef6a 100755 --- a/hm/scripts/bsh +++ b/hm/scripts/bsh @@ -42,12 +42,16 @@ then grep -o '^\s*[^#]*' $SCRIPT_DIR/.bsh/inputrc | sed 's/^\s\+//' > "${WORK}/i" grep -o '^\s*[^"]*' $SCRIPT_DIR/.bsh/vimrc | sed 's/^\s\+//' > "${WORK}/v" + # Creating entrypoint + echo "bash --rcfile ${DEST}/b" > "${WORK}/e" + echo "rm -rf ${DEST}" >> "${WORK}/e" + # TODO Do not remove unless last one connected + # Crafting command b64="$(cd "$CACHE_DIR"; tar czf - "$FOLDER_NAME" | base64 -w 0)" echo "echo $b64|base64 -d|tar xzC /tmp" > "${CACHE_DIR}/cmd" - echo "bash --rcfile ${DEST}/b" >> "${CACHE_DIR}/cmd" - echo "rm -rf ${DEST}" >> "${CACHE_DIR}/cmd" - # TODO Do not remove unless last one connected + # Due to magic, if the last command executed is bash, it disappears from the list of processes + echo "sh ${DEST}/e" >> "${CACHE_DIR}/cmd" # Cleanup rm -rf "$WORK" From 1a351ea5cbcaa00d80159d06d12028713547353f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 18 Dec 2023 21:17:23 +0100 Subject: [PATCH 35/37] bsh: Re-pro-du-ci-ble --- hm/scripts/bsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hm/scripts/bsh b/hm/scripts/bsh index be6ef6a..dc1780a 100755 --- a/hm/scripts/bsh +++ b/hm/scripts/bsh @@ -48,7 +48,7 @@ then # TODO Do not remove unless last one connected # Crafting command - b64="$(cd "$CACHE_DIR"; tar czf - "$FOLDER_NAME" | base64 -w 0)" + b64="$(cd "$CACHE_DIR"; tar czf - --sort=name "$FOLDER_NAME" | base64 -w 0)" echo "echo $b64|base64 -d|tar xzC /tmp" > "${CACHE_DIR}/cmd" # Due to magic, if the last command executed is bash, it disappears from the list of processes echo "sh ${DEST}/e" >> "${CACHE_DIR}/cmd" From b81f20c944cec988d9fed152a4b0deea65307734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 19 Dec 2023 18:03:29 +0100 Subject: [PATCH 36/37] Add ensure_nix script --- ensure_nix.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 ensure_nix.sh diff --git a/ensure_nix.sh b/ensure_nix.sh new file mode 100755 index 0000000..2e7d206 --- /dev/null +++ b/ensure_nix.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +# Runs the command given in a Nix environment, and create it if it doesn't exist. +# Useful for environments where nix isn't installed / you do not have root access + +# If you need a fresh slate: +# chmod +w .nix -R +# rm -rf .nix .nix-defexpr .nix-profile .config/nix .local/state/nix .local/share/nix .cache/nix + +set -euo pipefail +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +if [ ! -d /nix ] +then + # Doesn't support architectures other than x86_64 + NIX_USER_CHROOT_URL=https://github.com/nix-community/nix-user-chroot/releases/download/1.2.2/nix-user-chroot-bin-1.2.2-x86_64-unknown-linux-musl + NIX_USER_CHROOT_SHA256SUM=e11aff604bb8d3ffd1d9c0c68cd636816d7eb8da540de18ee3a41ccad7ac0972 + + nix_user_chroot="$HOME/.local/bin/nix-user-chroot" + mkdir -p "$(dirname "$nix_user_chroot")" + + nix_directory="$HOME/.nix" + mkdir -p "$nix_directory" + + if [ ! -x "$nix_user_chroot" ] || ! echo "$NIX_USER_CHROOT_SHA256SUM $nix_user_chroot" | sha256sum --check --status + then + wget "$NIX_USER_CHROOT_URL" -O "$nix_user_chroot" + echo "$NIX_USER_CHROOT_SHA256SUM $nix_user_chroot" | sha256sum --check --status + chmod +x "$nix_user_chroot" + fi + exec "$nix_user_chroot" "$nix_directory" "$0" "$@" + exit 1 +fi + +nix_profile_path="$HOME/.nix-profile/etc/profile.d/nix.sh" + +if [ ! -f "$nix_profile_path" ] +then + NIX_INSTALLER_URL=https://releases.nixos.org/nix/nix-2.19.2/install + NIX_INSTALLER_SHA256SUM=435f0d7e11f7c7dffeeab0ec9cc55723f6d3c03352379d785633cf4ddb5caf90 + + nix_installer="$(mktemp)" + + wget "$NIX_INSTALLER_URL" -O "$nix_installer" + echo "$NIX_INSTALLER_SHA256SUM $nix_installer" | sha256sum --check --status + chmod +x "$nix_installer" + + "$nix_installer" --no-daemon --yes --no-channel-add --no-modify-profile +fi + +. "$nix_profile_path" + +"${SCRIPT_DIR}/add_channels.sh" + +exec "$@" From 06f219f0c833e499e6b360660dacffaeae002094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 19 Dec 2023 23:09:25 +0100 Subject: [PATCH 37/37] mpv: Disable thumbnails auto-generation --- hm/desktop.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hm/desktop.nix b/hm/desktop.nix index e5796c2..50ce109 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -537,6 +537,7 @@ in scripts = with pkgs.mpvScripts; [ thumbnail ]; scriptOpts = { mpv_thumbnail_script = { + autogenerate = false; # TODO It creates too many processes at once, crashing the system cache_directory = "/tmp/mpv_thumbs_${config.home.username}"; mpv_hwdec = "auto-safe"; };