From 731578cac05205179009061f18436f5304063775 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Tue, 29 Aug 2023 13:18:40 +0200 Subject: [PATCH 001/176] Remove more default gnome packages --- nixos/modules/des/gnome/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nixos/modules/des/gnome/default.nix b/nixos/modules/des/gnome/default.nix index 9fc9bee..5b6ebf9 100644 --- a/nixos/modules/des/gnome/default.nix +++ b/nixos/modules/des/gnome/default.nix @@ -17,13 +17,19 @@ gnomeExtensions.launch-new-instance ]; + # We do not want these packages automatically environment.gnome.excludePackages = (with pkgs; [ + baobab epiphany # Web browser + evince # Document viewer + gnome-connections # Remote desktop client gnome-console gnome-photos gnome-text-editor gnome-tour ]) ++ (with pkgs.gnome; [ + eog # Image viewer + file-roller # Archive manager geary # Mail client gedit gnome-calculator @@ -31,8 +37,10 @@ gnome-characters gnome-clocks gnome-contacts + gnome-disk-utility gnome-maps gnome-music + gnome-system-monitor gnome-weather simple-scan totem # Movie player From 7e84a60ae69a862e7a9fbc2897b9a6aabf8b905d Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Fri, 1 Sep 2023 18:55:03 +0200 Subject: [PATCH 002/176] [thunderbird] Test adding calendars to config --- nixos/modules/apps/thunderbird/default.nix | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/nixos/modules/apps/thunderbird/default.nix b/nixos/modules/apps/thunderbird/default.nix index 7b4005f..b6d8d57 100644 --- a/nixos/modules/apps/thunderbird/default.nix +++ b/nixos/modules/apps/thunderbird/default.nix @@ -122,6 +122,40 @@ in "mailnews.mark_message_read.delay" = true; "mailnews.start_page.enabled" = false; "mail.pane_config.dynamic" = 2; # Vertical view + + "calendar.list.sortOrder" = "personal ugent tasks planning zeus"; + + "calendar.registry.personal.cache.enabled" = true; + "calendar.registry.personal.name" = "Personal"; + "calendar.registry.personal.type" = "caldav"; + "calendar.registry.personal.uri" = "https://cloud.depeuter.dev/remote.php/dav/calendars/tdpeuter/personal/"; + "calendar.registry.personal.username" = "tdpeuter"; + + "calendar.registry.ugent.cache.enabled" = true; + "calendar.registry.ugent.color" = "#1E64C8"; + "calendar.registry.ugent.name" = "UGent"; + "calendar.registry.ugent.type" = "caldav"; + "calendar.registry.ugent.uri" = "https://cloud.depeuter.dev/remote.php/dav/calendars/tdpeuter/ugent/"; + "calendar.registry.ugent.username" = "tdpeuter"; + + "calendar.registry.planning.cache.enabled" = true; + "calendar.registry.planning.name" = "Planning"; + "calendar.registry.planning.type" = "caldav"; + "calendar.registry.planning.uri" = "https://cloud.depeuter.dev/remote.php/dav/calendars/tdpeuter/planning/"; + "calendar.registry.planning.username" = "tdpeuter"; + + "calendar.registry.zeus.cache.enabled" = true; + "calendar.registry.zeus.color" = "#FF7F00"; + "calendar.registry.zeus.name" = "ZeusWPI"; + "calendar.registry.zeus.type" = "ics"; + "calendar.registry.zeus.uri" = "https://zeus.ugent.be/ical.ics"; + + "calendar.registry.tasks.cache.enabled" = true; + "calendar.registry.tasks.color" = "#813D9C"; + "calendar.registry.tasks.name" = "Tasks"; + "calendar.registry.tasks.type" = "caldav"; + "calendar.registry.tasks.uri" = "https://cloud.depeuter.dev/remote.php/dav/calendars/tdpeuter/tasks-2/"; + "calendar.registry.tasks.username" = "tdpeuter"; }; }; }; From 1f9a231a4df472c9da2b8109bda644910a4503d5 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sun, 3 Sep 2023 12:15:49 +0200 Subject: [PATCH 003/176] [Vifm] Add icon for .nix files --- stow/vifm/.config/vifm/scripts/favicons.vifm | 1 + 1 file changed, 1 insertion(+) diff --git a/stow/vifm/.config/vifm/scripts/favicons.vifm b/stow/vifm/.config/vifm/scripts/favicons.vifm index fdd4ce5..4c0f6dd 100644 --- a/stow/vifm/.config/vifm/scripts/favicons.vifm +++ b/stow/vifm/.config/vifm/scripts/favicons.vifm @@ -48,6 +48,7 @@ set classify+=' ::*.fish,,*.sh,,*.bash::' set classify+=' ::*.ejs,,*.slim,,*.xml::' set classify+='C ::*.c++,,*.cpp,,*.cxx,,*.h,,*.cc,,*.c::' set classify+=' ::*.coffee::' +set classify+=' ::*.nix::' " Unsorted and unconverted set classify+='λ ::*.ml,,*.mli::' From 3f08798bfea686e006c117d54a4fa687884536ca Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sat, 2 Sep 2023 17:48:59 +0200 Subject: [PATCH 004/176] Tibo-NixDesk new disk config --- nixos/flake.lock | 42 +++++++++---------- .../Tibo-NixDesk/hardware-configuration.nix | 15 +++++-- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index 9327918..ddd7950 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -8,11 +8,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1687173957, - "narHash": "sha256-GOds2bAQcZ94fb9/Nl/aM+r+0wGSi4EKYuZYR8Dw4R8=", + "lastModified": 1692793255, + "narHash": "sha256-yVyj0AE280JkccDHuG1XO9oGxN6bW8ksr/xttXcXzK0=", "owner": "numtide", "repo": "devshell", - "rev": "2cf83bb31720fcc29a999aee28d6da101173e66a", + "rev": "2aa26972b951bc05c3632d4e5ae683cb6771a7c6", "type": "github" }, "original": { @@ -26,11 +26,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1687709756, - "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=", + "lastModified": 1692799911, + "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", "owner": "numtide", "repo": "flake-utils", - "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7", + "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", "type": "github" }, "original": { @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1687647567, - "narHash": "sha256-Ua90LZYJO7/7KW/KK/AqijhIekd+wxPwbVKXuBYzJeQ=", + "lastModified": 1693208669, + "narHash": "sha256-hHFaaUsZ860wvppPeiu7nJn/nXZjJfnqAQEu9SPFE9I=", "owner": "nix-community", "repo": "home-manager", - "rev": "6ca1e16eb3016c94b7ac16699e1d4158bd4e39a4", + "rev": "5bac4a1c06cd77cf8fc35a658ccb035a6c50cd2c", "type": "github" }, "original": { @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1687729501, - "narHash": "sha256-mTLkMePoHUWvTCf3NuKbeYEea/tsikSIKBWwb9OfRr4=", + "lastModified": 1693428224, + "narHash": "sha256-FWUUlhYqkGEySUD0blTADRiDQ7fw+H1ikivfu88uy+w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "35130d4b4f0b8c50ed2aceb909a538c66c91d4a0", + "rev": "841889913dfd06a70ffb39f603e29e46f45f0c1a", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1687031877, - "narHash": "sha256-yMFcVeI+kZ6KD2QBrFPNsvBrLq2Gt//D0baHByMrjFY=", + "lastModified": 1693097136, + "narHash": "sha256-fBZSMdBaoZ0INFbyZ5s0DOF7zDNcLsLxgkwdDh3l9Pc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e2e2059d19668dab1744301b8b0e821e3aae9c99", + "rev": "9117c4e9dc117a6cd0319cca40f2349ed333669d", "type": "github" }, "original": { @@ -93,11 +93,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1687681650, - "narHash": "sha256-M2If+gRcfpmaJy/XbfSsRzLlPpoU4nr0NHnKKl50fd8=", + "lastModified": 1693565476, + "narHash": "sha256-ya00zHt7YbPo3ve/wNZ/6nts61xt7wK/APa6aZAfey0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1c9db9710cb23d60570ad4d7ab829c2d34403de3", + "rev": "aa8aa7e2ea35ce655297e8322dc82bf77a31d04b", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1687398569, - "narHash": "sha256-e/umuIKFcFtZtWeX369Hbdt9r+GQ48moDmlTcyHWL28=", + "lastModified": 1693404499, + "narHash": "sha256-cx/7yvM/AP+o/3wPJmA9W9F+WHemJk5t+Xcr+Qwkqhg=", "owner": "Mic92", "repo": "sops-nix", - "rev": "2ff6973350682f8d16371f8c071a304b8067f192", + "rev": "d9c5dc41c4b1f74c77f0dbffd0f3a4ebde447b7a", "type": "github" }, "original": { diff --git a/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix b/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix index 826c7bc..d20131b 100644 --- a/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix +++ b/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix @@ -8,22 +8,29 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-label/NIXROOT"; + { device = "/dev/disk/by-label/NIX-ROOT"; fsType = "ext4"; }; fileSystems."/boot/efi" = - { device = "/dev/disk/by-label/NIXBOOT"; + { device = "/dev/disk/by-label/NIX-BOOT"; fsType = "vfat"; }; - swapDevices = [ ]; + fileSystems."/nix" = + { device = "/dev/disk/by-label/NIX-STORE"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-label/SWAP"; } + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's From 496e103b53e946b93bbdb2b6ff3e314e3ce546ea Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sun, 10 Sep 2023 21:39:55 +0200 Subject: [PATCH 005/176] Rewrite README (using GPT-3.5) --- README.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3247fae..16d0835 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,22 @@ # sisyphus -This repository serves as my dotfiles. It contains the configuration for my Linux machine(s), for multiple distributions. Not everything might be up to date and/or working, so don't expect a working machine if you try to use this configuration for your own machines. However, feel free to steal some parts or be inspired. +Welcome to my dotfiles repository, named Sisyphus. This repository houses the configurations for my Linux machines, spanning various distributions. Please note that not all configurations may be up-to-date or fully functional. If you decide to use these configurations for your own machines, be prepared for potential issues. Nevertheless, feel free to borrow or draw inspiration from this collection. + +## Organisation + +To maintain clarity and versatility, I've organized my configuration files into distinct subdirectories. The "bare" configuration files, those you typically find in your `~/.config` directory, are located in [stow](./stow). This separation allows for a streamlined approach to managing configurations, while other subdirectories house OS-specific settings. - [Arch Linux](./arch) (+ [stow](./stow)) -- [Nixos](./nixos) +- [NixOS](./nixos) -## Analogy +## The Sisyphus Analogy -The analogy is quite simple. +The Sisyphus analogy is a straightforward one. -Over the course of getting to know Linux and during my career as a student, I had to reinstall my OS SO so so many times, either because I bricked my previous install, or because things weren't working the way I wanted them to or even because I found the current install to be cluttered. On a particular day, I had installed Arch (that's what I started with back then) over ten times, which is my personal record of most-installed-computers-in-one-day so far. I also managed to speedrun the installation process to 8min30sec for the kernel with an additional 4min30sec for installing Sway (fun fact/did you know?). +Throughout my journey with Linux, especially during my time as a student, I found myself reinstalling my operating system countless times. Whether it was due to a botched installation, unsatisfactory performance, or simply the desire for a fresh start, I've been there. Things escalated when I began tinkering extensively with machine configurations, often resulting in disk management mishaps. It was clear that I needed to find a way to put an end to these frequent reinstallations, contain my configurations, and maintain system stability. This repository represents my solution to these challenges. -Later, this worsened even more when I had way too much fun playing around with the machine configuration. (Managing disks is prone to errors!) I hope my addaction to breaking my laptop will ease with this repo: keeping everything easily accessible, often statically configured, so that it can be installed with as little input as (reasonably) possible. +I hope that by maintaining this repository, I can minimize the challenges of breaking my laptop and make configurations easily accessible. They are designed to be relatively static and require as little user input as reasonably possible during installation. -TL;DR: Discovering Linux was a tedious process and I had to start over several times, hence the analogy with [Sisyphus, greek mythology](https://en.wikipedia.org/wiki/Sisyphus). +TL;DR: My journey with Linux was a challenging one, marked by frequent restarts, which is why I chose the name Sisyphus as an analogy from [Greek mythology](https://en.wikipedia.org/wiki/Sisyphus). -*But also because it sounds cool and it has the sys from sytem in the name, don't tell anyone this though.* +P.S. While the name "Sisyphus" has a deep mythological significance, it also sounds cool and conveniently contains "sys" from "system" in its name. But, let's keep that our little secret, shall we? From 823ccc15b519ae35e9273a3af8b30ed739bcb2be Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sun, 10 Sep 2023 22:46:34 +0200 Subject: [PATCH 006/176] Configure secrets, configure ssh and add H4G0 --- nixos/.sops.yaml | 9 ++++--- nixos/modules/default.nix | 6 ++++- nixos/modules/utils/default.nix | 2 ++ nixos/modules/utils/sops/default.nix | 27 +++++++++++++++++++ nixos/modules/utils/ssh/default.nix | 14 ++++++++++ nixos/secrets/H4G0.yaml | 31 ++++++++++++++++++++++ nixos/secrets/secrets.yaml | 39 ++++++++++++++++++++++++++++ nixos/secrets/sops/age/keys.txt | 3 --- 8 files changed, 124 insertions(+), 7 deletions(-) create mode 100644 nixos/modules/utils/sops/default.nix create mode 100644 nixos/secrets/H4G0.yaml create mode 100644 nixos/secrets/secrets.yaml delete mode 100644 nixos/secrets/sops/age/keys.txt diff --git a/nixos/.sops.yaml b/nixos/.sops.yaml index 72755e4..62f72a2 100644 --- a/nixos/.sops.yaml +++ b/nixos/.sops.yaml @@ -1,10 +1,13 @@ keys: - - &tdpeuter age1q2gqur3t4fu8flsuu2zdnule37vdkh6egpt6a2e3ytx433x8gpvsr4hw6l - - &Tibo-NixDesk age1quvlqpznqkw2r0jhyx6p2hsq3dk93087yha46ugtce6ew9c64pgq4uhcvz + - &tdpeuter age1fva6s64s884z0q2w7de024sp69ucvqu0pg9shrhhqsn3ewlpjfpsh6md7y + + - &server_H4G0 age1d4gvqz3anf082ja6xt03hnkzazfum80um9t45m4rerl4n3va2yuqgnsg03 creation_rules: - - path_regex: secrets/[^/]+\.yaml$ + - path_regex: secrets/[^/]+\.(yaml|json|env|ini)$ key_groups: - age: - *tdpeuter + - *server_H4G0 + diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 6a39c9c..2d1dca6 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -18,7 +18,11 @@ users.users.tdpeuter = { description = "Tibo De Peuter"; isNormalUser = true; - extraGroups = [ "networkmanager" "wheel" ]; + extraGroups = [ + config.users.groups.keys.name + config.users.groups.networkmanager.name + config.users.groups.wheel.name + ]; initialPassword = "ChangeMe"; packages = with pkgs; [ home-manager diff --git a/nixos/modules/utils/default.nix b/nixos/modules/utils/default.nix index 50b298a..b869b10 100644 --- a/nixos/modules/utils/default.nix +++ b/nixos/modules/utils/default.nix @@ -1,6 +1,8 @@ { imports = [ ./mpv + ./sops + ./ssh ./vifm ./vim ./zellij diff --git a/nixos/modules/utils/sops/default.nix b/nixos/modules/utils/sops/default.nix new file mode 100644 index 0000000..ff143f0 --- /dev/null +++ b/nixos/modules/utils/sops/default.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + sops + ]; + + sops = { + # Add secrets.yml to the nix store + defaultSopsFile = ../../../secrets/secrets.yaml; + age = { + # Automatically import SSH keys as age keys + sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + # Use an age key that is expected to already be in the filesystem + keyFile = "/var/lib/sops-nix/key.txt"; + # Generate new keys if the key specified above does not exist + generateKey = true; + }; + secrets = { + "H4G0/ssh" = { + format = "yaml"; + sopsFile = ../../../secrets/H4G0.yaml; + owner = config.users.users.tdpeuter.name; + }; + }; + }; +} diff --git a/nixos/modules/utils/ssh/default.nix b/nixos/modules/utils/ssh/default.nix index 07b2810..f85a719 100644 --- a/nixos/modules/utils/ssh/default.nix +++ b/nixos/modules/utils/ssh/default.nix @@ -5,4 +5,18 @@ enable = true; passwordAuthentication = false; }; + + home-manager.users.tdpeuter = { + programs.ssh = { + enable = true; + matchBlocks = { + "H4G0" = { + hostname = "192.168.0.11"; + identitiesOnly = true; + identityFile = "/run/secrets/H4G0/ssh"; + user = "admin"; + }; + }; + }; + }; } diff --git a/nixos/secrets/H4G0.yaml b/nixos/secrets/H4G0.yaml new file mode 100644 index 0000000..b447fef --- /dev/null +++ b/nixos/secrets/H4G0.yaml @@ -0,0 +1,31 @@ +H4G0: + ssh: ENC[AES256_GCM,data:UfO/9VpMNP4A1qjgCYg5hGDu5/e3nHXJY0ozKt9nSfuDON/wjxCT7wTjbBOpVH1u6fvUQRE6+YEw5/oOf/+3U324a5TQ7WzfhOqgdkOxJswQRYL+hghzWDQUoxWFwO/gmLH+gJY2qTOs1VODgnaccadaewhIcw9DWYytTeF6PP3Hx4mXMMzsJ5AUur7Wl86geUmD0H5P9uG7dZNfe3r1CZKIdxYo9CLzx2zdHfKHjFh8C0gJgZA8xRZiq870t24807eetayWtEpAcbnCW7zpMnjMhtV8MxNsd5ImapShGaei4xHfZ4o1q592eXix75nqvkg25+mP4XWfNpuqFqbWHAespbUn3WFa5t1ose+D9ZTCa9JyeVvSRZSqCOdb2RwvtWowRAAo/OdyXGBQ/v25TIeuhUyZq5ndjS5g57K+70BGCt3IluFHQj9DvKyB433s0FUSy8xR/tq3mSIAwmrLlw7Ip/xjnhsn1lK2jvMOUSwLwZt7qMnWPIZRFA4PF6g8jL7BWv0imp00q54mTUby2vBkdJV6sAZMo2uU,iv:rYOykB1uj8oqdBIYsmD9H4Zg1RPTNamVhky2Rtfmvbw=,tag:mZzyg1Ez16M7ltxPUh5ktg==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1fva6s64s884z0q2w7de024sp69ucvqu0pg9shrhhqsn3ewlpjfpsh6md7y + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBYWWFUdnpERVlkK29TQ09k + SnJMVm5rUEV6S0huSzJ2YjFFQ3pNR0pmZWprClZEVDloeDE2ODNkMVVJTUtqaENz + ZzhwTTA4V2xOeW55WGtPZU5FWElQNDAKLS0tIFh5ZWtmZHRBWTAvM3ZwY3pKQ0R6 + aDNUbFlhWWVoOWpjVlV1VTVJejlSMjQK6wCeCRdHY5oyTX6/R1U5AOGJyp0exi1A + dWPUMfkKBBBkrR+G6ougd8o3FwFf+yfb5RhaTxxqjit6p2RyMjR64w== + -----END AGE ENCRYPTED FILE----- + - recipient: age1d4gvqz3anf082ja6xt03hnkzazfum80um9t45m4rerl4n3va2yuqgnsg03 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6WVcwYVFWbG1ucEtTSTI5 + Y0pxZ1FidjVURlVxZTdTSHdzME05Z0hyblJBCkQ5R2F1a2IyRVIvYjlmY1p3S3VR + OW1zcnp2Z1Zydlpjd2tBU2RHajhoamMKLS0tIG9oMWtHVU1nTHBtcGM3OWxVNFZL + K3NaMitlT2orSVhHVmFRVmhPUXhBSGMKAqVqH9hT9NL5D6Fsovn67GY056B6Ttwg + fr9y+8rkG43LbuehpKktv2I/UP64QKcYgqWDOWOmicHYx8pOXKLHkA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2023-09-10T20:16:08Z" + mac: ENC[AES256_GCM,data:/LEOHaf9No6KORPvM2yjLTfHA2aI+A5+vvjIRIcJVaMoHf6a0bommokhiujZTXxj8G234YMRXldfnY1nJd7lF0x5lrx6Gf39EHSmxztGJXsuzdN+oGc/zlnWO/+XoB2hc2dMGYP3vswru07bFxu9qpiVQLsBhv20hzhJA2Ex4nc=,iv:5R+qtwW8xKd8nUN6VBeT+7b73qlQtqcEEAJRaJzk/+g=,tag:dngDfl2/pHiXY23aJppRkw==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.7.3 diff --git a/nixos/secrets/secrets.yaml b/nixos/secrets/secrets.yaml new file mode 100644 index 0000000..f973af5 --- /dev/null +++ b/nixos/secrets/secrets.yaml @@ -0,0 +1,39 @@ +hello: ENC[AES256_GCM,data:Qs69AsC8Yz+2RWSMvZp3zw==,iv:9p9bf2MI0HFwPB5qu0nTy3riyE6xUqsdObaXv3vgs3c=,tag:fjwrOPR/2vIeNgPDEVI+LQ==,type:str] +example_key: ENC[AES256_GCM,data:JaknfPEPPtIotkwWpQ==,iv:OQy1S24scW0Ac9omkHg1HSCH6b7cClBMDH1GXZkzUBY=,tag:ItO6EdXKy4zOuZ2DROI+Tg==,type:str] +#ENC[AES256_GCM,data:Pok2Tcvryb59LmHDanq5/Q==,iv:Wl2nAb0X7s3bFeGeVUAHb+FMqrKHSJwwHulhdwhPkuE=,tag:YxicHwyrYLZZ6sFGNvkMMA==,type:comment] +example_array: + - ENC[AES256_GCM,data:ULZ3vixg/k1biadqhw8=,iv:7NMuh30RkiBGpXO/sd5WKzBggNnMZkV8eD16w39utd4=,tag:+ReYo3sQf2rgK0nTXAq1UA==,type:str] + - ENC[AES256_GCM,data:VawE9ClM28rRQPScWAM=,iv:XKiKDFGy6Io5gyp/FHLXIs7CpT41E6KAKHQmuZLRVHE=,tag:FSIdSnI/emPwHk0dQVT/TQ==,type:str] +example_number: ENC[AES256_GCM,data:yd6R8u2Nd5effA==,iv:7NO330iRkYO42a4AjBr5Ebv/nxx5J0/OpWKIqMTqdPQ=,tag:N/RK1+Q+QqnVPCkGPA1/AQ==,type:float] +example_booleans: + - ENC[AES256_GCM,data:Ul7fKA==,iv:U51FhTsWwkbhUWGsO8D+bl2mLdTIfapIB+OGJEOAiRA=,tag:9NJLKp8s2TSKLyXwM8OncA==,type:bool] + - ENC[AES256_GCM,data:LVU1a90=,iv:1X1qV+8iIe1i5hIrqyB3tJew9hsHjJHlATmkEmwRA0Y=,tag:ko/5OwmJH/6HKPsvbkoRpw==,type:bool] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1fva6s64s884z0q2w7de024sp69ucvqu0pg9shrhhqsn3ewlpjfpsh6md7y + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA3ekx1bzluY0ZhYmhnRmhW + b3pzM2RlKzFrREpMK3RNU1MweldNRXJ5NjE4CmNRbnFvbk1EN0V0ZWJiVzFmL3Jt + N1Vpb3NEdXFzdzU4MjN1elp1RWZ5THcKLS0tIDR4cTFJNVFveEdxaEYvZndKbURa + UHpaNENhL3c1K3RXc05hUmdNZVBpT2MKwBj4+Gb7giVJIoPWiwY3tvugEAexXy6Q + YTWgZQZk96r5aF2mBjRCFCc7prj85PsUN/UXOPjPLVAFG3lwS0Eaog== + -----END AGE ENCRYPTED FILE----- + - recipient: age1d4gvqz3anf082ja6xt03hnkzazfum80um9t45m4rerl4n3va2yuqgnsg03 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBDWkE3SW14Kzh6dlNHeE1S + dzUvTTN0bHZESy9vVy9DMXBuNjNneXdlWEFRCkZ1b1Znd2IweG1pNmloOFVjQkpa + LzZjZ051L0ZBTzNQd0N2LzRwNkZUOEUKLS0tIE4vQWk4cXlyUDAzM3VNaDVHaXNi + QXBOc1VXcXFlL2hNK2lTT2ZBeFNUd2sKjuy8anUcn8MCWe6TohLcIIPynBXqEZy/ + C3F94k4aniG0MK/yPoBpoCP9tquIw4zKHJ5syorUJR69LqupgfB6qA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2023-09-10T20:20:18Z" + mac: ENC[AES256_GCM,data:yfmYEo8pdlG3tu4Fabwde57igIvpt4UuhQqStVlV36rvPnv9dc42+6iduu+heuQ2OAVw0jk6/o6SWJpcms2DReOAMGDOgt+zV3TgJym52YdMcjTNJTo+4loULhvaWyN9ZdPJjSYKEoSgOZi+oMx4BpwreQEaPaYUxcbTqrWCUa8=,iv:Mb81sBxibRxSaC2kgakhy2pyEmW0MDobF+lHF7cny5E=,tag:DCqTWSnf5Gv5YfAGSEC2yw==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.7.3 diff --git a/nixos/secrets/sops/age/keys.txt b/nixos/secrets/sops/age/keys.txt deleted file mode 100644 index b21c58f..0000000 --- a/nixos/secrets/sops/age/keys.txt +++ /dev/null @@ -1,3 +0,0 @@ -# created: 2023-04-11T14:44:53+02:00 -# public key: age1q2gqur3t4fu8flsuu2zdnule37vdkh6egpt6a2e3ytx433x8gpvsr4hw6l -AGE-SECRET-KEY-10J7MWCWQQY33TVNMQ9AMH4TH5LULSVAZ539P9QG3NA2Z3LTMXAFS2QQ4NG From 5897150ea6c071616fd4af35b6248ccc1b7f2619 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Mon, 11 Sep 2023 11:06:55 +0200 Subject: [PATCH 007/176] Update NixTest --- nixos/flake.lock | 30 ++++----- nixos/hosts/Tibo-NixDesk/default.nix | 24 ++++---- nixos/hosts/Tibo-NixTest/default.nix | 92 +++------------------------- nixos/modules/des/plasma/default.nix | 11 ++-- 4 files changed, 43 insertions(+), 114 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index ddd7950..eb391d2 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -8,11 +8,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1692793255, - "narHash": "sha256-yVyj0AE280JkccDHuG1XO9oGxN6bW8ksr/xttXcXzK0=", + "lastModified": 1693833206, + "narHash": "sha256-wHOY0nnD6gWj8u9uI85/YlsganYyWRK1hLFZulZwfmY=", "owner": "numtide", "repo": "devshell", - "rev": "2aa26972b951bc05c3632d4e5ae683cb6771a7c6", + "rev": "65114ea495a8d3cc1352368bf170d67ef005aa5a", "type": "github" }, "original": { @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1693428224, - "narHash": "sha256-FWUUlhYqkGEySUD0blTADRiDQ7fw+H1ikivfu88uy+w=", + "lastModified": 1694304580, + "narHash": "sha256-5tIpNodDpEKT8mM/F5zCzWEAnidOg8eb1/x3SRaaBLs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "841889913dfd06a70ffb39f603e29e46f45f0c1a", + "rev": "4c8cf44c5b9481a4f093f1df3b8b7ba997a7c760", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1693097136, - "narHash": "sha256-fBZSMdBaoZ0INFbyZ5s0DOF7zDNcLsLxgkwdDh3l9Pc=", + "lastModified": 1693675694, + "narHash": "sha256-2pIOyQwGyy2FtFAUIb8YeKVmOCcPOTVphbAvmshudLE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9117c4e9dc117a6cd0319cca40f2349ed333669d", + "rev": "5601118d39ca9105f8e7b39d4c221d3388c0419d", "type": "github" }, "original": { @@ -93,11 +93,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1693565476, - "narHash": "sha256-ya00zHt7YbPo3ve/wNZ/6nts61xt7wK/APa6aZAfey0=", + "lastModified": 1694183432, + "narHash": "sha256-YyPGNapgZNNj51ylQMw9lAgvxtM2ai1HZVUu3GS8Fng=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "aa8aa7e2ea35ce655297e8322dc82bf77a31d04b", + "rev": "db9208ab987cdeeedf78ad9b4cf3c55f5ebd269b", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1693404499, - "narHash": "sha256-cx/7yvM/AP+o/3wPJmA9W9F+WHemJk5t+Xcr+Qwkqhg=", + "lastModified": 1693898833, + "narHash": "sha256-OIrMAGNYNeLs6IvBynxcXub7aSW3GEUvWNsb7zx6zuU=", "owner": "Mic92", "repo": "sops-nix", - "rev": "d9c5dc41c4b1f74c77f0dbffd0f3a4ebde447b7a", + "rev": "faf21ac162173c2deb54e5fdeed002a9bd6e8623", "type": "github" }, "original": { diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index 4226342..6132edc 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -11,14 +11,19 @@ ]; # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.efi.efiSysMountPoint = "/boot/efi"; + boot.loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; + }; + }; - # Enable networking - networking.hostName = "Tibo-NixDesk"; # Define your hostname. - networking.networkmanager.enable = true; - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking = { + hostName = "Tibo-NixDesk"; + networkmanager.enable = true; + # wireless.enable = true; # Enables wireless support via wpa_supplicant. + }; # Set your time zone. time.timeZone = "Europe/Brussels"; @@ -57,11 +62,6 @@ # enableSSHSupport = true; # }; - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ]; diff --git a/nixos/hosts/Tibo-NixTest/default.nix b/nixos/hosts/Tibo-NixTest/default.nix index e983ff6..15022c7 100644 --- a/nixos/hosts/Tibo-NixTest/default.nix +++ b/nixos/hosts/Tibo-NixTest/default.nix @@ -1,22 +1,14 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - { config, pkgs, ... }: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + + ../../modules/des/plasma ]; - # Nix Flakes - nix.package = pkgs.nixFlakes; - nix.extraOptions = '' - experimental-features = nix-command flakes - ''; - - # Use the systemd-boot EFI boot loader.] + # Bootloader boot.loader = { systemd-boot.enable = true; @@ -26,10 +18,11 @@ }; }; - networking.hostName = "Tibo-NixTest"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + networking = { + hostName = "Tibo-NixTest"; + # wireless.enable = true; # Enables wireless support via wpa_supplicant. + networkmanager.enable = true; # Easiest to use and most distros use this by default. + }; # Set your time zone. time.timeZone = "Europe/Brussels"; @@ -53,29 +46,6 @@ # "caps:escape" # map caps to escape. # }; - - services.xserver = { - # Enable the X11 windowing system. - enable = true; - - # Enable the Plasma 5 Desktop Environment. - displayManager.sddm.enable = true; - displayManager.defaultSession = "plasmawayland"; - - desktopManager.plasma5 = { - enable = true; - excludePackages = with pkgs.libsForQt5; [ - elisa - okular - plasma-browser-integration - khelpcenter - kwalletmanager - oxygen - ]; - }; - - }; - # Enable CUPS to print documents. # services.printing.enable = true; @@ -89,44 +59,6 @@ # Enable touchpad support (enabled default in most desktopManager). services.xserver.libinput.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.tdpeuter = { - description = "Tibo De Peuter"; - isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" ]; - initialPassword = "ChangeMe"; - packages = with pkgs; [ - home-manager - ]; - }; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - firefox - git - mongodb - vim - wget - ]; - - nixpkgs.config = { - allowUnfree = true; - }; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ]; @@ -138,13 +70,7 @@ # accidentally delete configuration.nix. # system.copySystemConfiguration = true; - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "22.11"; # Did you read the comment? + system.stateVersion = "23.05"; } diff --git a/nixos/modules/des/plasma/default.nix b/nixos/modules/des/plasma/default.nix index 55c69bb..542c012 100644 --- a/nixos/modules/des/plasma/default.nix +++ b/nixos/modules/des/plasma/default.nix @@ -4,10 +4,13 @@ services.xserver = { enable = true; - displayManager.sddm = { - enable = true; - # https://discourse.nixos.org/t/plasma-wayland-session-not-available-from-sddm/13447/2 - settings.Wayland.SessionDir = "${pkgs.plasma5Packages.plasma-workspace}/share/wayland-sessions"; + displayManager = { + defaultSession = "plasmawayland"; + sddm = { + enable = true; + # https://discourse.nixos.org/t/plasma-wayland-session-not-available-from-sddm/13447/2 + settings.Wayland.SessionDir = "${pkgs.plasma5Packages.plasma-workspace}/share/wayland-sessions"; + }; }; desktopManager.plasma5 = { From dd0aa22793eb39b05292ed2965e2ce0a7a81a225 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Mon, 11 Sep 2023 12:49:47 +0200 Subject: [PATCH 008/176] [SSH] Add GitHub key --- nixos/modules/utils/sops/default.nix | 7 ++++++- nixos/modules/utils/ssh/default.nix | 6 ++++++ nixos/secrets/GitHub.yaml | 31 ++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 nixos/secrets/GitHub.yaml diff --git a/nixos/modules/utils/sops/default.nix b/nixos/modules/utils/sops/default.nix index ff143f0..db4aa6e 100644 --- a/nixos/modules/utils/sops/default.nix +++ b/nixos/modules/utils/sops/default.nix @@ -14,7 +14,7 @@ # Use an age key that is expected to already be in the filesystem keyFile = "/var/lib/sops-nix/key.txt"; # Generate new keys if the key specified above does not exist - generateKey = true; + # generateKey = true; }; secrets = { "H4G0/ssh" = { @@ -22,6 +22,11 @@ sopsFile = ../../../secrets/H4G0.yaml; owner = config.users.users.tdpeuter.name; }; + "GitHub/ssh" = { + format = "yaml"; + sopsFile = ../../../secrets/GitHub.yaml; + owner = config.users.users.tdpeuter.name; + }; }; }; } diff --git a/nixos/modules/utils/ssh/default.nix b/nixos/modules/utils/ssh/default.nix index f85a719..f42b8ee 100644 --- a/nixos/modules/utils/ssh/default.nix +++ b/nixos/modules/utils/ssh/default.nix @@ -16,6 +16,12 @@ identityFile = "/run/secrets/H4G0/ssh"; user = "admin"; }; + "github.com" = { + hostname = "github.com"; + identitiesOnly = true; + identityFile = "/run/secrets/GitHub/ssh"; + user = "tdpeuter"; + }; }; }; }; diff --git a/nixos/secrets/GitHub.yaml b/nixos/secrets/GitHub.yaml new file mode 100644 index 0000000..f694c48 --- /dev/null +++ b/nixos/secrets/GitHub.yaml @@ -0,0 +1,31 @@ +GitHub: + ssh: ENC[AES256_GCM,data:jzRpTgefhZg7Vhm8QvWNsPBko1yw56sM/XehY72lAc7aRz+dx6BGgyYbZiifd7GrGJGUbH6gWfUg8YjgVla6VRsiHCEvSK3bY0ADDwTeSUs+wuybYXQZqhivSCInVtVSNAcp99uI1QwKor289zmxcFtSZEXgU1OCSel/8br+qipAbOkzAKX1v15eigjY4OSQxXL59EuuuHEQ+vjVVv95tDv03jaNAoU9UKr0Atrny/Fn2sQn4Tmec5Q1XdvDErKhSxrAFiACkxXUwPZMHez+BUZrmkksqpzNJjYNIlmsITuOVr7Fyen9wotAwsDf96Fmz5JYLtRX9CAboUgQLdUOKprwX/xgBnFtDTSH1Qr785T1QSAZL6xdE6hNibxZO3vGeeaPC3oGB5g9x5CwTQelMdOUPKdKorCDj226o56cTc/IQxUpsULbeOyi2pMGHiTHbiQBzHpxWyQ/gBktPkF25GOFeaCu3gW+xsspX91jSKudcYdBqWUNmJcdsfHfPxPM4cZtA/sVMyoA+YcehgU7GTu9DAlxDTug/JWo,iv:5shfzmrFFVEuaYmyTkBMAw9BIFFkKz0yl1dyJWxq6Y4=,tag:CX7TBJJXCKuIPSmg9/RpGg==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1fva6s64s884z0q2w7de024sp69ucvqu0pg9shrhhqsn3ewlpjfpsh6md7y + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBYWWFUdnpERVlkK29TQ09k + SnJMVm5rUEV6S0huSzJ2YjFFQ3pNR0pmZWprClZEVDloeDE2ODNkMVVJTUtqaENz + ZzhwTTA4V2xOeW55WGtPZU5FWElQNDAKLS0tIFh5ZWtmZHRBWTAvM3ZwY3pKQ0R6 + aDNUbFlhWWVoOWpjVlV1VTVJejlSMjQK6wCeCRdHY5oyTX6/R1U5AOGJyp0exi1A + dWPUMfkKBBBkrR+G6ougd8o3FwFf+yfb5RhaTxxqjit6p2RyMjR64w== + -----END AGE ENCRYPTED FILE----- + - recipient: age1d4gvqz3anf082ja6xt03hnkzazfum80um9t45m4rerl4n3va2yuqgnsg03 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6WVcwYVFWbG1ucEtTSTI5 + Y0pxZ1FidjVURlVxZTdTSHdzME05Z0hyblJBCkQ5R2F1a2IyRVIvYjlmY1p3S3VR + OW1zcnp2Z1Zydlpjd2tBU2RHajhoamMKLS0tIG9oMWtHVU1nTHBtcGM3OWxVNFZL + K3NaMitlT2orSVhHVmFRVmhPUXhBSGMKAqVqH9hT9NL5D6Fsovn67GY056B6Ttwg + fr9y+8rkG43LbuehpKktv2I/UP64QKcYgqWDOWOmicHYx8pOXKLHkA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2023-09-11T10:23:48Z" + mac: ENC[AES256_GCM,data:3XEbhFY1TlXo6bTctV2u4i6QPzXnJC6iU3F/MUARSQl1z4peOB5x8hZfdiV/hVMR8I+83TxDcEAmKDrcaMf89Tqa+OiD//wBekMUfS7AmBRhpv7X5qfarflfnygacFsAMhf/bdiqowYbGSNvlPjueqHJaFZ+3x/wPrt/jAYNlr8=,iv:ciQmY7bE+Je6kMlmxxtQvp+r3e/ZK942tT4TtXhDX2M=,tag:4+7uZlEm5bcRfZC7pp5Y7Q==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.7.3 From a60ff55afe74b1bf138c3259a2c7027c2ed9560d Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Mon, 11 Sep 2023 13:18:22 +0200 Subject: [PATCH 009/176] [SSH] Add documentation --- nixos/modules/utils/ssh/README.md | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 nixos/modules/utils/ssh/README.md diff --git a/nixos/modules/utils/ssh/README.md b/nixos/modules/utils/ssh/README.md new file mode 100644 index 0000000..8d7b9d8 --- /dev/null +++ b/nixos/modules/utils/ssh/README.md @@ -0,0 +1,41 @@ +# Adding SSH keys + +To incorporate SSH keys, for instance, to enable authentication with a Git server, follow these steps: + +Step 0: If necessary, generate a keypair, for example using the command: + +```bash +ssh-keygen -t ed25519 +``` + +Please note that setting a password for the keypair is not yet tested. + +Step 1: Create a new file named `yourservice.yaml` within the [secrets](../../../secrets/) directory by executing the following command: + +```bash +sops secrets/yourservice.yaml +``` + +Within this file, create a value that contains your private key. For example: + +```yaml +yourservice: + ssh: | + -----BEGIN OPENSSH PRIVATE KEY----- + <...> + -----END OPENSSH PRIVATE KEY----- +``` + +Step 2: Reference this value in [your sops configuration](../../utils/sops/default.nix) as follows: + +``` +sops.secrets."yourservice/ssh".format = "yaml"; +sops.secrets."yourservice/sss".sopsFile = secrets/youservice.yaml; +``` + +Step 3: Finally, add the SSH key to your SSH configuration so that it is used correctly when connecting to your host. Add the following lines to your SSH configuraton file: + +``` +Host yourservice + IdentityFile /run/secrets/yourservice/ssh +``` From 4347b650f12fa7184796ee355153ff2a8f0552eb Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Mon, 11 Sep 2023 13:19:03 +0200 Subject: [PATCH 010/176] [Git] Move into own module --- nixos/modules/utils/default.nix | 17 +---------------- nixos/modules/utils/git/default.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 nixos/modules/utils/git/default.nix diff --git a/nixos/modules/utils/default.nix b/nixos/modules/utils/default.nix index b869b10..68d5e14 100644 --- a/nixos/modules/utils/default.nix +++ b/nixos/modules/utils/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./git ./mpv ./sops ./ssh @@ -12,7 +13,6 @@ home.packages = with pkgs; [ direnv duf - git-crypt lynx nsxiv w3m @@ -25,21 +25,6 @@ enable = true; nix-direnv.enable = true; }; - - git = { - enable = true; - userName = "tdpeuter"; - userEmail = "tibo.depeuter@gmail.com"; - extraConfig = { - core.editor = "vim"; - }; - includes = [ - { - path = "~/.gitconfig-ugent"; - condition = "gitdir:~/Nextcloud/Documenten/UGent"; - } - ]; - }; }; }; } diff --git a/nixos/modules/utils/git/default.nix b/nixos/modules/utils/git/default.nix new file mode 100644 index 0000000..0f4be64 --- /dev/null +++ b/nixos/modules/utils/git/default.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +{ + home-manager.users.tdpeuter = { + programs.git = { + enable = true; + userName = "tdpeuter"; + userEmail = "tibo.depeuter@gmail.com"; + extraConfig = { + core.editor = "vim"; + }; + ignores = [ + "*.swp" + ]; + includes = [ + { + path = "~/.gitconfig-ugent"; + condition = "gitdir:~/Nextcloud/Documenten/UGent"; + } + ]; + }; + }; +} From a9305590495b5dbcd21fdada07f3a6e5921321cf Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Mon, 11 Sep 2023 13:28:41 +0200 Subject: [PATCH 011/176] [Git] Add GitHub-UGent key --- nixos/modules/utils/sops/default.nix | 5 +++++ nixos/modules/utils/ssh/default.nix | 6 ++++++ nixos/secrets/GitHub-UGent.yaml | 31 ++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 nixos/secrets/GitHub-UGent.yaml diff --git a/nixos/modules/utils/sops/default.nix b/nixos/modules/utils/sops/default.nix index db4aa6e..0d97a61 100644 --- a/nixos/modules/utils/sops/default.nix +++ b/nixos/modules/utils/sops/default.nix @@ -27,6 +27,11 @@ sopsFile = ../../../secrets/GitHub.yaml; owner = config.users.users.tdpeuter.name; }; + "GitHub-UGent/ssh" = { + format = "yaml"; + sopsFile = ../../../secrets/GitHub-UGent.yaml; + owner = config.users.users.tdpeuter.name; + }; }; }; } diff --git a/nixos/modules/utils/ssh/default.nix b/nixos/modules/utils/ssh/default.nix index f42b8ee..b6505cf 100644 --- a/nixos/modules/utils/ssh/default.nix +++ b/nixos/modules/utils/ssh/default.nix @@ -22,6 +22,12 @@ identityFile = "/run/secrets/GitHub/ssh"; user = "tdpeuter"; }; + "github.ugent.be" = { + hostname = "github.ugent.be"; + identitiesOnly = true; + identityFile = "/run/secrets/GitHub-UGent/ssh"; + user = "tdpeuter"; + }; }; }; }; diff --git a/nixos/secrets/GitHub-UGent.yaml b/nixos/secrets/GitHub-UGent.yaml new file mode 100644 index 0000000..d095f45 --- /dev/null +++ b/nixos/secrets/GitHub-UGent.yaml @@ -0,0 +1,31 @@ +GitHub-UGent: + ssh: ENC[AES256_GCM,data:FPnAyjJpyTJHzRMdN4qcIj/X60VBgejJSRWUQfvuMA/WrRHx7eWto7A0X94lOMwnayLx4DRL+LUOIqsuO9SM/T2aNt798y0Kiz/WbjyrrXTCK8TufcYBGOU6mMfXeeQG1J27Z2qALQQHVzenH5ot8Jet0vnqWGCDVacq/3T2S7hT8Oeyw+qew5NliBW6G980XTECwiWEWYwZbJ9iqZ2aFGgvgTu1qjalP7qWJcZ2tiEYIgW7KSIdru8hJM2xZgUOYoXWurEbWjyOWiTcPjpVEbjmOqgm5C9kwAq+wzRRl/pVCV0e505J7sDo94jsbby4Zub/bhKXHDFHBavnZcPACAjT4ixjTyFlzxeH79iVA9GP4Dp7tTs/FNkYSeYuAWRyul/VFiLc3762VoxvoQuiob9RISXdWPNhZd2rJYpHibGYXlF692gqI+IiJIaK3XXPh3FIMtaZjuhWhgECqBumcwVawO33c817GzP055y4yTk/KGjxkTy0IRz3zp3fBJvU/Y2plNjJNuWPnjlvkkQNHhCGJB5dvFMB8YYJ,iv:3kuM9apx5Ir/WN8loNFcOGXjPdBjpnttNg5LFzQPfqk=,tag:7rFCmJpMnNmSmqYopKLgaA==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1fva6s64s884z0q2w7de024sp69ucvqu0pg9shrhhqsn3ewlpjfpsh6md7y + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBYWWFUdnpERVlkK29TQ09k + SnJMVm5rUEV6S0huSzJ2YjFFQ3pNR0pmZWprClZEVDloeDE2ODNkMVVJTUtqaENz + ZzhwTTA4V2xOeW55WGtPZU5FWElQNDAKLS0tIFh5ZWtmZHRBWTAvM3ZwY3pKQ0R6 + aDNUbFlhWWVoOWpjVlV1VTVJejlSMjQK6wCeCRdHY5oyTX6/R1U5AOGJyp0exi1A + dWPUMfkKBBBkrR+G6ougd8o3FwFf+yfb5RhaTxxqjit6p2RyMjR64w== + -----END AGE ENCRYPTED FILE----- + - recipient: age1d4gvqz3anf082ja6xt03hnkzazfum80um9t45m4rerl4n3va2yuqgnsg03 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6WVcwYVFWbG1ucEtTSTI5 + Y0pxZ1FidjVURlVxZTdTSHdzME05Z0hyblJBCkQ5R2F1a2IyRVIvYjlmY1p3S3VR + OW1zcnp2Z1Zydlpjd2tBU2RHajhoamMKLS0tIG9oMWtHVU1nTHBtcGM3OWxVNFZL + K3NaMitlT2orSVhHVmFRVmhPUXhBSGMKAqVqH9hT9NL5D6Fsovn67GY056B6Ttwg + fr9y+8rkG43LbuehpKktv2I/UP64QKcYgqWDOWOmicHYx8pOXKLHkA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2023-09-11T11:22:49Z" + mac: ENC[AES256_GCM,data:IYTE5yunfyiGZg2yUaZzas7ebxgqGCamn44BgcHTqF4TKufzsqLyFSSuKtOag0Ll0MTL4YuJKP6RknpxY064EEjf/W2o1AEZ5/NsxThOCHJKq+6Cm9hkzeYF6IW20cBcO5l+NdOAQl6hDln5zBA770SYHy3FArm1YOnTdNi+B1I=,iv:BtRl0YrG+INNjOhSGR3RadDa1IfiXMosfVC8O8Q0i54=,tag:3E6yLsgx+9TbfTMj0jEDnw==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.7.3 From aec2ed2303512a9cf7427b19a9b4f715aa8ea0c3 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Wed, 13 Sep 2023 15:04:36 +0200 Subject: [PATCH 012/176] Add Windows-compatible partition to NixDesk --- nixos/flake.lock | 36 ++++++------ .../Tibo-NixDesk/hardware-configuration.nix | 55 +++++++++++++------ 2 files changed, 57 insertions(+), 34 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index eb391d2..63e5b48 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -8,11 +8,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1693833206, - "narHash": "sha256-wHOY0nnD6gWj8u9uI85/YlsganYyWRK1hLFZulZwfmY=", + "lastModified": 1694435990, + "narHash": "sha256-yLQPD2eZGepu3yvdwABXrR3GhAqWRWTj9rn3a4knYuk=", "owner": "numtide", "repo": "devshell", - "rev": "65114ea495a8d3cc1352368bf170d67ef005aa5a", + "rev": "f6aec2e8b1cdddcab10ce7fc2eac66886e3deaad", "type": "github" }, "original": { @@ -26,11 +26,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1692799911, - "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1693208669, - "narHash": "sha256-hHFaaUsZ860wvppPeiu7nJn/nXZjJfnqAQEu9SPFE9I=", + "lastModified": 1694465129, + "narHash": "sha256-8BQiuobMrCfCbGM7w6Snx+OBYdtTIm0+cGVaKwQ5BFg=", "owner": "nix-community", "repo": "home-manager", - "rev": "5bac4a1c06cd77cf8fc35a658ccb035a6c50cd2c", + "rev": "9787dffff5d315c9593d3f9fb0f9bf2097e1b57b", "type": "github" }, "original": { @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1694304580, - "narHash": "sha256-5tIpNodDpEKT8mM/F5zCzWEAnidOg8eb1/x3SRaaBLs=", + "lastModified": 1694499547, + "narHash": "sha256-R7xMz1Iia6JthWRHDn36s/E248WB1/je62ovC/dUVKI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4c8cf44c5b9481a4f093f1df3b8b7ba997a7c760", + "rev": "e5f018cf150e29aac26c61dac0790ea023c46b24", "type": "github" }, "original": { @@ -93,11 +93,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1694183432, - "narHash": "sha256-YyPGNapgZNNj51ylQMw9lAgvxtM2ai1HZVUu3GS8Fng=", + "lastModified": 1694422566, + "narHash": "sha256-lHJ+A9esOz9vln/3CJG23FV6Wd2OoOFbDeEs4cMGMqc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "db9208ab987cdeeedf78ad9b4cf3c55f5ebd269b", + "rev": "3a2786eea085f040a66ecde1bc3ddc7099f6dbeb", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1693898833, - "narHash": "sha256-OIrMAGNYNeLs6IvBynxcXub7aSW3GEUvWNsb7zx6zuU=", + "lastModified": 1694495315, + "narHash": "sha256-sZEYXs9T1NVHZSSbMqBEtEm2PGa7dEDcx0ttQkArORc=", "owner": "Mic92", "repo": "sops-nix", - "rev": "faf21ac162173c2deb54e5fdeed002a9bd6e8623", + "rev": "ea208e55f8742fdcc0986b256bdfa8986f5e4415", "type": "github" }, "original": { diff --git a/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix b/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix index d20131b..571525e 100644 --- a/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix +++ b/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix @@ -4,33 +4,56 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot = { + initrd = { + availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; - fileSystems."/" = - { device = "/dev/disk/by-label/NIX-ROOT"; + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIX-ROOT"; fsType = "ext4"; }; - fileSystems."/boot/efi" = - { device = "/dev/disk/by-label/NIX-BOOT"; + "/boot/efi" = { + device = "/dev/disk/by-label/NIX-BOOT"; fsType = "vfat"; }; - fileSystems."/nix" = - { device = "/dev/disk/by-label/NIX-STORE"; + "/nix" = { + device = "/dev/disk/by-label/NIX-STORE"; fsType = "ext4"; }; - swapDevices = - [ { device = "/dev/disk/by-label/SWAP"; } - ]; + "/mnt/Nextcloud" = { + device = "/dev/disk/by-label/Nextcloud"; + fsType = "ntfs"; + }; + + # "/home/${config.users.users.tdpeuter.name}/Nextcloud" = { + "/home/tdpeuter/Nextcloud" = { + depends = [ + "/mnt/Nextcloud" + ]; + device = "/mnt/Nextcloud/Nextcloud"; + fsType = "none"; + options = [ + "bind" + ]; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-label/SWAP"; } + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's From 5ca9ad69cf0289c540df2f46401d1f8c0b2531b5 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Fri, 15 Sep 2023 09:55:49 +0200 Subject: [PATCH 013/176] Add MIME defaults --- nixos/modules/default.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 2d1dca6..aa2a856 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -57,6 +57,29 @@ }; }; + + xdg.mimeApps = + let + browser = "firefox.desktop"; + image-viewer = "nsxiv.desktop"; + in { + enable = true; + + defaultApplications = { + "x-scheme-handler/http" = browser; + "x-scheme-handler/https" = browser; + "x-scheme-handler/chrome" = browser; + "text/html" = browser; + "application/x-extension-htm" = browser; + "application/x-extension-html" = browser; + "application/x-extension-shtml" = browser; + "application/xhtml+xml" = browser; + "application/x-extension-xhtml" = browser; + "application/x-extension-xht" = browser; + "image/jpeg" = image-viewer; + "image/png" = image-viewer; + }; + }; }; } From a004e4c358db090ab78d75e76221d2641d79ee53 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Fri, 15 Sep 2023 10:04:24 +0200 Subject: [PATCH 014/176] Fix renamed options --- nixos/modules/des/plasma/default.nix | 20 ++++++++++---------- nixos/modules/utils/ssh/default.nix | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/nixos/modules/des/plasma/default.nix b/nixos/modules/des/plasma/default.nix index 542c012..10a85e6 100644 --- a/nixos/modules/des/plasma/default.nix +++ b/nixos/modules/des/plasma/default.nix @@ -16,20 +16,20 @@ desktopManager.plasma5 = { enable = true; useQtScaling = true; - - excludePackages = with pkgs.libsForQt5; [ - elisa - okular - khelpcenter - konsole - print-manager - plasma-systemmonitor - gwenview - ]; }; excludePackages = with pkgs; [ xterm ]; }; + + environment.plasma5.excludePackages = with pkgs.libsForQt5; [ + elisa + okular + khelpcenter + konsole + print-manager + plasma-systemmonitor + gwenview + ]; } diff --git a/nixos/modules/utils/ssh/default.nix b/nixos/modules/utils/ssh/default.nix index b6505cf..84945b2 100644 --- a/nixos/modules/utils/ssh/default.nix +++ b/nixos/modules/utils/ssh/default.nix @@ -3,7 +3,7 @@ { services.openssh = { enable = true; - passwordAuthentication = false; + settings.PasswordAuthentication = false; }; home-manager.users.tdpeuter = { From 4b93c35270792513b38c2fa4ab969ff38ec73fdc Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Tue, 19 Sep 2023 19:57:50 +0200 Subject: [PATCH 015/176] Set zathura as default app for pdf --- nixos/modules/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index aa2a856..83e6a4a 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -66,18 +66,19 @@ enable = true; defaultApplications = { - "x-scheme-handler/http" = browser; - "x-scheme-handler/https" = browser; - "x-scheme-handler/chrome" = browser; - "text/html" = browser; + "application/pdf" = "org.pwmt.zathura-pdf-mupdf.desktop"; "application/x-extension-htm" = browser; "application/x-extension-html" = browser; "application/x-extension-shtml" = browser; - "application/xhtml+xml" = browser; - "application/x-extension-xhtml" = browser; "application/x-extension-xht" = browser; + "application/x-extension-xhtml" = browser; + "application/xhtml+xml" = browser; "image/jpeg" = image-viewer; "image/png" = image-viewer; + "text/html" = browser; + "x-scheme-handler/chrome" = browser; + "x-scheme-handler/http" = browser; + "x-scheme-handler/https" = browser; }; }; }; From 16789bd34239416454d6772e7f2a819e3cd8fcbd Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Thu, 21 Sep 2023 16:53:34 +0200 Subject: [PATCH 016/176] [SSH] Add H4Git key --- nixos/modules/utils/sops/default.nix | 24 ++++++++++++++------- nixos/modules/utils/ssh/default.nix | 11 +++++----- nixos/secrets/H4Git.yaml | 31 ++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 13 deletions(-) create mode 100644 nixos/secrets/H4Git.yaml diff --git a/nixos/modules/utils/sops/default.nix b/nixos/modules/utils/sops/default.nix index 0d97a61..c4f8401 100644 --- a/nixos/modules/utils/sops/default.nix +++ b/nixos/modules/utils/sops/default.nix @@ -16,21 +16,29 @@ # Generate new keys if the key specified above does not exist # generateKey = true; }; - secrets = { - "H4G0/ssh" = { - format = "yaml"; - sopsFile = ../../../secrets/H4G0.yaml; - owner = config.users.users.tdpeuter.name; - }; + secrets = + let + user = config.users.users.tdpeuter.name; + in { "GitHub/ssh" = { format = "yaml"; sopsFile = ../../../secrets/GitHub.yaml; - owner = config.users.users.tdpeuter.name; + owner = user; }; "GitHub-UGent/ssh" = { format = "yaml"; sopsFile = ../../../secrets/GitHub-UGent.yaml; - owner = config.users.users.tdpeuter.name; + owner = user; + }; + "H4G0/ssh" = { + format = "yaml"; + sopsFile = ../../../secrets/H4G0.yaml; + owner = user; + }; + "H4Git/ssh" = { + format = "yaml"; + sopsFile = ../../../secrets/H4Git.yaml; + owner = user; }; }; }; diff --git a/nixos/modules/utils/ssh/default.nix b/nixos/modules/utils/ssh/default.nix index 84945b2..281361f 100644 --- a/nixos/modules/utils/ssh/default.nix +++ b/nixos/modules/utils/ssh/default.nix @@ -1,11 +1,6 @@ { config, lib, pkgs, ... }: { - services.openssh = { - enable = true; - settings.PasswordAuthentication = false; - }; - home-manager.users.tdpeuter = { programs.ssh = { enable = true; @@ -28,6 +23,12 @@ identityFile = "/run/secrets/GitHub-UGent/ssh"; user = "tdpeuter"; }; + "git.depeuter.dev" = { + hostname = "git.depeuter.dev"; + identitiesOnly = true; + identityFile = "/run/secrets/H4Git/ssh"; + user = "tdpeuter"; + }; }; }; }; diff --git a/nixos/secrets/H4Git.yaml b/nixos/secrets/H4Git.yaml new file mode 100644 index 0000000..5266935 --- /dev/null +++ b/nixos/secrets/H4Git.yaml @@ -0,0 +1,31 @@ +H4Git: + ssh: ENC[AES256_GCM,data:AXt6YNzRkRpMynMkNvMiYas3LpGm34hQFqlaG32+XzhBdrS1wtLaNQp1iy/+G0yXBkwwmRVPoih8ssz7bEkQd+vORP5jSKnARbr9ZZvWoe7XjMDlyyfqMdWE+nr7hACCVmQmTt5VuX33xTuvgAP0hYAzUXMDt5Jl7ZWjfoYegqWUbQLLy6QpSo8hqxZpy7ec3s6mWQgb+nBwIjyIFq866Or56cyT72+b6iOjaehjPzZez1pMO1yCkt7CA5wt+gP76F6wG34PTMn6FtP0aRzGc2MohKLMssU1biqcADsdJmz1tBQZFh7x2X4toCbX9svt3cbGnVOmKbXluKjlS1+6haZgBzdHnob9ZobU2uV9GVyKo4IX3mhXRSeTCusLh9sE4V59FHFyRnVTWzkEBdQcuQ3EzhLFwK74gxTqtdsUbcFSHPwloPBZCfmmHVzqnBwR9FSURBK/olQl7VKr3PKXemzBAlB0COQh+feuH2hp/liWVkHPP5WAaoKpPnKtRduYYSEH4lp2Mk7X3lM/lUp6oIVYtpQby4p2pSU4,iv:n0M5re8pOQXCBcaxkp3n82vdHBcSFHZ8RymnwXaLvIM=,tag:rooT43fOYVWpcnQ8EDV8Qw==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1fva6s64s884z0q2w7de024sp69ucvqu0pg9shrhhqsn3ewlpjfpsh6md7y + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBZWnBUQXJKb2JWeGhjQURI + QUZLb1RncWRBMkJsVzFmUGFKL2Y4S0pQaVdFCldDSEZIVUJ3N01abmZUeGxPVHZT + ZWtKNTdycDlUTmx2UnpzajQvZG9INUEKLS0tIFBYOW8zZjZ4bThBMTBlb3NYOXlw + RnR4NEJ6M044dVhLelkyc2ViRU96bTgKfspxNwByG+nLPdfLEvn21BSjjbW5fGuZ + 77X/olzob2sR8UjYYYfTYUvw+kHfuiC8Mkg2b+Jy7Q6nSQ+4zuq4/A== + -----END AGE ENCRYPTED FILE----- + - recipient: age1d4gvqz3anf082ja6xt03hnkzazfum80um9t45m4rerl4n3va2yuqgnsg03 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA2cUxVekFVdWtsQTNTcm9x + YUFOTzdDSU1JeTdDbU0vcUZ4bEp5VGtkcjJRCmVuRUJYR0NnQXVGbnYyZ3FWZXNx + TUY3TlVMSTZPSUtUUnJhU2QvSWgyUUEKLS0tIGZaUUNSSkdxQW1zakZDbi9iZThS + Z2hKRHVDYUlsa1psaFU3ZUxnZitPbEkKm1sBknoqVcArgLGDD6Twi1/E3TDlAw4d + xhzeYNrS9LVCDKco8TGIv9OQV0u0MkGR4/fvuLopn2eyiDlJOqqVNg== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2023-09-21T13:16:04Z" + mac: ENC[AES256_GCM,data:69g9CpSo6Cg19CG4/vWeh9xT3EATwyxtMQ6xOmqF9kjCu8l9b5ZfFCfgX6RFDwSxFY0u2oFgxbNfbiudcKLwxCoXDSm+xhjpk9SSBSzwAJ+UWWQE/pKJVFbk1QG3iw/VGQJYVUK9SKk6TsTEphHYPS00Go/k38cPxVuyEKcpWkQ=,iv:YVqQmwHgw2Z/AqIJZaxrfotXuuHGx/Vw8p6y3FXbCqg=,tag:0l3f5BX0uzTGB6IBnpqpdg==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.7.3 From aad57e583bc271f44698d90c864fd90145f3cb78 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Fri, 22 Sep 2023 13:08:57 +0200 Subject: [PATCH 017/176] [SSH] Enable --- nixos/modules/utils/ssh/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/modules/utils/ssh/default.nix b/nixos/modules/utils/ssh/default.nix index 281361f..8a71748 100644 --- a/nixos/modules/utils/ssh/default.nix +++ b/nixos/modules/utils/ssh/default.nix @@ -1,6 +1,11 @@ { config, lib, pkgs, ... }: { + services.openssh = { + enable = true; + settings.PasswordAuthentication = false; + }; + home-manager.users.tdpeuter = { programs.ssh = { enable = true; From 53fec1cca520eb0e77d8798787e89cacb056fe3e Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Fri, 29 Sep 2023 08:21:05 +0200 Subject: [PATCH 018/176] [zsh] Add fzf --- nixos/modules/shells/zsh/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/modules/shells/zsh/default.nix b/nixos/modules/shells/zsh/default.nix index 0d84ea8..6b69e7e 100644 --- a/nixos/modules/shells/zsh/default.nix +++ b/nixos/modules/shells/zsh/default.nix @@ -8,6 +8,7 @@ home = { packages = with pkgs; [ font-awesome + fzf ]; file = { @@ -25,6 +26,12 @@ }; initExtra = '' eval "$(direnv hook zsh)" + + # Add fzf + if [ -x "$(command -v fzf-share)" ]; then + source "$(fzf-share)/key-bindings.zsh" + source "$(fzf-share)/completion.zsh" + fi ''; oh-my-zsh = { enable = true; From 729d83dfb79e0f4327ede8dc54f020d68896b2f9 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sun, 1 Oct 2023 16:56:12 +0200 Subject: [PATCH 019/176] Update NixLap --- nixos/flake.lock | 36 ++++---- nixos/hosts/Tibo-NixDesk/default.nix | 9 -- nixos/hosts/Tibo-NixFat/default.nix | 92 ++++++++----------- .../Tibo-NixFat/hardware-configuration.nix | 28 +++--- nixos/modules/default.nix | 12 +++ 5 files changed, 80 insertions(+), 97 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index 63e5b48..110b080 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -8,11 +8,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1694435990, - "narHash": "sha256-yLQPD2eZGepu3yvdwABXrR3GhAqWRWTj9rn3a4knYuk=", + "lastModified": 1695973661, + "narHash": "sha256-BP2H4c42GThPIhERtTpV1yCtwQHYHEKdRu7pjrmQAwo=", "owner": "numtide", "repo": "devshell", - "rev": "f6aec2e8b1cdddcab10ce7fc2eac66886e3deaad", + "rev": "cd4e2fda3150dd2f689caeac07b7f47df5197c31", "type": "github" }, "original": { @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1694465129, - "narHash": "sha256-8BQiuobMrCfCbGM7w6Snx+OBYdtTIm0+cGVaKwQ5BFg=", + "lastModified": 1695108154, + "narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=", "owner": "nix-community", "repo": "home-manager", - "rev": "9787dffff5d315c9593d3f9fb0f9bf2097e1b57b", + "rev": "07682fff75d41f18327a871088d20af2710d4744", "type": "github" }, "original": { @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1694499547, - "narHash": "sha256-R7xMz1Iia6JthWRHDn36s/E248WB1/je62ovC/dUVKI=", + "lastModified": 1695825837, + "narHash": "sha256-4Ne11kNRnQsmSJCRSSNkFRSnHC4Y5gPDBIQGjjPfJiU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e5f018cf150e29aac26c61dac0790ea023c46b24", + "rev": "5cfafa12d57374f48bcc36fda3274ada276cf69e", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1693675694, - "narHash": "sha256-2pIOyQwGyy2FtFAUIb8YeKVmOCcPOTVphbAvmshudLE=", + "lastModified": 1694908564, + "narHash": "sha256-ducA98AuWWJu5oUElIzN24Q22WlO8bOfixGzBgzYdVc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5601118d39ca9105f8e7b39d4c221d3388c0419d", + "rev": "596611941a74be176b98aeba9328aa9d01b8b322", "type": "github" }, "original": { @@ -93,11 +93,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1694422566, - "narHash": "sha256-lHJ+A9esOz9vln/3CJG23FV6Wd2OoOFbDeEs4cMGMqc=", + "lastModified": 1696019113, + "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3a2786eea085f040a66ecde1bc3ddc7099f6dbeb", + "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1694495315, - "narHash": "sha256-sZEYXs9T1NVHZSSbMqBEtEm2PGa7dEDcx0ttQkArORc=", + "lastModified": 1695284550, + "narHash": "sha256-z9fz/wz9qo9XePEvdduf+sBNeoI9QG8NJKl5ssA8Xl4=", "owner": "Mic92", "repo": "sops-nix", - "rev": "ea208e55f8742fdcc0986b256bdfa8986f5e4415", + "rev": "2f375ed8702b0d8ee2430885059d5e7975e38f78", "type": "github" }, "original": { diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index 6132edc..d18bc78 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -28,15 +28,6 @@ # Set your time zone. time.timeZone = "Europe/Brussels"; - # Select internationalisation properties. - i18n.defaultLocale = "en_GB.utf8"; - - # Configure keymap in X11 - services.xserver = { - layout = "us"; - xkbVariant = ""; - }; - # Enable sound with pipewire. sound.enable = true; hardware.pulseaudio.enable = false; diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index b6947d1..bd21cac 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -9,24 +9,32 @@ ../../modules/des/gnome ]; - # Use the systemd-boot EFI boot loader.] - boot.loader = { - systemd-boot.enable = true; - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot/efi"; + boot = { + # Use the systemd-boot EFI boot loader.] + loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; + }; + }; + + initrd = { + # Setup keyfile + secrets."/crypto_keyfile.bin" = null; + + # Enable swap on luks + luks.devices."luks-3825c43c-6cc4-4846-b1cc-02b5938640c9" = { + device = "/dev/disk/by-uuid/3825c43c-6cc4-4846-b1cc-02b5938640c9"; + keyFile = "/crypto_keyfile.bin"; + }; }; }; - - # Setup keyfile - boot.initrd.secrets = { - "/crypto_keyfile.bin" = null; - }; - networking.hostName = "Tibo-NixFat"; - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + networking = { + hostName = "Tibo-NixFat"; + networkmanager.enable = true; + }; # Set your time zone. time.timeZone = "Europe/Brussels"; @@ -35,23 +43,6 @@ # networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Select internationalisation properties. - i18n.defaultLocale = "en_GB.UTF-8"; - # console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - # useXkbConfig = true; # use xkbOptions in tty. - # }; - - services.xserver = { - # Configure keymap in X11 - layout = "us"; - xkbVariant = ""; - }; - - # Enable CUPS to print documents. - # services.printing.enable = true; - # Enable sound with pipewire. sound.enable = true; hardware.pulseaudio.enable = false; @@ -69,36 +60,25 @@ #media-session.enable = true; }; - services.logind.lidSwitch = "ignore"; - # Enable Bluetooth. hardware.bluetooth.enable = true; - # Enable touchpad support (enabled default in most desktopManager). - services.xserver.libinput.enable = true; - + services = { + logind = { + lidSwitch = "hybrid-sleep"; + lidSwitchExternalPower = "lock"; + lidSwitchDocked = "ignore"; + }; + + # Enable touchpad support (enabled default in most desktopManager). + xserver = { + libinput.enable = true; + }; + }; + # Allow unfree packages nixpkgs.config.allowUnfree = true; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - # Copy the NixOS configuration file and link it from the resulting system # (/run/current-system/configuration.nix). This is useful in case you # accidentally delete configuration.nix. diff --git a/nixos/hosts/Tibo-NixFat/hardware-configuration.nix b/nixos/hosts/Tibo-NixFat/hardware-configuration.nix index d2ef044..11384cf 100644 --- a/nixos/hosts/Tibo-NixFat/hardware-configuration.nix +++ b/nixos/hosts/Tibo-NixFat/hardware-configuration.nix @@ -13,29 +13,29 @@ boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-label/NIXROOT"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/NIX-ROOT"; + fsType = "ext4"; + }; - boot.initrd.luks.devices."luks-7319552e-7148-4a9b-aa56-aa580b0b935a".device = "/dev/disk/by-uuid/7319552e-7148-4a9b-aa56-aa580b0b935a"; + boot.initrd.luks.devices."luks-c21cb4a4-f618-43af-bc0c-e8be74fe3b81".device = "/dev/disk/by-uuid/c21cb4a4-f618-43af-bc0c-e8be74fe3b81"; - fileSystems."/boot/efi" = - { device = "/dev/disk/by-label/NIXBOOT"; - fsType = "vfat"; - }; + fileSystems."/boot/efi" = { + device = "/dev/disk/by-label/NIX-BOOT"; + fsType = "vfat"; + }; - # swapDevices = - # [ { device = "/dev/disk/by-label/SWAP"; } - # ]; + swapDevices = [ + { device = "/dev/disk/by-label/SWAP"; } + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno2.useDHCP = lib.mkDefault true; - # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp111s0.useDHCP = lib.mkDefault true; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 83e6a4a..2921668 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -29,6 +29,18 @@ ]; }; + # Select internationalisation properties. + i18n.defaultLocale = "en_GB.UTF-8"; + console = { + # font = "Lat2-Terminus16"; + useXkbConfig = true; # use xkbOptions in tty. + }; + + services.xserver = { + layout = "us"; + xkbVariant = "altgr-intl"; + }; + home-manager.useGlobalPkgs = true; home-manager.users.tdpeuter = { pkgs, ... }: { From 1f644492b04440acafdf7e1e65922907b1e085ab Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sun, 1 Oct 2023 18:31:13 +0200 Subject: [PATCH 020/176] Add tea --- nixos/modules/utils/default.nix | 1 + nixos/modules/utils/tea/default.nix | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 nixos/modules/utils/tea/default.nix diff --git a/nixos/modules/utils/default.nix b/nixos/modules/utils/default.nix index 68d5e14..aeab42c 100644 --- a/nixos/modules/utils/default.nix +++ b/nixos/modules/utils/default.nix @@ -4,6 +4,7 @@ ./mpv ./sops ./ssh + ./tea ./vifm ./vim ./zellij diff --git a/nixos/modules/utils/tea/default.nix b/nixos/modules/utils/tea/default.nix new file mode 100644 index 0000000..ca9964f --- /dev/null +++ b/nixos/modules/utils/tea/default.nix @@ -0,0 +1,10 @@ +{ config, lib, pkgs, ... }: + +{ + + home-manager.users.tdpeuter.home = { + packages = with pkgs; [ + tea + ]; + }; +} From ece50202e0e8da5dba5b5d08372ed20e21deff3f Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sun, 1 Oct 2023 18:34:05 +0200 Subject: [PATCH 021/176] Rename H4G0 to Hugo --- nixos/modules/utils/sops/default.nix | 6 +++--- nixos/modules/utils/ssh/default.nix | 4 ++-- nixos/secrets/{H4G0.yaml => Hugo.yaml} | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) rename nixos/secrets/{H4G0.yaml => Hugo.yaml} (56%) diff --git a/nixos/modules/utils/sops/default.nix b/nixos/modules/utils/sops/default.nix index c4f8401..fe8ee37 100644 --- a/nixos/modules/utils/sops/default.nix +++ b/nixos/modules/utils/sops/default.nix @@ -30,12 +30,12 @@ sopsFile = ../../../secrets/GitHub-UGent.yaml; owner = user; }; - "H4G0/ssh" = { + "Hugo/ssh" = { format = "yaml"; - sopsFile = ../../../secrets/H4G0.yaml; + sopsFile = ../../../secrets/Hugo.yaml; owner = user; }; - "H4Git/ssh" = { + "Git/ssh" = { format = "yaml"; sopsFile = ../../../secrets/H4Git.yaml; owner = user; diff --git a/nixos/modules/utils/ssh/default.nix b/nixos/modules/utils/ssh/default.nix index 8a71748..d68f150 100644 --- a/nixos/modules/utils/ssh/default.nix +++ b/nixos/modules/utils/ssh/default.nix @@ -10,10 +10,10 @@ programs.ssh = { enable = true; matchBlocks = { - "H4G0" = { + "Hugo" = { hostname = "192.168.0.11"; identitiesOnly = true; - identityFile = "/run/secrets/H4G0/ssh"; + identityFile = "/run/secrets/Hugo/ssh"; user = "admin"; }; "github.com" = { diff --git a/nixos/secrets/H4G0.yaml b/nixos/secrets/Hugo.yaml similarity index 56% rename from nixos/secrets/H4G0.yaml rename to nixos/secrets/Hugo.yaml index b447fef..7a45493 100644 --- a/nixos/secrets/H4G0.yaml +++ b/nixos/secrets/Hugo.yaml @@ -1,5 +1,5 @@ -H4G0: - ssh: ENC[AES256_GCM,data:UfO/9VpMNP4A1qjgCYg5hGDu5/e3nHXJY0ozKt9nSfuDON/wjxCT7wTjbBOpVH1u6fvUQRE6+YEw5/oOf/+3U324a5TQ7WzfhOqgdkOxJswQRYL+hghzWDQUoxWFwO/gmLH+gJY2qTOs1VODgnaccadaewhIcw9DWYytTeF6PP3Hx4mXMMzsJ5AUur7Wl86geUmD0H5P9uG7dZNfe3r1CZKIdxYo9CLzx2zdHfKHjFh8C0gJgZA8xRZiq870t24807eetayWtEpAcbnCW7zpMnjMhtV8MxNsd5ImapShGaei4xHfZ4o1q592eXix75nqvkg25+mP4XWfNpuqFqbWHAespbUn3WFa5t1ose+D9ZTCa9JyeVvSRZSqCOdb2RwvtWowRAAo/OdyXGBQ/v25TIeuhUyZq5ndjS5g57K+70BGCt3IluFHQj9DvKyB433s0FUSy8xR/tq3mSIAwmrLlw7Ip/xjnhsn1lK2jvMOUSwLwZt7qMnWPIZRFA4PF6g8jL7BWv0imp00q54mTUby2vBkdJV6sAZMo2uU,iv:rYOykB1uj8oqdBIYsmD9H4Zg1RPTNamVhky2Rtfmvbw=,tag:mZzyg1Ez16M7ltxPUh5ktg==,type:str] +Hugo: + ssh: ENC[AES256_GCM,data:Qi4YEvG64lJqhISMNtuC0mM02TU5KPpzdgs8x2UJwxAxus4+Aa3nIttkbcbKxtobL7ohKcMFGq7bBdj+s4zbctctknHdjiwj1caDoD7+Fm5H0RWLe7yjt5e4IxRywN8cNF59FfINl2tMutuENOzSucjHIXTKSV/ARZzwhcyZkQy//YvlReUSrUNaNkVM1VtjVILOToAXGzQx5w74eX+9JYV9FtZRTbr/spule+UDDtPZaaiFZmFfE5YjULFPaZJo2iUiirKalPodxfIar9eXzoN+bOQbz2Xys1QHNEt2cwWjERruCsojiyA+XeYFreWEWGggSEXizxv7cS5ab1e9XqtWR+u3Gdy/t1/cjoMBVXuLxQ+BwTlAO8NDgRbW0aq8q5yOsPCjShI/N4EVN5qtMUT1+mYZLCiZPPXbLBIiyqIWea/Ru8iIo7+WoF2iDBgshwnw8+uGDFfwlNh3SAwMSQOcGg06+U17PeU56Q/wqID2lEMDgGfHdqObvMlae1q+Qa9cwrp4xDw5S42NlgVaNcovUav5US5kO43r,iv:xvuRv4sqLRGv9npIVjnGV7zDPzIyS58ZKN2T23BmMZs=,tag:iGnBzgRhREEfKjE/ea5Drw==,type:str] sops: kms: [] gcp_kms: [] @@ -24,8 +24,8 @@ sops: K3NaMitlT2orSVhHVmFRVmhPUXhBSGMKAqVqH9hT9NL5D6Fsovn67GY056B6Ttwg fr9y+8rkG43LbuehpKktv2I/UP64QKcYgqWDOWOmicHYx8pOXKLHkA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2023-09-10T20:16:08Z" - mac: ENC[AES256_GCM,data:/LEOHaf9No6KORPvM2yjLTfHA2aI+A5+vvjIRIcJVaMoHf6a0bommokhiujZTXxj8G234YMRXldfnY1nJd7lF0x5lrx6Gf39EHSmxztGJXsuzdN+oGc/zlnWO/+XoB2hc2dMGYP3vswru07bFxu9qpiVQLsBhv20hzhJA2Ex4nc=,iv:5R+qtwW8xKd8nUN6VBeT+7b73qlQtqcEEAJRaJzk/+g=,tag:dngDfl2/pHiXY23aJppRkw==,type:str] + lastmodified: "2023-10-01T16:32:36Z" + mac: ENC[AES256_GCM,data:C+D3KlZ7MrCB9amCYSkTvUboZDnFa8MwrClk2Tql5LxKssN/VcG/ehBbpAsZqUwprVt+JqeddBtkEXJtUq0b0m0kE5j/HCYnG1k4i11x1TiPA7KcvIsMnp/ZHBMQJEbePZMj4WyD8DVs22fLWosEd/Jqj+8D4ypUkwvnKcW/c+8=,iv:aSI04J/pdYI5/be0z+7Xy/XCjPKeBO79o84JRacxj0w=,tag:IDa7QG2IFNzxU1fvjKI6uQ==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.7.3 From f7e8643c595554c4618ff2de1227f8edd08daffb Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Thu, 5 Oct 2023 21:09:36 +0200 Subject: [PATCH 022/176] [ssh] Add HPC key --- nixos/modules/utils/sops/default.nix | 33 ++++++++++++++-------------- nixos/modules/utils/ssh/default.nix | 22 +++++++++++++------ nixos/secrets/GitHub-UGent.yaml | 31 -------------------------- nixos/secrets/GitHub.yaml | 9 -------- nixos/secrets/H4Git.yaml | 31 -------------------------- nixos/secrets/Hugo.yaml | 15 ++++--------- nixos/secrets/UGent.yaml | 25 +++++++++++++++++++++ nixos/secrets/secrets.yaml | 9 -------- 8 files changed, 61 insertions(+), 114 deletions(-) delete mode 100644 nixos/secrets/GitHub-UGent.yaml delete mode 100644 nixos/secrets/H4Git.yaml create mode 100644 nixos/secrets/UGent.yaml diff --git a/nixos/modules/utils/sops/default.nix b/nixos/modules/utils/sops/default.nix index fe8ee37..e4b0f61 100644 --- a/nixos/modules/utils/sops/default.nix +++ b/nixos/modules/utils/sops/default.nix @@ -19,27 +19,28 @@ secrets = let user = config.users.users.tdpeuter.name; - in { + + Hugo = { + format = "yaml"; + sopsFile = ../../../secrets/Hugo.yaml; + owner = user; + }; + UGent = { + format = "yaml"; + sopsFile = ../../../secrets/UGent.yaml; + owner = user; + }; + in { + "Hugo/ssh" = Hugo; + "UGent/HPC/ssh" = UGent; + "GitHub/ssh" = { format = "yaml"; sopsFile = ../../../secrets/GitHub.yaml; owner = user; }; - "GitHub-UGent/ssh" = { - format = "yaml"; - sopsFile = ../../../secrets/GitHub-UGent.yaml; - owner = user; - }; - "Hugo/ssh" = { - format = "yaml"; - sopsFile = ../../../secrets/Hugo.yaml; - owner = user; - }; - "Git/ssh" = { - format = "yaml"; - sopsFile = ../../../secrets/H4Git.yaml; - owner = user; - }; + "Hugo/Gitea/ssh" = Hugo; + "UGent/GitHub/ssh" = UGent; }; }; } diff --git a/nixos/modules/utils/ssh/default.nix b/nixos/modules/utils/ssh/default.nix index d68f150..5b04bed 100644 --- a/nixos/modules/utils/ssh/default.nix +++ b/nixos/modules/utils/ssh/default.nix @@ -16,6 +16,20 @@ identityFile = "/run/secrets/Hugo/ssh"; user = "admin"; }; + "HPC" = { + hostname = "login.hpc.ugent.be"; + identitiesOnly = true; + identityFile = "/run/secrets/UGent/HPC/ssh"; + user = "vsc44995"; + }; + + # Git authentication + "git.depeuter.dev" = { + hostname = "git.depeuter.dev"; + identitiesOnly = true; + identityFile = "/run/secrets/Hugo/Gitea/ssh"; + user = "tdpeuter"; + }; "github.com" = { hostname = "github.com"; identitiesOnly = true; @@ -25,13 +39,7 @@ "github.ugent.be" = { hostname = "github.ugent.be"; identitiesOnly = true; - identityFile = "/run/secrets/GitHub-UGent/ssh"; - user = "tdpeuter"; - }; - "git.depeuter.dev" = { - hostname = "git.depeuter.dev"; - identitiesOnly = true; - identityFile = "/run/secrets/H4Git/ssh"; + identityFile = "/run/secrets/UGent/GitHub/ssh"; user = "tdpeuter"; }; }; diff --git a/nixos/secrets/GitHub-UGent.yaml b/nixos/secrets/GitHub-UGent.yaml deleted file mode 100644 index d095f45..0000000 --- a/nixos/secrets/GitHub-UGent.yaml +++ /dev/null @@ -1,31 +0,0 @@ -GitHub-UGent: - ssh: ENC[AES256_GCM,data:FPnAyjJpyTJHzRMdN4qcIj/X60VBgejJSRWUQfvuMA/WrRHx7eWto7A0X94lOMwnayLx4DRL+LUOIqsuO9SM/T2aNt798y0Kiz/WbjyrrXTCK8TufcYBGOU6mMfXeeQG1J27Z2qALQQHVzenH5ot8Jet0vnqWGCDVacq/3T2S7hT8Oeyw+qew5NliBW6G980XTECwiWEWYwZbJ9iqZ2aFGgvgTu1qjalP7qWJcZ2tiEYIgW7KSIdru8hJM2xZgUOYoXWurEbWjyOWiTcPjpVEbjmOqgm5C9kwAq+wzRRl/pVCV0e505J7sDo94jsbby4Zub/bhKXHDFHBavnZcPACAjT4ixjTyFlzxeH79iVA9GP4Dp7tTs/FNkYSeYuAWRyul/VFiLc3762VoxvoQuiob9RISXdWPNhZd2rJYpHibGYXlF692gqI+IiJIaK3XXPh3FIMtaZjuhWhgECqBumcwVawO33c817GzP055y4yTk/KGjxkTy0IRz3zp3fBJvU/Y2plNjJNuWPnjlvkkQNHhCGJB5dvFMB8YYJ,iv:3kuM9apx5Ir/WN8loNFcOGXjPdBjpnttNg5LFzQPfqk=,tag:7rFCmJpMnNmSmqYopKLgaA==,type:str] -sops: - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age1fva6s64s884z0q2w7de024sp69ucvqu0pg9shrhhqsn3ewlpjfpsh6md7y - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBYWWFUdnpERVlkK29TQ09k - SnJMVm5rUEV6S0huSzJ2YjFFQ3pNR0pmZWprClZEVDloeDE2ODNkMVVJTUtqaENz - ZzhwTTA4V2xOeW55WGtPZU5FWElQNDAKLS0tIFh5ZWtmZHRBWTAvM3ZwY3pKQ0R6 - aDNUbFlhWWVoOWpjVlV1VTVJejlSMjQK6wCeCRdHY5oyTX6/R1U5AOGJyp0exi1A - dWPUMfkKBBBkrR+G6ougd8o3FwFf+yfb5RhaTxxqjit6p2RyMjR64w== - -----END AGE ENCRYPTED FILE----- - - recipient: age1d4gvqz3anf082ja6xt03hnkzazfum80um9t45m4rerl4n3va2yuqgnsg03 - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6WVcwYVFWbG1ucEtTSTI5 - Y0pxZ1FidjVURlVxZTdTSHdzME05Z0hyblJBCkQ5R2F1a2IyRVIvYjlmY1p3S3VR - OW1zcnp2Z1Zydlpjd2tBU2RHajhoamMKLS0tIG9oMWtHVU1nTHBtcGM3OWxVNFZL - K3NaMitlT2orSVhHVmFRVmhPUXhBSGMKAqVqH9hT9NL5D6Fsovn67GY056B6Ttwg - fr9y+8rkG43LbuehpKktv2I/UP64QKcYgqWDOWOmicHYx8pOXKLHkA== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2023-09-11T11:22:49Z" - mac: ENC[AES256_GCM,data:IYTE5yunfyiGZg2yUaZzas7ebxgqGCamn44BgcHTqF4TKufzsqLyFSSuKtOag0Ll0MTL4YuJKP6RknpxY064EEjf/W2o1AEZ5/NsxThOCHJKq+6Cm9hkzeYF6IW20cBcO5l+NdOAQl6hDln5zBA770SYHy3FArm1YOnTdNi+B1I=,iv:BtRl0YrG+INNjOhSGR3RadDa1IfiXMosfVC8O8Q0i54=,tag:3E6yLsgx+9TbfTMj0jEDnw==,type:str] - pgp: [] - unencrypted_suffix: _unencrypted - version: 3.7.3 diff --git a/nixos/secrets/GitHub.yaml b/nixos/secrets/GitHub.yaml index f694c48..cfc0a97 100644 --- a/nixos/secrets/GitHub.yaml +++ b/nixos/secrets/GitHub.yaml @@ -15,15 +15,6 @@ sops: aDNUbFlhWWVoOWpjVlV1VTVJejlSMjQK6wCeCRdHY5oyTX6/R1U5AOGJyp0exi1A dWPUMfkKBBBkrR+G6ougd8o3FwFf+yfb5RhaTxxqjit6p2RyMjR64w== -----END AGE ENCRYPTED FILE----- - - recipient: age1d4gvqz3anf082ja6xt03hnkzazfum80um9t45m4rerl4n3va2yuqgnsg03 - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6WVcwYVFWbG1ucEtTSTI5 - Y0pxZ1FidjVURlVxZTdTSHdzME05Z0hyblJBCkQ5R2F1a2IyRVIvYjlmY1p3S3VR - OW1zcnp2Z1Zydlpjd2tBU2RHajhoamMKLS0tIG9oMWtHVU1nTHBtcGM3OWxVNFZL - K3NaMitlT2orSVhHVmFRVmhPUXhBSGMKAqVqH9hT9NL5D6Fsovn67GY056B6Ttwg - fr9y+8rkG43LbuehpKktv2I/UP64QKcYgqWDOWOmicHYx8pOXKLHkA== - -----END AGE ENCRYPTED FILE----- lastmodified: "2023-09-11T10:23:48Z" mac: ENC[AES256_GCM,data:3XEbhFY1TlXo6bTctV2u4i6QPzXnJC6iU3F/MUARSQl1z4peOB5x8hZfdiV/hVMR8I+83TxDcEAmKDrcaMf89Tqa+OiD//wBekMUfS7AmBRhpv7X5qfarflfnygacFsAMhf/bdiqowYbGSNvlPjueqHJaFZ+3x/wPrt/jAYNlr8=,iv:ciQmY7bE+Je6kMlmxxtQvp+r3e/ZK942tT4TtXhDX2M=,tag:4+7uZlEm5bcRfZC7pp5Y7Q==,type:str] pgp: [] diff --git a/nixos/secrets/H4Git.yaml b/nixos/secrets/H4Git.yaml deleted file mode 100644 index 5266935..0000000 --- a/nixos/secrets/H4Git.yaml +++ /dev/null @@ -1,31 +0,0 @@ -H4Git: - ssh: ENC[AES256_GCM,data:AXt6YNzRkRpMynMkNvMiYas3LpGm34hQFqlaG32+XzhBdrS1wtLaNQp1iy/+G0yXBkwwmRVPoih8ssz7bEkQd+vORP5jSKnARbr9ZZvWoe7XjMDlyyfqMdWE+nr7hACCVmQmTt5VuX33xTuvgAP0hYAzUXMDt5Jl7ZWjfoYegqWUbQLLy6QpSo8hqxZpy7ec3s6mWQgb+nBwIjyIFq866Or56cyT72+b6iOjaehjPzZez1pMO1yCkt7CA5wt+gP76F6wG34PTMn6FtP0aRzGc2MohKLMssU1biqcADsdJmz1tBQZFh7x2X4toCbX9svt3cbGnVOmKbXluKjlS1+6haZgBzdHnob9ZobU2uV9GVyKo4IX3mhXRSeTCusLh9sE4V59FHFyRnVTWzkEBdQcuQ3EzhLFwK74gxTqtdsUbcFSHPwloPBZCfmmHVzqnBwR9FSURBK/olQl7VKr3PKXemzBAlB0COQh+feuH2hp/liWVkHPP5WAaoKpPnKtRduYYSEH4lp2Mk7X3lM/lUp6oIVYtpQby4p2pSU4,iv:n0M5re8pOQXCBcaxkp3n82vdHBcSFHZ8RymnwXaLvIM=,tag:rooT43fOYVWpcnQ8EDV8Qw==,type:str] -sops: - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age1fva6s64s884z0q2w7de024sp69ucvqu0pg9shrhhqsn3ewlpjfpsh6md7y - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBZWnBUQXJKb2JWeGhjQURI - QUZLb1RncWRBMkJsVzFmUGFKL2Y4S0pQaVdFCldDSEZIVUJ3N01abmZUeGxPVHZT - ZWtKNTdycDlUTmx2UnpzajQvZG9INUEKLS0tIFBYOW8zZjZ4bThBMTBlb3NYOXlw - RnR4NEJ6M044dVhLelkyc2ViRU96bTgKfspxNwByG+nLPdfLEvn21BSjjbW5fGuZ - 77X/olzob2sR8UjYYYfTYUvw+kHfuiC8Mkg2b+Jy7Q6nSQ+4zuq4/A== - -----END AGE ENCRYPTED FILE----- - - recipient: age1d4gvqz3anf082ja6xt03hnkzazfum80um9t45m4rerl4n3va2yuqgnsg03 - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA2cUxVekFVdWtsQTNTcm9x - YUFOTzdDSU1JeTdDbU0vcUZ4bEp5VGtkcjJRCmVuRUJYR0NnQXVGbnYyZ3FWZXNx - TUY3TlVMSTZPSUtUUnJhU2QvSWgyUUEKLS0tIGZaUUNSSkdxQW1zakZDbi9iZThS - Z2hKRHVDYUlsa1psaFU3ZUxnZitPbEkKm1sBknoqVcArgLGDD6Twi1/E3TDlAw4d - xhzeYNrS9LVCDKco8TGIv9OQV0u0MkGR4/fvuLopn2eyiDlJOqqVNg== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2023-09-21T13:16:04Z" - mac: ENC[AES256_GCM,data:69g9CpSo6Cg19CG4/vWeh9xT3EATwyxtMQ6xOmqF9kjCu8l9b5ZfFCfgX6RFDwSxFY0u2oFgxbNfbiudcKLwxCoXDSm+xhjpk9SSBSzwAJ+UWWQE/pKJVFbk1QG3iw/VGQJYVUK9SKk6TsTEphHYPS00Go/k38cPxVuyEKcpWkQ=,iv:YVqQmwHgw2Z/AqIJZaxrfotXuuHGx/Vw8p6y3FXbCqg=,tag:0l3f5BX0uzTGB6IBnpqpdg==,type:str] - pgp: [] - unencrypted_suffix: _unencrypted - version: 3.7.3 diff --git a/nixos/secrets/Hugo.yaml b/nixos/secrets/Hugo.yaml index 7a45493..6a8d422 100644 --- a/nixos/secrets/Hugo.yaml +++ b/nixos/secrets/Hugo.yaml @@ -1,5 +1,7 @@ Hugo: ssh: ENC[AES256_GCM,data:Qi4YEvG64lJqhISMNtuC0mM02TU5KPpzdgs8x2UJwxAxus4+Aa3nIttkbcbKxtobL7ohKcMFGq7bBdj+s4zbctctknHdjiwj1caDoD7+Fm5H0RWLe7yjt5e4IxRywN8cNF59FfINl2tMutuENOzSucjHIXTKSV/ARZzwhcyZkQy//YvlReUSrUNaNkVM1VtjVILOToAXGzQx5w74eX+9JYV9FtZRTbr/spule+UDDtPZaaiFZmFfE5YjULFPaZJo2iUiirKalPodxfIar9eXzoN+bOQbz2Xys1QHNEt2cwWjERruCsojiyA+XeYFreWEWGggSEXizxv7cS5ab1e9XqtWR+u3Gdy/t1/cjoMBVXuLxQ+BwTlAO8NDgRbW0aq8q5yOsPCjShI/N4EVN5qtMUT1+mYZLCiZPPXbLBIiyqIWea/Ru8iIo7+WoF2iDBgshwnw8+uGDFfwlNh3SAwMSQOcGg06+U17PeU56Q/wqID2lEMDgGfHdqObvMlae1q+Qa9cwrp4xDw5S42NlgVaNcovUav5US5kO43r,iv:xvuRv4sqLRGv9npIVjnGV7zDPzIyS58ZKN2T23BmMZs=,tag:iGnBzgRhREEfKjE/ea5Drw==,type:str] + Gitea: + ssh: ENC[AES256_GCM,data:digqDmnEPg/Zn9Xt7+Z/R9lTBs6CeOgHgIhstWxHnvucwshUO7Zu+l80YPyzAck0pO5YIKML8hjAqj30lYqSPRzG1uRpT7likCy15MqyyQ64U+5PGQRNhybo1eYoqVFYd2sYc5xzkve1b8zCDfxj2mbmRYETYSidHZLaDilq6iKtWWSX+mnTXqJ2gIj+J7pfFBOHskWglnrVdj93AOdpG6cmnvzE7ey8SrMt9t0GzmRFAvjP3slio8NTsI97fu3isF0phGoh8q9tGGRnRMDq3E33zzntT3jawtWiib9ZCxuJ8Zhwc1fIF07YfBJ+sZJ7Kau1205NFJtISGbVhVmpD9kQdoFwYQxYJuvPcDYyIYH/K86bYnBmJWRCwbTh7Es7DCCC90VY/yMjRNoYvjupjhuHKGXE8O/Y8weERZ+GuZ8BSxFwU81YK9mcQyw+Z+MdAFsZEhR7cpxRkty2INKxOdX8wJGVw3A1cInwuiBjLiED0ndh39RqJbE8DUQAJgngSbYK52rCadjhs2xf+tPiDatsDMAHU2DpyDcz,iv:Dh9hhr1mp+gXA1eUvsJVb5opbaEtdRMKAd4HQSQlOpc=,tag:k4M96tstNATvyFe6xF2IzQ==,type:str] sops: kms: [] gcp_kms: [] @@ -15,17 +17,8 @@ sops: aDNUbFlhWWVoOWpjVlV1VTVJejlSMjQK6wCeCRdHY5oyTX6/R1U5AOGJyp0exi1A dWPUMfkKBBBkrR+G6ougd8o3FwFf+yfb5RhaTxxqjit6p2RyMjR64w== -----END AGE ENCRYPTED FILE----- - - recipient: age1d4gvqz3anf082ja6xt03hnkzazfum80um9t45m4rerl4n3va2yuqgnsg03 - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6WVcwYVFWbG1ucEtTSTI5 - Y0pxZ1FidjVURlVxZTdTSHdzME05Z0hyblJBCkQ5R2F1a2IyRVIvYjlmY1p3S3VR - OW1zcnp2Z1Zydlpjd2tBU2RHajhoamMKLS0tIG9oMWtHVU1nTHBtcGM3OWxVNFZL - K3NaMitlT2orSVhHVmFRVmhPUXhBSGMKAqVqH9hT9NL5D6Fsovn67GY056B6Ttwg - fr9y+8rkG43LbuehpKktv2I/UP64QKcYgqWDOWOmicHYx8pOXKLHkA== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2023-10-01T16:32:36Z" - mac: ENC[AES256_GCM,data:C+D3KlZ7MrCB9amCYSkTvUboZDnFa8MwrClk2Tql5LxKssN/VcG/ehBbpAsZqUwprVt+JqeddBtkEXJtUq0b0m0kE5j/HCYnG1k4i11x1TiPA7KcvIsMnp/ZHBMQJEbePZMj4WyD8DVs22fLWosEd/Jqj+8D4ypUkwvnKcW/c+8=,iv:aSI04J/pdYI5/be0z+7Xy/XCjPKeBO79o84JRacxj0w=,tag:IDa7QG2IFNzxU1fvjKI6uQ==,type:str] + lastmodified: "2023-10-05T19:05:15Z" + mac: ENC[AES256_GCM,data:8xMV6RkmXpt2uY07E+59ZXwTwTL6oqo9j5sFOxejwnFU06MGW9t1h/5HFg+GKpp3Jj1LT6a7uuyip6bDGCMEhI054sTv2uDlOIFd4nbHwOh+keEH/FLa8csTq4yyisROsaXUUCtWxraGXz0MQXT8xlQMT7Pn0x43JssmPhOwrRo=,iv:JKNsroIAxvV5V23at/DsDdud5idVn5IEQHrgeFHR3fQ=,tag:XY0hikk4yvqfynPI8q+GBg==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.7.3 diff --git a/nixos/secrets/UGent.yaml b/nixos/secrets/UGent.yaml new file mode 100644 index 0000000..bad19d8 --- /dev/null +++ b/nixos/secrets/UGent.yaml @@ -0,0 +1,25 @@ +UGent: + GitHub: + ssh: ENC[AES256_GCM,data:J50bZHBhN1AT1mF0YpzAFvC4zYeXiIPLJsb4Bx2oqnwX8XlfL0xta7z9Y5CmLxBIxowpj2sLaAnElO1pbsGl8NCnERYvAAt0tpnF3ndozLKfqGPsBKnnc/s9CrZhcsCtoH23lMlVsYMJfVR3B1/0W1XeU+E/GpzBTaH0jkwpmE9+k/TdtPPqSqHvF47NS9lTDx9puHSFixNhxUE82/7wvKTrkGO6+SJXTELXqFM7IojwIHs9UrL2zIrMMRnSPwAiZ96UI4Cg2S18j610ZzX/aw1qODqL53ZfZ9HKurGxyEN58ehR4UhiGsHiml9Ged9UIHhpX3DtMCrwrZfAzGLDV4DxDGQRT8C/aCgOag5AtYJczivY8wA9CQpiTBBUlomUurjRtiSX4FdvZxZLTmY+DtnE/SblRNsAZUEu6DVcg+HUYgqWu+XgVhWyKCiEbKpw0Crl4O3e8evIZ8H7+o3ydQjSgjbIkNjtYGR6fH/8Hh1HOsdh9CDevhNh0TtD/KP7ahTEIeelm6A9ZaP92Bnga5aafKtjX0RBOv4u,iv:6YE94ihsaUkB9+c48ELvRiY8bgZvS0EoyP+l5AisW8o=,tag:NSMpky7GoxDkybFSCjJm3Q==,type:str] + HPC: + ssh: ENC[AES256_GCM,data:A4ir0yvCgIVJCl4C5fB4+WhJVj6Go9XWfjw1/lOaWr2rP+tVNnjGuv/d47z55Gxose5keYX2wRMet/M2Re18+5ckFTyfT4YkcHtQCyBGbmwYmIzxcaxinNsCuOelEdNnFnYW2ha0aJ8Q5Xjfpec1YqDrCT/Add3qGRzBizQJ1FajbyhxJOKLYvUrYvLZ8+XE8SUndvjQnVig3ArUm2hDFsEMm4ClZ4T+EwcIuWrS8ia7ZoqlQhglEtlSEczE65a6hQAFeXE64YC3s8kWlRGhRqJQXjB5g/UTkOht3Vrw2cNzrz90tR9vhooOEBEI6d8F8RJGkdyUe5zod1eKnE/lwOFhhTbzrGrYzX4oUrDIL+Dx9+R9mQchv9qSau1JtKDvzkYmqVVgTC6wE98gTRSBw78f0MKO27FA3diC/k3t+mwsKVRjcvlTUcbRcFAxjq/U5TbOq5jOgA41dI9KE/+bnJoLRh81m/sq9EqMTp90wDKn+jjCn7lGcGDwtaaTlbLIGIw5u9pcfD4UyvJZamnS96JAhsDUqk+fxb05,iv:jPCdaC7CahKrj3tvzZTs1ZI/3+zuCCqIdXp3vo9l/iY=,tag:DeUdWEZHpsB1AMD2AQuiTg==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1fva6s64s884z0q2w7de024sp69ucvqu0pg9shrhhqsn3ewlpjfpsh6md7y + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBYWWFUdnpERVlkK29TQ09k + SnJMVm5rUEV6S0huSzJ2YjFFQ3pNR0pmZWprClZEVDloeDE2ODNkMVVJTUtqaENz + ZzhwTTA4V2xOeW55WGtPZU5FWElQNDAKLS0tIFh5ZWtmZHRBWTAvM3ZwY3pKQ0R6 + aDNUbFlhWWVoOWpjVlV1VTVJejlSMjQK6wCeCRdHY5oyTX6/R1U5AOGJyp0exi1A + dWPUMfkKBBBkrR+G6ougd8o3FwFf+yfb5RhaTxxqjit6p2RyMjR64w== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2023-10-05T18:46:49Z" + mac: ENC[AES256_GCM,data:a1BSmnDBsXhd7eOJ4GNdRwzKkIb8IL+aadSb92RZCdyAIg37Pj2BdsiU9lhofOhEBZ5lhT0hHknqGUzAWO2Lc1qrrluUz2Fz/RFphs55jdj/ZMSOvTQwehrDhqIhluubLgTsQds51CikKhTHCnVjFJNG5q7Qr0aWJSbrmZcj/FE=,iv:fk5+FY2HXyFOGHbl0u0lzwsDthGXbO26XWn8gxvdizg=,tag:oOiPKFJG7fhvnnCK5ISK8Q==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.7.3 diff --git a/nixos/secrets/secrets.yaml b/nixos/secrets/secrets.yaml index f973af5..6c8e2ac 100644 --- a/nixos/secrets/secrets.yaml +++ b/nixos/secrets/secrets.yaml @@ -23,15 +23,6 @@ sops: UHpaNENhL3c1K3RXc05hUmdNZVBpT2MKwBj4+Gb7giVJIoPWiwY3tvugEAexXy6Q YTWgZQZk96r5aF2mBjRCFCc7prj85PsUN/UXOPjPLVAFG3lwS0Eaog== -----END AGE ENCRYPTED FILE----- - - recipient: age1d4gvqz3anf082ja6xt03hnkzazfum80um9t45m4rerl4n3va2yuqgnsg03 - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBDWkE3SW14Kzh6dlNHeE1S - dzUvTTN0bHZESy9vVy9DMXBuNjNneXdlWEFRCkZ1b1Znd2IweG1pNmloOFVjQkpa - LzZjZ051L0ZBTzNQd0N2LzRwNkZUOEUKLS0tIE4vQWk4cXlyUDAzM3VNaDVHaXNi - QXBOc1VXcXFlL2hNK2lTT2ZBeFNUd2sKjuy8anUcn8MCWe6TohLcIIPynBXqEZy/ - C3F94k4aniG0MK/yPoBpoCP9tquIw4zKHJ5syorUJR69LqupgfB6qA== - -----END AGE ENCRYPTED FILE----- lastmodified: "2023-09-10T20:20:18Z" mac: ENC[AES256_GCM,data:yfmYEo8pdlG3tu4Fabwde57igIvpt4UuhQqStVlV36rvPnv9dc42+6iduu+heuQ2OAVw0jk6/o6SWJpcms2DReOAMGDOgt+zV3TgJym52YdMcjTNJTo+4loULhvaWyN9ZdPJjSYKEoSgOZi+oMx4BpwreQEaPaYUxcbTqrWCUa8=,iv:Mb81sBxibRxSaC2kgakhy2pyEmW0MDobF+lHF7cny5E=,tag:DCqTWSnf5Gv5YfAGSEC2yw==,type:str] pgp: [] From 706d18da5cde928a3c854a027a29f87566e7b104 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Thu, 5 Oct 2023 22:50:39 +0200 Subject: [PATCH 023/176] [gnome] Add styling tweaks --- nixos/modules/des/gnome/default.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/nixos/modules/des/gnome/default.nix b/nixos/modules/des/gnome/default.nix index 5b6ebf9..1a5f50e 100644 --- a/nixos/modules/des/gnome/default.nix +++ b/nixos/modules/des/gnome/default.nix @@ -46,4 +46,28 @@ totem # Movie player yelp # Help viewer ]); + + # GNOME ricing + # Browse available settings by running: + # gsettings list-schemas | xargs -I % sh -c 'echo %; gsettings list-keys %' | less + home-manager.users.tdpeuter.dconf.settings = { + "org/gnome/desktop/interface" = { + enable-animations = false; + }; + "org/gnome/desktop/notifications" = { + show-in-lock-screen = false; + }; + "org/gnome/desktop/peripherals.touchpad" = { + tap-to-click = true; + }; + "org/gnome/mutter" = { + dynamic-workspaces = true; + workspaces-only-on-primary = false; + }; + "org/gnome/shell/app-switcher" = { + current-workspace-only = true; + }; + # TODO Add background + # "org/gnome/desktop/background" + }; } From 0b3ce8351ed95147d1d3b0b4b9e945427e85b769 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sat, 7 Oct 2023 16:16:06 +0200 Subject: [PATCH 024/176] Add openrgb --- nixos/modules/hardware/corsair/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 nixos/modules/hardware/corsair/default.nix diff --git a/nixos/modules/hardware/corsair/default.nix b/nixos/modules/hardware/corsair/default.nix new file mode 100644 index 0000000..c67bd77 --- /dev/null +++ b/nixos/modules/hardware/corsair/default.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + services.hardware.openrgb = { + enable = true; + package = pkgs.openrgb-with-all-plugins; + motherboard = "intel"; + }; +} From 396b5046139659680d7242fd571d88d4a6ed83bc Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sat, 7 Oct 2023 16:16:33 +0200 Subject: [PATCH 025/176] Add speech synthesis --- nixos/hosts/Tibo-NixDesk/default.nix | 1 + nixos/modules/apps/firefox/default.nix | 66 ++++++++++++++------------ 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index d18bc78..afb4b3b 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -5,6 +5,7 @@ [ # Include the results of the hardware scan. ./hardware-configuration.nix ../../modules/hardware/nvidia.nix + ../../modules/hardware/corsair ../../modules/apps/virtualbox ../../modules/des/gnome diff --git a/nixos/modules/apps/firefox/default.nix b/nixos/modules/apps/firefox/default.nix index 058ed81..e95910d 100644 --- a/nixos/modules/apps/firefox/default.nix +++ b/nixos/modules/apps/firefox/default.nix @@ -1,37 +1,43 @@ { inputs, lib, config, pkgs, ... }: { - home-manager.users.tdpeuter.programs.firefox = { - enable = true; - package = pkgs.firefox.override { - cfg = { - enableTridactylNative = true; - }; - extraPolicies = { - DisableFirefoxStudies = true; - DisablePocket = true; - DisableTelemetry = true; - ExtensionSettings = {}; - OfferToSaveLogins = false; - }; - }; - profiles.tdpeuter = { - search = { - default = "DuckDuckGo"; - force = true; - engines = { - "eBay".metaData.hidden = true; - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; + home-manager.users.tdpeuter = { + home.packages = with pkgs; [ + speechd + ]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@np" ]; + programs.firefox = { + enable = true; + package = pkgs.firefox.override { + cfg = { + enableTridactylNative = true; + }; + extraPolicies = { + DisableFirefoxStudies = true; + DisablePocket = true; + DisableTelemetry = true; + ExtensionSettings = {}; + OfferToSaveLogins = false; + }; + }; + profiles.tdpeuter = { + search = { + default = "DuckDuckGo"; + force = true; + engines = { + "eBay".metaData.hidden = true; + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; }; }; }; From 6c60d85ea6c79f08c942014a1813e85dafaf3648 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sun, 8 Oct 2023 13:12:27 +0200 Subject: [PATCH 026/176] [gnome] Add wallpaper --- nixos/modules/des/gnome/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nixos/modules/des/gnome/default.nix b/nixos/modules/des/gnome/default.nix index 1a5f50e..967ccea 100644 --- a/nixos/modules/des/gnome/default.nix +++ b/nixos/modules/des/gnome/default.nix @@ -51,8 +51,13 @@ # Browse available settings by running: # gsettings list-schemas | xargs -I % sh -c 'echo %; gsettings list-keys %' | less home-manager.users.tdpeuter.dconf.settings = { + "org/gnome/desktop/background" = { + picture-uri = "file:///home/tdpeuter/Nextcloud/Afbeeldingen/wallpapers/bg"; + picture-uri-dark = "file:///home/tdpeuter/Nextcloud/Afbeeldingen/wallpapers/bg-dark"; + }; "org/gnome/desktop/interface" = { enable-animations = false; + enable-hot-corners = false; }; "org/gnome/desktop/notifications" = { show-in-lock-screen = false; @@ -67,7 +72,5 @@ "org/gnome/shell/app-switcher" = { current-workspace-only = true; }; - # TODO Add background - # "org/gnome/desktop/background" }; } From fff30c3314e5cc7fa5bd1fed068bfc37165db810 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sun, 8 Oct 2023 22:13:53 +0200 Subject: [PATCH 027/176] Test spotify-adblock --- nixos/flake.nix | 4 +++ nixos/modules/apps/default.nix | 2 +- nixos/modules/apps/spotify/default.nix | 17 ++++++++++++ nixos/overlays/spotify/default.nix | 38 ++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 nixos/modules/apps/spotify/default.nix create mode 100644 nixos/overlays/spotify/default.nix diff --git a/nixos/flake.nix b/nixos/flake.nix index 2440f38..3856535 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -38,6 +38,10 @@ allowUnfree = true; }; + sharedOverlays = [ + (import ./overlays/spotify) + ]; + hostDefaults = { inherit system; diff --git a/nixos/modules/apps/default.nix b/nixos/modules/apps/default.nix index ab391da..c65d534 100644 --- a/nixos/modules/apps/default.nix +++ b/nixos/modules/apps/default.nix @@ -2,6 +2,7 @@ imports = [ ./alacritty ./firefox + ./spotify ./steam ./thunderbird # ./virtualbox @@ -19,7 +20,6 @@ obsidian pinentry_qt qalculate-gtk - spotify zathura zoom-us ]; diff --git a/nixos/modules/apps/spotify/default.nix b/nixos/modules/apps/spotify/default.nix new file mode 100644 index 0000000..874595a --- /dev/null +++ b/nixos/modules/apps/spotify/default.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: + +{ + home-manager.users.tdpeuter = { + home.packages = with pkgs; [ + spotify + spotify-adblock + ]; + + # Set the desktop entry to use adblock. + # TODO Is it possible to inherit all other values? + xdg.desktopEntries.spotify = { + name = "Spotify"; + exec = "LD_PRELOAD=${pkgs.spotify-adblock}/lib/libspotifyadblock.so spotify %U"; + }; + }; +} diff --git a/nixos/overlays/spotify/default.nix b/nixos/overlays/spotify/default.nix new file mode 100644 index 0000000..a5f9c17 --- /dev/null +++ b/nixos/overlays/spotify/default.nix @@ -0,0 +1,38 @@ +final: prev: { + spotify-adblock = final.rustPlatform.buildRustPackage rec { + name = "spotify-adblock"; + version = "v1.0.3"; + src = final.fetchFromGitHub { + owner = "abba23"; + repo = "spotify-adblock"; + rev = "5a3281d"; + sha256 = "sha256-UzpHAHpQx2MlmBNKm2turjeVmgp5zXKWm3nZbEo0mYE="; + }; + + cargoHash = "sha256-oHfk68mAIcmOenW7jn71Xpt8hWVDtxyInWhVN2rH+kk="; + + buildInputs = with final; [ + cargo + rustc + ]; + }; +# spotify-wrapper = final.writeScriptBin "spotify-with-adblock" '' +# #!/bin/sh +# LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify +# ''; +# spotify = prev.spotify.overrideAttrs (something: rec { +# installPhase = '' +# echo no +# ''; + +# desktopItem = something.desktopItem.override (desktop: { +# exec = "LD_PRELOAD=/usr/local/lib/spotify-adblock.so ${desktop.exec}"; +# }); +# +# installPhase = builtins.replaceString [ +# "${something.desktopItem}" +# ] [ +# "${desktopItem}" +# ] something.installPhase; +# }); +} From 575bcf6388e2b0f469058bea7d122f5bfa7b14eb Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sun, 8 Oct 2023 23:04:55 +0200 Subject: [PATCH 028/176] Fix not showing up on desktop --- nixos/modules/apps/spotify/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/apps/spotify/default.nix b/nixos/modules/apps/spotify/default.nix index 874595a..54e701b 100644 --- a/nixos/modules/apps/spotify/default.nix +++ b/nixos/modules/apps/spotify/default.nix @@ -11,7 +11,14 @@ # TODO Is it possible to inherit all other values? xdg.desktopEntries.spotify = { name = "Spotify"; - exec = "LD_PRELOAD=${pkgs.spotify-adblock}/lib/libspotifyadblock.so spotify %U"; + genericName = "Music Player"; + icon = "spotify-client"; + exec = "env LD_PRELOAD=${pkgs.spotify-adblock}/lib/libspotifyadblock.so spotify %U"; + mimeType = [ "x-scheme-handler/spotify" ]; + categories = [ "Audio" "Music" "Player" "AudioVideo" ]; + settings = { + StartupWMClass = "spotify"; + }; }; }; } From ce2dfee5486ae0275b33e9c4451e259c674255c5 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Mon, 9 Oct 2023 09:17:50 +0200 Subject: [PATCH 029/176] [firefox] Add speech synthesis --- nixos/modules/apps/firefox/default.nix | 67 ++++++++++++-------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/nixos/modules/apps/firefox/default.nix b/nixos/modules/apps/firefox/default.nix index e95910d..eb0ca04 100644 --- a/nixos/modules/apps/firefox/default.nix +++ b/nixos/modules/apps/firefox/default.nix @@ -1,43 +1,40 @@ { inputs, lib, config, pkgs, ... }: { - home-manager.users.tdpeuter = { - home.packages = with pkgs; [ - speechd - ]; - - programs.firefox = { - enable = true; - package = pkgs.firefox.override { - cfg = { - enableTridactylNative = true; - }; - extraPolicies = { - DisableFirefoxStudies = true; - DisablePocket = true; - DisableTelemetry = true; - ExtensionSettings = {}; - OfferToSaveLogins = false; - }; + home-manager.users.tdpeuter.programs.firefox = { + enable = true; + package = pkgs.firefox.override { + cfg = { + enableTridactylNative = true; + speechSynthesisSupport = true; }; - profiles.tdpeuter = { - search = { - default = "DuckDuckGo"; - force = true; - engines = { - "eBay".metaData.hidden = true; - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; + extraPolicies = { + DisableFirefoxStudies = true; + DisablePocket = true; + DisableTelemetry = true; + ExtensionSettings = {}; + OfferToSaveLogins = false; + }; + }; + profiles.tdpeuter = { + search = { + default = "DuckDuckGo"; + force = true; + engines = { + "Bing".metaData.hidden = true; + "eBay".metaData.hidden = true; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@np" ]; - }; + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; }; }; }; From e1e6c01cf742c1ba36443f3c5ab2a4f595fb3136 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Mon, 9 Oct 2023 09:18:25 +0200 Subject: [PATCH 030/176] Add nsxiv as default for webp --- nixos/modules/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 2921668..6eb2beb 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -87,6 +87,7 @@ "application/xhtml+xml" = browser; "image/jpeg" = image-viewer; "image/png" = image-viewer; + "image/webp" = image-viewer; "text/html" = browser; "x-scheme-handler/chrome" = browser; "x-scheme-handler/http" = browser; From e9a61f9301404514d1235127886343625264de5f Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Tue, 10 Oct 2023 21:14:05 +0200 Subject: [PATCH 031/176] [ssh] Add SubGit key --- nixos/flake.lock | 30 ++++++++++++++-------------- nixos/modules/utils/sops/default.nix | 9 +++++---- nixos/modules/utils/ssh/default.nix | 5 +++++ nixos/secrets/UGent.yaml | 6 ++++-- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index 110b080..76b4674 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1695825837, - "narHash": "sha256-4Ne11kNRnQsmSJCRSSNkFRSnHC4Y5gPDBIQGjjPfJiU=", + "lastModified": 1696697597, + "narHash": "sha256-q26Qv4DQ+h6IeozF2o1secyQG0jt2VUT3V0K58jr3pg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5cfafa12d57374f48bcc36fda3274ada276cf69e", + "rev": "5a237aecb57296f67276ac9ab296a41c23981f56", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1694908564, - "narHash": "sha256-ducA98AuWWJu5oUElIzN24Q22WlO8bOfixGzBgzYdVc=", + "lastModified": 1696717752, + "narHash": "sha256-qEq1styCyQHSrw7AOhskH2qwCFx93bOwsGEzUIrZC0g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "596611941a74be176b98aeba9328aa9d01b8b322", + "rev": "2f3b6b3fcd9fa0a4e6b544180c058a70890a7cc1", "type": "github" }, "original": { @@ -93,11 +93,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1696019113, - "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=", + "lastModified": 1696604326, + "narHash": "sha256-YXUNI0kLEcI5g8lqGMb0nh67fY9f2YoJsILafh6zlMo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a", + "rev": "87828a0e03d1418e848d3dd3f3014a632e4a4f64", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1695284550, - "narHash": "sha256-z9fz/wz9qo9XePEvdduf+sBNeoI9QG8NJKl5ssA8Xl4=", + "lastModified": 1696890802, + "narHash": "sha256-q0cbDNjTnZ1ojoPdy4liEHWXokhQSNULnSKgURp4v2g=", "owner": "Mic92", "repo": "sops-nix", - "rev": "2f375ed8702b0d8ee2430885059d5e7975e38f78", + "rev": "6b32358c22d2718a5407d39a8236c7bd9608f447", "type": "github" }, "original": { @@ -175,11 +175,11 @@ ] }, "locked": { - "lastModified": 1657226504, - "narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=", + "lastModified": 1696331477, + "narHash": "sha256-YkbRa/1wQWdWkVJ01JvV+75KIdM37UErqKgTf0L54Fk=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a", + "rev": "bfc53579db89de750b25b0c5e7af299e0c06d7d3", "type": "github" }, "original": { diff --git a/nixos/modules/utils/sops/default.nix b/nixos/modules/utils/sops/default.nix index e4b0f61..81a9935 100644 --- a/nixos/modules/utils/sops/default.nix +++ b/nixos/modules/utils/sops/default.nix @@ -26,10 +26,10 @@ owner = user; }; UGent = { - format = "yaml"; - sopsFile = ../../../secrets/UGent.yaml; - owner = user; - }; + format = "yaml"; + sopsFile = ../../../secrets/UGent.yaml; + owner = user; + }; in { "Hugo/ssh" = Hugo; "UGent/HPC/ssh" = UGent; @@ -41,6 +41,7 @@ }; "Hugo/Gitea/ssh" = Hugo; "UGent/GitHub/ssh" = UGent; + "UGent/SubGit/ssh" = UGent; }; }; } diff --git a/nixos/modules/utils/ssh/default.nix b/nixos/modules/utils/ssh/default.nix index 5b04bed..445fbc8 100644 --- a/nixos/modules/utils/ssh/default.nix +++ b/nixos/modules/utils/ssh/default.nix @@ -42,6 +42,11 @@ identityFile = "/run/secrets/UGent/GitHub/ssh"; user = "tdpeuter"; }; + "subgit.ugent.be" = { + hostname = "subgit.ugent.be"; + identitiesOnly = true; + identityFile = "/run/secrets/UGent/SubGit/ssh"; + }; }; }; }; diff --git a/nixos/secrets/UGent.yaml b/nixos/secrets/UGent.yaml index bad19d8..ee6240b 100644 --- a/nixos/secrets/UGent.yaml +++ b/nixos/secrets/UGent.yaml @@ -3,6 +3,8 @@ UGent: ssh: ENC[AES256_GCM,data:J50bZHBhN1AT1mF0YpzAFvC4zYeXiIPLJsb4Bx2oqnwX8XlfL0xta7z9Y5CmLxBIxowpj2sLaAnElO1pbsGl8NCnERYvAAt0tpnF3ndozLKfqGPsBKnnc/s9CrZhcsCtoH23lMlVsYMJfVR3B1/0W1XeU+E/GpzBTaH0jkwpmE9+k/TdtPPqSqHvF47NS9lTDx9puHSFixNhxUE82/7wvKTrkGO6+SJXTELXqFM7IojwIHs9UrL2zIrMMRnSPwAiZ96UI4Cg2S18j610ZzX/aw1qODqL53ZfZ9HKurGxyEN58ehR4UhiGsHiml9Ged9UIHhpX3DtMCrwrZfAzGLDV4DxDGQRT8C/aCgOag5AtYJczivY8wA9CQpiTBBUlomUurjRtiSX4FdvZxZLTmY+DtnE/SblRNsAZUEu6DVcg+HUYgqWu+XgVhWyKCiEbKpw0Crl4O3e8evIZ8H7+o3ydQjSgjbIkNjtYGR6fH/8Hh1HOsdh9CDevhNh0TtD/KP7ahTEIeelm6A9ZaP92Bnga5aafKtjX0RBOv4u,iv:6YE94ihsaUkB9+c48ELvRiY8bgZvS0EoyP+l5AisW8o=,tag:NSMpky7GoxDkybFSCjJm3Q==,type:str] HPC: ssh: ENC[AES256_GCM,data:A4ir0yvCgIVJCl4C5fB4+WhJVj6Go9XWfjw1/lOaWr2rP+tVNnjGuv/d47z55Gxose5keYX2wRMet/M2Re18+5ckFTyfT4YkcHtQCyBGbmwYmIzxcaxinNsCuOelEdNnFnYW2ha0aJ8Q5Xjfpec1YqDrCT/Add3qGRzBizQJ1FajbyhxJOKLYvUrYvLZ8+XE8SUndvjQnVig3ArUm2hDFsEMm4ClZ4T+EwcIuWrS8ia7ZoqlQhglEtlSEczE65a6hQAFeXE64YC3s8kWlRGhRqJQXjB5g/UTkOht3Vrw2cNzrz90tR9vhooOEBEI6d8F8RJGkdyUe5zod1eKnE/lwOFhhTbzrGrYzX4oUrDIL+Dx9+R9mQchv9qSau1JtKDvzkYmqVVgTC6wE98gTRSBw78f0MKO27FA3diC/k3t+mwsKVRjcvlTUcbRcFAxjq/U5TbOq5jOgA41dI9KE/+bnJoLRh81m/sq9EqMTp90wDKn+jjCn7lGcGDwtaaTlbLIGIw5u9pcfD4UyvJZamnS96JAhsDUqk+fxb05,iv:jPCdaC7CahKrj3tvzZTs1ZI/3+zuCCqIdXp3vo9l/iY=,tag:DeUdWEZHpsB1AMD2AQuiTg==,type:str] + SubGit: + ssh: ENC[AES256_GCM,data:hJAle4DHJNvX569reclBG5rEdWsjAyV2TtHYMiPfky/dMKJkYgT4+T0doLfUn1O6at77kJGPmwUEvmK819DUuvHtNY7c6angV7iLygJ/ThI1FIFOKH+NxEsI3scoT0VDDybHpgice/fcJL1tMcvE74+dWOnZ2r4pxcMJEFHUPVVWcl9/stJLn78OonsyWpj8PglcnYFOfZ6THIe3lyNBxRp7XEweuwjacthGzOzNu3Z95zcCAnAokFVZ570glJNhjJVNEmPHZkHOcGiGNNM4JNbR11v+dOYtac942t/mmmWwAzbznuu8ZLupYWjdg/f07ftkPAwFwCoXblZ3708Lvf6uOt/CPeWvEII2Haf1Cr5w+U6TAt14zzL73xCSQqwz1TfkcmD+bJplmtcpSP/KX8/BRK7qr6Ec5T9ecbraRB7zDBg0X2x51DSHLrA7UIhpI9JNaOArU5UOVYTWwuzFiGG61elJMcPZ5vWEVrTCocfa4INPo4B2MkFbbsYf6xnY1L3Wc9LQjkff6aCqYnQaXZ/WfPWepf9YvYG1,iv:0Bm1r0FuJJKKmcbTiPL36rb5FaMZfOO7Mx8pXU2FSfg=,tag:0ShoJPJUx37mEAus+mhPmw==,type:str] sops: kms: [] gcp_kms: [] @@ -18,8 +20,8 @@ sops: aDNUbFlhWWVoOWpjVlV1VTVJejlSMjQK6wCeCRdHY5oyTX6/R1U5AOGJyp0exi1A dWPUMfkKBBBkrR+G6ougd8o3FwFf+yfb5RhaTxxqjit6p2RyMjR64w== -----END AGE ENCRYPTED FILE----- - lastmodified: "2023-10-05T18:46:49Z" - mac: ENC[AES256_GCM,data:a1BSmnDBsXhd7eOJ4GNdRwzKkIb8IL+aadSb92RZCdyAIg37Pj2BdsiU9lhofOhEBZ5lhT0hHknqGUzAWO2Lc1qrrluUz2Fz/RFphs55jdj/ZMSOvTQwehrDhqIhluubLgTsQds51CikKhTHCnVjFJNG5q7Qr0aWJSbrmZcj/FE=,iv:fk5+FY2HXyFOGHbl0u0lzwsDthGXbO26XWn8gxvdizg=,tag:oOiPKFJG7fhvnnCK5ISK8Q==,type:str] + lastmodified: "2023-10-10T06:57:11Z" + mac: ENC[AES256_GCM,data:Tvwv2mqceAxi7ic3+95Y6hBMHjqVoCkYnTkEsXOrhumgXpuuB/QQ0ASEf6gbgkCLXGwnUAXsK41bIIJfFgYSk89fHw6AaXfs6a+zL2Mh5zkhMIE2bm68mFK8+/TX/e8SibbEwNZCKOcPqvaO6nK816KCmh3KKCbT9ObaB6CA/KI=,iv:YPKgYAnQ135JXou7q9jVN7b3SKIDwceKcbqiIjkqnTU=,tag:udPrEVu2F+hWkhNoEyjTYg==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.7.3 From 43c8224f5b0d64ff2b95ceddd2feae9e75916b01 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 10 Oct 2023 22:11:09 +0200 Subject: [PATCH 032/176] [git] Fix different mail for uni --- nixos/modules/utils/git/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/modules/utils/git/default.nix b/nixos/modules/utils/git/default.nix index 0f4be64..7910375 100644 --- a/nixos/modules/utils/git/default.nix +++ b/nixos/modules/utils/git/default.nix @@ -4,7 +4,7 @@ home-manager.users.tdpeuter = { programs.git = { enable = true; - userName = "tdpeuter"; + userName = "Tibo De Peuter"; userEmail = "tibo.depeuter@gmail.com"; extraConfig = { core.editor = "vim"; @@ -14,8 +14,11 @@ ]; includes = [ { - path = "~/.gitconfig-ugent"; - condition = "gitdir:~/Nextcloud/Documenten/UGent"; + condition = "gitdir:~/university/"; # Trailing backslash is necessary! + contentSuffix = ".gitconfig"; + contents = { + user.email = "tibo.depeuter@ugent.be"; + }; } ]; }; From 69f948a46962f8f62be38a725d9ebedf81aff5d8 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 11 Oct 2023 20:56:57 +0200 Subject: [PATCH 033/176] Add Kitty Friendship ended with ALACRITTY Now KITTY is my best friend --- nixos/flake.lock | 6 +- nixos/modules/apps/default.nix | 1 + nixos/modules/apps/kitty/default.nix | 15 + nixos/modules/utils/vim/default.nix | 7 +- stow/kitty/.config/kitty/kitty.conf | 2365 +++++++++++++++++ .../.config/kitty/themes/tdpeuter-dark.conf | 39 + .../.config/kitty/themes/tdpeuter-light.conf | 37 + ...puccin_mocha_mod.vim => tdpeuter-dark.vim} | 5 +- stow/vim/.vim/colors/tdpeuter-light.vim | 214 ++ 9 files changed, 2683 insertions(+), 6 deletions(-) create mode 100644 nixos/modules/apps/kitty/default.nix create mode 100644 stow/kitty/.config/kitty/kitty.conf create mode 100644 stow/kitty/.config/kitty/themes/tdpeuter-dark.conf create mode 100644 stow/kitty/.config/kitty/themes/tdpeuter-light.conf rename stow/vim/.vim/colors/{catppuccin_mocha_mod.vim => tdpeuter-dark.vim} (99%) create mode 100644 stow/vim/.vim/colors/tdpeuter-light.vim diff --git a/nixos/flake.lock b/nixos/flake.lock index 76b4674..814881d 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -93,11 +93,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1696604326, - "narHash": "sha256-YXUNI0kLEcI5g8lqGMb0nh67fY9f2YoJsILafh6zlMo=", + "lastModified": 1696879762, + "narHash": "sha256-Ud6bH4DMcYHUDKavNMxAhcIpDGgHMyL/yaDEAVSImQY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "87828a0e03d1418e848d3dd3f3014a632e4a4f64", + "rev": "f99e5f03cc0aa231ab5950a15ed02afec45ed51a", "type": "github" }, "original": { diff --git a/nixos/modules/apps/default.nix b/nixos/modules/apps/default.nix index ab391da..c5ad367 100644 --- a/nixos/modules/apps/default.nix +++ b/nixos/modules/apps/default.nix @@ -2,6 +2,7 @@ imports = [ ./alacritty ./firefox + ./kitty ./steam ./thunderbird # ./virtualbox diff --git a/nixos/modules/apps/kitty/default.nix b/nixos/modules/apps/kitty/default.nix new file mode 100644 index 0000000..2e1726c --- /dev/null +++ b/nixos/modules/apps/kitty/default.nix @@ -0,0 +1,15 @@ +{ inputs, lib, config, pkgs, ... }: + +{ + home-manager.users.tdpeuter = { pkgs, ... }: { + home = { + packages = with pkgs; [ + kitty + ]; + + file = { + ".config/kitty".source = ../../../../stow/kitty/.config/kitty; + }; + }; + }; +} diff --git a/nixos/modules/utils/vim/default.nix b/nixos/modules/utils/vim/default.nix index 338a356..7da1b1a 100644 --- a/nixos/modules/utils/vim/default.nix +++ b/nixos/modules/utils/vim/default.nix @@ -9,7 +9,7 @@ programs.vim = { enable = true; extraConfig = '' - colorscheme catppuccin_mocha_mod + colorscheme tdpeuter-dark " Tags " pacman -S ctags @@ -47,6 +47,11 @@ if $TERM == 'alacritty' set ttymouse=sgr " Alacritty specific endif + if $TERM == 'xterm-kitty' + " Fix and not working + set term=xterm-256color + endif + if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif " https://stackoverflow.com/a/37558470/19044747 diff --git a/stow/kitty/.config/kitty/kitty.conf b/stow/kitty/.config/kitty/kitty.conf new file mode 100644 index 0000000..9f69a3d --- /dev/null +++ b/stow/kitty/.config/kitty/kitty.conf @@ -0,0 +1,2365 @@ +# vim:fileencoding=utf-8:foldmethod=marker + +include ./themes/tdpeuter-dark.conf + +#: Fonts {{{ + +#: kitty has very powerful font management. You can configure +#: individual font faces and even specify special fonts for particular +#: characters. + +# font_family monospace +# bold_font auto +# italic_font auto +# bold_italic_font auto + +#: You can specify different fonts for the bold/italic/bold-italic +#: variants. To get a full list of supported fonts use the `kitty +#: +list-fonts` command. By default they are derived automatically, by +#: the OSes font system. When bold_font or bold_italic_font is set to +#: auto on macOS, the priority of bold fonts is semi-bold, bold, +#: heavy. Setting them manually is useful for font families that have +#: many weight variants like Book, Medium, Thick, etc. For example:: + +#: font_family Operator Mono Book +#: bold_font Operator Mono Medium +#: italic_font Operator Mono Book Italic +#: bold_italic_font Operator Mono Medium Italic + +# font_size 11.0 + +#: Font size (in pts) + +# force_ltr no + +#: kitty does not support BIDI (bidirectional text), however, for RTL +#: scripts, words are automatically displayed in RTL. That is to say, +#: in an RTL script, the words "HELLO WORLD" display in kitty as +#: "WORLD HELLO", and if you try to select a substring of an RTL- +#: shaped string, you will get the character that would be there had +#: the the string been LTR. For example, assuming the Hebrew word +#: ירושלים, selecting the character that on the screen appears to be ם +#: actually writes into the selection buffer the character י. kitty's +#: default behavior is useful in conjunction with a filter to reverse +#: the word order, however, if you wish to manipulate RTL glyphs, it +#: can be very challenging to work with, so this option is provided to +#: turn it off. Furthermore, this option can be used with the command +#: line program GNU FriBidi +#: to get BIDI +#: support, because it will force kitty to always treat the text as +#: LTR, which FriBidi expects for terminals. + +# symbol_map + +#: E.g. symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols + +#: Map the specified Unicode codepoints to a particular font. Useful +#: if you need special rendering for some symbols, such as for +#: Powerline. Avoids the need for patched fonts. Each Unicode code +#: point is specified in the form `U+`. You +#: can specify multiple code points, separated by commas and ranges +#: separated by hyphens. This option can be specified multiple times. +#: The syntax is:: + +#: symbol_map codepoints Font Family Name + +# narrow_symbols + +#: E.g. narrow_symbols U+E0A0-U+E0A3,U+E0C0-U+E0C7 1 + +#: Usually, for Private Use Unicode characters and some symbol/dingbat +#: characters, if the character is followed by one or more spaces, +#: kitty will use those extra cells to render the character larger, if +#: the character in the font has a wide aspect ratio. Using this +#: option you can force kitty to restrict the specified code points to +#: render in the specified number of cells (defaulting to one cell). +#: This option can be specified multiple times. The syntax is:: + +#: narrow_symbols codepoints [optionally the number of cells] + +# disable_ligatures never + +#: Choose how you want to handle multi-character ligatures. The +#: default is to always render them. You can tell kitty to not render +#: them when the cursor is over them by using cursor to make editing +#: easier, or have kitty never render them at all by using always, if +#: you don't like them. The ligature strategy can be set per-window +#: either using the kitty remote control facility or by defining +#: shortcuts for it in kitty.conf, for example:: + +#: map alt+1 disable_ligatures_in active always +#: map alt+2 disable_ligatures_in all never +#: map alt+3 disable_ligatures_in tab cursor + +#: Note that this refers to programming ligatures, typically +#: implemented using the calt OpenType feature. For disabling general +#: ligatures, use the font_features option. + +# font_features + +#: E.g. font_features none + +#: Choose exactly which OpenType features to enable or disable. This +#: is useful as some fonts might have features worthwhile in a +#: terminal. For example, Fira Code includes a discretionary feature, +#: zero, which in that font changes the appearance of the zero (0), to +#: make it more easily distinguishable from Ø. Fira Code also includes +#: other discretionary features known as Stylistic Sets which have the +#: tags ss01 through ss20. + +#: For the exact syntax to use for individual features, see the +#: HarfBuzz documentation . + +#: Note that this code is indexed by PostScript name, and not the font +#: family. This allows you to define very precise feature settings; +#: e.g. you can disable a feature in the italic font but not in the +#: regular font. + +#: On Linux, font features are first read from the FontConfig database +#: and then this option is applied, so they can be configured in a +#: single, central place. + +#: To get the PostScript name for a font, use `kitty +list-fonts +#: --psnames`: + +#: .. code-block:: sh + +#: $ kitty +list-fonts --psnames | grep Fira +#: Fira Code +#: Fira Code Bold (FiraCode-Bold) +#: Fira Code Light (FiraCode-Light) +#: Fira Code Medium (FiraCode-Medium) +#: Fira Code Regular (FiraCode-Regular) +#: Fira Code Retina (FiraCode-Retina) + +#: The part in brackets is the PostScript name. + +#: Enable alternate zero and oldstyle numerals:: + +#: font_features FiraCode-Retina +zero +onum + +#: Enable only alternate zero in the bold font:: + +#: font_features FiraCode-Bold +zero + +#: Disable the normal ligatures, but keep the calt feature which (in +#: this font) breaks up monotony:: + +#: font_features TT2020StyleB-Regular -liga +calt + +#: In conjunction with force_ltr, you may want to disable Arabic +#: shaping entirely, and only look at their isolated forms if they +#: show up in a document. You can do this with e.g.:: + +#: font_features UnifontMedium +isol -medi -fina -init + +# modify_font + +#: Modify font characteristics such as the position or thickness of +#: the underline and strikethrough. The modifications can have the +#: suffix px for pixels or % for percentage of original value. No +#: suffix means use pts. For example:: + +#: modify_font underline_position -2 +#: modify_font underline_thickness 150% +#: modify_font strikethrough_position 2px + +#: Additionally, you can modify the size of the cell in which each +#: font glyph is rendered and the baseline at which the glyph is +#: placed in the cell. For example:: + +#: modify_font cell_width 80% +#: modify_font cell_height -2px +#: modify_font baseline 3 + +#: Note that modifying the baseline will automatically adjust the +#: underline and strikethrough positions by the same amount. +#: Increasing the baseline raises glyphs inside the cell and +#: decreasing it lowers them. Decreasing the cell size might cause +#: rendering artifacts, so use with care. + +# box_drawing_scale 0.001, 1, 1.5, 2 + +#: The sizes of the lines used for the box drawing Unicode characters. +#: These values are in pts. They will be scaled by the monitor DPI to +#: arrive at a pixel value. There must be four values corresponding to +#: thin, normal, thick, and very thick lines. + +# undercurl_style thin-sparse + +#: The style with which undercurls are rendered. This option takes the +#: form (thin|thick)-(sparse|dense). Thin and thick control the +#: thickness of the undercurl. Sparse and dense control how often the +#: curl oscillates. With sparse the curl will peak once per character, +#: with dense twice. + +# text_composition_strategy platform + +#: Control how kitty composites text glyphs onto the background color. +#: The default value of platform tries for text rendering as close to +#: "native" for the platform kitty is running on as possible. + +#: A value of legacy uses the old (pre kitty 0.28) strategy for how +#: glyphs are composited. This will make dark text on light +#: backgrounds look thicker and light text on dark backgrounds +#: thinner. It might also make some text appear like the strokes are +#: uneven. + +#: You can fine tune the actual contrast curve used for glyph +#: composition by specifying two space separated numbers for this +#: setting. + +#: The first number is the gamma adjustment, which controls the +#: thickness of dark text on light backgrounds. Increasing the value +#: will make text appear thicker. The default value for this is 1.0 on +#: Linux and 1.7 on macOS. Valid values are 0.01 and above. The result +#: is scaled based on the luminance difference between the background +#: and the foreground. Dark text on light backgrounds receives the +#: full impact of the curve while light text on dark backgrounds is +#: affected very little. + +#: The second number is an additional multiplicative contrast. It is +#: percentage ranging from 0 to 100. The default value is 0 on Linux +#: and 30 on macOS. + +#: If you wish to achieve similar looking thickness in light and dark +#: themes, a good way to experiment is start by setting the value to +#: 1.0 0 and use a dark theme. Then adjust the second parameter until +#: it looks good. Then switch to a light theme and adjust the first +#: parameter until the perceived thickness matches the dark theme. + +#: }}} + +#: Cursor customization {{{ + +# cursor #cccccc + +#: Default cursor color. If set to the special value none the cursor +#: will be rendered with a "reverse video" effect. It's color will be +#: the color of the text in the cell it is over and the text will be +#: rendered with the background color of the cell. Note that if the +#: program running in the terminal sets a cursor color, this takes +#: precedence. Also, the cursor colors are modified if the cell +#: background and foreground colors have very low contrast. + +# cursor_text_color #111111 + +#: The color of text under the cursor. If you want it rendered with +#: the background color of the cell underneath instead, use the +#: special keyword: background. Note that if cursor is set to none +#: then this option is ignored. + +# cursor_shape block + +#: The cursor shape can be one of block, beam, underline. Note that +#: when reloading the config this will be changed only if the cursor +#: shape has not been set by the program running in the terminal. This +#: sets the default cursor shape, applications running in the terminal +#: can override it. In particular, shell integration +#: in kitty sets +#: the cursor shape to beam at shell prompts. You can avoid this by +#: setting shell_integration to no-cursor. + +# cursor_beam_thickness 1.5 + +#: The thickness of the beam cursor (in pts). + +# cursor_underline_thickness 2.0 + +#: The thickness of the underline cursor (in pts). + +# cursor_blink_interval -1 + +#: The interval to blink the cursor (in seconds). Set to zero to +#: disable blinking. Negative values mean use system default. Note +#: that the minimum interval will be limited to repaint_delay. + +# cursor_stop_blinking_after 15.0 + +#: Stop blinking cursor after the specified number of seconds of +#: keyboard inactivity. Set to zero to never stop blinking. + +#: }}} + +#: Scrollback {{{ + +# scrollback_lines 2000 + +#: Number of lines of history to keep in memory for scrolling back. +#: Memory is allocated on demand. Negative numbers are (effectively) +#: infinite scrollback. Note that using very large scrollback is not +#: recommended as it can slow down performance of the terminal and +#: also use large amounts of RAM. Instead, consider using +#: scrollback_pager_history_size. Note that on config reload if this +#: is changed it will only affect newly created windows, not existing +#: ones. + +# scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER + +#: Program with which to view scrollback in a new window. The +#: scrollback buffer is passed as STDIN to this program. If you change +#: it, make sure the program you use can handle ANSI escape sequences +#: for colors and text formatting. INPUT_LINE_NUMBER in the command +#: line above will be replaced by an integer representing which line +#: should be at the top of the screen. Similarly CURSOR_LINE and +#: CURSOR_COLUMN will be replaced by the current cursor position or +#: set to 0 if there is no cursor, for example, when showing the last +#: command output. + +# scrollback_pager_history_size 0 + +#: Separate scrollback history size (in MB), used only for browsing +#: the scrollback buffer with pager. This separate buffer is not +#: available for interactive scrolling but will be piped to the pager +#: program when viewing scrollback buffer in a separate window. The +#: current implementation stores the data in UTF-8, so approximatively +#: 10000 lines per megabyte at 100 chars per line, for pure ASCII, +#: unformatted text. A value of zero or less disables this feature. +#: The maximum allowed size is 4GB. Note that on config reload if this +#: is changed it will only affect newly created windows, not existing +#: ones. + +# scrollback_fill_enlarged_window no + +#: Fill new space with lines from the scrollback buffer after +#: enlarging a window. + +# wheel_scroll_multiplier 5.0 + +#: Multiplier for the number of lines scrolled by the mouse wheel. +#: Note that this is only used for low precision scrolling devices, +#: not for high precision scrolling devices on platforms such as macOS +#: and Wayland. Use negative numbers to change scroll direction. See +#: also wheel_scroll_min_lines. + +# wheel_scroll_min_lines 1 + +#: The minimum number of lines scrolled by the mouse wheel. The scroll +#: multiplier wheel_scroll_multiplier only takes effect after it +#: reaches this number. Note that this is only used for low precision +#: scrolling devices like wheel mice that scroll by very small amounts +#: when using the wheel. With a negative number, the minimum number of +#: lines will always be added. + +touch_scroll_multiplier 2.0 + +#: Multiplier for the number of lines scrolled by a touchpad. Note +#: that this is only used for high precision scrolling devices on +#: platforms such as macOS and Wayland. Use negative numbers to change +#: scroll direction. + +#: }}} + +#: Mouse {{{ + +# mouse_hide_wait 3.0 + +#: Hide mouse cursor after the specified number of seconds of the +#: mouse not being used. Set to zero to disable mouse cursor hiding. +#: Set to a negative value to hide the mouse cursor immediately when +#: typing text. Disabled by default on macOS as getting it to work +#: robustly with the ever-changing sea of bugs that is Cocoa is too +#: much effort. + +url_color #94E2D5 +url_style stright + +#: The color and style for highlighting URLs on mouse-over. url_style +#: can be one of: none, straight, double, curly, dotted, dashed. + +# open_url_with default + +#: The program to open clicked URLs. The special value default with +#: first look for any URL handlers defined via the open_actions +#: facility and if non +#: are found, it will use the Operating System's default URL handler +#: (open on macOS and xdg-open on Linux). + +# url_prefixes file ftp ftps gemini git gopher http https irc ircs kitty mailto news sftp ssh + +#: The set of URL prefixes to look for when detecting a URL under the +#: mouse cursor. + +detect_urls yes + +#: Detect URLs under the mouse. Detected URLs are highlighted with an +#: underline and the mouse cursor becomes a hand over them. Even if +#: this option is disabled, URLs are still clickable. + +# url_excluded_characters + +#: Additional characters to be disallowed from URLs, when detecting +#: URLs under the mouse cursor. By default, all characters that are +#: legal in URLs are allowed. Additionally, newlines are allowed (but +#: stripped). This is to accommodate programs such as mutt that add +#: hard line breaks even for continued lines. \n can be added to this +#: option to disable this behavior. Special characters can be +#: specified using backslash escapes, to specify a backslash use a +#: double backslash. + +show_hyperlink_targets yes + +#: When the mouse hovers over a terminal hyperlink, show the actual +#: URL that will be activated when the hyperlink is clicked. + +# copy_on_select no + +#: Copy to clipboard or a private buffer on select. With this set to +#: clipboard, selecting text with the mouse will cause the text to be +#: copied to clipboard. Useful on platforms such as macOS that do not +#: have the concept of primary selection. You can instead specify a +#: name such as a1 to copy to a private kitty buffer. Map a shortcut +#: with the paste_from_buffer action to paste from this private +#: buffer. For example:: + +#: copy_on_select a1 +#: map shift+cmd+v paste_from_buffer a1 + +#: Note that copying to the clipboard is a security risk, as all +#: programs, including websites open in your browser can read the +#: contents of the system clipboard. + +# paste_actions quote-urls-at-prompt + +#: A comma separated list of actions to take when pasting text into +#: the terminal. The supported paste actions are: + +#: quote-urls-at-prompt: +#: If the text being pasted is a URL and the cursor is at a shell prompt, +#: automatically quote the URL (needs shell_integration). +#: confirm: +#: Confirm the paste if bracketed paste mode is not active or there is +#: a large amount of text being pasted. +#: filter: +#: Run the filter_paste() function from the file paste-actions.py in +#: the kitty config directory on the pasted text. The text returned by the +#: function will be actually pasted. + +# strip_trailing_spaces never + +#: Remove spaces at the end of lines when copying to clipboard. A +#: value of smart will do it when using normal selections, but not +#: rectangle selections. A value of always will always do it. + +# select_by_word_characters @-./_~?&=%+# + +#: Characters considered part of a word when double clicking. In +#: addition to these characters any character that is marked as an +#: alphanumeric character in the Unicode database will be matched. + +# select_by_word_characters_forward + +#: Characters considered part of a word when extending the selection +#: forward on double clicking. In addition to these characters any +#: character that is marked as an alphanumeric character in the +#: Unicode database will be matched. + +#: If empty (default) select_by_word_characters will be used for both +#: directions. + +# click_interval -1.0 + +#: The interval between successive clicks to detect double/triple +#: clicks (in seconds). Negative numbers will use the system default +#: instead, if available, or fallback to 0.5. + +# focus_follows_mouse no + +#: Set the active window to the window under the mouse when moving the +#: mouse around. + +# pointer_shape_when_grabbed arrow + +#: The shape of the mouse pointer when the program running in the +#: terminal grabs the mouse. Valid values are: arrow, beam and hand. + +# default_pointer_shape beam + +#: The default shape of the mouse pointer. Valid values are: arrow, +#: beam and hand. + +# pointer_shape_when_dragging beam + +#: The default shape of the mouse pointer when dragging across text. +#: Valid values are: arrow, beam and hand. + +#: Mouse actions {{{ + +#: Mouse buttons can be mapped to perform arbitrary actions. The +#: syntax is: + +#: .. code-block:: none + +#: mouse_map button-name event-type modes action + +#: Where button-name is one of left, middle, right, b1 ... b8 with +#: added keyboard modifiers. For example: ctrl+shift+left refers to +#: holding the Ctrl+Shift keys while clicking with the left mouse +#: button. The value b1 ... b8 can be used to refer to up to eight +#: buttons on a mouse. + +#: event-type is one of press, release, doublepress, triplepress, +#: click, doubleclick. modes indicates whether the action is performed +#: when the mouse is grabbed by the program running in the terminal, +#: or not. The values are grabbed or ungrabbed or a comma separated +#: combination of them. grabbed refers to when the program running in +#: the terminal has requested mouse events. Note that the click and +#: double click events have a delay of click_interval to disambiguate +#: from double and triple presses. + +#: You can run kitty with the kitty --debug-input command line option +#: to see mouse events. See the builtin actions below to get a sense +#: of what is possible. + +#: If you want to unmap an action, map it to no_op. For example, to +#: disable opening of URLs with a plain click:: + +#: mouse_map left click ungrabbed no_op + +#: See all the mappable actions including mouse actions here +#: . + +#: .. note:: +#: Once a selection is started, releasing the button that started it will +#: automatically end it and no release event will be dispatched. + +# clear_all_mouse_actions no + +#: Remove all mouse action definitions up to this point. Useful, for +#: instance, to remove the default mouse actions. + +#: Click the link under the mouse or move the cursor + +# mouse_map left click ungrabbed mouse_handle_click selection link prompt + +#:: First check for a selection and if one exists do nothing. Then +#:: check for a link under the mouse cursor and if one exists, click +#:: it. Finally check if the click happened at the current shell +#:: prompt and if so, move the cursor to the click location. Note +#:: that this requires shell integration +#:: to work. + +#: Click the link under the mouse or move the cursor even when grabbed + +# mouse_map shift+left click grabbed,ungrabbed mouse_handle_click selection link prompt + +#:: Same as above, except that the action is performed even when the +#:: mouse is grabbed by the program running in the terminal. + +#: Click the link under the mouse cursor + +# mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_handle_click link + +#:: Variant with Ctrl+Shift is present because the simple click based +#:: version has an unavoidable delay of click_interval, to +#:: disambiguate clicks from double clicks. + +#: Discard press event for link click + +# mouse_map ctrl+shift+left press grabbed discard_event + +#:: Prevent this press event from being sent to the program that has +#:: grabbed the mouse, as the corresponding release event is used to +#:: open a URL. + +#: Paste from the primary selection + +# mouse_map middle release ungrabbed paste_from_selection + +#: Start selecting text + +# mouse_map left press ungrabbed mouse_selection normal + +#: Start selecting text in a rectangle + +# mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle + +#: Select a word + +# mouse_map left doublepress ungrabbed mouse_selection word + +#: Select a line + +# mouse_map left triplepress ungrabbed mouse_selection line + +#: Select line from point + +# mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point + +#:: Select from the clicked point to the end of the line. + +#: Extend the current selection + +# mouse_map right press ungrabbed mouse_selection extend + +#:: If you want only the end of the selection to be moved instead of +#:: the nearest boundary, use move-end instead of extend. + +#: Paste from the primary selection even when grabbed + +# mouse_map shift+middle release ungrabbed,grabbed paste_selection +# mouse_map shift+middle press grabbed discard_event + +#: Start selecting text even when grabbed + +# mouse_map shift+left press ungrabbed,grabbed mouse_selection normal + +#: Start selecting text in a rectangle even when grabbed + +# mouse_map ctrl+shift+alt+left press ungrabbed,grabbed mouse_selection rectangle + +#: Select a word even when grabbed + +# mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word + +#: Select a line even when grabbed + +# mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line + +#: Select line from point even when grabbed + +# mouse_map ctrl+shift+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point + +#:: Select from the clicked point to the end of the line even when +#:: grabbed. + +#: Extend the current selection even when grabbed + +# mouse_map shift+right press ungrabbed,grabbed mouse_selection extend + +#: Show clicked command output in pager + +# mouse_map ctrl+shift+right press ungrabbed mouse_show_command_output + +#:: Requires shell integration +#:: to work. + +#: }}} + +#: }}} + +#: Performance tuning {{{ + +# repaint_delay 10 + +#: Delay between screen updates (in milliseconds). Decreasing it, +#: increases frames-per-second (FPS) at the cost of more CPU usage. +#: The default value yields ~100 FPS which is more than sufficient for +#: most uses. Note that to actually achieve 100 FPS, you have to +#: either set sync_to_monitor to no or use a monitor with a high +#: refresh rate. Also, to minimize latency when there is pending input +#: to be processed, this option is ignored. + +# input_delay 3 + +#: Delay before input from the program running in the terminal is +#: processed (in milliseconds). Note that decreasing it will increase +#: responsiveness, but also increase CPU usage and might cause flicker +#: in full screen programs that redraw the entire screen on each loop, +#: because kitty is so fast that partial screen updates will be drawn. + +# sync_to_monitor yes + +#: Sync screen updates to the refresh rate of the monitor. This +#: prevents screen tearing +#: when scrolling. +#: However, it limits the rendering speed to the refresh rate of your +#: monitor. With a very high speed mouse/high keyboard repeat rate, +#: you may notice some slight input latency. If so, set this to no. + +#: }}} + +#: Terminal bell {{{ + +enable_audio_bell no + +#: The audio bell. Useful to disable it in environments that require +#: silence. + +visual_bell_duration 0.1 + +#: The visual bell duration (in seconds). Flash the screen when a bell +#: occurs for the specified number of seconds. Set to zero to disable. + +visual_bell_color #b00020 + +#: The color used by visual bell. Set to none will fall back to +#: selection background color. If you feel that the visual bell is too +#: bright, you can set it to a darker color. + +# window_alert_on_bell yes + +#: Request window attention on bell. Makes the dock icon bounce on +#: macOS or the taskbar flash on linux. + +# bell_on_tab "🔔 " + +#: Some text or a Unicode symbol to show on the tab if a window in the +#: tab that does not have focus has a bell. If you want to use leading +#: or trailing spaces, surround the text with quotes. See +#: tab_title_template for how this is rendered. + +#: For backwards compatibility, values of yes, y and true are +#: converted to the default bell symbol and no, n, false and none are +#: converted to the empty string. + +# command_on_bell none + +#: Program to run when a bell occurs. The environment variable +#: KITTY_CHILD_CMDLINE can be used to get the program running in the +#: window in which the bell occurred. + +# bell_path none + +#: Path to a sound file to play as the bell sound. If set to none, the +#: system default bell sound is used. Must be in a format supported by +#: the operating systems sound API, such as WAV or OGA on Linux +#: (libcanberra) or AIFF, MP3 or WAV on macOS (NSSound) + +# linux_bell_theme __custom + +#: The XDG Sound Theme kitty will use to play the bell sound. Defaults +#: to the custom theme name used by GNOME and Budgie, falling back to +#: the default freedesktop theme if it does not exist. This option may +#: be removed if Linux ever provides desktop-agnostic support for +#: setting system sound themes. + +#: }}} + +#: Window layout {{{ + +# remember_window_size yes +# initial_window_width 640 +# initial_window_height 400 + +#: If enabled, the OS Window size will be remembered so that new +#: instances of kitty will have the same size as the previous +#: instance. If disabled, the OS Window will initially have size +#: configured by initial_window_width/height, in pixels. You can use a +#: suffix of "c" on the width/height values to have them interpreted +#: as number of cells instead of pixels. + +# enabled_layouts * + +#: The enabled window layouts. A comma separated list of layout names. +#: The special value all means all layouts. The first listed layout +#: will be used as the startup layout. Default configuration is all +#: layouts in alphabetical order. For a list of available layouts, see +#: the layouts . + +# window_resize_step_cells 2 +# window_resize_step_lines 2 + +#: The step size (in units of cell width/cell height) to use when +#: resizing kitty windows in a layout with the shortcut +#: start_resizing_window. The cells value is used for horizontal +#: resizing, and the lines value is used for vertical resizing. + +# window_border_width 0.5pt + +#: The width of window borders. Can be either in pixels (px) or pts +#: (pt). Values in pts will be rounded to the nearest number of pixels +#: based on screen resolution. If not specified, the unit is assumed +#: to be pts. Note that borders are displayed only when more than one +#: window is visible. They are meant to separate multiple windows. + +# draw_minimal_borders yes + +#: Draw only the minimum borders needed. This means that only the +#: borders that separate the window from a neighbor are drawn. Note +#: that setting a non-zero window_margin_width overrides this and +#: causes all borders to be drawn. + +# window_margin_width 0 + +#: The window margin (in pts) (blank area outside the border). A +#: single value sets all four sides. Two values set the vertical and +#: horizontal sides. Three values set top, horizontal and bottom. Four +#: values set top, right, bottom and left. + +# single_window_margin_width -1 + +#: The window margin to use when only a single window is visible (in +#: pts). Negative values will cause the value of window_margin_width +#: to be used instead. A single value sets all four sides. Two values +#: set the vertical and horizontal sides. Three values set top, +#: horizontal and bottom. Four values set top, right, bottom and left. + +# window_padding_width 0 + +#: The window padding (in pts) (blank area between the text and the +#: window border). A single value sets all four sides. Two values set +#: the vertical and horizontal sides. Three values set top, horizontal +#: and bottom. Four values set top, right, bottom and left. + +# placement_strategy center + +#: When the window size is not an exact multiple of the cell size, the +#: cell area of the terminal window will have some extra padding on +#: the sides. You can control how that padding is distributed with +#: this option. Using a value of center means the cell area will be +#: placed centrally. A value of top-left means the padding will be +#: only at the bottom and right edges. + +# active_border_color #00ff00 + +#: The color for the border of the active window. Set this to none to +#: not draw borders around the active window. + +# inactive_border_color #cccccc + +#: The color for the border of inactive windows. + +# bell_border_color #ff5a00 + +#: The color for the border of inactive windows in which a bell has +#: occurred. + +# inactive_text_alpha 1.0 + +#: Fade the text in inactive windows by the specified amount (a number +#: between zero and one, with zero being fully faded). + +hide_window_decorations yes + +#: Hide the window decorations (title-bar and window borders) with +#: yes. On macOS, titlebar-only can be used to only hide the titlebar. +#: Whether this works and exactly what effect it has depends on the +#: window manager/operating system. Note that the effects of changing +#: this option when reloading config are undefined. + +# window_logo_path none + +#: Path to a logo image. Must be in PNG format. Relative paths are +#: interpreted relative to the kitty config directory. The logo is +#: displayed in a corner of every kitty window. The position is +#: controlled by window_logo_position. Individual windows can be +#: configured to have different logos either using the launch action +#: or the remote control facility. + +# window_logo_position bottom-right + +#: Where to position the window logo in the window. The value can be +#: one of: top-left, top, top-right, left, center, right, bottom-left, +#: bottom, bottom-right. + +# window_logo_alpha 0.5 + +#: The amount the logo should be faded into the background. With zero +#: being fully faded and one being fully opaque. + +# resize_debounce_time 0.1 + +#: The time to wait before redrawing the screen when a resize event is +#: received (in seconds). On platforms such as macOS, where the +#: operating system sends events corresponding to the start and end of +#: a resize, this number is ignored. + +# resize_draw_strategy static + +#: Choose how kitty draws a window while a resize is in progress. A +#: value of static means draw the current window contents, mostly +#: unchanged. A value of scale means draw the current window contents +#: scaled. A value of blank means draw a blank window. A value of size +#: means show the window size in cells. + +# resize_in_steps no + +#: Resize the OS window in steps as large as the cells, instead of +#: with the usual pixel accuracy. Combined with initial_window_width +#: and initial_window_height in number of cells, this option can be +#: used to keep the margins as small as possible when resizing the OS +#: window. Note that this does not currently work on Wayland. + +# visual_window_select_characters 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ + +#: The list of characters for visual window selection. For example, +#: for selecting a window to focus on with focus_visible_window. The +#: value should be a series of unique numbers or alphabets, case +#: insensitive, from the set [0-9A-Z]. Specify your preference as a +#: string of characters. + +# confirm_os_window_close -1 + +#: Ask for confirmation when closing an OS window or a tab with at +#: least this number of kitty windows in it by window manager (e.g. +#: clicking the window close button or pressing the operating system +#: shortcut to close windows) or by the close_tab action. A value of +#: zero disables confirmation. This confirmation also applies to +#: requests to quit the entire application (all OS windows, via the +#: quit action). Negative values are converted to positive ones, +#: however, with shell_integration enabled, using negative values +#: means windows sitting at a shell prompt are not counted, only +#: windows where some command is currently running. Note that if you +#: want confirmation when closing individual windows, you can map the +#: close_window_with_confirmation action. + +#: }}} + +#: Tab bar {{{ + +# tab_bar_edge bottom + +#: The edge to show the tab bar on, top or bottom. + +# tab_bar_margin_width 0.0 + +#: The margin to the left and right of the tab bar (in pts). + +# tab_bar_margin_height 0.0 0.0 + +#: The margin above and below the tab bar (in pts). The first number +#: is the margin between the edge of the OS Window and the tab bar. +#: The second number is the margin between the tab bar and the +#: contents of the current tab. + +# tab_bar_style fade + +#: The tab bar style, can be one of: + +#: fade +#: Each tab's edges fade into the background color. (See also tab_fade) +#: slant +#: Tabs look like the tabs in a physical file. +#: separator +#: Tabs are separated by a configurable separator. (See also +#: tab_separator) +#: powerline +#: Tabs are shown as a continuous line with "fancy" separators. +#: (See also tab_powerline_style) +#: custom +#: A user-supplied Python function called draw_tab is loaded from the file +#: tab_bar.py in the kitty config directory. For examples of how to +#: write such a function, see the functions named draw_tab_with_* in +#: kitty's source code: kitty/tab_bar.py. See also +#: this discussion +#: for examples from kitty users. +#: hidden +#: The tab bar is hidden. If you use this, you might want to create +#: a mapping for the select_tab action which presents you with a list of +#: tabs and allows for easy switching to a tab. + +# tab_bar_align left + +#: The horizontal alignment of the tab bar, can be one of: left, +#: center, right. + +# tab_bar_min_tabs 2 + +#: The minimum number of tabs that must exist before the tab bar is +#: shown. + +# tab_switch_strategy previous + +#: The algorithm to use when switching to a tab when the current tab +#: is closed. The default of previous will switch to the last used +#: tab. A value of left will switch to the tab to the left of the +#: closed tab. A value of right will switch to the tab to the right of +#: the closed tab. A value of last will switch to the right-most tab. + +# tab_fade 0.25 0.5 0.75 1 + +#: Control how each tab fades into the background when using fade for +#: the tab_bar_style. Each number is an alpha (between zero and one) +#: that controls how much the corresponding cell fades into the +#: background, with zero being no fade and one being full fade. You +#: can change the number of cells used by adding/removing entries to +#: this list. + +# tab_separator " ┇" + +#: The separator between tabs in the tab bar when using separator as +#: the tab_bar_style. + +# tab_powerline_style angled + +#: The powerline separator style between tabs in the tab bar when +#: using powerline as the tab_bar_style, can be one of: angled, +#: slanted, round. + +# tab_activity_symbol none + +#: Some text or a Unicode symbol to show on the tab if a window in the +#: tab that does not have focus has some activity. If you want to use +#: leading or trailing spaces, surround the text with quotes. See +#: tab_title_template for how this is rendered. + +# tab_title_max_length 0 + +#: The maximum number of cells that can be used to render the text in +#: a tab. A value of zero means that no limit is applied. + +# tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}" + +#: A template to render the tab title. The default just renders the +#: title with optional symbols for bell and activity. If you wish to +#: include the tab-index as well, use something like: {index}:{title}. +#: Useful if you have shortcuts mapped for goto_tab N. If you prefer +#: to see the index as a superscript, use {sup.index}. All data +#: available is: + +#: title +#: The current tab title. +#: index +#: The tab index useable with goto_tab N goto_tab shortcuts. +#: layout_name +#: The current layout name. +#: num_windows +#: The number of windows in the tab. +#: num_window_groups +#: The number of window groups (not counting overlay windows) in the tab. +#: tab.active_wd +#: The working directory of the currently active window in the tab +#: (expensive, requires syscall). Use active_oldest_wd to get +#: the directory of the oldest foreground process rather than the newest. +#: tab.active_exe +#: The name of the executable running in the foreground of the currently +#: active window in the tab (expensive, requires syscall). Use +#: active_oldest_exe for the oldest foreground process. +#: max_title_length +#: The maximum title length available. + +#: Note that formatting is done by Python's string formatting +#: machinery, so you can use, for instance, {layout_name[:2].upper()} +#: to show only the first two letters of the layout name, upper-cased. +#: If you want to style the text, you can use styling directives, for +#: example: +#: `{fmt.fg.red}red{fmt.fg.tab}normal{fmt.bg._00FF00}greenbg{fmt.bg.tab}`. +#: Similarly, for bold and italic: +#: `{fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}`. +#: Note that for backward compatibility, if {bell_symbol} or +#: {activity_symbol} are not present in the template, they are +#: prepended to it. + +# active_tab_title_template none + +#: Template to use for active tabs. If not specified falls back to +#: tab_title_template. + +# active_tab_foreground #000 +# active_tab_background #eee +# active_tab_font_style bold-italic +# inactive_tab_foreground #444 +# inactive_tab_background #999 +# inactive_tab_font_style normal + +#: Tab bar colors and styles. + +# tab_bar_background none + +#: Background color for the tab bar. Defaults to using the terminal +#: background color. + +# tab_bar_margin_color none + +#: Color for the tab bar margin area. Defaults to using the terminal +#: background color for margins above and below the tab bar. For side +#: margins the default color is chosen to match the background color +#: of the neighboring tab. + +#: }}} + +#: Color scheme {{{ + +# Dark mode +#foreground #f8f8f8 +#background #171717 + +# Light mode +# background #f8f8f8 +# foreground #171717 + +#: The foreground and background colors. + +background_opacity 0.9 + +#: The opacity of the background. A number between zero and one, where +#: one is opaque and zero is fully transparent. This will only work if +#: supported by the OS (for instance, when using a compositor under +#: X11). Note that it only sets the background color's opacity in +#: cells that have the same background color as the default terminal +#: background, so that things like the status bar in vim, powerline +#: prompts, etc. still look good. But it means that if you use a color +#: theme with a background color in your editor, it will not be +#: rendered as transparent. Instead you should change the default +#: background color in your kitty config and not use a background +#: color in the editor color scheme. Or use the escape codes to set +#: the terminals default colors in a shell script to launch your +#: editor. Be aware that using a value less than 1.0 is a (possibly +#: significant) performance hit. If you want to dynamically change +#: transparency of windows, set dynamic_background_opacity to yes +#: (this is off by default as it has a performance cost). Changing +#: this option when reloading the config will only work if +#: dynamic_background_opacity was enabled in the original config. + +# background_image none + +#: Path to a background image. Must be in PNG format. + +# background_image_layout tiled + +#: Whether to tile, scale or clamp the background image. The value can +#: be one of tiled, mirror-tiled, scaled, clamped or centered. + +# background_image_linear no + +#: When background image is scaled, whether linear interpolation +#: should be used. + +# dynamic_background_opacity no + +#: Allow changing of the background_opacity dynamically, using either +#: keyboard shortcuts (increase_background_opacity and +#: decrease_background_opacity) or the remote control facility. +#: Changing this option by reloading the config is not supported. + +# background_tint 0.0 + +#: How much to tint the background image by the background color. This +#: option makes it easier to read the text. Tinting is done using the +#: current background color for each window. This option applies only +#: if background_opacity is set and transparent windows are supported +#: or background_image is set. + +# background_tint_gaps 1.0 + +#: How much to tint the background image at the window gaps by the +#: background color, after applying background_tint. Since this is +#: multiplicative with background_tint, it can be used to lighten the +#: tint over the window gaps for a *separated* look. + +# dim_opacity 0.75 + +#: How much to dim text that has the DIM/FAINT attribute set. One +#: means no dimming and zero means fully dimmed (i.e. invisible). + +# selection_foreground #000000 +# selection_background #fffacd + +#: The foreground and background colors for text selected with the +#: mouse. Setting both of these to none will cause a "reverse video" +#: effect for selections, where the selection will be the cell text +#: color and the text will become the cell background color. Setting +#: only selection_foreground to none will cause the foreground color +#: to be used unchanged. Note that these colors can be overridden by +#: the program running in the terminal. + +#: The color table {{{ + +#: The 256 terminal colors. There are 8 basic colors, each color has a +#: dull and bright version, for the first 16 colors. You can set the +#: remaining 240 colors as color16 to color255. + +# color0 #000000 +# color8 #767676 +# color8 #21222c +# color0 #6272a4 + +#: black + +# color1 #cc0403 +# color9 #f2201f +# color9 #ff5555 +# color1 #ff6e6e + +#: red + +# color2 #19cb00 +# color10 #23fd00 +# color10 #50fa7b +# color2 #69ff94 + +#: green + +# color3 #cecb00 +# color11 #fffd00 +# color11 #f1fa8c +# color3 #ffffa5 + +#: yellow + +# color4 #0d73cc +# color12 #1a8fff +# color12 #bd93f9 +# color4 #d6acff + +#: blue + +# color5 #cb1ed1 +# color13 #fd28ff +# color13 #ff79c6 +# color5 #ff92df + +#: magenta + +# color6 #0dcdcd +# color14 #14ffff +# color14 #8be9fd +# color6 #a4ffff + +#: cyan + +# color7 #dddddd +# color15 #ffffff + +#: white + +# mark1_foreground black + +#: Color for marks of type 1 + +# mark1_background #98d3cb + +#: Color for marks of type 1 (light steel blue) + +# mark2_foreground black + +#: Color for marks of type 2 + +# mark2_background #f2dcd3 + +#: Color for marks of type 1 (beige) + +# mark3_foreground black + +#: Color for marks of type 3 + +# mark3_background #f274bc + +#: Color for marks of type 3 (violet) + +#: }}} + +#: }}} + +#: Advanced {{{ + +# shell . + +#: The shell program to execute. The default value of . means to use +#: whatever shell is set as the default shell for the current user. +#: Note that on macOS if you change this, you might need to add +#: --login and --interactive to ensure that the shell starts in +#: interactive mode and reads its startup rc files. + +# editor . + +#: The terminal based text editor (such as vim or nano) to use when +#: editing the kitty config file or similar tasks. + +#: The default value of . means to use the environment variables +#: VISUAL and EDITOR in that order. If these variables aren't set, +#: kitty will run your shell ($SHELL -l -i -c env) to see if your +#: shell startup rc files set VISUAL or EDITOR. If that doesn't work, +#: kitty will cycle through various known editors (vim, emacs, etc.) +#: and take the first one that exists on your system. + +# close_on_child_death no + +#: Close the window when the child process (shell) exits. With the +#: default value no, the terminal will remain open when the child +#: exits as long as there are still processes outputting to the +#: terminal (for example disowned or backgrounded processes). When +#: enabled with yes, the window will close as soon as the child +#: process exits. Note that setting it to yes means that any +#: background processes still using the terminal can fail silently +#: because their stdout/stderr/stdin no longer work. + +# remote_control_password + +#: Allow other programs to control kitty using passwords. This option +#: can be specified multiple times to add multiple passwords. If no +#: passwords are present kitty will ask the user for permission if a +#: program tries to use remote control with a password. A password can +#: also *optionally* be associated with a set of allowed remote +#: control actions. For example:: + +#: remote_control_password "my passphrase" get-colors set-colors focus-window focus-tab + +#: Only the specified actions will be allowed when using this +#: password. Glob patterns can be used too, for example:: + +#: remote_control_password "my passphrase" set-tab-* resize-* + +#: To get a list of available actions, run:: + +#: kitty @ --help + +#: A set of actions to be allowed when no password is sent can be +#: specified by using an empty password. For example:: + +#: remote_control_password "" *-colors + +#: Finally, the path to a python module can be specified that provides +#: a function is_cmd_allowed that is used to check every remote +#: control command. For example:: + +#: remote_control_password "my passphrase" my_rc_command_checker.py + +#: Relative paths are resolved from the kitty configuration directory. +#: See rc_custom_auth for details. + +# allow_remote_control no + +#: Allow other programs to control kitty. If you turn this on, other +#: programs can control all aspects of kitty, including sending text +#: to kitty windows, opening new windows, closing windows, reading the +#: content of windows, etc. Note that this even works over SSH +#: connections. The default setting of no prevents any form of remote +#: control. The meaning of the various values are: + +#: password +#: Remote control requests received over both the TTY device and the socket +#: are confirmed based on passwords, see remote_control_password. + +#: socket-only +#: Remote control requests received over a socket are accepted +#: unconditionally. Requests received over the TTY are denied. +#: See listen_on. + +#: socket +#: Remote control requests received over a socket are accepted +#: unconditionally. Requests received over the TTY are confirmed based on +#: password. + +#: no +#: Remote control is completely disabled. + +#: yes +#: Remote control requests are always accepted. + +# listen_on none + +#: Listen to the specified UNIX socket for remote control connections. +#: Note that this will apply to all kitty instances. It can be +#: overridden by the kitty --listen-on command line option, which also +#: supports listening on a TCP socket. This option accepts only UNIX +#: sockets, such as unix:${TEMP}/mykitty or unix:@mykitty (on Linux). +#: Environment variables are expanded and relative paths are resolved +#: with respect to the temporary directory. If {kitty_pid} is present, +#: then it is replaced by the PID of the kitty process, otherwise the +#: PID of the kitty process is appended to the value, with a hyphen. +#: See the help for kitty --listen-on for more details. Note that this +#: will be ignored unless allow_remote_control is set to either: yes, +#: socket or socket-only. Changing this option by reloading the config +#: is not supported. + +# env + +#: Specify the environment variables to be set in all child processes. +#: Using the name with an equal sign (e.g. env VAR=) will set it to +#: the empty string. Specifying only the name (e.g. env VAR) will +#: remove the variable from the child process' environment. Note that +#: environment variables are expanded recursively, for example:: + +#: env VAR1=a +#: env VAR2=${HOME}/${VAR1}/b + +#: The value of VAR2 will be /a/b. + +# watcher + +#: Path to python file which will be loaded for watchers +#: . Can be +#: specified more than once to load multiple watchers. The watchers +#: will be added to every kitty window. Relative paths are resolved +#: relative to the kitty config directory. Note that reloading the +#: config will only affect windows created after the reload. + +# exe_search_path + +#: Control where kitty finds the programs to run. The default search +#: order is: First search the system wide PATH, then ~/.local/bin and +#: ~/bin. If still not found, the PATH defined in the login shell +#: after sourcing all its startup files is tried. Finally, if present, +#: the PATH specified by the env option is tried. + +#: This option allows you to prepend, append, or remove paths from +#: this search order. It can be specified multiple times for multiple +#: paths. A simple path will be prepended to the search order. A path +#: that starts with the + sign will be append to the search order, +#: after ~/bin above. A path that starts with the - sign will be +#: removed from the entire search order. For example:: + +#: exe_search_path /some/prepended/path +#: exe_search_path +/some/appended/path +#: exe_search_path -/some/excluded/path + +# update_check_interval 24 + +#: The interval to periodically check if an update to kitty is +#: available (in hours). If an update is found, a system notification +#: is displayed informing you of the available update. The default is +#: to check every 24 hours, set to zero to disable. Update checking is +#: only done by the official binary builds. Distro packages or source +#: builds do not do update checking. Changing this option by reloading +#: the config is not supported. + +# startup_session none + +#: Path to a session file to use for all kitty instances. Can be +#: overridden by using the kitty --session =none command line option +#: for individual instances. See sessions +#: in the kitty +#: documentation for details. Note that relative paths are interpreted +#: with respect to the kitty config directory. Environment variables +#: in the path are expanded. Changing this option by reloading the +#: config is not supported. + +# clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask + +#: Allow programs running in kitty to read and write from the +#: clipboard. You can control exactly which actions are allowed. The +#: possible actions are: write-clipboard, read-clipboard, write- +#: primary, read-primary, read-clipboard-ask, read-primary-ask. The +#: default is to allow writing to the clipboard and primary selection +#: and to ask for permission when a program tries to read from the +#: clipboard. Note that disabling the read confirmation is a security +#: risk as it means that any program, even the ones running on a +#: remote server via SSH can read your clipboard. See also +#: clipboard_max_size. + +# clipboard_max_size 512 + +#: The maximum size (in MB) of data from programs running in kitty +#: that will be stored for writing to the system clipboard. A value of +#: zero means no size limit is applied. See also clipboard_control. + +# file_transfer_confirmation_bypass + +#: The password that can be supplied to the file transfer kitten +#: to skip the +#: transfer confirmation prompt. This should only be used when +#: initiating transfers from trusted computers, over trusted networks +#: or encrypted transports, as it allows any programs running on the +#: remote machine to read/write to the local filesystem, without +#: permission. + +# allow_hyperlinks yes + +#: Process hyperlink escape sequences (OSC 8). If disabled OSC 8 +#: escape sequences are ignored. Otherwise they become clickable +#: links, that you can click with the mouse or by using the hints +#: kitten . The +#: special value of ask means that kitty will ask before opening the +#: link when clicked. + +# shell_integration enabled + +#: Enable shell integration on supported shells. This enables features +#: such as jumping to previous prompts, browsing the output of the +#: previous command in a pager, etc. on supported shells. Set to +#: disabled to turn off shell integration, completely. It is also +#: possible to disable individual features, set to a space separated +#: list of these values: no-rc, no-cursor, no-title, no-cwd, no- +#: prompt-mark, no-complete. See Shell integration +#: for details. + +# allow_cloning ask + +#: Control whether programs running in the terminal can request new +#: windows to be created. The canonical example is clone-in-kitty +#: . +#: By default, kitty will ask for permission for each clone request. +#: Allowing cloning unconditionally gives programs running in the +#: terminal (including over SSH) permission to execute arbitrary code, +#: as the user who is running the terminal, on the computer that the +#: terminal is running on. + +# clone_source_strategies venv,conda,env_var,path + +#: Control what shell code is sourced when running clone-in-kitty in +#: the newly cloned window. The supported strategies are: + +#: venv +#: Source the file $VIRTUAL_ENV/bin/activate. This is used by the +#: Python stdlib venv module and allows cloning venvs automatically. +#: conda +#: Run conda activate $CONDA_DEFAULT_ENV. This supports the virtual +#: environments created by conda. +#: env_var +#: Execute the contents of the environment variable +#: KITTY_CLONE_SOURCE_CODE with eval. +#: path +#: Source the file pointed to by the environment variable +#: KITTY_CLONE_SOURCE_PATH. + +#: This option must be a comma separated list of the above values. +#: This only source the first valid one in the above order. + +# term xterm-kitty + +#: The value of the TERM environment variable to set. Changing this +#: can break many terminal programs, only change it if you know what +#: you are doing, not because you read some advice on "Stack Overflow" +#: to change it. The TERM variable is used by various programs to get +#: information about the capabilities and behavior of the terminal. If +#: you change it, depending on what programs you run, and how +#: different the terminal you are changing it to is, various things +#: from key-presses, to colors, to various advanced features may not +#: work. Changing this option by reloading the config will only affect +#: newly created windows. + +#: }}} + +#: OS specific tweaks {{{ + +wayland_titlebar_color system + +#: The color of the kitty window's titlebar on Wayland systems with +#: client side window decorations such as GNOME. A value of system +#: means to use the default system color, a value of background means +#: to use the background color of the currently active window and +#: finally you can use an arbitrary color, such as #12af59 or red. + +# macos_titlebar_color system + +#: The color of the kitty window's titlebar on macOS. A value of +#: system means to use the default system color, light or dark can +#: also be used to set it explicitly. A value of background means to +#: use the background color of the currently active window and finally +#: you can use an arbitrary color, such as #12af59 or red. WARNING: +#: This option works by using a hack when arbitrary color (or +#: background) is configured, as there is no proper Cocoa API for it. +#: It sets the background color of the entire window and makes the +#: titlebar transparent. As such it is incompatible with +#: background_opacity. If you want to use both, you are probably +#: better off just hiding the titlebar with hide_window_decorations. + +# macos_option_as_alt no + +#: Use the Option key as an Alt key on macOS. With this set to no, +#: kitty will use the macOS native Option+Key to enter Unicode +#: character behavior. This will break any Alt+Key keyboard shortcuts +#: in your terminal programs, but you can use the macOS Unicode input +#: technique. You can use the values: left, right or both to use only +#: the left, right or both Option keys as Alt, instead. Note that +#: kitty itself always treats Option the same as Alt. This means you +#: cannot use this option to configure different kitty shortcuts for +#: Option+Key vs. Alt+Key. Also, any kitty shortcuts using +#: Option/Alt+Key will take priority, so that any such key presses +#: will not be passed to terminal programs running inside kitty. +#: Changing this option by reloading the config is not supported. + +# macos_hide_from_tasks no + +#: Hide the kitty window from running tasks on macOS (⌘+Tab and the +#: Dock). Changing this option by reloading the config is not +#: supported. + +# macos_quit_when_last_window_closed no + +#: Have kitty quit when all the top-level windows are closed on macOS. +#: By default, kitty will stay running, even with no open windows, as +#: is the expected behavior on macOS. + +# macos_window_resizable yes + +#: Disable this if you want kitty top-level OS windows to not be +#: resizable on macOS. Changing this option by reloading the config +#: will only affect newly created OS windows. + +# macos_thicken_font 0 + +#: Draw an extra border around the font with the given width, to +#: increase legibility at small font sizes on macOS. For example, a +#: value of 0.75 will result in rendering that looks similar to sub- +#: pixel antialiasing at common font sizes. Note that in modern kitty, +#: this option is obsolete (although still supported). Consider using +#: text_composition_strategy instead. + +# macos_traditional_fullscreen no + +#: Use the macOS traditional full-screen transition, that is faster, +#: but less pretty. + +# macos_show_window_title_in all + +#: Control where the window title is displayed on macOS. A value of +#: window will show the title of the currently active window at the +#: top of the macOS window. A value of menubar will show the title of +#: the currently active window in the macOS global menu bar, making +#: use of otherwise wasted space. A value of all will show the title +#: in both places, and none hides the title. See +#: macos_menubar_title_max_length for how to control the length of the +#: title in the menu bar. + +# macos_menubar_title_max_length 0 + +#: The maximum number of characters from the window title to show in +#: the macOS global menu bar. Values less than one means that there is +#: no maximum limit. + +# macos_custom_beam_cursor no + +#: Use a custom mouse cursor for macOS that is easier to see on both +#: light and dark backgrounds. Nowadays, the default macOS cursor +#: already comes with a white border. WARNING: this might make your +#: mouse cursor invisible on dual GPU machines. Changing this option +#: by reloading the config is not supported. + +# macos_colorspace srgb + +#: The colorspace in which to interpret terminal colors. The default +#: of srgb will cause colors to match those seen in web browsers. The +#: value of default will use whatever the native colorspace of the +#: display is. The value of displayp3 will use Apple's special +#: snowflake display P3 color space, which will result in over +#: saturated (brighter) colors with some color shift. Reloading +#: configuration will change this value only for newly created OS +#: windows. + +linux_display_server wayland + +#: Choose between Wayland and X11 backends. By default, an appropriate +#: backend based on the system state is chosen automatically. Set it +#: to x11 or wayland to force the choice. Changing this option by +#: reloading the config is not supported. + +#: }}} + +#: Keyboard shortcuts {{{ + +#: Keys are identified simply by their lowercase Unicode characters. +#: For example: a for the A key, [ for the left square bracket key, +#: etc. For functional keys, such as Enter or Escape, the names are +#: present at Functional key definitions +#: . +#: For modifier keys, the names are ctrl (control, ⌃), shift (⇧), alt +#: (opt, option, ⌥), super (cmd, command, ⌘). See also: GLFW mods +#: + +#: On Linux you can also use XKB key names to bind keys that are not +#: supported by GLFW. See XKB keys +#: for a list of key names. The name to use is the part +#: after the XKB_KEY_ prefix. Note that you can only use an XKB key +#: name for keys that are not known as GLFW keys. + +#: Finally, you can use raw system key codes to map keys, again only +#: for keys that are not known as GLFW keys. To see the system key +#: code for a key, start kitty with the kitty --debug-input option, +#: kitty will output some debug text for every key event. In that text +#: look for native_code, the value of that becomes the key name in the +#: shortcut. For example: + +#: .. code-block:: none + +#: on_key_input: glfw key: 0x61 native_code: 0x61 action: PRESS mods: none text: 'a' + +#: Here, the key name for the A key is 0x61 and you can use it with:: + +#: map ctrl+0x61 something + +#: to map Ctrl+A to something. + +#: You can use the special action no_op to unmap a keyboard shortcut +#: that is assigned in the default configuration:: + +#: map kitty_mod+space no_op + +#: If you would like kitty to completely ignore a key event, not even +#: sending it to the program running in the terminal, map it to +#: discard_event:: + +#: map kitty_mod+f1 discard_event + +#: You can combine multiple actions to be triggered by a single +#: shortcut with combine action, using the syntax below:: + +#: map key combine action1 action2 action3 ... + +#: For example:: + +#: map kitty_mod+e combine : new_window : next_layout + +#: This will create a new window and switch to the next available +#: layout. + +#: You can use multi-key shortcuts with the syntax shown below:: + +#: map key1>key2>key3 action + +#: For example:: + +#: map ctrl+f>2 set_font_size 20 + +#: The full list of actions that can be mapped to key presses is +#: available here . + +# kitty_mod ctrl+shift + +#: Special modifier key alias for default shortcuts. You can change +#: the value of this option to alter all default shortcuts that use +#: kitty_mod. + +# clear_all_shortcuts no + +#: Remove all shortcut definitions up to this point. Useful, for +#: instance, to remove the default shortcuts. + +# action_alias + +#: E.g. action_alias launch_tab launch --type=tab --cwd=current + +#: Define action aliases to avoid repeating the same options in +#: multiple mappings. Aliases can be defined for any action and will +#: be expanded recursively. For example, the above alias allows you to +#: create mappings to launch a new tab in the current working +#: directory without duplication:: + +#: map f1 launch_tab vim +#: map f2 launch_tab emacs + +#: Similarly, to alias kitten invocation:: + +#: action_alias hints kitten hints --hints-offset=0 + +# kitten_alias + +#: E.g. kitten_alias hints hints --hints-offset=0 + +#: Like action_alias above, but specifically for kittens. Generally, +#: prefer to use action_alias. This option is a legacy version, +#: present for backwards compatibility. It causes all invocations of +#: the aliased kitten to be substituted. So the example above will +#: cause all invocations of the hints kitten to have the --hints- +#: offset=0 option applied. + +#: Clipboard {{{ + +#: Copy to clipboard + +# map kitty_mod+c copy_to_clipboard +# map cmd+c copy_to_clipboard + +#:: There is also a copy_or_interrupt action that can be optionally +#:: mapped to Ctrl+C. It will copy only if there is a selection and +#:: send an interrupt otherwise. Similarly, +#:: copy_and_clear_or_interrupt will copy and clear the selection or +#:: send an interrupt if there is no selection. + +#: Paste from clipboard + +# map kitty_mod+v paste_from_clipboard +# map cmd+v paste_from_clipboard + +#: Paste from selection + +# map kitty_mod+s paste_from_selection +# map shift+insert paste_from_selection + +#: Pass selection to program + +# map kitty_mod+o pass_selection_to_program + +#:: You can also pass the contents of the current selection to any +#:: program with pass_selection_to_program. By default, the system's +#:: open program is used, but you can specify your own, the selection +#:: will be passed as a command line argument to the program. For +#:: example:: + +#:: map kitty_mod+o pass_selection_to_program firefox + +#:: You can pass the current selection to a terminal program running +#:: in a new kitty window, by using the @selection placeholder:: + +#:: map kitty_mod+y new_window less @selection + +#: }}} + +#: Scrolling {{{ + +#: Scroll line up + +# map kitty_mod+up scroll_line_up +# map kitty_mod+k scroll_line_up +# map opt+cmd+page_up scroll_line_up +# map cmd+up scroll_line_up + +#: Scroll line down + +# map kitty_mod+down scroll_line_down +# map kitty_mod+j scroll_line_down +# map opt+cmd+page_down scroll_line_down +# map cmd+down scroll_line_down + +#: Scroll page up + +# map kitty_mod+page_up scroll_page_up +# map cmd+page_up scroll_page_up + +#: Scroll page down + +# map kitty_mod+page_down scroll_page_down +# map cmd+page_down scroll_page_down + +#: Scroll to top + +# map kitty_mod+home scroll_home +# map cmd+home scroll_home + +#: Scroll to bottom + +# map kitty_mod+end scroll_end +# map cmd+end scroll_end + +#: Scroll to previous shell prompt + +# map kitty_mod+z scroll_to_prompt -1 + +#:: Use a parameter of 0 for scroll_to_prompt to scroll to the last +#:: jumped to or the last clicked position. Requires shell +#:: integration +#:: to work. + +#: Scroll to next shell prompt + +# map kitty_mod+x scroll_to_prompt 1 + +#: Browse scrollback buffer in pager + +# map kitty_mod+h show_scrollback + +#:: You can pipe the contents of the current screen and history +#:: buffer as STDIN to an arbitrary program using launch --stdin- +#:: source. For example, the following opens the scrollback buffer in +#:: less in an overlay window:: + +#:: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R + +#:: For more details on piping screen and buffer contents to external +#:: programs, see launch . + +#: Browse output of the last shell command in pager + +# map kitty_mod+g show_last_command_output + +#:: You can also define additional shortcuts to get the command +#:: output. For example, to get the first command output on screen:: + +#:: map f1 show_first_command_output_on_screen + +#:: To get the command output that was last accessed by a keyboard +#:: action or mouse action:: + +#:: map f1 show_last_visited_command_output + +#:: You can pipe the output of the last command run in the shell +#:: using the launch action. For example, the following opens the +#:: output in less in an overlay window:: + +#:: map f1 launch --stdin-source=@last_cmd_output --stdin-add-formatting --type=overlay less +G -R + +#:: To get the output of the first command on the screen, use +#:: @first_cmd_output_on_screen. To get the output of the last jumped +#:: to command, use @last_visited_cmd_output. + +#:: Requires shell integration +#:: to work. + +#: }}} + +#: Window management {{{ + +#: New window + +# map kitty_mod+enter new_window +# map cmd+enter new_window + +#:: You can open a new kitty window running an arbitrary program, for +#:: example:: + +#:: map kitty_mod+y launch mutt + +#:: You can open a new window with the current working directory set +#:: to the working directory of the current window using:: + +#:: map ctrl+alt+enter launch --cwd=current + +#:: You can open a new window that is allowed to control kitty via +#:: the kitty remote control facility with launch --allow-remote- +#:: control. Any programs running in that window will be allowed to +#:: control kitty. For example:: + +#:: map ctrl+enter launch --allow-remote-control some_program + +#:: You can open a new window next to the currently active window or +#:: as the first window, with:: + +#:: map ctrl+n launch --location=neighbor +#:: map ctrl+f launch --location=first + +#:: For more details, see launch +#:: . + +#: New OS window + +# map kitty_mod+n new_os_window +# map cmd+n new_os_window + +#:: Works like new_window above, except that it opens a top-level OS +#:: window. In particular you can use new_os_window_with_cwd to open +#:: a window with the current working directory. + +#: Close window + +# map kitty_mod+w close_window +# map shift+cmd+d close_window + +#: Next window + +# map kitty_mod+] next_window + +#: Previous window + +# map kitty_mod+[ previous_window + +#: Move window forward + +# map kitty_mod+f move_window_forward + +#: Move window backward + +# map kitty_mod+b move_window_backward + +#: Move window to top + +# map kitty_mod+` move_window_to_top + +#: Start resizing window + +# map kitty_mod+r start_resizing_window +# map cmd+r start_resizing_window + +#: First window + +# map kitty_mod+1 first_window +# map cmd+1 first_window + +#: Second window + +# map kitty_mod+2 second_window +# map cmd+2 second_window + +#: Third window + +# map kitty_mod+3 third_window +# map cmd+3 third_window + +#: Fourth window + +# map kitty_mod+4 fourth_window +# map cmd+4 fourth_window + +#: Fifth window + +# map kitty_mod+5 fifth_window +# map cmd+5 fifth_window + +#: Sixth window + +# map kitty_mod+6 sixth_window +# map cmd+6 sixth_window + +#: Seventh window + +# map kitty_mod+7 seventh_window +# map cmd+7 seventh_window + +#: Eight window + +# map kitty_mod+8 eighth_window +# map cmd+8 eighth_window + +#: Ninth window + +# map kitty_mod+9 ninth_window +# map cmd+9 ninth_window + +#: Tenth window + +# map kitty_mod+0 tenth_window + +#: Visually select and focus window + +# map kitty_mod+f7 focus_visible_window + +#:: Display overlay numbers and alphabets on the window, and switch +#:: the focus to the window when you press the key. When there are +#:: only two windows, the focus will be switched directly without +#:: displaying the overlay. You can change the overlay characters and +#:: their order with option visual_window_select_characters. + +#: Visually swap window with another + +# map kitty_mod+f8 swap_with_window + +#:: Works like focus_visible_window above, but swaps the window. + +#: }}} + +#: Tab management {{{ + +#: Next tab + +# map kitty_mod+right next_tab +# map shift+cmd+] next_tab +# map ctrl+tab next_tab + +#: Previous tab + +# map kitty_mod+left previous_tab +# map shift+cmd+[ previous_tab +# map ctrl+shift+tab previous_tab + +#: New tab + +# map kitty_mod+t new_tab +# map cmd+t new_tab + +#: Close tab + +# map kitty_mod+q close_tab +# map cmd+w close_tab + +#: Close OS window + +# map shift+cmd+w close_os_window + +#: Move tab forward + +# map kitty_mod+. move_tab_forward + +#: Move tab backward + +# map kitty_mod+, move_tab_backward + +#: Set tab title + +# map kitty_mod+alt+t set_tab_title +# map shift+cmd+i set_tab_title + + +#: You can also create shortcuts to go to specific tabs, with 1 being +#: the first tab, 2 the second tab and -1 being the previously active +#: tab, and any number larger than the last tab being the last tab:: + +#: map ctrl+alt+1 goto_tab 1 +#: map ctrl+alt+2 goto_tab 2 + +#: Just as with new_window above, you can also pass the name of +#: arbitrary commands to run when using new_tab and new_tab_with_cwd. +#: Finally, if you want the new tab to open next to the current tab +#: rather than at the end of the tabs list, use:: + +#: map ctrl+t new_tab !neighbor [optional cmd to run] +#: }}} + +#: Layout management {{{ + +#: Next layout + +# map kitty_mod+l next_layout + + +#: You can also create shortcuts to switch to specific layouts:: + +#: map ctrl+alt+t goto_layout tall +#: map ctrl+alt+s goto_layout stack + +#: Similarly, to switch back to the previous layout:: + +#: map ctrl+alt+p last_used_layout + +#: There is also a toggle_layout action that switches to the named +#: layout or back to the previous layout if in the named layout. +#: Useful to temporarily "zoom" the active window by switching to the +#: stack layout:: + +#: map ctrl+alt+z toggle_layout stack +#: }}} + +#: Font sizes {{{ + +#: You can change the font size for all top-level kitty OS windows at +#: a time or only the current one. + +#: Increase font size + +# map kitty_mod+equal change_font_size all +2.0 +# map kitty_mod+plus change_font_size all +2.0 +# map kitty_mod+kp_add change_font_size all +2.0 +# map cmd+plus change_font_size all +2.0 +# map cmd+equal change_font_size all +2.0 +# map shift+cmd+equal change_font_size all +2.0 + +#: Decrease font size + +# map kitty_mod+minus change_font_size all -2.0 +# map kitty_mod+kp_subtract change_font_size all -2.0 +# map cmd+minus change_font_size all -2.0 +# map shift+cmd+minus change_font_size all -2.0 + +#: Reset font size + +# map kitty_mod+backspace change_font_size all 0 +# map cmd+0 change_font_size all 0 + + +#: To setup shortcuts for specific font sizes:: + +#: map kitty_mod+f6 change_font_size all 10.0 + +#: To setup shortcuts to change only the current OS window's font +#: size:: + +#: map kitty_mod+f6 change_font_size current 10.0 +#: }}} + +#: Select and act on visible text {{{ + +#: Use the hints kitten to select text and either pass it to an +#: external program or insert it into the terminal or copy it to the +#: clipboard. + +#: Open URL + +# map kitty_mod+e open_url_with_hints + +#:: Open a currently visible URL using the keyboard. The program used +#:: to open the URL is specified in open_url_with. + +#: Insert selected path + +# map kitty_mod+p>f kitten hints --type path --program - + +#:: Select a path/filename and insert it into the terminal. Useful, +#:: for instance to run git commands on a filename output from a +#:: previous git command. + +#: Open selected path + +# map kitty_mod+p>shift+f kitten hints --type path + +#:: Select a path/filename and open it with the default open program. + +#: Insert selected line + +# map kitty_mod+p>l kitten hints --type line --program - + +#:: Select a line of text and insert it into the terminal. Useful for +#:: the output of things like: `ls -1`. + +#: Insert selected word + +# map kitty_mod+p>w kitten hints --type word --program - + +#:: Select words and insert into terminal. + +#: Insert selected hash + +# map kitty_mod+p>h kitten hints --type hash --program - + +#:: Select something that looks like a hash and insert it into the +#:: terminal. Useful with git, which uses SHA1 hashes to identify +#:: commits. + +#: Open the selected file at the selected line + +# map kitty_mod+p>n kitten hints --type linenum + +#:: Select something that looks like filename:linenum and open it in +#:: vim at the specified line number. + +#: Open the selected hyperlink + +# map kitty_mod+p>y kitten hints --type hyperlink + +#:: Select a hyperlink (i.e. a URL that has been marked as such by +#:: the terminal program, for example, by `ls --hyperlink=auto`). + + +#: The hints kitten has many more modes of operation that you can map +#: to different shortcuts. For a full description see hints kitten +#: . +#: }}} + +#: Miscellaneous {{{ + +#: Show documentation + +# map kitty_mod+f1 show_kitty_doc overview + +#: Toggle fullscreen + +# map kitty_mod+f11 toggle_fullscreen +# map ctrl+cmd+f toggle_fullscreen + +#: Toggle maximized + +# map kitty_mod+f10 toggle_maximized + +#: Toggle macOS secure keyboard entry + +# map opt+cmd+s toggle_macos_secure_keyboard_entry + +#: Unicode input + +# map kitty_mod+u kitten unicode_input +# map ctrl+cmd+space kitten unicode_input + +#: Edit config file + +# map kitty_mod+f2 edit_config_file +# map cmd+, edit_config_file + +#: Open the kitty command shell + +# map kitty_mod+escape kitty_shell window + +#:: Open the kitty shell in a new window / tab / overlay / os_window +#:: to control kitty using commands. + +#: Increase background opacity + +# map kitty_mod+a>m set_background_opacity +0.1 + +#: Decrease background opacity + +# map kitty_mod+a>l set_background_opacity -0.1 + +#: Make background fully opaque + +# map kitty_mod+a>1 set_background_opacity 1 + +#: Reset background opacity + +# map kitty_mod+a>d set_background_opacity default + +#: Reset the terminal + +# map kitty_mod+delete clear_terminal reset active +# map opt+cmd+r clear_terminal reset active + +#:: You can create shortcuts to clear/reset the terminal. For +#:: example:: + +#:: # Reset the terminal +#:: map f1 clear_terminal reset active +#:: # Clear the terminal screen by erasing all contents +#:: map f1 clear_terminal clear active +#:: # Clear the terminal scrollback by erasing it +#:: map f1 clear_terminal scrollback active +#:: # Scroll the contents of the screen into the scrollback +#:: map f1 clear_terminal scroll active +#:: # Clear everything up to the line with the cursor +#:: map f1 clear_terminal to_cursor active + +#:: If you want to operate on all kitty windows instead of just the +#:: current one, use all instead of active. + +#:: It is also possible to remap Ctrl+L to both scroll the current +#:: screen contents into the scrollback buffer and clear the screen, +#:: instead of just clearing the screen, for example, for ZSH add the +#:: following to ~/.zshrc: + +#:: .. code-block:: zsh + +#:: scroll-and-clear-screen() { +#:: printf '\n%.0s' {1..$LINES} +#:: zle clear-screen +#:: } +#:: zle -N scroll-and-clear-screen +#:: bindkey '^l' scroll-and-clear-screen + +#: Clear up to cursor line + +# map cmd+k clear_terminal to_cursor active + +#: Reload kitty.conf + +# map kitty_mod+f5 load_config_file +# map ctrl+cmd+, load_config_file + +#:: Reload kitty.conf, applying any changes since the last time it +#:: was loaded. Note that a handful of options cannot be dynamically +#:: changed and require a full restart of kitty. Particularly, when +#:: changing shortcuts for actions located on the macOS global menu +#:: bar, a full restart is needed. You can also map a keybinding to +#:: load a different config file, for example:: + +#:: map f5 load_config /path/to/alternative/kitty.conf + +#:: Note that all options from the original kitty.conf are discarded, +#:: in other words the new configuration *replace* the old ones. + +#: Debug kitty configuration + +# map kitty_mod+f6 debug_config +# map opt+cmd+, debug_config + +#:: Show details about exactly what configuration kitty is running +#:: with and its host environment. Useful for debugging issues. + +#: Send arbitrary text on key presses + +#:: E.g. map ctrl+shift+alt+h send_text all Hello World + +#:: You can tell kitty to send arbitrary (UTF-8) encoded text to the +#:: client program when pressing specified shortcut keys. For +#:: example:: + +#:: map ctrl+alt+a send_text all Special text + +#:: This will send "Special text" when you press the Ctrl+Alt+A key +#:: combination. The text to be sent decodes ANSI C escapes +#:: so you can use escapes like \e to send control +#:: codes or \u21fb to send Unicode characters (or you can just input +#:: the Unicode characters directly as UTF-8 text). You can use +#:: `kitty +kitten show_key` to get the key escape codes you want to +#:: emulate. + +#:: The first argument to send_text is the keyboard modes in which to +#:: activate the shortcut. The possible values are normal, +#:: application, kitty or a comma separated combination of them. The +#:: modes normal and application refer to the DECCKM cursor key mode +#:: for terminals, and kitty refers to the kitty extended keyboard +#:: protocol. The special value all means all of them. + +#:: Some more examples:: + +#:: # Output a word and move the cursor to the start of the line (like typing and pressing Home) +#:: map ctrl+alt+a send_text normal Word\e[H +#:: map ctrl+alt+a send_text application Word\eOH +#:: # Run a command at a shell prompt (like typing the command and pressing Enter) +#:: map ctrl+alt+a send_text normal,application some command with arguments\r + +#: Open kitty Website + +# map shift+cmd+/ open_url https://sw.kovidgoyal.net/kitty/ + +#: Hide macOS kitty application + +# map cmd+h hide_macos_app + +#: Hide macOS other applications + +# map opt+cmd+h hide_macos_other_apps + +#: Minimize macOS window + +# map cmd+m minimize_macos_window + +#: Quit kitty + +# map cmd+q quit + +#: }}} + +#: }}} + diff --git a/stow/kitty/.config/kitty/themes/tdpeuter-dark.conf b/stow/kitty/.config/kitty/themes/tdpeuter-dark.conf new file mode 100644 index 0000000..74d0bb6 --- /dev/null +++ b/stow/kitty/.config/kitty/themes/tdpeuter-dark.conf @@ -0,0 +1,39 @@ +foreground #dcdfe4 +background #171717 +selection_foreground #000000 +selection_background #FFFACD +url_color #0087BD + +# black +color0 #21222c +color8 #6272a4 + +# red +color1 #C86564 +color9 #C86564 + +# green +color2 #B2BC68 +color10 #B2BC68 + +# yellow +color3 #f7e03f +color11 #f7e03f + +# blue +color4 #80A2BE +color12 #80A2BE + +# magenta +color5 #b294bb +color13 #b294bb + +# cyan +# color6 #60C7CE +# color14 #60C7CE +color6 #8ABEB7 +color14 #8ABEB7 + +# white +color7 #ffffff +color15 #ffffff diff --git a/stow/kitty/.config/kitty/themes/tdpeuter-light.conf b/stow/kitty/.config/kitty/themes/tdpeuter-light.conf new file mode 100644 index 0000000..23288ce --- /dev/null +++ b/stow/kitty/.config/kitty/themes/tdpeuter-light.conf @@ -0,0 +1,37 @@ +foreground #383A42 +background #FAFAFA +selection_foreground #383A42 +selection_background #BFCEFF +url_color #F0F0F0 + +# black +color0 #383A42 +color8 #383A42 + +# red +color1 #E45649 +color9 #E45649 + +# green +color2 #40A14F +color10 #40A14F + +# yellow +color3 #C18401 +color11 #C18401 + +# blue +color4 #0184BC +color12 #0184BC + +# magenta +color5 #A626A4 +color13 #A626A4 + +# cyan +color6 #0997B3 +color14 #0997B3 + +# white +color7 #FAFAFA +color15 #FAFAFA diff --git a/stow/vim/.vim/colors/catppuccin_mocha_mod.vim b/stow/vim/.vim/colors/tdpeuter-dark.vim similarity index 99% rename from stow/vim/.vim/colors/catppuccin_mocha_mod.vim rename to stow/vim/.vim/colors/tdpeuter-dark.vim index 0282179..25c5705 100644 --- a/stow/vim/.vim/colors/catppuccin_mocha_mod.vim +++ b/stow/vim/.vim/colors/tdpeuter-dark.vim @@ -1,4 +1,4 @@ -" Name: catppuccin_mocha.vim +" Name: tdpeuter-dark.vim set background=dark hi clear @@ -7,7 +7,8 @@ if exists('syntax on') syntax reset endif -let g:colors_name='catppuccin_mocha_mod' +let g:colors_name="tdpeuter-dark" +let colors_name="tdpeuter-dark" set t_Co=256 set cursorline diff --git a/stow/vim/.vim/colors/tdpeuter-light.vim b/stow/vim/.vim/colors/tdpeuter-light.vim new file mode 100644 index 0000000..25d0399 --- /dev/null +++ b/stow/vim/.vim/colors/tdpeuter-light.vim @@ -0,0 +1,214 @@ +" Name: tdpeuter-light.vim + +set background=light +highlight clear +syntax reset + +let g:colors_name="tdpeuter-light" +let colors_name="tdpeuter-light" + +let s:black = { "gui": "#383a42", "cterm": "237" } +let s:red = { "gui": "#e45649", "cterm": "167" } +let s:green = { "gui": "#50a14f", "cterm": "71" } +let s:yellow = { "gui": "#c18401", "cterm": "136" } +let s:blue = { "gui": "#0184bc", "cterm": "31" } +let s:purple = { "gui": "#a626a4", "cterm": "127" } +let s:cyan = { "gui": "#0997b3", "cterm": "31" } +let s:white = { "gui": "#fafafa", "cterm": "231" } + +let s:fg = s:black +let s:bg = s:white + +let s:comment_fg = { "gui": "#a0a1a7", "cterm": "247" } +let s:gutter_bg = { "gui": "#fafafa", "cterm": "231" } +let s:gutter_fg = { "gui": "#d4d4d4", "cterm": "252" } +let s:non_text = { "gui": "#e5e5e5", "cterm": "252" } + +let s:cursor_line = { "gui": "#f0f0f0", "cterm": "255" } +let s:color_col = { "gui": "#f0f0f0", "cterm": "255" } + +let s:selection = { "gui": "#bfceff", "cterm": "153" } +let s:vertsplit = { "gui": "#f0f0f0", "cterm": "255" } + + +function! s:h(group, fg, bg, attr) + if type(a:fg) == type({}) + exec "hi " . a:group . " guifg=" . a:fg.gui . " ctermfg=" . a:fg.cterm + else + exec "hi " . a:group . " guifg=NONE cterm=NONE" + endif + if type(a:bg) == type({}) + exec "hi " . a:group . " guibg=" . a:bg.gui . " ctermbg=" . a:bg.cterm + else + exec "hi " . a:group . " guibg=NONE ctermbg=NONE" + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr + else + exec "hi " . a:group . " gui=NONE cterm=NONE" + endif +endfun + + +" User interface colors { +call s:h("Normal", s:fg, s:bg, "") + +call s:h("Cursor", s:bg, s:blue, "") +call s:h("CursorColumn", "", s:cursor_line, "") +call s:h("CursorLine", "", s:cursor_line, "") + +call s:h("LineNr", s:gutter_fg, s:gutter_bg, "") +call s:h("CursorLineNr", s:fg, "", "") + +call s:h("DiffAdd", s:green, "", "") +call s:h("DiffChange", s:yellow, "", "") +call s:h("DiffDelete", s:red, "", "") +call s:h("DiffText", s:blue, "", "") + +call s:h("IncSearch", s:bg, s:yellow, "") +call s:h("Search", s:bg, s:yellow, "") + +call s:h("ErrorMsg", s:fg, "", "") +call s:h("ModeMsg", s:fg, "", "") +call s:h("MoreMsg", s:fg, "", "") +call s:h("WarningMsg", s:red, "", "") +call s:h("Question", s:purple, "", "") + +call s:h("Pmenu", s:fg, s:cursor_line, "") +call s:h("PmenuSel", s:bg, s:blue, "") +call s:h("PmenuSbar", "", s:cursor_line, "") +call s:h("PmenuThumb", "", s:comment_fg, "") + +call s:h("SpellBad", s:red, "", "") +call s:h("SpellCap", s:yellow, "", "") +call s:h("SpellLocal", s:yellow, "", "") +call s:h("SpellRare", s:yellow, "", "") + +call s:h("StatusLine", s:blue, s:cursor_line, "") +call s:h("StatusLineNC", s:comment_fg, s:cursor_line, "") +call s:h("TabLine", s:comment_fg, s:cursor_line, "") +call s:h("TabLineFill", s:comment_fg, s:cursor_line, "") +call s:h("TabLineSel", s:fg, s:bg, "") + +call s:h("Visual", "", s:selection, "") +call s:h("VisualNOS", "", s:selection, "") + +call s:h("ColorColumn", "", s:color_col, "") +call s:h("Conceal", s:fg, "", "") +call s:h("Directory", s:blue, "", "") +call s:h("VertSplit", s:vertsplit, s:vertsplit, "") +call s:h("Folded", s:fg, "", "") +call s:h("FoldColumn", s:fg, "", "") +call s:h("SignColumn", s:fg, "", "") + +call s:h("MatchParen", s:blue, "", "underline") +call s:h("SpecialKey", s:fg, "", "") +call s:h("Title", s:green, "", "") +call s:h("WildMenu", s:fg, "", "") +" } + + +" Syntax colors { +" Whitespace is defined in Neovim, not Vim. +" See :help hl-Whitespace and :help hl-SpecialKey +call s:h("Whitespace", s:non_text, "", "") +call s:h("NonText", s:non_text, "", "") +call s:h("Comment", s:comment_fg, "", "italic") +call s:h("Constant", s:cyan, "", "") +call s:h("String", s:green, "", "") +call s:h("Character", s:green, "", "") +call s:h("Number", s:yellow, "", "") +call s:h("Boolean", s:yellow, "", "") +call s:h("Float", s:yellow, "", "") + +call s:h("Identifier", s:red, "", "") +call s:h("Function", s:blue, "", "") +call s:h("Statement", s:purple, "", "") + +call s:h("Conditional", s:purple, "", "") +call s:h("Repeat", s:purple, "", "") +call s:h("Label", s:purple, "", "") +call s:h("Operator", s:fg, "", "") +call s:h("Keyword", s:red, "", "") +call s:h("Exception", s:purple, "", "") + +call s:h("PreProc", s:yellow, "", "") +call s:h("Include", s:purple, "", "") +call s:h("Define", s:purple, "", "") +call s:h("Macro", s:purple, "", "") +call s:h("PreCondit", s:yellow, "", "") + +call s:h("Type", s:yellow, "", "") +call s:h("StorageClass", s:yellow, "", "") +call s:h("Structure", s:yellow, "", "") +call s:h("Typedef", s:yellow, "", "") + +call s:h("Special", s:blue, "", "") +call s:h("SpecialChar", s:fg, "", "") +call s:h("Tag", s:fg, "", "") +call s:h("Delimiter", s:fg, "", "") +call s:h("SpecialComment", s:fg, "", "") +call s:h("Debug", s:fg, "", "") +call s:h("Underlined", s:fg, "", "") +call s:h("Ignore", s:fg, "", "") +call s:h("Error", s:red, s:gutter_bg, "") +call s:h("Todo", s:purple, "", "") +" } + + +" Plugins { +" GitGutter +call s:h("GitGutterAdd", s:green, s:gutter_bg, "") +call s:h("GitGutterDelete", s:red, s:gutter_bg, "") +call s:h("GitGutterChange", s:yellow, s:gutter_bg, "") +call s:h("GitGutterChangeDelete", s:red, s:gutter_bg, "") +" Fugitive +call s:h("diffAdded", s:green, "", "") +call s:h("diffRemoved", s:red, "", "") +" } + + +" Git { +call s:h("gitcommitComment", s:comment_fg, "", "") +call s:h("gitcommitUnmerged", s:red, "", "") +call s:h("gitcommitOnBranch", s:fg, "", "") +call s:h("gitcommitBranch", s:purple, "", "") +call s:h("gitcommitDiscardedType", s:red, "", "") +call s:h("gitcommitSelectedType", s:green, "", "") +call s:h("gitcommitHeader", s:fg, "", "") +call s:h("gitcommitUntrackedFile", s:cyan, "", "") +call s:h("gitcommitDiscardedFile", s:red, "", "") +call s:h("gitcommitSelectedFile", s:green, "", "") +call s:h("gitcommitUnmergedFile", s:yellow, "", "") +call s:h("gitcommitFile", s:fg, "", "") +hi link gitcommitNoBranch gitcommitBranch +hi link gitcommitUntracked gitcommitComment +hi link gitcommitDiscarded gitcommitComment +hi link gitcommitSelected gitcommitComment +hi link gitcommitDiscardedArrow gitcommitDiscardedFile +hi link gitcommitSelectedArrow gitcommitSelectedFile +hi link gitcommitUnmergedArrow gitcommitUnmergedFile +" } + +" Fix colors in neovim terminal buffers { + if has('nvim') + let g:terminal_color_0 = s:black.gui + let g:terminal_color_1 = s:red.gui + let g:terminal_color_2 = s:green.gui + let g:terminal_color_3 = s:yellow.gui + let g:terminal_color_4 = s:blue.gui + let g:terminal_color_5 = s:purple.gui + let g:terminal_color_6 = s:cyan.gui + let g:terminal_color_7 = s:white.gui + let g:terminal_color_8 = s:black.gui + let g:terminal_color_9 = s:red.gui + let g:terminal_color_10 = s:green.gui + let g:terminal_color_11 = s:yellow.gui + let g:terminal_color_12 = s:blue.gui + let g:terminal_color_13 = s:purple.gui + let g:terminal_color_14 = s:cyan.gui + let g:terminal_color_15 = s:white.gui + let g:terminal_color_background = s:bg.gui + let g:terminal_color_foreground = s:fg.gui + endif +" } From 0753356f01ea9bd0db78f09e8d78f393307cd4d5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 11 Oct 2023 22:39:54 +0200 Subject: [PATCH 034/176] Add custom font --- nixos/flake.nix | 4 ++++ nixos/modules/default.nix | 10 ++++++---- nixos/overlays/letter/default.nix | 18 +++++++++++++++++ .../alacritty/.config/alacritty/alacritty.yml | 20 +++++++++---------- stow/kitty/.config/kitty/kitty.conf | 12 +++++------ 5 files changed, 44 insertions(+), 20 deletions(-) create mode 100644 nixos/overlays/letter/default.nix diff --git a/nixos/flake.nix b/nixos/flake.nix index 2440f38..ee2996e 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -38,6 +38,10 @@ allowUnfree = true; }; + sharedOverlays = [ + (import ./overlays/letter) + ]; + hostDefaults = { inherit system; diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 6eb2beb..e150275 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -15,6 +15,11 @@ keep-derivations = true ''; + fonts.fonts = with pkgs; [ + corefonts # Calibri for Uni + letter # Personal font + ]; + users.users.tdpeuter = { description = "Tibo De Peuter"; isNormalUser = true; @@ -50,10 +55,7 @@ stateVersion = "23.05"; packages = with pkgs; [ - gnupg - - # Fonts - corefonts # Calibri for Uni + gnupg ]; }; diff --git a/nixos/overlays/letter/default.nix b/nixos/overlays/letter/default.nix new file mode 100644 index 0000000..d494bf4 --- /dev/null +++ b/nixos/overlays/letter/default.nix @@ -0,0 +1,18 @@ +final: prev: { + letter = final.stdenv.mkDerivation { + name = "letter"; + version = "v1.0.0"; + src = final.fetchFromGitea { + domain = "git.depeuter.dev"; + owner = "tdpeuter"; + repo = "letter"; + rev = "v1.0.0"; + hash = "sha256-2HaXZMIYSauqj9Cy7rRzYGyuYLno9AHAXpWsyD+BdtE="; + }; + + installPhase = '' + mkdir -p $out/share/fonts + cp -R $src/ttf $out/share/fonts/letter + ''; + }; +} diff --git a/stow/alacritty/.config/alacritty/alacritty.yml b/stow/alacritty/.config/alacritty/alacritty.yml index 4ea1c1b..dcd08cc 100644 --- a/stow/alacritty/.config/alacritty/alacritty.yml +++ b/stow/alacritty/.config/alacritty/alacritty.yml @@ -102,41 +102,41 @@ window: #multiplier: 3 # Font configuration -# font: +font: # Normal (roman) font face - # normal: + normal: # Font family # # Default: # - (macOS) Menlo # - (Linux/BSD) monospace # - (Windows) Consolas - # family: Letter + family: Letter # The `style` can be specified to pick a specific face. - # style: Extended + style: Extended # Bold font face - # bold: + bold: # Font family # # If the bold family is not specified, it will fall back to the # value specified for the normal font. - # family: Letter + family: Letter # The `style` can be specified to pick a specific face. - # style: Heavy + style: Heavy # Italic font face - # italic: + italic: # Font family # # If the italic family is not specified, it will fall back to the # value specified for the normal font. - # family: Letter + family: Letter # The `style` can be specified to pick a specific face. - # style: Oblique + style: Oblique # Bold italic font face #bold_italic: diff --git a/stow/kitty/.config/kitty/kitty.conf b/stow/kitty/.config/kitty/kitty.conf index 9f69a3d..2504662 100644 --- a/stow/kitty/.config/kitty/kitty.conf +++ b/stow/kitty/.config/kitty/kitty.conf @@ -8,10 +8,10 @@ include ./themes/tdpeuter-dark.conf #: individual font faces and even specify special fonts for particular #: characters. -# font_family monospace -# bold_font auto -# italic_font auto -# bold_italic_font auto +font_family Letter Extended +bold_font Letter Semibold Extended +italic_font Letter Extended Oblique +bold_italic_font Letter Semibold Extended Oblique #: You can specify different fonts for the bold/italic/bold-italic #: variants. To get a full list of supported fonts use the `kitty @@ -77,7 +77,7 @@ include ./themes/tdpeuter-dark.conf #: narrow_symbols codepoints [optionally the number of cells] -# disable_ligatures never +disable_ligatures always #: Choose how you want to handle multi-character ligatures. The #: default is to always render them. You can tell kitty to not render @@ -363,7 +363,7 @@ touch_scroll_multiplier 2.0 #: much effort. url_color #94E2D5 -url_style stright +url_style straight #: The color and style for highlighting URLs on mouse-over. url_style #: can be one of: none, straight, double, curly, dotted, dashed. From 5155078c3736843bde570b9731e18322424bed53 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 12 Oct 2023 11:48:45 +0200 Subject: [PATCH 035/176] [kitty] Add padding --- nixos/modules/default.nix | 2 ++ stow/kitty/.config/kitty/kitty.conf | 4 ++-- stow/kitty/.config/kitty/themes/tdpeuter-light.conf | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index e150275..3410fdc 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -17,6 +17,8 @@ fonts.fonts = with pkgs; [ corefonts # Calibri for Uni + vistafonts + letter # Personal font ]; diff --git a/stow/kitty/.config/kitty/kitty.conf b/stow/kitty/.config/kitty/kitty.conf index 2504662..35935c5 100644 --- a/stow/kitty/.config/kitty/kitty.conf +++ b/stow/kitty/.config/kitty/kitty.conf @@ -1,6 +1,6 @@ # vim:fileencoding=utf-8:foldmethod=marker -include ./themes/tdpeuter-dark.conf +include ./themes/tdpeuter-light.conf #: Fonts {{{ @@ -786,7 +786,7 @@ visual_bell_color #b00020 #: set the vertical and horizontal sides. Three values set top, #: horizontal and bottom. Four values set top, right, bottom and left. -# window_padding_width 0 +window_padding_width 5 #: The window padding (in pts) (blank area between the text and the #: window border). A single value sets all four sides. Two values set diff --git a/stow/kitty/.config/kitty/themes/tdpeuter-light.conf b/stow/kitty/.config/kitty/themes/tdpeuter-light.conf index 23288ce..fd8c278 100644 --- a/stow/kitty/.config/kitty/themes/tdpeuter-light.conf +++ b/stow/kitty/.config/kitty/themes/tdpeuter-light.conf @@ -1,4 +1,4 @@ -foreground #383A42 +foreground #000000 background #FAFAFA selection_foreground #383A42 selection_background #BFCEFF From 992df6871177d9b4ffec64191ac88f48696b1fad Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Thu, 12 Oct 2023 17:26:29 +0200 Subject: [PATCH 036/176] [spotify] Add TryExec --- nixos/modules/apps/spotify/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/apps/spotify/default.nix b/nixos/modules/apps/spotify/default.nix index 54e701b..7d23b46 100644 --- a/nixos/modules/apps/spotify/default.nix +++ b/nixos/modules/apps/spotify/default.nix @@ -17,6 +17,7 @@ mimeType = [ "x-scheme-handler/spotify" ]; categories = [ "Audio" "Music" "Player" "AudioVideo" ]; settings = { + TryExec = "spotify"; StartupWMClass = "spotify"; }; }; From 2456478f30a68b27a17bcea1184b4f7eac801dd8 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 13 Oct 2023 10:22:38 +0200 Subject: [PATCH 037/176] [ssh] Set default git users --- nixos/flake.lock | 12 ++++++------ nixos/modules/utils/ssh/default.nix | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index 814881d..a4a7089 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1696697597, - "narHash": "sha256-q26Qv4DQ+h6IeozF2o1secyQG0jt2VUT3V0K58jr3pg=", + "lastModified": 1696983906, + "narHash": "sha256-L7GyeErguS7Pg4h8nK0wGlcUTbfUMDu+HMf1UcyP72k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5a237aecb57296f67276ac9ab296a41c23981f56", + "rev": "bd1cde45c77891214131cbbea5b1203e485a9d51", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1696890802, - "narHash": "sha256-q0cbDNjTnZ1ojoPdy4liEHWXokhQSNULnSKgURp4v2g=", + "lastModified": 1697064251, + "narHash": "sha256-xxp2sB+4vqB6S6zC/L5J8LlRKgVbgIZOcYl9/TDrEzI=", "owner": "Mic92", "repo": "sops-nix", - "rev": "6b32358c22d2718a5407d39a8236c7bd9608f447", + "rev": "f995ea159252a53b25fa99824f2891e3b479d511", "type": "github" }, "original": { diff --git a/nixos/modules/utils/ssh/default.nix b/nixos/modules/utils/ssh/default.nix index 445fbc8..bc0f463 100644 --- a/nixos/modules/utils/ssh/default.nix +++ b/nixos/modules/utils/ssh/default.nix @@ -28,24 +28,25 @@ hostname = "git.depeuter.dev"; identitiesOnly = true; identityFile = "/run/secrets/Hugo/Gitea/ssh"; - user = "tdpeuter"; + user = "git"; }; "github.com" = { hostname = "github.com"; identitiesOnly = true; identityFile = "/run/secrets/GitHub/ssh"; - user = "tdpeuter"; + user = "git"; }; "github.ugent.be" = { hostname = "github.ugent.be"; identitiesOnly = true; identityFile = "/run/secrets/UGent/GitHub/ssh"; - user = "tdpeuter"; + user = "git"; }; "subgit.ugent.be" = { hostname = "subgit.ugent.be"; identitiesOnly = true; identityFile = "/run/secrets/UGent/SubGit/ssh"; + user = "git"; }; }; }; From 091a8ab89a74cacd5c798aa9c8d2fd9127c27b70 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 13 Oct 2023 11:15:16 +0200 Subject: [PATCH 038/176] [zsh] Fix prompt not visible on both themes --- stow/zsh/.oh-my-zsh/themes/mrfortem.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stow/zsh/.oh-my-zsh/themes/mrfortem.zsh-theme b/stow/zsh/.oh-my-zsh/themes/mrfortem.zsh-theme index 53ba179..3515550 100644 --- a/stow/zsh/.oh-my-zsh/themes/mrfortem.zsh-theme +++ b/stow/zsh/.oh-my-zsh/themes/mrfortem.zsh-theme @@ -10,7 +10,7 @@ zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes zstyle ':vcs_info:*' actionformats '%F{5}(%F{2}%b%F{3}|%F{1}%a%c%u%m%F{5})%f ' -zstyle ':vcs_info:*' formats "%F{white}(%F{cyan} %b%c%u%m%F{white})%f " +zstyle ':vcs_info:*' formats "%f(%F{cyan} %b%c%u%m%f)%f " zstyle ':vcs_info:svn:*' branchformat '%b' zstyle ':vcs_info:svn:*' actionformats '%F{5}(%F{2}%b%F{1}:%{3}%i%F{3}|%F{1}%a%c%u%m%F{5})%f ' zstyle ':vcs_info:svn:*' formats '%F{5}(%F{2}%b%F{1}:%F{3}%i%c%u%m%F{5})%f ' From 9df715f74e4269f4ac167547bcf272337c491b51 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 14 Oct 2023 17:35:52 +0200 Subject: [PATCH 039/176] Stay on light-mode while I figure out how to switch --- nixos/flake.lock | 6 +++--- nixos/modules/utils/vim/default.nix | 2 +- stow/kitty/.config/kitty/kitty.conf | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index a4a7089..26e30cb 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -93,11 +93,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1696879762, - "narHash": "sha256-Ud6bH4DMcYHUDKavNMxAhcIpDGgHMyL/yaDEAVSImQY=", + "lastModified": 1697059129, + "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f99e5f03cc0aa231ab5950a15ed02afec45ed51a", + "rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593", "type": "github" }, "original": { diff --git a/nixos/modules/utils/vim/default.nix b/nixos/modules/utils/vim/default.nix index 7da1b1a..0a9cbb6 100644 --- a/nixos/modules/utils/vim/default.nix +++ b/nixos/modules/utils/vim/default.nix @@ -9,7 +9,7 @@ programs.vim = { enable = true; extraConfig = '' - colorscheme tdpeuter-dark + colorscheme tdpeuter-light " Tags " pacman -S ctags diff --git a/stow/kitty/.config/kitty/kitty.conf b/stow/kitty/.config/kitty/kitty.conf index 35935c5..182e72b 100644 --- a/stow/kitty/.config/kitty/kitty.conf +++ b/stow/kitty/.config/kitty/kitty.conf @@ -764,7 +764,7 @@ visual_bell_color #b00020 #: to be pts. Note that borders are displayed only when more than one #: window is visible. They are meant to separate multiple windows. -# draw_minimal_borders yes +draw_minimal_borders yes #: Draw only the minimum borders needed. This means that only the #: borders that separate the window from a neighbor are drawn. Note @@ -821,7 +821,7 @@ window_padding_width 5 #: Fade the text in inactive windows by the specified amount (a number #: between zero and one, with zero being fully faded). -hide_window_decorations yes +# hide_window_decorations no #: Hide the window decorations (title-bar and window borders) with #: yes. On macOS, titlebar-only can be used to only hide the titlebar. From ef69f9943aa45c5643f1e91166a4d4a53d3b21a5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 14 Oct 2023 17:38:08 +0200 Subject: [PATCH 040/176] Add icon theme --- nixos/flake.nix | 1 + nixos/modules/default.nix | 2 ++ nixos/overlays/icosystem/default.nix | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 nixos/overlays/icosystem/default.nix diff --git a/nixos/flake.nix b/nixos/flake.nix index ee2996e..0bdd89a 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -40,6 +40,7 @@ sharedOverlays = [ (import ./overlays/letter) + (import ./overlays/icosystem) ]; hostDefaults = { diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 3410fdc..570872c 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -58,6 +58,8 @@ packages = with pkgs; [ gnupg + + icosystem ]; }; diff --git a/nixos/overlays/icosystem/default.nix b/nixos/overlays/icosystem/default.nix new file mode 100644 index 0000000..0249251 --- /dev/null +++ b/nixos/overlays/icosystem/default.nix @@ -0,0 +1,18 @@ +final: prev: { + icosystem = final.stdenv.mkDerivation { + name = "icosystem"; + version = "v1.0.0"; + src = final.fetchFromGitea { + domain = "git.depeuter.dev"; + owner = "tdpeuter"; + repo = "icosystem"; + rev = "ca565dc36d"; + hash = "sha256-GJu0APTkrsFH981Y1RBedOnvVJ5Z79w2WPcLkrc8CH0="; + }; + + installPhase = '' + mkdir -p $out/share/icons + cp -R $src $out/share/icons/icosystem + ''; + }; +} From 82a2d7bbea9d611349ecea99b7a0a55da8c8621a Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 14 Oct 2023 17:38:24 +0200 Subject: [PATCH 041/176] Add GitHub search engine --- nixos/modules/apps/firefox/default.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nixos/modules/apps/firefox/default.nix b/nixos/modules/apps/firefox/default.nix index eb0ca04..56e0eb2 100644 --- a/nixos/modules/apps/firefox/default.nix +++ b/nixos/modules/apps/firefox/default.nix @@ -6,7 +6,7 @@ package = pkgs.firefox.override { cfg = { enableTridactylNative = true; - speechSynthesisSupport = true; + speechSynthesisSupport = true; # Allow Text-to-speech in e.g. Discord }; extraPolicies = { DisableFirefoxStudies = true; @@ -36,6 +36,18 @@ icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@np" ]; }; + "GitHub" = { + urls = [{ + template = "https://github.com/search"; + params = [ + { name = "q"; value = "{searchTerms}"; } + { name = "type"; value = "repositories"; } + ]; + }]; + + icon = "${pkgs.icosystem}/share/icons/icosystem/scalable/apps/github-mark.svg"; + definedAliases = [ "@gh" ]; + }; }; }; }; From 97db5d05d375260020f91e326cc3f54ac9771e1e Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 17 Oct 2023 12:15:41 +0200 Subject: [PATCH 042/176] Rename fake modules to modules-old --- nixos/flake.lock | 18 +++++++++--------- nixos/flake.nix | 2 +- nixos/hosts/Tibo-NixFat/default.nix | 6 +++--- .../apps/alacritty/default.nix | 0 .../{modules => modules-old}/apps/default.nix | 0 .../apps/firefox/default.nix | 0 .../apps/kitty/default.nix | 0 .../apps/steam/default.nix | 0 .../apps/thunderbird/default.nix | 0 .../apps/virtualbox/default.nix | 0 nixos/{modules => modules-old}/default.nix | 0 .../des/gnome/default.nix | 0 .../des/plasma/default.nix | 0 .../des/sway/default.nix | 0 .../hardware/corsair/default.nix | 0 .../hardware/nvidia.nix | 0 .../shells/default.nix | 0 .../shells/zsh/default.nix | 0 .../{modules => modules-old}/utils/default.nix | 0 .../utils/git/default.nix | 0 .../utils/mpv/default.nix | 0 .../utils/sops/default.nix | 0 .../utils/ssh/README.md | 0 .../utils/ssh/default.nix | 0 .../utils/tea/default.nix | 0 .../utils/vifm/default.nix | 0 .../utils/vim/default.nix | 0 .../utils/zellij/default.nix | 0 28 files changed, 13 insertions(+), 13 deletions(-) rename nixos/{modules => modules-old}/apps/alacritty/default.nix (100%) rename nixos/{modules => modules-old}/apps/default.nix (100%) rename nixos/{modules => modules-old}/apps/firefox/default.nix (100%) rename nixos/{modules => modules-old}/apps/kitty/default.nix (100%) rename nixos/{modules => modules-old}/apps/steam/default.nix (100%) rename nixos/{modules => modules-old}/apps/thunderbird/default.nix (100%) rename nixos/{modules => modules-old}/apps/virtualbox/default.nix (100%) rename nixos/{modules => modules-old}/default.nix (100%) rename nixos/{modules => modules-old}/des/gnome/default.nix (100%) rename nixos/{modules => modules-old}/des/plasma/default.nix (100%) rename nixos/{modules => modules-old}/des/sway/default.nix (100%) rename nixos/{modules => modules-old}/hardware/corsair/default.nix (100%) rename nixos/{modules => modules-old}/hardware/nvidia.nix (100%) rename nixos/{modules => modules-old}/shells/default.nix (100%) rename nixos/{modules => modules-old}/shells/zsh/default.nix (100%) rename nixos/{modules => modules-old}/utils/default.nix (100%) rename nixos/{modules => modules-old}/utils/git/default.nix (100%) rename nixos/{modules => modules-old}/utils/mpv/default.nix (100%) rename nixos/{modules => modules-old}/utils/sops/default.nix (100%) rename nixos/{modules => modules-old}/utils/ssh/README.md (100%) rename nixos/{modules => modules-old}/utils/ssh/default.nix (100%) rename nixos/{modules => modules-old}/utils/tea/default.nix (100%) rename nixos/{modules => modules-old}/utils/vifm/default.nix (100%) rename nixos/{modules => modules-old}/utils/vim/default.nix (100%) rename nixos/{modules => modules-old}/utils/zellij/default.nix (100%) diff --git a/nixos/flake.lock b/nixos/flake.lock index 26e30cb..d488555 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1696983906, - "narHash": "sha256-L7GyeErguS7Pg4h8nK0wGlcUTbfUMDu+HMf1UcyP72k=", + "lastModified": 1697226376, + "narHash": "sha256-cumLLb1QOUtWieUnLGqo+ylNt3+fU8Lcv5Zl+tYbRUE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bd1cde45c77891214131cbbea5b1203e485a9d51", + "rev": "898cb2064b6e98b8c5499f37e81adbdf2925f7c5", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1696717752, - "narHash": "sha256-qEq1styCyQHSrw7AOhskH2qwCFx93bOwsGEzUIrZC0g=", + "lastModified": 1697332183, + "narHash": "sha256-ACYvYsgLETfEI2xM1jjp8ZLVNGGC0onoCGe+69VJGGE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2f3b6b3fcd9fa0a4e6b544180c058a70890a7cc1", + "rev": "0e1cff585c1a85aeab059d3109f66134a8f76935", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1697064251, - "narHash": "sha256-xxp2sB+4vqB6S6zC/L5J8LlRKgVbgIZOcYl9/TDrEzI=", + "lastModified": 1697339241, + "narHash": "sha256-ITsFtEtRbCBeEH9XrES1dxZBkE1fyNNUfIyQjQ2AYQs=", "owner": "Mic92", "repo": "sops-nix", - "rev": "f995ea159252a53b25fa99824f2891e3b479d511", + "rev": "51186b8012068c417dac7c31fb12861726577898", "type": "github" }, "original": { diff --git a/nixos/flake.nix b/nixos/flake.nix index 0bdd89a..988ba1f 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -55,7 +55,7 @@ modules = [ home-manager.nixosModule sops-nix.nixosModules.sops - ./modules + ./modules-old ]; }; diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index bd21cac..46f8125 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -3,10 +3,10 @@ { imports = [ ./hardware-configuration.nix - ../../modules/hardware/nvidia.nix + ../../modules-old/hardware/nvidia.nix - ../../modules/apps/virtualbox - ../../modules/des/gnome + ../../modules-old/apps/virtualbox + ../../modules-old/des/gnome ]; boot = { diff --git a/nixos/modules/apps/alacritty/default.nix b/nixos/modules-old/apps/alacritty/default.nix similarity index 100% rename from nixos/modules/apps/alacritty/default.nix rename to nixos/modules-old/apps/alacritty/default.nix diff --git a/nixos/modules/apps/default.nix b/nixos/modules-old/apps/default.nix similarity index 100% rename from nixos/modules/apps/default.nix rename to nixos/modules-old/apps/default.nix diff --git a/nixos/modules/apps/firefox/default.nix b/nixos/modules-old/apps/firefox/default.nix similarity index 100% rename from nixos/modules/apps/firefox/default.nix rename to nixos/modules-old/apps/firefox/default.nix diff --git a/nixos/modules/apps/kitty/default.nix b/nixos/modules-old/apps/kitty/default.nix similarity index 100% rename from nixos/modules/apps/kitty/default.nix rename to nixos/modules-old/apps/kitty/default.nix diff --git a/nixos/modules/apps/steam/default.nix b/nixos/modules-old/apps/steam/default.nix similarity index 100% rename from nixos/modules/apps/steam/default.nix rename to nixos/modules-old/apps/steam/default.nix diff --git a/nixos/modules/apps/thunderbird/default.nix b/nixos/modules-old/apps/thunderbird/default.nix similarity index 100% rename from nixos/modules/apps/thunderbird/default.nix rename to nixos/modules-old/apps/thunderbird/default.nix diff --git a/nixos/modules/apps/virtualbox/default.nix b/nixos/modules-old/apps/virtualbox/default.nix similarity index 100% rename from nixos/modules/apps/virtualbox/default.nix rename to nixos/modules-old/apps/virtualbox/default.nix diff --git a/nixos/modules/default.nix b/nixos/modules-old/default.nix similarity index 100% rename from nixos/modules/default.nix rename to nixos/modules-old/default.nix diff --git a/nixos/modules/des/gnome/default.nix b/nixos/modules-old/des/gnome/default.nix similarity index 100% rename from nixos/modules/des/gnome/default.nix rename to nixos/modules-old/des/gnome/default.nix diff --git a/nixos/modules/des/plasma/default.nix b/nixos/modules-old/des/plasma/default.nix similarity index 100% rename from nixos/modules/des/plasma/default.nix rename to nixos/modules-old/des/plasma/default.nix diff --git a/nixos/modules/des/sway/default.nix b/nixos/modules-old/des/sway/default.nix similarity index 100% rename from nixos/modules/des/sway/default.nix rename to nixos/modules-old/des/sway/default.nix diff --git a/nixos/modules/hardware/corsair/default.nix b/nixos/modules-old/hardware/corsair/default.nix similarity index 100% rename from nixos/modules/hardware/corsair/default.nix rename to nixos/modules-old/hardware/corsair/default.nix diff --git a/nixos/modules/hardware/nvidia.nix b/nixos/modules-old/hardware/nvidia.nix similarity index 100% rename from nixos/modules/hardware/nvidia.nix rename to nixos/modules-old/hardware/nvidia.nix diff --git a/nixos/modules/shells/default.nix b/nixos/modules-old/shells/default.nix similarity index 100% rename from nixos/modules/shells/default.nix rename to nixos/modules-old/shells/default.nix diff --git a/nixos/modules/shells/zsh/default.nix b/nixos/modules-old/shells/zsh/default.nix similarity index 100% rename from nixos/modules/shells/zsh/default.nix rename to nixos/modules-old/shells/zsh/default.nix diff --git a/nixos/modules/utils/default.nix b/nixos/modules-old/utils/default.nix similarity index 100% rename from nixos/modules/utils/default.nix rename to nixos/modules-old/utils/default.nix diff --git a/nixos/modules/utils/git/default.nix b/nixos/modules-old/utils/git/default.nix similarity index 100% rename from nixos/modules/utils/git/default.nix rename to nixos/modules-old/utils/git/default.nix diff --git a/nixos/modules/utils/mpv/default.nix b/nixos/modules-old/utils/mpv/default.nix similarity index 100% rename from nixos/modules/utils/mpv/default.nix rename to nixos/modules-old/utils/mpv/default.nix diff --git a/nixos/modules/utils/sops/default.nix b/nixos/modules-old/utils/sops/default.nix similarity index 100% rename from nixos/modules/utils/sops/default.nix rename to nixos/modules-old/utils/sops/default.nix diff --git a/nixos/modules/utils/ssh/README.md b/nixos/modules-old/utils/ssh/README.md similarity index 100% rename from nixos/modules/utils/ssh/README.md rename to nixos/modules-old/utils/ssh/README.md diff --git a/nixos/modules/utils/ssh/default.nix b/nixos/modules-old/utils/ssh/default.nix similarity index 100% rename from nixos/modules/utils/ssh/default.nix rename to nixos/modules-old/utils/ssh/default.nix diff --git a/nixos/modules/utils/tea/default.nix b/nixos/modules-old/utils/tea/default.nix similarity index 100% rename from nixos/modules/utils/tea/default.nix rename to nixos/modules-old/utils/tea/default.nix diff --git a/nixos/modules/utils/vifm/default.nix b/nixos/modules-old/utils/vifm/default.nix similarity index 100% rename from nixos/modules/utils/vifm/default.nix rename to nixos/modules-old/utils/vifm/default.nix diff --git a/nixos/modules/utils/vim/default.nix b/nixos/modules-old/utils/vim/default.nix similarity index 100% rename from nixos/modules/utils/vim/default.nix rename to nixos/modules-old/utils/vim/default.nix diff --git a/nixos/modules/utils/zellij/default.nix b/nixos/modules-old/utils/zellij/default.nix similarity index 100% rename from nixos/modules/utils/zellij/default.nix rename to nixos/modules-old/utils/zellij/default.nix From afa0baf28c4f3385d772146069d6d1e9cea66712 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 17 Oct 2023 23:09:40 +0200 Subject: [PATCH 043/176] Add user module --- nixos/flake.nix | 4 +- nixos/modules/users/default.nix | 5 ++ nixos/modules/users/tdpeuter/default.nix | 80 ++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 nixos/modules/users/default.nix create mode 100644 nixos/modules/users/tdpeuter/default.nix diff --git a/nixos/flake.nix b/nixos/flake.nix index 988ba1f..59776e4 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -55,7 +55,9 @@ modules = [ home-manager.nixosModule sops-nix.nixosModules.sops - ./modules-old + ./modules + + ./modules-old # Wordt stilaan weggewerkt ]; }; diff --git a/nixos/modules/users/default.nix b/nixos/modules/users/default.nix new file mode 100644 index 0000000..a48b2c4 --- /dev/null +++ b/nixos/modules/users/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./tdpeuter + ]; +} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix new file mode 100644 index 0000000..503f9ba --- /dev/null +++ b/nixos/modules/users/tdpeuter/default.nix @@ -0,0 +1,80 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.users.tdpeuter; + + installedPkgs = config.home-manager.users.tdpeuter.home.packages; +in { + options.sisyphus.users.tdpeuter.enable = lib.mkEnableOption "user Tibo De Peuter"; + + config = lib.mkIf cfg.enable { + users.users.tdpeuter = { + description = "Tibo De Peuter"; + isNormalUser = true; + extraGroups = [ + config.users.groups.keys.name + config.users.groups.networkmanager.name + config.users.groups.wheel.name + ]; + initialPassword = "ChangeMe"; + }; + + home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable { + programs.home-manager.enable = true; + + home = { + username = "tdpeuter"; + homeDirectory = "/home/tdpeuter"; + stateVersion = config.system.stateVersion; + + # If you specify an application here, it will be detected by the configuration module + # and the configuration files will be put in place for you. + packages = with pkgs; [ + brave + duf + jellyfin-media-player + libreoffice-fresh + nextcloud-client + nsxiv + obsidian + qalculate-gtk + spotify + unzip + zathura + zenith-nvidia + ]; + + file = { + ".config/alacritty" = lib.mkIf (builtins.elem pkgs.alacritty installedPkgs) { + source = ../../../../stow/alacritty/.config/alacritty; + }; + }; + }; + + xdg.mimeApps = { + enable = true; + + defaultApplications = let + browser = "firefox.desktop"; + image-viewer = "nsxiv.desktop"; + pdf-viewer = "org.pwmt.zathura-pdf-mupdf.desktop"; + in { + "application/pdf" = pdf-viewer; + "application/x-extension-htm" = browser; + "application/x-extension-html" = browser; + "application/x-extension-shtml" = browser; + "application/x-extension-xht" = browser; + "application/x-extension-xhtml" = browser; + "application/xhtml+xml" = browser; + "image/jpeg" = image-viewer; + "image/png" = image-viewer; + "image/webp" = image-viewer; + "text/html" = browser; + "x-scheme-handler/chrome" = browser; + "x-scheme-handler/http" = browser; + "x-scheme-handler/https" = browser; + }; + }; + }; + }; +} From 019f1e9b62e88256e35fbc1dfb19c12229c6cc38 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 17 Oct 2023 23:14:25 +0200 Subject: [PATCH 044/176] Add home-manager module --- nixos/hosts/Tibo-NixFat/default.nix | 45 +++++++----- nixos/modules-old/default.nix | 69 ------------------- nixos/modules-old/utils/default.nix | 19 ----- nixos/modules/default.nix | 8 +++ nixos/modules/programs/default.nix | 5 ++ .../modules/programs/home-manager/default.nix | 15 ++++ 6 files changed, 55 insertions(+), 106 deletions(-) create mode 100644 nixos/modules/default.nix create mode 100644 nixos/modules/programs/default.nix create mode 100644 nixos/modules/programs/home-manager/default.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 46f8125..9337f45 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -8,17 +8,17 @@ ../../modules-old/apps/virtualbox ../../modules-old/des/gnome ]; - - boot = { - # Use the systemd-boot EFI boot loader.] - loader = { - systemd-boot.enable = true; - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot/efi"; - }; - }; + sisyphus = { + users.tdpeuter.enable = true; + + programs = { + home-manager.enable = true; + }; + }; + + boot = { + # Encryption initrd = { # Setup keyfile secrets."/crypto_keyfile.bin" = null; @@ -29,8 +29,25 @@ keyFile = "/crypto_keyfile.bin"; }; }; + + # Use the systemd-boot EFI boot loader.] + loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; + }; + }; }; + environment.systemPackages = with pkgs; [ + wget + ]; + + system.stateVersion = "23.05"; + + # --- Barrier --- + networking = { hostName = "Tibo-NixFat"; networkmanager.enable = true; @@ -78,12 +95,4 @@ # Allow unfree packages nixpkgs.config.allowUnfree = true; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = true; - - system.stateVersion = "23.05"; } - diff --git a/nixos/modules-old/default.nix b/nixos/modules-old/default.nix index 570872c..6f44b7a 100644 --- a/nixos/modules-old/default.nix +++ b/nixos/modules-old/default.nix @@ -22,20 +22,6 @@ letter # Personal font ]; - users.users.tdpeuter = { - description = "Tibo De Peuter"; - isNormalUser = true; - extraGroups = [ - config.users.groups.keys.name - config.users.groups.networkmanager.name - config.users.groups.wheel.name - ]; - initialPassword = "ChangeMe"; - packages = with pkgs; [ - home-manager - ]; - }; - # Select internationalisation properties. i18n.defaultLocale = "en_GB.UTF-8"; console = { @@ -47,59 +33,4 @@ layout = "us"; xkbVariant = "altgr-intl"; }; - - home-manager.useGlobalPkgs = true; - - home-manager.users.tdpeuter = { pkgs, ... }: { - home = { - username = "tdpeuter"; - homeDirectory = "/home/tdpeuter"; - stateVersion = "23.05"; - - packages = with pkgs; [ - gnupg - - icosystem - ]; - }; - - programs = { - home-manager.enable = true; - gpg.enable = true; - }; - - services = { - gpg-agent = { - enable = true; - pinentryFlavor = "qt"; - }; - - }; - - xdg.mimeApps = - let - browser = "firefox.desktop"; - image-viewer = "nsxiv.desktop"; - in { - enable = true; - - defaultApplications = { - "application/pdf" = "org.pwmt.zathura-pdf-mupdf.desktop"; - "application/x-extension-htm" = browser; - "application/x-extension-html" = browser; - "application/x-extension-shtml" = browser; - "application/x-extension-xht" = browser; - "application/x-extension-xhtml" = browser; - "application/xhtml+xml" = browser; - "image/jpeg" = image-viewer; - "image/png" = image-viewer; - "image/webp" = image-viewer; - "text/html" = browser; - "x-scheme-handler/chrome" = browser; - "x-scheme-handler/http" = browser; - "x-scheme-handler/https" = browser; - }; - }; - }; - } diff --git a/nixos/modules-old/utils/default.nix b/nixos/modules-old/utils/default.nix index aeab42c..4b4a5df 100644 --- a/nixos/modules-old/utils/default.nix +++ b/nixos/modules-old/utils/default.nix @@ -9,23 +9,4 @@ ./vim ./zellij ]; - - home-manager.users.tdpeuter = { pkgs, ... }: { - home.packages = with pkgs; [ - direnv - duf - lynx - nsxiv - w3m - wget - zenith-nvidia - ]; - - programs = { - direnv = { - enable = true; - nix-direnv.enable = true; - }; - }; - }; } diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix new file mode 100644 index 0000000..d89efe6 --- /dev/null +++ b/nixos/modules/default.nix @@ -0,0 +1,8 @@ +{ lib, ... }: + +{ + imports = [ + ./programs + ./users + ]; +} diff --git a/nixos/modules/programs/default.nix b/nixos/modules/programs/default.nix new file mode 100644 index 0000000..73b1132 --- /dev/null +++ b/nixos/modules/programs/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./home-manager + ]; +} diff --git a/nixos/modules/programs/home-manager/default.nix b/nixos/modules/programs/home-manager/default.nix new file mode 100644 index 0000000..65e3bf6 --- /dev/null +++ b/nixos/modules/programs/home-manager/default.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.programs.home-manager; +in { + options.sisyphus.programs.home-manager.enable = lib.mkEnableOption "Home-manager"; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + home-manager + ]; + + home-manager.useGlobalPkgs = true; + }; +} From a9688167ec2cc9224b0f16626a060d8f8f2c8f93 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 17 Oct 2023 23:14:45 +0200 Subject: [PATCH 045/176] Remove alacritty fake --- nixos/modules-old/apps/alacritty/default.nix | 15 --------------- nixos/modules-old/apps/default.nix | 19 ------------------- 2 files changed, 34 deletions(-) delete mode 100644 nixos/modules-old/apps/alacritty/default.nix diff --git a/nixos/modules-old/apps/alacritty/default.nix b/nixos/modules-old/apps/alacritty/default.nix deleted file mode 100644 index dad5f42..0000000 --- a/nixos/modules-old/apps/alacritty/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ inputs, lib, config, pkgs, ... }: - -{ - home-manager.users.tdpeuter = { pkgs, ... }: { - home = { - packages = with pkgs; [ - alacritty - ]; - - file = { - ".config/alacritty".source = ../../../../stow/alacritty/.config/alacritty; - }; - }; - }; -} diff --git a/nixos/modules-old/apps/default.nix b/nixos/modules-old/apps/default.nix index c5ad367..4ad4b18 100644 --- a/nixos/modules-old/apps/default.nix +++ b/nixos/modules-old/apps/default.nix @@ -1,28 +1,9 @@ { imports = [ - ./alacritty ./firefox ./kitty ./steam ./thunderbird # ./virtualbox ]; - - home-manager.users.tdpeuter = { pkgs, ... }: { - home.packages = with pkgs; [ - brave - caprine-bin - discord - jellyfin-media-player - libreoffice-fresh - mattermost-desktop - nextcloud-client - obsidian - pinentry_qt - qalculate-gtk - spotify - zathura - zoom-us - ]; - }; } From b6044e99dcab3d8d3e2f37ffb3ef1a68c7f861c6 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 17 Oct 2023 23:15:14 +0200 Subject: [PATCH 046/176] Update documentation --- nixos/README.md | 10 ++++++++++ nixos/flake.lock | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/nixos/README.md b/nixos/README.md index 615cc7a..0f69ea6 100644 --- a/nixos/README.md +++ b/nixos/README.md @@ -1,3 +1,13 @@ # nixos Nix Flake for my Linux machines running NixOS. + +The directory structure can be interpreted as follows: + +- [`flake.nix`](./flake.nix): Main entrypoint for the configuration +- [hosts/*hostname*](./hosts): Host-specific configuration by setting options +- [modules](./modules): Declarations of options +- [modules/users/*username*](./modules/users): Since users are dependent on a host machine to exist, they are defined as a module as well +- [overlays](./overlays): Attribute overrides of Nix Packages +- [secrets](./secrets): Encrypted files that hold secrets, for example SSH private keys + diff --git a/nixos/flake.lock b/nixos/flake.lock index d488555..0bc894e 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -93,11 +93,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1697059129, - "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=", + "lastModified": 1697456312, + "narHash": "sha256-roiSnrqb5r+ehnKCauPLugoU8S36KgmWraHgRqVYndo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593", + "rev": "ca012a02bf8327be9e488546faecae5e05d7d749", "type": "github" }, "original": { From c46a7ce9c3b8e0acdb3bebf1ea0f92ba1bfdf477 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 16:47:13 +0200 Subject: [PATCH 047/176] [virtualbox] Move into proper module --- nixos/hosts/Tibo-NixFat/default.nix | 1 - nixos/modules-old/apps/default.nix | 1 - nixos/modules-old/apps/virtualbox/default.nix | 17 -------------- nixos/modules/default.nix | 1 + nixos/modules/users/tdpeuter/default.nix | 1 - nixos/modules/virtualisation/default.nix | 5 ++++ .../virtualisation/virtualbox/default.nix | 23 +++++++++++++++++++ 7 files changed, 29 insertions(+), 20 deletions(-) delete mode 100644 nixos/modules-old/apps/virtualbox/default.nix create mode 100644 nixos/modules/virtualisation/default.nix create mode 100644 nixos/modules/virtualisation/virtualbox/default.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 9337f45..667b8ff 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -5,7 +5,6 @@ ./hardware-configuration.nix ../../modules-old/hardware/nvidia.nix - ../../modules-old/apps/virtualbox ../../modules-old/des/gnome ]; diff --git a/nixos/modules-old/apps/default.nix b/nixos/modules-old/apps/default.nix index 4ad4b18..cd1aa58 100644 --- a/nixos/modules-old/apps/default.nix +++ b/nixos/modules-old/apps/default.nix @@ -4,6 +4,5 @@ ./kitty ./steam ./thunderbird - # ./virtualbox ]; } diff --git a/nixos/modules-old/apps/virtualbox/default.nix b/nixos/modules-old/apps/virtualbox/default.nix deleted file mode 100644 index 8766028..0000000 --- a/nixos/modules-old/apps/virtualbox/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - - virtualisation.virtualbox = { - host = { - enable = true; - enableExtensionPack = true; - }; - guest = { - enable = true; - x11 = true; - }; - }; - users.extraGroups.vboxusers.members = [ - "user-with-access-to-virtualbox" - ]; - -} diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index d89efe6..18a9fb3 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -4,5 +4,6 @@ imports = [ ./programs ./users + ./virtualisation ]; } diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 503f9ba..2a94de0 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -30,7 +30,6 @@ in { # If you specify an application here, it will be detected by the configuration module # and the configuration files will be put in place for you. packages = with pkgs; [ - brave duf jellyfin-media-player libreoffice-fresh diff --git a/nixos/modules/virtualisation/default.nix b/nixos/modules/virtualisation/default.nix new file mode 100644 index 0000000..01f37b3 --- /dev/null +++ b/nixos/modules/virtualisation/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./virtualbox + ]; +} diff --git a/nixos/modules/virtualisation/virtualbox/default.nix b/nixos/modules/virtualisation/virtualbox/default.nix new file mode 100644 index 0000000..f4a31b6 --- /dev/null +++ b/nixos/modules/virtualisation/virtualbox/default.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.virtualisation.virtualbox; +in { + options.sisyphus.virtualisation.virtualbox.enable = lib.mkEnableOption "VirtualBox"; + + config = lib.mkIf cfg.enable { + virtualisation.virtualbox = { + host = { + enable = true; + enableExtensionPack = true; + }; + guest = { + enable = true; + x11 = true; + }; + }; + users.extraGroups.vboxusers.members = [ + "user-with-access-to-virtualbox" + ]; + }; +} From 502f0f8bb026b416eca2881d738ba5b2a5a0c2b0 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 17:02:32 +0200 Subject: [PATCH 048/176] [mpv] Merge module into user --- nixos/hosts/Tibo-NixFat/default.nix | 1 + nixos/modules-old/utils/default.nix | 1 - nixos/modules-old/utils/mpv/default.nix | 11 ----------- nixos/modules/users/tdpeuter/default.nix | 16 ++++++++++++---- 4 files changed, 13 insertions(+), 16 deletions(-) delete mode 100644 nixos/modules-old/utils/mpv/default.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 667b8ff..25e0714 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -40,6 +40,7 @@ }; environment.systemPackages = with pkgs; [ + zenith-nvidia wget ]; diff --git a/nixos/modules-old/utils/default.nix b/nixos/modules-old/utils/default.nix index 4b4a5df..e80aac8 100644 --- a/nixos/modules-old/utils/default.nix +++ b/nixos/modules-old/utils/default.nix @@ -1,7 +1,6 @@ { imports = [ ./git - ./mpv ./sops ./ssh ./tea diff --git a/nixos/modules-old/utils/mpv/default.nix b/nixos/modules-old/utils/mpv/default.nix deleted file mode 100644 index 098e7d5..0000000 --- a/nixos/modules-old/utils/mpv/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, system, lib, pkgs-unstable, ... }: - -{ - home-manager.users.tdpeuter.home = { - packages = with pkgs-unstable; [ - mpv - ]; - - file.".config/mpv".source = ../../../../stow/mpv/.config/mpv; - }; -} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 2a94de0..e0cd766 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, pkgs-unstable, ... }: let cfg = config.sisyphus.users.tdpeuter; @@ -29,7 +29,7 @@ in { # If you specify an application here, it will be detected by the configuration module # and the configuration files will be put in place for you. - packages = with pkgs; [ + packages = (with pkgs; [ duf jellyfin-media-player libreoffice-fresh @@ -40,13 +40,21 @@ in { spotify unzip zathura - zenith-nvidia - ]; + ]) ++ (with pkgs-unstable; [ + mpv + ]); + # Put dotfiles in place. file = { ".config/alacritty" = lib.mkIf (builtins.elem pkgs.alacritty installedPkgs) { source = ../../../../stow/alacritty/.config/alacritty; }; + ".config/mpv" = lib.mkIf (builtins.elem pkgs-unstable.mpv installedPkgs) { + source = ../../../../stow/mpv/.config/mpv; + }; + ".config/zellij" = lib.mkIf (builtins.elem pkgs.zellij installedPkgs) { + source = ../../../../stow/zellij/.config/zellij; + }; }; }; From 189b8278b7593e91de13a003e269d7009f199360 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 17:03:24 +0200 Subject: [PATCH 049/176] [zellij] Move to proper module --- nixos/hosts/Tibo-NixFat/default.nix | 1 + nixos/modules-old/utils/default.nix | 1 - nixos/modules-old/utils/zellij/default.nix | 16 ---------------- nixos/modules/programs/default.nix | 1 + nixos/modules/programs/zellij/default.nix | 18 ++++++++++++++++++ nixos/modules/users/tdpeuter/default.nix | 2 +- 6 files changed, 21 insertions(+), 18 deletions(-) delete mode 100644 nixos/modules-old/utils/zellij/default.nix create mode 100644 nixos/modules/programs/zellij/default.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 25e0714..10f5546 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -13,6 +13,7 @@ programs = { home-manager.enable = true; + zellij.enable = true; }; }; diff --git a/nixos/modules-old/utils/default.nix b/nixos/modules-old/utils/default.nix index e80aac8..c8c89e0 100644 --- a/nixos/modules-old/utils/default.nix +++ b/nixos/modules-old/utils/default.nix @@ -6,6 +6,5 @@ ./tea ./vifm ./vim - ./zellij ]; } diff --git a/nixos/modules-old/utils/zellij/default.nix b/nixos/modules-old/utils/zellij/default.nix deleted file mode 100644 index b84eb71..0000000 --- a/nixos/modules-old/utils/zellij/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - home-manager.users.tdpeuter.home = { - packages = with pkgs; [ - zellij - ]; - - file.".config/zellij".source = ../../../../stow/zellij/.config/zellij; - }; - - fonts.fonts = with pkgs; [ - noto-fonts - noto-fonts-cjk - ]; -} diff --git a/nixos/modules/programs/default.nix b/nixos/modules/programs/default.nix index 73b1132..17e5627 100644 --- a/nixos/modules/programs/default.nix +++ b/nixos/modules/programs/default.nix @@ -1,5 +1,6 @@ { imports = [ ./home-manager + ./zellij ]; } diff --git a/nixos/modules/programs/zellij/default.nix b/nixos/modules/programs/zellij/default.nix new file mode 100644 index 0000000..db81b28 --- /dev/null +++ b/nixos/modules/programs/zellij/default.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.programs.zellij; +in { + options.sisyphus.programs.zellij.enable = lib.mkEnableOption "Zellij"; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + zellij + ]; + + fonts.fonts = with pkgs; [ + noto-fonts + noto-fonts-cjk + ]; + }; +} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index e0cd766..e698d55 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -3,7 +3,7 @@ let cfg = config.sisyphus.users.tdpeuter; - installedPkgs = config.home-manager.users.tdpeuter.home.packages; + installedPkgs = config.environment.systemPackages ++ config.home-manager.users.tdpeuter.home.packages; in { options.sisyphus.users.tdpeuter.enable = lib.mkEnableOption "user Tibo De Peuter"; From 7a3ada2a382f5e308a13637e3b8d63c40d007540 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 17:21:17 +0200 Subject: [PATCH 050/176] [vifm] Move into user --- nixos/modules-old/utils/default.nix | 1 - nixos/modules-old/utils/vifm/default.nix | 22 ------------------- nixos/modules/users/tdpeuter/default.nix | 28 ++++++++++++++++++++---- 3 files changed, 24 insertions(+), 27 deletions(-) delete mode 100644 nixos/modules-old/utils/vifm/default.nix diff --git a/nixos/modules-old/utils/default.nix b/nixos/modules-old/utils/default.nix index c8c89e0..f2670d7 100644 --- a/nixos/modules-old/utils/default.nix +++ b/nixos/modules-old/utils/default.nix @@ -4,7 +4,6 @@ ./sops ./ssh ./tea - ./vifm ./vim ]; } diff --git a/nixos/modules-old/utils/vifm/default.nix b/nixos/modules-old/utils/vifm/default.nix deleted file mode 100644 index 61e1da7..0000000 --- a/nixos/modules-old/utils/vifm/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - - home-manager.users.tdpeuter.home = { - packages = with pkgs; [ - vifm - - chafa # Terminal image previewer - glow # Terminal Markdown renderer - - font-awesome_5 - ]; - - # Put files separately so history still works - file = { - ".config/vifm/colors".source = ../../../../stow/vifm/.config/vifm/colors; - ".config/vifm/scripts".source = ../../../../stow/vifm/.config/vifm/scripts; - ".config/vifm/vifmrc".source = ../../../../stow/vifm/.config/vifm/vifmrc; - }; - }; -} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index e698d55..cc525f8 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -27,19 +27,26 @@ in { homeDirectory = "/home/tdpeuter"; stateVersion = config.system.stateVersion; + fonts.fonts = with pkgs; [ + font-awesome_5 # Dependency of Vifm config + ]; + # If you specify an application here, it will be detected by the configuration module # and the configuration files will be put in place for you. packages = (with pkgs; [ - duf + chafa # Terminal image viewer + duf # Df alternative + glow # Terminal Markdown renderer jellyfin-media-player libreoffice-fresh nextcloud-client - nsxiv + nsxiv # Lightweight image viewer obsidian - qalculate-gtk + qalculate-gtk # Calculator spotify unzip - zathura + vifm # File manager + zathura # PDF viewer ]) ++ (with pkgs-unstable; [ mpv ]); @@ -49,9 +56,22 @@ in { ".config/alacritty" = lib.mkIf (builtins.elem pkgs.alacritty installedPkgs) { source = ../../../../stow/alacritty/.config/alacritty; }; + ".config/mpv" = lib.mkIf (builtins.elem pkgs-unstable.mpv installedPkgs) { source = ../../../../stow/mpv/.config/mpv; }; + + # Put Vifm files separately so history fill still works. + ".config/vifm/colors" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) { + source = ../../../../stow/vifm/.config/vifm/colors; + }; + ".config/vifm/scripts" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) { + source = ../../../../stow/vifm/.config/vifm/scripts; + }; + ".config/vifm/vifmrc" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) { + source = ../../../../stow/vifm/.config/vifm/vifmrc; + }; + ".config/zellij" = lib.mkIf (builtins.elem pkgs.zellij installedPkgs) { source = ../../../../stow/zellij/.config/zellij; }; From 65baefa48be29f78f16334a504f124d9cba74409 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 17:22:36 +0200 Subject: [PATCH 051/176] [tea] Move into user --- nixos/modules-old/utils/default.nix | 1 - nixos/modules-old/utils/tea/default.nix | 10 ---------- nixos/modules/users/tdpeuter/default.nix | 1 + 3 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 nixos/modules-old/utils/tea/default.nix diff --git a/nixos/modules-old/utils/default.nix b/nixos/modules-old/utils/default.nix index f2670d7..c84130e 100644 --- a/nixos/modules-old/utils/default.nix +++ b/nixos/modules-old/utils/default.nix @@ -3,7 +3,6 @@ ./git ./sops ./ssh - ./tea ./vim ]; } diff --git a/nixos/modules-old/utils/tea/default.nix b/nixos/modules-old/utils/tea/default.nix deleted file mode 100644 index ca9964f..0000000 --- a/nixos/modules-old/utils/tea/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - - home-manager.users.tdpeuter.home = { - packages = with pkgs; [ - tea - ]; - }; -} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index cc525f8..0cd6a10 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -44,6 +44,7 @@ in { obsidian qalculate-gtk # Calculator spotify + tea # Gitea CLI unzip vifm # File manager zathura # PDF viewer From 1732827367b18724d25b8c022c9d762a498c54d1 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 17:27:58 +0200 Subject: [PATCH 052/176] Fix font --- nixos/modules/users/tdpeuter/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 0cd6a10..353f25a 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -19,6 +19,10 @@ in { initialPassword = "ChangeMe"; }; + fonts.fonts = with pkgs; [ + font-awesome_5 # Dependency of Vifm config + ]; + home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable { programs.home-manager.enable = true; @@ -27,10 +31,6 @@ in { homeDirectory = "/home/tdpeuter"; stateVersion = config.system.stateVersion; - fonts.fonts = with pkgs; [ - font-awesome_5 # Dependency of Vifm config - ]; - # If you specify an application here, it will be detected by the configuration module # and the configuration files will be put in place for you. packages = (with pkgs; [ From cb1e9496a97c8e9656b41159fe083a59c1744a9f Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 17:57:00 +0200 Subject: [PATCH 053/176] [git] Move into proper module --- nixos/hosts/Tibo-NixFat/default.nix | 3 ++- nixos/modules-old/utils/default.nix | 1 - nixos/modules-old/utils/git/default.nix | 26 ------------------------ nixos/modules/users/tdpeuter/default.nix | 4 ++++ stow/git/.config/git/config | 17 ++++++++++++++++ stow/git/.config/git/ignore | 2 ++ stow/git/.config/git/university | 2 ++ 7 files changed, 27 insertions(+), 28 deletions(-) delete mode 100644 nixos/modules-old/utils/git/default.nix create mode 100644 stow/git/.config/git/config create mode 100644 stow/git/.config/git/ignore create mode 100644 stow/git/.config/git/university diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 10f5546..d96b7e1 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -41,8 +41,9 @@ }; environment.systemPackages = with pkgs; [ - zenith-nvidia + git wget + zenith-nvidia ]; system.stateVersion = "23.05"; diff --git a/nixos/modules-old/utils/default.nix b/nixos/modules-old/utils/default.nix index c84130e..cb04b39 100644 --- a/nixos/modules-old/utils/default.nix +++ b/nixos/modules-old/utils/default.nix @@ -1,6 +1,5 @@ { imports = [ - ./git ./sops ./ssh ./vim diff --git a/nixos/modules-old/utils/git/default.nix b/nixos/modules-old/utils/git/default.nix deleted file mode 100644 index 7910375..0000000 --- a/nixos/modules-old/utils/git/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home-manager.users.tdpeuter = { - programs.git = { - enable = true; - userName = "Tibo De Peuter"; - userEmail = "tibo.depeuter@gmail.com"; - extraConfig = { - core.editor = "vim"; - }; - ignores = [ - "*.swp" - ]; - includes = [ - { - condition = "gitdir:~/university/"; # Trailing backslash is necessary! - contentSuffix = ".gitconfig"; - contents = { - user.email = "tibo.depeuter@ugent.be"; - }; - } - ]; - }; - }; -} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 353f25a..3f9baf4 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -58,6 +58,10 @@ in { source = ../../../../stow/alacritty/.config/alacritty; }; + ".config/git" = lib.mkIf (builtins.elem pkgs.git installedPkgs) { + source = ../../../../stow/git/.config/git; + }; + ".config/mpv" = lib.mkIf (builtins.elem pkgs-unstable.mpv installedPkgs) { source = ../../../../stow/mpv/.config/mpv; }; diff --git a/stow/git/.config/git/config b/stow/git/.config/git/config new file mode 100644 index 0000000..85f71f0 --- /dev/null +++ b/stow/git/.config/git/config @@ -0,0 +1,17 @@ +[user] + name = "Tibo De Peuter" + email = "tibo.depeuter@gmail.com" + +[core] + editor = "vim"; + excludesFile = "~/.config/git/ignore" + +[color] + ui = true + +[help] + autocorrect = 20 + +[includeIf "gitdir:~/university/"] # Trailing backslash is necessary! + path = "~/.config/git/university" + diff --git a/stow/git/.config/git/ignore b/stow/git/.config/git/ignore new file mode 100644 index 0000000..4c5f88a --- /dev/null +++ b/stow/git/.config/git/ignore @@ -0,0 +1,2 @@ +*~ +.*.swp diff --git a/stow/git/.config/git/university b/stow/git/.config/git/university new file mode 100644 index 0000000..e0f3026 --- /dev/null +++ b/stow/git/.config/git/university @@ -0,0 +1,2 @@ +[user] + email = "tibo.depeuter@ugent.be" From 197fcdbb810abc23d2c4be2da4c74a53598fcbdb Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 18:15:24 +0200 Subject: [PATCH 054/176] [git] Add default branch --- stow/git/.config/git/config | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/stow/git/.config/git/config b/stow/git/.config/git/config index 85f71f0..19e8151 100644 --- a/stow/git/.config/git/config +++ b/stow/git/.config/git/config @@ -2,16 +2,19 @@ name = "Tibo De Peuter" email = "tibo.depeuter@gmail.com" +[color] + ui = true + [core] editor = "vim"; excludesFile = "~/.config/git/ignore" -[color] - ui = true - [help] autocorrect = 20 [includeIf "gitdir:~/university/"] # Trailing backslash is necessary! path = "~/.config/git/university" +[init] + defaultBranch = "main" + From 37b39687220698c63ac4023c6e2c265e78af3fa4 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 18:54:27 +0200 Subject: [PATCH 055/176] [ssh] Move to actual module --- nixos/hosts/Tibo-NixFat/default.nix | 41 +++++++------- .../modules-old/utils/{ssh => sops}/README.md | 0 nixos/modules-old/utils/ssh/default.nix | 54 ------------------- nixos/modules/default.nix | 3 +- nixos/modules/programs/default.nix | 1 + nixos/modules/programs/ssh/default.nix | 13 +++++ nixos/modules/services/default.nix | 5 ++ nixos/modules/services/openssh/default.nix | 17 ++++++ nixos/modules/users/tdpeuter/default.nix | 7 +++ stow/ssh/.ssh/config | 37 +++++++++++++ 10 files changed, 100 insertions(+), 78 deletions(-) rename nixos/modules-old/utils/{ssh => sops}/README.md (100%) delete mode 100644 nixos/modules-old/utils/ssh/default.nix create mode 100644 nixos/modules/programs/ssh/default.nix create mode 100644 nixos/modules/services/default.nix create mode 100644 nixos/modules/services/openssh/default.nix create mode 100644 stow/ssh/.ssh/config diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index d96b7e1..54b960b 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -13,6 +13,7 @@ programs = { home-manager.enable = true; + ssh.enable = true; zellij.enable = true; }; }; @@ -46,22 +47,29 @@ zenith-nvidia ]; + hardware.bluetooth.enable = true; + + networking.hostName = "Tibo-NixFat"; + + services = { + # Handle the laptop lid switch as follows: + logind = { + lidSwitch = "hybrid-sleep"; + lidSwitchExternalPower = "lock"; + lidSwitchDocked = "ignore"; + }; + }; + system.stateVersion = "23.05"; + time.timeZone = "Europe/Brussels"; + # --- Barrier --- networking = { - hostName = "Tibo-NixFat"; networkmanager.enable = true; }; - # Set your time zone. - time.timeZone = "Europe/Brussels"; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Enable sound with pipewire. sound.enable = true; hardware.pulseaudio.enable = false; @@ -79,20 +87,9 @@ #media-session.enable = true; }; - # Enable Bluetooth. - hardware.bluetooth.enable = true; - - services = { - logind = { - lidSwitch = "hybrid-sleep"; - lidSwitchExternalPower = "lock"; - lidSwitchDocked = "ignore"; - }; - - # Enable touchpad support (enabled default in most desktopManager). - xserver = { - libinput.enable = true; - }; + # Enable touchpad support (enabled default in most desktopManager). + services.xserver = { + libinput.enable = true; }; # Allow unfree packages diff --git a/nixos/modules-old/utils/ssh/README.md b/nixos/modules-old/utils/sops/README.md similarity index 100% rename from nixos/modules-old/utils/ssh/README.md rename to nixos/modules-old/utils/sops/README.md diff --git a/nixos/modules-old/utils/ssh/default.nix b/nixos/modules-old/utils/ssh/default.nix deleted file mode 100644 index bc0f463..0000000 --- a/nixos/modules-old/utils/ssh/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - services.openssh = { - enable = true; - settings.PasswordAuthentication = false; - }; - - home-manager.users.tdpeuter = { - programs.ssh = { - enable = true; - matchBlocks = { - "Hugo" = { - hostname = "192.168.0.11"; - identitiesOnly = true; - identityFile = "/run/secrets/Hugo/ssh"; - user = "admin"; - }; - "HPC" = { - hostname = "login.hpc.ugent.be"; - identitiesOnly = true; - identityFile = "/run/secrets/UGent/HPC/ssh"; - user = "vsc44995"; - }; - - # Git authentication - "git.depeuter.dev" = { - hostname = "git.depeuter.dev"; - identitiesOnly = true; - identityFile = "/run/secrets/Hugo/Gitea/ssh"; - user = "git"; - }; - "github.com" = { - hostname = "github.com"; - identitiesOnly = true; - identityFile = "/run/secrets/GitHub/ssh"; - user = "git"; - }; - "github.ugent.be" = { - hostname = "github.ugent.be"; - identitiesOnly = true; - identityFile = "/run/secrets/UGent/GitHub/ssh"; - user = "git"; - }; - "subgit.ugent.be" = { - hostname = "subgit.ugent.be"; - identitiesOnly = true; - identityFile = "/run/secrets/UGent/SubGit/ssh"; - user = "git"; - }; - }; - }; - }; -} diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 18a9fb3..b9d9008 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -1,8 +1,7 @@ -{ lib, ... }: - { imports = [ ./programs + ./services ./users ./virtualisation ]; diff --git a/nixos/modules/programs/default.nix b/nixos/modules/programs/default.nix index 17e5627..159d6a0 100644 --- a/nixos/modules/programs/default.nix +++ b/nixos/modules/programs/default.nix @@ -1,6 +1,7 @@ { imports = [ ./home-manager + ./ssh ./zellij ]; } diff --git a/nixos/modules/programs/ssh/default.nix b/nixos/modules/programs/ssh/default.nix new file mode 100644 index 0000000..13b008c --- /dev/null +++ b/nixos/modules/programs/ssh/default.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.programs.ssh; +in { + options.sisyphus.programs.ssh.enable = lib.mkEnableOption "SSH"; + + config = lib.mkIf cfg.enable { + programs.ssh = { + enableAskPassword = false; + }; + }; +} diff --git a/nixos/modules/services/default.nix b/nixos/modules/services/default.nix new file mode 100644 index 0000000..f7295a5 --- /dev/null +++ b/nixos/modules/services/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./openssh + ]; +} diff --git a/nixos/modules/services/openssh/default.nix b/nixos/modules/services/openssh/default.nix new file mode 100644 index 0000000..f4ba49b --- /dev/null +++ b/nixos/modules/services/openssh/default.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.services.openssh; +in { + options.sisyphus.services.openssh.enable = lib.mkEnableOption "OpenSSH"; + + config = lib.mkIf cfg.enable { + services.openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + PermitRootLogin = "no"; + }; + }; + }; +} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 3f9baf4..5e89862 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -21,6 +21,8 @@ in { fonts.fonts = with pkgs; [ font-awesome_5 # Dependency of Vifm config + noto-fonts # Dependency of Zellij config + noto-fonts-cjk # Dependency of Zellij config ]; home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable { @@ -48,6 +50,7 @@ in { unzip vifm # File manager zathura # PDF viewer + zellij # Tmux + screen alternative ]) ++ (with pkgs-unstable; [ mpv ]); @@ -66,6 +69,10 @@ in { source = ../../../../stow/mpv/.config/mpv; }; + ".ssh/config" = { # Always put SSH configuration + source = ../../../../stow/ssh/.ssh/config; + }; + # Put Vifm files separately so history fill still works. ".config/vifm/colors" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) { source = ../../../../stow/vifm/.config/vifm/colors; diff --git a/stow/ssh/.ssh/config b/stow/ssh/.ssh/config new file mode 100644 index 0000000..1bdb4cd --- /dev/null +++ b/stow/ssh/.ssh/config @@ -0,0 +1,37 @@ +Host Hugo + User admin + HostName 192.168.0.11 + IdentitiesOnly yes + IdentityFile /run/secrets/Hugo/ssh + +Host HPC + User vsc44995 + HostName login.hpc.ugent.be + IdentitiesOnly yes + IdentityFile /run/secrets/UGent/HPC/ssh + +# Git authentication +Host git.depeuter.dev + User git + HostName git.depeuter.dev + IdentitiesOnly yes + IdentityFile /run/secrets/Hugo/Gitea/ssh + +Host github.com + User git + HostName github.com + IdentitiesOnly yes + IdentityFile /run/secrets/GitHub/ssh + +Host github.ugent.be + User git + HostName github.ugent.be + IdentitiesOnly yes + IdentityFile /run/secrets/UGent/GitHub/ssh + +Host subgit.ugent.be + User git + HostName subgit.ugent.be + IdentitiesOnly yes + IdentityFile /run/secrets/UGent/SubGit/ssh + From f931c28f79fb3393aea05e21e4b5b491a5239266 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 19:03:00 +0200 Subject: [PATCH 056/176] Remove almost empty bash config --- arch/stow/bash/.bashrc | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 arch/stow/bash/.bashrc diff --git a/arch/stow/bash/.bashrc b/arch/stow/bash/.bashrc deleted file mode 100644 index 617dfaf..0000000 --- a/arch/stow/bash/.bashrc +++ /dev/null @@ -1,11 +0,0 @@ -# -# ~/.bashrc -# - -# If not running interactively, don't do anything -[[ $- != *i* ]] && return - -alias ls='ls --color=auto' -PS1='[\u@\h \W]\$ ' - -eval $( keychain --eval --quiet ~/.ssh/id_ed25519 ) From 8a63138f28f8ed44c263f6d47efaba0d8ec3f416 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 19:11:50 +0200 Subject: [PATCH 057/176] Add stow as dependency for NixOS --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 16d0835..66bae0b 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Welcome to my dotfiles repository, named Sisyphus. This repository houses the co To maintain clarity and versatility, I've organized my configuration files into distinct subdirectories. The "bare" configuration files, those you typically find in your `~/.config` directory, are located in [stow](./stow). This separation allows for a streamlined approach to managing configurations, while other subdirectories house OS-specific settings. - [Arch Linux](./arch) (+ [stow](./stow)) -- [NixOS](./nixos) +- [NixOS](./nixos) (+ [stow](./stow)) ## The Sisyphus Analogy From bd6b9a4b132fb6ac27b06d14bb060072d2cad0b1 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 20:11:35 +0200 Subject: [PATCH 058/176] Remove steam --- nixos/modules-old/apps/default.nix | 1 - nixos/modules-old/apps/steam/default.nix | 8 -------- nixos/modules-old/utils/default.nix | 1 - 3 files changed, 10 deletions(-) delete mode 100644 nixos/modules-old/apps/steam/default.nix diff --git a/nixos/modules-old/apps/default.nix b/nixos/modules-old/apps/default.nix index cd1aa58..5dc1373 100644 --- a/nixos/modules-old/apps/default.nix +++ b/nixos/modules-old/apps/default.nix @@ -2,7 +2,6 @@ imports = [ ./firefox ./kitty - ./steam ./thunderbird ]; } diff --git a/nixos/modules-old/apps/steam/default.nix b/nixos/modules-old/apps/steam/default.nix deleted file mode 100644 index 1dc2523..0000000 --- a/nixos/modules-old/apps/steam/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ inputs, lib, config, pkgs, ... }: - -{ - programs.steam = { - enable = true; - }; - -} diff --git a/nixos/modules-old/utils/default.nix b/nixos/modules-old/utils/default.nix index cb04b39..9259e66 100644 --- a/nixos/modules-old/utils/default.nix +++ b/nixos/modules-old/utils/default.nix @@ -1,7 +1,6 @@ { imports = [ ./sops - ./ssh ./vim ]; } From 99ddea165868bb2ee539cc05ec11cb3c04bf4fba Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 20:14:07 +0200 Subject: [PATCH 059/176] [kitty] Move into user config --- nixos/modules-old/apps/default.nix | 1 - nixos/modules-old/apps/kitty/default.nix | 15 --------------- nixos/modules/users/tdpeuter/default.nix | 9 ++++----- 3 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 nixos/modules-old/apps/kitty/default.nix diff --git a/nixos/modules-old/apps/default.nix b/nixos/modules-old/apps/default.nix index 5dc1373..d14f28e 100644 --- a/nixos/modules-old/apps/default.nix +++ b/nixos/modules-old/apps/default.nix @@ -1,7 +1,6 @@ { imports = [ ./firefox - ./kitty ./thunderbird ]; } diff --git a/nixos/modules-old/apps/kitty/default.nix b/nixos/modules-old/apps/kitty/default.nix deleted file mode 100644 index 2e1726c..0000000 --- a/nixos/modules-old/apps/kitty/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ inputs, lib, config, pkgs, ... }: - -{ - home-manager.users.tdpeuter = { pkgs, ... }: { - home = { - packages = with pkgs; [ - kitty - ]; - - file = { - ".config/kitty".source = ../../../../stow/kitty/.config/kitty; - }; - }; - }; -} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 5e89862..692d7de 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -40,6 +40,7 @@ in { duf # Df alternative glow # Terminal Markdown renderer jellyfin-media-player + kitty libreoffice-fresh nextcloud-client nsxiv # Lightweight image viewer @@ -60,19 +61,18 @@ in { ".config/alacritty" = lib.mkIf (builtins.elem pkgs.alacritty installedPkgs) { source = ../../../../stow/alacritty/.config/alacritty; }; - ".config/git" = lib.mkIf (builtins.elem pkgs.git installedPkgs) { source = ../../../../stow/git/.config/git; }; - + ".config/kitty" = lib.mkIf (builtins.elem pkgs.kitty installedPkgs) { + source = ../../../../stow/kitty/.config/kitty; + }; ".config/mpv" = lib.mkIf (builtins.elem pkgs-unstable.mpv installedPkgs) { source = ../../../../stow/mpv/.config/mpv; }; - ".ssh/config" = { # Always put SSH configuration source = ../../../../stow/ssh/.ssh/config; }; - # Put Vifm files separately so history fill still works. ".config/vifm/colors" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) { source = ../../../../stow/vifm/.config/vifm/colors; @@ -83,7 +83,6 @@ in { ".config/vifm/vifmrc" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) { source = ../../../../stow/vifm/.config/vifm/vifmrc; }; - ".config/zellij" = lib.mkIf (builtins.elem pkgs.zellij installedPkgs) { source = ../../../../stow/zellij/.config/zellij; }; From e8b3e3d8134bed8767b608331ba762a469a5949e Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 20:30:40 +0200 Subject: [PATCH 060/176] [gnome] Move into proper module --- nixos/hosts/Tibo-NixFat/default.nix | 3 +- nixos/modules-old/des/gnome/default.nix | 76 ------------------- nixos/modules/services/default.nix | 1 + nixos/modules/services/desktop/default.nix | 5 ++ .../services/desktop/gnome/default.nix | 54 +++++++++++++ nixos/modules/users/tdpeuter/default.nix | 29 ++++++- 6 files changed, 89 insertions(+), 79 deletions(-) delete mode 100644 nixos/modules-old/des/gnome/default.nix create mode 100644 nixos/modules/services/desktop/default.nix create mode 100644 nixos/modules/services/desktop/gnome/default.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 54b960b..24b4c08 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -4,8 +4,6 @@ imports = [ ./hardware-configuration.nix ../../modules-old/hardware/nvidia.nix - - ../../modules-old/des/gnome ]; sisyphus = { @@ -16,6 +14,7 @@ ssh.enable = true; zellij.enable = true; }; + services.desktop.gnome.enable = true; }; boot = { diff --git a/nixos/modules-old/des/gnome/default.nix b/nixos/modules-old/des/gnome/default.nix deleted file mode 100644 index 967ccea..0000000 --- a/nixos/modules-old/des/gnome/default.nix +++ /dev/null @@ -1,76 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - services.xserver = { - enable = true; - - # Enable the GNOME Desktop Environment. - displayManager.gdm.enable = true; - desktopManager.gnome.enable = true; - - excludePackages = with pkgs; [ - xterm - ]; - }; - - environment.systemPackages = with pkgs; [ - gnomeExtensions.launch-new-instance - ]; - - # We do not want these packages automatically - environment.gnome.excludePackages = (with pkgs; [ - baobab - epiphany # Web browser - evince # Document viewer - gnome-connections # Remote desktop client - gnome-console - gnome-photos - gnome-text-editor - gnome-tour - ]) ++ (with pkgs.gnome; [ - eog # Image viewer - file-roller # Archive manager - geary # Mail client - gedit - gnome-calculator - gnome-calendar - gnome-characters - gnome-clocks - gnome-contacts - gnome-disk-utility - gnome-maps - gnome-music - gnome-system-monitor - gnome-weather - simple-scan - totem # Movie player - yelp # Help viewer - ]); - - # GNOME ricing - # Browse available settings by running: - # gsettings list-schemas | xargs -I % sh -c 'echo %; gsettings list-keys %' | less - home-manager.users.tdpeuter.dconf.settings = { - "org/gnome/desktop/background" = { - picture-uri = "file:///home/tdpeuter/Nextcloud/Afbeeldingen/wallpapers/bg"; - picture-uri-dark = "file:///home/tdpeuter/Nextcloud/Afbeeldingen/wallpapers/bg-dark"; - }; - "org/gnome/desktop/interface" = { - enable-animations = false; - enable-hot-corners = false; - }; - "org/gnome/desktop/notifications" = { - show-in-lock-screen = false; - }; - "org/gnome/desktop/peripherals.touchpad" = { - tap-to-click = true; - }; - "org/gnome/mutter" = { - dynamic-workspaces = true; - workspaces-only-on-primary = false; - }; - "org/gnome/shell/app-switcher" = { - current-workspace-only = true; - }; - }; -} diff --git a/nixos/modules/services/default.nix b/nixos/modules/services/default.nix index f7295a5..b22d263 100644 --- a/nixos/modules/services/default.nix +++ b/nixos/modules/services/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./desktop ./openssh ]; } diff --git a/nixos/modules/services/desktop/default.nix b/nixos/modules/services/desktop/default.nix new file mode 100644 index 0000000..7c1002b --- /dev/null +++ b/nixos/modules/services/desktop/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./gnome + ]; +} diff --git a/nixos/modules/services/desktop/gnome/default.nix b/nixos/modules/services/desktop/gnome/default.nix new file mode 100644 index 0000000..415211b --- /dev/null +++ b/nixos/modules/services/desktop/gnome/default.nix @@ -0,0 +1,54 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.services.desktop.gnome; +in { + options.sisyphus.services.desktop.gnome.enable = lib.mkEnableOption "GNOME"; + + config = lib.mkIf cfg.enable { + services.xserver = { + enable = true; + excludePackages = with pkgs; [ + xterm + ]; + + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + }; + + # Start a new instance of application instead of going to that window. + environment.systemPackages = with pkgs.gnomeExtensions; [ + launch-new-instance + ]; + + # Do not use these packages + environment.gnome.excludePackages = (with pkgs; [ + baobab + epiphany # Web browser + evince # Document viewer + gnome-connections # Remote desktop client + gnome-console + gnome-photos + gnome-text-editor + gnome-tour + ]) ++ (with pkgs.gnome; [ + eog # Image viewer + file-roller # Archive manager + geary # Mail client + gedit + gnome-calculator + gnome-calendar + gnome-characters + gnome-clocks + gnome-contacts + gnome-disk-utility + gnome-maps + gnome-music + gnome-system-monitor + gnome-weather + simple-scan + totem # Movie player + yelp # Help viewer + ]); + }; +} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 692d7de..bdb653e 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -70,7 +70,7 @@ in { ".config/mpv" = lib.mkIf (builtins.elem pkgs-unstable.mpv installedPkgs) { source = ../../../../stow/mpv/.config/mpv; }; - ".ssh/config" = { # Always put SSH configuration + ".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable { source = ../../../../stow/ssh/.ssh/config; }; # Put Vifm files separately so history fill still works. @@ -89,6 +89,33 @@ in { }; }; + # GNOME ricing + # Browse available settings by running: + # gsettings list-schemas | xargs -I % sh -c 'echo %; gsettings list-keys %' | less + dconf.settings = lib.mkIf config.sisyphus.services.desktop.gnome.enable { + "org/gnome/desktop/background" = { + picture-uri = "file:///home/tdpeuter/Nextcloud/Afbeeldingen/wallpapers/bg"; + picture-uri-dark = "file:///home/tdpeuter/Nextcloud/Afbeeldingen/wallpapers/bg-dark"; + }; + "org/gnome/desktop/interface" = { + enable-animations = false; + enable-hot-corners = false; + }; + "org/gnome/desktop/notifications" = { + show-in-lock-screen = false; + }; + "org/gnome/desktop/peripherals.touchpad" = { + tap-to-click = true; + }; + "org/gnome/mutter" = { + dynamic-workspaces = true; + workspaces-only-on-primary = false; + }; + "org/gnome/shell/app-switcher" = { + current-workspace-only = true; + }; + }; + xdg.mimeApps = { enable = true; From 6b2bd26e48e59ada6cbf7006bd29bc2a2902d4e3 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 20:58:49 +0200 Subject: [PATCH 061/176] [sops] Move into proper module --- nixos/hosts/Tibo-NixFat/default.nix | 1 + nixos/modules-old/utils/default.nix | 1 - nixos/modules/programs/default.nix | 1 + nixos/modules/programs/sops/default.nix | 25 ++++++++++++++++++++ nixos/modules/users/tdpeuter/default.nix | 30 ++++++++++++++++++++++-- 5 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 nixos/modules/programs/sops/default.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 24b4c08..098cdc5 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -11,6 +11,7 @@ programs = { home-manager.enable = true; + sops.enable = true; ssh.enable = true; zellij.enable = true; }; diff --git a/nixos/modules-old/utils/default.nix b/nixos/modules-old/utils/default.nix index 9259e66..c398e48 100644 --- a/nixos/modules-old/utils/default.nix +++ b/nixos/modules-old/utils/default.nix @@ -1,6 +1,5 @@ { imports = [ - ./sops ./vim ]; } diff --git a/nixos/modules/programs/default.nix b/nixos/modules/programs/default.nix index 159d6a0..e13df16 100644 --- a/nixos/modules/programs/default.nix +++ b/nixos/modules/programs/default.nix @@ -1,6 +1,7 @@ { imports = [ ./home-manager + ./sops ./ssh ./zellij ]; diff --git a/nixos/modules/programs/sops/default.nix b/nixos/modules/programs/sops/default.nix new file mode 100644 index 0000000..443eac9 --- /dev/null +++ b/nixos/modules/programs/sops/default.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.programs.sops; +in { + options.sisyphus.programs.sops.enable = lib.mkEnableOption "Sops"; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + sops + ]; + + sops = { + # Add secrets.yml to the Nix Store. + defaultSopsFile = ../../../secrets/secrets.yaml; + age = { + # Automatically import SSH keys as age keys. + sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + # Use an age key that is expected to already be in the filesystem. + # You will need to place this file manually. + keyFile = "/var/lib/sops-nix/key.txt"; + }; + }; + }; +} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index bdb653e..c91390f 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -3,6 +3,7 @@ let cfg = config.sisyphus.users.tdpeuter; + user = config.users.users.tdpeuter.name; installedPkgs = config.environment.systemPackages ++ config.home-manager.users.tdpeuter.home.packages; in { options.sisyphus.users.tdpeuter.enable = lib.mkEnableOption "user Tibo De Peuter"; @@ -29,8 +30,8 @@ in { programs.home-manager.enable = true; home = { - username = "tdpeuter"; - homeDirectory = "/home/tdpeuter"; + username = user; + homeDirectory = "/home/${user}"; stateVersion = config.system.stateVersion; # If you specify an application here, it will be detected by the configuration module @@ -141,5 +142,30 @@ in { }; }; }; + sops.secrets = lib.mkIf config.sisyphus.programs.sops.enable ( + let + Hugo = { + format = "yaml"; + sopsFile = ../../../secrets/Hugo.yaml; + owner = user; + }; + UGent = { + format = "yaml"; + sopsFile = ../../../secrets/UGent.yaml; + owner = user; + }; + in { + "Hugo/ssh" = Hugo; + "UGent/HPC/ssh" = UGent; + + "GitHub/ssh" = { + format = "yaml"; + sopsFile = ../../../secrets/GitHub.yaml; + owner = user; + }; + "Hugo/Gitea/ssh" = Hugo; + "UGent/GitHub/ssh" = UGent; + "UGent/SubGit/ssh" = UGent; + }); }; } From 7c912db2b527a43da40fc91e69c741d354fa1ac0 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 21:12:30 +0200 Subject: [PATCH 062/176] Improve NixOS README Assisted by ChatGPT --- nixos/README.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/nixos/README.md b/nixos/README.md index 0f69ea6..e059c53 100644 --- a/nixos/README.md +++ b/nixos/README.md @@ -1,13 +1,16 @@ -# nixos +# NixOS -Nix Flake for my Linux machines running NixOS. +Nix Flake configuration for my Linux machines running NixOS. -The directory structure can be interpreted as follows: +## Structure -- [`flake.nix`](./flake.nix): Main entrypoint for the configuration -- [hosts/*hostname*](./hosts): Host-specific configuration by setting options -- [modules](./modules): Declarations of options -- [modules/users/*username*](./modules/users): Since users are dependent on a host machine to exist, they are defined as a module as well -- [overlays](./overlays): Attribute overrides of Nix Packages -- [secrets](./secrets): Encrypted files that hold secrets, for example SSH private keys +The directory structure is organized as follows: +- [`flake.nix`](./flake.nix): Main entrypoint for the configuration. +- [hosts/*hostname*](./hosts): Host-specific configuration by setting options. Each host has its own folder. +- [modules](./modules): Declarations of configuration options. +- [modules/users/*username*](./modules/users): User-specific configuration. Users are defined as modules, as they are dependent on a host machine. +- [overlays](./overlays): Attribute overrides for Nix Packages. +- [secrets](./secrets): Encrypted files that store sensitive information, such as SSH private keys. + +[Modules](https://nixos.wiki/wiki/NixOS_modules) are a key component of NixOS. They encapsulate various configuration options, which should make it easy for you to integrate it into your specific configuration. From e378e97534d544ce4ab3293ba886b41904939de0 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 19 Oct 2023 20:58:15 +0200 Subject: [PATCH 063/176] Add printing module --- nixos/hosts/Tibo-NixFat/default.nix | 5 ++++- nixos/modules/services/default.nix | 1 + nixos/modules/services/printing/default.nix | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 nixos/modules/services/printing/default.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 098cdc5..1d85891 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -15,7 +15,10 @@ ssh.enable = true; zellij.enable = true; }; - services.desktop.gnome.enable = true; + services = { + desktop.gnome.enable = true; + printing.enable = true; + }; }; boot = { diff --git a/nixos/modules/services/default.nix b/nixos/modules/services/default.nix index b22d263..9fc4c37 100644 --- a/nixos/modules/services/default.nix +++ b/nixos/modules/services/default.nix @@ -2,5 +2,6 @@ imports = [ ./desktop ./openssh + ./printing ]; } diff --git a/nixos/modules/services/printing/default.nix b/nixos/modules/services/printing/default.nix new file mode 100644 index 0000000..b7352b3 --- /dev/null +++ b/nixos/modules/services/printing/default.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.services.printing; +in { + options.sisyphus.services.printing.enable = lib.mkEnableOption "Printing"; + + config = lib.mkIf cfg.enable { + services = { + printing.enable = true; + avahi = { + enable = true; + nssmdns = true; + openFirewall = true; + }; + }; + }; +} From cf9058cc48ff99e62d237533d598190141b46435 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 19 Oct 2023 21:03:53 +0200 Subject: [PATCH 064/176] [vim] Move into user config --- nixos/modules-old/default.nix | 1 - nixos/modules-old/utils/default.nix | 5 - nixos/modules-old/utils/vim/default.nix | 81 - nixos/modules/users/tdpeuter/default.nix | 27 +- stow/vim/.vim/autoload/plug.vim | 2812 ---------------------- stow/vim/.vim/colors/tdpeuter-light.vim | 4 +- stow/vim/.vimrc | 130 +- 7 files changed, 76 insertions(+), 2984 deletions(-) delete mode 100644 nixos/modules-old/utils/default.nix delete mode 100644 nixos/modules-old/utils/vim/default.nix delete mode 100644 stow/vim/.vim/autoload/plug.vim diff --git a/nixos/modules-old/default.nix b/nixos/modules-old/default.nix index 6f44b7a..cab2f2d 100644 --- a/nixos/modules-old/default.nix +++ b/nixos/modules-old/default.nix @@ -4,7 +4,6 @@ imports = [ ./apps ./shells - ./utils ]; # Nix Flakes diff --git a/nixos/modules-old/utils/default.nix b/nixos/modules-old/utils/default.nix deleted file mode 100644 index c398e48..0000000 --- a/nixos/modules-old/utils/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./vim - ]; -} diff --git a/nixos/modules-old/utils/vim/default.nix b/nixos/modules-old/utils/vim/default.nix deleted file mode 100644 index 0a9cbb6..0000000 --- a/nixos/modules-old/utils/vim/default.nix +++ /dev/null @@ -1,81 +0,0 @@ -{ inputs, lib, config, pkgs, ... }: - -{ - home-manager.users.tdpeuter = { pkgs, ... }: { - home.file = { - ".vim".source = ../../../../stow/vim/.vim; - }; - - programs.vim = { - enable = true; - extraConfig = '' - colorscheme tdpeuter-light - - " Tags - " pacman -S ctags - command! MakeTags !ctags -R . & - " Move to defintion using ^] - " Move to ambigious using g^] - " Move back using ^t - - filetype on - filetype indent on - filetype plugin on - - " File browsing - let g:netrw_browse_split=4 " open in the previous window - let g:netrw_altv=1 " split new windows to the right - let g:netrw_liststyle=3 " treeview - - set autoindent - set conceallevel=2 - set incsearch - set linebreak - set nocompatible - set path+=** - set scrolloff=3 - set showcmd - set showmatch - set smartindent - set smarttab - set title - set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx - set wildmenu - - syntax enable - - if $TERM == 'alacritty' - set ttymouse=sgr " Alacritty specific - endif - if $TERM == 'xterm-kitty' - " Fix and not working - set term=xterm-256color - endif - - if has("autocmd") - au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif - " https://stackoverflow.com/a/37558470/19044747 - augroup remember_folds - autocmd! - autocmd BufWinLeave * silent! mkview - autocmd BufWinEnter * silent! loadview - augroup END - endif - ''; - plugins = with pkgs.vimPlugins; [ - ale - catppuccin-vim - statix - vifm-vim - ]; - settings = { - expandtab = true; - mouse = "a"; - number = true; - relativenumber = true; - shiftwidth = 4; - tabstop = 4; - }; - }; - }; -} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index c91390f..be02a5a 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -32,7 +32,7 @@ in { home = { username = user; homeDirectory = "/home/${user}"; - stateVersion = config.system.stateVersion; + inherit (config.system) stateVersion; # If you specify an application here, it will be detected by the configuration module # and the configuration files will be put in place for you. @@ -55,6 +55,9 @@ in { zellij # Tmux + screen alternative ]) ++ (with pkgs-unstable; [ mpv + ]) ++ (with pkgs.vimPlugins; [ + statix + vim-plug ]); # Put dotfiles in place. @@ -74,19 +77,23 @@ in { ".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable { source = ../../../../stow/ssh/.ssh/config; }; - # Put Vifm files separately so history fill still works. - ".config/vifm/colors" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) { - source = ../../../../stow/vifm/.config/vifm/colors; - }; - ".config/vifm/scripts" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) { - source = ../../../../stow/vifm/.config/vifm/scripts; - }; - ".config/vifm/vifmrc" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) { - source = ../../../../stow/vifm/.config/vifm/vifmrc; + ".config/vifm" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) { + source = ../../../../stow/vifm/.config/vifm; + recursive = true; }; ".config/zellij" = lib.mkIf (builtins.elem pkgs.zellij installedPkgs) { source = ../../../../stow/zellij/.config/zellij; }; + ".vim" = lib.mkIf (builtins.elem pkgs.vim installedPkgs) { + source = ../../../../stow/vim/.vim; + recursive = true; + }; + ".vim/autoload/plug.vim" = lib.mkIf (builtins.elem pkgs.vim installedPkgs) { + source = "${pkgs.vimPlugins.vim-plug}/plug.vim"; + }; + ".vimrc" = lib.mkIf (builtins.elem pkgs.vim installedPkgs) { + source = ../../../../stow/vim/.vimrc; + }; }; }; diff --git a/stow/vim/.vim/autoload/plug.vim b/stow/vim/.vim/autoload/plug.vim deleted file mode 100644 index 652caa8..0000000 --- a/stow/vim/.vim/autoload/plug.vim +++ /dev/null @@ -1,2812 +0,0 @@ -" vim-plug: Vim plugin manager -" ============================ -" -" Download plug.vim and put it in ~/.vim/autoload -" -" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ -" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -" -" Edit your .vimrc -" -" call plug#begin('~/.vim/plugged') -" -" " Make sure you use single quotes -" -" " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align -" Plug 'junegunn/vim-easy-align' -" -" " Any valid git URL is allowed -" Plug 'https://github.com/junegunn/vim-github-dashboard.git' -" -" " Multiple Plug commands can be written in a single line using | separators -" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' -" -" " On-demand loading -" Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } -" Plug 'tpope/vim-fireplace', { 'for': 'clojure' } -" -" " Using a non-default branch -" Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' } -" -" " Using a tagged release; wildcard allowed (requires git 1.9.2 or above) -" Plug 'fatih/vim-go', { 'tag': '*' } -" -" " Plugin options -" Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' } -" -" " Plugin outside ~/.vim/plugged with post-update hook -" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } -" -" " Unmanaged plugin (manually installed and updated) -" Plug '~/my-prototype-plugin' -" -" " Initialize plugin system -" call plug#end() -" -" Then reload .vimrc and :PlugInstall to install plugins. -" -" Plug options: -" -"| Option | Description | -"| ----------------------- | ------------------------------------------------ | -"| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use | -"| `rtp` | Subdirectory that contains Vim plugin | -"| `dir` | Custom directory for the plugin | -"| `as` | Use different name for the plugin | -"| `do` | Post-update hook (string or funcref) | -"| `on` | On-demand loading: Commands or ``-mappings | -"| `for` | On-demand loading: File types | -"| `frozen` | Do not update unless explicitly specified | -" -" More information: https://github.com/junegunn/vim-plug -" -" -" Copyright (c) 2017 Junegunn Choi -" -" MIT License -" -" 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: -" -" 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. - -if exists('g:loaded_plug') - finish -endif -let g:loaded_plug = 1 - -let s:cpo_save = &cpo -set cpo&vim - -let s:plug_src = 'https://github.com/junegunn/vim-plug.git' -let s:plug_tab = get(s:, 'plug_tab', -1) -let s:plug_buf = get(s:, 'plug_buf', -1) -let s:mac_gui = has('gui_macvim') && has('gui_running') -let s:is_win = has('win32') -let s:nvim = has('nvim-0.2') || (has('nvim') && exists('*jobwait') && !s:is_win) -let s:vim8 = has('patch-8.0.0039') && exists('*job_start') -if s:is_win && &shellslash - set noshellslash - let s:me = resolve(expand(':p')) - set shellslash -else - let s:me = resolve(expand(':p')) -endif -let s:base_spec = { 'branch': '', 'frozen': 0 } -let s:TYPE = { -\ 'string': type(''), -\ 'list': type([]), -\ 'dict': type({}), -\ 'funcref': type(function('call')) -\ } -let s:loaded = get(s:, 'loaded', {}) -let s:triggers = get(s:, 'triggers', {}) - -function! s:is_powershell(shell) - return a:shell =~# 'powershell\(\.exe\)\?$' || a:shell =~# 'pwsh\(\.exe\)\?$' -endfunction - -function! s:isabsolute(dir) abort - return a:dir =~# '^/' || (has('win32') && a:dir =~? '^\%(\\\|[A-Z]:\)') -endfunction - -function! s:git_dir(dir) abort - let gitdir = s:trim(a:dir) . '/.git' - if isdirectory(gitdir) - return gitdir - endif - if !filereadable(gitdir) - return '' - endif - let gitdir = matchstr(get(readfile(gitdir), 0, ''), '^gitdir: \zs.*') - if len(gitdir) && !s:isabsolute(gitdir) - let gitdir = a:dir . '/' . gitdir - endif - return isdirectory(gitdir) ? gitdir : '' -endfunction - -function! s:git_origin_url(dir) abort - let gitdir = s:git_dir(a:dir) - let config = gitdir . '/config' - if empty(gitdir) || !filereadable(config) - return '' - endif - return matchstr(join(readfile(config)), '\[remote "origin"\].\{-}url\s*=\s*\zs\S*\ze') -endfunction - -function! s:git_revision(dir) abort - let gitdir = s:git_dir(a:dir) - let head = gitdir . '/HEAD' - if empty(gitdir) || !filereadable(head) - return '' - endif - - let line = get(readfile(head), 0, '') - let ref = matchstr(line, '^ref: \zs.*') - if empty(ref) - return line - endif - - if filereadable(gitdir . '/' . ref) - return get(readfile(gitdir . '/' . ref), 0, '') - endif - - if filereadable(gitdir . '/packed-refs') - for line in readfile(gitdir . '/packed-refs') - if line =~# ' ' . ref - return matchstr(line, '^[0-9a-f]*') - endif - endfor - endif - - return '' -endfunction - -function! s:git_local_branch(dir) abort - let gitdir = s:git_dir(a:dir) - let head = gitdir . '/HEAD' - if empty(gitdir) || !filereadable(head) - return '' - endif - let branch = matchstr(get(readfile(head), 0, ''), '^ref: refs/heads/\zs.*') - return len(branch) ? branch : 'HEAD' -endfunction - -function! s:git_origin_branch(spec) - if len(a:spec.branch) - return a:spec.branch - endif - - " The file may not be present if this is a local repository - let gitdir = s:git_dir(a:spec.dir) - let origin_head = gitdir.'/refs/remotes/origin/HEAD' - if len(gitdir) && filereadable(origin_head) - return matchstr(get(readfile(origin_head), 0, ''), - \ '^ref: refs/remotes/origin/\zs.*') - endif - - " The command may not return the name of a branch in detached HEAD state - let result = s:lines(s:system('git symbolic-ref --short HEAD', a:spec.dir)) - return v:shell_error ? '' : result[-1] -endfunction - -if s:is_win - function! s:plug_call(fn, ...) - let shellslash = &shellslash - try - set noshellslash - return call(a:fn, a:000) - finally - let &shellslash = shellslash - endtry - endfunction -else - function! s:plug_call(fn, ...) - return call(a:fn, a:000) - endfunction -endif - -function! s:plug_getcwd() - return s:plug_call('getcwd') -endfunction - -function! s:plug_fnamemodify(fname, mods) - return s:plug_call('fnamemodify', a:fname, a:mods) -endfunction - -function! s:plug_expand(fmt) - return s:plug_call('expand', a:fmt, 1) -endfunction - -function! s:plug_tempname() - return s:plug_call('tempname') -endfunction - -function! plug#begin(...) - if a:0 > 0 - let s:plug_home_org = a:1 - let home = s:path(s:plug_fnamemodify(s:plug_expand(a:1), ':p')) - elseif exists('g:plug_home') - let home = s:path(g:plug_home) - elseif has('nvim') - let home = stdpath('data') . '/plugged' - elseif !empty(&rtp) - let home = s:path(split(&rtp, ',')[0]) . '/plugged' - else - return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.') - endif - if s:plug_fnamemodify(home, ':t') ==# 'plugin' && s:plug_fnamemodify(home, ':h') ==# s:first_rtp - return s:err('Invalid plug home. '.home.' is a standard Vim runtime path and is not allowed.') - endif - - let g:plug_home = home - let g:plugs = {} - let g:plugs_order = [] - let s:triggers = {} - - call s:define_commands() - return 1 -endfunction - -function! s:define_commands() - command! -nargs=+ -bar Plug call plug#() - if !executable('git') - return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') - endif - if has('win32') - \ && &shellslash - \ && (&shell =~# 'cmd\(\.exe\)\?$' || s:is_powershell(&shell)) - return s:err('vim-plug does not support shell, ' . &shell . ', when shellslash is set.') - endif - if !has('nvim') - \ && (has('win32') || has('win32unix')) - \ && !has('multi_byte') - return s:err('Vim needs +multi_byte feature on Windows to run shell commands. Enable +iconv for best results.') - endif - command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install(0, []) - command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update(0, []) - command! -nargs=0 -bar -bang PlugClean call s:clean(0) - command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:esc(s:me) | endif - command! -nargs=0 -bar PlugStatus call s:status() - command! -nargs=0 -bar PlugDiff call s:diff() - command! -nargs=? -bar -bang -complete=file PlugSnapshot call s:snapshot(0, ) -endfunction - -function! s:to_a(v) - return type(a:v) == s:TYPE.list ? a:v : [a:v] -endfunction - -function! s:to_s(v) - return type(a:v) == s:TYPE.string ? a:v : join(a:v, "\n") . "\n" -endfunction - -function! s:glob(from, pattern) - return s:lines(globpath(a:from, a:pattern)) -endfunction - -function! s:source(from, ...) - let found = 0 - for pattern in a:000 - for vim in s:glob(a:from, pattern) - execute 'source' s:esc(vim) - let found = 1 - endfor - endfor - return found -endfunction - -function! s:assoc(dict, key, val) - let a:dict[a:key] = add(get(a:dict, a:key, []), a:val) -endfunction - -function! s:ask(message, ...) - call inputsave() - echohl WarningMsg - let answer = input(a:message.(a:0 ? ' (y/N/a) ' : ' (y/N) ')) - echohl None - call inputrestore() - echo "\r" - return (a:0 && answer =~? '^a') ? 2 : (answer =~? '^y') ? 1 : 0 -endfunction - -function! s:ask_no_interrupt(...) - try - return call('s:ask', a:000) - catch - return 0 - endtry -endfunction - -function! s:lazy(plug, opt) - return has_key(a:plug, a:opt) && - \ (empty(s:to_a(a:plug[a:opt])) || - \ !isdirectory(a:plug.dir) || - \ len(s:glob(s:rtp(a:plug), 'plugin')) || - \ len(s:glob(s:rtp(a:plug), 'after/plugin'))) -endfunction - -function! plug#end() - if !exists('g:plugs') - return s:err('plug#end() called without calling plug#begin() first') - endif - - if exists('#PlugLOD') - augroup PlugLOD - autocmd! - augroup END - augroup! PlugLOD - endif - let lod = { 'ft': {}, 'map': {}, 'cmd': {} } - - if get(g:, 'did_load_filetypes', 0) - filetype off - endif - for name in g:plugs_order - if !has_key(g:plugs, name) - continue - endif - let plug = g:plugs[name] - if get(s:loaded, name, 0) || !s:lazy(plug, 'on') && !s:lazy(plug, 'for') - let s:loaded[name] = 1 - continue - endif - - if has_key(plug, 'on') - let s:triggers[name] = { 'map': [], 'cmd': [] } - for cmd in s:to_a(plug.on) - if cmd =~? '^.\+' - if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i')) - call s:assoc(lod.map, cmd, name) - endif - call add(s:triggers[name].map, cmd) - elseif cmd =~# '^[A-Z]' - let cmd = substitute(cmd, '!*$', '', '') - if exists(':'.cmd) != 2 - call s:assoc(lod.cmd, cmd, name) - endif - call add(s:triggers[name].cmd, cmd) - else - call s:err('Invalid `on` option: '.cmd. - \ '. Should start with an uppercase letter or ``.') - endif - endfor - endif - - if has_key(plug, 'for') - let types = s:to_a(plug.for) - if !empty(types) - augroup filetypedetect - call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim') - augroup END - endif - for type in types - call s:assoc(lod.ft, type, name) - endfor - endif - endfor - - for [cmd, names] in items(lod.cmd) - execute printf( - \ 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "", , , , %s)', - \ cmd, string(cmd), string(names)) - endfor - - for [map, names] in items(lod.map) - for [mode, map_prefix, key_prefix] in - \ [['i', '', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] - execute printf( - \ '%snoremap %s %s:call lod_map(%s, %s, %s, "%s")', - \ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix) - endfor - endfor - - for [ft, names] in items(lod.ft) - augroup PlugLOD - execute printf('autocmd FileType %s call lod_ft(%s, %s)', - \ ft, string(ft), string(names)) - augroup END - endfor - - call s:reorg_rtp() - filetype plugin indent on - if has('vim_starting') - if has('syntax') && !exists('g:syntax_on') - syntax enable - end - else - call s:reload_plugins() - endif -endfunction - -function! s:loaded_names() - return filter(copy(g:plugs_order), 'get(s:loaded, v:val, 0)') -endfunction - -function! s:load_plugin(spec) - call s:source(s:rtp(a:spec), 'plugin/**/*.vim', 'after/plugin/**/*.vim') -endfunction - -function! s:reload_plugins() - for name in s:loaded_names() - call s:load_plugin(g:plugs[name]) - endfor -endfunction - -function! s:trim(str) - return substitute(a:str, '[\/]\+$', '', '') -endfunction - -function! s:version_requirement(val, min) - for idx in range(0, len(a:min) - 1) - let v = get(a:val, idx, 0) - if v < a:min[idx] | return 0 - elseif v > a:min[idx] | return 1 - endif - endfor - return 1 -endfunction - -function! s:git_version_requirement(...) - if !exists('s:git_version') - let s:git_version = map(split(split(s:system(['git', '--version']))[2], '\.'), 'str2nr(v:val)') - endif - return s:version_requirement(s:git_version, a:000) -endfunction - -function! s:progress_opt(base) - return a:base && !s:is_win && - \ s:git_version_requirement(1, 7, 1) ? '--progress' : '' -endfunction - -function! s:rtp(spec) - return s:path(a:spec.dir . get(a:spec, 'rtp', '')) -endfunction - -if s:is_win - function! s:path(path) - return s:trim(substitute(a:path, '/', '\', 'g')) - endfunction - - function! s:dirpath(path) - return s:path(a:path) . '\' - endfunction - - function! s:is_local_plug(repo) - return a:repo =~? '^[a-z]:\|^[%~]' - endfunction - - " Copied from fzf - function! s:wrap_cmds(cmds) - let cmds = [ - \ '@echo off', - \ 'setlocal enabledelayedexpansion'] - \ + (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) - \ + ['endlocal'] - if has('iconv') - if !exists('s:codepage') - let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0) - endif - return map(cmds, printf('iconv(v:val."\r", "%s", "cp%d")', &encoding, s:codepage)) - endif - return map(cmds, 'v:val."\r"') - endfunction - - function! s:batchfile(cmd) - let batchfile = s:plug_tempname().'.bat' - call writefile(s:wrap_cmds(a:cmd), batchfile) - let cmd = plug#shellescape(batchfile, {'shell': &shell, 'script': 0}) - if s:is_powershell(&shell) - let cmd = '& ' . cmd - endif - return [batchfile, cmd] - endfunction -else - function! s:path(path) - return s:trim(a:path) - endfunction - - function! s:dirpath(path) - return substitute(a:path, '[/\\]*$', '/', '') - endfunction - - function! s:is_local_plug(repo) - return a:repo[0] =~ '[/$~]' - endfunction -endif - -function! s:err(msg) - echohl ErrorMsg - echom '[vim-plug] '.a:msg - echohl None -endfunction - -function! s:warn(cmd, msg) - echohl WarningMsg - execute a:cmd 'a:msg' - echohl None -endfunction - -function! s:esc(path) - return escape(a:path, ' ') -endfunction - -function! s:escrtp(path) - return escape(a:path, ' ,') -endfunction - -function! s:remove_rtp() - for name in s:loaded_names() - let rtp = s:rtp(g:plugs[name]) - execute 'set rtp-='.s:escrtp(rtp) - let after = globpath(rtp, 'after') - if isdirectory(after) - execute 'set rtp-='.s:escrtp(after) - endif - endfor -endfunction - -function! s:reorg_rtp() - if !empty(s:first_rtp) - execute 'set rtp-='.s:first_rtp - execute 'set rtp-='.s:last_rtp - endif - - " &rtp is modified from outside - if exists('s:prtp') && s:prtp !=# &rtp - call s:remove_rtp() - unlet! s:middle - endif - - let s:middle = get(s:, 'middle', &rtp) - let rtps = map(s:loaded_names(), 's:rtp(g:plugs[v:val])') - let afters = filter(map(copy(rtps), 'globpath(v:val, "after")'), '!empty(v:val)') - let rtp = join(map(rtps, 'escape(v:val, ",")'), ',') - \ . ','.s:middle.',' - \ . join(map(afters, 'escape(v:val, ",")'), ',') - let &rtp = substitute(substitute(rtp, ',,*', ',', 'g'), '^,\|,$', '', 'g') - let s:prtp = &rtp - - if !empty(s:first_rtp) - execute 'set rtp^='.s:first_rtp - execute 'set rtp+='.s:last_rtp - endif -endfunction - -function! s:doautocmd(...) - if exists('#'.join(a:000, '#')) - execute 'doautocmd' ((v:version > 703 || has('patch442')) ? '' : '') join(a:000) - endif -endfunction - -function! s:dobufread(names) - for name in a:names - let path = s:rtp(g:plugs[name]) - for dir in ['ftdetect', 'ftplugin', 'after/ftdetect', 'after/ftplugin'] - if len(finddir(dir, path)) - if exists('#BufRead') - doautocmd BufRead - endif - return - endif - endfor - endfor -endfunction - -function! plug#load(...) - if a:0 == 0 - return s:err('Argument missing: plugin name(s) required') - endif - if !exists('g:plugs') - return s:err('plug#begin was not called') - endif - let names = a:0 == 1 && type(a:1) == s:TYPE.list ? a:1 : a:000 - let unknowns = filter(copy(names), '!has_key(g:plugs, v:val)') - if !empty(unknowns) - let s = len(unknowns) > 1 ? 's' : '' - return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', '))) - end - let unloaded = filter(copy(names), '!get(s:loaded, v:val, 0)') - if !empty(unloaded) - for name in unloaded - call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - endfor - call s:dobufread(unloaded) - return 1 - end - return 0 -endfunction - -function! s:remove_triggers(name) - if !has_key(s:triggers, a:name) - return - endif - for cmd in s:triggers[a:name].cmd - execute 'silent! delc' cmd - endfor - for map in s:triggers[a:name].map - execute 'silent! unmap' map - execute 'silent! iunmap' map - endfor - call remove(s:triggers, a:name) -endfunction - -function! s:lod(names, types, ...) - for name in a:names - call s:remove_triggers(name) - let s:loaded[name] = 1 - endfor - call s:reorg_rtp() - - for name in a:names - let rtp = s:rtp(g:plugs[name]) - for dir in a:types - call s:source(rtp, dir.'/**/*.vim') - endfor - if a:0 - if !s:source(rtp, a:1) && !empty(s:glob(rtp, a:2)) - execute 'runtime' a:1 - endif - call s:source(rtp, a:2) - endif - call s:doautocmd('User', name) - endfor -endfunction - -function! s:lod_ft(pat, names) - let syn = 'syntax/'.a:pat.'.vim' - call s:lod(a:names, ['plugin', 'after/plugin'], syn, 'after/'.syn) - execute 'autocmd! PlugLOD FileType' a:pat - call s:doautocmd('filetypeplugin', 'FileType') - call s:doautocmd('filetypeindent', 'FileType') -endfunction - -function! s:lod_cmd(cmd, bang, l1, l2, args, names) - call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - call s:dobufread(a:names) - execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) -endfunction - -function! s:lod_map(map, names, with_prefix, prefix) - call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - call s:dobufread(a:names) - let extra = '' - while 1 - let c = getchar(0) - if c == 0 - break - endif - let extra .= nr2char(c) - endwhile - - if a:with_prefix - let prefix = v:count ? v:count : '' - let prefix .= '"'.v:register.a:prefix - if mode(1) == 'no' - if v:operator == 'c' - let prefix = "\" . prefix - endif - let prefix .= v:operator - endif - call feedkeys(prefix, 'n') - endif - call feedkeys(substitute(a:map, '^', "\", '') . extra) -endfunction - -function! plug#(repo, ...) - if a:0 > 1 - return s:err('Invalid number of arguments (1..2)') - endif - - try - let repo = s:trim(a:repo) - let opts = a:0 == 1 ? s:parse_options(a:1) : s:base_spec - let name = get(opts, 'as', s:plug_fnamemodify(repo, ':t:s?\.git$??')) - let spec = extend(s:infer_properties(name, repo), opts) - if !has_key(g:plugs, name) - call add(g:plugs_order, name) - endif - let g:plugs[name] = spec - let s:loaded[name] = get(s:loaded, name, 0) - catch - return s:err(repo . ' ' . v:exception) - endtry -endfunction - -function! s:parse_options(arg) - let opts = copy(s:base_spec) - let type = type(a:arg) - let opt_errfmt = 'Invalid argument for "%s" option of :Plug (expected: %s)' - if type == s:TYPE.string - if empty(a:arg) - throw printf(opt_errfmt, 'tag', 'string') - endif - let opts.tag = a:arg - elseif type == s:TYPE.dict - for opt in ['branch', 'tag', 'commit', 'rtp', 'dir', 'as'] - if has_key(a:arg, opt) - \ && (type(a:arg[opt]) != s:TYPE.string || empty(a:arg[opt])) - throw printf(opt_errfmt, opt, 'string') - endif - endfor - for opt in ['on', 'for'] - if has_key(a:arg, opt) - \ && type(a:arg[opt]) != s:TYPE.list - \ && (type(a:arg[opt]) != s:TYPE.string || empty(a:arg[opt])) - throw printf(opt_errfmt, opt, 'string or list') - endif - endfor - if has_key(a:arg, 'do') - \ && type(a:arg.do) != s:TYPE.funcref - \ && (type(a:arg.do) != s:TYPE.string || empty(a:arg.do)) - throw printf(opt_errfmt, 'do', 'string or funcref') - endif - call extend(opts, a:arg) - if has_key(opts, 'dir') - let opts.dir = s:dirpath(s:plug_expand(opts.dir)) - endif - else - throw 'Invalid argument type (expected: string or dictionary)' - endif - return opts -endfunction - -function! s:infer_properties(name, repo) - let repo = a:repo - if s:is_local_plug(repo) - return { 'dir': s:dirpath(s:plug_expand(repo)) } - else - if repo =~ ':' - let uri = repo - else - if repo !~ '/' - throw printf('Invalid argument: %s (implicit `vim-scripts'' expansion is deprecated)', repo) - endif - let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git') - let uri = printf(fmt, repo) - endif - return { 'dir': s:dirpath(g:plug_home.'/'.a:name), 'uri': uri } - endif -endfunction - -function! s:install(force, names) - call s:update_impl(0, a:force, a:names) -endfunction - -function! s:update(force, names) - call s:update_impl(1, a:force, a:names) -endfunction - -function! plug#helptags() - if !exists('g:plugs') - return s:err('plug#begin was not called') - endif - for spec in values(g:plugs) - let docd = join([s:rtp(spec), 'doc'], '/') - if isdirectory(docd) - silent! execute 'helptags' s:esc(docd) - endif - endfor - return 1 -endfunction - -function! s:syntax() - syntax clear - syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber - syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX - syn match plugNumber /[0-9]\+[0-9.]*/ contained - syn match plugBracket /[[\]]/ contained - syn match plugX /x/ contained - syn match plugDash /^-\{1}\ / - syn match plugPlus /^+/ - syn match plugStar /^*/ - syn match plugMessage /\(^- \)\@<=.*/ - syn match plugName /\(^- \)\@<=[^ ]*:/ - syn match plugSha /\%(: \)\@<=[0-9a-f]\{4,}$/ - syn match plugTag /(tag: [^)]\+)/ - syn match plugInstall /\(^+ \)\@<=[^:]*/ - syn match plugUpdate /\(^* \)\@<=[^:]*/ - syn match plugCommit /^ \X*[0-9a-f]\{7,9} .*/ contains=plugRelDate,plugEdge,plugTag - syn match plugEdge /^ \X\+$/ - syn match plugEdge /^ \X*/ contained nextgroup=plugSha - syn match plugSha /[0-9a-f]\{7,9}/ contained - syn match plugRelDate /([^)]*)$/ contained - syn match plugNotLoaded /(not loaded)$/ - syn match plugError /^x.*/ - syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/ - syn match plugH2 /^.*:\n-\+$/ - syn match plugH2 /^-\{2,}/ - syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean - hi def link plug1 Title - hi def link plug2 Repeat - hi def link plugH2 Type - hi def link plugX Exception - hi def link plugBracket Structure - hi def link plugNumber Number - - hi def link plugDash Special - hi def link plugPlus Constant - hi def link plugStar Boolean - - hi def link plugMessage Function - hi def link plugName Label - hi def link plugInstall Function - hi def link plugUpdate Type - - hi def link plugError Error - hi def link plugDeleted Ignore - hi def link plugRelDate Comment - hi def link plugEdge PreProc - hi def link plugSha Identifier - hi def link plugTag Constant - - hi def link plugNotLoaded Comment -endfunction - -function! s:lpad(str, len) - return a:str . repeat(' ', a:len - len(a:str)) -endfunction - -function! s:lines(msg) - return split(a:msg, "[\r\n]") -endfunction - -function! s:lastline(msg) - return get(s:lines(a:msg), -1, '') -endfunction - -function! s:new_window() - execute get(g:, 'plug_window', 'vertical topleft new') -endfunction - -function! s:plug_window_exists() - let buflist = tabpagebuflist(s:plug_tab) - return !empty(buflist) && index(buflist, s:plug_buf) >= 0 -endfunction - -function! s:switch_in() - if !s:plug_window_exists() - return 0 - endif - - if winbufnr(0) != s:plug_buf - let s:pos = [tabpagenr(), winnr(), winsaveview()] - execute 'normal!' s:plug_tab.'gt' - let winnr = bufwinnr(s:plug_buf) - execute winnr.'wincmd w' - call add(s:pos, winsaveview()) - else - let s:pos = [winsaveview()] - endif - - setlocal modifiable - return 1 -endfunction - -function! s:switch_out(...) - call winrestview(s:pos[-1]) - setlocal nomodifiable - if a:0 > 0 - execute a:1 - endif - - if len(s:pos) > 1 - execute 'normal!' s:pos[0].'gt' - execute s:pos[1] 'wincmd w' - call winrestview(s:pos[2]) - endif -endfunction - -function! s:finish_bindings() - nnoremap R :call retry() - nnoremap D :PlugDiff - nnoremap S :PlugStatus - nnoremap U :call status_update() - xnoremap U :call status_update() - nnoremap ]] :silent! call section('') - nnoremap [[ :silent! call section('b') -endfunction - -function! s:prepare(...) - if empty(s:plug_getcwd()) - throw 'Invalid current working directory. Cannot proceed.' - endif - - for evar in ['$GIT_DIR', '$GIT_WORK_TREE'] - if exists(evar) - throw evar.' detected. Cannot proceed.' - endif - endfor - - call s:job_abort() - if s:switch_in() - if b:plug_preview == 1 - pc - endif - enew - else - call s:new_window() - endif - - nnoremap q :call close_pane() - if a:0 == 0 - call s:finish_bindings() - endif - let b:plug_preview = -1 - let s:plug_tab = tabpagenr() - let s:plug_buf = winbufnr(0) - call s:assign_name() - - for k in ['', 'L', 'o', 'X', 'd', 'dd'] - execute 'silent! unmap ' k - endfor - setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline modifiable nospell - if exists('+colorcolumn') - setlocal colorcolumn= - endif - setf vim-plug - if exists('g:syntax_on') - call s:syntax() - endif -endfunction - -function! s:close_pane() - if b:plug_preview == 1 - pc - let b:plug_preview = -1 - else - bd - endif -endfunction - -function! s:assign_name() - " Assign buffer name - let prefix = '[Plugins]' - let name = prefix - let idx = 2 - while bufexists(name) - let name = printf('%s (%s)', prefix, idx) - let idx = idx + 1 - endwhile - silent! execute 'f' fnameescape(name) -endfunction - -function! s:chsh(swap) - let prev = [&shell, &shellcmdflag, &shellredir] - if !s:is_win - set shell=sh - endif - if a:swap - if s:is_powershell(&shell) - let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s' - elseif &shell =~# 'sh' || &shell =~# 'cmd\(\.exe\)\?$' - set shellredir=>%s\ 2>&1 - endif - endif - return prev -endfunction - -function! s:bang(cmd, ...) - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(a:0) - " FIXME: Escaping is incomplete. We could use shellescape with eval, - " but it won't work on Windows. - let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd - if s:is_win - let [batchfile, cmd] = s:batchfile(cmd) - endif - let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%') - execute "normal! :execute g:_plug_bang\\" - finally - unlet g:_plug_bang - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry - return v:shell_error ? 'Exit status: ' . v:shell_error : '' -endfunction - -function! s:regress_bar() - let bar = substitute(getline(2)[1:-2], '.*\zs=', 'x', '') - call s:progress_bar(2, bar, len(bar)) -endfunction - -function! s:is_updated(dir) - return !empty(s:system_chomp(['git', 'log', '--pretty=format:%h', 'HEAD...HEAD@{1}'], a:dir)) -endfunction - -function! s:do(pull, force, todo) - for [name, spec] in items(a:todo) - if !isdirectory(spec.dir) - continue - endif - let installed = has_key(s:update.new, name) - let updated = installed ? 0 : - \ (a:pull && index(s:update.errors, name) < 0 && s:is_updated(spec.dir)) - if a:force || installed || updated - execute 'cd' s:esc(spec.dir) - call append(3, '- Post-update hook for '. name .' ... ') - let error = '' - let type = type(spec.do) - if type == s:TYPE.string - if spec.do[0] == ':' - if !get(s:loaded, name, 0) - let s:loaded[name] = 1 - call s:reorg_rtp() - endif - call s:load_plugin(spec) - try - execute spec.do[1:] - catch - let error = v:exception - endtry - if !s:plug_window_exists() - cd - - throw 'Warning: vim-plug was terminated by the post-update hook of '.name - endif - else - let error = s:bang(spec.do) - endif - elseif type == s:TYPE.funcref - try - call s:load_plugin(spec) - let status = installed ? 'installed' : (updated ? 'updated' : 'unchanged') - call spec.do({ 'name': name, 'status': status, 'force': a:force }) - catch - let error = v:exception - endtry - else - let error = 'Invalid hook type' - endif - call s:switch_in() - call setline(4, empty(error) ? (getline(4) . 'OK') - \ : ('x' . getline(4)[1:] . error)) - if !empty(error) - call add(s:update.errors, name) - call s:regress_bar() - endif - cd - - endif - endfor -endfunction - -function! s:hash_match(a, b) - return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0 -endfunction - -function! s:checkout(spec) - let sha = a:spec.commit - let output = s:git_revision(a:spec.dir) - if !empty(output) && !s:hash_match(sha, s:lines(output)[0]) - let credential_helper = s:git_version_requirement(2) ? '-c credential.helper= ' : '' - let output = s:system( - \ 'git '.credential_helper.'fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) - endif - return output -endfunction - -function! s:finish(pull) - let new_frozen = len(filter(keys(s:update.new), 'g:plugs[v:val].frozen')) - if new_frozen - let s = new_frozen > 1 ? 's' : '' - call append(3, printf('- Installed %d frozen plugin%s', new_frozen, s)) - endif - call append(3, '- Finishing ... ') | 4 - redraw - call plug#helptags() - call plug#end() - call setline(4, getline(4) . 'Done!') - redraw - let msgs = [] - if !empty(s:update.errors) - call add(msgs, "Press 'R' to retry.") - endif - if a:pull && len(s:update.new) < len(filter(getline(5, '$'), - \ "v:val =~ '^- ' && v:val !~# 'Already up.to.date'")) - call add(msgs, "Press 'D' to see the updated changes.") - endif - echo join(msgs, ' ') - call s:finish_bindings() -endfunction - -function! s:retry() - if empty(s:update.errors) - return - endif - echo - call s:update_impl(s:update.pull, s:update.force, - \ extend(copy(s:update.errors), [s:update.threads])) -endfunction - -function! s:is_managed(name) - return has_key(g:plugs[a:name], 'uri') -endfunction - -function! s:names(...) - return sort(filter(keys(g:plugs), 'stridx(v:val, a:1) == 0 && s:is_managed(v:val)')) -endfunction - -function! s:check_ruby() - silent! ruby require 'thread'; VIM::command("let g:plug_ruby = '#{RUBY_VERSION}'") - if !exists('g:plug_ruby') - redraw! - return s:warn('echom', 'Warning: Ruby interface is broken') - endif - let ruby_version = split(g:plug_ruby, '\.') - unlet g:plug_ruby - return s:version_requirement(ruby_version, [1, 8, 7]) -endfunction - -function! s:update_impl(pull, force, args) abort - let sync = index(a:args, '--sync') >= 0 || has('vim_starting') - let args = filter(copy(a:args), 'v:val != "--sync"') - let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ? - \ remove(args, -1) : get(g:, 'plug_threads', 16) - - let managed = filter(copy(g:plugs), 's:is_managed(v:key)') - let todo = empty(args) ? filter(managed, '!v:val.frozen || !isdirectory(v:val.dir)') : - \ filter(managed, 'index(args, v:key) >= 0') - - if empty(todo) - return s:warn('echo', 'No plugin to '. (a:pull ? 'update' : 'install')) - endif - - if !s:is_win && s:git_version_requirement(2, 3) - let s:git_terminal_prompt = exists('$GIT_TERMINAL_PROMPT') ? $GIT_TERMINAL_PROMPT : '' - let $GIT_TERMINAL_PROMPT = 0 - for plug in values(todo) - let plug.uri = substitute(plug.uri, - \ '^https://git::@github\.com', 'https://github.com', '') - endfor - endif - - if !isdirectory(g:plug_home) - try - call mkdir(g:plug_home, 'p') - catch - return s:err(printf('Invalid plug directory: %s. '. - \ 'Try to call plug#begin with a valid directory', g:plug_home)) - endtry - endif - - if has('nvim') && !exists('*jobwait') && threads > 1 - call s:warn('echom', '[vim-plug] Update Neovim for parallel installer') - endif - - let use_job = s:nvim || s:vim8 - let python = (has('python') || has('python3')) && !use_job - let ruby = has('ruby') && !use_job && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running')) && threads > 1 && s:check_ruby() - - let s:update = { - \ 'start': reltime(), - \ 'all': todo, - \ 'todo': copy(todo), - \ 'errors': [], - \ 'pull': a:pull, - \ 'force': a:force, - \ 'new': {}, - \ 'threads': (python || ruby || use_job) ? min([len(todo), threads]) : 1, - \ 'bar': '', - \ 'fin': 0 - \ } - - call s:prepare(1) - call append(0, ['', '']) - normal! 2G - silent! redraw - - " Set remote name, overriding a possible user git config's clone.defaultRemoteName - let s:clone_opt = ['--origin', 'origin'] - if get(g:, 'plug_shallow', 1) - call extend(s:clone_opt, ['--depth', '1']) - if s:git_version_requirement(1, 7, 10) - call add(s:clone_opt, '--no-single-branch') - endif - endif - - if has('win32unix') || has('wsl') - call extend(s:clone_opt, ['-c', 'core.eol=lf', '-c', 'core.autocrlf=input']) - endif - - let s:submodule_opt = s:git_version_requirement(2, 8) ? ' --jobs='.threads : '' - - " Python version requirement (>= 2.7) - if python && !has('python3') && !ruby && !use_job && s:update.threads > 1 - redir => pyv - silent python import platform; print platform.python_version() - redir END - let python = s:version_requirement( - \ map(split(split(pyv)[0], '\.'), 'str2nr(v:val)'), [2, 6]) - endif - - if (python || ruby) && s:update.threads > 1 - try - let imd = &imd - if s:mac_gui - set noimd - endif - if ruby - call s:update_ruby() - else - call s:update_python() - endif - catch - let lines = getline(4, '$') - let printed = {} - silent! 4,$d _ - for line in lines - let name = s:extract_name(line, '.', '') - if empty(name) || !has_key(printed, name) - call append('$', line) - if !empty(name) - let printed[name] = 1 - if line[0] == 'x' && index(s:update.errors, name) < 0 - call add(s:update.errors, name) - end - endif - endif - endfor - finally - let &imd = imd - call s:update_finish() - endtry - else - call s:update_vim() - while use_job && sync - sleep 100m - if s:update.fin - break - endif - endwhile - endif -endfunction - -function! s:log4(name, msg) - call setline(4, printf('- %s (%s)', a:msg, a:name)) - redraw -endfunction - -function! s:update_finish() - if exists('s:git_terminal_prompt') - let $GIT_TERMINAL_PROMPT = s:git_terminal_prompt - endif - if s:switch_in() - call append(3, '- Updating ...') | 4 - for [name, spec] in items(filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && (s:update.force || s:update.pull || has_key(s:update.new, v:key))')) - let [pos, _] = s:logpos(name) - if !pos - continue - endif - if has_key(spec, 'commit') - call s:log4(name, 'Checking out '.spec.commit) - let out = s:checkout(spec) - elseif has_key(spec, 'tag') - let tag = spec.tag - if tag =~ '\*' - let tags = s:lines(s:system('git tag --list '.plug#shellescape(tag).' --sort -version:refname 2>&1', spec.dir)) - if !v:shell_error && !empty(tags) - let tag = tags[0] - call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag)) - call append(3, '') - endif - endif - call s:log4(name, 'Checking out '.tag) - let out = s:system('git checkout -q '.plug#shellescape(tag).' -- 2>&1', spec.dir) - else - let branch = s:git_origin_branch(spec) - call s:log4(name, 'Merging origin/'.s:esc(branch)) - let out = s:system('git checkout -q '.plug#shellescape(branch).' -- 2>&1' - \. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only '.plug#shellescape('origin/'.branch).' 2>&1')), spec.dir) - endif - if !v:shell_error && filereadable(spec.dir.'/.gitmodules') && - \ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir)) - call s:log4(name, 'Updating submodules. This may take a while.') - let out .= s:bang('git submodule update --init --recursive'.s:submodule_opt.' 2>&1', spec.dir) - endif - let msg = s:format_message(v:shell_error ? 'x': '-', name, out) - if v:shell_error - call add(s:update.errors, name) - call s:regress_bar() - silent execute pos 'd _' - call append(4, msg) | 4 - elseif !empty(out) - call setline(pos, msg[0]) - endif - redraw - endfor - silent 4 d _ - try - call s:do(s:update.pull, s:update.force, filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && has_key(v:val, "do")')) - catch - call s:warn('echom', v:exception) - call s:warn('echo', '') - return - endtry - call s:finish(s:update.pull) - call setline(1, 'Updated. Elapsed time: ' . split(reltimestr(reltime(s:update.start)))[0] . ' sec.') - call s:switch_out('normal! gg') - endif -endfunction - -function! s:job_abort() - if (!s:nvim && !s:vim8) || !exists('s:jobs') - return - endif - - for [name, j] in items(s:jobs) - if s:nvim - silent! call jobstop(j.jobid) - elseif s:vim8 - silent! call job_stop(j.jobid) - endif - if j.new - call s:rm_rf(g:plugs[name].dir) - endif - endfor - let s:jobs = {} -endfunction - -function! s:last_non_empty_line(lines) - let len = len(a:lines) - for idx in range(len) - let line = a:lines[len-idx-1] - if !empty(line) - return line - endif - endfor - return '' -endfunction - -function! s:job_out_cb(self, data) abort - let self = a:self - let data = remove(self.lines, -1) . a:data - let lines = map(split(data, "\n", 1), 'split(v:val, "\r", 1)[-1]') - call extend(self.lines, lines) - " To reduce the number of buffer updates - let self.tick = get(self, 'tick', -1) + 1 - if !self.running || self.tick % len(s:jobs) == 0 - let bullet = self.running ? (self.new ? '+' : '*') : (self.error ? 'x' : '-') - let result = self.error ? join(self.lines, "\n") : s:last_non_empty_line(self.lines) - call s:log(bullet, self.name, result) - endif -endfunction - -function! s:job_exit_cb(self, data) abort - let a:self.running = 0 - let a:self.error = a:data != 0 - call s:reap(a:self.name) - call s:tick() -endfunction - -function! s:job_cb(fn, job, ch, data) - if !s:plug_window_exists() " plug window closed - return s:job_abort() - endif - call call(a:fn, [a:job, a:data]) -endfunction - -function! s:nvim_cb(job_id, data, event) dict abort - return (a:event == 'stdout' || a:event == 'stderr') ? - \ s:job_cb('s:job_out_cb', self, 0, join(a:data, "\n")) : - \ s:job_cb('s:job_exit_cb', self, 0, a:data) -endfunction - -function! s:spawn(name, cmd, opts) - let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''], - \ 'new': get(a:opts, 'new', 0) } - let s:jobs[a:name] = job - - if s:nvim - if has_key(a:opts, 'dir') - let job.cwd = a:opts.dir - endif - let argv = a:cmd - call extend(job, { - \ 'on_stdout': function('s:nvim_cb'), - \ 'on_stderr': function('s:nvim_cb'), - \ 'on_exit': function('s:nvim_cb'), - \ }) - let jid = s:plug_call('jobstart', argv, job) - if jid > 0 - let job.jobid = jid - else - let job.running = 0 - let job.error = 1 - let job.lines = [jid < 0 ? argv[0].' is not executable' : - \ 'Invalid arguments (or job table is full)'] - endif - elseif s:vim8 - let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"script": 0})')) - if has_key(a:opts, 'dir') - let cmd = s:with_cd(cmd, a:opts.dir, 0) - endif - let argv = s:is_win ? ['cmd', '/s', '/c', '"'.cmd.'"'] : ['sh', '-c', cmd] - let jid = job_start(s:is_win ? join(argv, ' ') : argv, { - \ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]), - \ 'err_cb': function('s:job_cb', ['s:job_out_cb', job]), - \ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]), - \ 'err_mode': 'raw', - \ 'out_mode': 'raw' - \}) - if job_status(jid) == 'run' - let job.jobid = jid - else - let job.running = 0 - let job.error = 1 - let job.lines = ['Failed to start job'] - endif - else - let job.lines = s:lines(call('s:system', has_key(a:opts, 'dir') ? [a:cmd, a:opts.dir] : [a:cmd])) - let job.error = v:shell_error != 0 - let job.running = 0 - endif -endfunction - -function! s:reap(name) - let job = s:jobs[a:name] - if job.error - call add(s:update.errors, a:name) - elseif get(job, 'new', 0) - let s:update.new[a:name] = 1 - endif - let s:update.bar .= job.error ? 'x' : '=' - - let bullet = job.error ? 'x' : '-' - let result = job.error ? join(job.lines, "\n") : s:last_non_empty_line(job.lines) - call s:log(bullet, a:name, empty(result) ? 'OK' : result) - call s:bar() - - call remove(s:jobs, a:name) -endfunction - -function! s:bar() - if s:switch_in() - let total = len(s:update.all) - call setline(1, (s:update.pull ? 'Updating' : 'Installing'). - \ ' plugins ('.len(s:update.bar).'/'.total.')') - call s:progress_bar(2, s:update.bar, total) - call s:switch_out() - endif -endfunction - -function! s:logpos(name) - let max = line('$') - for i in range(4, max > 4 ? max : 4) - if getline(i) =~# '^[-+x*] '.a:name.':' - for j in range(i + 1, max > 5 ? max : 5) - if getline(j) !~ '^ ' - return [i, j - 1] - endif - endfor - return [i, i] - endif - endfor - return [0, 0] -endfunction - -function! s:log(bullet, name, lines) - if s:switch_in() - let [b, e] = s:logpos(a:name) - if b > 0 - silent execute printf('%d,%d d _', b, e) - if b > winheight('.') - let b = 4 - endif - else - let b = 4 - endif - " FIXME For some reason, nomodifiable is set after :d in vim8 - setlocal modifiable - call append(b - 1, s:format_message(a:bullet, a:name, a:lines)) - call s:switch_out() - endif -endfunction - -function! s:update_vim() - let s:jobs = {} - - call s:bar() - call s:tick() -endfunction - -function! s:tick() - let pull = s:update.pull - let prog = s:progress_opt(s:nvim || s:vim8) -while 1 " Without TCO, Vim stack is bound to explode - if empty(s:update.todo) - if empty(s:jobs) && !s:update.fin - call s:update_finish() - let s:update.fin = 1 - endif - return - endif - - let name = keys(s:update.todo)[0] - let spec = remove(s:update.todo, name) - let new = empty(globpath(spec.dir, '.git', 1)) - - call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...') - redraw - - let has_tag = has_key(spec, 'tag') - if !new - let [error, _] = s:git_validate(spec, 0) - if empty(error) - if pull - let cmd = s:git_version_requirement(2) ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch'] - if has_tag && !empty(globpath(spec.dir, '.git/shallow')) - call extend(cmd, ['--depth', '99999999']) - endif - if !empty(prog) - call add(cmd, prog) - endif - call s:spawn(name, cmd, { 'dir': spec.dir }) - else - let s:jobs[name] = { 'running': 0, 'lines': ['Already installed'], 'error': 0 } - endif - else - let s:jobs[name] = { 'running': 0, 'lines': s:lines(error), 'error': 1 } - endif - else - let cmd = ['git', 'clone'] - if !has_tag - call extend(cmd, s:clone_opt) - endif - if !empty(prog) - call add(cmd, prog) - endif - call s:spawn(name, extend(cmd, [spec.uri, s:trim(spec.dir)]), { 'new': 1 }) - endif - - if !s:jobs[name].running - call s:reap(name) - endif - if len(s:jobs) >= s:update.threads - break - endif -endwhile -endfunction - -function! s:update_python() -let py_exe = has('python') ? 'python' : 'python3' -execute py_exe "<< EOF" -import datetime -import functools -import os -try: - import queue -except ImportError: - import Queue as queue -import random -import re -import shutil -import signal -import subprocess -import tempfile -import threading as thr -import time -import traceback -import vim - -G_NVIM = vim.eval("has('nvim')") == '1' -G_PULL = vim.eval('s:update.pull') == '1' -G_RETRIES = int(vim.eval('get(g:, "plug_retries", 2)')) + 1 -G_TIMEOUT = int(vim.eval('get(g:, "plug_timeout", 60)')) -G_CLONE_OPT = ' '.join(vim.eval('s:clone_opt')) -G_PROGRESS = vim.eval('s:progress_opt(1)') -G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads')) -G_STOP = thr.Event() -G_IS_WIN = vim.eval('s:is_win') == '1' - -class PlugError(Exception): - def __init__(self, msg): - self.msg = msg -class CmdTimedOut(PlugError): - pass -class CmdFailed(PlugError): - pass -class InvalidURI(PlugError): - pass -class Action(object): - INSTALL, UPDATE, ERROR, DONE = ['+', '*', 'x', '-'] - -class Buffer(object): - def __init__(self, lock, num_plugs, is_pull): - self.bar = '' - self.event = 'Updating' if is_pull else 'Installing' - self.lock = lock - self.maxy = int(vim.eval('winheight(".")')) - self.num_plugs = num_plugs - - def __where(self, name): - """ Find first line with name in current buffer. Return line num. """ - found, lnum = False, 0 - matcher = re.compile('^[-+x*] {0}:'.format(name)) - for line in vim.current.buffer: - if matcher.search(line) is not None: - found = True - break - lnum += 1 - - if not found: - lnum = -1 - return lnum - - def header(self): - curbuf = vim.current.buffer - curbuf[0] = self.event + ' plugins ({0}/{1})'.format(len(self.bar), self.num_plugs) - - num_spaces = self.num_plugs - len(self.bar) - curbuf[1] = '[{0}{1}]'.format(self.bar, num_spaces * ' ') - - with self.lock: - vim.command('normal! 2G') - vim.command('redraw') - - def write(self, action, name, lines): - first, rest = lines[0], lines[1:] - msg = ['{0} {1}{2}{3}'.format(action, name, ': ' if first else '', first)] - msg.extend([' ' + line for line in rest]) - - try: - if action == Action.ERROR: - self.bar += 'x' - vim.command("call add(s:update.errors, '{0}')".format(name)) - elif action == Action.DONE: - self.bar += '=' - - curbuf = vim.current.buffer - lnum = self.__where(name) - if lnum != -1: # Found matching line num - del curbuf[lnum] - if lnum > self.maxy and action in set([Action.INSTALL, Action.UPDATE]): - lnum = 3 - else: - lnum = 3 - curbuf.append(msg, lnum) - - self.header() - except vim.error: - pass - -class Command(object): - CD = 'cd /d' if G_IS_WIN else 'cd' - - def __init__(self, cmd, cmd_dir=None, timeout=60, cb=None, clean=None): - self.cmd = cmd - if cmd_dir: - self.cmd = '{0} {1} && {2}'.format(Command.CD, cmd_dir, self.cmd) - self.timeout = timeout - self.callback = cb if cb else (lambda msg: None) - self.clean = clean if clean else (lambda: None) - self.proc = None - - @property - def alive(self): - """ Returns true only if command still running. """ - return self.proc and self.proc.poll() is None - - def execute(self, ntries=3): - """ Execute the command with ntries if CmdTimedOut. - Returns the output of the command if no Exception. - """ - attempt, finished, limit = 0, False, self.timeout - - while not finished: - try: - attempt += 1 - result = self.try_command() - finished = True - return result - except CmdTimedOut: - if attempt != ntries: - self.notify_retry() - self.timeout += limit - else: - raise - - def notify_retry(self): - """ Retry required for command, notify user. """ - for count in range(3, 0, -1): - if G_STOP.is_set(): - raise KeyboardInterrupt - msg = 'Timeout. Will retry in {0} second{1} ...'.format( - count, 's' if count != 1 else '') - self.callback([msg]) - time.sleep(1) - self.callback(['Retrying ...']) - - def try_command(self): - """ Execute a cmd & poll for callback. Returns list of output. - Raises CmdFailed -> return code for Popen isn't 0 - Raises CmdTimedOut -> command exceeded timeout without new output - """ - first_line = True - - try: - tfile = tempfile.NamedTemporaryFile(mode='w+b') - preexec_fn = not G_IS_WIN and os.setsid or None - self.proc = subprocess.Popen(self.cmd, stdout=tfile, - stderr=subprocess.STDOUT, - stdin=subprocess.PIPE, shell=True, - preexec_fn=preexec_fn) - thrd = thr.Thread(target=(lambda proc: proc.wait()), args=(self.proc,)) - thrd.start() - - thread_not_started = True - while thread_not_started: - try: - thrd.join(0.1) - thread_not_started = False - except RuntimeError: - pass - - while self.alive: - if G_STOP.is_set(): - raise KeyboardInterrupt - - if first_line or random.random() < G_LOG_PROB: - first_line = False - line = '' if G_IS_WIN else nonblock_read(tfile.name) - if line: - self.callback([line]) - - time_diff = time.time() - os.path.getmtime(tfile.name) - if time_diff > self.timeout: - raise CmdTimedOut(['Timeout!']) - - thrd.join(0.5) - - tfile.seek(0) - result = [line.decode('utf-8', 'replace').rstrip() for line in tfile] - - if self.proc.returncode != 0: - raise CmdFailed([''] + result) - - return result - except: - self.terminate() - raise - - def terminate(self): - """ Terminate process and cleanup. """ - if self.alive: - if G_IS_WIN: - os.kill(self.proc.pid, signal.SIGINT) - else: - os.killpg(self.proc.pid, signal.SIGTERM) - self.clean() - -class Plugin(object): - def __init__(self, name, args, buf_q, lock): - self.name = name - self.args = args - self.buf_q = buf_q - self.lock = lock - self.tag = args.get('tag', 0) - - def manage(self): - try: - if os.path.exists(self.args['dir']): - self.update() - else: - self.install() - with self.lock: - thread_vim_command("let s:update.new['{0}'] = 1".format(self.name)) - except PlugError as exc: - self.write(Action.ERROR, self.name, exc.msg) - except KeyboardInterrupt: - G_STOP.set() - self.write(Action.ERROR, self.name, ['Interrupted!']) - except: - # Any exception except those above print stack trace - msg = 'Trace:\n{0}'.format(traceback.format_exc().rstrip()) - self.write(Action.ERROR, self.name, msg.split('\n')) - raise - - def install(self): - target = self.args['dir'] - if target[-1] == '\\': - target = target[0:-1] - - def clean(target): - def _clean(): - try: - shutil.rmtree(target) - except OSError: - pass - return _clean - - self.write(Action.INSTALL, self.name, ['Installing ...']) - callback = functools.partial(self.write, Action.INSTALL, self.name) - cmd = 'git clone {0} {1} {2} {3} 2>&1'.format( - '' if self.tag else G_CLONE_OPT, G_PROGRESS, self.args['uri'], - esc(target)) - com = Command(cmd, None, G_TIMEOUT, callback, clean(target)) - result = com.execute(G_RETRIES) - self.write(Action.DONE, self.name, result[-1:]) - - def repo_uri(self): - cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url' - command = Command(cmd, self.args['dir'], G_TIMEOUT,) - result = command.execute(G_RETRIES) - return result[-1] - - def update(self): - actual_uri = self.repo_uri() - expect_uri = self.args['uri'] - regex = re.compile(r'^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$') - ma = regex.match(actual_uri) - mb = regex.match(expect_uri) - if ma is None or mb is None or ma.groups() != mb.groups(): - msg = ['', - 'Invalid URI: {0}'.format(actual_uri), - 'Expected {0}'.format(expect_uri), - 'PlugClean required.'] - raise InvalidURI(msg) - - if G_PULL: - self.write(Action.UPDATE, self.name, ['Updating ...']) - callback = functools.partial(self.write, Action.UPDATE, self.name) - fetch_opt = '--depth 99999999' if self.tag and os.path.isfile(os.path.join(self.args['dir'], '.git/shallow')) else '' - cmd = 'git fetch {0} {1} 2>&1'.format(fetch_opt, G_PROGRESS) - com = Command(cmd, self.args['dir'], G_TIMEOUT, callback) - result = com.execute(G_RETRIES) - self.write(Action.DONE, self.name, result[-1:]) - else: - self.write(Action.DONE, self.name, ['Already installed']) - - def write(self, action, name, msg): - self.buf_q.put((action, name, msg)) - -class PlugThread(thr.Thread): - def __init__(self, tname, args): - super(PlugThread, self).__init__() - self.tname = tname - self.args = args - - def run(self): - thr.current_thread().name = self.tname - buf_q, work_q, lock = self.args - - try: - while not G_STOP.is_set(): - name, args = work_q.get_nowait() - plug = Plugin(name, args, buf_q, lock) - plug.manage() - work_q.task_done() - except queue.Empty: - pass - -class RefreshThread(thr.Thread): - def __init__(self, lock): - super(RefreshThread, self).__init__() - self.lock = lock - self.running = True - - def run(self): - while self.running: - with self.lock: - thread_vim_command('noautocmd normal! a') - time.sleep(0.33) - - def stop(self): - self.running = False - -if G_NVIM: - def thread_vim_command(cmd): - vim.session.threadsafe_call(lambda: vim.command(cmd)) -else: - def thread_vim_command(cmd): - vim.command(cmd) - -def esc(name): - return '"' + name.replace('"', '\"') + '"' - -def nonblock_read(fname): - """ Read a file with nonblock flag. Return the last line. """ - fread = os.open(fname, os.O_RDONLY | os.O_NONBLOCK) - buf = os.read(fread, 100000).decode('utf-8', 'replace') - os.close(fread) - - line = buf.rstrip('\r\n') - left = max(line.rfind('\r'), line.rfind('\n')) - if left != -1: - left += 1 - line = line[left:] - - return line - -def main(): - thr.current_thread().name = 'main' - nthreads = int(vim.eval('s:update.threads')) - plugs = vim.eval('s:update.todo') - mac_gui = vim.eval('s:mac_gui') == '1' - - lock = thr.Lock() - buf = Buffer(lock, len(plugs), G_PULL) - buf_q, work_q = queue.Queue(), queue.Queue() - for work in plugs.items(): - work_q.put(work) - - start_cnt = thr.active_count() - for num in range(nthreads): - tname = 'PlugT-{0:02}'.format(num) - thread = PlugThread(tname, (buf_q, work_q, lock)) - thread.start() - if mac_gui: - rthread = RefreshThread(lock) - rthread.start() - - while not buf_q.empty() or thr.active_count() != start_cnt: - try: - action, name, msg = buf_q.get(True, 0.25) - buf.write(action, name, ['OK'] if not msg else msg) - buf_q.task_done() - except queue.Empty: - pass - except KeyboardInterrupt: - G_STOP.set() - - if mac_gui: - rthread.stop() - rthread.join() - -main() -EOF -endfunction - -function! s:update_ruby() - ruby << EOF - module PlugStream - SEP = ["\r", "\n", nil] - def get_line - buffer = '' - loop do - char = readchar rescue return - if SEP.include? char.chr - buffer << $/ - break - else - buffer << char - end - end - buffer - end - end unless defined?(PlugStream) - - def esc arg - %["#{arg.gsub('"', '\"')}"] - end - - def killall pid - pids = [pid] - if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM - pids.each { |pid| Process.kill 'INT', pid.to_i rescue nil } - else - unless `which pgrep 2> /dev/null`.empty? - children = pids - until children.empty? - children = children.map { |pid| - `pgrep -P #{pid}`.lines.map { |l| l.chomp } - }.flatten - pids += children - end - end - pids.each { |pid| Process.kill 'TERM', pid.to_i rescue nil } - end - end - - def compare_git_uri a, b - regex = %r{^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$} - regex.match(a).to_a.drop(1) == regex.match(b).to_a.drop(1) - end - - require 'thread' - require 'fileutils' - require 'timeout' - running = true - iswin = VIM::evaluate('s:is_win').to_i == 1 - pull = VIM::evaluate('s:update.pull').to_i == 1 - base = VIM::evaluate('g:plug_home') - all = VIM::evaluate('s:update.todo') - limit = VIM::evaluate('get(g:, "plug_timeout", 60)') - tries = VIM::evaluate('get(g:, "plug_retries", 2)') + 1 - nthr = VIM::evaluate('s:update.threads').to_i - maxy = VIM::evaluate('winheight(".")').to_i - vim7 = VIM::evaluate('v:version').to_i <= 703 && RUBY_PLATFORM =~ /darwin/ - cd = iswin ? 'cd /d' : 'cd' - tot = VIM::evaluate('len(s:update.todo)') || 0 - bar = '' - skip = 'Already installed' - mtx = Mutex.new - take1 = proc { mtx.synchronize { running && all.shift } } - logh = proc { - cnt = bar.length - $curbuf[1] = "#{pull ? 'Updating' : 'Installing'} plugins (#{cnt}/#{tot})" - $curbuf[2] = '[' + bar.ljust(tot) + ']' - VIM::command('normal! 2G') - VIM::command('redraw') - } - where = proc { |name| (1..($curbuf.length)).find { |l| $curbuf[l] =~ /^[-+x*] #{name}:/ } } - log = proc { |name, result, type| - mtx.synchronize do - ing = ![true, false].include?(type) - bar += type ? '=' : 'x' unless ing - b = case type - when :install then '+' when :update then '*' - when true, nil then '-' else - VIM::command("call add(s:update.errors, '#{name}')") - 'x' - end - result = - if type || type.nil? - ["#{b} #{name}: #{result.lines.to_a.last || 'OK'}"] - elsif result =~ /^Interrupted|^Timeout/ - ["#{b} #{name}: #{result}"] - else - ["#{b} #{name}"] + result.lines.map { |l| " " << l } - end - if lnum = where.call(name) - $curbuf.delete lnum - lnum = 4 if ing && lnum > maxy - end - result.each_with_index do |line, offset| - $curbuf.append((lnum || 4) - 1 + offset, line.gsub(/\e\[./, '').chomp) - end - logh.call - end - } - bt = proc { |cmd, name, type, cleanup| - tried = timeout = 0 - begin - tried += 1 - timeout += limit - fd = nil - data = '' - if iswin - Timeout::timeout(timeout) do - tmp = VIM::evaluate('tempname()') - system("(#{cmd}) > #{tmp}") - data = File.read(tmp).chomp - File.unlink tmp rescue nil - end - else - fd = IO.popen(cmd).extend(PlugStream) - first_line = true - log_prob = 1.0 / nthr - while line = Timeout::timeout(timeout) { fd.get_line } - data << line - log.call name, line.chomp, type if name && (first_line || rand < log_prob) - first_line = false - end - fd.close - end - [$? == 0, data.chomp] - rescue Timeout::Error, Interrupt => e - if fd && !fd.closed? - killall fd.pid - fd.close - end - cleanup.call if cleanup - if e.is_a?(Timeout::Error) && tried < tries - 3.downto(1) do |countdown| - s = countdown > 1 ? 's' : '' - log.call name, "Timeout. Will retry in #{countdown} second#{s} ...", type - sleep 1 - end - log.call name, 'Retrying ...', type - retry - end - [false, e.is_a?(Interrupt) ? "Interrupted!" : "Timeout!"] - end - } - main = Thread.current - threads = [] - watcher = Thread.new { - if vim7 - while VIM::evaluate('getchar(1)') - sleep 0.1 - end - else - require 'io/console' # >= Ruby 1.9 - nil until IO.console.getch == 3.chr - end - mtx.synchronize do - running = false - threads.each { |t| t.raise Interrupt } unless vim7 - end - threads.each { |t| t.join rescue nil } - main.kill - } - refresh = Thread.new { - while true - mtx.synchronize do - break unless running - VIM::command('noautocmd normal! a') - end - sleep 0.2 - end - } if VIM::evaluate('s:mac_gui') == 1 - - clone_opt = VIM::evaluate('s:clone_opt').join(' ') - progress = VIM::evaluate('s:progress_opt(1)') - nthr.times do - mtx.synchronize do - threads << Thread.new { - while pair = take1.call - name = pair.first - dir, uri, tag = pair.last.values_at *%w[dir uri tag] - exists = File.directory? dir - ok, result = - if exists - chdir = "#{cd} #{iswin ? dir : esc(dir)}" - ret, data = bt.call "#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url", nil, nil, nil - current_uri = data.lines.to_a.last - if !ret - if data =~ /^Interrupted|^Timeout/ - [false, data] - else - [false, [data.chomp, "PlugClean required."].join($/)] - end - elsif !compare_git_uri(current_uri, uri) - [false, ["Invalid URI: #{current_uri}", - "Expected: #{uri}", - "PlugClean required."].join($/)] - else - if pull - log.call name, 'Updating ...', :update - fetch_opt = (tag && File.exist?(File.join(dir, '.git/shallow'))) ? '--depth 99999999' : '' - bt.call "#{chdir} && git fetch #{fetch_opt} #{progress} 2>&1", name, :update, nil - else - [true, skip] - end - end - else - d = esc dir.sub(%r{[\\/]+$}, '') - log.call name, 'Installing ...', :install - bt.call "git clone #{clone_opt unless tag} #{progress} #{uri} #{d} 2>&1", name, :install, proc { - FileUtils.rm_rf dir - } - end - mtx.synchronize { VIM::command("let s:update.new['#{name}'] = 1") } if !exists && ok - log.call name, result, ok - end - } if running - end - end - threads.each { |t| t.join rescue nil } - logh.call - refresh.kill if refresh - watcher.kill -EOF -endfunction - -function! s:shellesc_cmd(arg, script) - let escaped = substitute('"'.a:arg.'"', '[&|<>()@^!"]', '^&', 'g') - return substitute(escaped, '%', (a:script ? '%' : '^') . '&', 'g') -endfunction - -function! s:shellesc_ps1(arg) - return "'".substitute(escape(a:arg, '\"'), "'", "''", 'g')."'" -endfunction - -function! s:shellesc_sh(arg) - return "'".substitute(a:arg, "'", "'\\\\''", 'g')."'" -endfunction - -" Escape the shell argument based on the shell. -" Vim and Neovim's shellescape() are insufficient. -" 1. shellslash determines whether to use single/double quotes. -" Double-quote escaping is fragile for cmd.exe. -" 2. It does not work for powershell. -" 3. It does not work for *sh shells if the command is executed -" via cmd.exe (ie. cmd.exe /c sh -c command command_args) -" 4. It does not support batchfile syntax. -" -" Accepts an optional dictionary with the following keys: -" - shell: same as Vim/Neovim 'shell' option. -" If unset, fallback to 'cmd.exe' on Windows or 'sh'. -" - script: If truthy and shell is cmd.exe, escape for batchfile syntax. -function! plug#shellescape(arg, ...) - if a:arg =~# '^[A-Za-z0-9_/:.-]\+$' - return a:arg - endif - let opts = a:0 > 0 && type(a:1) == s:TYPE.dict ? a:1 : {} - let shell = get(opts, 'shell', s:is_win ? 'cmd.exe' : 'sh') - let script = get(opts, 'script', 1) - if shell =~# 'cmd\(\.exe\)\?$' - return s:shellesc_cmd(a:arg, script) - elseif s:is_powershell(shell) - return s:shellesc_ps1(a:arg) - endif - return s:shellesc_sh(a:arg) -endfunction - -function! s:glob_dir(path) - return map(filter(s:glob(a:path, '**'), 'isdirectory(v:val)'), 's:dirpath(v:val)') -endfunction - -function! s:progress_bar(line, bar, total) - call setline(a:line, '[' . s:lpad(a:bar, a:total) . ']') -endfunction - -function! s:compare_git_uri(a, b) - " See `git help clone' - " https:// [user@] github.com[:port] / junegunn/vim-plug [.git] - " [git@] github.com[:port] : junegunn/vim-plug [.git] - " file:// / junegunn/vim-plug [/] - " / junegunn/vim-plug [/] - let pat = '^\%(\w\+://\)\='.'\%([^@/]*@\)\='.'\([^:/]*\%(:[0-9]*\)\=\)'.'[:/]'.'\(.\{-}\)'.'\%(\.git\)\=/\?$' - let ma = matchlist(a:a, pat) - let mb = matchlist(a:b, pat) - return ma[1:2] ==# mb[1:2] -endfunction - -function! s:format_message(bullet, name, message) - if a:bullet != 'x' - return [printf('%s %s: %s', a:bullet, a:name, s:lastline(a:message))] - else - let lines = map(s:lines(a:message), '" ".v:val') - return extend([printf('x %s:', a:name)], lines) - endif -endfunction - -function! s:with_cd(cmd, dir, ...) - let script = a:0 > 0 ? a:1 : 1 - return printf('cd%s %s && %s', s:is_win ? ' /d' : '', plug#shellescape(a:dir, {'script': script}), a:cmd) -endfunction - -function! s:system(cmd, ...) - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(1) - if type(a:cmd) == s:TYPE.list - " Neovim's system() supports list argument to bypass the shell - " but it cannot set the working directory for the command. - " Assume that the command does not rely on the shell. - if has('nvim') && a:0 == 0 - return system(a:cmd) - endif - let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"shell": &shell, "script": 0})')) - if s:is_powershell(&shell) - let cmd = '& ' . cmd - endif - else - let cmd = a:cmd - endif - if a:0 > 0 - let cmd = s:with_cd(cmd, a:1, type(a:cmd) != s:TYPE.list) - endif - if s:is_win && type(a:cmd) != s:TYPE.list - let [batchfile, cmd] = s:batchfile(cmd) - endif - return system(cmd) - finally - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry -endfunction - -function! s:system_chomp(...) - let ret = call('s:system', a:000) - return v:shell_error ? '' : substitute(ret, '\n$', '', '') -endfunction - -function! s:git_validate(spec, check_branch) - let err = '' - if isdirectory(a:spec.dir) - let result = [s:git_local_branch(a:spec.dir), s:git_origin_url(a:spec.dir)] - let remote = result[-1] - if empty(remote) - let err = join([remote, 'PlugClean required.'], "\n") - elseif !s:compare_git_uri(remote, a:spec.uri) - let err = join(['Invalid URI: '.remote, - \ 'Expected: '.a:spec.uri, - \ 'PlugClean required.'], "\n") - elseif a:check_branch && has_key(a:spec, 'commit') - let sha = s:git_revision(a:spec.dir) - if empty(sha) - let err = join(add(result, 'PlugClean required.'), "\n") - elseif !s:hash_match(sha, a:spec.commit) - let err = join([printf('Invalid HEAD (expected: %s, actual: %s)', - \ a:spec.commit[:6], sha[:6]), - \ 'PlugUpdate required.'], "\n") - endif - elseif a:check_branch - let current_branch = result[0] - " Check tag - let origin_branch = s:git_origin_branch(a:spec) - if has_key(a:spec, 'tag') - let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir) - if a:spec.tag !=# tag && a:spec.tag !~ '\*' - let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.', - \ (empty(tag) ? 'N/A' : tag), a:spec.tag) - endif - " Check branch - elseif origin_branch !=# current_branch - let err = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.', - \ current_branch, origin_branch) - endif - if empty(err) - let [ahead, behind] = split(s:lastline(s:system([ - \ 'git', 'rev-list', '--count', '--left-right', - \ printf('HEAD...origin/%s', origin_branch) - \ ], a:spec.dir)), '\t') - if !v:shell_error && ahead - if behind - " Only mention PlugClean if diverged, otherwise it's likely to be - " pushable (and probably not that messed up). - let err = printf( - \ "Diverged from origin/%s (%d commit(s) ahead and %d commit(s) behind!\n" - \ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', origin_branch, ahead, behind) - else - let err = printf("Ahead of origin/%s by %d commit(s).\n" - \ .'Cannot update until local changes are pushed.', - \ origin_branch, ahead) - endif - endif - endif - endif - else - let err = 'Not found' - endif - return [err, err =~# 'PlugClean'] -endfunction - -function! s:rm_rf(dir) - if isdirectory(a:dir) - return s:system(s:is_win - \ ? 'rmdir /S /Q '.plug#shellescape(a:dir) - \ : ['rm', '-rf', a:dir]) - endif -endfunction - -function! s:clean(force) - call s:prepare() - call append(0, 'Searching for invalid plugins in '.g:plug_home) - call append(1, '') - - " List of valid directories - let dirs = [] - let errs = {} - let [cnt, total] = [0, len(g:plugs)] - for [name, spec] in items(g:plugs) - if !s:is_managed(name) - call add(dirs, spec.dir) - else - let [err, clean] = s:git_validate(spec, 1) - if clean - let errs[spec.dir] = s:lines(err)[0] - else - call add(dirs, spec.dir) - endif - endif - let cnt += 1 - call s:progress_bar(2, repeat('=', cnt), total) - normal! 2G - redraw - endfor - - let allowed = {} - for dir in dirs - let allowed[s:dirpath(s:plug_fnamemodify(dir, ':h:h'))] = 1 - let allowed[dir] = 1 - for child in s:glob_dir(dir) - let allowed[child] = 1 - endfor - endfor - - let todo = [] - let found = sort(s:glob_dir(g:plug_home)) - while !empty(found) - let f = remove(found, 0) - if !has_key(allowed, f) && isdirectory(f) - call add(todo, f) - call append(line('$'), '- ' . f) - if has_key(errs, f) - call append(line('$'), ' ' . errs[f]) - endif - let found = filter(found, 'stridx(v:val, f) != 0') - end - endwhile - - 4 - redraw - if empty(todo) - call append(line('$'), 'Already clean.') - else - let s:clean_count = 0 - call append(3, ['Directories to delete:', '']) - redraw! - if a:force || s:ask_no_interrupt('Delete all directories?') - call s:delete([6, line('$')], 1) - else - call setline(4, 'Cancelled.') - nnoremap d :set opfunc=delete_opg@ - nmap dd d_ - xnoremap d :call delete_op(visualmode(), 1) - echo 'Delete the lines (d{motion}) to delete the corresponding directories' - endif - endif - 4 - setlocal nomodifiable -endfunction - -function! s:delete_op(type, ...) - call s:delete(a:0 ? [line("'<"), line("'>")] : [line("'["), line("']")], 0) -endfunction - -function! s:delete(range, force) - let [l1, l2] = a:range - let force = a:force - let err_count = 0 - while l1 <= l2 - let line = getline(l1) - if line =~ '^- ' && isdirectory(line[2:]) - execute l1 - redraw! - let answer = force ? 1 : s:ask('Delete '.line[2:].'?', 1) - let force = force || answer > 1 - if answer - let err = s:rm_rf(line[2:]) - setlocal modifiable - if empty(err) - call setline(l1, '~'.line[1:]) - let s:clean_count += 1 - else - delete _ - call append(l1 - 1, s:format_message('x', line[1:], err)) - let l2 += len(s:lines(err)) - let err_count += 1 - endif - let msg = printf('Removed %d directories.', s:clean_count) - if err_count > 0 - let msg .= printf(' Failed to remove %d directories.', err_count) - endif - call setline(4, msg) - setlocal nomodifiable - endif - endif - let l1 += 1 - endwhile -endfunction - -function! s:upgrade() - echo 'Downloading the latest version of vim-plug' - redraw - let tmp = s:plug_tempname() - let new = tmp . '/plug.vim' - - try - let out = s:system(['git', 'clone', '--depth', '1', s:plug_src, tmp]) - if v:shell_error - return s:err('Error upgrading vim-plug: '. out) - endif - - if readfile(s:me) ==# readfile(new) - echo 'vim-plug is already up-to-date' - return 0 - else - call rename(s:me, s:me . '.old') - call rename(new, s:me) - unlet g:loaded_plug - echo 'vim-plug has been upgraded' - return 1 - endif - finally - silent! call s:rm_rf(tmp) - endtry -endfunction - -function! s:upgrade_specs() - for spec in values(g:plugs) - let spec.frozen = get(spec, 'frozen', 0) - endfor -endfunction - -function! s:status() - call s:prepare() - call append(0, 'Checking plugins') - call append(1, '') - - let ecnt = 0 - let unloaded = 0 - let [cnt, total] = [0, len(g:plugs)] - for [name, spec] in items(g:plugs) - let is_dir = isdirectory(spec.dir) - if has_key(spec, 'uri') - if is_dir - let [err, _] = s:git_validate(spec, 1) - let [valid, msg] = [empty(err), empty(err) ? 'OK' : err] - else - let [valid, msg] = [0, 'Not found. Try PlugInstall.'] - endif - else - if is_dir - let [valid, msg] = [1, 'OK'] - else - let [valid, msg] = [0, 'Not found.'] - endif - endif - let cnt += 1 - let ecnt += !valid - " `s:loaded` entry can be missing if PlugUpgraded - if is_dir && get(s:loaded, name, -1) == 0 - let unloaded = 1 - let msg .= ' (not loaded)' - endif - call s:progress_bar(2, repeat('=', cnt), total) - call append(3, s:format_message(valid ? '-' : 'x', name, msg)) - normal! 2G - redraw - endfor - call setline(1, 'Finished. '.ecnt.' error(s).') - normal! gg - setlocal nomodifiable - if unloaded - echo "Press 'L' on each line to load plugin, or 'U' to update" - nnoremap L :call status_load(line('.')) - xnoremap L :call status_load(line('.')) - end -endfunction - -function! s:extract_name(str, prefix, suffix) - return matchstr(a:str, '^'.a:prefix.' \zs[^:]\+\ze:.*'.a:suffix.'$') -endfunction - -function! s:status_load(lnum) - let line = getline(a:lnum) - let name = s:extract_name(line, '-', '(not loaded)') - if !empty(name) - call plug#load(name) - setlocal modifiable - call setline(a:lnum, substitute(line, ' (not loaded)$', '', '')) - setlocal nomodifiable - endif -endfunction - -function! s:status_update() range - let lines = getline(a:firstline, a:lastline) - let names = filter(map(lines, 's:extract_name(v:val, "[x-]", "")'), '!empty(v:val)') - if !empty(names) - echo - execute 'PlugUpdate' join(names) - endif -endfunction - -function! s:is_preview_window_open() - silent! wincmd P - if &previewwindow - wincmd p - return 1 - endif -endfunction - -function! s:find_name(lnum) - for lnum in reverse(range(1, a:lnum)) - let line = getline(lnum) - if empty(line) - return '' - endif - let name = s:extract_name(line, '-', '') - if !empty(name) - return name - endif - endfor - return '' -endfunction - -function! s:preview_commit() - if b:plug_preview < 0 - let b:plug_preview = !s:is_preview_window_open() - endif - - let sha = matchstr(getline('.'), '^ \X*\zs[0-9a-f]\{7,9}') - if empty(sha) - let name = matchstr(getline('.'), '^- \zs[^:]*\ze:$') - if empty(name) - return - endif - let title = 'HEAD@{1}..' - let command = 'git diff --no-color HEAD@{1}' - else - let title = sha - let command = 'git show --no-color --pretty=medium '.sha - let name = s:find_name(line('.')) - endif - - if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir) - return - endif - - if exists('g:plug_pwindow') && !s:is_preview_window_open() - execute g:plug_pwindow - execute 'e' title - else - execute 'pedit' title - wincmd P - endif - setlocal previewwindow filetype=git buftype=nofile bufhidden=wipe nobuflisted modifiable - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(1) - let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && '.command - if s:is_win - let [batchfile, cmd] = s:batchfile(cmd) - endif - execute 'silent %!' cmd - finally - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry - setlocal nomodifiable - nnoremap q :q - wincmd p -endfunction - -function! s:section(flags) - call search('\(^[x-] \)\@<=[^:]\+:', a:flags) -endfunction - -function! s:format_git_log(line) - let indent = ' ' - let tokens = split(a:line, nr2char(1)) - if len(tokens) != 5 - return indent.substitute(a:line, '\s*$', '', '') - endif - let [graph, sha, refs, subject, date] = tokens - let tag = matchstr(refs, 'tag: [^,)]\+') - let tag = empty(tag) ? ' ' : ' ('.tag.') ' - return printf('%s%s%s%s%s (%s)', indent, graph, sha, tag, subject, date) -endfunction - -function! s:append_ul(lnum, text) - call append(a:lnum, ['', a:text, repeat('-', len(a:text))]) -endfunction - -function! s:diff() - call s:prepare() - call append(0, ['Collecting changes ...', '']) - let cnts = [0, 0] - let bar = '' - let total = filter(copy(g:plugs), 's:is_managed(v:key) && isdirectory(v:val.dir)') - call s:progress_bar(2, bar, len(total)) - for origin in [1, 0] - let plugs = reverse(sort(items(filter(copy(total), (origin ? '' : '!').'(has_key(v:val, "commit") || has_key(v:val, "tag"))')))) - if empty(plugs) - continue - endif - call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:') - for [k, v] in plugs - let branch = s:git_origin_branch(v) - if len(branch) - let range = origin ? '..origin/'.branch : 'HEAD@{1}..' - let cmd = ['git', 'log', '--graph', '--color=never'] - if s:git_version_requirement(2, 10, 0) - call add(cmd, '--no-show-signature') - endif - call extend(cmd, ['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range]) - if has_key(v, 'rtp') - call extend(cmd, ['--', v.rtp]) - endif - let diff = s:system_chomp(cmd, v.dir) - if !empty(diff) - let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : '' - call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)'))) - let cnts[origin] += 1 - endif - endif - let bar .= '=' - call s:progress_bar(2, bar, len(total)) - normal! 2G - redraw - endfor - if !cnts[origin] - call append(5, ['', 'N/A']) - endif - endfor - call setline(1, printf('%d plugin(s) updated.', cnts[0]) - \ . (cnts[1] ? printf(' %d plugin(s) have pending updates.', cnts[1]) : '')) - - if cnts[0] || cnts[1] - nnoremap (plug-preview) :silent! call preview_commit() - if empty(maparg("\", 'n')) - nmap (plug-preview) - endif - if empty(maparg('o', 'n')) - nmap o (plug-preview) - endif - endif - if cnts[0] - nnoremap X :call revert() - echo "Press 'X' on each block to revert the update" - endif - normal! gg - setlocal nomodifiable -endfunction - -function! s:revert() - if search('^Pending updates', 'bnW') - return - endif - - let name = s:find_name(line('.')) - if empty(name) || !has_key(g:plugs, name) || - \ input(printf('Revert the update of %s? (y/N) ', name)) !~? '^y' - return - endif - - call s:system('git reset --hard HEAD@{1} && git checkout '.plug#shellescape(g:plugs[name].branch).' --', g:plugs[name].dir) - setlocal modifiable - normal! "_dap - setlocal nomodifiable - echo 'Reverted' -endfunction - -function! s:snapshot(force, ...) abort - call s:prepare() - setf vim - call append(0, ['" Generated by vim-plug', - \ '" '.strftime("%c"), - \ '" :source this file in vim to restore the snapshot', - \ '" or execute: vim -S snapshot.vim', - \ '', '', 'PlugUpdate!']) - 1 - let anchor = line('$') - 3 - let names = sort(keys(filter(copy(g:plugs), - \'has_key(v:val, "uri") && isdirectory(v:val.dir)'))) - for name in reverse(names) - let sha = has_key(g:plugs[name], 'commit') ? g:plugs[name].commit : s:git_revision(g:plugs[name].dir) - if !empty(sha) - call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha)) - redraw - endif - endfor - - if a:0 > 0 - let fn = s:plug_expand(a:1) - if filereadable(fn) && !(a:force || s:ask(a:1.' already exists. Overwrite?')) - return - endif - call writefile(getline(1, '$'), fn) - echo 'Saved as '.a:1 - silent execute 'e' s:esc(fn) - setf vim - endif -endfunction - -function! s:split_rtp() - return split(&rtp, '\\\@ 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif - - " https://stackoverflow.com/a/37558470/19044747 - augroup remember_folds - autocmd! - autocmd BufWinLeave * silent! mkview - autocmd BufWinEnter * silent! loadview - augroup END - -endif - -" }}} - -" TALK ------------------------------------------------------------------ {{{ -" https://youtu.be/XA2WjJbmmoM ---------------------------------------------- - set nocompatible - -" Finding files using :find +set number set path+=** -" Also use :b to select files in buffer - -" Show suggestions on another line instead of inplace +set relativenumber +set scrolloff=3 +set shiftwidth=4 +set showcmd +set showmatch +set smartindent +set smarttab +set tabstop=4 +set title +set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx +"" Show suggestions on another line instead of inplace set wildmenu -" Tags -" pacman -S ctags -command! MakeTags !ctags -R . & -" Move to defintion using ^] -" Move to ambigious using g^] -" Move back using ^t +syntax enable + +filetype on +filetype indent on +filetype plugin on " File browsing let g:netrw_browse_split=4 " open in the previous window @@ -96,4 +43,39 @@ let g:netrw_liststyle=3 " treeview " ^p previous " ^x^f filename completion +if $TERM == 'alacritty' + set ttymouse=sgr " Alacritty specific +endif +if $TERM == 'xterm-kitty' + " Fix and not working + set term=xterm-256color +endif + +" AUTO ------------------------------------------------------------------ {{{ + +if has("autocmd") + au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif + + " https://stackoverflow.com/a/37558470/19044747 + augroup remember_folds + autocmd! + autocmd BufWinLeave * silent! mkview + autocmd BufWinEnter * silent! loadview + augroup END +endif + " }}} + +" PLUGINS --------------------------------------------------------------- {{{ + +call plug#begin() + +Plug 'dense-analysis/ale' +Plug 'vifm/vifm.vim' +Plug 'catppuccin/vim', { 'as': 'catppuccin' } +Plug 'NerdyPepper/statix' + +call plug#end() + +" }}} + From 50086f590fc6f22763e7cc59a30ae6d32d4d4a06 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 19 Oct 2023 21:05:14 +0200 Subject: [PATCH 065/176] Remove old zellij --- nixos/modules/programs/default.nix | 1 - nixos/modules/programs/zellij/default.nix | 18 ------------------ 2 files changed, 19 deletions(-) delete mode 100644 nixos/modules/programs/zellij/default.nix diff --git a/nixos/modules/programs/default.nix b/nixos/modules/programs/default.nix index e13df16..335dd93 100644 --- a/nixos/modules/programs/default.nix +++ b/nixos/modules/programs/default.nix @@ -3,6 +3,5 @@ ./home-manager ./sops ./ssh - ./zellij ]; } diff --git a/nixos/modules/programs/zellij/default.nix b/nixos/modules/programs/zellij/default.nix deleted file mode 100644 index db81b28..0000000 --- a/nixos/modules/programs/zellij/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.sisyphus.programs.zellij; -in { - options.sisyphus.programs.zellij.enable = lib.mkEnableOption "Zellij"; - - config = lib.mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - zellij - ]; - - fonts.fonts = with pkgs; [ - noto-fonts - noto-fonts-cjk - ]; - }; -} From 5647db6b466af89037dea833dafc93f939757ea3 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 19 Oct 2023 21:06:02 +0200 Subject: [PATCH 066/176] Move ssh-key README --- nixos/modules-old/utils/sops/default.nix | 47 ------------------- .../utils => modules/programs}/sops/README.md | 0 2 files changed, 47 deletions(-) delete mode 100644 nixos/modules-old/utils/sops/default.nix rename nixos/{modules-old/utils => modules/programs}/sops/README.md (100%) diff --git a/nixos/modules-old/utils/sops/default.nix b/nixos/modules-old/utils/sops/default.nix deleted file mode 100644 index 81a9935..0000000 --- a/nixos/modules-old/utils/sops/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - environment.systemPackages = with pkgs; [ - sops - ]; - - sops = { - # Add secrets.yml to the nix store - defaultSopsFile = ../../../secrets/secrets.yaml; - age = { - # Automatically import SSH keys as age keys - sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; - # Use an age key that is expected to already be in the filesystem - keyFile = "/var/lib/sops-nix/key.txt"; - # Generate new keys if the key specified above does not exist - # generateKey = true; - }; - secrets = - let - user = config.users.users.tdpeuter.name; - - Hugo = { - format = "yaml"; - sopsFile = ../../../secrets/Hugo.yaml; - owner = user; - }; - UGent = { - format = "yaml"; - sopsFile = ../../../secrets/UGent.yaml; - owner = user; - }; - in { - "Hugo/ssh" = Hugo; - "UGent/HPC/ssh" = UGent; - - "GitHub/ssh" = { - format = "yaml"; - sopsFile = ../../../secrets/GitHub.yaml; - owner = user; - }; - "Hugo/Gitea/ssh" = Hugo; - "UGent/GitHub/ssh" = UGent; - "UGent/SubGit/ssh" = UGent; - }; - }; -} diff --git a/nixos/modules-old/utils/sops/README.md b/nixos/modules/programs/sops/README.md similarity index 100% rename from nixos/modules-old/utils/sops/README.md rename to nixos/modules/programs/sops/README.md From 74e1f9580a2c88e6a02dd4dcf742d145d308f4ce Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 19 Oct 2023 21:07:33 +0200 Subject: [PATCH 067/176] [kitty] Allow theme switching --- nixos/modules/users/tdpeuter/default.nix | 4 +++- stow/kitty/.config/kitty/kitty.conf | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index be02a5a..89753e4 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -68,8 +68,10 @@ in { ".config/git" = lib.mkIf (builtins.elem pkgs.git installedPkgs) { source = ../../../../stow/git/.config/git; }; - ".config/kitty" = lib.mkIf (builtins.elem pkgs.kitty installedPkgs) { + ".config/kitty" = { + enable = builtins.elem pkgs.kitty installedPkgs; source = ../../../../stow/kitty/.config/kitty; + recursive = true; }; ".config/mpv" = lib.mkIf (builtins.elem pkgs-unstable.mpv installedPkgs) { source = ../../../../stow/mpv/.config/mpv; diff --git a/stow/kitty/.config/kitty/kitty.conf b/stow/kitty/.config/kitty/kitty.conf index 182e72b..b201ac2 100644 --- a/stow/kitty/.config/kitty/kitty.conf +++ b/stow/kitty/.config/kitty/kitty.conf @@ -1,6 +1,6 @@ # vim:fileencoding=utf-8:foldmethod=marker -include ./themes/tdpeuter-light.conf +include ./theme.conf #: Fonts {{{ From 8a143f029da280a11e3ab6ce7c2664c1aba37edd Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 19 Oct 2023 22:24:04 +0200 Subject: [PATCH 068/176] [zsh] Move into user config --- nixos/flake.nix | 1 + nixos/hosts/Tibo-NixFat/default.nix | 5 ++ nixos/modules-old/shells/default.nix | 5 -- nixos/modules-old/shells/zsh/default.nix | 77 ------------------- nixos/modules/users/tdpeuter/default.nix | 49 ++++++++++-- nixos/overlays/cmdtime/default.nix | 17 ++++ ...{mrfortem.zsh-theme => tdpeuter.zsh-theme} | 2 +- stow/zsh/.zshrc | 68 ++++++++++++++++ 8 files changed, 134 insertions(+), 90 deletions(-) delete mode 100644 nixos/modules-old/shells/default.nix delete mode 100644 nixos/modules-old/shells/zsh/default.nix create mode 100644 nixos/overlays/cmdtime/default.nix rename stow/zsh/.oh-my-zsh/themes/{mrfortem.zsh-theme => tdpeuter.zsh-theme} (97%) create mode 100644 stow/zsh/.zshrc diff --git a/nixos/flake.nix b/nixos/flake.nix index 59776e4..4b07dfd 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -41,6 +41,7 @@ sharedOverlays = [ (import ./overlays/letter) (import ./overlays/icosystem) + (import ./overlays/cmdtime) ]; hostDefaults = { diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 1d85891..0e382b5 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -46,10 +46,15 @@ environment.systemPackages = with pkgs; [ git + vim wget zenith-nvidia ]; + programs = { + zsh.enable = true; + }; + hardware.bluetooth.enable = true; networking.hostName = "Tibo-NixFat"; diff --git a/nixos/modules-old/shells/default.nix b/nixos/modules-old/shells/default.nix deleted file mode 100644 index 87b90be..0000000 --- a/nixos/modules-old/shells/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./zsh - ]; -} diff --git a/nixos/modules-old/shells/zsh/default.nix b/nixos/modules-old/shells/zsh/default.nix deleted file mode 100644 index 6b69e7e..0000000 --- a/nixos/modules-old/shells/zsh/default.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - programs.zsh.enable = true; - users.users.tdpeuter.shell = pkgs.zsh; - - home-manager.users.tdpeuter = { pkgs, ... }: { - home = { - packages = with pkgs; [ - font-awesome - fzf - ]; - - file = { - ".oh-my-zsh".source = ../../../../stow/zsh/.oh-my-zsh; - }; - }; - - programs.zsh = { - enable = true; - enableAutosuggestions = true; - enableSyntaxHighlighting = true; - history = { - expireDuplicatesFirst = true; - extended = true; - }; - initExtra = '' - eval "$(direnv hook zsh)" - - # Add fzf - if [ -x "$(command -v fzf-share)" ]; then - source "$(fzf-share)/key-bindings.zsh" - source "$(fzf-share)/completion.zsh" - fi - ''; - oh-my-zsh = { - enable = true; - custom = "$HOME/.oh-my-zsh"; - plugins = [ - "dirhistory" - "git" - "screen" - ]; - theme = "mrfortem"; - }; - plugins = [ - { - name = "cmdtime"; - src = pkgs.fetchFromGitHub { - owner = "tom-auger"; - repo = "cmdtime"; - rev = "ffc72641dcfa0ee6666ceb1dc712b61be30a1e8b"; - hash = "sha256-v6wCfNoPXDD3sS6yUYE6lre8Ir1yJcLGoAW3O8sUOCg="; - }; - } - ]; - shellAliases = { - cp = "cp -i"; # Confirm before overwriting something - df = "df -h"; - free = "free -m"; - ll = "ls -la"; - np = "nano -w PKGBUILD"; - more = "less"; - hgrep = "history | grep"; - - gs = "git status"; - - update = '' - pushd ~/projects/sisyphus/nixos - nix flake update - sudo nixos-rebuild switch --flake .# --show-trace - popd - ''; - }; - }; - }; -} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 89753e4..0d877be 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -18,9 +18,11 @@ in { config.users.groups.wheel.name ]; initialPassword = "ChangeMe"; + shell = pkgs.zsh; }; fonts.fonts = with pkgs; [ + font-awesome # Dependency of zsh font-awesome_5 # Dependency of Vifm config noto-fonts # Dependency of Zellij config noto-fonts-cjk # Dependency of Zellij config @@ -38,7 +40,9 @@ in { # and the configuration files will be put in place for you. packages = (with pkgs; [ chafa # Terminal image viewer + cmdtime # Zsh plugin duf # Df alternative + fzf glow # Terminal Markdown renderer jellyfin-media-player kitty @@ -53,6 +57,9 @@ in { vifm # File manager zathura # PDF viewer zellij # Tmux + screen alternative + zsh + zsh-autosuggestions + zsh-syntax-highlighting ]) ++ (with pkgs-unstable; [ mpv ]) ++ (with pkgs.vimPlugins; [ @@ -65,37 +72,65 @@ in { ".config/alacritty" = lib.mkIf (builtins.elem pkgs.alacritty installedPkgs) { source = ../../../../stow/alacritty/.config/alacritty; }; - ".config/git" = lib.mkIf (builtins.elem pkgs.git installedPkgs) { + ".config/git" = { + enable = (builtins.elem pkgs.git installedPkgs); source = ../../../../stow/git/.config/git; + recursive = true; }; ".config/kitty" = { enable = builtins.elem pkgs.kitty installedPkgs; source = ../../../../stow/kitty/.config/kitty; recursive = true; }; - ".config/mpv" = lib.mkIf (builtins.elem pkgs-unstable.mpv installedPkgs) { + ".config/mpv" = { + enable = (builtins.elem pkgs-unstable.mpv installedPkgs); source = ../../../../stow/mpv/.config/mpv; }; ".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable { source = ../../../../stow/ssh/.ssh/config; }; - ".config/vifm" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) { + ".config/vifm" = { + enable = (builtins.elem pkgs.vifm installedPkgs); source = ../../../../stow/vifm/.config/vifm; recursive = true; }; - ".config/zellij" = lib.mkIf (builtins.elem pkgs.zellij installedPkgs) { + ".config/zellij" = { + enable = (builtins.elem pkgs.zellij installedPkgs); source = ../../../../stow/zellij/.config/zellij; }; - ".vim" = lib.mkIf (builtins.elem pkgs.vim installedPkgs) { + ".oh-my-zsh" = { + enable = (builtins.elem pkgs.zsh installedPkgs); + source = ../../../../stow/zsh/.oh-my-zsh; + }; + ".vim" = { + enable = (builtins.elem pkgs.vim installedPkgs); source = ../../../../stow/vim/.vim; recursive = true; }; - ".vim/autoload/plug.vim" = lib.mkIf (builtins.elem pkgs.vim installedPkgs) { + ".vim/autoload/plug.vim" = { + enable = (builtins.elem pkgs.vim installedPkgs); source = "${pkgs.vimPlugins.vim-plug}/plug.vim"; }; - ".vimrc" = lib.mkIf (builtins.elem pkgs.vim installedPkgs) { + ".vimrc" = { + enable = (builtins.elem pkgs.vim installedPkgs); source = ../../../../stow/vim/.vimrc; }; + ".zshrc" = { + enable = (config.users.users.tdpeuter.shell == pkgs.zsh); + source = ../../../../stow/zsh/.zshrc; + }; + ".zsh/plugins/cmdtime/cmdtime.plugin.zsh" = { + enable = (builtins.elem pkgs.cmdtime installedPkgs); + source = "${pkgs.cmdtime}/share/cmdtime/cmdtime.plugin.zsh"; + }; + ".zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" = { + enable = (builtins.elem pkgs.zsh-autosuggestions installedPkgs); + source = "${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; + }; + ".zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" = { + enable = (builtins.elem pkgs.zsh-syntax-highlighting installedPkgs); + source = "${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"; + }; }; }; diff --git a/nixos/overlays/cmdtime/default.nix b/nixos/overlays/cmdtime/default.nix new file mode 100644 index 0000000..afc864f --- /dev/null +++ b/nixos/overlays/cmdtime/default.nix @@ -0,0 +1,17 @@ +final: prev: { + cmdtime = final.stdenv.mkDerivation { + name = "cmdtime"; + version = "v0.0.0"; + src = final.fetchFromGitHub { + owner = "tom-auger"; + repo = "cmdtime"; + rev = "ffc72641dcfa0ee6666ceb1dc712b61be30a1e8b"; + hash = "sha256-v6wCfNoPXDD3sS6yUYE6lre8Ir1yJcLGoAW3O8sUOCg="; + }; + + installPhase = '' + mkdir -p $out/share/cmdtime + cp $src/cmdtime.plugin.zsh $out/share/cmdtime.plugin.zsh + ''; + }; +} diff --git a/stow/zsh/.oh-my-zsh/themes/mrfortem.zsh-theme b/stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme similarity index 97% rename from stow/zsh/.oh-my-zsh/themes/mrfortem.zsh-theme rename to stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme index 3515550..958c7fe 100644 --- a/stow/zsh/.oh-my-zsh/themes/mrfortem.zsh-theme +++ b/stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme @@ -1,5 +1,5 @@ # -# ~/.oh-my-zsh/themes/mrfortem.zsh-theme +# ~/.oh-my-zsh/themes/tdpeuter.zsh-theme # Stolen from gentoo-theme and gianni # diff --git a/stow/zsh/.zshrc b/stow/zsh/.zshrc new file mode 100644 index 0000000..5209f6b --- /dev/null +++ b/stow/zsh/.zshrc @@ -0,0 +1,68 @@ +typeset -U path cdpath fpath manpath + +path+="$HOME/.zsh/plugins/cmdtime" +fpath+="$HOME/.zsh/plugins/cmdtime" + +plugins=(dirhistory git screen) +ZSH_CUSTOM="$HOME/.oh-my-zsh" +ZSH_THEME="tdpeuter" +# source $ZSH/oh-my-zsh.sh + +if [[ -f "$HOME/.zsh/plugins/cmdtime/cmdtime.plugin.zsh" ]]; then + source "$HOME/.zsh/plugins/cmdtime/cmdtime.plugin.zsh" +fi +if [[ -f "$HOME/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" ]]; then + source "$HOME/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" +fi + +if [[ -f "$HOME/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]]; then + source "$HOME/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" +fi + +# History options should be set in .zshrc and after oh-my-zsh sourcing. +# See https://github.com/nix-community/home-manager/issues/177. +HISTSIZE="10000" +SAVEHIST="10000" + +HISTFILE="$HOME/.zsh_history" +mkdir -p "$(dirname "$HISTFILE")" + +setopt HIST_FCNTL_LOCK +setopt HIST_IGNORE_DUPS +setopt HIST_IGNORE_SPACE +setopt HIST_EXPIRE_DUPS_FIRST +setopt SHARE_HISTORY +setopt EXTENDED_HISTORY + +# Add direnv +if [ -x "$(command -v direnv)" ]; then + eval "$(direnv hook zsh)" +fi + +# Add fzf +if [ -x "$(command -v fzf-share)" ]; then + source "$(fzf-share)/key-bindings.zsh" + source "$(fzf-share)/completion.zsh" +fi + +# Aliases +alias cp='cp -i' +alias df='df -h' +alias free='free -m' +alias gs='git status' +alias hgrep='history | grep' +alias ll='ls -la' +alias more='less' +alias np='nano -w PKGBUILD' +alias update='pushd ~/projects/sisyphus/nixos +nix flake update +sudo nixos-rebuild switch --flake .# --show-trace +popd +' + +# -- Barrier -- + +for profile in ${(z)NIX_PROFILES}; do + fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) +done + From 4967fbe29eaaecc01bb1965d32dac6a8029fb723 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 19 Oct 2023 22:24:33 +0200 Subject: [PATCH 069/176] Touchups --- nixos/flake.lock | 6 +++--- nixos/flake.nix | 3 ++- nixos/hosts/Tibo-NixFat/default.nix | 12 +++--------- nixos/modules-old/default.nix | 6 ------ nixos/modules/services/desktop/gnome/default.nix | 3 +++ 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index 0bc894e..6b5bbae 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1697226376, - "narHash": "sha256-cumLLb1QOUtWieUnLGqo+ylNt3+fU8Lcv5Zl+tYbRUE=", + "lastModified": 1697655685, + "narHash": "sha256-79Kuv+QdgsVc+rkibuAgWHnh8IXrLBTOKg5nM0Qvux0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "898cb2064b6e98b8c5499f37e81adbdf2925f7c5", + "rev": "80c1aab725151632ddc2a20caeb914e76dd0673c", "type": "github" }, "original": { diff --git a/nixos/flake.nix b/nixos/flake.nix index 4b07dfd..f2ec5c5 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -35,7 +35,8 @@ inherit self inputs; channelsConfig = { - allowUnfree = true; + allowUnfree.allowUnfreePredicate = pkg: builtins.elem (utils.lib.getName pkg) [ + ]; }; sharedOverlays = [ diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 0e382b5..4e7467f 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -13,7 +13,6 @@ home-manager.enable = true; sops.enable = true; ssh.enable = true; - zellij.enable = true; }; services = { desktop.gnome.enable = true; @@ -66,6 +65,9 @@ lidSwitchExternalPower = "lock"; lidSwitchDocked = "ignore"; }; + + # Touchpad + xserver.libinput.enable = true; }; system.stateVersion = "23.05"; @@ -94,12 +96,4 @@ # no need to redefine it in your config for now) #media-session.enable = true; }; - - # Enable touchpad support (enabled default in most desktopManager). - services.xserver = { - libinput.enable = true; - }; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; } diff --git a/nixos/modules-old/default.nix b/nixos/modules-old/default.nix index cab2f2d..8073084 100644 --- a/nixos/modules-old/default.nix +++ b/nixos/modules-old/default.nix @@ -3,7 +3,6 @@ { imports = [ ./apps - ./shells ]; # Nix Flakes @@ -27,9 +26,4 @@ # font = "Lat2-Terminus16"; useXkbConfig = true; # use xkbOptions in tty. }; - - services.xserver = { - layout = "us"; - xkbVariant = "altgr-intl"; - }; } diff --git a/nixos/modules/services/desktop/gnome/default.nix b/nixos/modules/services/desktop/gnome/default.nix index 415211b..186155e 100644 --- a/nixos/modules/services/desktop/gnome/default.nix +++ b/nixos/modules/services/desktop/gnome/default.nix @@ -8,6 +8,9 @@ in { config = lib.mkIf cfg.enable { services.xserver = { enable = true; + layout = "us"; + xkbVariant = "altgr-intl"; + excludePackages = with pkgs; [ xterm ]; From 29ff9c1a0134f74fd88bf2c3c24a5bafbdd541f6 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 19 Oct 2023 23:02:17 +0200 Subject: [PATCH 070/176] [zsh] Fix --- nixos/modules/users/tdpeuter/default.nix | 8 +++++++- nixos/overlays/cmdtime/default.nix | 2 +- stow/zsh/.zshrc | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 0d877be..0de33d2 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -50,6 +50,7 @@ in { nextcloud-client nsxiv # Lightweight image viewer obsidian + oh-my-zsh qalculate-gtk # Calculator spotify tea # Gitea CLI @@ -100,7 +101,12 @@ in { }; ".oh-my-zsh" = { enable = (builtins.elem pkgs.zsh installedPkgs); - source = ../../../../stow/zsh/.oh-my-zsh; + source = "${pkgs.oh-my-zsh}/share/oh-my-zsh"; + recursive = true; + }; + ".oh-my-zsh/themes/tdpeuter.zsh-theme" = { + enable = (builtins.elem pkgs.zsh installedPkgs); + source = ../../../../stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme; }; ".vim" = { enable = (builtins.elem pkgs.vim installedPkgs); diff --git a/nixos/overlays/cmdtime/default.nix b/nixos/overlays/cmdtime/default.nix index afc864f..6ff497f 100644 --- a/nixos/overlays/cmdtime/default.nix +++ b/nixos/overlays/cmdtime/default.nix @@ -11,7 +11,7 @@ final: prev: { installPhase = '' mkdir -p $out/share/cmdtime - cp $src/cmdtime.plugin.zsh $out/share/cmdtime.plugin.zsh + cp $src/cmdtime.plugin.zsh $out/share/cmdtime/cmdtime.plugin.zsh ''; }; } diff --git a/stow/zsh/.zshrc b/stow/zsh/.zshrc index 5209f6b..d6e4b06 100644 --- a/stow/zsh/.zshrc +++ b/stow/zsh/.zshrc @@ -6,7 +6,7 @@ fpath+="$HOME/.zsh/plugins/cmdtime" plugins=(dirhistory git screen) ZSH_CUSTOM="$HOME/.oh-my-zsh" ZSH_THEME="tdpeuter" -# source $ZSH/oh-my-zsh.sh +source $ZSH_CUSTOM/oh-my-zsh.sh if [[ -f "$HOME/.zsh/plugins/cmdtime/cmdtime.plugin.zsh" ]]; then source "$HOME/.zsh/plugins/cmdtime/cmdtime.plugin.zsh" From a53b7ef45955611377cdafc3625ef6aaeae8cc24 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 20 Oct 2023 19:20:32 +0200 Subject: [PATCH 071/176] Separate user into smaller chunks --- nixos/modules/users/tdpeuter/default.nix | 101 ++-------------------- nixos/modules/users/tdpeuter/dotfiles.nix | 83 ++++++++++++++++++ nixos/modules/users/tdpeuter/secrets.nix | 34 ++++++++ 3 files changed, 122 insertions(+), 96 deletions(-) create mode 100644 nixos/modules/users/tdpeuter/dotfiles.nix create mode 100644 nixos/modules/users/tdpeuter/secrets.nix diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 0de33d2..3e9b84d 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -6,6 +6,11 @@ let user = config.users.users.tdpeuter.name; installedPkgs = config.environment.systemPackages ++ config.home-manager.users.tdpeuter.home.packages; in { + imports = [ + ./dotfiles.nix + ./secrets.nix + ]; + options.sisyphus.users.tdpeuter.enable = lib.mkEnableOption "user Tibo De Peuter"; config = lib.mkIf cfg.enable { @@ -67,77 +72,6 @@ in { statix vim-plug ]); - - # Put dotfiles in place. - file = { - ".config/alacritty" = lib.mkIf (builtins.elem pkgs.alacritty installedPkgs) { - source = ../../../../stow/alacritty/.config/alacritty; - }; - ".config/git" = { - enable = (builtins.elem pkgs.git installedPkgs); - source = ../../../../stow/git/.config/git; - recursive = true; - }; - ".config/kitty" = { - enable = builtins.elem pkgs.kitty installedPkgs; - source = ../../../../stow/kitty/.config/kitty; - recursive = true; - }; - ".config/mpv" = { - enable = (builtins.elem pkgs-unstable.mpv installedPkgs); - source = ../../../../stow/mpv/.config/mpv; - }; - ".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable { - source = ../../../../stow/ssh/.ssh/config; - }; - ".config/vifm" = { - enable = (builtins.elem pkgs.vifm installedPkgs); - source = ../../../../stow/vifm/.config/vifm; - recursive = true; - }; - ".config/zellij" = { - enable = (builtins.elem pkgs.zellij installedPkgs); - source = ../../../../stow/zellij/.config/zellij; - }; - ".oh-my-zsh" = { - enable = (builtins.elem pkgs.zsh installedPkgs); - source = "${pkgs.oh-my-zsh}/share/oh-my-zsh"; - recursive = true; - }; - ".oh-my-zsh/themes/tdpeuter.zsh-theme" = { - enable = (builtins.elem pkgs.zsh installedPkgs); - source = ../../../../stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme; - }; - ".vim" = { - enable = (builtins.elem pkgs.vim installedPkgs); - source = ../../../../stow/vim/.vim; - recursive = true; - }; - ".vim/autoload/plug.vim" = { - enable = (builtins.elem pkgs.vim installedPkgs); - source = "${pkgs.vimPlugins.vim-plug}/plug.vim"; - }; - ".vimrc" = { - enable = (builtins.elem pkgs.vim installedPkgs); - source = ../../../../stow/vim/.vimrc; - }; - ".zshrc" = { - enable = (config.users.users.tdpeuter.shell == pkgs.zsh); - source = ../../../../stow/zsh/.zshrc; - }; - ".zsh/plugins/cmdtime/cmdtime.plugin.zsh" = { - enable = (builtins.elem pkgs.cmdtime installedPkgs); - source = "${pkgs.cmdtime}/share/cmdtime/cmdtime.plugin.zsh"; - }; - ".zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" = { - enable = (builtins.elem pkgs.zsh-autosuggestions installedPkgs); - source = "${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; - }; - ".zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" = { - enable = (builtins.elem pkgs.zsh-syntax-highlighting installedPkgs); - source = "${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"; - }; - }; }; # GNOME ricing @@ -192,30 +126,5 @@ in { }; }; }; - sops.secrets = lib.mkIf config.sisyphus.programs.sops.enable ( - let - Hugo = { - format = "yaml"; - sopsFile = ../../../secrets/Hugo.yaml; - owner = user; - }; - UGent = { - format = "yaml"; - sopsFile = ../../../secrets/UGent.yaml; - owner = user; - }; - in { - "Hugo/ssh" = Hugo; - "UGent/HPC/ssh" = UGent; - - "GitHub/ssh" = { - format = "yaml"; - sopsFile = ../../../secrets/GitHub.yaml; - owner = user; - }; - "Hugo/Gitea/ssh" = Hugo; - "UGent/GitHub/ssh" = UGent; - "UGent/SubGit/ssh" = UGent; - }); }; } diff --git a/nixos/modules/users/tdpeuter/dotfiles.nix b/nixos/modules/users/tdpeuter/dotfiles.nix new file mode 100644 index 0000000..e437cc1 --- /dev/null +++ b/nixos/modules/users/tdpeuter/dotfiles.nix @@ -0,0 +1,83 @@ +{ config, lib, pkgs, pkgs-unstable, ... }: + +let + cfg = config.sisyphus.users.tdpeuter; + user = config.users.users.tdpeuter.name; + installedPkgs = config.environment.systemPackages ++ config.home-manager.users.tdpeuter.home.packages; +in { + config = lib.mkIf cfg.enable { + home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable { + home = { + file = { + ".config/alacritty" = lib.mkIf (builtins.elem pkgs.alacritty installedPkgs) { + source = ../../../../stow/alacritty/.config/alacritty; + }; + ".config/git" = { + enable = (builtins.elem pkgs.git installedPkgs); + source = ../../../../stow/git/.config/git; + recursive = true; + }; + ".config/kitty" = { + enable = builtins.elem pkgs.kitty installedPkgs; + source = ../../../../stow/kitty/.config/kitty; + recursive = true; + }; + ".config/mpv" = { + enable = (builtins.elem pkgs-unstable.mpv installedPkgs); + source = ../../../../stow/mpv/.config/mpv; + }; + ".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable { + source = ../../../../stow/ssh/.ssh/config; + }; + ".config/vifm" = { + enable = (builtins.elem pkgs.vifm installedPkgs); + source = ../../../../stow/vifm/.config/vifm; + recursive = true; + }; + ".config/zellij" = { + enable = (builtins.elem pkgs.zellij installedPkgs); + source = ../../../../stow/zellij/.config/zellij; + }; + ".oh-my-zsh" = { + enable = (builtins.elem pkgs.zsh installedPkgs); + source = "${pkgs.oh-my-zsh}/share/oh-my-zsh"; + recursive = true; + }; + ".oh-my-zsh/themes/tdpeuter.zsh-theme" = { + enable = (builtins.elem pkgs.zsh installedPkgs); + source = ../../../../stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme; + }; + ".vim" = { + enable = (builtins.elem pkgs.vim installedPkgs); + source = ../../../../stow/vim/.vim; + recursive = true; + }; + ".vim/autoload/plug.vim" = { + enable = (builtins.elem pkgs.vim installedPkgs); + source = "${pkgs.vimPlugins.vim-plug}/plug.vim"; + }; + ".vimrc" = { + enable = (builtins.elem pkgs.vim installedPkgs); + source = ../../../../stow/vim/.vimrc; + }; + ".zshrc" = { + enable = (config.users.users.tdpeuter.shell == pkgs.zsh); + source = ../../../../stow/zsh/.zshrc; + }; + ".zsh/plugins/cmdtime/cmdtime.plugin.zsh" = { + enable = (builtins.elem pkgs.cmdtime installedPkgs); + source = "${pkgs.cmdtime}/share/cmdtime/cmdtime.plugin.zsh"; + }; + ".zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" = { + enable = (builtins.elem pkgs.zsh-autosuggestions installedPkgs); + source = "${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; + }; + ".zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" = { + enable = (builtins.elem pkgs.zsh-syntax-highlighting installedPkgs); + source = "${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"; + }; + }; + }; + }; + }; +} diff --git a/nixos/modules/users/tdpeuter/secrets.nix b/nixos/modules/users/tdpeuter/secrets.nix new file mode 100644 index 0000000..b2f208c --- /dev/null +++ b/nixos/modules/users/tdpeuter/secrets.nix @@ -0,0 +1,34 @@ +{ config, lib, pkgs, pkgs-unstable, ... }: + +let + cfg = config.sisyphus.users.tdpeuter; + user = config.users.users.tdpeuter.name; +in { + config = lib.mkIf cfg.enable { + sops.secrets = lib.mkIf config.sisyphus.programs.sops.enable ( + let + Hugo = { + format = "yaml"; + sopsFile = ../../../secrets/Hugo.yaml; + owner = user; + }; + UGent = { + format = "yaml"; + sopsFile = ../../../secrets/UGent.yaml; + owner = user; + }; + in { + "Hugo/ssh" = Hugo; + "UGent/HPC/ssh" = UGent; + + "GitHub/ssh" = { + format = "yaml"; + sopsFile = ../../../secrets/GitHub.yaml; + owner = user; + }; + "Hugo/Gitea/ssh" = Hugo; + "UGent/GitHub/ssh" = UGent; + "UGent/SubGit/ssh" = UGent; + }); + }; +} From 36abb35b7bde0da64d625c74dcd45f2cebb96c5b Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 20 Oct 2023 19:26:31 +0200 Subject: [PATCH 072/176] [thunderbird] Move into user config --- nixos/modules-old/apps/default.nix | 1 - .../modules-old/apps/thunderbird/default.nix | 130 ----------------- nixos/modules/users/tdpeuter/default.nix | 1 + nixos/modules/users/tdpeuter/mail.nix | 135 ++++++++++++++++++ 4 files changed, 136 insertions(+), 131 deletions(-) delete mode 100644 nixos/modules-old/apps/thunderbird/default.nix create mode 100644 nixos/modules/users/tdpeuter/mail.nix diff --git a/nixos/modules-old/apps/default.nix b/nixos/modules-old/apps/default.nix index d14f28e..3887b25 100644 --- a/nixos/modules-old/apps/default.nix +++ b/nixos/modules-old/apps/default.nix @@ -1,6 +1,5 @@ { imports = [ ./firefox - ./thunderbird ]; } diff --git a/nixos/modules-old/apps/thunderbird/default.nix b/nixos/modules-old/apps/thunderbird/default.nix deleted file mode 100644 index 7b4005f..0000000 --- a/nixos/modules-old/apps/thunderbird/default.nix +++ /dev/null @@ -1,130 +0,0 @@ -{ inputs, lib, config, pkgs, ... }: - -let - signatures = { - default = '' - Met vriendelijke groeten - Tibo De Peuter - ''; - UGent = '' - Met vriendelijke groeten - Tibo De Peuter - - Student 2Ba Informatica - ''; - MrFortem = '' - Kind regards - MrFortem Fiducia - ''; - }; -in -{ - home-manager.users.tdpeuter = { - accounts.email.accounts = { - Telenet = { - address = "tibo.depeuter@telenet.be"; - userName = "tibo.depeuter@telenet.be"; - imap = { - host = "imap.telenet.be"; - port = 993; - tls.enable = true; - }; - smtp = { - host = "smtp.telenet.be"; - port = 587; - tls = { - enable = true; - useStartTls = true; - }; - }; - - realName = "Tibo De Peuter"; - signature = { - showSignature = "append"; - text = signatures.default; - }; - - primary = true; - thunderbird = { - enable = true; - settings = id: { - "mail.identity.id_${id}.htmlSigText" = signatures.default; - }; - }; - }; - UGent = { - flavor = "outlook.office365.com"; - address = "tibo.depeuter@ugent.be"; - - realName = "Tibo De Peuter"; - signature = { - showSignature = "append"; - text = signatures.UGent; - }; - - thunderbird = { - enable = true; - settings = id: { - "mail.server.server_${id}.authMethod" = 10; - "mail.smtpserver.smtp_${id}.authMethod" = 10; - "mail.identity.id_${id}.htmlSigText" = signatures.UGent; - }; - }; - }; - Gmail = { - flavor = "gmail.com"; - address = "tibo.depeuter@gmail.com"; - - realName = "Tibo De Peuter"; - signature = { - showSignature = "append"; - text = signatures.default; - }; - thunderbird = { - enable = true; - settings = id: { - "mail.identity.id_${id}.htmlSigText" = signatures.default; - }; - }; - - }; - MrFortem = { - flavor = "gmail.com"; - address = "fortemfiducia@gmail.com"; - - realName = "Fortem Fiducia"; - signature = { - showSignature = "attach"; - text = '' - Kind regards - MrFortem Fiducia - ''; - }; - - thunderbird = { - enable = true; - settings = id: { - "mail.server.server_${id}.directory" = ".thunderbird/tdpeuter/ImapMail/imap.gmail.com-mrfortem"; - "mail.server.server_${id}.directory-rel" = "[ProfD]ImapMail/imap.gmail.com-mrfortem"; - "mail.identity.id_${id}.htmlSigText" = signatures.MrFortem; - }; - }; - }; - }; - - programs = { - thunderbird = { - enable = true; - profiles.tdpeuter = { - isDefault = true; - settings = { - "mailnews.default_sort_order" = 2; # Sort descending - "mailnews.mark_message_read.delay" = true; - "mailnews.start_page.enabled" = false; - "mail.pane_config.dynamic" = 2; # Vertical view - }; - }; - }; - }; - }; -} diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 3e9b84d..2866f11 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -8,6 +8,7 @@ let in { imports = [ ./dotfiles.nix + ./mail.nix ./secrets.nix ]; diff --git a/nixos/modules/users/tdpeuter/mail.nix b/nixos/modules/users/tdpeuter/mail.nix new file mode 100644 index 0000000..4315f79 --- /dev/null +++ b/nixos/modules/users/tdpeuter/mail.nix @@ -0,0 +1,135 @@ +{ config, lib, pkgs, pkgs-unstable, ... }: + +let + cfg = config.sisyphus.users.tdpeuter; + user = config.users.users.tdpeuter.name; + signatures = { + default = '' + Met vriendelijke groeten + Tibo De Peuter + ''; + UGent = '' + Met vriendelijke groeten + Tibo De Peuter + + Student 2Ba Informatica + ''; + MrFortem = '' + Kind regards + MrFortem Fiducia + ''; + }; +in { + config = lib.mkIf cfg.enable { + home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable { + home = { + accounts.email.accounts = { + Telenet = { + address = "tibo.depeuter@telenet.be"; + userName = "tibo.depeuter@telenet.be"; + imap = { + host = "imap.telenet.be"; + port = 993; + tls.enable = true; + }; + smtp = { + host = "smtp.telenet.be"; + port = 587; + tls = { + enable = true; + useStartTls = true; + }; + }; + + realName = "Tibo De Peuter"; + signature = { + showSignature = "append"; + text = signatures.default; + }; + + primary = true; + thunderbird = { + enable = true; + settings = id: { + "mail.identity.id_${id}.htmlSigText" = signatures.default; + }; + }; + }; + UGent = { + flavor = "outlook.office365.com"; + address = "tibo.depeuter@ugent.be"; + + realName = "Tibo De Peuter"; + signature = { + showSignature = "append"; + text = signatures.UGent; + }; + + thunderbird = { + enable = true; + settings = id: { + "mail.server.server_${id}.authMethod" = 10; + "mail.smtpserver.smtp_${id}.authMethod" = 10; + "mail.identity.id_${id}.htmlSigText" = signatures.UGent; + }; + }; + }; + Gmail = { + flavor = "gmail.com"; + address = "tibo.depeuter@gmail.com"; + + realName = "Tibo De Peuter"; + signature = { + showSignature = "append"; + text = signatures.default; + }; + thunderbird = { + enable = true; + settings = id: { + "mail.identity.id_${id}.htmlSigText" = signatures.default; + }; + }; + + }; + MrFortem = { + flavor = "gmail.com"; + address = "fortemfiducia@gmail.com"; + + realName = "Fortem Fiducia"; + signature = { + showSignature = "attach"; + text = '' + Kind regards + MrFortem Fiducia + ''; + }; + + thunderbird = { + enable = true; + settings = id: { + "mail.server.server_${id}.directory" = ".thunderbird/tdpeuter/ImapMail/imap.gmail.com-mrfortem"; + "mail.server.server_${id}.directory-rel" = "[ProfD]ImapMail/imap.gmail.com-mrfortem"; + "mail.identity.id_${id}.htmlSigText" = signatures.MrFortem; + }; + }; + }; + }; + + programs = { + thunderbird = { + enable = true; + profiles.tdpeuter = { + isDefault = true; + settings = { + "mailnews.default_sort_order" = 2; # Sort descending + "mailnews.mark_message_read.delay" = true; + "mailnews.start_page.enabled" = false; + "mail.pane_config.dynamic" = 2; # Vertical view + }; + }; + }; + }; + }; + }; + }; +} From 745074da5010f5b659d477cafb246122b15a8810 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 20 Oct 2023 20:01:07 +0200 Subject: [PATCH 073/176] [thunderbird] Tweak --- nixos/modules/users/tdpeuter/mail.nix | 181 +++++++++++++------------- 1 file changed, 88 insertions(+), 93 deletions(-) diff --git a/nixos/modules/users/tdpeuter/mail.nix b/nixos/modules/users/tdpeuter/mail.nix index 4315f79..a7335c9 100644 --- a/nixos/modules/users/tdpeuter/mail.nix +++ b/nixos/modules/users/tdpeuter/mail.nix @@ -12,7 +12,7 @@ let Met vriendelijke groeten Tibo De Peuter - Student 2Ba Informatica + Student 2Ba/3Ba Informatica ''; MrFortem = '' Kind regards @@ -22,110 +22,105 @@ let in { config = lib.mkIf cfg.enable { home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable { - home = { - accounts.email.accounts = { - Telenet = { - address = "tibo.depeuter@telenet.be"; - userName = "tibo.depeuter@telenet.be"; - imap = { - host = "imap.telenet.be"; - port = 993; - tls.enable = true; - }; - smtp = { - host = "smtp.telenet.be"; - port = 587; - tls = { - enable = true; - useStartTls = true; - }; - }; - - realName = "Tibo De Peuter"; - signature = { - showSignature = "append"; - text = signatures.default; - }; - - primary = true; - thunderbird = { + accounts.email.accounts = { + Telenet = { + address = "tibo.depeuter@telenet.be"; + userName = "tibo.depeuter@telenet.be"; + imap = { + host = "imap.telenet.be"; + port = 993; + tls.enable = true; + }; + smtp = { + host = "smtp.telenet.be"; + port = 587; + tls = { enable = true; - settings = id: { - "mail.identity.id_${id}.htmlSigText" = signatures.default; - }; + useStartTls = true; }; }; - UGent = { - flavor = "outlook.office365.com"; - address = "tibo.depeuter@ugent.be"; - realName = "Tibo De Peuter"; - signature = { - showSignature = "append"; - text = signatures.UGent; - }; - - thunderbird = { - enable = true; - settings = id: { - "mail.server.server_${id}.authMethod" = 10; - "mail.smtpserver.smtp_${id}.authMethod" = 10; - "mail.identity.id_${id}.htmlSigText" = signatures.UGent; - }; - }; + realName = config.users.users.tdpeuter.description; + signature = { + showSignature = "append"; + text = signatures.default; }; - Gmail = { - flavor = "gmail.com"; - address = "tibo.depeuter@gmail.com"; - realName = "Tibo De Peuter"; - signature = { - showSignature = "append"; - text = signatures.default; - }; - thunderbird = { - enable = true; - settings = id: { - "mail.identity.id_${id}.htmlSigText" = signatures.default; - }; - }; - - }; - MrFortem = { - flavor = "gmail.com"; - address = "fortemfiducia@gmail.com"; - - realName = "Fortem Fiducia"; - signature = { - showSignature = "attach"; - text = '' - Kind regards - MrFortem Fiducia - ''; - }; - - thunderbird = { - enable = true; - settings = id: { - "mail.server.server_${id}.directory" = ".thunderbird/tdpeuter/ImapMail/imap.gmail.com-mrfortem"; - "mail.server.server_${id}.directory-rel" = "[ProfD]ImapMail/imap.gmail.com-mrfortem"; - "mail.identity.id_${id}.htmlSigText" = signatures.MrFortem; - }; + primary = true; + thunderbird = { + enable = true; + settings = id: { + "mail.identity.id_${id}.htmlSigText" = signatures.default; }; }; }; + UGent = { + flavor = "outlook.office365.com"; + address = "tibo.depeuter@ugent.be"; + + realName = config.users.users.tdpeuter.description; + signature = { + showSignature = "append"; + text = signatures.UGent; + }; - programs = { thunderbird = { enable = true; - profiles.tdpeuter = { - isDefault = true; - settings = { - "mailnews.default_sort_order" = 2; # Sort descending - "mailnews.mark_message_read.delay" = true; - "mailnews.start_page.enabled" = false; - "mail.pane_config.dynamic" = 2; # Vertical view - }; + settings = id: { + "mail.server.server_${id}.authMethod" = 10; + "mail.smtpserver.smtp_${id}.authMethod" = 10; + "mail.identity.id_${id}.htmlSigText" = signatures.UGent; + }; + }; + }; + Gmail = { + flavor = "gmail.com"; + address = "tibo.depeuter@gmail.com"; + + realName = config.users.users.tdpeuter.description; + signature = { + showSignature = "append"; + text = signatures.default; + }; + thunderbird = { + enable = true; + settings = id: { + "mail.identity.id_${id}.htmlSigText" = signatures.default; + }; + }; + + }; + MrFortem = { + flavor = "gmail.com"; + address = "fortemfiducia@gmail.com"; + + realName = "Fortem Fiducia"; + signature = { + showSignature = "append"; + text = signatures.MrFortem; + }; + + thunderbird = { + enable = true; + settings = id: { + "mail.server.server_${id}.directory" = ".thunderbird/tdpeuter/ImapMail/imap.gmail.com-mrfortem"; + "mail.server.server_${id}.directory-rel" = "[ProfD]ImapMail/imap.gmail.com-mrfortem"; + "mail.identity.id_${id}.htmlSigText" = signatures.MrFortem; + }; + }; + }; + }; + + programs = { + thunderbird = { + enable = true; + profiles.tdpeuter = { + isDefault = true; + settings = { + "mailnews.default_sort_order" = 2; # Sort descending + "mailnews.mark_message_read.delay" = true; + "mailnews.start_page.enabled" = false; + "mail.pane_config.dynamic" = 2; # Vertical view }; }; }; From 10ad4de0c53dce07e90b0938fa6bf1175983a10d Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 20 Oct 2023 20:10:35 +0200 Subject: [PATCH 074/176] [firefox] Move into user config --- nixos/hosts/Tibo-NixFat/default.nix | 1 + nixos/modules-old/apps/default.nix | 5 -- nixos/modules-old/apps/firefox/default.nix | 56 -------------------- nixos/modules-old/default.nix | 11 ---- nixos/modules/users/tdpeuter/default.nix | 11 ++-- nixos/modules/users/tdpeuter/firefox.nix | 60 ++++++++++++++++++++++ 6 files changed, 69 insertions(+), 75 deletions(-) delete mode 100644 nixos/modules-old/apps/default.nix delete mode 100644 nixos/modules-old/apps/firefox/default.nix create mode 100644 nixos/modules/users/tdpeuter/firefox.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 4e7467f..7dec708 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -46,6 +46,7 @@ environment.systemPackages = with pkgs; [ git vim + w3m wget zenith-nvidia ]; diff --git a/nixos/modules-old/apps/default.nix b/nixos/modules-old/apps/default.nix deleted file mode 100644 index 3887b25..0000000 --- a/nixos/modules-old/apps/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./firefox - ]; -} diff --git a/nixos/modules-old/apps/firefox/default.nix b/nixos/modules-old/apps/firefox/default.nix deleted file mode 100644 index 56e0eb2..0000000 --- a/nixos/modules-old/apps/firefox/default.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ inputs, lib, config, pkgs, ... }: - -{ - home-manager.users.tdpeuter.programs.firefox = { - enable = true; - package = pkgs.firefox.override { - cfg = { - enableTridactylNative = true; - speechSynthesisSupport = true; # Allow Text-to-speech in e.g. Discord - }; - extraPolicies = { - DisableFirefoxStudies = true; - DisablePocket = true; - DisableTelemetry = true; - ExtensionSettings = {}; - OfferToSaveLogins = false; - }; - }; - profiles.tdpeuter = { - search = { - default = "DuckDuckGo"; - force = true; - engines = { - "Bing".metaData.hidden = true; - "eBay".metaData.hidden = true; - - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; - - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@np" ]; - }; - "GitHub" = { - urls = [{ - template = "https://github.com/search"; - params = [ - { name = "q"; value = "{searchTerms}"; } - { name = "type"; value = "repositories"; } - ]; - }]; - - icon = "${pkgs.icosystem}/share/icons/icosystem/scalable/apps/github-mark.svg"; - definedAliases = [ "@gh" ]; - }; - }; - }; - }; - }; -} - diff --git a/nixos/modules-old/default.nix b/nixos/modules-old/default.nix index 8073084..ec66e24 100644 --- a/nixos/modules-old/default.nix +++ b/nixos/modules-old/default.nix @@ -1,10 +1,6 @@ { inputs, lib, config, pkgs, ... }: { - imports = [ - ./apps - ]; - # Nix Flakes nix.package = pkgs.nixFlakes; nix.extraOptions = '' @@ -13,13 +9,6 @@ keep-derivations = true ''; - fonts.fonts = with pkgs; [ - corefonts # Calibri for Uni - vistafonts - - letter # Personal font - ]; - # Select internationalisation properties. i18n.defaultLocale = "en_GB.UTF-8"; console = { diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 2866f11..0be8d05 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -8,7 +8,8 @@ let in { imports = [ ./dotfiles.nix - ./mail.nix + ./firefox.nix # Enables Firefox without setting options + ./mail.nix # Enables Thunderbird without setting options ./secrets.nix ]; @@ -28,10 +29,13 @@ in { }; fonts.fonts = with pkgs; [ - font-awesome # Dependency of zsh + corefonts # Calibri for Uni font-awesome_5 # Dependency of Vifm config - noto-fonts # Dependency of Zellij config + font-awesome # Dependency of zsh + letter # Personal font noto-fonts-cjk # Dependency of Zellij config + noto-fonts # Dependency of Zellij config + vistafonts # Microsoft fonts ]; home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable { @@ -50,6 +54,7 @@ in { duf # Df alternative fzf glow # Terminal Markdown renderer + icosystem # Personal icon theme jellyfin-media-player kitty libreoffice-fresh diff --git a/nixos/modules/users/tdpeuter/firefox.nix b/nixos/modules/users/tdpeuter/firefox.nix new file mode 100644 index 0000000..1a43fe6 --- /dev/null +++ b/nixos/modules/users/tdpeuter/firefox.nix @@ -0,0 +1,60 @@ +{ config, lib, pkgs, pkgs-unstable, ... }: + +let + cfg = config.sisyphus.users.tdpeuter; + user = config.users.users.tdpeuter.name; +in { + config = lib.mkIf cfg.enable { + home-manager.users.tdpeuter.programs.firefox = lib.mkIf config.sisyphus.programs.home-manager.enable { + enable = true; + package = pkgs.firefox.override { + cfg = { + enableTridactylNative = true; + speechSynthesisSupport = true; # Allow Text-to-speech in e.g. Discord + }; + extraPolicies = { + DisableFirefoxStudies = true; + DisablePocket = true; + DisableTelemetry = true; + ExtensionSettings = {}; + OfferToSaveLogins = false; + }; + }; + profiles.tdpeuter = { + search = { + default = "DuckDuckGo"; + force = true; + engines = { + "Bing".metaData.hidden = true; + "eBay".metaData.hidden = true; + + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + "GitHub" = { + urls = [{ + template = "https://github.com/search"; + params = [ + { name = "q"; value = "{searchTerms}"; } + { name = "type"; value = "repositories"; } + ]; + }]; + + icon = "${pkgs.icosystem}/share/icons/icosystem/scalable/apps/github-mark.svg"; + definedAliases = [ "@gh" ]; + }; + }; + }; + }; + }; + }; +} From 00e003214ff095d5e133b25f1baf17cffbd04ab3 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 20 Oct 2023 20:29:11 +0200 Subject: [PATCH 075/176] Move users directory up --- nixos/README.md | 2 +- nixos/flake.nix | 3 +-- nixos/hosts/Tibo-NixFat/default.nix | 1 + nixos/modules/default.nix | 1 - nixos/{modules => }/users/default.nix | 0 .../{modules => }/users/tdpeuter/default.nix | 0 .../{modules => }/users/tdpeuter/dotfiles.nix | 22 +++++++++---------- .../{modules => }/users/tdpeuter/firefox.nix | 0 nixos/{modules => }/users/tdpeuter/mail.nix | 0 .../{modules => }/users/tdpeuter/secrets.nix | 6 ++--- 10 files changed, 17 insertions(+), 18 deletions(-) rename nixos/{modules => }/users/default.nix (100%) rename nixos/{modules => }/users/tdpeuter/default.nix (100%) rename nixos/{modules => }/users/tdpeuter/dotfiles.nix (81%) rename nixos/{modules => }/users/tdpeuter/firefox.nix (100%) rename nixos/{modules => }/users/tdpeuter/mail.nix (100%) rename nixos/{modules => }/users/tdpeuter/secrets.nix (82%) diff --git a/nixos/README.md b/nixos/README.md index e059c53..03b91e9 100644 --- a/nixos/README.md +++ b/nixos/README.md @@ -9,8 +9,8 @@ The directory structure is organized as follows: - [`flake.nix`](./flake.nix): Main entrypoint for the configuration. - [hosts/*hostname*](./hosts): Host-specific configuration by setting options. Each host has its own folder. - [modules](./modules): Declarations of configuration options. -- [modules/users/*username*](./modules/users): User-specific configuration. Users are defined as modules, as they are dependent on a host machine. - [overlays](./overlays): Attribute overrides for Nix Packages. - [secrets](./secrets): Encrypted files that store sensitive information, such as SSH private keys. +- [users/*username*](./modules/users): User-specific configuration. Users are defined as modules, so they can be enabled or disabled on a host machine. [Modules](https://nixos.wiki/wiki/NixOS_modules) are a key component of NixOS. They encapsulate various configuration options, which should make it easy for you to integrate it into your specific configuration. diff --git a/nixos/flake.nix b/nixos/flake.nix index f2ec5c5..e6a679e 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -58,8 +58,7 @@ home-manager.nixosModule sops-nix.nixosModules.sops ./modules - - ./modules-old # Wordt stilaan weggewerkt + ./users ]; }; diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 7dec708..1cea7fa 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -4,6 +4,7 @@ imports = [ ./hardware-configuration.nix ../../modules-old/hardware/nvidia.nix + ../../modules-old ]; sisyphus = { diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index b9d9008..c7dbaae 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -2,7 +2,6 @@ imports = [ ./programs ./services - ./users ./virtualisation ]; } diff --git a/nixos/modules/users/default.nix b/nixos/users/default.nix similarity index 100% rename from nixos/modules/users/default.nix rename to nixos/users/default.nix diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix similarity index 100% rename from nixos/modules/users/tdpeuter/default.nix rename to nixos/users/tdpeuter/default.nix diff --git a/nixos/modules/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix similarity index 81% rename from nixos/modules/users/tdpeuter/dotfiles.nix rename to nixos/users/tdpeuter/dotfiles.nix index e437cc1..d0a6df6 100644 --- a/nixos/modules/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -10,33 +10,33 @@ in { home = { file = { ".config/alacritty" = lib.mkIf (builtins.elem pkgs.alacritty installedPkgs) { - source = ../../../../stow/alacritty/.config/alacritty; + source = ../../../stow/alacritty/.config/alacritty; }; ".config/git" = { enable = (builtins.elem pkgs.git installedPkgs); - source = ../../../../stow/git/.config/git; + source = ../../../stow/git/.config/git; recursive = true; }; ".config/kitty" = { enable = builtins.elem pkgs.kitty installedPkgs; - source = ../../../../stow/kitty/.config/kitty; + source = ../../../stow/kitty/.config/kitty; recursive = true; }; ".config/mpv" = { enable = (builtins.elem pkgs-unstable.mpv installedPkgs); - source = ../../../../stow/mpv/.config/mpv; + source = ../../../stow/mpv/.config/mpv; }; ".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable { - source = ../../../../stow/ssh/.ssh/config; + source = ../../../stow/ssh/.ssh/config; }; ".config/vifm" = { enable = (builtins.elem pkgs.vifm installedPkgs); - source = ../../../../stow/vifm/.config/vifm; + source = ../../../stow/vifm/.config/vifm; recursive = true; }; ".config/zellij" = { enable = (builtins.elem pkgs.zellij installedPkgs); - source = ../../../../stow/zellij/.config/zellij; + source = ../../../stow/zellij/.config/zellij; }; ".oh-my-zsh" = { enable = (builtins.elem pkgs.zsh installedPkgs); @@ -45,11 +45,11 @@ in { }; ".oh-my-zsh/themes/tdpeuter.zsh-theme" = { enable = (builtins.elem pkgs.zsh installedPkgs); - source = ../../../../stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme; + source = ../../../stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme; }; ".vim" = { enable = (builtins.elem pkgs.vim installedPkgs); - source = ../../../../stow/vim/.vim; + source = ../../../stow/vim/.vim; recursive = true; }; ".vim/autoload/plug.vim" = { @@ -58,11 +58,11 @@ in { }; ".vimrc" = { enable = (builtins.elem pkgs.vim installedPkgs); - source = ../../../../stow/vim/.vimrc; + source = ../../../stow/vim/.vimrc; }; ".zshrc" = { enable = (config.users.users.tdpeuter.shell == pkgs.zsh); - source = ../../../../stow/zsh/.zshrc; + source = ../../../stow/zsh/.zshrc; }; ".zsh/plugins/cmdtime/cmdtime.plugin.zsh" = { enable = (builtins.elem pkgs.cmdtime installedPkgs); diff --git a/nixos/modules/users/tdpeuter/firefox.nix b/nixos/users/tdpeuter/firefox.nix similarity index 100% rename from nixos/modules/users/tdpeuter/firefox.nix rename to nixos/users/tdpeuter/firefox.nix diff --git a/nixos/modules/users/tdpeuter/mail.nix b/nixos/users/tdpeuter/mail.nix similarity index 100% rename from nixos/modules/users/tdpeuter/mail.nix rename to nixos/users/tdpeuter/mail.nix diff --git a/nixos/modules/users/tdpeuter/secrets.nix b/nixos/users/tdpeuter/secrets.nix similarity index 82% rename from nixos/modules/users/tdpeuter/secrets.nix rename to nixos/users/tdpeuter/secrets.nix index b2f208c..f97cdb0 100644 --- a/nixos/modules/users/tdpeuter/secrets.nix +++ b/nixos/users/tdpeuter/secrets.nix @@ -9,12 +9,12 @@ in { let Hugo = { format = "yaml"; - sopsFile = ../../../secrets/Hugo.yaml; + sopsFile = ../../secrets/Hugo.yaml; owner = user; }; UGent = { format = "yaml"; - sopsFile = ../../../secrets/UGent.yaml; + sopsFile = ../../secrets/UGent.yaml; owner = user; }; in { @@ -23,7 +23,7 @@ in { "GitHub/ssh" = { format = "yaml"; - sopsFile = ../../../secrets/GitHub.yaml; + sopsFile = ../../secrets/GitHub.yaml; owner = user; }; "Hugo/Gitea/ssh" = Hugo; From b57c8c329ac8b8c2a9b7260a02b555cfa024f97a Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 20 Oct 2023 22:28:37 +0200 Subject: [PATCH 076/176] [nvidia] Move into module --- nixos/flake.nix | 14 ++++-- .../Tibo-NixDesk/hardware-configuration.nix | 1 + nixos/hosts/Tibo-NixFat/default.nix | 4 +- nixos/modules-old/default.nix | 27 +++++++---- nixos/modules-old/hardware/nvidia.nix | 33 ------------- nixos/modules/default.nix | 1 + nixos/modules/hardware/default.nix | 5 ++ nixos/modules/hardware/nvidia/default.nix | 46 +++++++++++++++++++ nixos/users/tdpeuter/default.nix | 4 +- 9 files changed, 87 insertions(+), 48 deletions(-) delete mode 100644 nixos/modules-old/hardware/nvidia.nix create mode 100644 nixos/modules/hardware/default.nix create mode 100644 nixos/modules/hardware/nvidia/default.nix diff --git a/nixos/flake.nix b/nixos/flake.nix index e6a679e..31056f8 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -34,10 +34,12 @@ utils.lib.mkFlake { inherit self inputs; - channelsConfig = { - allowUnfree.allowUnfreePredicate = pkg: builtins.elem (utils.lib.getName pkg) [ - ]; - }; + channelsConfig.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ + "nvidia-x11" + "nvidia-settings" + "corefonts" + "vista-fonts" + ]; sharedOverlays = [ (import ./overlays/letter) @@ -51,6 +53,10 @@ specialArgs = { pkgs-unstable = import nixpkgs-unstable { inherit system; + config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ + "obsidian" + "spotify" + ]; }; }; diff --git a/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix b/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix index 571525e..a5ae163 100644 --- a/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix +++ b/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix @@ -31,6 +31,7 @@ "/nix" = { device = "/dev/disk/by-label/NIX-STORE"; fsType = "ext4"; + options = [ "noatime" ]; }; "/mnt/Nextcloud" = { diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 1cea7fa..7712d12 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -3,13 +3,15 @@ { imports = [ ./hardware-configuration.nix - ../../modules-old/hardware/nvidia.nix ../../modules-old ]; sisyphus = { users.tdpeuter.enable = true; + hardware.nvidia.enable = true; + hardware.nvidia.model = "T2000"; + programs = { home-manager.enable = true; sops.enable = true; diff --git a/nixos/modules-old/default.nix b/nixos/modules-old/default.nix index ec66e24..35fb80f 100644 --- a/nixos/modules-old/default.nix +++ b/nixos/modules-old/default.nix @@ -1,15 +1,26 @@ { inputs, lib, config, pkgs, ... }: { - # Nix Flakes - nix.package = pkgs.nixFlakes; - nix.extraOptions = '' - experimental-features = nix-command flakes - keep-outputs = true - keep-derivations = true - ''; + nix = { + # Allow Nix Flakes + # Keep derivations so shells don't break (direnv) + # If the disk has less than 100MiB, free up to 2GiB by garbage-collecting. + extraOptions = '' + experimental-features = nix-command flakes + keep-outputs = true + keep-derivations = true + min-free = ${toString (100 * 1024 * 1024)} + max-free = ${toString (2048 * 1024 * 1024)} + ''; + # Scheduled garbage-collect + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + package = pkgs.nixFlakes; + }; - # Select internationalisation properties. i18n.defaultLocale = "en_GB.UTF-8"; console = { # font = "Lat2-Terminus16"; diff --git a/nixos/modules-old/hardware/nvidia.nix b/nixos/modules-old/hardware/nvidia.nix deleted file mode 100644 index 1473758..0000000 --- a/nixos/modules-old/hardware/nvidia.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ inputs, lib, config, pkgs, ... }: - -let - nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' - export __NV_PRIME_RENDER_OFFLOAD=1 - export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 - export __GLX_VENDOR_LIBRARY_NAME=nvidia - export __VK_LAYER_NV_optimus=NVIDIA_only - exec "$@" - ''; -in -{ - nixpkgs.config.allowUnfree = true; - - services.xserver.videoDrivers = [ "nvidia" ]; - - hardware = { - opengl.enable = true; - nvidia = { - open = true; - package = config.boot.kernelPackages.nvidiaPackages.stable; - modesetting.enable = true; - }; - }; - - # Offloading - # environment.systemPackages = [ nvidia-offload ]; - # hardware.nvidia.prime = { - # offload.enable = true; - # intelBusId = "PCI::00:02:0"; - # nvidiaBusId = "PCI:01:00:0"; - # }; -} diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index c7dbaae..5f5812b 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./hardware ./programs ./services ./virtualisation diff --git a/nixos/modules/hardware/default.nix b/nixos/modules/hardware/default.nix new file mode 100644 index 0000000..efa0833 --- /dev/null +++ b/nixos/modules/hardware/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./nvidia + ]; +} diff --git a/nixos/modules/hardware/nvidia/default.nix b/nixos/modules/hardware/nvidia/default.nix new file mode 100644 index 0000000..34ba4e6 --- /dev/null +++ b/nixos/modules/hardware/nvidia/default.nix @@ -0,0 +1,46 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.hardware.nvidia; + + nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' + export __NV_PRIME_RENDER_OFFLOAD=1 + export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 + export __GLX_VENDOR_LIBRARY_NAME=nvidia + export __VK_LAYER_NV_optimus=NVIDIA_only + exec "$@" + ''; +in { + options.sisyphus.hardware.nvidia = { + enable = lib.mkEnableOption "NVIDIA GPU support"; + model = lib.mkOption { + type = lib.types.enum [ "" "T2000" "RTX 2060" ]; + default = ""; + example = "T2000"; + description = lib.mdDoc "The model of NVIDIA GPU card"; + }; + }; + + config = lib.mkIf cfg.enable { + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware = { + opengl.enable = true; + nvidia = { + open = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + modesetting.enable = true; + + prime = lib.mkIf (cfg.model == "T2000") { + offload.enable = true; + intelBusId = "PCI::00:02:0"; + nvidiaBusId = "PCI:01:00:0"; + }; + }; + }; + + environment.systemPackages = lib.mkIf (cfg.model != "") [ + nvidia-offload + ]; + }; +} diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index 0be8d05..56f51b8 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -60,10 +60,8 @@ in { libreoffice-fresh nextcloud-client nsxiv # Lightweight image viewer - obsidian oh-my-zsh qalculate-gtk # Calculator - spotify tea # Gitea CLI unzip vifm # File manager @@ -74,6 +72,8 @@ in { zsh-syntax-highlighting ]) ++ (with pkgs-unstable; [ mpv + obsidian + spotify ]) ++ (with pkgs.vimPlugins; [ statix vim-plug From 52e83e243513e7dd4525964408c60e714f0ca41b Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 20 Oct 2023 22:43:15 +0200 Subject: [PATCH 077/176] Fix README users not working --- nixos/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/README.md b/nixos/README.md index 03b91e9..552606d 100644 --- a/nixos/README.md +++ b/nixos/README.md @@ -11,6 +11,6 @@ The directory structure is organized as follows: - [modules](./modules): Declarations of configuration options. - [overlays](./overlays): Attribute overrides for Nix Packages. - [secrets](./secrets): Encrypted files that store sensitive information, such as SSH private keys. -- [users/*username*](./modules/users): User-specific configuration. Users are defined as modules, so they can be enabled or disabled on a host machine. +- [users/*username*](./users): User-specific configuration. Users are defined as modules, so they can be enabled or disabled on a host machine. [Modules](https://nixos.wiki/wiki/NixOS_modules) are a key component of NixOS. They encapsulate various configuration options, which should make it easy for you to integrate it into your specific configuration. From 789fb1902931e77a1021be8609e2553e1289ef38 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 20 Oct 2023 23:01:15 +0200 Subject: [PATCH 078/176] [kitty] Change soft-black to blue instead of black --- nixos/flake.lock | 6 +++--- stow/kitty/.config/kitty/themes/tdpeuter-light.conf | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index 6b5bbae..e397f53 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -93,11 +93,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1697456312, - "narHash": "sha256-roiSnrqb5r+ehnKCauPLugoU8S36KgmWraHgRqVYndo=", + "lastModified": 1697723726, + "narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ca012a02bf8327be9e488546faecae5e05d7d749", + "rev": "7c9cc5a6e5d38010801741ac830a3f8fd667a7a0", "type": "github" }, "original": { diff --git a/stow/kitty/.config/kitty/themes/tdpeuter-light.conf b/stow/kitty/.config/kitty/themes/tdpeuter-light.conf index fd8c278..b2537b7 100644 --- a/stow/kitty/.config/kitty/themes/tdpeuter-light.conf +++ b/stow/kitty/.config/kitty/themes/tdpeuter-light.conf @@ -6,7 +6,7 @@ url_color #F0F0F0 # black color0 #383A42 -color8 #383A42 +color8 #6272a4 # red color1 #E45649 From 18b5e573e261ff08b9f95b4c2ed3129090e99342 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 20 Oct 2023 23:17:15 +0200 Subject: [PATCH 079/176] [vim] Change LineNr to transparent background --- stow/vim/.vim/colors/tdpeuter-light.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stow/vim/.vim/colors/tdpeuter-light.vim b/stow/vim/.vim/colors/tdpeuter-light.vim index ebc7298..609cfac 100644 --- a/stow/vim/.vim/colors/tdpeuter-light.vim +++ b/stow/vim/.vim/colors/tdpeuter-light.vim @@ -59,7 +59,9 @@ call s:h("Cursor", s:bg, s:blue, "") call s:h("CursorColumn", "", s:cursor_line, "") call s:h("CursorLine", "", s:cursor_line, "") -call s:h("LineNr", s:gutter_fg, s:gutter_bg, "") +" call s:h("LineNr", s:gutter_fg, s:gutter_bg, "") +" Transparent column +hi LineNr guisp=NONE guifg=#d4d4d4 guibg=#fafafa ctermfg=252 ctermbg=NONE gui=NONE call s:h("CursorLineNr", s:fg, "", "") call s:h("DiffAdd", s:green, "", "") From c8d78da5d95f66e6ae30e158106dcbb5fb99a315 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Mon, 23 Oct 2023 22:18:18 +0200 Subject: [PATCH 080/176] [spotify] Fix adblock config file not found --- nixos/modules/apps/spotify/default.nix | 12 ++++++++---- nixos/overlays/spotify/default.nix | 24 +++++------------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/nixos/modules/apps/spotify/default.nix b/nixos/modules/apps/spotify/default.nix index 7d23b46..df5fbe7 100644 --- a/nixos/modules/apps/spotify/default.nix +++ b/nixos/modules/apps/spotify/default.nix @@ -2,10 +2,14 @@ { home-manager.users.tdpeuter = { - home.packages = with pkgs; [ - spotify - spotify-adblock - ]; + home = { + packages = with pkgs; [ + spotify + spotify-adblock + ]; + + file.".config/spotify-adblock/config.toml".source = "${pkgs.spotify-adblock}/config.toml"; + }; # Set the desktop entry to use adblock. # TODO Is it possible to inherit all other values? diff --git a/nixos/overlays/spotify/default.nix b/nixos/overlays/spotify/default.nix index a5f9c17..fc77396 100644 --- a/nixos/overlays/spotify/default.nix +++ b/nixos/overlays/spotify/default.nix @@ -15,24 +15,10 @@ final: prev: { cargo rustc ]; - }; -# spotify-wrapper = final.writeScriptBin "spotify-with-adblock" '' -# #!/bin/sh -# LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify -# ''; -# spotify = prev.spotify.overrideAttrs (something: rec { -# installPhase = '' -# echo no -# ''; -# desktopItem = something.desktopItem.override (desktop: { -# exec = "LD_PRELOAD=/usr/local/lib/spotify-adblock.so ${desktop.exec}"; -# }); -# -# installPhase = builtins.replaceString [ -# "${something.desktopItem}" -# ] [ -# "${desktopItem}" -# ] something.installPhase; -# }); + postPatch = '' + mkdir -p $out + cp $src/config.toml $out/config.toml + ''; + }; } From 698876102e838e2b1b2e811df8ea058636ff5ba5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 24 Oct 2023 12:43:44 +0200 Subject: [PATCH 081/176] [spotify] Move adblock around --- nixos/flake.lock | 18 +++++++++--------- nixos/modules/programs/default.nix | 1 + .../programs/spotify-adblock/default.nix | 11 +++++++++++ nixos/users/tdpeuter/default.nix | 4 ++-- 4 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 nixos/modules/programs/spotify-adblock/default.nix diff --git a/nixos/flake.lock b/nixos/flake.lock index e397f53..ba37cbe 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1697655685, - "narHash": "sha256-79Kuv+QdgsVc+rkibuAgWHnh8IXrLBTOKg5nM0Qvux0=", + "lastModified": 1697851979, + "narHash": "sha256-lJ8k4qkkwdvi+t/Xc6Fn74kUuobpu9ynPGxNZR6OwoA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "80c1aab725151632ddc2a20caeb914e76dd0673c", + "rev": "5550a85a087c04ddcace7f892b0bdc9d8bb080c8", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1697332183, - "narHash": "sha256-ACYvYsgLETfEI2xM1jjp8ZLVNGGC0onoCGe+69VJGGE=", + "lastModified": 1697929210, + "narHash": "sha256-RkQZif6QhswEwv7484mrKfIU8XmIWm+ED6llbr4IyxM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0e1cff585c1a85aeab059d3109f66134a8f76935", + "rev": "fb000224952bf7749a9e8b3779104ef7ea4465c8", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1697339241, - "narHash": "sha256-ITsFtEtRbCBeEH9XrES1dxZBkE1fyNNUfIyQjQ2AYQs=", + "lastModified": 1697943852, + "narHash": "sha256-DaBxUPaZhQ3yLCmAATshYB7qo7NwcMvSFWz9T3bjYYY=", "owner": "Mic92", "repo": "sops-nix", - "rev": "51186b8012068c417dac7c31fb12861726577898", + "rev": "30a0ba4a20703b4bfe047fe5def1fc24978e322c", "type": "github" }, "original": { diff --git a/nixos/modules/programs/default.nix b/nixos/modules/programs/default.nix index 335dd93..6a41a2f 100644 --- a/nixos/modules/programs/default.nix +++ b/nixos/modules/programs/default.nix @@ -3,5 +3,6 @@ ./home-manager ./sops ./ssh + ./spotify-adblock ]; } diff --git a/nixos/modules/programs/spotify-adblock/default.nix b/nixos/modules/programs/spotify-adblock/default.nix new file mode 100644 index 0000000..fc80856 --- /dev/null +++ b/nixos/modules/programs/spotify-adblock/default.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.programs.spotify-adblock; +in { + options.sisyphus.programs.spotify-adblock.enable = lib.mkEnableOption "Spotify adblock"; + + config = lib.mkIf cfg.enable { + environment.etc."spotify-adblock/config.toml".source = "${pkgs.spotify-adblock}/config.toml"; + }; +} diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index d73bd5f..29a5351 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -38,6 +38,8 @@ in { vistafonts # Microsoft fonts ]; + sisyphus.programs.spotify-adblock.enable = true; + home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable { programs.home-manager.enable = true; @@ -79,8 +81,6 @@ in { statix vim-plug ]); - - file.".config/spotify-adblock/config.toml".source = "${pkgs.spotify-adblock}/config.toml"; }; # GNOME ricing From 99231d0d046d1bcdcae446abcd17d1c934a1f6fc Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 24 Oct 2023 12:45:40 +0200 Subject: [PATCH 082/176] [nvidia] Update settings --- nixos/hosts/Tibo-NixFat/default.nix | 2 +- nixos/modules/hardware/nvidia/default.nix | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 7712d12..e88cf35 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -10,7 +10,7 @@ users.tdpeuter.enable = true; hardware.nvidia.enable = true; - hardware.nvidia.model = "T2000"; + hardware.nvidia.model = "Quadro T2000"; programs = { home-manager.enable = true; diff --git a/nixos/modules/hardware/nvidia/default.nix b/nixos/modules/hardware/nvidia/default.nix index 34ba4e6..701fcac 100644 --- a/nixos/modules/hardware/nvidia/default.nix +++ b/nixos/modules/hardware/nvidia/default.nix @@ -14,25 +14,38 @@ in { options.sisyphus.hardware.nvidia = { enable = lib.mkEnableOption "NVIDIA GPU support"; model = lib.mkOption { - type = lib.types.enum [ "" "T2000" "RTX 2060" ]; + type = lib.types.enum [ "" "Quadro T2000" "RTX 2060" ]; default = ""; - example = "T2000"; + example = "Quadro T2000"; description = lib.mdDoc "The model of NVIDIA GPU card"; }; + gui-settings = lib.mkEnableOption "NVIDIA settings menu"; }; config = lib.mkIf cfg.enable { services.xserver.videoDrivers = [ "nvidia" ]; hardware = { - opengl.enable = true; + opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; nvidia = { open = true; package = config.boot.kernelPackages.nvidiaPackages.stable; modesetting.enable = true; + nvidiaSettings = config.sisyphus.hardware.nvidia.gui-settings; + powerManagement = { + enable = true; + finegrained = true; + }; - prime = lib.mkIf (cfg.model == "T2000") { - offload.enable = true; + prime = lib.mkIf (cfg.model == "Quadro T2000") { + offload = { + enable = true; + enableOffloadCmd = true; + }; intelBusId = "PCI::00:02:0"; nvidiaBusId = "PCI:01:00:0"; }; From 759ebb3558bac38592d19f2c256c8a060f3433f4 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 24 Oct 2023 21:00:53 +0200 Subject: [PATCH 083/176] Update NixDesk --- nixos/flake.nix | 5 +- nixos/hosts/Tibo-NixDesk/default.nix | 126 ++++++++++-------- nixos/hosts/Tibo-NixFat/default.nix | 56 ++++---- .../modules-old/hardware/corsair/default.nix | 9 -- nixos/modules/default.nix | 1 + .../{services => }/desktop/default.nix | 0 .../{services => }/desktop/gnome/default.nix | 4 +- nixos/modules/hardware/nvidia/default.nix | 34 +++-- nixos/modules/services/default.nix | 3 +- nixos/modules/services/openrgb/default.nix | 15 +++ nixos/modules/services/pipewire/default.nix | 25 ++++ nixos/users/tdpeuter/default.nix | 7 +- 12 files changed, 182 insertions(+), 103 deletions(-) delete mode 100644 nixos/modules-old/hardware/corsair/default.nix rename nixos/modules/{services => }/desktop/default.nix (100%) rename nixos/modules/{services => }/desktop/gnome/default.nix (91%) create mode 100644 nixos/modules/services/openrgb/default.nix create mode 100644 nixos/modules/services/pipewire/default.nix diff --git a/nixos/flake.nix b/nixos/flake.nix index 3c296bc..3feca67 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -35,9 +35,10 @@ inherit self inputs; channelsConfig.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ - "nvidia-x11" - "nvidia-settings" "corefonts" + "nvidia-settings" + "nvidia-x11" + "Oracle_VM_VirtualBox_Extension_Pack" "vista-fonts" ]; diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index afb4b3b..b114570 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -1,64 +1,86 @@ { config, pkgs, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ../../modules/hardware/nvidia.nix - ../../modules/hardware/corsair + imports = [ + ./hardware-configuration.nix + ]; - ../../modules/apps/virtualbox - ../../modules/des/gnome - ]; + sisyphus = { + hardware.nvidia = { + enable = true; + model = "RTX 2060"; + }; - # Bootloader. - boot.loader = { - systemd-boot.enable = true; - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot/efi"; - }; + programs = { + home-manager.enable = true; + sops.enable = true; + ssh.enable = true; + }; + + services = { + pipewire.enable = true; + printing.enable = true; + openrgb.enable = true; + }; + + users.tdpeuter.enable = true; + + virtualisation.virtualbox.enable = true; }; + boot.loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; + }; + }; + + environment.systemPackages = with pkgs; [ + git + vim + w3m + wget + zenith-nvidia + ]; + + programs.zsh.enable = true; + + hardware.bluetooth.enable = true; + networking = { - hostName = "Tibo-NixDesk"; - networkmanager.enable = true; - # wireless.enable = true; # Enables wireless support via wpa_supplicant. + hostName = "Tibo-NixDesk"; + networkmanager.enable = true; + # wireless.enable = true; # Enables wireless support via wpa_supplicant. }; - # Set your time zone. - time.timeZone = "Europe/Brussels"; - - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - system.stateVersion = "23.05"; + + time.timeZone = "Europe/Brussels"; + + nix = { + # Allow Nix Flakes + # Keep derivations so shells don't break (direnv) + # If the disk has less than 100MiB, free up to 2GiB by garbage-collecting. + extraOptions = '' + experimental-features = nix-command flakes + keep-outputs = true + keep-derivations = true + min-free = ${toString (100 * 1024 * 1024)} + max-free = ${toString (2048 * 1024 * 1024)} + ''; + # Scheduled garbage-collect + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + package = pkgs.nixFlakes; + }; + + i18n.defaultLocale = "en_GB.UTF-8"; + console = { + # font = "Lat2-Terminus16"; + useXkbConfig = true; # use xkbOptions in tty. + }; } diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index e88cf35..d8970a4 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -3,24 +3,25 @@ { imports = [ ./hardware-configuration.nix - ../../modules-old ]; sisyphus = { - users.tdpeuter.enable = true; - - hardware.nvidia.enable = true; - hardware.nvidia.model = "Quadro T2000"; + hardware.nvidia = { + enable = true; + model = "Quadro T2000"; + }; programs = { home-manager.enable = true; sops.enable = true; ssh.enable = true; }; + services = { - desktop.gnome.enable = true; - printing.enable = true; + pipewire.enable = true; }; + + users.tdpeuter.enable = true; }; boot = { @@ -83,21 +84,30 @@ networking = { networkmanager.enable = true; }; - - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; + + nix = { + # Allow Nix Flakes + # Keep derivations so shells don't break (direnv) + # If the disk has less than 100MiB, free up to 2GiB by garbage-collecting. + extraOptions = '' + experimental-features = nix-command flakes + keep-outputs = true + keep-derivations = true + min-free = ${toString (100 * 1024 * 1024)} + max-free = ${toString (2048 * 1024 * 1024)} + ''; + # Scheduled garbage-collect + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + package = pkgs.nixFlakes; + }; + + i18n.defaultLocale = "en_GB.UTF-8"; + console = { + # font = "Lat2-Terminus16"; + useXkbConfig = true; # use xkbOptions in tty. }; } diff --git a/nixos/modules-old/hardware/corsair/default.nix b/nixos/modules-old/hardware/corsair/default.nix deleted file mode 100644 index c67bd77..0000000 --- a/nixos/modules-old/hardware/corsair/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ - services.hardware.openrgb = { - enable = true; - package = pkgs.openrgb-with-all-plugins; - motherboard = "intel"; - }; -} diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 5f5812b..7c3c16f 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./desktop ./hardware ./programs ./services diff --git a/nixos/modules/services/desktop/default.nix b/nixos/modules/desktop/default.nix similarity index 100% rename from nixos/modules/services/desktop/default.nix rename to nixos/modules/desktop/default.nix diff --git a/nixos/modules/services/desktop/gnome/default.nix b/nixos/modules/desktop/gnome/default.nix similarity index 91% rename from nixos/modules/services/desktop/gnome/default.nix rename to nixos/modules/desktop/gnome/default.nix index 186155e..dfe804e 100644 --- a/nixos/modules/services/desktop/gnome/default.nix +++ b/nixos/modules/desktop/gnome/default.nix @@ -1,9 +1,9 @@ { config, lib, pkgs, ... }: let - cfg = config.sisyphus.services.desktop.gnome; + cfg = config.sisyphus.desktop.gnome; in { - options.sisyphus.services.desktop.gnome.enable = lib.mkEnableOption "GNOME"; + options.sisyphus.desktop.gnome.enable = lib.mkEnableOption "GNOME"; config = lib.mkIf cfg.enable { services.xserver = { diff --git a/nixos/modules/hardware/nvidia/default.nix b/nixos/modules/hardware/nvidia/default.nix index 701fcac..077520d 100644 --- a/nixos/modules/hardware/nvidia/default.nix +++ b/nixos/modules/hardware/nvidia/default.nix @@ -3,6 +3,7 @@ let cfg = config.sisyphus.hardware.nvidia; + do-offloading = builtins.elem cfg.model [ "Quadro T2000" ]; nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' export __NV_PRIME_RENDER_OFFLOAD=1 export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 @@ -35,24 +36,33 @@ in { open = true; package = config.boot.kernelPackages.nvidiaPackages.stable; modesetting.enable = true; - nvidiaSettings = config.sisyphus.hardware.nvidia.gui-settings; + nvidiaSettings = cfg.gui-settings; powerManagement = { - enable = true; - finegrained = true; + enable = do-offloading; + finegrained = do-offloading; }; - prime = lib.mkIf (cfg.model == "Quadro T2000") { - offload = { - enable = true; - enableOffloadCmd = true; - }; - intelBusId = "PCI::00:02:0"; - nvidiaBusId = "PCI:01:00:0"; - }; + prime = lib.mkMerge [ + (lib.mkIf do-offloading { + offload = { + enable = true; + enableOffloadCmd = true; + }; + }) + (lib.mkIf (cfg.model == "Quadro T2000") { + intelBusId = "PCI::00:02:0"; + nvidiaBusId = "PCI:01:00:0"; + }) + (lib.mkIf (cfg.model == "RTX 2060") { + sync.enable = true; + intelBusId = "PCI::00:02:0"; + nvidiaBusId = "PCI:01:00:0"; + }) + ]; }; }; - environment.systemPackages = lib.mkIf (cfg.model != "") [ + environment.systemPackages = lib.mkIf do-offloading [ nvidia-offload ]; }; diff --git a/nixos/modules/services/default.nix b/nixos/modules/services/default.nix index 9fc4c37..8094bfa 100644 --- a/nixos/modules/services/default.nix +++ b/nixos/modules/services/default.nix @@ -1,7 +1,8 @@ { imports = [ - ./desktop + ./openrgb ./openssh + ./pipewire ./printing ]; } diff --git a/nixos/modules/services/openrgb/default.nix b/nixos/modules/services/openrgb/default.nix new file mode 100644 index 0000000..1898a0f --- /dev/null +++ b/nixos/modules/services/openrgb/default.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.services.openrgb; +in { + options.sisyphus.services.openrgb.enable = lib.mkEnableOption "OpenRGB"; + + config = lib.mkIf cfg.enable { + services.hardware.openrgb = { + enable = true; + package = pkgs.openrgb-with-all-plugins; + motherboard = "intel"; + }; + }; +} diff --git a/nixos/modules/services/pipewire/default.nix b/nixos/modules/services/pipewire/default.nix new file mode 100644 index 0000000..09393f0 --- /dev/null +++ b/nixos/modules/services/pipewire/default.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.services.pipewire; +in { + options.sisyphus.services.pipewire.enable = lib.mkEnableOption "Pipewire"; + + config = lib.mkIf cfg.enable { + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + }; +} diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index 29a5351..782ea1f 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -38,7 +38,10 @@ in { vistafonts # Microsoft fonts ]; - sisyphus.programs.spotify-adblock.enable = true; + sisyphus = { + desktop.gnome.enable = true; + programs.spotify-adblock.enable = true; + }; home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable { programs.home-manager.enable = true; @@ -86,7 +89,7 @@ in { # GNOME ricing # Browse available settings by running: # gsettings list-schemas | xargs -I % sh -c 'echo %; gsettings list-keys %' | less - dconf.settings = lib.mkIf config.sisyphus.services.desktop.gnome.enable { + dconf.settings = lib.mkIf config.sisyphus.desktop.gnome.enable { "org/gnome/desktop/background" = { picture-uri = "file:///home/tdpeuter/Nextcloud/Afbeeldingen/wallpapers/bg"; picture-uri-dark = "file:///home/tdpeuter/Nextcloud/Afbeeldingen/wallpapers/bg-dark"; From 7aba583074d9b8a37f93c86c5c9a5934d128077d Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 28 Oct 2023 11:14:50 +0200 Subject: [PATCH 084/176] [tailscale] Add module --- nixos/hosts/Tibo-NixFat/default.nix | 1 + nixos/modules/services/default.nix | 1 + nixos/modules/services/tailscale/default.nix | 14 ++++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 nixos/modules/services/tailscale/default.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index d8970a4..33aa410 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -19,6 +19,7 @@ services = { pipewire.enable = true; + tailscale.enable = true; }; users.tdpeuter.enable = true; diff --git a/nixos/modules/services/default.nix b/nixos/modules/services/default.nix index 8094bfa..ce7bc80 100644 --- a/nixos/modules/services/default.nix +++ b/nixos/modules/services/default.nix @@ -4,5 +4,6 @@ ./openssh ./pipewire ./printing + ./tailscale ]; } diff --git a/nixos/modules/services/tailscale/default.nix b/nixos/modules/services/tailscale/default.nix new file mode 100644 index 0000000..f0bbc05 --- /dev/null +++ b/nixos/modules/services/tailscale/default.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.services.tailscale; +in { + options.sisyphus.services.tailscale.enable = lib.mkEnableOption "Tailscale"; + + config = lib.mkIf cfg.enable { + services.tailscale = { + enable = true; + useRoutingFeatures = "client"; + }; + }; +} From 222dcbb4dd57d86bc8790c93d3d10a6e80f9a158 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 28 Oct 2023 11:18:31 +0200 Subject: [PATCH 085/176] Move unchecked configs to old folder --- {stow => arch/stow}/dunst/.config/dunst/dunstrc | 0 {stow => arch/stow}/sway/.config/sway/autostart.sh | 0 {stow => arch/stow}/sway/.config/sway/commands | 0 {stow => arch/stow}/sway/.config/sway/config | 0 {stow => arch/stow}/sway/.config/sway/modes | 0 {stow => arch/stow}/sway/.config/sway/style | 0 {stow => arch/stow}/swaylock/.config/swaylock/config | 0 {stow => arch/stow}/waybar/.config/waybar/config | 0 {stow => arch/stow}/waybar/.config/waybar/default.json | 0 {stow => arch/stow}/waybar/.config/waybar/left.json | 0 {stow => arch/stow}/waybar/.config/waybar/mediaplayer.py | 0 {stow => arch/stow}/waybar/.config/waybar/modules.json | 0 {stow => arch/stow}/waybar/.config/waybar/round.css | 0 {stow => arch/stow}/waybar/.config/waybar/sharp.css | 0 {stow => arch/stow}/waybar/.config/waybar/style.css | 0 {stow => arch/stow}/waybar/.config/waybar/transparent.css | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename {stow => arch/stow}/dunst/.config/dunst/dunstrc (100%) rename {stow => arch/stow}/sway/.config/sway/autostart.sh (100%) rename {stow => arch/stow}/sway/.config/sway/commands (100%) rename {stow => arch/stow}/sway/.config/sway/config (100%) rename {stow => arch/stow}/sway/.config/sway/modes (100%) rename {stow => arch/stow}/sway/.config/sway/style (100%) rename {stow => arch/stow}/swaylock/.config/swaylock/config (100%) rename {stow => arch/stow}/waybar/.config/waybar/config (100%) rename {stow => arch/stow}/waybar/.config/waybar/default.json (100%) rename {stow => arch/stow}/waybar/.config/waybar/left.json (100%) rename {stow => arch/stow}/waybar/.config/waybar/mediaplayer.py (100%) rename {stow => arch/stow}/waybar/.config/waybar/modules.json (100%) rename {stow => arch/stow}/waybar/.config/waybar/round.css (100%) rename {stow => arch/stow}/waybar/.config/waybar/sharp.css (100%) rename {stow => arch/stow}/waybar/.config/waybar/style.css (100%) rename {stow => arch/stow}/waybar/.config/waybar/transparent.css (100%) diff --git a/stow/dunst/.config/dunst/dunstrc b/arch/stow/dunst/.config/dunst/dunstrc similarity index 100% rename from stow/dunst/.config/dunst/dunstrc rename to arch/stow/dunst/.config/dunst/dunstrc diff --git a/stow/sway/.config/sway/autostart.sh b/arch/stow/sway/.config/sway/autostart.sh similarity index 100% rename from stow/sway/.config/sway/autostart.sh rename to arch/stow/sway/.config/sway/autostart.sh diff --git a/stow/sway/.config/sway/commands b/arch/stow/sway/.config/sway/commands similarity index 100% rename from stow/sway/.config/sway/commands rename to arch/stow/sway/.config/sway/commands diff --git a/stow/sway/.config/sway/config b/arch/stow/sway/.config/sway/config similarity index 100% rename from stow/sway/.config/sway/config rename to arch/stow/sway/.config/sway/config diff --git a/stow/sway/.config/sway/modes b/arch/stow/sway/.config/sway/modes similarity index 100% rename from stow/sway/.config/sway/modes rename to arch/stow/sway/.config/sway/modes diff --git a/stow/sway/.config/sway/style b/arch/stow/sway/.config/sway/style similarity index 100% rename from stow/sway/.config/sway/style rename to arch/stow/sway/.config/sway/style diff --git a/stow/swaylock/.config/swaylock/config b/arch/stow/swaylock/.config/swaylock/config similarity index 100% rename from stow/swaylock/.config/swaylock/config rename to arch/stow/swaylock/.config/swaylock/config diff --git a/stow/waybar/.config/waybar/config b/arch/stow/waybar/.config/waybar/config similarity index 100% rename from stow/waybar/.config/waybar/config rename to arch/stow/waybar/.config/waybar/config diff --git a/stow/waybar/.config/waybar/default.json b/arch/stow/waybar/.config/waybar/default.json similarity index 100% rename from stow/waybar/.config/waybar/default.json rename to arch/stow/waybar/.config/waybar/default.json diff --git a/stow/waybar/.config/waybar/left.json b/arch/stow/waybar/.config/waybar/left.json similarity index 100% rename from stow/waybar/.config/waybar/left.json rename to arch/stow/waybar/.config/waybar/left.json diff --git a/stow/waybar/.config/waybar/mediaplayer.py b/arch/stow/waybar/.config/waybar/mediaplayer.py similarity index 100% rename from stow/waybar/.config/waybar/mediaplayer.py rename to arch/stow/waybar/.config/waybar/mediaplayer.py diff --git a/stow/waybar/.config/waybar/modules.json b/arch/stow/waybar/.config/waybar/modules.json similarity index 100% rename from stow/waybar/.config/waybar/modules.json rename to arch/stow/waybar/.config/waybar/modules.json diff --git a/stow/waybar/.config/waybar/round.css b/arch/stow/waybar/.config/waybar/round.css similarity index 100% rename from stow/waybar/.config/waybar/round.css rename to arch/stow/waybar/.config/waybar/round.css diff --git a/stow/waybar/.config/waybar/sharp.css b/arch/stow/waybar/.config/waybar/sharp.css similarity index 100% rename from stow/waybar/.config/waybar/sharp.css rename to arch/stow/waybar/.config/waybar/sharp.css diff --git a/stow/waybar/.config/waybar/style.css b/arch/stow/waybar/.config/waybar/style.css similarity index 100% rename from stow/waybar/.config/waybar/style.css rename to arch/stow/waybar/.config/waybar/style.css diff --git a/stow/waybar/.config/waybar/transparent.css b/arch/stow/waybar/.config/waybar/transparent.css similarity index 100% rename from stow/waybar/.config/waybar/transparent.css rename to arch/stow/waybar/.config/waybar/transparent.css From 0d72ee0c84784545a034d912bd4b612b490cd6f5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 28 Oct 2023 12:49:49 +0200 Subject: [PATCH 086/176] Add themeswitch script --- nixos/flake.lock | 24 +++++------ scripts/toggle-light-dark.sh | 80 ++++++++++++++++++++++++++++++++++++ stow/vim/.vimrc | 2 +- 3 files changed, 93 insertions(+), 13 deletions(-) create mode 100755 scripts/toggle-light-dark.sh diff --git a/nixos/flake.lock b/nixos/flake.lock index ba37cbe..7bced25 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -8,11 +8,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1695973661, - "narHash": "sha256-BP2H4c42GThPIhERtTpV1yCtwQHYHEKdRu7pjrmQAwo=", + "lastModified": 1698410321, + "narHash": "sha256-MphuSlgpmKwtJncGMohryHiK55J1n6WzVQ/OAfmfoMc=", "owner": "numtide", "repo": "devshell", - "rev": "cd4e2fda3150dd2f689caeac07b7f47df5197c31", + "rev": "1aed986e3c81a4f6698e85a7452cbfcc4b31a36e", "type": "github" }, "original": { @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1697851979, - "narHash": "sha256-lJ8k4qkkwdvi+t/Xc6Fn74kUuobpu9ynPGxNZR6OwoA=", + "lastModified": 1698288402, + "narHash": "sha256-jIIjApPdm+4yt8PglX8pUOexAdEiAax/DXW3S/Mb21E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5550a85a087c04ddcace7f892b0bdc9d8bb080c8", + "rev": "60b9db998f71ea49e1a9c41824d09aa274be1344", "type": "github" }, "original": { @@ -93,11 +93,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1697723726, - "narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=", + "lastModified": 1698318101, + "narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7c9cc5a6e5d38010801741ac830a3f8fd667a7a0", + "rev": "63678e9f3d3afecfeafa0acead6239cdb447574c", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1697943852, - "narHash": "sha256-DaBxUPaZhQ3yLCmAATshYB7qo7NwcMvSFWz9T3bjYYY=", + "lastModified": 1698273636, + "narHash": "sha256-swsqg/ckSVJnravx7ie9NFQSKIH27owtlk0wh4+xStk=", "owner": "Mic92", "repo": "sops-nix", - "rev": "30a0ba4a20703b4bfe047fe5def1fc24978e322c", + "rev": "014e44d334a39481223a5d163530d4c4ca2e75cb", "type": "github" }, "original": { diff --git a/scripts/toggle-light-dark.sh b/scripts/toggle-light-dark.sh new file mode 100755 index 0000000..7ba6e5c --- /dev/null +++ b/scripts/toggle-light-dark.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash +# Toggle light- or dark-mode for your applications +# Usage: toggle [-m light|dark] + +################# +### Variables ### +################# + +THEME_LIGHT='tdpeuter-light' +THEME_DARK='tdpeuter-dark' +THEME_DEFAULT="${THEME_LIGHT}" + +STATE_FILE="${HOME}/.local/state/sisyphus/theme" + +declare -A theme_next +theme_next[${THEME_LIGHT}]="${THEME_DARK}" +theme_next[${THEME_DARK}]="${THEME_LIGHT}" + +declare -A gsettings_alt +gsettings_alt[${THEME_LIGHT}]='default' +gsettings_alt[${THEME_DARK}]='prefer-dark' + +############# +### Logic ### +############# + +# Parse options +while getopts ":m:" option; do + case "${option}" in + m) + if [ "${OPTARG}" == 'light' ]; then + theme="${THEME_LIGHT}" + elif [ "${OPTARG}" == 'dark' ]; then + theme="${THEME_DARK}" + else + >&2 printf "Error: Invalid mode: '%s'.\nShould be either 'light' or 'dark'\n" "${option}" + exit 1 + fi + ;; + *) + >&2 printf "Error: Invalid option: '%s'.\n" "${option}" + exit 1 + ;; + esac +done +shift $(( OPTIND - 1 )) + +# Check if the state file exists +if ! [ -d "$(dirname ${STATE_FILE})" ]; then + mkdir -p "$(dirname ${STATE_FILE})" +fi + +# Choose next theme +previous_theme="$(cat ${STATE_FILE})" +if ! [[ -z "${previous_theme}" || "${theme}" ]]; then + theme="${theme_next[${previous_theme}]}" +fi +echo "${theme:=${THEME_DEFAULT}}" > "${STATE_FILE}" + +###################### +### Set all themes ### +###################### + +# GNOME +if [ "$(command -v gsettings)" ]; then + gsettings set org.gnome.desktop.interface color-scheme "${gsettings_alt[${theme}]}" +fi + +# Kitty +if [ "$(command -v kitty)" ]; then + kitten themes --config-file-name theme.conf "${theme}" +fi + +# Vim +# This does not reload the config, but will use it when you restart vim +# Toggle an existing window using `:colorscheme ${theme}` +if [ "$(command -v vim)" ]; then + echo "colorscheme ${theme}" > ~/.vim/theme.conf +fi + diff --git a/stow/vim/.vimrc b/stow/vim/.vimrc index 933d6ed..bbd482f 100644 --- a/stow/vim/.vimrc +++ b/stow/vim/.vimrc @@ -2,7 +2,7 @@ " ~/.vimrc " -colorscheme tdpeuter-light +source ~/.vim/theme.conf set autoindent set conceallevel=2 From fb66f46e02a9353b3b11b3bf0d73a4627966d05d Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Mon, 30 Oct 2023 10:30:03 +0100 Subject: [PATCH 087/176] [OpenRGB] Fix --- nixos/flake.lock | 18 +- nixos/modules/services/openrgb/default.nix | 8 + nixos/users/tdpeuter/dotfiles.nix | 11 +- stow/openrgb/.config/OpenRGB/Default.orp | Bin 0 -> 3803 bytes stow/openrgb/.config/OpenRGB/OpenRGB.json | 1096 ++++++++++++++++++++ 5 files changed, 1121 insertions(+), 12 deletions(-) create mode 100644 stow/openrgb/.config/OpenRGB/Default.orp create mode 100644 stow/openrgb/.config/OpenRGB/OpenRGB.json diff --git a/nixos/flake.lock b/nixos/flake.lock index 7bced25..0d453b3 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1698288402, - "narHash": "sha256-jIIjApPdm+4yt8PglX8pUOexAdEiAax/DXW3S/Mb21E=", + "lastModified": 1698434055, + "narHash": "sha256-Phxi5mUKSoL7A0IYUiYtkI9e8NcGaaV5PJEaJApU1Ko=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "60b9db998f71ea49e1a9c41824d09aa274be1344", + "rev": "1a3c95e3b23b3cdb26750621c08cc2f1560cb883", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1697929210, - "narHash": "sha256-RkQZif6QhswEwv7484mrKfIU8XmIWm+ED6llbr4IyxM=", + "lastModified": 1698544399, + "narHash": "sha256-vhRmPyEyoPkrXF2iykBsWHA05MIaOSmMRLMF7Hul6+s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fb000224952bf7749a9e8b3779104ef7ea4465c8", + "rev": "d87c5d8c41c9b3b39592563242f3a448b5cc4bc9", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1698273636, - "narHash": "sha256-swsqg/ckSVJnravx7ie9NFQSKIH27owtlk0wh4+xStk=", + "lastModified": 1698548647, + "narHash": "sha256-7c03OjBGqnwDW0FBaBc+NjfEBxMkza+dxZGJPyIzfFE=", "owner": "Mic92", "repo": "sops-nix", - "rev": "014e44d334a39481223a5d163530d4c4ca2e75cb", + "rev": "632c3161a6cc24142c8e3f5529f5d81042571165", "type": "github" }, "original": { diff --git a/nixos/modules/services/openrgb/default.nix b/nixos/modules/services/openrgb/default.nix index 1898a0f..ae4fc51 100644 --- a/nixos/modules/services/openrgb/default.nix +++ b/nixos/modules/services/openrgb/default.nix @@ -6,6 +6,14 @@ in { options.sisyphus.services.openrgb.enable = lib.mkEnableOption "OpenRGB"; config = lib.mkIf cfg.enable { + services.udev.packages = with pkgs; [ + openrgb + ]; + + boot.kernelModules = [ "i2c-dev" ]; + + hardware.i2c.enable = true; + services.hardware.openrgb = { enable = true; package = pkgs.openrgb-with-all-plugins; diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index d0a6df6..9050b2b 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -26,13 +26,15 @@ in { enable = (builtins.elem pkgs-unstable.mpv installedPkgs); source = ../../../stow/mpv/.config/mpv; }; - ".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable { - source = ../../../stow/ssh/.ssh/config; + ".config/OpenRGB" = { + enable = config.sisyphus.services.openrgb.enable; + source = ../../../stow/openrgb/.config/OpenRGB; + recursive = true; }; ".config/vifm" = { enable = (builtins.elem pkgs.vifm installedPkgs); source = ../../../stow/vifm/.config/vifm; - recursive = true; + recursive = true; # Fix history and all working }; ".config/zellij" = { enable = (builtins.elem pkgs.zellij installedPkgs); @@ -47,6 +49,9 @@ in { enable = (builtins.elem pkgs.zsh installedPkgs); source = ../../../stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme; }; + ".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable { + source = ../../../stow/ssh/.ssh/config; + }; ".vim" = { enable = (builtins.elem pkgs.vim installedPkgs); source = ../../../stow/vim/.vim; diff --git a/stow/openrgb/.config/OpenRGB/Default.orp b/stow/openrgb/.config/OpenRGB/Default.orp new file mode 100644 index 0000000000000000000000000000000000000000..e1de89bcdbb4ea5b7919e9e4ef737b66996d3aff GIT binary patch literal 3803 zcmeH~eOD7l6vjtei;9S%)xO%*zKCyRlMo14Ym;miB1wn@L{Y0tGQif54VwVSYQ;EoQB9c!; zW^`o4bZ93-QOwAHh#x9xQ?9K+Qb<198;M(3re5{R>5oFgLTjYs&DkU2dz%d zLymupG5}YA1;&9&b=Cepmk!E0cnUo5D|i5+F(32y3d$yU0k(n4*z@2jh}uTwts`P( z#1_FbFbCE^3v_@4s&ALe9o#ZVr&+7qZ+Shb*MEp2ueH$GHft?=>spRdUCHb9t!mJE zqk|VHSd|+CtGVTG40LqNh?auxAPhR@h;BNgB|q(f7H7FnG%}A--`!r9q1Eu(*0gSS zn%cQ(bBLIDY}ORCFb%Ex-FC3wH{*@a@4|m8l(MViJgu5+`<_+X9nk6|E#-CV$Wm-p zF|n%K@qC-6SkvOXv0#M`E#gIr!Bx=d9IiNTL(yx!>GwRm&D6Px`E3q@o{lE{&ggjL zH>(x9iixsWE}QP+YOhfG9Afd_i2TU;XN)WW=7lBQC+ zLo!a+MP!x^F+U?FDyF{$Q`C}H%zK5`?1eR6s5dLObYqUK^sGV{2Kzdew08S%;&h!v zmgyX`<(OF1{kf)Uio05HGS*~wS8MYEf1j^=x^>boT^oGP+_Y^zF(w*j&3#i$Xu+qs z+#SeJ2iTc9A@5zWJGyn!89n{LS?m=-v*A^GZkoAi3d$cgQVi9>=*m9bU$N72xN>~O t7_Y6v86`c^)cGu?tno^7k&=Z&NT7qz&ar>{{+r*;|Mxxq{~SlH-Cs!tPVE2y literal 0 HcmV?d00001 diff --git a/stow/openrgb/.config/OpenRGB/OpenRGB.json b/stow/openrgb/.config/OpenRGB/OpenRGB.json new file mode 100644 index 0000000..beb068d --- /dev/null +++ b/stow/openrgb/.config/OpenRGB/OpenRGB.json @@ -0,0 +1,1096 @@ +{ + "AutoStart": { + "client": "localhost:6742", + "custom": "", + "enabled": true, + "host": "0.0.0.0", + "port": "6742", + "profile": "Default", + "setclient": false, + "setcustom": false, + "setminimized": false, + "setprofile": true, + "setserver": false, + "setserverhost": false, + "setserverport": false + }, + "Detectors": { + "detectors": { + "AMD Wraith Prism": false, + "ASRock Deskmini Addressable LED Strip": false, + "ASRock Motherboard SMBus Controllers": false, + "ASRock Polychrome SMBus": false, + "ASRock Polychrome USB": false, + "ASUS AREZ Strix RX Vega 56 O8G": false, + "ASUS Aura Addressable": false, + "ASUS Aura Core": false, + "ASUS Aura GPU": false, + "ASUS Aura GPU (ENE)": false, + "ASUS Aura Motherboard": false, + "ASUS Aura SMBus Motherboard": false, + "ASUS Cerberus Mech": false, + "ASUS GTX 1060 Strix": false, + "ASUS GTX 1060 Strix 6G Gaming": false, + "ASUS GTX 1070 Strix Gaming": false, + "ASUS GTX 1070 Strix OC": false, + "ASUS GTX 1080 Strix OC": false, + "ASUS KO RTX 3060 O12G V2 GAMING": false, + "ASUS KO RTX 3060 OC O12G GAMING": false, + "ASUS KO RTX 3060Ti O8G V2 GAMING": false, + "ASUS KO RTX 3070 O8G V2 GAMING": false, + "ASUS ROG AURA Terminal": false, + "ASUS ROG Balteus": false, + "ASUS ROG Balteus Qi": false, + "ASUS ROG Chakram (Wireless)": false, + "ASUS ROG Claymore": false, + "ASUS ROG Falchion (Wired)": false, + "ASUS ROG Falchion (Wireless)": false, + "ASUS ROG GTX 1660 Ti OC 6G": false, + "ASUS ROG Gladius II": false, + "ASUS ROG Gladius II Core": false, + "ASUS ROG Gladius II Origin": false, + "ASUS ROG Gladius II Origin COD": false, + "ASUS ROG Gladius II Origin PNK LTD": false, + "ASUS ROG Gladius II Wireless": false, + "ASUS ROG Gladius III": false, + "ASUS ROG Gladius III Wireless 2.4Ghz": false, + "ASUS ROG Gladius III Wireless Bluetooth": false, + "ASUS ROG Gladius III Wireless USB": false, + "ASUS ROG Keris": false, + "ASUS ROG Keris Wireless 2.4Ghz": false, + "ASUS ROG Keris Wireless Bluetooth": false, + "ASUS ROG Keris Wireless USB": false, + "ASUS ROG PG32UQ": false, + "ASUS ROG Pugio": false, + "ASUS ROG Pugio II (Wired)": false, + "ASUS ROG Pugio II (Wireless)": false, + "ASUS ROG Ryuo AIO": false, + "ASUS ROG STRIX 3060 O12G GAMING": false, + "ASUS ROG STRIX 3060 O12G V2 GAMING": false, + "ASUS ROG STRIX 3060Ti O8G OC": false, + "ASUS ROG STRIX 3060Ti O8G V2": false, + "ASUS ROG STRIX 3070 O8G GAMING": false, + "ASUS ROG STRIX 3070 O8G V2 GAMING": false, + "ASUS ROG STRIX 3070 O8G V2 White": false, + "ASUS ROG STRIX 3070 O8G White": false, + "ASUS ROG STRIX 3070 OC": false, + "ASUS ROG STRIX 3070Ti O8G GAMING": false, + "ASUS ROG STRIX 3080 10G GAMING": false, + "ASUS ROG STRIX 3080 10G V2 GAMING": false, + "ASUS ROG STRIX 3080 O10G GAMING": false, + "ASUS ROG STRIX 3080 O10G V2 GAMING": false, + "ASUS ROG STRIX 3080 O10G V2 WHITE": false, + "ASUS ROG STRIX 3080 O10G WHITE": false, + "ASUS ROG STRIX 3080Ti O12G GAMING": false, + "ASUS ROG STRIX 3090 24G GAMING": false, + "ASUS ROG STRIX 3090 O24G GAMING": false, + "ASUS ROG STRIX 3090 O24G GAMING White OC": false, + "ASUS ROG STRIX LC 3080Ti O12G GAMING": false, + "ASUS ROG STRIX RTX 2060 EVO Gaming 6G": false, + "ASUS ROG STRIX RTX 2060 O6G EVO Gaming": false, + "ASUS ROG STRIX RTX 2060 O6G Gaming": false, + "ASUS ROG STRIX RTX 2060S 8G Gaming": false, + "ASUS ROG STRIX RTX 2060S A8G EVO Gaming": false, + "ASUS ROG STRIX RTX 2060S A8G Gaming": false, + "ASUS ROG STRIX RTX 2060S O8G Gaming": false, + "ASUS ROG STRIX RTX 2070 A8G Gaming": false, + "ASUS ROG STRIX RTX 2070 O8G Gaming": false, + "ASUS ROG STRIX RTX 2070S 8G Gaming": false, + "ASUS ROG STRIX RTX 2070S A8G Gaming": false, + "ASUS ROG STRIX RTX 2070S O8G Gaming": false, + "ASUS ROG STRIX RTX 2080 8G Gaming": false, + "ASUS ROG STRIX RTX 2080 O8G Gaming": false, + "ASUS ROG STRIX RTX 2080 O8G V2 Gaming": false, + "ASUS ROG STRIX RTX 2080 Ti 11G Gaming": false, + "ASUS ROG STRIX RTX 2080 Ti A11G Gaming": false, + "ASUS ROG STRIX RTX 2080 Ti O11G Gaming": false, + "ASUS ROG STRIX RTX 2080S A8G Gaming": false, + "ASUS ROG STRIX RTX 2080S O8G Gaming": false, + "ASUS ROG STRIX RTX 2080S O8G White": false, + "ASUS ROG STRIX RTX 3080 12G": false, + "ASUS ROG STRIX RTX 3080 O12G": false, + "ASUS ROG STRIX RX470 O4G GAMING": false, + "ASUS ROG STRIX RX480 Gaming OC": false, + "ASUS ROG STRIX RX560 Gaming": false, + "ASUS ROG Strix Claw": false, + "ASUS ROG Strix Evolve": false, + "ASUS ROG Strix Flare": false, + "ASUS ROG Strix Flare PNK LTD": false, + "ASUS ROG Strix GTX 1050 O2G Gaming": false, + "ASUS ROG Strix GTX 1050 TI 4G Gaming": false, + "ASUS ROG Strix GTX 1050 TI O4G Gaming": false, + "ASUS ROG Strix GTX 1650S OC 4G": false, + "ASUS ROG Strix GTX 1660S O6G Gaming": false, + "ASUS ROG Strix GTX1070 Ti 8G Gaming": false, + "ASUS ROG Strix GTX1070 Ti A8G Gaming": false, + "ASUS ROG Strix GTX1080 A8G Gaming": false, + "ASUS ROG Strix GTX1080 O8G 11Gbps": false, + "ASUS ROG Strix GTX1080 O8G Gaming": false, + "ASUS ROG Strix GTX1080 Ti 11G Gaming": false, + "ASUS ROG Strix GTX1080 Ti Gaming": false, + "ASUS ROG Strix GTX1080 Ti O11G Gaming": false, + "ASUS ROG Strix Impact": false, + "ASUS ROG Strix Impact II": false, + "ASUS ROG Strix Impact II Electro Punk": false, + "ASUS ROG Strix Impact II Gundam": false, + "ASUS ROG Strix Impact II Moonlight White": false, + "ASUS ROG Strix Impact II Wireless 2.4 Ghz": false, + "ASUS ROG Strix Impact II Wireless USB": false, + "ASUS ROG Strix LC": false, + "ASUS ROG Strix SCAR 15": false, + "ASUS ROG Strix Scope": false, + "ASUS ROG Strix Scope RX": false, + "ASUS ROG Strix Scope TKL": false, + "ASUS ROG Strix Scope TKL PNK LTD": false, + "ASUS ROG Strix XG27AQ": false, + "ASUS ROG Strix XG27AQM": false, + "ASUS ROG Strix XG27W": false, + "ASUS ROG Throne": false, + "ASUS ROG Throne QI": false, + "ASUS ROG Throne QI GUNDAM": false, + "ASUS RX 5600XT Strix O6G Gaming": false, + "ASUS RX 570 Strix O4G Gaming OC": false, + "ASUS RX 5700XT Strix Gaming OC": false, + "ASUS RX 580 Strix Gaming OC": false, + "ASUS RX 580 Strix Gaming TOP": false, + "ASUS RX 6800 TUF Gaming OC": false, + "ASUS TUF 3060 O12G GAMING": false, + "ASUS TUF 3060 O12G V2 GAMING": false, + "ASUS TUF Gaming K3": false, + "ASUS TUF Gaming K7": false, + "ASUS TUF Gaming M3": false, + "ASUS TUF Gaming M5": false, + "ASUS TUF RTX 3060 Ti 8G Gaming OC": false, + "ASUS TUF RTX 3060Ti O8G OC": false, + "ASUS TUF RTX 3070 O8G GAMING": false, + "ASUS TUF RTX 3070 O8G V2 GAMING": false, + "ASUS TUF RTX 3070Ti O8G GAMING": false, + "ASUS TUF RTX 3070Ti O8G V2 GAMING": false, + "ASUS TUF RTX 3080 10G GAMING": false, + "ASUS TUF RTX 3080 O10G OC": false, + "ASUS TUF RTX 3080 O10G V2 GAMING": false, + "ASUS TUF RTX 3080 O12G GAMING": false, + "ASUS TUF RTX 3080Ti 12G GAMING": false, + "ASUS TUF RTX 3080Ti O12G GAMING": false, + "ASUS TUF RTX 3090 O24G": false, + "ASUS TUF RTX 3090 O24G OC": false, + "ASUS TUF RTX 4090 O24G": false, + "ASUS TUF RTX 4090 O24G OC": false, + "ASUS TUF RX 6800XT O16G GAMING": false, + "ASUS TUF RX 6900XT O16G GAMING": false, + "ASUS TUF RX 6900XT T16G GAMING": false, + "ASUS Vega 64 Strix": false, + "ASUS_TUF RX 6700XT O12G GAMING": false, + "Acer Predator Gaming Mouse (Rival 300)": false, + "Alienware AW510K": false, + "Anne Pro 2": false, + "Aorus CPU Coolers": false, + "Asus ROG Chakram (Wired)": false, + "Asus ROG Chakram Core": false, + "BlinkyTape": false, + "Bloody MP 50RS": false, + "Bloody W60 Pro": false, + "Cooler Master ARGB": false, + "Cooler Master ARGB Gen 2 A1": false, + "Cooler Master ARGB Gen 2 A1 V2": false, + "Cooler Master MK570": false, + "Cooler Master MK750": false, + "Cooler Master MM530": false, + "Cooler Master MM711": false, + "Cooler Master MM720": false, + "Cooler Master MM730": false, + "Cooler Master MP750 Large": false, + "Cooler Master MP750 Medium": false, + "Cooler Master MP750 XL": false, + "Cooler Master MasterKeys Pro L": false, + "Cooler Master MasterKeys Pro L White": false, + "Cooler Master MasterKeys Pro S": false, + "Cooler Master RGB": false, + "Cooler Master Radeon 6000 GPU": false, + "Cooler Master Radeon 6900 GPU": false, + "Cooler Master SK630": false, + "Cooler Master SK650": false, + "Cooler Master Small ARGB": false, + "Corsair 1000D Obsidian": false, + "Corsair Commander Core": false, + "Corsair Commander Pro": false, + "Corsair Dominator Platinum": false, + "Corsair Glaive RGB": false, + "Corsair Glaive RGB PRO": true, + "Corsair Harpoon RGB": false, + "Corsair Harpoon RGB PRO": false, + "Corsair Hydro H100i Platinum": false, + "Corsair Hydro H100i Platinum SE": false, + "Corsair Hydro H100i Pro XT": false, + "Corsair Hydro H100i Pro XT v2": false, + "Corsair Hydro H115i Platinum": false, + "Corsair Hydro H115i Pro XT": false, + "Corsair Hydro H150i Pro XT": false, + "Corsair Hydro H60i Pro XT": false, + "Corsair Hydro Series": false, + "Corsair Ironclaw RGB": false, + "Corsair K100": false, + "Corsair K55 RGB": false, + "Corsair K55 RGB PRO": false, + "Corsair K55 RGB PRO XT": false, + "Corsair K57 RGB (Wired)": false, + "Corsair K60 RGB PRO": false, + "Corsair K60 RGB PRO Low Profile": false, + "Corsair K65 LUX RGB": false, + "Corsair K65 Mini": false, + "Corsair K65 RGB": false, + "Corsair K65 RGB RAPIDFIRE": false, + "Corsair K68 RGB": true, + "Corsair K70 LUX": false, + "Corsair K70 LUX RGB": false, + "Corsair K70 RGB": false, + "Corsair K70 RGB MK.2": false, + "Corsair K70 RGB MK.2 Low Profile": false, + "Corsair K70 RGB MK.2 SE": false, + "Corsair K70 RGB RAPIDFIRE": false, + "Corsair K95 RGB": false, + "Corsair K95 RGB PLATINUM": false, + "Corsair K95 RGB PLATINUM XT": false, + "Corsair LS100 Lighting Kit": false, + "Corsair LT100": false, + "Corsair Lighting Node Core": false, + "Corsair Lighting Node Pro": false, + "Corsair M65": false, + "Corsair M65 PRO": false, + "Corsair M65 RGB Elite": false, + "Corsair MM700": false, + "Corsair MM800 RGB Polaris": false, + "Corsair Nightsword": false, + "Corsair SPEC OMEGA RGB": false, + "Corsair ST100 RGB": false, + "Corsair Sabre RGB": false, + "Corsair Scimitar Elite RGB": false, + "Corsair Scimitar PRO RGB": false, + "Corsair Scimitar RGB": false, + "Corsair Strafe": false, + "Corsair Strafe MK.2": false, + "Corsair Strafe Red": false, + "Corsair Vengeance": false, + "Corsair Vengeance Pro": false, + "Cougar 700K EVO Gaming Keyboard": false, + "Cougar Revenger ST": false, + "Creative SoundBlasterX G6": false, + "Crucial": false, + "Dark Project KD3B V2": false, + "Das Keyboard Q4 RGB": false, + "Das Keyboard Q5 RGB": false, + "Debug Controllers": false, + "Dell G Series LED Controller": false, + "Ducky One 2 RGB TKL": false, + "Ducky Shine 7/Ducky One 2 RGB": false, + "Dygma Raise": false, + "E1.31": false, + "EK Loop Connect": false, + "ENE SMBus DRAM": false, + "EVGA GP102 GPU": false, + "EVGA GPU": false, + "EVGA GeForce RTX 2070 SUPER FTW3 Ultra": false, + "EVGA GeForce RTX 2070 SUPER FTW3 Ultra+": false, + "EVGA GeForce RTX 2070 SUPER XC Ultra": false, + "EVGA GeForce RTX 2070 SUPER XC Ultra+": false, + "EVGA GeForce RTX 2070 XC Gaming": false, + "EVGA GeForce RTX 2070 XC OC": false, + "EVGA GeForce RTX 2080 Black": false, + "EVGA GeForce RTX 2080 SUPER FTW3 Hybrid OC": false, + "EVGA GeForce RTX 2080 SUPER FTW3 Ultra": false, + "EVGA GeForce RTX 2080 SUPER FTW3 Ultra Hydro Copper": false, + "EVGA GeForce RTX 2080 SUPER XC Gaming": false, + "EVGA GeForce RTX 2080 SUPER XC Ultra": false, + "EVGA GeForce RTX 2080 XC Black": false, + "EVGA GeForce RTX 2080 XC Gaming": false, + "EVGA GeForce RTX 2080 XC Ultra Gaming": false, + "EVGA GeForce RTX 2080Ti Black": false, + "EVGA GeForce RTX 2080Ti FTW3 Ultra": false, + "EVGA GeForce RTX 2080Ti XC HYBRID GAMING": false, + "EVGA GeForce RTX 2080Ti XC HYDRO COPPER": false, + "EVGA GeForce RTX 2080Ti XC Ultra": false, + "EVGA GeForce RTX 3060TI FTW3 Gaming": false, + "EVGA GeForce RTX 3060TI FTW3 Ultra": false, + "EVGA GeForce RTX 3060TI FTW3 Ultra LHR": false, + "EVGA GeForce RTX 3070 Black Gaming": false, + "EVGA GeForce RTX 3070 FTW3 Ultra": false, + "EVGA GeForce RTX 3070 FTW3 Ultra LHR": false, + "EVGA GeForce RTX 3070 XC3 Gaming": false, + "EVGA GeForce RTX 3070 XC3 Ultra": false, + "EVGA GeForce RTX 3070 XC3 Ultra LHR": false, + "EVGA GeForce RTX 3070Ti FTW3 Ultra": false, + "EVGA GeForce RTX 3070Ti FTW3 Ultra v2": false, + "EVGA GeForce RTX 3070Ti XC3 Gaming": false, + "EVGA GeForce RTX 3070Ti XC3 Ultra": false, + "EVGA GeForce RTX 3070Ti XC3 Ultra v2": false, + "EVGA GeForce RTX 3080 FTW3 Gaming": false, + "EVGA GeForce RTX 3080 FTW3 Ultra": false, + "EVGA GeForce RTX 3080 FTW3 Ultra 12GB": false, + "EVGA GeForce RTX 3080 FTW3 Ultra Hybrid": false, + "EVGA GeForce RTX 3080 FTW3 Ultra Hybrid Gaming LHR": false, + "EVGA GeForce RTX 3080 FTW3 Ultra Hybrid LHR": false, + "EVGA GeForce RTX 3080 FTW3 Ultra Hydro Copper": false, + "EVGA GeForce RTX 3080 FTW3 Ultra Hydro Copper 12G": false, + "EVGA GeForce RTX 3080 FTW3 Ultra LHR": false, + "EVGA GeForce RTX 3080 FTW3 Ultra v2 LHR": false, + "EVGA GeForce RTX 3080 XC3 Black": false, + "EVGA GeForce RTX 3080 XC3 Black LHR": false, + "EVGA GeForce RTX 3080 XC3 Gaming": false, + "EVGA GeForce RTX 3080 XC3 Gaming LHR": false, + "EVGA GeForce RTX 3080 XC3 Ultra": false, + "EVGA GeForce RTX 3080 XC3 Ultra Hybrid": false, + "EVGA GeForce RTX 3080 XC3 Ultra Hybrid LHR": false, + "EVGA GeForce RTX 3080 XC3 Ultra Hydro Copper": false, + "EVGA GeForce RTX 3080 XC3 Ultra LHR": false, + "EVGA GeForce RTX 3080Ti FTW3 Ultra": false, + "EVGA GeForce RTX 3080Ti FTW3 Ultra Hybrid": false, + "EVGA GeForce RTX 3080Ti FTW3 Ultra Hydro Copper": false, + "EVGA GeForce RTX 3080Ti XC3 Gaming": false, + "EVGA GeForce RTX 3080Ti XC3 Gaming Hybrid": false, + "EVGA GeForce RTX 3080Ti XC3 Gaming Hydro Copper": false, + "EVGA GeForce RTX 3080Ti XC3 Ultra Gaming": false, + "EVGA GeForce RTX 3090 FTW3 Ultra": false, + "EVGA GeForce RTX 3090 FTW3 Ultra Hybrid": false, + "EVGA GeForce RTX 3090 FTW3 Ultra Hydro Copper": false, + "EVGA GeForce RTX 3090 FTW3 Ultra v2": false, + "EVGA GeForce RTX 3090 FTW3 Ultra v3": false, + "EVGA GeForce RTX 3090 K|NGP|N Hybrid": false, + "EVGA GeForce RTX 3090 K|NGP|N Hydro Copper": false, + "EVGA GeForce RTX 3090 XC3 Black": false, + "EVGA GeForce RTX 3090 XC3 Gaming": false, + "EVGA GeForce RTX 3090 XC3 Ultra": false, + "EVGA GeForce RTX 3090 XC3 Ultra Hybrid": false, + "EVGA GeForce RTX 3090 XC3 Ultra Hydro Copper": false, + "EVGA GeForce RTX 3090Ti FTW3 Gaming": false, + "EVGA GeForce RTX 3090Ti FTW3 Ultra Gaming": false, + "EVGA Pascal GPU": false, + "EVGA X20 Gaming Mouse": false, + "EVGA X20 USB Receiver": false, + "EVGA Z15 Keyboard": false, + "EVGA Z20 Keyboard": false, + "EVision Keyboard 0C45:5004": false, + "EVision Keyboard 0C45:5104": false, + "EVision Keyboard 0C45:5204": false, + "EVision Keyboard 0C45:652F": false, + "EVision Keyboard 0C45:7698": false, + "EVision Keyboard 0C45:8520": false, + "EVision Keyboard 320F:502A": false, + "ElgatoKeyLight": false, + "Espurna": false, + "Everest GT-100 RGB": false, + "FL ESPORTS F11": false, + "FanBus": false, + "Faustus": false, + "GALAX RTX 2070 Super EX Gamer Black": false, + "GaiZhongGai 17 PRO": false, + "GaiZhongGai 17+4+Touch PRO": false, + "GaiZhongGai 20 PRO": false, + "GaiZhongGai 68+4 PRO": false, + "Gainward GPU": false, + "Gainward GTX 1080 Phoenix": false, + "Gainward GTX 1080 Ti Phoenix": false, + "Gainward RTX 2070 Super Phantom": false, + "Gainward RTX 2080 Phoenix GS": false, + "Gainward RTX 3070 Phoenix": false, + "Gainward RTX 3080 Ti Phoenix": false, + "Galax GPU": false, + "Genesis Thor 300": false, + "Gigabyte AORUS RTX2060 SUPER 8G V1": false, + "Gigabyte AORUS RTX2070 SUPER 8G": false, + "Gigabyte AORUS RTX2070 XTREME 8G": false, + "Gigabyte AORUS RTX2080 8G": false, + "Gigabyte AORUS RTX2080 SUPER 8G": false, + "Gigabyte AORUS RTX2080 SUPER 8G Rev 1.0": false, + "Gigabyte AORUS RTX2080 SUPER Waterforce WB 8G": false, + "Gigabyte AORUS RTX2080 Ti XTREME 11G": false, + "Gigabyte AORUS RTX2080 XTREME 8G": false, + "Gigabyte AORUS RTX3060 ELITE 12G": false, + "Gigabyte AORUS RTX3060 Ti ELITE 8G LHR": false, + "Gigabyte AORUS RTX3070 Ti MASTER 8G": false, + "Gigabyte AORUS RTX3080 Ti XTREME WATERFORCE 12G": false, + "Gigabyte AORUS RTX3080 XTREME WATERFORCE 10G Rev 2.0": false, + "Gigabyte AORUS RTX3080 XTREME WATERFORCE WB 10G": false, + "Gigabyte AORUS RTX3090 XTREME WATERFORCE 24G": false, + "Gigabyte AORUS RTX3090 XTREME WATERFORCE WB 24G": false, + "Gigabyte GTX1050 Ti G1 Gaming": false, + "Gigabyte GTX1050 Ti G1 Gaming (rev A1)": false, + "Gigabyte GTX1060 G1 Gaming 6G": false, + "Gigabyte GTX1060 G1 Gaming 6G OC": false, + "Gigabyte GTX1060 Xtreme Gaming V1": false, + "Gigabyte GTX1060 Xtreme Gaming v2": false, + "Gigabyte GTX1070 G1 Gaming 8G V1": false, + "Gigabyte GTX1070 Ti 8G Gaming": false, + "Gigabyte GTX1070 Xtreme Gaming": false, + "Gigabyte GTX1080 G1 Gaming": false, + "Gigabyte GTX1080 Ti 11G": false, + "Gigabyte GTX1080 Ti Gaming OC 11G": false, + "Gigabyte GTX1080 Ti Gaming OC BLACK 11G": false, + "Gigabyte GTX1080 Ti Xtreme Edition": false, + "Gigabyte GTX1080 Ti Xtreme Waterforce Edition": false, + "Gigabyte GTX1650 Gaming OC": false, + "Gigabyte GTX1660 Gaming OC 6G": false, + "Gigabyte GTX1660 SUPER Gaming OC": false, + "Gigabyte RGB": false, + "Gigabyte RGB Fusion": false, + "Gigabyte RGB Fusion 2 DRAM": false, + "Gigabyte RGB Fusion 2 SMBus": false, + "Gigabyte RGB Fusion 2 USB": false, + "Gigabyte RGB Fusion GPU": false, + "Gigabyte RGB Fusion2 GPU": false, + "Gigabyte RTX2060 Gaming OC": false, + "Gigabyte RTX2060 Gaming OC PRO": false, + "Gigabyte RTX2060 Gaming OC PRO V2": false, + "Gigabyte RTX2060 Gaming OC PRO White": false, + "Gigabyte RTX2060 SUPER Gaming": false, + "Gigabyte RTX2060 SUPER Gaming OC": false, + "Gigabyte RTX2060 SUPER Gaming OC 3X 8G V2": false, + "Gigabyte RTX2060 SUPER Gaming OC 3X White 8G": false, + "Gigabyte RTX2070 Gaming OC 8G": false, + "Gigabyte RTX2070 Windforce 8G": false, + "Gigabyte RTX2070S Gaming OC": false, + "Gigabyte RTX2070S Gaming OC 3X": false, + "Gigabyte RTX2070S Gaming OC 3X White": false, + "Gigabyte RTX2080 Gaming OC 8G": false, + "Gigabyte RTX2080 Ti GAMING OC 11G": false, + "Gigabyte RTX2080S Gaming OC 8G": false, + "Gigabyte RTX3050 Gaming OC 8G": false, + "Gigabyte RTX3060 EAGLE 12G LHR V2": false, + "Gigabyte RTX3060 EAGLE OC 12G": false, + "Gigabyte RTX3060 EAGLE OC 12G V2": false, + "Gigabyte RTX3060 Gaming OC 12G": false, + "Gigabyte RTX3060 Gaming OC 12G (rev. 2.0)": false, + "Gigabyte RTX3060 Ti EAGLE OC 8G": false, + "Gigabyte RTX3060 Ti EAGLE OC 8G V2.0 LHR": false, + "Gigabyte RTX3060 Ti GAMING OC LHR 8G": false, + "Gigabyte RTX3060 Ti GAMING OC PRO 8G": false, + "Gigabyte RTX3060 Ti Gaming OC PRO 8G LHR": false, + "Gigabyte RTX3060 Ti Vision OC 8G": false, + "Gigabyte RTX3060 Vision OC 12G": false, + "Gigabyte RTX3060 Vision OC 12G LHR": false, + "Gigabyte RTX3060 Vision OC 12G v3.0": false, + "Gigabyte RTX3070 Eagle OC 8G": false, + "Gigabyte RTX3070 Gaming OC 8G": false, + "Gigabyte RTX3070 Gaming OC 8G v3.0 LHR": false, + "Gigabyte RTX3070 MASTER 8G": false, + "Gigabyte RTX3070 MASTER 8G LHR": false, + "Gigabyte RTX3070 Ti EAGLE 8G": false, + "Gigabyte RTX3070 Ti Gaming OC 8G": false, + "Gigabyte RTX3070 Ti Vision OC 8G": false, + "Gigabyte RTX3070 Vision 8G": false, + "Gigabyte RTX3070 Vision 8G V2.0 LHR": false, + "Gigabyte RTX3080 Gaming OC 10G": false, + "Gigabyte RTX3080 Gaming OC 12G": false, + "Gigabyte RTX3080 Ti EAGLE 12G": false, + "Gigabyte RTX3080 Ti Gaming OC 12G": false, + "Gigabyte RTX3080 Ti Vision OC 12G": false, + "Gigabyte RTX3080 Vision OC 10G": false, + "Gigabyte RTX3080 Vision OC 10G (REV 2.0)": false, + "Gigabyte RTX3090 Gaming OC 24G": false, + "Glorious Model D / D-": false, + "Glorious Model D / D- Wireless": false, + "Glorious Model O / O-": false, + "Glorious Model O / O- Wireless": false, + "HP Omen 30L": false, + "Holtek Mousemat": false, + "Holtek USB Gaming Mouse": false, + "HyperX Alloy Elite 2": false, + "HyperX Alloy Elite 2 (HP)": false, + "HyperX Alloy Elite RGB": false, + "HyperX Alloy FPS RGB": false, + "HyperX Alloy Origins": false, + "HyperX Alloy Origins 60": false, + "HyperX Alloy Origins Core": false, + "HyperX DRAM": false, + "HyperX Fury Ultra": false, + "HyperX Pulsefire Core": false, + "HyperX Pulsefire Dart (Wired)": false, + "HyperX Pulsefire Dart (Wireless)": false, + "HyperX Pulsefire FPS Pro": false, + "HyperX Pulsefire Haste": false, + "HyperX Pulsefire Mat": false, + "HyperX Pulsefire Raid": false, + "HyperX Pulsefire Surge": false, + "Intel Arc A770 Limited Edition": false, + "KFA2 RTX 2070 EX": false, + "KFA2 RTX 2080 EX OC": false, + "KFA2 RTX 2080 Super EX OC": false, + "KFA2 RTX 2080 TI EX OC": false, + "Keychron Gaming Keyboard 1": false, + "LED Strip": false, + "LIFX": false, + "Lenovo Legion 7 gen 5": false, + "Lenovo Legion 7 gen 6": false, + "Lenovo Legion 7S gen 5": false, + "Lenovo Legion 7S gen 6": false, + "Lenovo Legion Y740": false, + "Lian Li O11 Dynamic - Razer Edition": false, + "Lian Li Uni Hub": false, + "Lian Li Uni Hub - AL": false, + "Linux LED": false, + "Logitech G Pro (HERO) Gaming Mouse": false, + "Logitech G Pro Gaming Mouse": false, + "Logitech G Pro RGB Mechanical Gaming Keyboard": false, + "Logitech G Pro Wireless Gaming Mouse": false, + "Logitech G Pro Wireless Gaming Mouse (wired)": false, + "Logitech G203 Lightsync": false, + "Logitech G203 Prodigy": false, + "Logitech G213": false, + "Logitech G303 Daedalus Apex": false, + "Logitech G403 Hero": false, + "Logitech G403 Prodigy Gaming Mouse": false, + "Logitech G403 Wireless Gaming Mouse": false, + "Logitech G403 Wireless Gaming Mouse (wired)": false, + "Logitech G502 Hero Gaming Mouse": false, + "Logitech G502 Proteus Spectrum Gaming Mouse": false, + "Logitech G502 Wireless Gaming Mouse": false, + "Logitech G502 Wireless Gaming Mouse (wired)": false, + "Logitech G512": false, + "Logitech G512 RGB": false, + "Logitech G560 Lightsync Speaker": false, + "Logitech G610 Orion": false, + "Logitech G703 Hero Wireless Gaming Mouse": false, + "Logitech G703 Hero Wireless Gaming Mouse (wired)": false, + "Logitech G703 Wireless Gaming Mouse": false, + "Logitech G703 Wireless Gaming Mouse (wired)": false, + "Logitech G733 Gaming Headset": false, + "Logitech G810 Orion Spectrum": false, + "Logitech G813 RGB Mechanical Gaming Keyboard": false, + "Logitech G815 RGB Mechanical Gaming Keyboard": false, + "Logitech G900 Wireless Gaming Mouse": false, + "Logitech G900 Wireless Gaming Mouse (wired)": false, + "Logitech G903 Hero Wireless Gaming Mouse": false, + "Logitech G903 Hero Wireless Gaming Mouse (wired)": false, + "Logitech G903 Wireless Gaming Mouse": false, + "Logitech G903 Wireless Gaming Mouse (wired)": false, + "Logitech G910 Orion Spark": false, + "Logitech G910 Orion Spectrum": false, + "Logitech G915 Wireless RGB Mechanical Gaming Keyboard": false, + "Logitech G915 Wireless RGB Mechanical Gaming Keyboard (Wired)": false, + "Logitech G915TKL Wireless RGB Mechanical Gaming Keyboard": false, + "Logitech G915TKL Wireless RGB Mechanical Gaming Keyboard (Wired)": false, + "Logitech G933 Lightsync Headset": false, + "Logitech G935 Gaming Headset": false, + "Logitech Powerplay Mat": false, + "Logitech X56 Rhino Hotas Joystick": false, + "Logitech X56 Rhino Hotas Throttle": false, + "MSI 3-Zone Laptop": false, + "MSI GPU": false, + "MSI GeForce GTX 1070 Gaming X": false, + "MSI GeForce GTX 1660 Gaming X 6G": false, + "MSI GeForce GTX 1660 Super Gaming 6G": false, + "MSI GeForce GTX 1660 Super Gaming X 6G": false, + "MSI GeForce GTX 1660Ti Gaming 6G": false, + "MSI GeForce GTX 1660Ti Gaming X 6G": false, + "MSI GeForce RTX 2060 Gaming Z 6G": false, + "MSI GeForce RTX 2060 Super ARMOR OC": false, + "MSI GeForce RTX 2060 Super Gaming X": false, + "MSI GeForce RTX 2070 ARMOR": false, + "MSI GeForce RTX 2070 ARMOR OC": false, + "MSI GeForce RTX 2070 Gaming": false, + "MSI GeForce RTX 2070 Gaming Z": false, + "MSI GeForce RTX 2070 SUPER ARMOR OC": false, + "MSI GeForce RTX 2070 Super Gaming": false, + "MSI GeForce RTX 2070 Super Gaming Trio": false, + "MSI GeForce RTX 2070 Super Gaming X": false, + "MSI GeForce RTX 2070 Super Gaming X Trio": false, + "MSI GeForce RTX 2070 Super Gaming Z Trio": false, + "MSI GeForce RTX 2080 Duke 8G OC": false, + "MSI GeForce RTX 2080 Gaming Trio": false, + "MSI GeForce RTX 2080 Gaming X Trio": false, + "MSI GeForce RTX 2080 Sea Hawk EK X": false, + "MSI GeForce RTX 2080 Super Gaming X Trio": false, + "MSI GeForce RTX 2080Ti 11G Gaming X Trio": false, + "MSI GeForce RTX 2080Ti Gaming X Trio": false, + "MSI GeForce RTX 2080Ti Gaming Z Trio": false, + "MSI GeForce RTX 2080Ti Sea Hawk EK X": false, + "MSI GeForce RTX 3060 12G Gaming X Trio LHR": false, + "MSI GeForce RTX 3060 12GB Gaming X Trio": false, + "MSI GeForce RTX 3060 Gaming X 12G": false, + "MSI GeForce RTX 3060 Gaming X 12G (GA104)": false, + "MSI GeForce RTX 3060 Gaming X 12G LHR": false, + "MSI GeForce RTX 3060 Ti 8GB Gaming X LHR": false, + "MSI GeForce RTX 3060 Ti 8GB Gaming X Trio": false, + "MSI GeForce RTX 3060 Ti 8GB Gaming X Trio LHR": false, + "MSI GeForce RTX 3070 8GB Gaming Trio": false, + "MSI GeForce RTX 3070 8GB Gaming X Trio": false, + "MSI GeForce RTX 3070 8GB Suprim X": false, + "MSI GeForce RTX 3070 8GB Suprim X LHR": false, + "MSI GeForce RTX 3070 Ti 8GB Gaming X Trio": false, + "MSI GeForce RTX 3070 Ti Suprim X 8G": false, + "MSI GeForce RTX 3080 10GB Gaming X Trio": false, + "MSI GeForce RTX 3080 10GB Gaming Z Trio": false, + "MSI GeForce RTX 3080 10GB Gaming Z Trio LHR": false, + "MSI GeForce RTX 3080 12GB Gaming Z Trio LHR": false, + "MSI GeForce RTX 3080 Suprim X 10G": false, + "MSI GeForce RTX 3080 Suprim X 10G LHR": false, + "MSI GeForce RTX 3080 Suprim X 12G LHR": false, + "MSI GeForce RTX 3080 Ti Gaming X Trio 12G": false, + "MSI GeForce RTX 3080 Ti Suprim X 12G": false, + "MSI GeForce RTX 3090 24GB Gaming X Trio": false, + "MSI GeForce RTX 3090 Suprim X 24G": false, + "MSI GeForce RTX 3090 Ti Gaming X Trio 24G": false, + "MSI GeForce RTX 3090 Ti Suprim X 24G": false, + "MSI Mystic Light MS_1562": false, + "MSI Mystic Light MS_1563": false, + "MSI Mystic Light MS_1564": false, + "MSI Mystic Light MS_1720": false, + "MSI Mystic Light MS_7B12": false, + "MSI Mystic Light MS_7B16": false, + "MSI Mystic Light MS_7B17": false, + "MSI Mystic Light MS_7B18": false, + "MSI Mystic Light MS_7B50": false, + "MSI Mystic Light MS_7B85": false, + "MSI Mystic Light MS_7B93": false, + "MSI Mystic Light MS_7C34": false, + "MSI Mystic Light MS_7C35": false, + "MSI Mystic Light MS_7C36": false, + "MSI Mystic Light MS_7C37": false, + "MSI Mystic Light MS_7C56": false, + "MSI Mystic Light MS_7C59": false, + "MSI Mystic Light MS_7C60": false, + "MSI Mystic Light MS_7C67": false, + "MSI Mystic Light MS_7C71": false, + "MSI Mystic Light MS_7C73": false, + "MSI Mystic Light MS_7C75": false, + "MSI Mystic Light MS_7C76": false, + "MSI Mystic Light MS_7C77": false, + "MSI Mystic Light MS_7C79": false, + "MSI Mystic Light MS_7C80": false, + "MSI Mystic Light MS_7C81": false, + "MSI Mystic Light MS_7C83": false, + "MSI Mystic Light MS_7C84": false, + "MSI Mystic Light MS_7C86": false, + "MSI Mystic Light MS_7C90": false, + "MSI Mystic Light MS_7C91": false, + "MSI Mystic Light MS_7C92": false, + "MSI Mystic Light MS_7C94": false, + "MSI Mystic Light MS_7C95": false, + "MSI Mystic Light MS_7C98": false, + "MSI Mystic Light MS_7D06": false, + "MSI Mystic Light MS_7D07": false, + "MSI Mystic Light MS_7D08": false, + "MSI Mystic Light MS_7D09": false, + "MSI Mystic Light MS_7D13": false, + "MSI Mystic Light MS_7D15": false, + "MSI Mystic Light MS_7D17": false, + "MSI Mystic Light MS_7D18": false, + "MSI Mystic Light MS_7D19": false, + "MSI Mystic Light MS_7D20": false, + "MSI Mystic Light MS_7D25": false, + "MSI Mystic Light MS_7D27": false, + "MSI Mystic Light MS_7D28": false, + "MSI Mystic Light MS_7D29": false, + "MSI Mystic Light MS_7D30": false, + "MSI Mystic Light MS_7D31": false, + "MSI Mystic Light MS_7D32": false, + "MSI Mystic Light MS_7D36": false, + "MSI Mystic Light MS_7D38": false, + "MSI Mystic Light MS_7D41": false, + "MSI Mystic Light MS_7D42": false, + "MSI Mystic Light MS_7D43": false, + "MSI Mystic Light MS_7D50": false, + "MSI Mystic Light MS_7D51": false, + "MSI Mystic Light MS_7D52": false, + "MSI Mystic Light MS_7D53": false, + "MSI Mystic Light MS_7D54": false, + "MSI Mystic Light MS_7D59": false, + "MSI Mystic Light MS_7D69": false, + "MSI Mystic Light MS_7D77": false, + "MSI Mystic Light MS_7D91": false, + "MSI Mystic Light MS_7E06": false, + "MSI Optix controller": false, + "MSI Radeon RX 6600 XT Gaming X": false, + "MSI Radeon RX 6700 XT Gaming X": false, + "MSI Radeon RX 6800 Gaming X Trio": false, + "MSI Radeon RX 6800 XT Gaming X Trio": false, + "MSI Radeon RX 6800 XT Gaming Z Trio": false, + "MSI Radeon RX 6900 XT Gaming X Trio": false, + "MSI Radeon RX 6900 XT Gaming Z Trio": false, + "MSI Radeon RX 6950 XT Gaming X Trio": false, + "MSI Vigor GK30 controller": false, + "MSI-RGB": false, + "N5312A USB Optical Mouse": false, + "NVIDIA RTX2060S": false, + "NVIDIA RTX2080S": false, + "NZXT Hue 2": false, + "NZXT Hue 2 Ambient": false, + "NZXT Hue 2 Motherboard": false, + "NZXT Hue+": false, + "NZXT Kraken M2": false, + "NZXT Kraken X2": false, + "NZXT Kraken X3": false, + "NZXT RGB & Fan Controller": false, + "NZXT Smart Device V2": false, + "Nanoleaf": false, + "Np93 ALPHA - Gaming Mouse": false, + "Nvidia ESA - Dell XPS 730x": false, + "OpenRazer": false, + "PNY GPU": false, + "PNY XLR8 OC EDITION RTX 2060": false, + "PNY XLR8 Revel EPIC-X RTX 3080": false, + "PNY XLR8 Revel EPIC-X RTX 3090": false, + "Palit 3060": false, + "Palit 3060 LHR": false, + "Palit 3060TI LHR": false, + "Palit 3060Ti": false, + "Palit 3070": false, + "Palit 3070 LHR": false, + "Palit 3070Ti": false, + "Palit 3070Ti GamingPro": false, + "Palit 3080": false, + "Palit 3080 LHR": false, + "Palit 3080Ti": false, + "Palit 3080Ti Gamerock": false, + "Palit 3090": false, + "Palit GeForce RTX 3060 Ti Dual": false, + "Patriot Viper": false, + "Patriot Viper Steel": false, + "Philips Hue": false, + "Philips Wiz": false, + "Razer Abyssus Elite D.Va Edition": false, + "Razer Abyssus Essential": false, + "Razer Base Station Chroma": false, + "Razer Base Station V2 Chroma": false, + "Razer Basilisk": false, + "Razer Basilisk Essential": false, + "Razer Basilisk Ultimate (Wired)": false, + "Razer Basilisk Ultimate (Wireless)": false, + "Razer Basilisk V2": false, + "Razer Basilisk V3": false, + "Razer Blackwidow 2019": false, + "Razer Blackwidow Chroma": false, + "Razer Blackwidow Chroma Tournament Edition": false, + "Razer Blackwidow Chroma V2": false, + "Razer Blackwidow Elite": false, + "Razer Blackwidow Overwatch": false, + "Razer Blackwidow V3": false, + "Razer Blackwidow V3 Mini (Wired)": false, + "Razer Blackwidow V3 Mini (Wireless)": false, + "Razer Blackwidow V3 Pro (Wired)": false, + "Razer Blackwidow V3 Pro (Wireless)": false, + "Razer Blackwidow V3 TKL": false, + "Razer Blackwidow X Chroma": false, + "Razer Blackwidow X Chroma Tournament Edition": false, + "Razer Blade (2016)": false, + "Razer Blade (Late 2016)": false, + "Razer Blade 14 (2021)": false, + "Razer Blade 15 (2018 Advanced)": false, + "Razer Blade 15 (2018 Base)": false, + "Razer Blade 15 (2018 Mercury)": false, + "Razer Blade 15 (2019 Advanced)": false, + "Razer Blade 15 (2019 Base)": false, + "Razer Blade 15 (2019 Mercury)": false, + "Razer Blade 15 (2019 Studio)": false, + "Razer Blade 15 (2020 Advanced)": false, + "Razer Blade 15 (2020 Base)": false, + "Razer Blade 15 (2021 Advanced)": false, + "Razer Blade 15 (2021 Base)": false, + "Razer Blade 15 (Late 2020)": false, + "Razer Blade Pro (2016)": false, + "Razer Blade Pro (2017 FullHD)": false, + "Razer Blade Pro (2017)": false, + "Razer Blade Pro (2019)": false, + "Razer Blade Pro (Late 2019)": false, + "Razer Blade Pro 17 (2020)": false, + "Razer Blade Pro 17 (2021)": false, + "Razer Blade Stealth (2016)": false, + "Razer Blade Stealth (2017)": false, + "Razer Blade Stealth (2019)": false, + "Razer Blade Stealth (2020)": false, + "Razer Blade Stealth (Late 2016)": false, + "Razer Blade Stealth (Late 2017)": false, + "Razer Blade Stealth (Late 2019)": false, + "Razer Blade Stealth (Late 2020)": false, + "Razer Book 13 (2020)": false, + "Razer Charging Pad Chroma": false, + "Razer Chroma Addressable RGB Controller": false, + "Razer Chroma HDK": false, + "Razer Chroma Mug Holder": false, + "Razer Chroma PC Case Lighting Kit": false, + "Razer Core": false, + "Razer Core X": false, + "Razer Cynosa Chroma": false, + "Razer Cynosa Chroma V2": false, + "Razer Cynosa Lite": false, + "Razer Deathadder Chroma": false, + "Razer Deathadder Elite": false, + "Razer Deathadder Essential": false, + "Razer Deathadder Essential V2": false, + "Razer Deathadder Essential White Edition": false, + "Razer Deathadder V2": false, + "Razer Deathadder V2 Mini": false, + "Razer Deathadder V2 Pro (Wired)": false, + "Razer Deathadder V2 Pro (Wireless)": false, + "Razer Deathstalker Chroma": false, + "Razer Diamondback": false, + "Razer Firefly": false, + "Razer Firefly Hyperflux": false, + "Razer Firefly V2": false, + "Razer Goliathus": false, + "Razer Goliathus Extended": false, + "Razer Huntsman": false, + "Razer Huntsman Elite": false, + "Razer Huntsman Mini": false, + "Razer Huntsman Tournament Edition": false, + "Razer Huntsman V2": false, + "Razer Huntsman V2 Analog": false, + "Razer Huntsman V2 TKL": false, + "Razer Kraken 7.1": false, + "Razer Kraken 7.1 Chroma": false, + "Razer Kraken 7.1 V2": false, + "Razer Kraken Kitty Black Edition": false, + "Razer Kraken Kitty Edition": false, + "Razer Kraken Ultimate": false, + "Razer Lancehead 2017 (Wired)": false, + "Razer Lancehead 2017 (Wireless)": false, + "Razer Lancehead 2019 (Wired)": false, + "Razer Lancehead 2019 (Wireless)": false, + "Razer Lancehead Tournament Edition": false, + "Razer Laptop Stand Chroma": false, + "Razer Laptop Stand Chroma V2": false, + "Razer Mamba 2012 (Wired)": false, + "Razer Mamba 2012 (Wireless)": false, + "Razer Mamba 2015 (Wired)": false, + "Razer Mamba 2015 (Wireless)": false, + "Razer Mamba 2018 (Wired)": false, + "Razer Mamba 2018 (Wireless)": false, + "Razer Mamba Elite": false, + "Razer Mamba Tournament Edition": false, + "Razer Mouse Bungee V3 Chroma": false, + "Razer Mouse Dock Chroma": false, + "Razer Naga Chroma": false, + "Razer Naga Classic": false, + "Razer Naga Epic Chroma": false, + "Razer Naga Hex V2": false, + "Razer Naga Left Handed": false, + "Razer Naga Pro (Wired)": false, + "Razer Naga Pro (Wireless)": false, + "Razer Naga Trinity": false, + "Razer Nommo Chroma": false, + "Razer Nommo Pro": false, + "Razer Orbweaver Chroma": false, + "Razer Ornata Chroma": false, + "Razer Ornata Chroma V2": false, + "Razer Ornata V3": false, + "Razer Seiren Emote": false, + "Razer Strider Chroma": false, + "Razer Tartarus Chroma": false, + "Razer Tartarus Pro": false, + "Razer Tartarus V2": false, + "Razer Tiamat 7.1 V2": false, + "Razer Viper": false, + "Razer Viper 8kHz": false, + "Razer Viper Mini": false, + "Razer Viper Ultimate (Wired)": false, + "Razer Viper Ultimate (Wireless)": false, + "Red Square Keyrox TKL": false, + "Redragon M602 Griffin": false, + "Redragon M711 Cobra": false, + "Redragon M715 Dagger": false, + "Redragon M716 Inquisitor": false, + "Redragon M908 Impact": false, + "Roccat Burst Core": false, + "Roccat Burst Pro": false, + "Roccat Horde Aimo": false, + "Roccat Kone Aimo": false, + "Roccat Kone Aimo 16K": false, + "Roccat Vulcan 120 Aimo": false, + "Roccat Vulcan 120-Series Aimo": false, + "SRGBmods Pico LED Controller": false, + "Sapphire GPU": false, + "Sapphire RX 470/480 Nitro+": false, + "Sapphire RX 5500 XT Nitro+": false, + "Sapphire RX 570/580/590 Nitro+": false, + "Sapphire RX 5700 (XT) Nitro+": false, + "Sapphire RX 5700 XT Nitro+": false, + "Sapphire RX 580 Nitro+ (2048SP)": false, + "Sapphire RX 6600 XT Nitro+": false, + "Sapphire RX 6700 XT Nitro+": false, + "Sapphire RX 6800 Nitro+": false, + "Sapphire RX 6800 XT Nitro+ SE": false, + "Sapphire RX 6800 XT/6900 XT Nitro+": false, + "Sapphire RX 6900 XT Nitro+ SE": false, + "Sapphire RX 6900 XT Toxic": false, + "Sapphire RX 6900 XT Toxic Limited Edition": false, + "Sapphire RX 6950 XT Nitro+": false, + "Sapphire RX Vega 56/64 Nitro+": false, + "Sinowealth Keyboard": false, + "Sony DualSense": false, + "Sony DualShock 4": false, + "SteelSeries Aerox 3 Wired": false, + "SteelSeries Aerox 9 Wired": false, + "SteelSeries Apex (OG)/Apex Fnatic": false, + "SteelSeries Apex 3": false, + "SteelSeries Apex 3 TKL": false, + "SteelSeries Apex 350": false, + "SteelSeries Apex 5": false, + "SteelSeries Apex 7": false, + "SteelSeries Apex 7 TKL": false, + "SteelSeries Apex M750": false, + "SteelSeries Apex Pro": false, + "SteelSeries Apex Pro TKL": false, + "SteelSeries Arctis 5": false, + "SteelSeries QCK Prism Cloth 3XL": false, + "SteelSeries QCK Prism Cloth 4XL": false, + "SteelSeries QCK Prism Cloth Medium": false, + "SteelSeries QCK Prism Cloth XL": false, + "SteelSeries QCK Prism Cloth XL CS:GO Neon Rider Ed.": false, + "SteelSeries QCK Prism Cloth XL Destiny Ed.": false, + "SteelSeries Rival 100": false, + "SteelSeries Rival 100 DotA 2 Edition": false, + "SteelSeries Rival 105": false, + "SteelSeries Rival 106": false, + "SteelSeries Rival 110": false, + "SteelSeries Rival 3": false, + "SteelSeries Rival 3 (Old Firmware)": false, + "SteelSeries Rival 300": false, + "SteelSeries Rival 300 Black Ops Edition": false, + "SteelSeries Rival 300 CS:GO Fade Edition": false, + "SteelSeries Rival 300 CS:GO Fade Edition (stm32)": false, + "SteelSeries Rival 300 CS:GO Hyperbeast Edition": false, + "SteelSeries Rival 300 Dota 2 Edition": false, + "SteelSeries Rival 300 HP Omen Edition": false, + "SteelSeries Rival 310": false, + "SteelSeries Rival 310 CS:GO Howl Edition": false, + "SteelSeries Rival 310 PUBG Edition": false, + "SteelSeries Rival 600": false, + "SteelSeries Rival 600 Dota 2 Edition": false, + "SteelSeries Rival 650": false, + "SteelSeries Rival 650 Wireless": false, + "SteelSeries Rival 700": false, + "SteelSeries Rival 710": false, + "SteelSeries Sensei 310": false, + "SteelSeries Sensei TEN": false, + "SteelSeries Sensei TEN CS:GO Neon Rider Edition": false, + "SteelSeries Siberia 350": false, + "Strimer L Connect": false, + "Tecknet M008": false, + "Thermaltake Poseidon Z RGB": false, + "Thermaltake Riing (PID 0x1FA5)": false, + "Thermaltake Riing (PID 0x1FA6)": false, + "Thermaltake Riing (PID 0x1FA7)": false, + "Thermaltake Riing (PID 0x1FA8)": false, + "Thermaltake Riing (PID 0x1FA9)": false, + "Thermaltake Riing (PID 0x1FAA)": false, + "Thermaltake Riing (PID 0x1FAB)": false, + "Thermaltake Riing (PID 0x1FAC)": false, + "Thermaltake Riing (PID 0x1FAD)": false, + "Thermaltake Riing (PID 0x1FAE)": false, + "Thermaltake Riing (PID 0x1FAF)": false, + "Thermaltake Riing (PID 0x1FB0)": false, + "Thermaltake Riing (PID 0x1FB1)": false, + "Thermaltake Riing (PID 0x1FB2)": false, + "Thermaltake Riing (PID 0x1FB3)": false, + "Thermaltake Riing (PID 0x1FB4)": false, + "Thermaltake Riing (PID 0x1FB5)": false, + "Thermaltake Riing Quad (PID 0x2260)": false, + "Thermaltake Riing Quad (PID 0x2261)": false, + "Thermaltake Riing Quad (PID 0x2262)": false, + "Thermaltake Riing Quad (PID 0x2263)": false, + "Thermaltake Riing Quad (PID 0x2264)": false, + "Thermaltake Riing Quad (PID 0x2265)": false, + "Thermaltake Riing Quad (PID 0x2266)": false, + "Thermaltake Riing Quad (PID 0x2267)": false, + "Thermaltake Riing Quad (PID 0x2268)": false, + "Thermaltake Riing Quad (PID 0x2269)": false, + "Thermaltake Riing Quad (PID 0x226A)": false, + "Thermaltake Riing Quad (PID 0x226B)": false, + "Thermaltake Riing Quad (PID 0x226C)": false, + "Thermaltake Riing Quad (PID 0x226D)": false, + "Thermaltake Riing Quad (PID 0x226E)": false, + "Thermaltake Riing Quad (PID 0x226F)": false, + "Thermaltake Riing Quad (PID 0x2270)": false, + "ThingM blink(1) mk2": false, + "Trust GXT 114": false, + "Trust GXT 180": false, + "ViewSonic Monitor XG270QG": false, + "Wooting ONE Keyboard": false, + "Wooting One (Classic)": false, + "Wooting One (Legacy)": false, + "Wooting One (None)": false, + "Wooting One (Xbox)": false, + "Wooting TWO Keyboard": false, + "Wooting TWO Keyboard HE": false, + "Wooting TWO Keyboard LE": false, + "Wooting Two (Classic)": false, + "Wooting Two (Legacy)": false, + "Wooting Two (None)": false, + "Wooting Two (Xbox)": false, + "Wooting Two 60HE (Classic)": false, + "Wooting Two 60HE (None)": false, + "Wooting Two 60HE (Xbox)": false, + "Wooting Two HE (Classic)": false, + "Wooting Two HE (None)": false, + "Wooting Two HE (Xbox)": false, + "Wooting Two LE (Classic)": false, + "Wooting Two LE (None)": false, + "Wooting Two LE (Xbox)": false, + "XPG Spectrix S40G": false, + "Yeelight": false, + "ZET Blade Optical": false, + "ZET Fury Pro": false, + "ZET GAMING Edge Air Elit": false, + "ZET GAMING Edge Air Elit (Wireless)": false, + "ZET GAMING Edge Air Pro": false, + "ZET GAMING Edge Air Pro (Wireless)": false, + "Zalman Z Sync": false, + "iGame GeForce RTX 3060 Ultra W OC 12G L-V": false, + "iGame GeForce RTX 3070 Advanced OC-V": false, + "iGame GeForce RTX 3070 Ti Advanced OC-V": false + } + }, + "Gigabyte RGB Fusion 2 SMBus": { + "SupportedDevices": [ + "B450 AORUS ELITE", + "B450 AORUS ELITE V2", + "B450 AORUS M", + "B450 AORUS PRO WIFI-CF", + "B450 AORUS PRO-CF", + "B450 AORUS PRO-CF4", + "B450 I AORUS PRO WIFI-CF", + "B450M DS3H-CF", + "X399 AORUS XTREME-CF", + "X399 DESIGNARE EX-CF", + "X470 AORUS GAMING 5 WIFI", + "X470 AORUS GAMING 7 WIFI-CF", + "X470 AORUS GAMING 7 WIFI-50-CF", + "X470 AORUS ULTRA GAMING", + "X470 AORUS ULTRA GAMING-CF", + "Z370 AORUS Gaming 5-CF" + ] + }, + "Plugins": { + "plugins": [ + { + "description": "Provides a variety of custom effects", + "enabled": true, + "name": "OpenRGB Effects Plugin" + }, + { + "description": "Sync colors with hardware measures", + "enabled": true, + "name": "Hardware Sync" + } + ] + }, + "Theme": { + "theme": "auto" + }, + "UserInterface": { + "exit_profile": { + "profile_name": "Default", + "set_on_exit": true + }, + "geometry": { + "height": 0, + "load_geometry": false, + "save_on_exit": false, + "width": 0, + "x": 0, + "y": 0 + }, + "greyscale_tray_icon": false, + "language": "default", + "minimize_on_close": false + } +} \ No newline at end of file From 9e35adca87ebc69021296e312e95c514408aef85 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Mon, 30 Oct 2023 10:32:23 +0100 Subject: [PATCH 088/176] Enable Virtualbox on laptop --- nixos/hosts/Tibo-NixFat/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 33aa410..f8bf36e 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -23,6 +23,8 @@ }; users.tdpeuter.enable = true; + + virtualisation.virtualbox.enable = true; }; boot = { From d3f0c9458328f28fce5de642469aa6546ac3edd3 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 31 Oct 2023 09:14:14 +0100 Subject: [PATCH 089/176] Fix capitalized urls not matching --- stow/ssh/.ssh/config | 1 + 1 file changed, 1 insertion(+) diff --git a/stow/ssh/.ssh/config b/stow/ssh/.ssh/config index 1bdb4cd..74bb449 100644 --- a/stow/ssh/.ssh/config +++ b/stow/ssh/.ssh/config @@ -34,4 +34,5 @@ Host subgit.ugent.be HostName subgit.ugent.be IdentitiesOnly yes IdentityFile /run/secrets/UGent/SubGit/ssh + CanonicalizeHostname yes # Ignore capitalization From 70b163cf0cbd69955a6ff5ad52f6eb257fea1bdb Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 2 Nov 2023 17:04:04 +0100 Subject: [PATCH 090/176] [tailscale] Update --- nixos/modules/services/tailscale/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/tailscale/default.nix b/nixos/modules/services/tailscale/default.nix index f0bbc05..48eceb7 100644 --- a/nixos/modules/services/tailscale/default.nix +++ b/nixos/modules/services/tailscale/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, pkgs-unstable, ... }: let cfg = config.sisyphus.services.tailscale; @@ -8,6 +8,7 @@ in { config = lib.mkIf cfg.enable { services.tailscale = { enable = true; + package = pkgs-unstable.tailscale; useRoutingFeatures = "client"; }; }; From 856bfa82e80d97afd5d02fb09655fdb26247bffe Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 2 Nov 2023 17:05:09 +0100 Subject: [PATCH 091/176] [vifm] Add to light-dark toggle --- scripts/toggle-light-dark.sh | 7 ++++ .../{Personal.vifm => tdpeuter-dark.vifm} | 3 ++ .../.config/vifm/colors/tdpeuter-light.vifm | 38 +++++++++++++++++++ stow/vifm/.config/vifm/vifmrc | 6 +-- 4 files changed, 50 insertions(+), 4 deletions(-) rename stow/vifm/.config/vifm/colors/{Personal.vifm => tdpeuter-dark.vifm} (92%) create mode 100644 stow/vifm/.config/vifm/colors/tdpeuter-light.vifm diff --git a/scripts/toggle-light-dark.sh b/scripts/toggle-light-dark.sh index 7ba6e5c..f36a637 100755 --- a/scripts/toggle-light-dark.sh +++ b/scripts/toggle-light-dark.sh @@ -71,6 +71,13 @@ if [ "$(command -v kitty)" ]; then kitten themes --config-file-name theme.conf "${theme}" fi +# Vifm +if [ "$(command -v vifm)" ]; then + echo "colorscheme ${theme} Default-256 Default" > ~/.config/vifm/theme.conf + # Update all running instances + vifm --remote -c "colorscheme ${theme}" +fi + # Vim # This does not reload the config, but will use it when you restart vim # Toggle an existing window using `:colorscheme ${theme}` diff --git a/stow/vifm/.config/vifm/colors/Personal.vifm b/stow/vifm/.config/vifm/colors/tdpeuter-dark.vifm similarity index 92% rename from stow/vifm/.config/vifm/colors/Personal.vifm rename to stow/vifm/.config/vifm/colors/tdpeuter-dark.vifm index abf323b..cf92123 100644 --- a/stow/vifm/.config/vifm/colors/Personal.vifm +++ b/stow/vifm/.config/vifm/colors/tdpeuter-dark.vifm @@ -34,3 +34,6 @@ highlight Win ctermfg=12 ctermbg=-1 cterm=none highlight Border ctermfg=-1 ctermbg=-1 cterm=none + +highlight CmdLine ctermfg=7 ctermbg=0 cterm=none + diff --git a/stow/vifm/.config/vifm/colors/tdpeuter-light.vifm b/stow/vifm/.config/vifm/colors/tdpeuter-light.vifm new file mode 100644 index 0000000..a27559f --- /dev/null +++ b/stow/vifm/.config/vifm/colors/tdpeuter-light.vifm @@ -0,0 +1,38 @@ +" +" ~/.config/vifm/colors/Personal.vifm +" + +" The standard ncurses colors are: +" Default = -1 = None, can be used for transparency or default color +" Black = 0 +" Red = 1 +" Green = 2 +" Yellow = 3 +" Blue = 4 +" Magenta = 5 +" Cyan = 6 +" White = 7 + +" Light versions of colors are also available (set bold attribute): +" LightBlack +" LightRed +" LightGreen +" LightYellow +" LightBlue +" LightMagenta +" LightCyan +" LightWhite + +" Available attributes (some of them can be combined): +" bold +" underline +" reverse or inverse +" standout +" none + +" Make background and vertical borders transparent. +highlight Win ctermfg=12 ctermbg=-1 cterm=none + +highlight Border ctermfg=-1 ctermbg=-1 cterm=none + +highlight CmdLine ctermfg=7 ctermbg=12 cterm=none diff --git a/stow/vifm/.config/vifm/vifmrc b/stow/vifm/.config/vifm/vifmrc index b4b588a..a965df1 100644 --- a/stow/vifm/.config/vifm/vifmrc +++ b/stow/vifm/.config/vifm/vifmrc @@ -2,6 +2,8 @@ " ~/.config/vifm/vifmrc " +source ~/.config/vifm/theme.conf + " vim: filetype=vifm : " Sample configuration file for vifm (last updated: 31 August, 2021) " You can edit this file by hand. @@ -76,10 +78,6 @@ set vimhelp set norunexec -" List of color schemes to try (picks the first one supported by the terminal) - -colorscheme Personal Default-256 Default - " Format for displaying time in file list. For example: " TIME_STAMP_FORMAT=%m/%d-%H:%M " See man date or man strftime for details. From 5f3c611554c6164619693df1d1df66651a6f6c81 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 2 Nov 2023 17:35:18 +0100 Subject: [PATCH 092/176] [openconnect] Add openconnect-sso module --- nixos/flake.nix | 1 + nixos/hosts/Tibo-NixDesk/default.nix | 2 ++ nixos/hosts/Tibo-NixFat/default.nix | 2 ++ nixos/modules/default.nix | 1 + nixos/modules/networking/default.nix | 5 +++++ .../networking/openconnect-sso/default.nix | 20 +++++++++++++++++++ nixos/overlays/openconnect-sso/default.nix | 4 ++++ 7 files changed, 35 insertions(+) create mode 100644 nixos/modules/networking/default.nix create mode 100644 nixos/modules/networking/openconnect-sso/default.nix create mode 100644 nixos/overlays/openconnect-sso/default.nix diff --git a/nixos/flake.nix b/nixos/flake.nix index 3feca67..3909e0f 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -46,6 +46,7 @@ (import ./overlays/cmdtime) (import ./overlays/icosystem) (import ./overlays/letter) + (import ./overlays/openconnect-sso) (import ./overlays/spotify) ]; diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index b114570..c5bdc77 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -11,6 +11,8 @@ model = "RTX 2060"; }; + networking.openconnect-sso.enable = true; + programs = { home-manager.enable = true; sops.enable = true; diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index f8bf36e..1773ba7 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -11,6 +11,8 @@ model = "Quadro T2000"; }; + networking.openconnect-sso.enable = true; + programs = { home-manager.enable = true; sops.enable = true; diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 7c3c16f..7227806 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -2,6 +2,7 @@ imports = [ ./desktop ./hardware + ./networking ./programs ./services ./virtualisation diff --git a/nixos/modules/networking/default.nix b/nixos/modules/networking/default.nix new file mode 100644 index 0000000..d44dd42 --- /dev/null +++ b/nixos/modules/networking/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./openconnect-sso + ]; +} diff --git a/nixos/modules/networking/openconnect-sso/default.nix b/nixos/modules/networking/openconnect-sso/default.nix new file mode 100644 index 0000000..3b400f8 --- /dev/null +++ b/nixos/modules/networking/openconnect-sso/default.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.networking.openconnect-sso; +in { + options.sisyphus.networking.openconnect-sso.enable = lib.mkEnableOption "OpenConnect SSO"; + + config = lib.mkIf cfg.enable { + nixpkgs = { + config.permittedInsecurePackages = [ + "python3.10-requests-2.28.2" + "python3.10-cryptography-40.0.1" + ]; + }; + + environment.systemPackages = with pkgs; [ + openconnect-sso + ]; + }; +} diff --git a/nixos/overlays/openconnect-sso/default.nix b/nixos/overlays/openconnect-sso/default.nix new file mode 100644 index 0000000..4759c18 --- /dev/null +++ b/nixos/overlays/openconnect-sso/default.nix @@ -0,0 +1,4 @@ +import "${builtins.fetchTarball { + url = "https://github.com/vlaci/openconnect-sso/archive/master.tar.gz"; + sha256 = "08cqd40p9vld1liyl6qrsdrilzc709scyfghfzmmja3m1m7nym94"; +}}/overlay.nix" From 1f7a57a8f88cd55d50c1a9b25684d2c4cc7ef476 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 2 Nov 2023 17:35:40 +0100 Subject: [PATCH 093/176] [virtualbox] Pin version --- nixos/flake.lock | 18 +++++++++--------- .../virtualisation/virtualbox/default.nix | 12 ++++++++++++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index 0d453b3..a52b3cd 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1698434055, - "narHash": "sha256-Phxi5mUKSoL7A0IYUiYtkI9e8NcGaaV5PJEaJApU1Ko=", + "lastModified": 1698846319, + "narHash": "sha256-4jyW/dqFBVpWFnhl0nvP6EN4lP7/ZqPxYRjl6var0Oc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1a3c95e3b23b3cdb26750621c08cc2f1560cb883", + "rev": "34bdaaf1f0b7fb6d9091472edc968ff10a8c2857", "type": "github" }, "original": { @@ -93,11 +93,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1698318101, - "narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=", + "lastModified": 1698611440, + "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "63678e9f3d3afecfeafa0acead6239cdb447574c", + "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1698548647, - "narHash": "sha256-7c03OjBGqnwDW0FBaBc+NjfEBxMkza+dxZGJPyIzfFE=", + "lastModified": 1698929376, + "narHash": "sha256-TmROaV9W6HArdTUgxLN334Kw+CradxWHw1HYM/3H6xI=", "owner": "Mic92", "repo": "sops-nix", - "rev": "632c3161a6cc24142c8e3f5529f5d81042571165", + "rev": "84d6b27dc71ac02422e192c35806d06915d2bf67", "type": "github" }, "original": { diff --git a/nixos/modules/virtualisation/virtualbox/default.nix b/nixos/modules/virtualisation/virtualbox/default.nix index f4a31b6..5a01b66 100644 --- a/nixos/modules/virtualisation/virtualbox/default.nix +++ b/nixos/modules/virtualisation/virtualbox/default.nix @@ -2,6 +2,17 @@ let cfg = config.sisyphus.virtualisation.virtualbox; + + # I like to override the virtualbox package because it is frequently + # and rebuilds take quite long. + inherit (pkgs) fetchurl; + version = "7.0.10"; + virtualbox-override = pkgs.virtualbox.overrideAttrs (oldAttrs: { + src = fetchurl { + url = "https://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2"; + sha256 = "0b1e6d8b7f87d017c7fae37f80586acff04f799ffc1d51e995954d6415dee371"; + }; + }); in { options.sisyphus.virtualisation.virtualbox.enable = lib.mkEnableOption "VirtualBox"; @@ -10,6 +21,7 @@ in { host = { enable = true; enableExtensionPack = true; + package = virtualbox-override; }; guest = { enable = true; From e8c09b3387f6c488752b7786956c95c56b4983b8 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 4 Nov 2023 21:47:35 +0100 Subject: [PATCH 094/176] [dunst] Check config --- nixos/users/tdpeuter/dotfiles.nix | 4 ++++ {arch/stow => stow}/dunst/.config/dunst/dunstrc | 0 2 files changed, 4 insertions(+) rename {arch/stow => stow}/dunst/.config/dunst/dunstrc (100%) diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index 9050b2b..965ef5e 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -12,6 +12,10 @@ in { ".config/alacritty" = lib.mkIf (builtins.elem pkgs.alacritty installedPkgs) { source = ../../../stow/alacritty/.config/alacritty; }; + ".config/dunst" = { + enable = config.sisyphus.desktop.sway.enable; + source = ../../../stow/dunst/.config/dunst; + }; ".config/git" = { enable = (builtins.elem pkgs.git installedPkgs); source = ../../../stow/git/.config/git; diff --git a/arch/stow/dunst/.config/dunst/dunstrc b/stow/dunst/.config/dunst/dunstrc similarity index 100% rename from arch/stow/dunst/.config/dunst/dunstrc rename to stow/dunst/.config/dunst/dunstrc From bf888106875f29d77ff561a5d884b30a683decbb Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 4 Nov 2023 21:47:59 +0100 Subject: [PATCH 095/176] Remove unused script --- .../_scripts/.scripts/cleandependencies.sh | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100755 arch/stow/_scripts/.scripts/cleandependencies.sh diff --git a/arch/stow/_scripts/.scripts/cleandependencies.sh b/arch/stow/_scripts/.scripts/cleandependencies.sh deleted file mode 100755 index 7fac670..0000000 --- a/arch/stow/_scripts/.scripts/cleandependencies.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# Remove unused dependencies that are not explicitly installed -# Usage: [sudo] cleandependencies - -# Retrieve a list of all packages that are not explicitly installed and are not needed by anything else. -# Note that optional dependencies also do not get removed. -# function getList () { -# grep "Name\|Required By\|Optional For\|Install Reason" <<< $(pacman -Qi) | -# tr '\n' ';' | sed "s/$/\n/" | -# sed "s/ */ /g" | -# sed "s/Name/\nName/g" | -# sed "s/\(Name\|Required By\|Optional For\|Install Reason\) : //g" | -# grep "Installed as a dependency for another package" | -# grep "^[^;]*;None;None" | -# cut -f 1 -d ';' -# } ; export -f getList - -current_amount=$(pacman -Qdtq | wc -l) -# Keep looping while there are unusded dependencies. -# Stop when the next amount is the same, probably because the action was canceled. -while [[ ${current_amount} -ne 0 && ${current_amount} -ne ${previous_amount:=0} ]] ; do - previous_amount=${current_amount} - pacman -R $(pacman -Qdtq) - current_amount=$(pacman -Qdtq | wc -l) -done - From c135ee94a1afd39d14e789d5f589b53f916970f5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 4 Nov 2023 21:50:07 +0100 Subject: [PATCH 096/176] [swaylock] Check config --- {arch/stow => stow}/swaylock/.config/swaylock/config | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {arch/stow => stow}/swaylock/.config/swaylock/config (100%) diff --git a/arch/stow/swaylock/.config/swaylock/config b/stow/swaylock/.config/swaylock/config similarity index 100% rename from arch/stow/swaylock/.config/swaylock/config rename to stow/swaylock/.config/swaylock/config From 1236598093b62053f8cd8126989b0e3f86ecd7a0 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 4 Nov 2023 22:00:19 +0100 Subject: [PATCH 097/176] [mako] Check config --- nixos/users/tdpeuter/dotfiles.nix | 4 ++++ {arch/stow => stow}/mako/.config/mako/config | 0 2 files changed, 4 insertions(+) rename {arch/stow => stow}/mako/.config/mako/config (100%) diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index 965ef5e..7638a65 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -26,6 +26,10 @@ in { source = ../../../stow/kitty/.config/kitty; recursive = true; }; + ".config/mako" = { + enable = builtins.elem pkgs.mako installedPkgs; + source = ../../../stow/mako/.config/mako; + }; ".config/mpv" = { enable = (builtins.elem pkgs-unstable.mpv installedPkgs); source = ../../../stow/mpv/.config/mpv; diff --git a/arch/stow/mako/.config/mako/config b/stow/mako/.config/mako/config similarity index 100% rename from arch/stow/mako/.config/mako/config rename to stow/mako/.config/mako/config From 1cb3fad4cc5159eb9dba0b282d6e1f2e4c11361b Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sun, 5 Nov 2023 17:25:26 +0100 Subject: [PATCH 098/176] [fuzzel] Check config --- nixos/users/tdpeuter/dotfiles.nix | 5 +++++ {arch/stow => stow}/fuzzel/.config/fuzzel/fuzzel.ini | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) rename {arch/stow => stow}/fuzzel/.config/fuzzel/fuzzel.ini (76%) diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index 7638a65..d77ade0 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -16,6 +16,11 @@ in { enable = config.sisyphus.desktop.sway.enable; source = ../../../stow/dunst/.config/dunst; }; + ".config/fuzzel" = { + enable = builtins.elem pkgs.fuzzel installedPkgs; + source = ../../../stow/fuzzel/.config/fuzzel; + recursive = true; + }; ".config/git" = { enable = (builtins.elem pkgs.git installedPkgs); source = ../../../stow/git/.config/git; diff --git a/arch/stow/fuzzel/.config/fuzzel/fuzzel.ini b/stow/fuzzel/.config/fuzzel/fuzzel.ini similarity index 76% rename from arch/stow/fuzzel/.config/fuzzel/fuzzel.ini rename to stow/fuzzel/.config/fuzzel/fuzzel.ini index b4ee0e2..078c64d 100644 --- a/arch/stow/fuzzel/.config/fuzzel/fuzzel.ini +++ b/stow/fuzzel/.config/fuzzel/fuzzel.ini @@ -4,8 +4,8 @@ font=letter:size=10 dpi-aware=yes -icon-theme=Win11-black -terminal=alacritty -e +icon-theme=Icosystem +terminal=kitty -e output=eDP-1 lines=10 From ffda64709fa204904afc388dcee05a6929982029 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Mon, 6 Nov 2023 10:45:26 +0100 Subject: [PATCH 099/176] Improve light-dark toggle speed and Vim --- scripts/toggle-light-dark.sh | 19 ++++++++++++++++--- stow/vim/.vimrc | 3 +++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/scripts/toggle-light-dark.sh b/scripts/toggle-light-dark.sh index f36a637..4c5d074 100755 --- a/scripts/toggle-light-dark.sh +++ b/scripts/toggle-light-dark.sh @@ -20,6 +20,10 @@ declare -A gsettings_alt gsettings_alt[${THEME_LIGHT}]='default' gsettings_alt[${THEME_DARK}]='prefer-dark' +declare -A wallpaper +wallpaper[${THEME_LIGHT}]="bg" +wallpaper[${THEME_DARK}]="bg-dark" + ############# ### Logic ### ############# @@ -63,19 +67,24 @@ echo "${theme:=${THEME_DEFAULT}}" > "${STATE_FILE}" # GNOME if [ "$(command -v gsettings)" ]; then - gsettings set org.gnome.desktop.interface color-scheme "${gsettings_alt[${theme}]}" + gsettings set org.gnome.desktop.interface color-scheme "${gsettings_alt[${theme}]}" & fi # Kitty if [ "$(command -v kitty)" ]; then - kitten themes --config-file-name theme.conf "${theme}" + kitten themes --reload-in all --config-file-name theme.conf "${theme}" & +fi + +# Sway +if [ "$(command -v swaybg)" ]; then + pkill swaybg && swaybg -i ~/Nextcloud/Afbeeldingen/wallpapers/${wallpaper[${theme}]} && swaymsg reload & fi # Vifm if [ "$(command -v vifm)" ]; then echo "colorscheme ${theme} Default-256 Default" > ~/.config/vifm/theme.conf # Update all running instances - vifm --remote -c "colorscheme ${theme}" + vifm --remote -c "colorscheme ${theme}" & fi # Vim @@ -83,5 +92,9 @@ fi # Toggle an existing window using `:colorscheme ${theme}` if [ "$(command -v vim)" ]; then echo "colorscheme ${theme}" > ~/.vim/theme.conf + # Update all running instances + for server in $(vim --serverlist); do + vim --servername "${server}" --remote-send ":colorscheme ${theme}" + done fi diff --git a/stow/vim/.vimrc b/stow/vim/.vimrc index bbd482f..eb05888 100644 --- a/stow/vim/.vimrc +++ b/stow/vim/.vimrc @@ -51,6 +51,9 @@ if $TERM == 'xterm-kitty' set term=xterm-256color endif +" Automatically start vim in a server - enable colorscheme switching +call remote_startserver("VIM") + " AUTO ------------------------------------------------------------------ {{{ if has("autocmd") From 7b0e1ce83727ffdbc8168f01a6b5c1256c87e4f0 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 8 Nov 2023 20:54:33 +0100 Subject: [PATCH 100/176] Remove unused git-crypt --- .git-crypt/.gitattributes | 4 ---- .../EBD15FF520C7C7204D431FB096CC5C98FEB6588D.gpg | Bin 293 -> 0 bytes .gitattributes | 1 - 3 files changed, 5 deletions(-) delete mode 100644 .git-crypt/.gitattributes delete mode 100644 .git-crypt/keys/default/0/EBD15FF520C7C7204D431FB096CC5C98FEB6588D.gpg delete mode 100644 .gitattributes diff --git a/.git-crypt/.gitattributes b/.git-crypt/.gitattributes deleted file mode 100644 index 665b10e..0000000 --- a/.git-crypt/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -# Do not edit this file. To specify the files to encrypt, create your own -# .gitattributes file in the directory where your files are. -* !filter !diff -*.gpg binary diff --git a/.git-crypt/keys/default/0/EBD15FF520C7C7204D431FB096CC5C98FEB6588D.gpg b/.git-crypt/keys/default/0/EBD15FF520C7C7204D431FB096CC5C98FEB6588D.gpg deleted file mode 100644 index 6c29a1419e6ef4cc6b72521919020a06a65fce59..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 293 zcmV+=0owkAUIX-O#DOAa_5ut!7~xnLuYFl=A+M!FSFfEu=QML&Jg zzybkrbuUYqNxpOC6Pefqp10|?2ndz-gTBRKCGBhYX!1&Pn@uocf8c2J*Wv|h?VR&{? rzRNtq$?{8i(7LaM+XUQa9}bcNel5Vc#Yh?ep^EmFwwY3fhv@GC1!0o$ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index a9fc17b..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -nixos/secrets/** filter=git-crypt diff=git-crypt From 295fef53d622da0402800a8573941ff8a95d462c Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 9 Nov 2023 19:45:13 +0100 Subject: [PATCH 101/176] Remove garbage-collect on laptop --- nixos/hosts/Tibo-NixFat/default.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 1773ba7..b12b53d 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -101,12 +101,6 @@ min-free = ${toString (100 * 1024 * 1024)} max-free = ${toString (2048 * 1024 * 1024)} ''; - # Scheduled garbage-collect - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; package = pkgs.nixFlakes; }; From bf1b696b2a21cc03ee645e97eefb17a6ec795f1a Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 9 Nov 2023 19:46:23 +0100 Subject: [PATCH 102/176] Add custom cursor --- nixos/users/tdpeuter/default.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index 782ea1f..db2e261 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -5,6 +5,12 @@ let user = config.users.users.tdpeuter.name; installedPkgs = config.environment.systemPackages ++ config.home-manager.users.tdpeuter.home.packages; + + cursor = { + package = pkgs.phinger-cursors; + name = "phinger-cursors"; + size = 24; + }; in { imports = [ ./dotfiles.nix @@ -66,6 +72,7 @@ in { nextcloud-client nsxiv # Lightweight image viewer oh-my-zsh + phinger-cursors # Cursor theme qalculate-gtk # Calculator spotify-adblock tea # Gitea CLI @@ -84,6 +91,14 @@ in { statix vim-plug ]); + + pointerCursor = { + package = cursor.package; + name = cursor.name; + size = cursor.size; + gtk.enable = true; + x11.enable = true; + }; }; # GNOME ricing @@ -113,6 +128,11 @@ in { }; }; + gtk = { + enable = true; + cursorTheme = cursor; + }; + xdg = { desktopEntries.spotify = { name = "Spotify"; From 3be4dc3422db0cc02f4c290492dc48454ce9c7d5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 10 Nov 2023 11:02:21 +0100 Subject: [PATCH 103/176] [plasma] Add module --- nixos/modules-old/des/plasma/default.nix | 35 ------------------- nixos/modules/desktop/plasma/default.nix | 43 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 35 deletions(-) delete mode 100644 nixos/modules-old/des/plasma/default.nix create mode 100644 nixos/modules/desktop/plasma/default.nix diff --git a/nixos/modules-old/des/plasma/default.nix b/nixos/modules-old/des/plasma/default.nix deleted file mode 100644 index 10a85e6..0000000 --- a/nixos/modules-old/des/plasma/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - services.xserver = { - enable = true; - - displayManager = { - defaultSession = "plasmawayland"; - sddm = { - enable = true; - # https://discourse.nixos.org/t/plasma-wayland-session-not-available-from-sddm/13447/2 - settings.Wayland.SessionDir = "${pkgs.plasma5Packages.plasma-workspace}/share/wayland-sessions"; - }; - }; - - desktopManager.plasma5 = { - enable = true; - useQtScaling = true; - }; - - excludePackages = with pkgs; [ - xterm - ]; - }; - - environment.plasma5.excludePackages = with pkgs.libsForQt5; [ - elisa - okular - khelpcenter - konsole - print-manager - plasma-systemmonitor - gwenview - ]; -} diff --git a/nixos/modules/desktop/plasma/default.nix b/nixos/modules/desktop/plasma/default.nix new file mode 100644 index 0000000..39e1ab7 --- /dev/null +++ b/nixos/modules/desktop/plasma/default.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: + +# This module is not tested at all so it might be broken! + +let + cfg = config.sisyphus.desktop.plasma; +in { + options.sisyphus.desktop.plasma.enable = lib.mkEnableOption "KDE Plasma"; + + config = lib.mkIf cfg.enable { + services.xserver = { + enable = true; + + displayManager = { + defaultSession = "plasmawayland"; + sddm = { + enable = true; + # https://discourse.nixos.org/t/plasma-wayland-session-not-available-from-sddm/13447/2 + settings.Wayland.SessionDir = "${pkgs.plasma5Packages.plasma-workspace}/share/wayland-sessions"; + }; + }; + + desktopManager.plasma5 = { + enable = true; + useQtScaling = true; + }; + + excludePackages = with pkgs; [ + xterm + ]; + }; + + environment.plasma5.excludePackages = with pkgs.libsForQt5; [ + elisa + okular + khelpcenter + konsole + print-manager + plasma-systemmonitor + gwenview + ]; + }; +} From 5f0934bf3988b4050a9188460fd65ac0995b1394 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 10 Nov 2023 11:04:15 +0100 Subject: [PATCH 104/176] Power off bluetooth at boot --- nixos/hosts/Tibo-NixFat/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index b12b53d..33324b6 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -64,7 +64,10 @@ zsh.enable = true; }; - hardware.bluetooth.enable = true; + hardware.bluetooth = { + enable = true; + powerOnBoot = false; + }; networking.hostName = "Tibo-NixFat"; From 4e0b6e9869b2770c8b41aa5cc04662580a104ab5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 10 Nov 2023 13:07:42 +0100 Subject: [PATCH 105/176] [nix] Make own module --- nixos/hosts/Tibo-NixDesk/default.nix | 17 +++++------------ nixos/hosts/Tibo-NixFat/default.nix | 11 +++++------ nixos/modules/nix/default.nix | 6 ++++++ nixos/modules/nix/flakes/default.nix | 14 ++++++++++++++ nixos/modules/nix/gc/default.nix | 25 +++++++++++++++++++++++++ 5 files changed, 55 insertions(+), 18 deletions(-) create mode 100644 nixos/modules/nix/default.nix create mode 100644 nixos/modules/nix/flakes/default.nix create mode 100644 nixos/modules/nix/gc/default.nix diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index c5bdc77..5eb7234 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -13,6 +13,11 @@ networking.openconnect-sso.enable = true; + nix = { + flakes.enable = true; + gc.onFull.enable = true; + }; + programs = { home-manager.enable = true; sops.enable = true; @@ -61,23 +66,11 @@ time.timeZone = "Europe/Brussels"; nix = { - # Allow Nix Flakes # Keep derivations so shells don't break (direnv) - # If the disk has less than 100MiB, free up to 2GiB by garbage-collecting. extraOptions = '' - experimental-features = nix-command flakes keep-outputs = true keep-derivations = true - min-free = ${toString (100 * 1024 * 1024)} - max-free = ${toString (2048 * 1024 * 1024)} ''; - # Scheduled garbage-collect - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - package = pkgs.nixFlakes; }; i18n.defaultLocale = "en_GB.UTF-8"; diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 33324b6..c05381b 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -13,6 +13,11 @@ networking.openconnect-sso.enable = true; + nix = { + flakes.enable = true; + gc.onFull.enable = true; + }; + programs = { home-manager.enable = true; sops.enable = true; @@ -94,17 +99,11 @@ }; nix = { - # Allow Nix Flakes # Keep derivations so shells don't break (direnv) - # If the disk has less than 100MiB, free up to 2GiB by garbage-collecting. extraOptions = '' - experimental-features = nix-command flakes keep-outputs = true keep-derivations = true - min-free = ${toString (100 * 1024 * 1024)} - max-free = ${toString (2048 * 1024 * 1024)} ''; - package = pkgs.nixFlakes; }; i18n.defaultLocale = "en_GB.UTF-8"; diff --git a/nixos/modules/nix/default.nix b/nixos/modules/nix/default.nix new file mode 100644 index 0000000..1c67c6d --- /dev/null +++ b/nixos/modules/nix/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./flakes + ./gc + ]; +} diff --git a/nixos/modules/nix/flakes/default.nix b/nixos/modules/nix/flakes/default.nix new file mode 100644 index 0000000..3c5d892 --- /dev/null +++ b/nixos/modules/nix/flakes/default.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.nix.flakes; +in { + options.sisyphus.nix.flakes.enable = lib.mkEnableOption "Nix Flakes"; + + config.nix = lib.mkIf cfg.enable { + extraOptions = '' + experimental-features = nix-command flakes + ''; + package = pkgs.nixFlakes; + }; +} diff --git a/nixos/modules/nix/gc/default.nix b/nixos/modules/nix/gc/default.nix new file mode 100644 index 0000000..a28133f --- /dev/null +++ b/nixos/modules/nix/gc/default.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.nix.gc; +in { + options.sisyphus.nix.gc = { + weekly.enable = lib.mkEnableOption "Scheduled Nix garbage-collection"; + onFull.enable = lib.mkEnableOption "Nix garbage-collection when disk is almost full"; + }; + + config.nix = { + # If the disk has less than 100MiB, free up to 2GiB by garbage-collecting. + extraOptions = lib.mkIf cfg.onFull.enable '' + min-free = ${toString (100 * 1024 * 1024)} + max-free = ${toString (2048 * 1024 * 1024)} + ''; + + # Scheduled garbage-collect + gc = lib.mkIf cfg.weekly.enable { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + }; +} From 553b973bb43600f6728939ed3faef3faab42584d Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 10 Nov 2023 13:50:28 +0100 Subject: [PATCH 106/176] [swayidle] Add config --- arch/stow/_scripts/.scripts/idle.sh | 19 ------------------- arch/stow/_scripts/.scripts/wander.sh | 9 --------- stow/swayidle/.config/swayidle/config | 5 +++++ 3 files changed, 5 insertions(+), 28 deletions(-) delete mode 100755 arch/stow/_scripts/.scripts/idle.sh delete mode 100755 arch/stow/_scripts/.scripts/wander.sh create mode 100644 stow/swayidle/.config/swayidle/config diff --git a/arch/stow/_scripts/.scripts/idle.sh b/arch/stow/_scripts/.scripts/idle.sh deleted file mode 100755 index 46ff18a..0000000 --- a/arch/stow/_scripts/.scripts/idle.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -# Configuration of swayidle -# Just run the script - -# Kill previous instances to avoid clashing -pkill swayidle - -swayidle -w \ - timeout 600 \ - 'swaymsg "output * dpms off"' \ - resume 'swaymsg "output * dpms on"' \ - timeout 1200 \ - 'systemctl suspend' \ - before-sleep 'swaymsg "output * dpms on"; swaylock' - # Screen needs to be turned back on or you will get a black screen after waking up again. - -# timeout 300 \ -# "~/.scripts/wander.sh" \ -# resume 'brightnessctl -r' \ diff --git a/arch/stow/_scripts/.scripts/wander.sh b/arch/stow/_scripts/.scripts/wander.sh deleted file mode 100755 index 4325164..0000000 --- a/arch/stow/_scripts/.scripts/wander.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -# Toggle brightness to 'sleep' or 'awake', since brightnessctl does not support -# percentages of current amount. -# Just run the script - -current=$( brightnessctl get ) -# Doesn't have to be accurate so we can use built-in calculator. -brightnessctl -sq set $(( current / 10 * 3 )) - diff --git a/stow/swayidle/.config/swayidle/config b/stow/swayidle/.config/swayidle/config new file mode 100644 index 0000000..d558828 --- /dev/null +++ b/stow/swayidle/.config/swayidle/config @@ -0,0 +1,5 @@ +timeout 60 'brightnessctl -sq set $(( $(brightnessctl get) / 10 * 3 ))' resume 'brightnessctl -qr' +timeout 120 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' +timeout 240 'systemctl suspend' + +before-sleep 'swaymsg "output * dpms on"; swaylock' From 523a4be56548c2bfd06e47fce5ad9220c7e1beb4 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Fri, 10 Nov 2023 13:53:46 +0100 Subject: [PATCH 107/176] [virtualbox] Add vb group to users --- nixos/modules/virtualisation/virtualbox/default.nix | 8 ++++++-- nixos/users/default.nix | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/nixos/modules/virtualisation/virtualbox/default.nix b/nixos/modules/virtualisation/virtualbox/default.nix index 5a01b66..a746493 100644 --- a/nixos/modules/virtualisation/virtualbox/default.nix +++ b/nixos/modules/virtualisation/virtualbox/default.nix @@ -28,8 +28,12 @@ in { x11 = true; }; }; - users.extraGroups.vboxusers.members = [ - "user-with-access-to-virtualbox" + + users.groups.vboxusers = {}; + + sisyphus.users.wantedGroups = [ + config.users.groups.vboxusers.name # The group we defined earlier + config.users.groups.dialout.name # Serial Port ]; }; } diff --git a/nixos/users/default.nix b/nixos/users/default.nix index a48b2c4..2c60be9 100644 --- a/nixos/users/default.nix +++ b/nixos/users/default.nix @@ -1,5 +1,14 @@ +{ config, lib, ... }: + { imports = [ ./tdpeuter ]; + + options.sisyphus.users.wantedGroups = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + example = [ config.users.groups.wheel.name ]; + description = "Groups to which a user should be added"; + }; } From 0e622c6abaf5c8edceb9caeb27631f57f79355a5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sun, 12 Nov 2023 20:08:01 +0100 Subject: [PATCH 108/176] Move swayidle script --- arch/stow/_scripts/.scripts/wlsunset.sh | 6 +++--- scripts/sunset.sh | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) mode change 100755 => 100644 arch/stow/_scripts/.scripts/wlsunset.sh create mode 100755 scripts/sunset.sh diff --git a/arch/stow/_scripts/.scripts/wlsunset.sh b/arch/stow/_scripts/.scripts/wlsunset.sh old mode 100755 new mode 100644 index 84a7d69..f185115 --- a/arch/stow/_scripts/.scripts/wlsunset.sh +++ b/arch/stow/_scripts/.scripts/wlsunset.sh @@ -6,10 +6,10 @@ pid=$(pgrep wlsunset) if [[ -z ${pid} ]] ; then # Start wlsunset right away. - wlsunset -l 50 -L 4 -t 2500 & + wlsunset -l 50.50 -L 4.00 -t 3000 -T 6500 & else # Currently stop wlsunset but restart in an hour. kill ${pid} - ~/.scripts/notify.sh 'Stopping sunset' 'Restarting in an hour' - at now +1 hours -f ~/.scripts/wlsunset.sh + notify-send 'Stopping sunset' 'Restarting in an hour' + at now +1 hours -f "${0}" fi diff --git a/scripts/sunset.sh b/scripts/sunset.sh new file mode 100755 index 0000000..f185115 --- /dev/null +++ b/scripts/sunset.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Script to disable for an hour or immediately continue wlsunset. 'Toggle' + +# Check if wlsunset is still running +pid=$(pgrep wlsunset) + +if [[ -z ${pid} ]] ; then + # Start wlsunset right away. + wlsunset -l 50.50 -L 4.00 -t 3000 -T 6500 & +else + # Currently stop wlsunset but restart in an hour. + kill ${pid} + notify-send 'Stopping sunset' 'Restarting in an hour' + at now +1 hours -f "${0}" +fi From 3d07c5e58ffdbfd5c9a64874b741e797a4ffa283 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sun, 12 Nov 2023 20:08:53 +0100 Subject: [PATCH 109/176] [swayidle] Fix timeout after sleep --- stow/swayidle/.config/swayidle/config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stow/swayidle/.config/swayidle/config b/stow/swayidle/.config/swayidle/config index d558828..973d62b 100644 --- a/stow/swayidle/.config/swayidle/config +++ b/stow/swayidle/.config/swayidle/config @@ -2,4 +2,5 @@ timeout 60 'brightnessctl -sq set $(( $(brightnessctl get) / 10 * 3 ))' resume timeout 120 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' timeout 240 'systemctl suspend' -before-sleep 'swaymsg "output * dpms on"; swaylock' +before-sleep 'playerctl pause' +before-sleep 'swaymsg "output * dpms on"; swaylock --grace 0' # Avoid being able to unlock immediately without password From 55f7385742881e6bf243282c01b1940f28526e15 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sun, 12 Nov 2023 20:16:49 +0100 Subject: [PATCH 110/176] Remove simple focus script --- arch/stow/_scripts/.scripts/focus.sh | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100755 arch/stow/_scripts/.scripts/focus.sh diff --git a/arch/stow/_scripts/.scripts/focus.sh b/arch/stow/_scripts/.scripts/focus.sh deleted file mode 100755 index 37f9bcd..0000000 --- a/arch/stow/_scripts/.scripts/focus.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -# Script to toggle black background to focus on sway - -# Get instances of swaybg, except for the 'standard' one. -list=$( pgrep swaybg | head -n -1 ) - -if [ -z "${list}" ] ; then - swaybg --mode=solid_color --color=#000000 & - # Give the previous command some time to execute - sleep .1 - swaymsg reload -else - # Clean up if already running - kill $( tr ' ' '\n' <<< ${list} ) -fi - From 9bc2761ee15d68132991e17c11a1eb13de3016b1 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 14 Nov 2023 20:51:38 +0100 Subject: [PATCH 111/176] Update notify.sh --- {arch/stow/_scripts/.scripts => scripts}/notify.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) rename {arch/stow/_scripts/.scripts => scripts}/notify.sh (81%) diff --git a/arch/stow/_scripts/.scripts/notify.sh b/scripts/notify.sh similarity index 81% rename from arch/stow/_scripts/.scripts/notify.sh rename to scripts/notify.sh index faa63de..a9453d5 100755 --- a/arch/stow/_scripts/.scripts/notify.sh +++ b/scripts/notify.sh @@ -2,8 +2,10 @@ # Show system status in notification, or your own message # Syntaxis: notify [-vb] [-t ] [-p ] [ <message>] -# Requirements: +# Requirements/dependencies: +# - amixer # - brightnessctl +# - libnotify (notify-send) panic () { >&2 echo "Syntaxis: notify [-vb] [-t <timeout>] [-p <value>] [<title> <message>]" @@ -20,15 +22,15 @@ while getopts ":bvt:p:" options; do ;; v) # Get volume (don't use pamixer because that is way slower) - value=$( pactl get-sink-volume @DEFAULT_SINK@ \ - | cut -d '/' -f2 \ - | grep -o '[0-9]*%' \ - | tr -d '%' ) + value=$( amixer sget 'Master' \ + | grep -o '\[[0-9]*%\]' \ + | tr -d '][%' \ + | head -n1 ) title="Volume: ${value}%" category='sysinfo' # If audio disabled, set value to zero. - if [ "$( pactl get-sink-mute @DEFAULT_SINK@ )" == "Mute: yes" ] ; then + if [ "$( amixer sget 'Master' | grep -o '\[\(on\|off\)\]' | head -n1 )" == "[off]" ] ; then title="Volume: ${value}% (Disabled)" value=0 fi From 69ff446a04432e88c0b6412e8bb57093b078572e Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Tue, 14 Nov 2023 21:04:57 +0100 Subject: [PATCH 112/176] Combine unfreepkgs list for stable and unstable --- nixos/flake.nix | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/nixos/flake.nix b/nixos/flake.nix index 3909e0f..64bf1bc 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -30,17 +30,21 @@ ... }: let system = "x86_64-linux"; + + unfreePackages = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ + "corefonts" + "nvidia-settings" "nvidia-x11" + "obsidian" + "Oracle_VM_VirtualBox_Extension_Pack" + "spotify" + "steam" "steam-original" "steam-run" + "vista-fonts" + ]; in utils.lib.mkFlake { inherit self inputs; - channelsConfig.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ - "corefonts" - "nvidia-settings" - "nvidia-x11" - "Oracle_VM_VirtualBox_Extension_Pack" - "vista-fonts" - ]; + channelsConfig.allowUnfreePredicate = unfreePackages; sharedOverlays = [ (import ./overlays/cmdtime) @@ -56,10 +60,7 @@ specialArgs = { pkgs-unstable = import nixpkgs-unstable { inherit system; - config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ - "obsidian" - "spotify" - ]; + config.allowUnfreePredicate = unfreePackages; }; }; From be4fc18caa4215418078c0b4b9f14379592a64e0 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Tue, 14 Nov 2023 21:17:35 +0100 Subject: [PATCH 113/176] Use specific Linux kernels --- nixos/hosts/Tibo-NixDesk/default.nix | 14 +++++++++----- nixos/hosts/Tibo-NixFat/default.nix | 3 +++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index 5eb7234..3890a88 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -35,11 +35,15 @@ virtualisation.virtualbox.enable = true; }; - boot.loader = { - systemd-boot.enable = true; - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot/efi"; + boot = { + kernelPackages = pkgs.linuxPackages_hardened; + + loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; + }; }; }; diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index c05381b..9cc516d 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -47,6 +47,8 @@ }; }; + kernelPackages = pkgs.linuxPackages_hardened; + # Use the systemd-boot EFI boot loader.] loader = { systemd-boot.enable = true; @@ -66,6 +68,7 @@ ]; programs = { + steam.enable = true; zsh.enable = true; }; From 84b0d44ac147511a3ace4e27248bdc2ee039023e Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Tue, 14 Nov 2023 21:53:22 +0100 Subject: [PATCH 114/176] Drop mako support --- arch/stow/_scripts/.scripts/dnd.sh | 22 ---------------------- scripts/do-not-disturb.sh | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 22 deletions(-) delete mode 100755 arch/stow/_scripts/.scripts/dnd.sh create mode 100755 scripts/do-not-disturb.sh diff --git a/arch/stow/_scripts/.scripts/dnd.sh b/arch/stow/_scripts/.scripts/dnd.sh deleted file mode 100755 index 5037511..0000000 --- a/arch/stow/_scripts/.scripts/dnd.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -# Script to toggle Do not disturb mode for mako and dunst - -# Permanent memory -saved_state=0 - -# Toggle -if [[ ${saved_state} -eq 0 ]] ; then - ~/.scripts/notify.sh 'Hiding notifications' - sleep 5 - makoctl set-mode do-not-disturb - dunstctl set-paused true -else - makoctl set-mode default - dunstctl set-paused false - ~/.scripts/notify.sh 'Showing notifications' -fi - -# Update status in file -new_state=$(( (${saved_state} + 1) % 2 )) -sed -i "s/^saved_state=.*$/saved_state=${new_state}/" "${0}" - diff --git a/scripts/do-not-disturb.sh b/scripts/do-not-disturb.sh new file mode 100755 index 0000000..c9c5f21 --- /dev/null +++ b/scripts/do-not-disturb.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# Script to toggle Do not disturb mode for dunst + +# Get current state +if [ "$( command -v dunstctl )" ]; then + current_state="$( dunstctl is-paused )" +fi + +# Toggle +if [ "${current_state}" == "false" ] ; then + notify-send 'Hiding notifications' + sleep 5 + # makoctl set-mode do-not-disturb + dunstctl set-paused true +else + # makoctl set-mode default + dunstctl set-paused false + notify-send 'Showing notifications' +fi From 43d4d0c3651d1f5c2907dae25fc06f5c75879631 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Tue, 14 Nov 2023 22:07:24 +0100 Subject: [PATCH 115/176] Remove old scripts --- arch/stow/_scripts/.scripts/wlsunset.sh | 15 --------------- arch/stow/_scripts/git-flake | 7 ------- 2 files changed, 22 deletions(-) delete mode 100644 arch/stow/_scripts/.scripts/wlsunset.sh delete mode 100755 arch/stow/_scripts/git-flake diff --git a/arch/stow/_scripts/.scripts/wlsunset.sh b/arch/stow/_scripts/.scripts/wlsunset.sh deleted file mode 100644 index f185115..0000000 --- a/arch/stow/_scripts/.scripts/wlsunset.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -# Script to disable for an hour or immediately continue wlsunset. 'Toggle' - -# Check if wlsunset is still running -pid=$(pgrep wlsunset) - -if [[ -z ${pid} ]] ; then - # Start wlsunset right away. - wlsunset -l 50.50 -L 4.00 -t 3000 -T 6500 & -else - # Currently stop wlsunset but restart in an hour. - kill ${pid} - notify-send 'Stopping sunset' 'Restarting in an hour' - at now +1 hours -f "${0}" -fi diff --git a/arch/stow/_scripts/git-flake b/arch/stow/_scripts/git-flake deleted file mode 100755 index e6df509..0000000 --- a/arch/stow/_scripts/git-flake +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -# Ignore flake.nix and flake.lock -# For using personal flakes in a project that does not provide and want flakes. -# Syntaxis: git flake - -git add --intent-to-add flake.nix flake.lock -git update-index --assume-unchanged flake.nix From a112f3929bdaec23841323dedd5bba983f5748b5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Tue, 14 Nov 2023 22:07:52 +0100 Subject: [PATCH 116/176] Fix comments; works now --- scripts/toggle-light-dark.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/toggle-light-dark.sh b/scripts/toggle-light-dark.sh index 4c5d074..890e29e 100755 --- a/scripts/toggle-light-dark.sh +++ b/scripts/toggle-light-dark.sh @@ -88,8 +88,6 @@ if [ "$(command -v vifm)" ]; then fi # Vim -# This does not reload the config, but will use it when you restart vim -# Toggle an existing window using `:colorscheme ${theme}` if [ "$(command -v vim)" ]; then echo "colorscheme ${theme}" > ~/.vim/theme.conf # Update all running instances From 125803927c4ceb203783ccd19d92498ae2811c41 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Tue, 14 Nov 2023 22:19:05 +0100 Subject: [PATCH 117/176] Use vim-full instead of vim --- nixos/hosts/Tibo-NixDesk/default.nix | 2 +- nixos/hosts/Tibo-NixFat/default.nix | 2 +- nixos/users/tdpeuter/dotfiles.nix | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index 3890a88..cbef30c 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -49,7 +49,7 @@ environment.systemPackages = with pkgs; [ git - vim + vim-full w3m wget zenith-nvidia diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 9cc516d..b794143 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -61,7 +61,7 @@ environment.systemPackages = with pkgs; [ git - vim + vim-full w3m wget zenith-nvidia diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index d77ade0..34db407 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -66,16 +66,16 @@ in { source = ../../../stow/ssh/.ssh/config; }; ".vim" = { - enable = (builtins.elem pkgs.vim installedPkgs); + enable = (builtins.elem pkgs.vim-full installedPkgs); source = ../../../stow/vim/.vim; recursive = true; }; ".vim/autoload/plug.vim" = { - enable = (builtins.elem pkgs.vim installedPkgs); + enable = (builtins.elem pkgs.vim-full installedPkgs); source = "${pkgs.vimPlugins.vim-plug}/plug.vim"; }; ".vimrc" = { - enable = (builtins.elem pkgs.vim installedPkgs); + enable = (builtins.elem pkgs.vim-full installedPkgs); source = ../../../stow/vim/.vimrc; }; ".zshrc" = { From 7dda8086d480d96cfd18dc7bc31a40e4256660b2 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Tue, 14 Nov 2023 22:32:04 +0100 Subject: [PATCH 118/176] [direnv] Create module --- nixos/hosts/Tibo-NixDesk/default.nix | 9 +------ nixos/hosts/Tibo-NixFat/default.nix | 9 +------ nixos/modules-old/default.nix | 29 ----------------------- nixos/modules/programs/default.nix | 3 ++- nixos/modules/programs/direnv/default.nix | 22 +++++++++++++++++ 5 files changed, 26 insertions(+), 46 deletions(-) delete mode 100644 nixos/modules-old/default.nix create mode 100644 nixos/modules/programs/direnv/default.nix diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index cbef30c..7695521 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -19,6 +19,7 @@ }; programs = { + direnv.enable = true; home-manager.enable = true; sops.enable = true; ssh.enable = true; @@ -69,14 +70,6 @@ time.timeZone = "Europe/Brussels"; - nix = { - # Keep derivations so shells don't break (direnv) - extraOptions = '' - keep-outputs = true - keep-derivations = true - ''; - }; - i18n.defaultLocale = "en_GB.UTF-8"; console = { # font = "Lat2-Terminus16"; diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index b794143..c00d9a1 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -19,6 +19,7 @@ }; programs = { + direnv.enable = true; home-manager.enable = true; sops.enable = true; ssh.enable = true; @@ -101,14 +102,6 @@ networkmanager.enable = true; }; - nix = { - # Keep derivations so shells don't break (direnv) - extraOptions = '' - keep-outputs = true - keep-derivations = true - ''; - }; - i18n.defaultLocale = "en_GB.UTF-8"; console = { # font = "Lat2-Terminus16"; diff --git a/nixos/modules-old/default.nix b/nixos/modules-old/default.nix deleted file mode 100644 index 35fb80f..0000000 --- a/nixos/modules-old/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ inputs, lib, config, pkgs, ... }: - -{ - nix = { - # Allow Nix Flakes - # Keep derivations so shells don't break (direnv) - # If the disk has less than 100MiB, free up to 2GiB by garbage-collecting. - extraOptions = '' - experimental-features = nix-command flakes - keep-outputs = true - keep-derivations = true - min-free = ${toString (100 * 1024 * 1024)} - max-free = ${toString (2048 * 1024 * 1024)} - ''; - # Scheduled garbage-collect - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - package = pkgs.nixFlakes; - }; - - i18n.defaultLocale = "en_GB.UTF-8"; - console = { - # font = "Lat2-Terminus16"; - useXkbConfig = true; # use xkbOptions in tty. - }; -} diff --git a/nixos/modules/programs/default.nix b/nixos/modules/programs/default.nix index 6a41a2f..fd61ea8 100644 --- a/nixos/modules/programs/default.nix +++ b/nixos/modules/programs/default.nix @@ -1,8 +1,9 @@ { imports = [ + ./direnv ./home-manager ./sops - ./ssh ./spotify-adblock + ./ssh ]; } diff --git a/nixos/modules/programs/direnv/default.nix b/nixos/modules/programs/direnv/default.nix new file mode 100644 index 0000000..7ecf1b7 --- /dev/null +++ b/nixos/modules/programs/direnv/default.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: + +let + cfg = sisyphus.programs.direnv; +in { + options.sisyphus.programs.direnv.enable = lib.mkEnableOption "direnv"; + + config = lib.mkIf cfg.enable { + programs.direnv = { + enable = true; + nix-direnv.enable = true; # Use nix-specific direnv. + persistDerivations = true; # Sets the extraOptions listed below. + }; + + # This is also done by setting programs.direnv.persistDerivations. + # Keep derivations so shells don't break. + nix.extraOption = '' + keep-outputs = true + keep-derivations = true + ''; + }; +}; From 65ef0adf6d420bc2c34cd471830acea92e241648 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Tue, 14 Nov 2023 22:33:03 +0100 Subject: [PATCH 119/176] [waybar] Move config --- arch/stow/waybar/.config/waybar/modules.json | 156 ----------------- nixos/users/tdpeuter/dotfiles.nix | 4 + .../waybar/.config/waybar/config | 14 +- .../waybar/.config/waybar/default.json | 5 +- .../waybar/.config/waybar/left.json | 3 + .../waybar/.config/waybar/mediaplayer.py | 0 stow/waybar/.config/waybar/modules.json | 162 ++++++++++++++++++ .../waybar/.config/waybar/round.css | 0 .../waybar/.config/waybar/sharp.css | 0 .../waybar/.config/waybar/style.css | 18 +- .../waybar/.config/waybar/transparent.css | 0 11 files changed, 188 insertions(+), 174 deletions(-) delete mode 100644 arch/stow/waybar/.config/waybar/modules.json rename {arch/stow => stow}/waybar/.config/waybar/config (77%) rename {arch/stow => stow}/waybar/.config/waybar/default.json (88%) rename {arch/stow => stow}/waybar/.config/waybar/left.json (74%) rename {arch/stow => stow}/waybar/.config/waybar/mediaplayer.py (100%) create mode 100644 stow/waybar/.config/waybar/modules.json rename {arch/stow => stow}/waybar/.config/waybar/round.css (100%) rename {arch/stow => stow}/waybar/.config/waybar/sharp.css (100%) rename {arch/stow => stow}/waybar/.config/waybar/style.css (82%) rename {arch/stow => stow}/waybar/.config/waybar/transparent.css (100%) diff --git a/arch/stow/waybar/.config/waybar/modules.json b/arch/stow/waybar/.config/waybar/modules.json deleted file mode 100644 index 3bd3ba4..0000000 --- a/arch/stow/waybar/.config/waybar/modules.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - - "battery": { - "format": "{capacity}% {icon}", - "format-alt": "{time} {icon}", - "format-charging": "{capacity}% \uf0e7 {icon}", - "format-icons": ["\uf244", "\uf243", "\uf242", "\uf241", "\uf240"], - "format-plugged": "{capacity}% \ue55c", - "states": { - "warning": 30, - "critical": 15 - } - }, - - - "disk": { - "interval": 30, - "format": "{percentage_used}% \uf0a0", - "on-click": "alacritty -e ncdu /", - "path": "/", - "tooltip-format": "{used} used out of {total} on {path} ({percentage_free}% or {free} free)" - }, - - - "bluetooth": { - "format-disabled": "<big>\uf294</big>", - "format-off": "\uf294", - "format-on": "<big>\uf294</big>", - "format-connected": "<big>\uf294</big>c", - "max-length": 10.3, - "on-click": "alacritty --title 'FZF-Jump' -e ~/.scripts/fzf-jump/standalone.sh ~/.scripts/fzf-jump/modules/bluetooth.sh", - "tooltip-format": "{status}", - "tooltip-format-on": "{status}, no devices connected", - "tooltip-format-connected": "{status} ({num_connections}):\n{device_enumerate}", - "tooltip-format-enumerate-connected": "{device_alias} ({device_address})", - "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}" - }, - - - "clock": { - "format": "{:%H:%M}", - "format-alt": "{:%d/%m/%Y %H:%M}", - // "timezone": "Europe/Brussels", - "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>" - }, - - - "custom/browser": { - "format": "\uf120", - "on-click": "alacritty -t 'FZF-Jump' -e ~/.scripts/fzf-jump/launcher.sh", - "tooltip-format": "Launch an application" - }, - - - "custom/media": { - "escape": true, - "exec": "~/.config/waybar/mediaplayer.py 2> /dev/null", - "format": "{icon} {}", - "format-icons": { - "default": "\uf51f", - "spotify": "\uf1bc" - }, - "max-length": 40, - "on-click": "playerctl play-pause", - "return-type": "json" - }, - - - "cpu": { - "format": "{usage}% \uf2db", - "on-click": "alacritty -e htop", - "tooltip": true - }, - - - "idle_inhibitor": { - "format": "{icon}", - "format-icons": { - "activated": "\uf06e", - "deactivated": "\uf070" - }, - "tooltip": false - }, - - - "memory": { - "format": "{}% \uf1c0", - "on-click": "alacritty -e htop" - }, - - - "network": { - "format-disconnected": "\uf127", - "format-ethernet": "\uf6ff {ifname}: {ipadds}/{cidr}", - "format-wifi": "\uf1eb", - "interval": 5, - "on-click-right": "alacritty -e nmtui", - "tooltip-format": "{ifname}: {ipaddr}", - "tooltip-format-disconnected": "Disconnected", - "tooltip-format-wifi": "{essid} ({signalStrength}%)\n{ifname}: {ipaddr}" - }, - - - "sway/window": { - "max-length": 85 - }, - - - "sway/workspaces": { - "all-outputs": false, - "disable-scroll": true, - "format": "{icon}{name}", - "format-icons": { - "default": "", // Prevent showing workspace name literal. - "urgent": "\uf071 " - }, - // "persistent_workspaces": { - // "0:¯\\_(ツ)_/¯": [] - // } - }, - - - "pulseaudio": { - "format": "{volume}% {icon}{format_source}", - "format-bluetooth": "{volume}% {icon}\uf294{format_source}", - "format-bluetooth-muted": "\uf6a9 {icon}\uf294{format_source}", - "format-muted": "\uf6a9{format_source}", - "format-source": " {volume}% \uf130", - "format-source-muted": "", - "format-icons": { - "headphone": "\uf58f", - "hands-free": "\uf590", - "headset": "\uf590", - "phone": "\uf3ce", - "portable": "\uf3ce", - "car": "\uf1b9", - "default": ["\uf026", "\uf027", "\uf028 "] - }, - "on-click": "pamixer --toggle-mute", - "on-click-right": "pavucontrol", - "scroll-step": 2 - }, - - - "temperature": { - "critical-threshold": 70, - "format": "{temperatureC}°C {icon}", - "format-icons": ["\uf2cb", "\uf2c9", "\uf2c7"] - }, - - - "tray": { - "spacing": 10 - } - -} diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index 34db407..0603830 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -49,6 +49,10 @@ in { source = ../../../stow/vifm/.config/vifm; recursive = true; # Fix history and all working }; + ".config/waybar" = { + enable = config.sisyphus.desktop.sway.enable; + source = ../../../stow/waybar/.config/waybar; + }; ".config/zellij" = { enable = (builtins.elem pkgs.zellij installedPkgs); source = ../../../stow/zellij/.config/zellij; diff --git a/arch/stow/waybar/.config/waybar/config b/stow/waybar/.config/waybar/config similarity index 77% rename from arch/stow/waybar/.config/waybar/config rename to stow/waybar/.config/waybar/config index a8198f5..45b047a 100644 --- a/arch/stow/waybar/.config/waybar/config +++ b/stow/waybar/.config/waybar/config @@ -3,15 +3,14 @@ // [{ - "name": "toggle", "mode": "hide", - "ipc": true, + "ipc": true, "position": "top", - "height": 25, - "spacing": 4, + "height": 25, + "spacing": 4, "margin": "-25px 0 0 0", // Show this bar on top of the other one, seemingly the "same" one. "custom/sep": { @@ -28,18 +27,15 @@ }, { - "name": "keep", "position": "top", "height": 25, - "modules-left": ["sway/mode", "custom/browser"], - "modules-center": ["sway/window"], - "modules-right": ["clock"], + "modules-left": ["sway/mode"], + "modules-center": ["clock"], "include": [ // Import modules (!) "~/.config/waybar/modules.json" ], - }] diff --git a/arch/stow/waybar/.config/waybar/default.json b/stow/waybar/.config/waybar/default.json similarity index 88% rename from arch/stow/waybar/.config/waybar/default.json rename to stow/waybar/.config/waybar/default.json index d045a28..7a3f71c 100644 --- a/arch/stow/waybar/.config/waybar/default.json +++ b/stow/waybar/.config/waybar/default.json @@ -1,13 +1,12 @@ - { - "modules-left": [ + "modules-left": [ "idle_inhibitor", "custom/media" ], "modules-center": [ "sway/workspaces" ], - "modules-right": [ + "modules-right": [ "disk", "memory", "cpu", diff --git a/arch/stow/waybar/.config/waybar/left.json b/stow/waybar/.config/waybar/left.json similarity index 74% rename from arch/stow/waybar/.config/waybar/left.json rename to stow/waybar/.config/waybar/left.json index d8948f0..23b4b5d 100644 --- a/arch/stow/waybar/.config/waybar/left.json +++ b/stow/waybar/.config/waybar/left.json @@ -2,6 +2,9 @@ "modules-left": [ "sway/workspaces", "idle_inhibitor", + "custom/light-dark-toggle", + "custom/night-light-toggle", + "custom/toggle-notifications", "custom/media" ], "modules-right": [ diff --git a/arch/stow/waybar/.config/waybar/mediaplayer.py b/stow/waybar/.config/waybar/mediaplayer.py similarity index 100% rename from arch/stow/waybar/.config/waybar/mediaplayer.py rename to stow/waybar/.config/waybar/mediaplayer.py diff --git a/stow/waybar/.config/waybar/modules.json b/stow/waybar/.config/waybar/modules.json new file mode 100644 index 0000000..39e2d9e --- /dev/null +++ b/stow/waybar/.config/waybar/modules.json @@ -0,0 +1,162 @@ +{ + "battery": { + "format": "{capacity}% {icon}", + "format-alt": "{time} {icon}", + "format-charging": "{capacity}% \uf0e7 {icon}", + "format-icons": ["\uf244", "\uf243", "\uf242", "\uf241", "\uf240"], + "format-plugged": "{capacity}% \ue55c", + "states": { + "warning": 30, + "critical": 15 + } + }, + + "disk": { + "interval": 30, + "format": "{percentage_used}% \uf0a0", + "on-click": "kitty -e duf /", + "path": "/", + "tooltip-format": "{used} used out of {total} on {path} ({percentage_free}% or {free} free)" + }, + + "bluetooth": { + "format-disabled": "<big>\uf294</big>", + "format-off": "\uf294", + "format-on": "<big>\uf294</big>", + "format-connected": "<big>\uf294</big>c", + "max-length": 10.3, + "on-click": "bluetoothctl power $( bluetoothctl show | sed -n 's/\\s*Powered: \\(yes\\|no\\)/\\1/p' | sed 's/yes/off/;s/no/on/' )", + "on-click-right": "kitty -e bluetoothctl", + "tooltip-format": "{status}", + "tooltip-format-on": "{status}, no devices connected", + "tooltip-format-connected": "{status} ({num_connections}):\n{device_enumerate}", + "tooltip-format-enumerate-connected": "{device_alias} ({device_address})", + "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}" + }, + + "clock": { + "format": "{:%H:%M}", + "format-alt": "{:%d/%m/%Y %H:%M}", + "timezone": "Europe/Brussels", + "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>" + }, + + "custom/browser": { + "format": "\uf120", + "on-click": "dmenu_run", + "tooltip-format": "Launch an application" + }, + + "custom/media": { + "escape": true, + "exec": "~/.config/waybar/mediaplayer.py 2> /dev/null", + "format": "{icon} {}", + "format-icons": { + "default": "\uf51f", + "spotify": "\uf1bc" + }, + "max-length": 40, + "on-click": "playerctl play-pause", + "return-type": "json" + }, + + "custom/light-dark-toggle": { + "on-click": "bash ${SCRIPT_DIR}/toggle-light-dark.sh", + "tooltip-format": "Toggle between light and dark mode", + "format": "\uf042 ", + "tooltip": true + }, + + "custom/night-light-toggle": { + "on-click": "bash ${SCRIPT_DIR}/sunset.sh", + "tooltip-format": "Toggle night-light on or off", + "format": "\uf0eb ", + "tooltip": true + }, + + "custom/toggle-notifications": { + "on-click": "bash ${SCRIPT_DIR}/do-not-disturb.sh", + "tooltip-format": "Toggle notifications", + "format": "\uf1f6 ", + "tooltip": true + }, + + "cpu": { + "format": "{usage}% \uf2db", + "on-click": "kitty -e htop", + "tooltip": true + }, + + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "\uf06e", + "deactivated": "\uf070" + }, + "tooltip": false + }, + + "memory": { + "format": "{}% \uf1c0", + "on-click": "kitty -e zenith" + }, + + "network": { + "format-disconnected": "\uf127", + "format-ethernet": "\uf6ff {ifname}: {ipadds}/{cidr}", + "format-wifi": "\uf1eb", + "interval": 5, + "on-click-right": "kitty -e nmtui", + "tooltip-format": "{ifname}: {ipaddr}", + "tooltip-format-disconnected": "Disconnected", + "tooltip-format-wifi": "{essid} ({signalStrength}%)\n{ifname}: {ipaddr}" + }, + + "sway/window": { + "max-length": 85 + }, + + "sway/workspaces": { + "all-outputs": false, + "disable-scroll": true, + "format": "{icon}{name}", + "format-icons": { + "default": "", // Prevent showing workspace name literal. + "urgent": "\uf071 " + }, + // "persistent_workspaces": { + // "0:¯\\_(ツ)_/¯": [] + // } + }, + + "pulseaudio": { + "format": "{volume}% {icon}{format_source}", + "format-muted": "\uf6a9{format_source}", + "format-bluetooth": "{volume}% {icon}\uf294{format_source}", + "format-bluetooth-muted": "\uf6a9 {icon}\uf294{format_source}", + "format-source": " {volume}% \uf130", + "format-source-muted": "", + "format-icons": { + "headphone": "\uf58f", + "hands-free": "\uf590", + "headset": "\uf590", + "phone": "\uf3ce", + "portable": "\uf3ce", + "car": "\uf1b9", + "default": ["\uf026", "\uf027", "\uf028 "] + }, + "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle", + "on-click-right": "pavucontrol", + "scroll-step": 2 + }, + + "temperature": { + "critical-threshold": 70, + "format": "{temperatureC}°C {icon}", + "format-icons": ["\uf2cb", "\uf2c9", "\uf2c7"] + }, + + "tray": { + "spacing": 10 + } +} diff --git a/arch/stow/waybar/.config/waybar/round.css b/stow/waybar/.config/waybar/round.css similarity index 100% rename from arch/stow/waybar/.config/waybar/round.css rename to stow/waybar/.config/waybar/round.css diff --git a/arch/stow/waybar/.config/waybar/sharp.css b/stow/waybar/.config/waybar/sharp.css similarity index 100% rename from arch/stow/waybar/.config/waybar/sharp.css rename to stow/waybar/.config/waybar/sharp.css diff --git a/arch/stow/waybar/.config/waybar/style.css b/stow/waybar/.config/waybar/style.css similarity index 82% rename from arch/stow/waybar/.config/waybar/style.css rename to stow/waybar/.config/waybar/style.css index 499b543..a922899 100644 --- a/arch/stow/waybar/.config/waybar/style.css +++ b/stow/waybar/.config/waybar/style.css @@ -15,8 +15,9 @@ @define-color accent #00897b; window#waybar { - font-family: Letter; /* This is my personal font. */ + font-family: font-awesome, letter, monospace; font-size: 13px; + -webkit-font-smoothing: antialiased; transition-property: background-color; transition-duration: .5s; } @@ -32,22 +33,26 @@ window#waybar { padding: 0 5px; } -#workspaces button:hover, #workspaces button.focused { background-color: transparent; color: @white; } +#workspaces button:hover { + background-color: transparent; + color: @transparent-black; +} + #workspaces button.urgent { color: @white; background-color: @warning-red; } /* All modules individually. */ -#backlight, #battery, #bluetooth, #clock, #cpu, -#custom-browser, #custom-media, #disk, #idle_inhibitor, -#memory, #mode, #mpd, #network, #pulseaudio, -#temperature, #tray { +#backlight, #battery, #bluetooth, #clock, #cpu, +#custom-browser, #custom-media, #custom-light-dark-toggle, #custom-night-light-toggle, #custom-toggle-notifications, +#disk, #idle_inhibitor, #memory, #mode, #mpd, #network, +#pulseaudio, #temperature, #tray { padding: 0 5px; } @@ -114,6 +119,7 @@ label:focus { background-color: #eb4d4b; } +#custom_light-dark-toggle.activated, #idle_inhibitor.activated { background-color: #ecf0f1; color: #2d3436; diff --git a/arch/stow/waybar/.config/waybar/transparent.css b/stow/waybar/.config/waybar/transparent.css similarity index 100% rename from arch/stow/waybar/.config/waybar/transparent.css rename to stow/waybar/.config/waybar/transparent.css From 8f97a8c7199e35b25fcc9a6e4cfe944f1f32df0f Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Tue, 14 Nov 2023 22:37:04 +0100 Subject: [PATCH 120/176] [sway] Move config and use --- arch/stow/sway/.config/sway/autostart.sh | 35 ---- arch/stow/sway/.config/sway/commands | 178 --------------------- arch/stow/sway/.config/sway/config | 54 ------- arch/stow/sway/.config/sway/modes | 93 ----------- arch/stow/sway/.config/sway/style | 27 ---- nixos/modules-old/des/sway/default.nix | 110 ------------- nixos/modules/default.nix | 1 + nixos/modules/desktop/default.nix | 2 + nixos/modules/desktop/sway/default.nix | 128 +++++++++++++++ nixos/users/tdpeuter/default.nix | 2 +- nixos/users/tdpeuter/dotfiles.nix | 12 ++ stow/sway/.config/sway/config | 61 +++++++ stow/sway/.config/sway/input-output | 11 ++ stow/sway/.config/sway/keybinds | 195 +++++++++++++++++++++++ stow/sway/.config/sway/modes | 88 ++++++++++ stow/sway/.config/sway/style | 31 ++++ 16 files changed, 530 insertions(+), 498 deletions(-) delete mode 100755 arch/stow/sway/.config/sway/autostart.sh delete mode 100644 arch/stow/sway/.config/sway/commands delete mode 100644 arch/stow/sway/.config/sway/config delete mode 100644 arch/stow/sway/.config/sway/modes delete mode 100644 arch/stow/sway/.config/sway/style delete mode 100644 nixos/modules-old/des/sway/default.nix create mode 100644 nixos/modules/desktop/sway/default.nix create mode 100644 stow/sway/.config/sway/config create mode 100644 stow/sway/.config/sway/input-output create mode 100644 stow/sway/.config/sway/keybinds create mode 100644 stow/sway/.config/sway/modes create mode 100644 stow/sway/.config/sway/style diff --git a/arch/stow/sway/.config/sway/autostart.sh b/arch/stow/sway/.config/sway/autostart.sh deleted file mode 100755 index dfea59b..0000000 --- a/arch/stow/sway/.config/sway/autostart.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# -# ~/.config/sway/autostart.sh -# List of applications to autostart -# - -function execute () { - setsid --fork $SHELL -c "${1}" &> /dev/null -} - -# Idle script -execute "~/.scripts/idle.sh" - -# Gamma and brightness -execute "clight" - -# Notification manager -execute "dunst -verbosity crit" - -# Fix [Slow launch for some GTK apps](https://github.com/swaywm/sway/issues/5732) -dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK - -# Fix JetBrain IDE's showing properly -wmname LG3 - - -sleep 3 -# --- Everything that requires tray to be active --- - -# Nextcloud client -execute "nextcloud --background" - -# Activity watch server & client -execute "aw-qt" - diff --git a/arch/stow/sway/.config/sway/commands b/arch/stow/sway/.config/sway/commands deleted file mode 100644 index 4c3c621..0000000 --- a/arch/stow/sway/.config/sway/commands +++ /dev/null @@ -1,178 +0,0 @@ -# -# ~/.config/sway/commands -# Keybinds for sway -# - -# Variables -set { - $alt Mod1 - $flag Mod4 - $term alacritty - $notify ~/.scripts/notify.sh -} - -# Focus -bindsym { - $flag+h focus left - $flag+j focus down - $flag+k focus up - $flag+l focus right - - $flag+Left focus left - $flag+Down focus down - $flag+Up focus up - $flag+Right focus right - - $flag+semicolon focus mode_toggle - $flag+p focus parent -} - -# Move windows -bindsym { - $flag+Shift+h move left - $flag+Shift+j move down - $flag+Shift+k move up - $flag+Shift+l move right - - $flag+Shift+Left move left - $flag+Shift+Down move down - $flag+Shift+Up move up - $flag+Shift+Right move right - - $flag+Next move scratchpad - $flag+KP_Next move scratchpad - $flag+Prior scratchpad show - $flag+KP_Prior scratchpad show -} - -# Layouts -bindsym { - $flag+w layout toggle split - $flag+x layout tabbed - $flag+c split h - $flag+v split v - - $flag+f floating enable, border normal 1 - $flag+Shift+f floating disable, border pixel 1 - - $alt+Next border pixel 1 # Show window title - $alt+KP_Next border pixel 1 - $alt+Prior border normal 1 # Hide window title - $alt+KP_Prior border normal 1 - - $flag+s sticky toggle -} - -# Workspaces -set { - $ws1 "1:1" - $ws2 "2:2" - $ws3 "3:3" - $ws4 "4:4" - $ws5 "5:5" - $ws6 "6:6" - $ws7 "7:7" - $ws8 "8:8" - $ws9 "9:9" - $ws10 "10:10" - $ws11 "11:Soc" - $ws12 "12:Ent" -} - -bindsym { - $flag+1 workspace $ws1 - $flag+2 workspace $ws2 - $flag+3 workspace $ws3 - $flag+4 workspace $ws4 - $flag+5 workspace $ws5 - $flag+6 workspace $ws6 - $flag+7 workspace $ws7 - $flag+8 workspace $ws8 - $flag+9 workspace $ws9 - $flag+0 workspace $ws10 - $flag+minus workspace $ws11 - $flag+equal workspace $ws12 - - $flag+Shift+1 move container to workspace $ws1, workspace $ws1 - $flag+Shift+2 move container to workspace $ws2, workspace $ws2 - $flag+Shift+3 move container to workspace $ws3, workspace $ws3 - $flag+Shift+4 move container to workspace $ws4, workspace $ws4 - $flag+Shift+5 move container to workspace $ws5, workspace $ws5 - $flag+Shift+6 move container to workspace $ws6, workspace $ws6 - $flag+Shift+7 move container to workspace $ws7, workspace $ws7 - $flag+Shift+8 move container to workspace $ws8, workspace $ws8 - $flag+Shift+9 move container to workspace $ws9, workspace $ws9 - $flag+Shift+0 move container to workspace $ws10, workspace $ws10 - $flag+Shift+minus move container to workspace $ws11, workspace $ws11 - $flag+Shift+equal move container to workspace $ws12, workspace $ws12 - - $flag+Control+j focus output 'eDP-1' - $flag+Control+h workspace prev_on_output - $flag+Control+l workspace next_on_output - $flag+Control+k focus output 'HDMI-A-1' - - $flag+Control+Down focus output 'eDP-1' - $flag+Control+Left workspace prev_on_output - $flag+Control+Right workspace next_on_output - $flag+Control+Up focus output 'HDMI-A-1' - - $flag+Control+Shift+j \ - move container to output 'eDP-1', focus output 'eDP-1' - $flag+Control+Shift+h \ - move container to workspace prev_on_output, workspace prev_on_output - $flag+Control+Shift+l \ - move container to workspace next_on_output, workspace next_on_output - $flag+Control+Shift+k \ - move container to output 'HDMI-A-1', focus output 'HDMI-A-1' - - $flag+Control+Shift+Down \ - move container to output 'eDP-1', focus output 'eDP-1' - $flag+Control+Shift+Left \ - move container to workspace prev_on_output, workspace prev_on_output - $flag+Control+Shift+Right \ - move container to workspace next_on_output, workspace next_on_output - $flag+Control+Shift+Up \ - move container to output 'HDMI-A-1', focus output 'HDMI-A-1' -} - -# System -bindsym --locked { -# Brightness - XF86MonBrightnessDown exec brightnessctl -e s 5%- && $notify -b - XF86MonBrightnessUp exec brightnessctl -e s +5% && $notify -b - -# Volume control (Pulsemixer is slow!) - XF86AudioRaiseVolume exec pamixer -i 2 --set-limit 100 && $notify -v - XF86AudioLowerVolume exec pamixer -d 2 && $notify -v - XF86AudioMute exec pamixer -t && $notify -v - XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle - -# Media control - F7 exec playerctl play-pause - Shift+XF86AudioLowerVolume exec playerctl previous - Shift+XF86AudioRaiseVolume exec playerctl next -} - -# Special commands -set $fzf ~/.scripts/fzf-jump -bindsym { - # Reload sway - $alt+Shift+r reload - # Dialog to exit sway - $alt+Shift+e exec swaynag -t warning -m 'Do you really want to exit sway?' \ - -B 'Yes, exit sway' 'swaymsg exit' - - $flag+q kill # Kill focused window - $flag+Return exec $term -e bash -c "zellij attach || zellij" # Start a terminal - $flag+Delete exec swaylock # Lockscreen - - # Start application launcher - $alt+space exec $term --title 'FZF-Jump' -e $fzf/launcher.sh - # Window switcher - $alt+Tab exec $term --title 'FZF-Jump' -e $fzf/standalone.sh $fzf/modules/windows.sh $fzf/modules/workspaces.sh - - # File explorer - $flag+e exec $term -e vifm - # Internet explorer - $flag+i exec firefox -} diff --git a/arch/stow/sway/.config/sway/config b/arch/stow/sway/.config/sway/config deleted file mode 100644 index 14915b2..0000000 --- a/arch/stow/sway/.config/sway/config +++ /dev/null @@ -1,54 +0,0 @@ -# -# .config/sway/config -# Personal config for sway -# Requires noto-fonts-cjk -# - -# Import other config files -include { - commands - modes - style -} - -input type:touchpad { - natural_scroll enabled - scroll_factor 0.6 - middle_emulation enabled - tap enabled -} - -seat seat0 hide_cursor when-typing enable - -# Output -output * { - bg "~/Pictures/wallpapers/bg.*" fill -} - -output 'Dell Inc. DELL P2214H 29C2937M4YTL' { - # Vertical monitor - transform 270 -} - -output 'Samsung Electric Company SAMSUNG 0x00000001' { - # Zoom in because long distance - scale 2 -} - -# Focus -focus_follows_mouse no -floating_modifier Mod4 normal - -# Window rules -for_window [window_role="pop-up"] floating enable -for_window [window_role="task_dialog"] floating enable -for_window [window_role="splash"] floating enable - -for_window [class="Qalculate"] floating enable -for_window [class="Caprine"] floating enable, border normal 2 -for_window [title="^FZF-Jump$"] floating enable, border pixel 0, resize set 600 350 - -for_window [class="^Betterbird$"] move container to workspace "11:Soc" - -exec "~/.config/sway/autostart.sh" - diff --git a/arch/stow/sway/.config/sway/modes b/arch/stow/sway/.config/sway/modes deleted file mode 100644 index 237932b..0000000 --- a/arch/stow/sway/.config/sway/modes +++ /dev/null @@ -1,93 +0,0 @@ -# -# ~/.config/sway/modes -# Modes for sway -# - -set { - $alt Mod1 - $flag Mod4 -} - -# Resizing -bindsym $flag+r mode "resize" -mode "resize" bindsym { - l resize grow width 10 px or 10 ppt - k resize grow height 10 px or 10 ppt - h resize shrink width 10 px or 10 ppt - j resize shrink height 10 px or 10 ppt - - Shift+l resize grow width 50 px or 50 ppt - Shift+k resize grow height 50 px or 50 ppt - Shift+h resize shrink width 50 px or 50 ppt - Shift+j resize shrink height 50 px or 50 ppt - - Right resize grow width 10 px or 10 ppt - Up resize grow height 10 px or 10 ppt - Left resize shrink width 10 px or 10 ppt - Down resize shrink height 10 px or 10 ppt - - Shift+Right resize grow width 50 px or 50 ppt - Shift+Up resize grow height 50 px or 50 ppt - Shift+Left resize shrink width 50 px or 50 ppt - Shift+Down resize shrink height 50 px or 50 ppt - - $flag+h move left - $flag+j move down - $flag+k move up - $flag+l move right - - $flag+Left move left - $flag+Down move down - $flag+Up move up - $flag+Right move right - - Return mode "default" - Escape mode "default" - $flag+r mode "default" -} - -# System actions -set $mode_system System (l)ock, (s)leep, (h)ibernate, (r)eboot, (Shift+s)hutdown -bindsym Control+$alt+Delete mode "$mode_system" -mode "$mode_system" bindsym { - l exec swaylock, mode "default" - s exec systemctl suspend, mode "default" - h exec systemctl hibernate, mode "default" - r exec systemctl reboot, mode "default" - Shift+s exec systemctl poweroff -i, mode "default" - - Return mode "default" - Escape mode "default" - Control+$alt+Delete mode "default" -} - -# Screenshots -set $mode_screenshot Screenshot of (a)rea, current (w)indow, (s)creen - Shift to save -set $save_format ~/Pictures/Screenshots/$(date +%F-%H-%M-%S).png -bindsym Print mode "$mode_screenshot" -mode "$mode_screenshot" bindsym { - a exec grimshot copy area, mode "default" - w exec grimshot --notify copy active, mode "default" - s exec grimshot --notify copy screen, mode "default" - - Print exec grimshot --notify save screen $save_format mode "default" # Super fast screens! - Shift+a exec grimshot --notify save area $save_format, mode "default" - Shift+w exec grimshot --notify save active $save_format, mode "default" - Shift+s exec grimshot --notify save screen $save_format, mode "default" - - Return mode "default" - Escape mode "default" -} - -# Some preferences -set $mode_preferences Toggle (s)unset, (n)otifications, (f)ocus -bindsym $alt+end mode "$mode_preferences" -mode "$mode_preferences" bindsym { - s exec "~/.scripts/wlsunset.sh", mode "default" - n exec "~/.scripts/dnd.sh", mode "default" - f exec "~/.scripts/focus.sh", mode "default" - - Return mode "default" - Escape mode "default" - $alt+end mode "default" -} diff --git a/arch/stow/sway/.config/sway/style b/arch/stow/sway/.config/sway/style deleted file mode 100644 index d1668ac..0000000 --- a/arch/stow/sway/.config/sway/style +++ /dev/null @@ -1,27 +0,0 @@ -# -# ~/.config/sway/style -# Styling for sway -# - -# Decrease the height of the window bar thing. -font pango:monospace 1 - -bar { - swaybar_command /usr/bin/waybar - mode hide -} - -default_border pixel 1 -default_floating_border normal 1 -hide_edge_borders both -smart_borders on - -# Mimic no titles -# border backgr. text indic. child_border -client.focused #000000 #00897b #00897b #00897b #000000 -client.focused_inactive #000000 #222222 #222222 #222222 #000000 -client.unfocused #000000 #222222 #222222 #222222 #000000 -client.urgent #ff0000 #ff0000 #ff0000 #ff0000 #ff0000 - -exec gsettings set org.gnome.desktop.interface icon-theme 'IcoSystem' -exec gsettings set org.gnome.desktop.interface gtk-theme 'Nordic' diff --git a/nixos/modules-old/des/sway/default.nix b/nixos/modules-old/des/sway/default.nix deleted file mode 100644 index c485a60..0000000 --- a/nixos/modules-old/des/sway/default.nix +++ /dev/null @@ -1,110 +0,0 @@ -{ config, pkgs, lib, ... }: - -let - # bash script to let dbus know about important env variables and - # propagate them to relevent services run at the end of sway config - # see - # https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist - # note: this is pretty much the same as /etc/sway/config.d/nixos.conf but also restarts - # some user services to make sure they have the correct environment variables - dbus-sway-environment = pkgs.writeTextFile { - name = "dbus-sway-environment"; - destination = "/bin/dbus-sway-environment"; - executable = true; - - text = '' - dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway - systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr - systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr - ''; - }; - - # currently, there is some friction between sway and gtk: - # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland - # the suggested way to set gtk settings is with gsettings - # for gsettings to work, we need to tell it where the schemas are - # using the XDG_DATA_DIR environment variable - # run at the end of sway config - configure-gtk = pkgs.writeTextFile { - name = "configure-gtk"; - destination = "/bin/configure-gtk"; - executable = true; - text = let - schema = pkgs.gsettings-desktop-schemas; - datadir = "${schema}/share/gsettings-schemas/${schema.name}"; - in '' - export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS - gnome_schema=org.gnome.desktop.interface - gsettings set $gnome_schema gtk-theme 'Dracula' - ''; - }; -in -{ - services.xserver = { - enable = true; - - displayManager.lightdm.enable = true; - - excludePackages = with pkgs; [ - xterm - ]; - }; - - security.polkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - pulse.enable = true; - }; - - services.dbus.enable = true; - xdg.portal = { - enable = true; - wlr.enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - }; - - programs.sway = { - enable = true; - wrapperFeatures.gtk = true; - }; - - home-manager.users.tdpeuter = { pkgs, ... }: { - home = { - username = "tdpeuter"; - homeDirectory = "/home/tdpeuter"; - - file = { - ".config/sway".source = ../../../../stow/sway/.config/sway; - ".config/waybar".source = ../../../../stow/waybar/.config/waybar; - ".config/dunst".source = ../../../../stow/dunst/.config/dunst; - # TODO Fix scripts, I don't like it this way - ".scripts".source = ../../../../stow/_scripts/.scripts; - }; - - packages = with pkgs; [ - brightnessctl - dunst - font-awesome - pamixer - pavucontrol - playerctl - swayidle - swaylock-effects - waybar - wmname - ]; -# }; -# -# wayland.windowManager.sway = { -# enable = true; -# package = pkgs.sway-unwrapped; -# config = rec { -# terminal = "alacritty"; -# startup = [ -# {command = "alacritty";} -# ]; -# }; - }; - }; -} diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 7227806..4a466b2 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -3,6 +3,7 @@ ./desktop ./hardware ./networking + ./nix ./programs ./services ./virtualisation diff --git a/nixos/modules/desktop/default.nix b/nixos/modules/desktop/default.nix index 7c1002b..f67e134 100644 --- a/nixos/modules/desktop/default.nix +++ b/nixos/modules/desktop/default.nix @@ -1,5 +1,7 @@ { imports = [ ./gnome + ./plasma + ./sway ]; } diff --git a/nixos/modules/desktop/sway/default.nix b/nixos/modules/desktop/sway/default.nix new file mode 100644 index 0000000..b5de914 --- /dev/null +++ b/nixos/modules/desktop/sway/default.nix @@ -0,0 +1,128 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.desktop.sway; + + # bash script to let dbus know about important env variables and + # propagate them to relevent services run at the end of sway config + # see + # https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist + # note: this is pretty much the same as /etc/sway/config.d/nixos.conf but also restarts + # some user services to make sure they have the correct environment variables + dbus-sway-environment = pkgs.writeTextFile { + name = "dbus-sway-environment"; + destination = "/bin/dbus-sway-environment"; + executable = true; + + text = '' + dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway + systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr + systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr + ''; + }; + + # currently, there is some friction between sway and gtk: + # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland + # the suggested way to set gtk settings is with gsettings + # for gsettings to work, we need to tell it where the schemas are + # using the XDG_DATA_DIR environment variable + # run at the end of sway config + configure-gtk = pkgs.writeTextFile { + name = "configure-gtk"; + destination = "/bin/configure-gtk"; + executable = true; + text = let + schema = pkgs.gsettings-desktop-schemas; + datadir = "${schema}/share/gsettings-schemas/${schema.name}"; + in '' + export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS + gnome_schema=org.gnome.desktop.interface + # gsettings set $gnome_schema gtk-theme 'Dracula' + ''; + }; +in { + options.sisyphus.desktop.sway.enable = lib.mkEnableOption "Sway"; + + config = lib.mkIf cfg.enable { + environment.systemPackages = (with pkgs; [ + dbus-sway-environment + configure-gtk + wayland + xdg-utils # Open with default program + glib # gsettings + wl-clipboard + wdisplays # Tool to configure displays + + brightnessctl + dunst + libnotify + playerctl + swaybg + swaylock-effects + waybar + wlsunset + + # TODO Turn into own module/package? + jq + j4-dmenu-desktop + rofi + ]) ++ (with pkgs.sway-contrib; [ + grimshot + ]); + + environment.sessionVariables = { + SCRIPT_DIR = ../../../../scripts; + }; + + fonts.fonts = with pkgs; [ + dejavu_fonts + font-awesome + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + source-han-sans + source-han-sans-japanese + source-han-serif-japanese + ]; + + security.polkit.enable = true; + + services = { + atd.enable = true; # Required by sunset.sh + dbus.enable = true; + gnome.gnome-keyring.enable = true; + + pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + + power-profiles-daemon.enable = true; + + xserver.displayManager.session = [{ + manage = "window"; + name = "Sway"; + start = '' + ${pkgs.sway}/bin/sway --unsupported-gpu & + waitPID=$! + ''; + }]; + }; + + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + }; + + sisyphus.users.wantedGroups = [ + config.users.groups.video.name # Brightnessctl + ]; + }; +} diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index db2e261..d8dc3e4 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -45,7 +45,7 @@ in { ]; sisyphus = { - desktop.gnome.enable = true; + desktop.sway.enable = true; programs.spotify-adblock.enable = true; }; diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index 0603830..b526564 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -44,6 +44,18 @@ in { source = ../../../stow/openrgb/.config/OpenRGB; recursive = true; }; + ".config/sway" = { + enable = config.sisyphus.desktop.sway.enable; + source = ../../../stow/sway/.config/sway; + }; + ".config/swayidle" = { + enable = (builtins.elem pkgs.swayidle installedPkgs); + source = ../../../stow/swayidle/.config/swayidle; + }; + ".config/swaylock" = { + enable = config.sisyphus.desktop.sway.enable; + source = ../../../stow/swaylock/.config/swaylock; + }; ".config/vifm" = { enable = (builtins.elem pkgs.vifm installedPkgs); source = ../../../stow/vifm/.config/vifm; diff --git a/stow/sway/.config/sway/config b/stow/sway/.config/sway/config new file mode 100644 index 0000000..55ef837 --- /dev/null +++ b/stow/sway/.config/sway/config @@ -0,0 +1,61 @@ +# +# ~/.config/sway/config +# + +# Variables +set { + $alt Mod1 + $flag Mod4 + + $left h + $down j + $up k + $right l + + $scrollUp button4 + $scrollDown button5 + + $term kitty || alacritty || foot + $menu j4-dmenu-desktop --dmenu "rofi -dmenu -i" + $window_switcher /home/tdpeuter/projects/fzf-jump/new.sh + $lock swaylock -f +} + +include { + input-output + keybinds + modes + style +} + +# Focus +focus_follows_mouse no +floating_modifier $flag normal + +# Window rules +for_window { + [window_role="About"] floating enable + [window_role="bubble"] floating enable + [window_role="Organizer"] floating enable + [window_role="page-info"] floating enable + [window_role="pop-up"] floating enable + [window_role="Preferences"] floating enable + [window_role="splash"] floating enable + [window_role="task_dialog"] floating enable + [window_role="task_dialog"] floating enable + [window_role="toolbox"] floating enable + [window_role="webconsole"] floating enable + [window_type="dialog"] floating enable + [window_type="menu"] floating enable +} + +exec dbus-sway-environment +exec configure-gtk +exec dbus-update-activation-environment --systemd DISPLAY XAUTHORITY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway + +exec wlsunset -l 50.50 -L 4.00 -t 3000 -T 6500 +exec gnome-keyring-daemon --start --components=secrets # Secrets +exec dunst --verbosity crit # Notification manager +exec swayidle -w + +exec nextcloud --background diff --git a/stow/sway/.config/sway/input-output b/stow/sway/.config/sway/input-output new file mode 100644 index 0000000..b7df7fc --- /dev/null +++ b/stow/sway/.config/sway/input-output @@ -0,0 +1,11 @@ +input type:touchpad { + natural_scroll enabled + scroll_factor 0.8 + middle_emulation enabled + tap enabled +} + +output * { + bg "~/Nextcloud/Afbeeldingen/wallpapers/bg" fill +} + diff --git a/stow/sway/.config/sway/keybinds b/stow/sway/.config/sway/keybinds new file mode 100644 index 0000000..1a81a76 --- /dev/null +++ b/stow/sway/.config/sway/keybinds @@ -0,0 +1,195 @@ +set $notify ~/projects/sisyphus/scripts/notify.sh + +# Focus +bindsym { + $flag+$up focus up + $flag+$right focus right + $flag+$down focus down + $flag+$left focus left + + $flag+Up focus up + $flag+Right focus right + $flag+Down focus down + $flag+Left focus left + + $flag+p focus parent + $flag+space focus mode_toggle +} + +# Move windows +bindsym { + $flag+Shift+$up move up + $flag+Shift+$right move right + $flag+Shift+$down move down + $flag+Shift+$left move left + + $flag+Shift+Up move up + $flag+Shift+Right move right + $flag+Shift+Down move down + $flag+Shift+Left move left + + $flag+Next move scratchpad + $flag+KP_Next move scratchpad + $flag+Prior scratchpad show + $flag+KP_Prior scratchpad show +} + +# Layouts +bindsym { + $flag+z layout toggle split + $flag+x layout tabbed + $flag+c split h + $flag+v split v + + $flag+f floating enable, border normal 1 + $flag+Shift+f floating disable, border pixel 1 + + $flag+s sticky toggle + $flag+F11 fullscreen + + $alt+Next border pixel 1 # Show window title + $alt+KP_Next border pixel 1 + $alt+Prior border normal 1 # Hide window title + $alt+KP_Prior border normal 1 +} + +# Workspaces +set { + $ws1 "1:1" + $ws2 "2:2" + $ws3 "3:3" + $ws4 "4:4" + $ws5 "5:5" + $ws6 "6:6" + $ws7 "7:7" + $ws8 "8:8" + $ws9 "9:9" + $ws10 "10:10" + $ws11 "11:Soc" + $ws12 "12:Ent" +} + +bindsym { + $flag+1 workspace $ws1 + $flag+2 workspace $ws2 + $flag+3 workspace $ws3 + $flag+4 workspace $ws4 + $flag+5 workspace $ws5 + $flag+6 workspace $ws6 + $flag+7 workspace $ws7 + $flag+8 workspace $ws8 + $flag+9 workspace $ws9 + $flag+0 workspace $ws10 + $flag+minus workspace $ws11 + $flag+equal workspace $ws12 + + $flag+Shift+1 move container to workspace $ws1, workspace $ws1 + $flag+Shift+2 move container to workspace $ws2, workspace $ws2 + $flag+Shift+3 move container to workspace $ws3, workspace $ws3 + $flag+Shift+4 move container to workspace $ws4, workspace $ws4 + $flag+Shift+5 move container to workspace $ws5, workspace $ws5 + $flag+Shift+6 move container to workspace $ws6, workspace $ws6 + $flag+Shift+7 move container to workspace $ws7, workspace $ws7 + $flag+Shift+8 move container to workspace $ws8, workspace $ws8 + $flag+Shift+9 move container to workspace $ws9, workspace $ws9 + $flag+Shift+0 move container to workspace $ws10, workspace $ws10 + $flag+Shift+minus move container to workspace $ws11, workspace $ws11 + $flag+Shift+equal move container to workspace $ws12, workspace $ws12 + + $flag+Control+$left workspace prev_on_output + $flag+Control+$right workspace next_on_output + + $flag+Control+Left workspace prev_on_output + $flag+Control+Right workspace next_on_output + + --whole-window $flag+$scrollUp workspace prev_on_output + --whole-window $flag+$scrollDown workspace next_on_output + + $flag+Control+Shift+$left move container to workspace prev_on_output, workspace prev_on_output + $flag+Control+Shift+$right move container to workspace next_on_output, workspace next_on_output + + $flag+Control+Shift+Left move container to workspace prev_on_output, workspace prev_on_output + $flag+Control+Shift+Right move container to workspace next_on_output, workspace next_on_output +} + +bindgesture { + swipe:3:right workspace prev_on_output + swipe:3:left workspace next_on_output +} + +# Outputs +bindsym { + $flag+Control+$up focus output up + $flag+Control+$down focus output down + + $flag+Control+Up focus output up + $flag+Control+Down focus output down + + $flag+Control+Shift+$up move container to output up, focus output up + $flag+Control+Shift+$down move container to output down, focus output down + + $flag+Control+Shift+Up move container to output up, focus output up + $flag+Control+Shift+Down move container to output down, focus output down +} + +# System +bindsym --locked { + # Brightness + XF86MonBrightnessDown exec brightnessctl -e s 5%- && $notify -b + XF86MonBrightnessUp exec brightnessctl -e s +5% && $notify -b + + # Audio + XF86AudioRaiseVolume exec wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 2%+ && $notify -v + XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- && $notify -v + XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && $notify -v + XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle + + # Media + XF86AudioPlay exec playerctl play-pause + XF86AudioPrev exec playerctl previous + XF86AudioNext exec playerctl next + + Shift+XF86AudioMute exec playerctl play-pause + Shift+XF86AudioLowerVolume exec playerctl previous + Shift+XF86AudioRaiseVolume exec playerctl next + + # Other special keys + XF86Calculator exec qalculate-gtk +} + +bindgesture hold:3 exec playerctl play-pause + + +# Shortcuts +bindsym { + # Reload sway + $alt+Shift+r reload + # Dialog to exit sway + $alt+Shift+e exec swaynag -t warning \ + -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' \ + -B 'Yes, exit sway' 'swaymsg exit' + + # Kill focused window + $flag+q kill + # Start a terminal + $flag+Return exec $term + $alt+space exec $menu + $alt+Tab focus prev + $flag+Tab exec $window_switcher + + # Lock the screen + $flag+Delete exec $lock + + # File explorer + $flag+e exec $term -e vifm + # Internet browser + $flag+i exec firefox +} + +bindgesture { + swipe:3:up exec $window_switcher + swipe:4:up exec $menu + + # Cancel + swipe:down exec pkill rofi +} diff --git a/stow/sway/.config/sway/modes b/stow/sway/.config/sway/modes new file mode 100644 index 0000000..545d1a4 --- /dev/null +++ b/stow/sway/.config/sway/modes @@ -0,0 +1,88 @@ +# +# ~/.config/sway/modes +# + +set $default "default" + +# Resizing +set $resize "Resize" +bindsym $flag+r mode $resize +mode $resize bindsym { + $right resize grow width 10 px or 10 ppt + $up resize grow height 10 px or 10 ppt + $left resize shrink width 10 px or 10 ppt + $down resize shrink height 10 px or 10 ppt + + Right resize grow width 10 px or 10 ppt + Up resize grow height 10 px or 10 ppt + Left resize shrink width 10 px or 10 ppt + Down resize shrink height 10 px or 10 ppt + + Shift+$right resize grow width 50 px or 50 ppt + Shift+$up resize grow height 50 px or 50 ppt + Shift+$left resize shrink width 50 px or 50 ppt + Shift+$down resize shrink height 50 px or 50 ppt + + Shift+Right resize grow width 50 px or 50 ppt + Shift+Up resize grow height 50 px or 50 ppt + Shift+Left resize shrink width 50 px or 50 ppt + Shift+Down resize shrink height 50 px or 50 ppt + + $flag+$right move right + $flag+$up move up + $flag+$left move left + $flag+$down move down + + $flag+Right move right + $flag+Up move up + $flag+Left move left + $flag+Down move down + + Return mode $default + Escape mode $default + $flag+r mode $default +} + +# System actions +set $mode_system "System (l)ock, (s)leep, (h)ibernate, (r)eboot, (Shift+s)hutdown" +bindsym Control+$alt+Delete mode $mode_system +mode $mode_system bindsym { + l mode $default, exec $lock + s mode $default, exec $lock, exec systemctl suspend + h mode $default, exec $lock, exec systemctl hibernate + r mode $default, exec systemctl reboot + Shift+s mode $default, exec systemctl poweroff -i + + Return mode $default + Escape mode $default + Control+$alt+Delete mode $default +} + +# Screenshots +set $mode_screenshot "Screenshot of (a)rea, current (w)indow, (s)creen - Shift to save" +set $save_format ~/Nextcloud/Afbeeldingen/Screenshots/$(date +%F-%H-%M-%S).png +bindsym Print mode $mode_screenshot +mode $mode_screenshot bindsym { + a exec grimshot copy area, mode $default + w exec grimshot --notify copy active, mode $default + s exec grimshot --notify copy screen, mode $default + + Shift+a exec grimshot --notify save area $save_format, mode $default + Shift+w exec grimshot --notify save active $save_format, mode $default + Shift+s exec grimshot --notify save screen $save_format, mode $default + Print exec grimshot --notify save screen $save_format, mode $default + + Return mode $default + Escape mode $default +} + +set $mode_preferences "Toggle (d)ark mode, (s)unset, (n)otification" +bindsym $alt+end mode $mode_preferences { + d exec "${SCRIPT_DIR}/toggle-light-dark.sh", mode $default + s exec "${SCRIPT_DIR}/sunset.sh", mode $default + n exec "${SCRIPT_DIR}/do-not-disturb.sh", mode $default + + Return mode $default + Escape mode $default + $alt+end mode $default +} diff --git a/stow/sway/.config/sway/style b/stow/sway/.config/sway/style new file mode 100644 index 0000000..7377b3b --- /dev/null +++ b/stow/sway/.config/sway/style @@ -0,0 +1,31 @@ +# +# ~/.config/sway/style +# Styling for sway +# + +# Decrease the height of the window title bar. +font pango:monospace 0.1 + +bar { + swaybar_command waybar + mode hide +} + +default_border pixel 1 +default_floating_border normal 1 +hide_edge_borders smart +smart_borders on + +# Mimic no titles by setting the text color to background color +# border backgr. text indic. child_border +client.focused #00897b #00897b #00897b #00897b #00897b +client.focused_inactive #a6a6a6 #a6a6a6 #a6a6a6 #a6a6a6 #a6a6a6 +client.unfocused #a6a6a6 #a6a6a6 #a6a6a6 #a6a6a6 #a6a6a6 +client.urgent #ff0000 #ff0000 #ff0000 #ff0000 #ff0000 + +# Configure GTK +exec gsettings set org.gnome.desktop.interface icon-theme 'IcoSystem' +exec gsettings set org.gnome.desktop.interface cursor-theme 'phinger-cursor' +exec gsettings set org.gnome.desktop.interface gtk-theme 'Nordic' + +seat seat0 xcursor_theme phinger-cursors 24 From 21abf1deed8d0221a22510b59547752226f207fc Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Tue, 14 Nov 2023 22:37:49 +0100 Subject: [PATCH 121/176] [swayidle] Tweak parameters --- stow/swayidle/.config/swayidle/config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stow/swayidle/.config/swayidle/config b/stow/swayidle/.config/swayidle/config index 973d62b..d676df0 100644 --- a/stow/swayidle/.config/swayidle/config +++ b/stow/swayidle/.config/swayidle/config @@ -1,6 +1,6 @@ -timeout 60 'brightnessctl -sq set $(( $(brightnessctl get) / 10 * 3 ))' resume 'brightnessctl -qr' -timeout 120 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' +timeout 60 'brightnessctl -sq set $(( $(brightnessctl get) / 10 * 3 + 1 ))' resume 'brightnessctl -qr' +timeout 120 'swaylock -f; swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' timeout 240 'systemctl suspend' before-sleep 'playerctl pause' -before-sleep 'swaymsg "output * dpms on"; swaylock --grace 0' # Avoid being able to unlock immediately without password +before-sleep 'swaymsg "output * dpms on"; swaylock -f --grace 0' # Avoid being able to unlock immediately without password From 2d4ebe3370a62cc44282dcb8a3b8d454bb257072 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Tue, 14 Nov 2023 22:38:08 +0100 Subject: [PATCH 122/176] Update --- nixos/flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index a52b3cd..36ddf9c 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1695108154, - "narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=", + "lastModified": 1699748081, + "narHash": "sha256-MOmMapBydd7MTjhX4eeQZzKlCABWw8W6iSHSG4OeFKE=", "owner": "nix-community", "repo": "home-manager", - "rev": "07682fff75d41f18327a871088d20af2710d4744", + "rev": "04bac349d585c9df38d78e0285b780a140dc74a4", "type": "github" }, "original": { @@ -62,11 +62,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1698846319, - "narHash": "sha256-4jyW/dqFBVpWFnhl0nvP6EN4lP7/ZqPxYRjl6var0Oc=", + "lastModified": 1699596684, + "narHash": "sha256-XSXP8zjBZJBVvpNb2WmY0eW8O2ce+sVyj1T0/iBRIvg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "34bdaaf1f0b7fb6d9091472edc968ff10a8c2857", + "rev": "da4024d0ead5d7820f6bd15147d3fe2a0c0cec73", "type": "github" }, "original": { @@ -77,11 +77,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1698544399, - "narHash": "sha256-vhRmPyEyoPkrXF2iykBsWHA05MIaOSmMRLMF7Hul6+s=", + "lastModified": 1699756042, + "narHash": "sha256-bHHjQQBsEPOxLL+klYU2lYshDnnWY12SewzQ7n5ab2M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d87c5d8c41c9b3b39592563242f3a448b5cc4bc9", + "rev": "9502d0245983bb233da8083b55d60d96fd3c29ff", "type": "github" }, "original": { @@ -93,11 +93,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1698611440, - "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", + "lastModified": 1699781429, + "narHash": "sha256-UYefjidASiLORAjIvVsUHG6WBtRhM67kTjEY4XfZOFs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", + "rev": "e44462d6021bfe23dfb24b775cc7c390844f773d", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1698929376, - "narHash": "sha256-TmROaV9W6HArdTUgxLN334Kw+CradxWHw1HYM/3H6xI=", + "lastModified": 1699951338, + "narHash": "sha256-1GeczM7XfgHcYGYiYNcdwSFu3E62vmh4d7mffWZvyzE=", "owner": "Mic92", "repo": "sops-nix", - "rev": "84d6b27dc71ac02422e192c35806d06915d2bf67", + "rev": "0e3a94167dcd10a47b89141f35b2ff9e04b34c46", "type": "github" }, "original": { From 39992187a64469023cf2b2ac4aced5ac2bfd0ec2 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Tue, 14 Nov 2023 22:38:42 +0100 Subject: [PATCH 123/176] Tweaks and leftover bits --- nixos/overlays/default.nix | 12 ++++++++++++ nixos/users/tdpeuter/default.nix | 9 ++++++--- nixos/users/tdpeuter/dotfiles.nix | 2 +- stow/vifm/.config/vifm/vifmrc | 3 ++- 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 nixos/overlays/default.nix diff --git a/nixos/overlays/default.nix b/nixos/overlays/default.nix new file mode 100644 index 0000000..545008f --- /dev/null +++ b/nixos/overlays/default.nix @@ -0,0 +1,12 @@ +# The following is taken from: https://nixos-and-flakes.thiscute.world/nixpkgs/overlays + +# import all nix files in the current folder, and execute them with args as parameters +# The return value is a list of all execution results, which is the list of overlays + +args: +# execute and import all overlay files in the current directory with the given args +builtins.map + (f: (import (./. + "/${f}") args)) # execute and import the overlay file + (builtins.filter # find all overlay files in the current directory + (f: f != "default.nix") + (builtins.attrNames (builtins.readDir ./.))) diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index d8dc3e4..1900b2d 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -25,7 +25,8 @@ in { users.users.tdpeuter = { description = "Tibo De Peuter"; isNormalUser = true; - extraGroups = [ + extraGroups = config.sisyphus.users.wantedGroups ++ [ + config.users.groups.input.name config.users.groups.keys.name config.users.groups.networkmanager.name config.users.groups.wheel.name @@ -36,8 +37,7 @@ in { fonts.fonts = with pkgs; [ corefonts # Calibri for Uni - font-awesome_5 # Dependency of Vifm config - font-awesome # Dependency of zsh + font-awesome # Dependency of Vifm & zsh config letter # Personal font noto-fonts-cjk # Dependency of Zellij config noto-fonts # Dependency of Zellij config @@ -83,6 +83,9 @@ in { zsh zsh-autosuggestions zsh-syntax-highlighting + + # SMB + cifs-utils psmisc ]) ++ (with pkgs-unstable; [ mpv obsidian diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index b526564..fa81113 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -70,7 +70,7 @@ in { source = ../../../stow/zellij/.config/zellij; }; ".oh-my-zsh" = { - enable = (builtins.elem pkgs.zsh installedPkgs); + enable = true; source = "${pkgs.oh-my-zsh}/share/oh-my-zsh"; recursive = true; }; diff --git a/stow/vifm/.config/vifm/vifmrc b/stow/vifm/.config/vifm/vifmrc index a965df1..f280482 100644 --- a/stow/vifm/.config/vifm/vifmrc +++ b/stow/vifm/.config/vifm/vifmrc @@ -257,7 +257,8 @@ filextype {*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm},<image/*> \ shotwell, \ gwenview &, fileviewer {*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm},<image/*> - \ chafa, + \ kitten icat %f, + \ chafa %f, \ identify %f, " OpenRaster From d9188bfd13fb2d2f0647f6a83658e5943cffc1b6 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Wed, 22 Nov 2023 18:31:56 +0100 Subject: [PATCH 124/176] Fix direnv --- nixos/modules/programs/direnv/default.nix | 6 +++--- stow/sway/.config/sway/modes | 17 ++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/nixos/modules/programs/direnv/default.nix b/nixos/modules/programs/direnv/default.nix index 7ecf1b7..cf91026 100644 --- a/nixos/modules/programs/direnv/default.nix +++ b/nixos/modules/programs/direnv/default.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: let - cfg = sisyphus.programs.direnv; + cfg = config.sisyphus.programs.direnv; in { options.sisyphus.programs.direnv.enable = lib.mkEnableOption "direnv"; @@ -14,9 +14,9 @@ in { # This is also done by setting programs.direnv.persistDerivations. # Keep derivations so shells don't break. - nix.extraOption = '' + nix.extraOptions = '' keep-outputs = true keep-derivations = true ''; }; -}; +} diff --git a/stow/sway/.config/sway/modes b/stow/sway/.config/sway/modes index 545d1a4..6a80baa 100644 --- a/stow/sway/.config/sway/modes +++ b/stow/sway/.config/sway/modes @@ -77,12 +77,15 @@ mode $mode_screenshot bindsym { } set $mode_preferences "Toggle (d)ark mode, (s)unset, (n)otification" -bindsym $alt+end mode $mode_preferences { - d exec "${SCRIPT_DIR}/toggle-light-dark.sh", mode $default - s exec "${SCRIPT_DIR}/sunset.sh", mode $default - n exec "${SCRIPT_DIR}/do-not-disturb.sh", mode $default +bindsym $alt+end mode $mode_preferences +bindsym $alt+KP_End mode $mode_preferences +mode $mode_preferences bindsym { + d exec "${SCRIPT_DIR}/toggle-light-dark.sh", mode $default + s exec "${SCRIPT_DIR}/sunset.sh", mode $default + n exec "${SCRIPT_DIR}/do-not-disturb.sh", mode $default - Return mode $default - Escape mode $default - $alt+end mode $default + Return mode $default + Escape mode $default + $alt+end mode $default + $alt+KP_End mode $default } From 414bb4b983ae1fb53254e65690bb9c9e3f1ea213 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Fri, 24 Nov 2023 19:08:42 +0100 Subject: [PATCH 125/176] [qemu][docker] Add modules and use on laptop --- nixos/hosts/Tibo-NixFat/default.nix | 6 +++++- nixos/modules/virtualisation/default.nix | 2 ++ nixos/modules/virtualisation/docker/default.nix | 11 +++++++++++ nixos/modules/virtualisation/qemu/default.nix | 15 +++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 nixos/modules/virtualisation/docker/default.nix create mode 100644 nixos/modules/virtualisation/qemu/default.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index c00d9a1..b5783f7 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -32,7 +32,11 @@ users.tdpeuter.enable = true; - virtualisation.virtualbox.enable = true; + virtualisation = { + docker.enable = true; + qemu.enable = true; + virtualbox.enable = true; + }; }; boot = { diff --git a/nixos/modules/virtualisation/default.nix b/nixos/modules/virtualisation/default.nix index 01f37b3..5de3dce 100644 --- a/nixos/modules/virtualisation/default.nix +++ b/nixos/modules/virtualisation/default.nix @@ -1,5 +1,7 @@ { imports = [ + ./docker + ./qemu ./virtualbox ]; } diff --git a/nixos/modules/virtualisation/docker/default.nix b/nixos/modules/virtualisation/docker/default.nix new file mode 100644 index 0000000..7143d41 --- /dev/null +++ b/nixos/modules/virtualisation/docker/default.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.virtualisation.docker; +in { + options.sisyphus.virtualisation.docker.enable = lib.mkEnableOption "Docker"; + + config = lib.mkIf cfg.enable { + virtualisation.docker.enable = true; + }; +} diff --git a/nixos/modules/virtualisation/qemu/default.nix b/nixos/modules/virtualisation/qemu/default.nix new file mode 100644 index 0000000..220e027 --- /dev/null +++ b/nixos/modules/virtualisation/qemu/default.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.virtualisation.qemu; +in { + options.sisyphus.virtualisation.qemu.enable = lib.mkEnableOption "QEMU"; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + qemu + ]; + + virtualisation.libvirtd.qemu.runAsRoot = false; + }; +} From 356b1dd991abdc8ba6a8e1c2ff89c64a0abfbc0d Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Fri, 24 Nov 2023 19:15:25 +0100 Subject: [PATCH 126/176] [networkmanager] Improve boot times --- nixos/hosts/Tibo-NixFat/default.nix | 9 ++++----- nixos/modules/networking/default.nix | 1 + .../modules/networking/networkmanager/default.nix | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 nixos/modules/networking/networkmanager/default.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index b5783f7..11aa47e 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -11,7 +11,10 @@ model = "Quadro T2000"; }; - networking.openconnect-sso.enable = true; + networking = { + networkmanager.enable = true; + openconnect-sso.enable = true; + }; nix = { flakes.enable = true; @@ -102,10 +105,6 @@ # --- Barrier --- - networking = { - networkmanager.enable = true; - }; - i18n.defaultLocale = "en_GB.UTF-8"; console = { # font = "Lat2-Terminus16"; diff --git a/nixos/modules/networking/default.nix b/nixos/modules/networking/default.nix index d44dd42..5a46d2c 100644 --- a/nixos/modules/networking/default.nix +++ b/nixos/modules/networking/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./networkmanager ./openconnect-sso ]; } diff --git a/nixos/modules/networking/networkmanager/default.nix b/nixos/modules/networking/networkmanager/default.nix new file mode 100644 index 0000000..492e724 --- /dev/null +++ b/nixos/modules/networking/networkmanager/default.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.networking.networkmanager; +in { + options.sisyphus.networking.networkmanager.enable = lib.mkEnableOption "NetworkManager"; + + config = lib.mkIf cfg.enable { + networking.networkmanager.enable = true; + + # Prevent slow boot times + systemd.services.NetworkManager-wait-online.enable = false; + }; +} From 2b2a99aead245c307bcbd2447a0e241f618e9784 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Sat, 25 Nov 2023 10:37:54 +0100 Subject: [PATCH 127/176] Fix distorted background on different screens --- scripts/toggle-light-dark.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/toggle-light-dark.sh b/scripts/toggle-light-dark.sh index 890e29e..34be380 100755 --- a/scripts/toggle-light-dark.sh +++ b/scripts/toggle-light-dark.sh @@ -77,7 +77,7 @@ fi # Sway if [ "$(command -v swaybg)" ]; then - pkill swaybg && swaybg -i ~/Nextcloud/Afbeeldingen/wallpapers/${wallpaper[${theme}]} && swaymsg reload & + pkill swaybg && swaybg --mode fill --image ~/Nextcloud/Afbeeldingen/wallpapers/${wallpaper[${theme}]} && swaymsg reload & fi # Vifm From fe61e2c96d333002e7127bca78a9c525c64fa63d Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Sat, 25 Nov 2023 11:53:46 +0100 Subject: [PATCH 128/176] [firefox] Fix crashes --- nixos/users/tdpeuter/firefox.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/users/tdpeuter/firefox.nix b/nixos/users/tdpeuter/firefox.nix index 1a43fe6..ba1e9e2 100644 --- a/nixos/users/tdpeuter/firefox.nix +++ b/nixos/users/tdpeuter/firefox.nix @@ -7,11 +7,13 @@ in { config = lib.mkIf cfg.enable { home-manager.users.tdpeuter.programs.firefox = lib.mkIf config.sisyphus.programs.home-manager.enable { enable = true; - package = pkgs.firefox.override { + package = pkgs-unstable.firefox.override { cfg = { - enableTridactylNative = true; speechSynthesisSupport = true; # Allow Text-to-speech in e.g. Discord }; + nativeMessagingHosts = with pkgs; [ + tridactyl-native + ]; extraPolicies = { DisableFirefoxStudies = true; DisablePocket = true; From b6eb3492a863fcc0363a0f66e75b3253cbe49b30 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Sun, 26 Nov 2023 10:56:39 +0100 Subject: [PATCH 129/176] [zsh] Add non-zero exit code to prompt --- stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme b/stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme index 958c7fe..b3638be 100644 --- a/stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme +++ b/stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme @@ -35,7 +35,7 @@ add-zsh-hook precmd loadgit # Backup line(s) # PROMPT='%(!.%B%F{red}.%B%F{green}%n@)%m %F{blue}%(!.%1~.%~) ${vcs_info_msg_0_}%F{blue}%(!.#.$)%k%b%f ' # PROMPT='%(!.%B%F{red}.%B%F{green}%n@)%m %{$reset_color%}%F{cyan}%c %B${vcs_info_msg_0_}%F{green}%(!.#.$)%k%b%f ' -PROMPT='%(!.%B%F{red}%m .)%{$reset_color%}%F{cyan}%c %B${vcs_info_msg_0_}%F{green}%(!.#.$)%k%b%f ' +PROMPT='%(!.%B%F{red}%m .)%{$reset_color%}%F{cyan}%c %B${vcs_info_msg_0_}%(?.%F{green}%(!.#.$).%F{red}%?)%k%b%f ' # PROMPT='%{$fg_bold[green]%}[%n@%m%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%}$(git_prompt_info)%{$fg_bold[green]%}]%{$reset_color%}$ ' From 6264d45316ef28f774b4efe4fdc648f06bd0e49a Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Sun, 26 Nov 2023 14:13:47 +0100 Subject: [PATCH 130/176] [sway] Improve various things --- stow/sway/.config/sway/config | 9 ++-- stow/sway/.config/sway/keybinds | 93 ++++++++++++++++++++++++--------- 2 files changed, 74 insertions(+), 28 deletions(-) diff --git a/stow/sway/.config/sway/config b/stow/sway/.config/sway/config index 55ef837..77bfaa9 100644 --- a/stow/sway/.config/sway/config +++ b/stow/sway/.config/sway/config @@ -15,10 +15,11 @@ set { $scrollUp button4 $scrollDown button5 - $term kitty || alacritty || foot - $menu j4-dmenu-desktop --dmenu "rofi -dmenu -i" + $term kitty || alacritty || foot + $menu j4-dmenu-desktop --dmenu "rofi -dmenu -i" + # TODO Find better location and better way to reference this. $window_switcher /home/tdpeuter/projects/fzf-jump/new.sh - $lock swaylock -f + $lock swaylock -f } include { @@ -47,6 +48,8 @@ for_window { [window_role="webconsole"] floating enable [window_type="dialog"] floating enable [window_type="menu"] floating enable + + [app_id="qalculate-gtk"] floating enable, border pixel 1 } exec dbus-sway-environment diff --git a/stow/sway/.config/sway/keybinds b/stow/sway/.config/sway/keybinds index 1a81a76..7a75d3f 100644 --- a/stow/sway/.config/sway/keybinds +++ b/stow/sway/.config/sway/keybinds @@ -55,21 +55,22 @@ bindsym { # Workspaces set { - $ws1 "1:1" - $ws2 "2:2" - $ws3 "3:3" - $ws4 "4:4" - $ws5 "5:5" - $ws6 "6:6" - $ws7 "7:7" - $ws8 "8:8" - $ws9 "9:9" + $ws1 "1:1" + $ws2 "2:2" + $ws3 "3:3" + $ws4 "4:4" + $ws5 "5:5" + $ws6 "6:6" + $ws7 "7:7" + $ws8 "8:8" + $ws9 "9:9" $ws10 "10:10" $ws11 "11:Soc" $ws12 "12:Ent" } bindsym { + # Focus a specific workspace $flag+1 workspace $ws1 $flag+2 workspace $ws2 $flag+3 workspace $ws3 @@ -83,6 +84,7 @@ bindsym { $flag+minus workspace $ws11 $flag+equal workspace $ws12 + # Move window to a specific workspace $flag+Shift+1 move container to workspace $ws1, workspace $ws1 $flag+Shift+2 move container to workspace $ws2, workspace $ws2 $flag+Shift+3 move container to workspace $ws3, workspace $ws3 @@ -96,20 +98,35 @@ bindsym { $flag+Shift+minus move container to workspace $ws11, workspace $ws11 $flag+Shift+equal move container to workspace $ws12, workspace $ws12 + # Go through workspaces in order $flag+Control+$left workspace prev_on_output $flag+Control+$right workspace next_on_output $flag+Control+Left workspace prev_on_output $flag+Control+Right workspace next_on_output - --whole-window $flag+$scrollUp workspace prev_on_output - --whole-window $flag+$scrollDown workspace next_on_output - $flag+Control+Shift+$left move container to workspace prev_on_output, workspace prev_on_output $flag+Control+Shift+$right move container to workspace next_on_output, workspace next_on_output $flag+Control+Shift+Left move container to workspace prev_on_output, workspace prev_on_output $flag+Control+Shift+Right move container to workspace next_on_output, workspace next_on_output + + # Also GNOME-like keybinds + $flag+$alt+$left workspace prev_on_output + $flag+$alt+$right workspace next_on_output + + $flag+$alt+Left workspace prev_on_output + $flag+$alt+Right workspace next_on_output + + $flag+$alt+Shift+$left move container to workspace prev_on_output, workspace prev_on_output + $flag+$alt+Shift+$right move container to workspace next_on_output, workspace next_on_output + + $flag+$alt+Shift+Left move container to workspace prev_on_output, workspace prev_on_output + $flag+$alt+Shift+Right move container to workspace next_on_output, workspace next_on_output + + # Use your mouse to scroll between workspaces + --whole-window $flag+$scrollUp workspace prev_on_output + --whole-window $flag+$scrollDown workspace next_on_output } bindgesture { @@ -119,17 +136,40 @@ bindgesture { # Outputs bindsym { - $flag+Control+$up focus output up - $flag+Control+$down focus output down + # Use "left" and "up" at the same time to mimic "previous" + # Use "right" and "down" at the same time to mimic "next" + # Though this does not work when using multiple screens, it's an intermediary solution until Sway supports "output next/previous" + $flag+Control+$up focus output left, focus output up + $flag+Control+$down focus output right, focus output down - $flag+Control+Up focus output up - $flag+Control+Down focus output down + $flag+Control+Up focus output left, focus output up + $flag+Control+Down focus output right, focus output down - $flag+Control+Shift+$up move container to output up, focus output up - $flag+Control+Shift+$down move container to output down, focus output down + $flag+$alt+$up focus output left, focus output up + $flag+$alt+$down focus output right, focus output down - $flag+Control+Shift+Up move container to output up, focus output up - $flag+Control+Shift+Down move container to output down, focus output down + $flag+$alt+Up focus output left, focus output up + $flag+$alt+Down focus output right, focus output down + + $flag+Control+Shift+$up move container to output left, focus output left \ + move container to output up, focus output up + $flag+Control+Shift+$down move container to output right, focus output right \ + move container to output down, focus output down + + $flag+Control+Shift+Up move container to output left, focus output left \ + move container to output up, focus output up + $flag+Control+Shift+Down move container to output right, focus output right \ + move container to output down, focus output down + + $flag+$alt+Shift+$up move container to output left, focus output left \ + move container to output up, focus output up + $flag+$alt+Shift+$down move container to output right, focus output right \ + move container to output down, focus output down + + $flag+$alt+Shift+Up move container to output left, focus output left \ + move container to output up, focus output up + $flag+$alt+Shift+Down move container to output right, focus output right \ + move container to output down, focus output down } # System @@ -159,7 +199,6 @@ bindsym --locked { bindgesture hold:3 exec playerctl play-pause - # Shortcuts bindsym { # Reload sway @@ -177,6 +216,9 @@ bindsym { $alt+Tab focus prev $flag+Tab exec $window_switcher + --whole-window $alt+$scrollUp focus prev + --whole-window $alt+$scrollDown focus next + # Lock the screen $flag+Delete exec $lock @@ -187,9 +229,10 @@ bindsym { } bindgesture { - swipe:3:up exec $window_switcher - swipe:4:up exec $menu + # Also show the bar, hide when finished + swipe:3:up bar hidden_state show, exec "$window_switcher; swaymsg bar hidden_state hide" + swipe:4:up exec "$menu; swaymsg bar hidden_state hide" - # Cancel - swipe:down exec pkill rofi + # Cancel and hide bar + swipe:down exec pkill rofi, bar hidden_state hide } From fd15c177e80307d6acd61d8ffdf63016266fca34 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Thu, 7 Dec 2023 20:24:37 +0100 Subject: [PATCH 131/176] Add NVidia support to Docker --- nixos/modules/virtualisation/docker/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/docker/default.nix b/nixos/modules/virtualisation/docker/default.nix index 7143d41..9029217 100644 --- a/nixos/modules/virtualisation/docker/default.nix +++ b/nixos/modules/virtualisation/docker/default.nix @@ -6,6 +6,9 @@ in { options.sisyphus.virtualisation.docker.enable = lib.mkEnableOption "Docker"; config = lib.mkIf cfg.enable { - virtualisation.docker.enable = true; + virtualisation.docker = { + enable = true; + enableNvidia = true; + }; }; } From a795604d15bf61b1ae202acc3dff904a053ec217 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Sun, 24 Dec 2023 11:07:43 +0100 Subject: [PATCH 132/176] Remove deprecated direnv option --- nixos/modules/programs/direnv/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nixos/modules/programs/direnv/default.nix b/nixos/modules/programs/direnv/default.nix index cf91026..ad16c7c 100644 --- a/nixos/modules/programs/direnv/default.nix +++ b/nixos/modules/programs/direnv/default.nix @@ -9,7 +9,6 @@ in { programs.direnv = { enable = true; nix-direnv.enable = true; # Use nix-specific direnv. - persistDerivations = true; # Sets the extraOptions listed below. }; # This is also done by setting programs.direnv.persistDerivations. From 2843567f2ce2575f0da15bd526fc60567831890e Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Sun, 18 Feb 2024 16:17:37 +0100 Subject: [PATCH 133/176] Mount disk for games --- nixos/hosts/Tibo-NixDesk/default.nix | 5 ++++- nixos/hosts/Tibo-NixDesk/hardware-configuration.nix | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index 7695521..5bec21e 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -56,7 +56,10 @@ zenith-nvidia ]; - programs.zsh.enable = true; + programs = { + steam.enable = true; + zsh.enable = true; + }; hardware.bluetooth.enable = true; diff --git a/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix b/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix index a5ae163..4903685 100644 --- a/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix +++ b/nixos/hosts/Tibo-NixDesk/hardware-configuration.nix @@ -50,6 +50,16 @@ "bind" ]; }; + + "/mnt/Games" = { + device = "/dev/disk/by-label/Games"; + fsType = "ntfs"; + options = [ + "uid=tdpeuter" + "gid=users" + "defaults" + ]; + }; }; swapDevices = [ From 381cfbcd72f86c7906c403ffbf536226889205aa Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Sun, 18 Feb 2024 16:31:46 +0100 Subject: [PATCH 134/176] [openconnect-sso] Fix poetry error --- nixos/flake.nix | 10 ++++++++-- nixos/hosts/Tibo-NixDesk/default.nix | 5 ++++- nixos/modules/networking/openconnect-sso/default.nix | 4 ++-- nixos/overlays/openconnect-sso/default.nix | 4 ---- 4 files changed, 14 insertions(+), 9 deletions(-) delete mode 100644 nixos/overlays/openconnect-sso/default.nix diff --git a/nixos/flake.nix b/nixos/flake.nix index 64bf1bc..b2dda58 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -14,6 +14,13 @@ url = "github:nix-community/home-manager/release-23.05"; inputs.nixpkgs.follows = "nixpkgs"; }; + openconnect-sso = { + url = github:ThinkChaos/openconnect-sso/fix/nix-flake; + inputs = { + flake-utils.follows = "utils"; + nixpkgs.follows = "nixpkgs"; + }; + }; sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -26,7 +33,7 @@ outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, - devshell, flake-utils, home-manager, sops-nix, utils, + devshell, flake-utils, home-manager, openconnect-sso, sops-nix, utils, ... }: let system = "x86_64-linux"; @@ -50,7 +57,6 @@ (import ./overlays/cmdtime) (import ./overlays/icosystem) (import ./overlays/letter) - (import ./overlays/openconnect-sso) (import ./overlays/spotify) ]; diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index 5bec21e..be82054 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -11,7 +11,10 @@ model = "RTX 2060"; }; - networking.openconnect-sso.enable = true; + networking = { + networkmanager.enable = true; + openconnect-sso.enable = true; + }; nix = { flakes.enable = true; diff --git a/nixos/modules/networking/openconnect-sso/default.nix b/nixos/modules/networking/openconnect-sso/default.nix index 3b400f8..b62bc89 100644 --- a/nixos/modules/networking/openconnect-sso/default.nix +++ b/nixos/modules/networking/openconnect-sso/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, inputs, lib, pkgs, ... }: let cfg = config.sisyphus.networking.openconnect-sso; @@ -14,7 +14,7 @@ in { }; environment.systemPackages = with pkgs; [ - openconnect-sso + inputs.openconnect-sso.packages.${config.nixpkgs.localSystem.system}.default ]; }; } diff --git a/nixos/overlays/openconnect-sso/default.nix b/nixos/overlays/openconnect-sso/default.nix deleted file mode 100644 index 4759c18..0000000 --- a/nixos/overlays/openconnect-sso/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -import "${builtins.fetchTarball { - url = "https://github.com/vlaci/openconnect-sso/archive/master.tar.gz"; - sha256 = "08cqd40p9vld1liyl6qrsdrilzc709scyfghfzmmja3m1m7nym94"; -}}/overlay.nix" From d3510a3c65cd09d7832db94b4ca431cbb14e3634 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Sun, 18 Feb 2024 16:32:40 +0100 Subject: [PATCH 135/176] [gnome] Remove more unused packages --- nixos/modules/desktop/gnome/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/modules/desktop/gnome/default.nix b/nixos/modules/desktop/gnome/default.nix index dfe804e..e522780 100644 --- a/nixos/modules/desktop/gnome/default.nix +++ b/nixos/modules/desktop/gnome/default.nix @@ -8,8 +8,6 @@ in { config = lib.mkIf cfg.enable { services.xserver = { enable = true; - layout = "us"; - xkbVariant = "altgr-intl"; excludePackages = with pkgs; [ xterm @@ -34,6 +32,8 @@ in { gnome-photos gnome-text-editor gnome-tour + loupe # Image viewer + snapshot # Camera ]) ++ (with pkgs.gnome; [ eog # Image viewer file-roller # Archive manager @@ -45,6 +45,8 @@ in { gnome-clocks gnome-contacts gnome-disk-utility + gnome-font-viewer + gnome-logs gnome-maps gnome-music gnome-system-monitor From 53a2d4c1a679c8c36723c5e3ef3625ea7b5faf0b Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Sun, 18 Feb 2024 16:34:18 +0100 Subject: [PATCH 136/176] Update Tibo-NixDesk --- nixos/flake.lock | 195 +++++++++++++++++++++++---- nixos/flake.nix | 7 +- nixos/hosts/Tibo-NixDesk/default.nix | 21 +-- nixos/users/tdpeuter/default.nix | 8 +- 4 files changed, 186 insertions(+), 45 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index 36ddf9c..f002d94 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -2,17 +2,17 @@ "nodes": { "devshell": { "inputs": { + "flake-utils": "flake-utils", "nixpkgs": [ "nixpkgs" - ], - "systems": "systems" + ] }, "locked": { - "lastModified": 1698410321, - "narHash": "sha256-MphuSlgpmKwtJncGMohryHiK55J1n6WzVQ/OAfmfoMc=", + "lastModified": 1705332421, + "narHash": "sha256-USpGLPme1IuqG78JNqSaRabilwkCyHmVWY0M9vYyqEA=", "owner": "numtide", "repo": "devshell", - "rev": "1aed986e3c81a4f6698e85a7452cbfcc4b31a36e", + "rev": "83cb93d6d063ad290beee669f4badf9914cc16ec", "type": "github" }, "original": { @@ -22,15 +22,33 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "inputs": { "systems": "systems_2" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -46,58 +64,79 @@ ] }, "locked": { - "lastModified": 1699748081, - "narHash": "sha256-MOmMapBydd7MTjhX4eeQZzKlCABWw8W6iSHSG4OeFKE=", + "lastModified": 1706981411, + "narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "04bac349d585c9df38d78e0285b780a140dc74a4", + "rev": "652fda4ca6dafeb090943422c34ae9145787af37", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-23.05", + "ref": "release-23.11", "repo": "home-manager", "type": "github" } }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "openconnect-sso", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701208414, + "narHash": "sha256-xrQ0FyhwTZK6BwKhahIkUVZhMNk21IEI1nUcWSONtpo=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "93e39cc1a087d65bcf7a132e75a650c44dd2b734", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1699596684, - "narHash": "sha256-XSXP8zjBZJBVvpNb2WmY0eW8O2ce+sVyj1T0/iBRIvg=", + "lastModified": 1708161998, + "narHash": "sha256-6KnemmUorCvlcAvGziFosAVkrlWZGIc6UNT9GUYr0jQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "da4024d0ead5d7820f6bd15147d3fe2a0c0cec73", + "rev": "84d981bae8b5e783b3b548de505b22880559515f", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "type": "indirect" } }, "nixpkgs-stable": { "locked": { - "lastModified": 1699756042, - "narHash": "sha256-bHHjQQBsEPOxLL+klYU2lYshDnnWY12SewzQ7n5ab2M=", + "lastModified": 1708210246, + "narHash": "sha256-Q8L9XwrBK53fbuuIFMbjKvoV7ixfLFKLw4yV+SD28Y8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9502d0245983bb233da8083b55d60d96fd3c29ff", + "rev": "69405156cffbdf2be50153f13cbdf9a0bea38e49", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-23.05", + "ref": "release-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-unstable": { "locked": { - "lastModified": 1699781429, - "narHash": "sha256-UYefjidASiLORAjIvVsUHG6WBtRhM67kTjEY4XfZOFs=", + "lastModified": 1708118438, + "narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e44462d6021bfe23dfb24b775cc7c390844f773d", + "rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80", "type": "github" }, "original": { @@ -106,13 +145,79 @@ "type": "indirect" } }, + "openconnect-sso": { + "inputs": { + "flake-utils": [ + "utils" + ], + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "nixpkgs" + ], + "poetry2nix": "poetry2nix", + "systems": "systems_3", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1701455376, + "narHash": "sha256-FMLrMdi6JY7ZfqV5XnNj64jnDcGKznKZLn7O6OMO3u0=", + "owner": "ThinkChaos", + "repo": "openconnect-sso", + "rev": "20c0015c4264c72cc19ac272de0dc534309bd21b", + "type": "github" + }, + "original": { + "owner": "ThinkChaos", + "ref": "fix/nix-flake", + "repo": "openconnect-sso", + "type": "github" + } + }, + "poetry2nix": { + "inputs": { + "flake-utils": [ + "openconnect-sso", + "flake-utils" + ], + "nix-github-actions": [ + "openconnect-sso", + "nix-github-actions" + ], + "nixpkgs": [ + "openconnect-sso", + "nixpkgs" + ], + "systems": [ + "openconnect-sso", + "systems" + ], + "treefmt-nix": [ + "openconnect-sso", + "treefmt-nix" + ] + }, + "locked": { + "lastModified": 1701105783, + "narHash": "sha256-5IOI0xXGbhAkUZNNcPId48V78Q+/JlW0hzlif0zxRmM=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "0b2bff39e9bd4e6db3208e09c276ca83a063b370", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, "root": { "inputs": { "devshell": "devshell", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "home-manager": "home-manager", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", + "openconnect-sso": "openconnect-sso", "sops-nix": "sops-nix", "utils": "utils" } @@ -125,11 +230,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1699951338, - "narHash": "sha256-1GeczM7XfgHcYGYiYNcdwSFu3E62vmh4d7mffWZvyzE=", + "lastModified": 1708225343, + "narHash": "sha256-Q0uVUOfumc1DcKsIJIfMCHph08MjkOvZxvPb/Vi8hWw=", "owner": "Mic92", "repo": "sops-nix", - "rev": "0e3a94167dcd10a47b89141f35b2ff9e04b34c46", + "rev": "ffed177a9d2c685901781c3c6c9024ae0ffc252b", "type": "github" }, "original": { @@ -168,6 +273,42 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "openconnect-sso", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1699786194, + "narHash": "sha256-3h3EH1FXQkIeAuzaWB+nK0XK54uSD46pp+dMD3gAcB4=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "e82f32aa7f06bbbd56d7b12186d555223dc399d1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "utils": { "inputs": { "flake-utils": [ diff --git a/nixos/flake.nix b/nixos/flake.nix index b2dda58..e5a93b8 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -2,7 +2,7 @@ description = "System configuration of my machines using flakes"; inputs = { - nixpkgs.url = "nixpkgs/nixos-23.05"; + nixpkgs.url = "nixpkgs/nixos-23.11"; nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; devshell = { @@ -11,7 +11,7 @@ }; flake-utils.url = "github:numtide/flake-utils"; home-manager = { - url = "github:nix-community/home-manager/release-23.05"; + url = "github:nix-community/home-manager/release-23.11"; inputs.nixpkgs.follows = "nixpkgs"; }; openconnect-sso = { @@ -40,8 +40,7 @@ unfreePackages = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "corefonts" - "nvidia-settings" "nvidia-x11" - "obsidian" + "nvidia-settings" "nvidia-x11" "nvidia-persistenced" "Oracle_VM_VirtualBox_Extension_Pack" "spotify" "steam" "steam-original" "steam-run" diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index be82054..4d207b3 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -6,9 +6,12 @@ ]; sisyphus = { + desktop.gnome.enable = true; + hardware.nvidia = { enable = true; model = "RTX 2060"; + gui-settings = true; }; networking = { @@ -36,12 +39,13 @@ users.tdpeuter.enable = true; - virtualisation.virtualbox.enable = true; + virtualisation = { + docker.enable = true; + virtualbox.enable = true; + }; }; boot = { - kernelPackages = pkgs.linuxPackages_hardened; - loader = { systemd-boot.enable = true; efi = { @@ -66,13 +70,14 @@ hardware.bluetooth.enable = true; - networking = { - hostName = "Tibo-NixDesk"; - networkmanager.enable = true; - # wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.hostName = "Tibo-NixDesk"; + + services.xserver = { + layout = "us"; + xkbVariant = "altgr-intl"; }; - system.stateVersion = "23.05"; + system.stateVersion = "23.11"; time.timeZone = "Europe/Brussels"; diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index 1900b2d..a63da41 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -35,7 +35,7 @@ in { shell = pkgs.zsh; }; - fonts.fonts = with pkgs; [ + fonts.packages = with pkgs; [ corefonts # Calibri for Uni font-awesome # Dependency of Vifm & zsh config letter # Personal font @@ -45,7 +45,6 @@ in { ]; sisyphus = { - desktop.sway.enable = true; programs.spotify-adblock.enable = true; }; @@ -57,8 +56,6 @@ in { homeDirectory = "/home/${user}"; inherit (config.system) stateVersion; - # If you specify an application here, it will be detected by the configuration module - # and the configuration files will be put in place for you. packages = (with pkgs; [ chafa # Terminal image viewer cmdtime # Zsh plugin @@ -71,7 +68,6 @@ in { libreoffice-fresh nextcloud-client nsxiv # Lightweight image viewer - oh-my-zsh phinger-cursors # Cursor theme qalculate-gtk # Calculator spotify-adblock @@ -87,8 +83,8 @@ in { # SMB cifs-utils psmisc ]) ++ (with pkgs-unstable; [ + brave mpv - obsidian spotify ]) ++ (with pkgs.vimPlugins; [ statix From c34b4caad99f47e53364e2ee850f61cfb5418b91 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Sun, 18 Feb 2024 16:35:03 +0100 Subject: [PATCH 137/176] Fix keyboard layouts --- nixos/hosts/Tibo-NixFat/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 11aa47e..8d5f415 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -95,8 +95,12 @@ lidSwitchDocked = "ignore"; }; - # Touchpad - xserver.libinput.enable = true; + xserver = { + # Keyboard layout + layout = "us"; + xkbVariant = "altgr-intl"; + # Touchpad + libinput.enable = true; }; system.stateVersion = "23.05"; @@ -107,7 +111,6 @@ i18n.defaultLocale = "en_GB.UTF-8"; console = { - # font = "Lat2-Terminus16"; useXkbConfig = true; # use xkbOptions in tty. }; } From 5c9517bb0c420084cb42dd3bc831166fb9de7b74 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Mon, 19 Feb 2024 07:54:22 +0100 Subject: [PATCH 138/176] [vim] Fix working linter --- nixos/users/tdpeuter/default.nix | 9 ++++++--- stow/vim/.vimrc | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index a63da41..9be9195 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -66,11 +66,12 @@ in { jellyfin-media-player kitty libreoffice-fresh + mpv nextcloud-client nsxiv # Lightweight image viewer phinger-cursors # Cursor theme qalculate-gtk # Calculator - spotify-adblock + spotify tea # Gitea CLI unzip vifm # File manager @@ -86,9 +87,11 @@ in { brave mpv spotify - ]) ++ (with pkgs.vimPlugins; [ + ]) ++ (with pkgs-unstable.vimPlugins; [ + # ale statix - vim-plug + # vim-plug + vifm-vim ]); pointerCursor = { diff --git a/stow/vim/.vimrc b/stow/vim/.vimrc index eb05888..44b7aab 100644 --- a/stow/vim/.vimrc +++ b/stow/vim/.vimrc @@ -71,7 +71,7 @@ endif " PLUGINS --------------------------------------------------------------- {{{ -call plug#begin() +call plug#begin('~/.vim/plugins') Plug 'dense-analysis/ale' Plug 'vifm/vifm.vim' From 6c1cdbe2884e6a1e94b05c83722e832f24259ef9 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Mon, 19 Feb 2024 10:14:33 +0100 Subject: [PATCH 139/176] Update Tibo-NixFat --- nixos/hosts/Tibo-NixFat/default.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 8d5f415..bb4ab0d 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -36,7 +36,6 @@ users.tdpeuter.enable = true; virtualisation = { - docker.enable = true; qemu.enable = true; virtualbox.enable = true; }; @@ -55,8 +54,6 @@ }; }; - kernelPackages = pkgs.linuxPackages_hardened; - # Use the systemd-boot EFI boot loader.] loader = { systemd-boot.enable = true; @@ -76,7 +73,6 @@ ]; programs = { - steam.enable = true; zsh.enable = true; }; @@ -101,9 +97,10 @@ xkbVariant = "altgr-intl"; # Touchpad libinput.enable = true; + }; }; - system.stateVersion = "23.05"; + system.stateVersion = "23.11"; time.timeZone = "Europe/Brussels"; From 85553a4a9c6c49233e42344de5095aad06bccfe1 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Fri, 23 Feb 2024 08:03:47 +0100 Subject: [PATCH 140/176] [vim] Tweak linters --- nixos/users/tdpeuter/default.nix | 23 ++++---- nixos/users/tdpeuter/dotfiles.nix | 24 +++------ stow/vim/.vim/source/python | 87 +++++++++++++++++++++++++++++++ stow/vim/.vimrc | 8 ++- 4 files changed, 112 insertions(+), 30 deletions(-) create mode 100644 stow/vim/.vim/source/python diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index 9be9195..f406f49 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -57,12 +57,18 @@ in { inherit (config.system) stateVersion; packages = (with pkgs; [ - chafa # Terminal image viewer cmdtime # Zsh plugin + icosystem # Personal icon theme + spotify-adblock + ]) ++ (with pkgs-unstable; [ + # logseq + # obsidian + + brave + chafa # Terminal image viewer duf # Df alternative fzf glow # Terminal Markdown renderer - icosystem # Personal icon theme jellyfin-media-player kitty libreoffice-fresh @@ -83,15 +89,10 @@ in { # SMB cifs-utils psmisc - ]) ++ (with pkgs-unstable; [ - brave - mpv - spotify - ]) ++ (with pkgs-unstable.vimPlugins; [ - # ale - statix - # vim-plug - vifm-vim + + # Linters and LSPs + statix # Nix + ruff pylint # Python ]); pointerCursor = { diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index fa81113..d1d1dc5 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -9,7 +9,7 @@ in { home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable { home = { file = { - ".config/alacritty" = lib.mkIf (builtins.elem pkgs.alacritty installedPkgs) { + ".config/alacritty" = { source = ../../../stow/alacritty/.config/alacritty; }; ".config/dunst" = { @@ -17,26 +17,21 @@ in { source = ../../../stow/dunst/.config/dunst; }; ".config/fuzzel" = { - enable = builtins.elem pkgs.fuzzel installedPkgs; source = ../../../stow/fuzzel/.config/fuzzel; recursive = true; }; ".config/git" = { - enable = (builtins.elem pkgs.git installedPkgs); source = ../../../stow/git/.config/git; recursive = true; }; ".config/kitty" = { - enable = builtins.elem pkgs.kitty installedPkgs; source = ../../../stow/kitty/.config/kitty; recursive = true; }; ".config/mako" = { - enable = builtins.elem pkgs.mako installedPkgs; source = ../../../stow/mako/.config/mako; }; ".config/mpv" = { - enable = (builtins.elem pkgs-unstable.mpv installedPkgs); source = ../../../stow/mpv/.config/mpv; }; ".config/OpenRGB" = { @@ -49,7 +44,7 @@ in { source = ../../../stow/sway/.config/sway; }; ".config/swayidle" = { - enable = (builtins.elem pkgs.swayidle installedPkgs); + enable = config.sisyphus.desktop.sway.enable; source = ../../../stow/swayidle/.config/swayidle; }; ".config/swaylock" = { @@ -57,7 +52,6 @@ in { source = ../../../stow/swaylock/.config/swaylock; }; ".config/vifm" = { - enable = (builtins.elem pkgs.vifm installedPkgs); source = ../../../stow/vifm/.config/vifm; recursive = true; # Fix history and all working }; @@ -66,32 +60,28 @@ in { source = ../../../stow/waybar/.config/waybar; }; ".config/zellij" = { - enable = (builtins.elem pkgs.zellij installedPkgs); source = ../../../stow/zellij/.config/zellij; }; ".oh-my-zsh" = { - enable = true; + enable = (config.users.users.tdpeuter.shell == pkgs.zsh); source = "${pkgs.oh-my-zsh}/share/oh-my-zsh"; recursive = true; }; ".oh-my-zsh/themes/tdpeuter.zsh-theme" = { - enable = (builtins.elem pkgs.zsh installedPkgs); + enable = (config.users.users.tdpeuter.shell == pkgs.zsh); source = ../../../stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme; }; ".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable { source = ../../../stow/ssh/.ssh/config; }; ".vim" = { - enable = (builtins.elem pkgs.vim-full installedPkgs); source = ../../../stow/vim/.vim; recursive = true; }; ".vim/autoload/plug.vim" = { - enable = (builtins.elem pkgs.vim-full installedPkgs); source = "${pkgs.vimPlugins.vim-plug}/plug.vim"; }; ".vimrc" = { - enable = (builtins.elem pkgs.vim-full installedPkgs); source = ../../../stow/vim/.vimrc; }; ".zshrc" = { @@ -99,15 +89,15 @@ in { source = ../../../stow/zsh/.zshrc; }; ".zsh/plugins/cmdtime/cmdtime.plugin.zsh" = { - enable = (builtins.elem pkgs.cmdtime installedPkgs); + enable = (config.users.users.tdpeuter.shell == pkgs.zsh); source = "${pkgs.cmdtime}/share/cmdtime/cmdtime.plugin.zsh"; }; ".zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" = { - enable = (builtins.elem pkgs.zsh-autosuggestions installedPkgs); + enable = (config.users.users.tdpeuter.shell == pkgs.zsh); source = "${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; }; ".zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" = { - enable = (builtins.elem pkgs.zsh-syntax-highlighting installedPkgs); + enable = (config.users.users.tdpeuter.shell == pkgs.zsh); source = "${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"; }; }; diff --git a/stow/vim/.vim/source/python b/stow/vim/.vim/source/python new file mode 100644 index 0000000..fc00b9e --- /dev/null +++ b/stow/vim/.vim/source/python @@ -0,0 +1,87 @@ +" vimrc file for following the coding standards specified in PEP 7 & 8. +" +" To use this file, source it in your own personal .vimrc file (``source +" <filename>``) or, if you don't have a .vimrc file, you can just symlink to it +" (``ln -s <this file> ~/.vimrc``). All options are protected by autocmds +" (read below for an explanation of the command) so blind sourcing of this file +" is safe and will not affect your settings for non-Python or non-C files. +" +" +" All setting are protected by 'au' ('autocmd') statements. Only files ending +" in .py or .pyw will trigger the Python settings while files ending in *.c or +" *.h will trigger the C settings. This makes the file "safe" in terms of only +" adjusting settings for Python and C files. +" +" Only basic settings needed to enforce the style guidelines are set. +" Some suggested options are listed but commented out at the end of this file. + +" Number of spaces that a pre-existing tab is equal to. +" For the amount of space used for a new tab use shiftwidth. +au BufRead,BufNewFile *py,*pyw,*.c,*.h set tabstop=8 + +" What to use for an indent. +" This will affect Ctrl-T and 'autoindent'. +" Python: 4 spaces +" C: tabs (pre-existing files) or 4 spaces (new files) +au BufRead,BufNewFile *.py,*pyw set shiftwidth=4 +au BufRead,BufNewFile *.py,*.pyw set expandtab +fu Select_c_style() + if search('^\t', 'n', 150) + set shiftwidth=8 + set noexpandtab + el + set shiftwidth=4 + set expandtab + en +endf +au BufRead,BufNewFile *.c,*.h call Select_c_style() +au BufRead,BufNewFile Makefile* set noexpandtab + +" Use the below highlight group when displaying bad whitespace is desired. +highlight BadWhitespace ctermbg=red guibg=red + +" Display tabs at the beginning of a line in Python mode as bad. +au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/ +" Make trailing whitespace be flagged as bad. +au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/ + +" Wrap text after a certain number of characters +" Python: 79 +" C: 79 +au BufRead,BufNewFile *.py,*.pyw,*.c,*.h set textwidth=79 + +" Turn off settings in 'formatoptions' relating to comment formatting. +" - c : do not automatically insert the comment leader when wrapping based on +" 'textwidth' +" - o : do not insert the comment leader when using 'o' or 'O' from command mode +" - r : do not insert the comment leader when hitting <Enter> in insert mode +" Python: not needed +" C: prevents insertion of '*' at the beginning of every line in a comment +au BufRead,BufNewFile *.c,*.h set formatoptions-=c formatoptions-=o formatoptions-=r + +" Use UNIX (\n) line endings. +" Only used for new files so as to not force existing files to change their +" line endings. +" Python: yes +" C: yes +au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix + + +" ---------------------------------------------------------------------------- +" The following section contains suggested settings. While in no way required +" to meet coding standards, they are helpful. + +" Set the default file encoding to UTF-8: ``set encoding=utf-8`` + +" Puts a marker at the beginning of the file to differentiate between UTF and +" UCS encoding (WARNING: can trick shells into thinking a text file is actually +" a binary file when executing the text file): ``set bomb`` + +" For full syntax highlighting: +"``let python_highlight_all=1`` +"``syntax on`` + +" Automatically indent based on file type: ``filetype indent on`` +" Keep indentation level from previous line: ``set autoindent`` + +" Folding based on indentation: ``set foldmethod=indent`` diff --git a/stow/vim/.vimrc b/stow/vim/.vimrc index 44b7aab..5995924 100644 --- a/stow/vim/.vimrc +++ b/stow/vim/.vimrc @@ -3,6 +3,7 @@ " source ~/.vim/theme.conf +source ~/.vim/source/python set autoindent set conceallevel=2 @@ -12,6 +13,7 @@ set linebreak set mouse=a set nocompatible set number +set omnifunc=ale#completion#OmniFunc set path+=** set relativenumber set scrolloff=3 @@ -73,10 +75,12 @@ endif call plug#begin('~/.vim/plugins') -Plug 'dense-analysis/ale' -Plug 'vifm/vifm.vim' Plug 'catppuccin/vim', { 'as': 'catppuccin' } +Plug 'dense-analysis/ale' Plug 'NerdyPepper/statix' +Plug 'prabirshrestha/vim-lsp' +Plug 'sheerun/vim-polyglot' +Plug 'vifm/vifm.vim' call plug#end() From 1ac8bc985c7c6c93eb352f149147f60706517904 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Mon, 4 Mar 2024 16:46:30 +0100 Subject: [PATCH 141/176] [hyprland] Add module --- nixos/modules/desktop/default.nix | 1 + nixos/modules/desktop/hyprland/default.nix | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 nixos/modules/desktop/hyprland/default.nix diff --git a/nixos/modules/desktop/default.nix b/nixos/modules/desktop/default.nix index f67e134..465f8ca 100644 --- a/nixos/modules/desktop/default.nix +++ b/nixos/modules/desktop/default.nix @@ -1,6 +1,7 @@ { imports = [ ./gnome + ./hyprland ./plasma ./sway ]; diff --git a/nixos/modules/desktop/hyprland/default.nix b/nixos/modules/desktop/hyprland/default.nix new file mode 100644 index 0000000..5209653 --- /dev/null +++ b/nixos/modules/desktop/hyprland/default.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: + +let + cfg = config.sisyphus.desktop.hyprland; +in { + options.sisyphus.desktop.hyprland.enable = lib.mkEnableOption "Hyprland"; + + config = lib.mkIf cfg.enable { + programs.hyprland = { + enable = true; + xwayland.enable = true; + }; + }; +} + From 4004a048f6a106fcbb79aca265179314851d4dd7 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Mon, 4 Mar 2024 16:49:09 +0100 Subject: [PATCH 142/176] [sway] Add history log to dmenu --- stow/sway/.config/sway/config | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stow/sway/.config/sway/config b/stow/sway/.config/sway/config index 77bfaa9..1b9ee29 100644 --- a/stow/sway/.config/sway/config +++ b/stow/sway/.config/sway/config @@ -15,8 +15,9 @@ set { $scrollUp button4 $scrollDown button5 - $term kitty || alacritty || foot - $menu j4-dmenu-desktop --dmenu "rofi -dmenu -i" + # $term kitty || alacritty || foot + $term kitty + $menu j4-dmenu-desktop --dmenu "rofi -dmenu -i" --usage-log="/home/tdpeuter/.local/state/dmenu.log" # TODO Find better location and better way to reference this. $window_switcher /home/tdpeuter/projects/fzf-jump/new.sh $lock swaylock -f From e81082733131320d4194a9b1a4ff245cb56cc1e1 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Mon, 4 Mar 2024 16:52:53 +0100 Subject: [PATCH 143/176] Fix rename --- nixos/modules/desktop/sway/default.nix | 2 +- nixos/users/tdpeuter/default.nix | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/nixos/modules/desktop/sway/default.nix b/nixos/modules/desktop/sway/default.nix index b5de914..3b29094 100644 --- a/nixos/modules/desktop/sway/default.nix +++ b/nixos/modules/desktop/sway/default.nix @@ -74,7 +74,7 @@ in { SCRIPT_DIR = ../../../../scripts; }; - fonts.fonts = with pkgs; [ + fonts.packages = with pkgs; [ dejavu_fonts font-awesome noto-fonts diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index f406f49..cc5a5a5 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -61,9 +61,6 @@ in { icosystem # Personal icon theme spotify-adblock ]) ++ (with pkgs-unstable; [ - # logseq - # obsidian - brave chafa # Terminal image viewer duf # Df alternative @@ -72,6 +69,7 @@ in { jellyfin-media-player kitty libreoffice-fresh + logseq mpv nextcloud-client nsxiv # Lightweight image viewer @@ -96,9 +94,7 @@ in { ]); pointerCursor = { - package = cursor.package; - name = cursor.name; - size = cursor.size; + inherit (cursor) package name size; gtk.enable = true; x11.enable = true; }; From 15e00efe3e5d9ea77075ebd11267306af9b9d6c0 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Mon, 4 Mar 2024 16:54:28 +0100 Subject: [PATCH 144/176] [nvidia] Attempts to fix flicker Switch to nouveau --- nixos/flake.nix | 1 + nixos/hosts/Tibo-NixFat/default.nix | 2 ++ nixos/modules/desktop/sway/default.nix | 39 ++++++++++++++++++----- nixos/modules/hardware/nvidia/default.nix | 19 +++++++++-- 4 files changed, 50 insertions(+), 11 deletions(-) diff --git a/nixos/flake.nix b/nixos/flake.nix index e5a93b8..54d6be8 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -45,6 +45,7 @@ "spotify" "steam" "steam-original" "steam-run" "vista-fonts" + "nvidia-persistenced" # Docker ]; in utils.lib.mkFlake { diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index bb4ab0d..fd0af25 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -6,6 +6,8 @@ ]; sisyphus = { + desktop.sway.enable = true; + hardware.nvidia = { enable = true; model = "Quadro T2000"; diff --git a/nixos/modules/desktop/sway/default.nix b/nixos/modules/desktop/sway/default.nix index 3b29094..267fe03 100644 --- a/nixos/modules/desktop/sway/default.nix +++ b/nixos/modules/desktop/sway/default.nix @@ -38,6 +38,26 @@ let export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS gnome_schema=org.gnome.desktop.interface # gsettings set $gnome_schema gtk-theme 'Dracula' + + # https://github.com/crispyricepc/sway-nvidia/blob/2101a18698151a61266740f1297158119bf660ac/wlroots-env-nvidia.sh + # Hardware cursors not yet working on wlroots + export WLR_NO_HARDWARE_CURSORS=1 + # Set wlroots renderer to Vulkan to avoid flickering + export WLR_RENDERER=vulkan + # General wayland environment variables + export XDG_SESSION_TYPE=wayland + export QT_QPA_PLATFORM=wayland + export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 + # Firefox wayland environment variable + export MOZ_ENABLE_WAYLAND=1 + export MOZ_USE_XINPUT2=1 + # OpenGL Variables + export GBM_BACKEND=nvidia-drm + export __GL_GSYNC_ALLOWED=0 + export __GL_VRR_ALLOWED=0 + export __GLX_VENDOR_LIBRARY_NAME=nvidia + # Xwayland compatibility + export XWAYLAND_NO_GLAMOR=1 ''; }; in { @@ -100,14 +120,17 @@ in { power-profiles-daemon.enable = true; - xserver.displayManager.session = [{ - manage = "window"; - name = "Sway"; - start = '' - ${pkgs.sway}/bin/sway --unsupported-gpu & - waitPID=$! - ''; - }]; + xserver = { + displayManager.session = [{ + manage = "window"; + name = "Sway"; + start = '' + ${pkgs.sway}/bin/sway --unsupported-gpu & + waitPID=$! + ''; + }]; + videoDrivers = [ "nouveau" ]; + }; }; xdg.portal = { diff --git a/nixos/modules/hardware/nvidia/default.nix b/nixos/modules/hardware/nvidia/default.nix index 077520d..036cf4c 100644 --- a/nixos/modules/hardware/nvidia/default.nix +++ b/nixos/modules/hardware/nvidia/default.nix @@ -3,6 +3,7 @@ let cfg = config.sisyphus.hardware.nvidia; + # The graphics cards for which to do offloading do-offloading = builtins.elem cfg.model [ "Quadro T2000" ]; nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' export __NV_PRIME_RENDER_OFFLOAD=1 @@ -24,8 +25,17 @@ in { }; config = lib.mkIf cfg.enable { - services.xserver.videoDrivers = [ "nvidia" ]; - +# boot = { +# extraModprobeConfig = "options nvidia-drm modeset=1"; +# +# initrd.kernelModules = [ +# "nvidia" +# "nvidia_modeset" +# "nvidia_uvm" +# "nvidia_drm" +# ]; +# }; + hardware = { opengl = { enable = true; @@ -33,7 +43,7 @@ in { driSupport32Bit = true; }; nvidia = { - open = true; + open = false; package = config.boot.kernelPackages.nvidiaPackages.stable; modesetting.enable = true; nvidiaSettings = cfg.gui-settings; @@ -42,6 +52,9 @@ in { finegrained = do-offloading; }; + # Avoid flickering + forceFullCompositionPipeline = true; + prime = lib.mkMerge [ (lib.mkIf do-offloading { offload = { From 6cd501571e9bd92ead8d2e3e83dfc5b207cc622e Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Fri, 8 Mar 2024 15:38:32 +0100 Subject: [PATCH 145/176] [openconnect-sso] Remove insecure --- nixos/modules/networking/openconnect-sso/default.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/nixos/modules/networking/openconnect-sso/default.nix b/nixos/modules/networking/openconnect-sso/default.nix index b62bc89..db5b91d 100644 --- a/nixos/modules/networking/openconnect-sso/default.nix +++ b/nixos/modules/networking/openconnect-sso/default.nix @@ -6,13 +6,6 @@ in { options.sisyphus.networking.openconnect-sso.enable = lib.mkEnableOption "OpenConnect SSO"; config = lib.mkIf cfg.enable { - nixpkgs = { - config.permittedInsecurePackages = [ - "python3.10-requests-2.28.2" - "python3.10-cryptography-40.0.1" - ]; - }; - environment.systemPackages = with pkgs; [ inputs.openconnect-sso.packages.${config.nixpkgs.localSystem.system}.default ]; From 601a742cd23f278de7c5d1145fadc8b62d5eb29c Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Fri, 8 Mar 2024 15:38:48 +0100 Subject: [PATCH 146/176] [foot] Add package --- nixos/users/tdpeuter/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index cc5a5a5..4402d0b 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -64,6 +64,7 @@ in { brave chafa # Terminal image viewer duf # Df alternative + foot fzf glow # Terminal Markdown renderer jellyfin-media-player From 832d664e6cc9aa038218ffbb3c96ab3d412ec067 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Wed, 13 Mar 2024 08:15:51 +0100 Subject: [PATCH 147/176] [sway] Add altgr keyboard variant --- stow/sway/.config/sway/input-output | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stow/sway/.config/sway/input-output b/stow/sway/.config/sway/input-output index b7df7fc..d8f2756 100644 --- a/stow/sway/.config/sway/input-output +++ b/stow/sway/.config/sway/input-output @@ -1,3 +1,8 @@ +input type:keyboard { + xkb_layout "us" + xkb_variant "altgr-intl" +} + input type:touchpad { natural_scroll enabled scroll_factor 0.8 From 059fa04660bcb2dae403701e03b51e64d452acfe Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Wed, 13 Mar 2024 08:16:17 +0100 Subject: [PATCH 148/176] [monero] Add module --- nixos/flake.lock | 36 ++++++++++----------- nixos/hosts/Tibo-NixFat/default.nix | 1 + nixos/modules/services/default.nix | 1 + nixos/modules/services/monero/default.nix | 39 +++++++++++++++++++++++ 4 files changed, 59 insertions(+), 18 deletions(-) create mode 100644 nixos/modules/services/monero/default.nix diff --git a/nixos/flake.lock b/nixos/flake.lock index f002d94..ac020d9 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -8,11 +8,11 @@ ] }, "locked": { - "lastModified": 1705332421, - "narHash": "sha256-USpGLPme1IuqG78JNqSaRabilwkCyHmVWY0M9vYyqEA=", + "lastModified": 1710156081, + "narHash": "sha256-4PMY6aumJi5dLFjBzF5O4flKXmadMNq3AGUHKYfchh0=", "owner": "numtide", "repo": "devshell", - "rev": "83cb93d6d063ad290beee669f4badf9914cc16ec", + "rev": "bc68b058dc7e6d4d6befc4ec6c60082b6e844b7d", "type": "github" }, "original": { @@ -44,11 +44,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -101,11 +101,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1708161998, - "narHash": "sha256-6KnemmUorCvlcAvGziFosAVkrlWZGIc6UNT9GUYr0jQ=", + "lastModified": 1710162809, + "narHash": "sha256-i2R2bcnQp+85de67yjgZVvJhd6rRnJbSYNpGmB6Leb8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "84d981bae8b5e783b3b548de505b22880559515f", + "rev": "ddcd7598b2184008c97e6c9c6a21c5f37590b8d2", "type": "github" }, "original": { @@ -116,11 +116,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1708210246, - "narHash": "sha256-Q8L9XwrBK53fbuuIFMbjKvoV7ixfLFKLw4yV+SD28Y8=", + "lastModified": 1710033658, + "narHash": "sha256-yiZiVKP5Ya813iYLho2+CcFuuHpaqKc/CoxOlANKcqM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "69405156cffbdf2be50153f13cbdf9a0bea38e49", + "rev": "b17375d3bb7c79ffc52f3538028b2ec06eb79ef8", "type": "github" }, "original": { @@ -132,11 +132,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1708118438, - "narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=", + "lastModified": 1709961763, + "narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80", + "rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34", "type": "github" }, "original": { @@ -230,11 +230,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1708225343, - "narHash": "sha256-Q0uVUOfumc1DcKsIJIfMCHph08MjkOvZxvPb/Vi8hWw=", + "lastModified": 1710195194, + "narHash": "sha256-KFxCJp0T6TJOz1IOKlpRdpsCr9xsvlVuWY/VCiAFnTE=", "owner": "Mic92", "repo": "sops-nix", - "rev": "ffed177a9d2c685901781c3c6c9024ae0ffc252b", + "rev": "e52d8117b330f690382f1d16d81ae43daeb4b880", "type": "github" }, "original": { diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index fd0af25..cf367bd 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -31,6 +31,7 @@ }; services = { + monero.enable = true; pipewire.enable = true; tailscale.enable = true; }; diff --git a/nixos/modules/services/default.nix b/nixos/modules/services/default.nix index ce7bc80..8abb180 100644 --- a/nixos/modules/services/default.nix +++ b/nixos/modules/services/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./monero ./openrgb ./openssh ./pipewire diff --git a/nixos/modules/services/monero/default.nix b/nixos/modules/services/monero/default.nix new file mode 100644 index 0000000..1ca5c58 --- /dev/null +++ b/nixos/modules/services/monero/default.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.services.monero; +in { + options.sisyphus.services.monero.enable = lib.mkEnableOption "Monero"; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + monero-cli + ]; + + services = { + monero.enable = true; + xmrig = { + enable = true; + settings = { + autosave = true; + background = true; + pause-on-battery = true; + pasue-on-active = true; + donate-level = 5; + cpu = true; + opencl = false; + cuda = true; + pools = [ + { + # url = "monerohash.com:9999"; + url = "127.0.0.1:18081"; # Local node + user = "44FjmmLn1k1GC1AFTLSdWDZ17CHB2h3eRCnfkfTQBucHaKX1AGS5oLERR1FEaHxPQcUNwrbEfsgbY4Y6bYJm6ZrdCYGwg7b"; + keepalive = true; + tls = true; + } + ]; + }; + }; + }; + }; +} From 77c4056ada0c77692e36ae93ec0065d8775ae8ab Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Wed, 20 Mar 2024 21:36:56 +0100 Subject: [PATCH 149/176] [docker] Disable on boot --- nixos/modules/virtualisation/docker/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/virtualisation/docker/default.nix b/nixos/modules/virtualisation/docker/default.nix index 9029217..6b90e37 100644 --- a/nixos/modules/virtualisation/docker/default.nix +++ b/nixos/modules/virtualisation/docker/default.nix @@ -9,6 +9,8 @@ in { virtualisation.docker = { enable = true; enableNvidia = true; + # Because these are made for development purposes and not for servers + enableOnBoot = false; }; }; } From cf34acefe0ab7e7a3603165504f4a00c5f552b51 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo.depeuter@gmail.com> Date: Wed, 20 Mar 2024 22:06:43 +0100 Subject: [PATCH 150/176] [sway] Add vertical display --- stow/sway/.config/sway/input-output | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stow/sway/.config/sway/input-output b/stow/sway/.config/sway/input-output index d8f2756..c336c59 100644 --- a/stow/sway/.config/sway/input-output +++ b/stow/sway/.config/sway/input-output @@ -14,3 +14,7 @@ output * { bg "~/Nextcloud/Afbeeldingen/wallpapers/bg" fill } +# Vertical display +output "Dell Inc. DELL P2214H 29C2937M4YTL" { + transform 270 +} From 4c0cabe4bae7509dad8215d1c4673734dc23f993 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Fri, 22 Mar 2024 21:16:12 +0100 Subject: [PATCH 151/176] [yubikey] Add module --- nixos/modules/hardware/default.nix | 1 + nixos/modules/hardware/yubikey/default.nix | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 nixos/modules/hardware/yubikey/default.nix diff --git a/nixos/modules/hardware/default.nix b/nixos/modules/hardware/default.nix index efa0833..f77ad04 100644 --- a/nixos/modules/hardware/default.nix +++ b/nixos/modules/hardware/default.nix @@ -1,5 +1,6 @@ { imports = [ ./nvidia + ./yubikey ]; } diff --git a/nixos/modules/hardware/yubikey/default.nix b/nixos/modules/hardware/yubikey/default.nix new file mode 100644 index 0000000..8deb1ed --- /dev/null +++ b/nixos/modules/hardware/yubikey/default.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.hardware.yubikey; +in { + options.sisyphus.hardware.yubikey.enable = lib.mkEnableOption "YubiKey support"; + + config = lib.mkIf cfg.enable { + # Enable smart card reading + services.pcscd.enable = true; + + programs.gnupg.agent = { + enable = true; + pinentryFlavor = "curses"; + }; + }; +} From e9274202bb5f2d12736972b60b5ad5c83bd85a3b Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Fri, 22 Mar 2024 21:29:30 +0100 Subject: [PATCH 152/176] [git] Add PGP signing --- stow/git/.config/git/config | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stow/git/.config/git/config b/stow/git/.config/git/config index 19e8151..196318f 100644 --- a/stow/git/.config/git/config +++ b/stow/git/.config/git/config @@ -1,10 +1,15 @@ [user] name = "Tibo De Peuter" - email = "tibo.depeuter@gmail.com" + email = "tibo@depeuter.dev" + signingkey = "0x9B11F5243089DB5B" [color] ui = true +[commit] + # Always sign commits + gpgsign = true + [core] editor = "vim"; excludesFile = "~/.config/git/ignore" From 26521600a10f055282dfc8f4694b75218092a87e Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Fri, 22 Mar 2024 21:39:08 +0100 Subject: [PATCH 153/176] [git] Disable signing university commits for now --- stow/git/.config/git/university | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stow/git/.config/git/university b/stow/git/.config/git/university index e0f3026..0c480ac 100644 --- a/stow/git/.config/git/university +++ b/stow/git/.config/git/university @@ -1,2 +1,5 @@ [user] email = "tibo.depeuter@ugent.be" + +[commit] + gpgsign = false From 985f687cc4b9e8bc0aa5a0ef8873dd0f86c57fdd Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Sat, 23 Mar 2024 22:41:16 +0100 Subject: [PATCH 154/176] [yubikey] Enable on laptop --- nixos/hosts/Tibo-NixFat/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index cf367bd..3d9205c 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -8,9 +8,12 @@ sisyphus = { desktop.sway.enable = true; - hardware.nvidia = { - enable = true; - model = "Quadro T2000"; + hardware = { + nvidia = { + enable = true; + model = "Quadro T2000"; + }; + yubikey.enable = true; }; networking = { From 1c8e7e9b9339336e4d64cd74b010cb1b7ae9f1de Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Sat, 23 Mar 2024 22:45:11 +0100 Subject: [PATCH 155/176] [monero] Disable --- nixos/hosts/Tibo-NixFat/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 3d9205c..87186d4 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -34,7 +34,6 @@ }; services = { - monero.enable = true; pipewire.enable = true; tailscale.enable = true; }; @@ -42,7 +41,7 @@ users.tdpeuter.enable = true; virtualisation = { - qemu.enable = true; + docker.enable = true; virtualbox.enable = true; }; }; From 93260e3857deb35ece63bc7a51de00afc93a1d6c Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Sun, 24 Mar 2024 11:50:01 +0100 Subject: [PATCH 156/176] [zsh] Disable autoupdate oh-my-zsh --- stow/zsh/.zshrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stow/zsh/.zshrc b/stow/zsh/.zshrc index d6e4b06..318afca 100644 --- a/stow/zsh/.zshrc +++ b/stow/zsh/.zshrc @@ -6,6 +6,8 @@ fpath+="$HOME/.zsh/plugins/cmdtime" plugins=(dirhistory git screen) ZSH_CUSTOM="$HOME/.oh-my-zsh" ZSH_THEME="tdpeuter" +# Disable automatically updating +zstyle ':omz:update' mode disabled source $ZSH_CUSTOM/oh-my-zsh.sh if [[ -f "$HOME/.zsh/plugins/cmdtime/cmdtime.plugin.zsh" ]]; then From 7c0a2bf02217461317d779a0973a300ee2505881 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Wed, 27 Mar 2024 16:28:39 +0100 Subject: [PATCH 157/176] Restructure dotfiles --- nixos/users/tdpeuter/dotfiles.nix | 192 +++++++++++++++--------------- 1 file changed, 99 insertions(+), 93 deletions(-) diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index d1d1dc5..cfce3e7 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -1,5 +1,7 @@ { config, lib, pkgs, pkgs-unstable, ... }: +# Does basically the same thing that stow does, but using Nix. + let cfg = config.sisyphus.users.tdpeuter; user = config.users.users.tdpeuter.name; @@ -8,99 +10,103 @@ in { config = lib.mkIf cfg.enable { home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable { home = { - file = { - ".config/alacritty" = { - source = ../../../stow/alacritty/.config/alacritty; - }; - ".config/dunst" = { - enable = config.sisyphus.desktop.sway.enable; - source = ../../../stow/dunst/.config/dunst; - }; - ".config/fuzzel" = { - source = ../../../stow/fuzzel/.config/fuzzel; - recursive = true; - }; - ".config/git" = { - source = ../../../stow/git/.config/git; - recursive = true; - }; - ".config/kitty" = { - source = ../../../stow/kitty/.config/kitty; - recursive = true; - }; - ".config/mako" = { - source = ../../../stow/mako/.config/mako; - }; - ".config/mpv" = { - source = ../../../stow/mpv/.config/mpv; - }; - ".config/OpenRGB" = { - enable = config.sisyphus.services.openrgb.enable; - source = ../../../stow/openrgb/.config/OpenRGB; - recursive = true; - }; - ".config/sway" = { - enable = config.sisyphus.desktop.sway.enable; - source = ../../../stow/sway/.config/sway; - }; - ".config/swayidle" = { - enable = config.sisyphus.desktop.sway.enable; - source = ../../../stow/swayidle/.config/swayidle; - }; - ".config/swaylock" = { - enable = config.sisyphus.desktop.sway.enable; - source = ../../../stow/swaylock/.config/swaylock; - }; - ".config/vifm" = { - source = ../../../stow/vifm/.config/vifm; - recursive = true; # Fix history and all working - }; - ".config/waybar" = { - enable = config.sisyphus.desktop.sway.enable; - source = ../../../stow/waybar/.config/waybar; - }; - ".config/zellij" = { - source = ../../../stow/zellij/.config/zellij; - }; - ".oh-my-zsh" = { - enable = (config.users.users.tdpeuter.shell == pkgs.zsh); - source = "${pkgs.oh-my-zsh}/share/oh-my-zsh"; - recursive = true; - }; - ".oh-my-zsh/themes/tdpeuter.zsh-theme" = { - enable = (config.users.users.tdpeuter.shell == pkgs.zsh); - source = ../../../stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme; - }; - ".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable { - source = ../../../stow/ssh/.ssh/config; - }; - ".vim" = { - source = ../../../stow/vim/.vim; - recursive = true; - }; - ".vim/autoload/plug.vim" = { - source = "${pkgs.vimPlugins.vim-plug}/plug.vim"; - }; - ".vimrc" = { - source = ../../../stow/vim/.vimrc; - }; - ".zshrc" = { - enable = (config.users.users.tdpeuter.shell == pkgs.zsh); - source = ../../../stow/zsh/.zshrc; - }; - ".zsh/plugins/cmdtime/cmdtime.plugin.zsh" = { - enable = (config.users.users.tdpeuter.shell == pkgs.zsh); - source = "${pkgs.cmdtime}/share/cmdtime/cmdtime.plugin.zsh"; - }; - ".zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" = { - enable = (config.users.users.tdpeuter.shell == pkgs.zsh); - source = "${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; - }; - ".zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" = { - enable = (config.users.users.tdpeuter.shell == pkgs.zsh); - source = "${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"; - }; - }; + file = lib.mkMerge [ + { + ".config/alacritty" = { + enable = false; + source = ../../../stow/alacritty/.config/alacritty; + }; + ".config/dunst" = { + inherit (config.sisyphus.desktop.sway) enable; + source = ../../../stow/dunst/.config/dunst; + }; + ".config/fuzzel" = { + recursive = true; + source = ../../../stow/fuzzel/.config/fuzzel; + }; + ".config/git" = { + recursive = true; + source = ../../../stow/git/.config/git; + }; + ".config/kitty" = { + enable = false; + recursive = true; + source = ../../../stow/kitty/.config/kitty; + }; + ".config/mako" = { + enable = false; + source = ../../../stow/mako/.config/mako; + }; + ".config/mpv" = { + source = ../../../stow/mpv/.config/mpv; + }; + ".config/OpenRGB" = { + inherit (config.sisyphus.services.openrgb) enable; + recursive = true; + source = ../../../stow/openrgb/.config/OpenRGB; + }; + ".config/sway" = { + inherit (config.sisyphus.desktop.sway) enable; + source = ../../../stow/sway/.config/sway; + }; + ".config/swayidle" = { + inherit (config.sisyphus.desktop.sway) enable; + source = ../../../stow/swayidle/.config/swayidle; + }; + ".config/swaylock" = { + inherit (config.sisyphus.desktop.sway) enable; + source = ../../../stow/swaylock/.config/swaylock; + }; + ".config/vifm" = { + recursive = true; # Fix history and all working + source = ../../../stow/vifm/.config/vifm; + }; + ".config/waybar" = { + inherit (config.sisyphus.desktop.sway) enable; + source = ../../../stow/waybar/.config/waybar; + }; + ".config/zellij" = { + source = ../../../stow/zellij/.config/zellij; + }; + ".oh-my-zsh" = { + enable = config.users.users.tdpeuter.shell == pkgs.zsh; + source = "${pkgs.oh-my-zsh}/share/oh-my-zsh"; + recursive = true; + }; + ".oh-my-zsh/themes/tdpeuter.zsh-theme" = { + enable = config.users.users.tdpeuter.shell == pkgs.zsh; + source = ../../../stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme; + }; + ".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable { + inherit (config.sisyphus.programs.ssh) enable; + source = ../../../stow/ssh/.ssh/config; + }; + ".vim" = { + recursive = true; + source = ../../../stow/vim/.vim; + }; + ".vim/autoload/plug.vim" = { + source = "${pkgs.vimPlugins.vim-plug}/plug.vim"; + }; + ".vimrc" = { + source = ../../../stow/vim/.vimrc; + }; + } + (lib.mkIf (config.users.users.tdpeuter.shell == pkgs.zsh) { + ".zshrc" = { + source = ../../../stow/zsh/.zshrc; + }; + ".zsh/plugins/cmdtime/cmdtime.plugin.zsh" = { + source = "${pkgs.cmdtime}/share/cmdtime/cmdtime.plugin.zsh"; + }; + ".zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" = { + source = "${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"; + }; + ".zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" = { + source = "${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"; + }; + }) + ]; }; }; }; From ceda87452c5aca6b79504eaf2dedcc68f734f069 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Wed, 27 Mar 2024 16:29:15 +0100 Subject: [PATCH 158/176] Update monero config --- nixos/modules/services/monero/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/monero/default.nix b/nixos/modules/services/monero/default.nix index 1ca5c58..fc49b91 100644 --- a/nixos/modules/services/monero/default.nix +++ b/nixos/modules/services/monero/default.nix @@ -11,22 +11,24 @@ in { ]; services = { + # Choose to run a node or not. monero.enable = true; + xmrig = { enable = true; settings = { autosave = true; background = true; pause-on-battery = true; - pasue-on-active = true; + pause-on-active = 60; donate-level = 5; cpu = true; opencl = false; cuda = true; pools = [ { - # url = "monerohash.com:9999"; - url = "127.0.0.1:18081"; # Local node + url = "monerohash.com:9999"; + # url = "127.0.0.1:18081"; # Local node user = "44FjmmLn1k1GC1AFTLSdWDZ17CHB2h3eRCnfkfTQBucHaKX1AGS5oLERR1FEaHxPQcUNwrbEfsgbY4Y6bYJm6ZrdCYGwg7b"; keepalive = true; tls = true; From ff9de17d04d2d3107ff6c1505608673abf851df2 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Sat, 30 Mar 2024 00:24:22 +0100 Subject: [PATCH 159/176] Allow signing with university mail --- nixos/flake.lock | 36 ++++++++++++++++----------------- stow/git/.config/git/university | 2 -- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index ac020d9..9d83527 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -8,11 +8,11 @@ ] }, "locked": { - "lastModified": 1710156081, - "narHash": "sha256-4PMY6aumJi5dLFjBzF5O4flKXmadMNq3AGUHKYfchh0=", + "lastModified": 1711099426, + "narHash": "sha256-HzpgM/wc3aqpnHJJ2oDqPBkNsqWbW0WfWUO8lKu8nGk=", "owner": "numtide", "repo": "devshell", - "rev": "bc68b058dc7e6d4d6befc4ec6c60082b6e844b7d", + "rev": "2d45b54ca4a183f2fdcf4b19c895b64fbf620ee8", "type": "github" }, "original": { @@ -64,11 +64,11 @@ ] }, "locked": { - "lastModified": 1706981411, - "narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=", + "lastModified": 1710888565, + "narHash": "sha256-s9Hi4RHhc6yut4EcYD50sZWRDKsugBJHSbON8KFwoTw=", "owner": "nix-community", "repo": "home-manager", - "rev": "652fda4ca6dafeb090943422c34ae9145787af37", + "rev": "f33900124c23c4eca5831b9b5eb32ea5894375ce", "type": "github" }, "original": { @@ -101,11 +101,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1710162809, - "narHash": "sha256-i2R2bcnQp+85de67yjgZVvJhd6rRnJbSYNpGmB6Leb8=", + "lastModified": 1711668574, + "narHash": "sha256-u1dfs0ASQIEr1icTVrsKwg2xToIpn7ZXxW3RHfHxshg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ddcd7598b2184008c97e6c9c6a21c5f37590b8d2", + "rev": "219951b495fc2eac67b1456824cc1ec1fd2ee659", "type": "github" }, "original": { @@ -116,11 +116,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1710033658, - "narHash": "sha256-yiZiVKP5Ya813iYLho2+CcFuuHpaqKc/CoxOlANKcqM=", + "lastModified": 1711233294, + "narHash": "sha256-eEu5y4J145BYDw9o/YEmeJyqh8blgnZwuz9k234zuWc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b17375d3bb7c79ffc52f3538028b2ec06eb79ef8", + "rev": "ac6bdf6181666ebb4f90dd20f31e2fa66ede6b68", "type": "github" }, "original": { @@ -132,11 +132,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1709961763, - "narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=", + "lastModified": 1711703276, + "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34", + "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", "type": "github" }, "original": { @@ -230,11 +230,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1710195194, - "narHash": "sha256-KFxCJp0T6TJOz1IOKlpRdpsCr9xsvlVuWY/VCiAFnTE=", + "lastModified": 1711249319, + "narHash": "sha256-N+Pp3/8H+rd7cO71VNV/ovV/Kwt+XNeUHNhsmyTabdM=", "owner": "Mic92", "repo": "sops-nix", - "rev": "e52d8117b330f690382f1d16d81ae43daeb4b880", + "rev": "405987a66cce9a4a82f321f11b205982a7127c88", "type": "github" }, "original": { diff --git a/stow/git/.config/git/university b/stow/git/.config/git/university index 0c480ac..35a9a3a 100644 --- a/stow/git/.config/git/university +++ b/stow/git/.config/git/university @@ -1,5 +1,3 @@ [user] email = "tibo.depeuter@ugent.be" -[commit] - gpgsign = false From 6f5815b39200d70b6d29958d2751ffb15bdffce2 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Sat, 30 Mar 2024 23:05:05 +0100 Subject: [PATCH 160/176] [thunderbird] Sign mail with YubiKey --- nixos/modules/hardware/yubikey/default.nix | 10 ++++++---- nixos/users/tdpeuter/mail.nix | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/nixos/modules/hardware/yubikey/default.nix b/nixos/modules/hardware/yubikey/default.nix index 8deb1ed..116a7d1 100644 --- a/nixos/modules/hardware/yubikey/default.nix +++ b/nixos/modules/hardware/yubikey/default.nix @@ -6,12 +6,14 @@ in { options.sisyphus.hardware.yubikey.enable = lib.mkEnableOption "YubiKey support"; config = lib.mkIf cfg.enable { - # Enable smart card reading - services.pcscd.enable = true; - programs.gnupg.agent = { enable = true; - pinentryFlavor = "curses"; + # TODO Necessary? + # enableSSHSupport = true; + # pinentryFlavor = "curses"; }; + + # Enable smart card reading + services.pcscd.enable = true; }; } diff --git a/nixos/users/tdpeuter/mail.nix b/nixos/users/tdpeuter/mail.nix index a7335c9..d6b4928 100644 --- a/nixos/users/tdpeuter/mail.nix +++ b/nixos/users/tdpeuter/mail.nix @@ -67,9 +67,13 @@ in { thunderbird = { enable = true; settings = id: { - "mail.server.server_${id}.authMethod" = 10; + "mail.server.server_${id}.authMethod" = 10; "mail.smtpserver.smtp_${id}.authMethod" = 10; - "mail.identity.id_${id}.htmlSigText" = signatures.UGent; + "mail.identity.id_${id}.htmlSigText" = signatures.UGent; + + # Allow PGP + "mail.identity.id_${id}.openpgp_key_id" = "9B11F5243089DB5B"; # Your 'master' key + "mail.identity.id_${id}.attachPgpKey" = true; }; }; }; @@ -117,10 +121,15 @@ in { profiles.tdpeuter = { isDefault = true; settings = { - "mailnews.default_sort_order" = 2; # Sort descending + # View + "mailnews.default_sort_order" = 2; # Sort descending "mailnews.mark_message_read.delay" = true; "mailnews.start_page.enabled" = false; - "mail.pane_config.dynamic" = 2; # Vertical view + "mail.pane_config.dynamic" = 2; # Vertical view + + # Encryption + "mail.openpgp.allow_external_gnupg" = true; # Enable YubiKey GPG signing + "mail.e2ee.auto_enable" = true; # Automatically enable encryption when possible. }; }; }; From da6d195afbd4d5504cadcf95bc6f0791249deeae Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Sat, 6 Apr 2024 23:00:17 +0200 Subject: [PATCH 161/176] [yubikey] Add touch-detector --- nixos/modules/hardware/yubikey/default.nix | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/nixos/modules/hardware/yubikey/default.nix b/nixos/modules/hardware/yubikey/default.nix index 116a7d1..708b9c1 100644 --- a/nixos/modules/hardware/yubikey/default.nix +++ b/nixos/modules/hardware/yubikey/default.nix @@ -6,14 +6,31 @@ in { options.sisyphus.hardware.yubikey.enable = lib.mkEnableOption "YubiKey support"; config = lib.mkIf cfg.enable { - programs.gnupg.agent = { - enable = true; - # TODO Necessary? - # enableSSHSupport = true; - # pinentryFlavor = "curses"; + programs = { + gnupg.agent = { + enable = true; + # TODO Necessary? + # enableSSHSupport = true; + # pinentryFlavor = "curses"; + }; + + # yubikey-touch-detector.enable = true; }; # Enable smart card reading services.pcscd.enable = true; + + environment.systemPackages = with pkgs; [ + yubikey-touch-detector + ]; + + # Send a notification if the YubiKey is waiting for touch. + systemd.user.services.yubikey-touch-detector = { + enable = true; + description = "Detects when your YubiKey is waiting for a touch"; + path = with pkgs; [ yubikey-touch-detector ]; + script = ''exec yubikey-touch-detector --notify''; + environment.YUBIKEY_TOUCH_DETECTOR_LIBNOTIFY = "true"; + }; }; } From ef9f891482a337bdca9a0e5cef33d356240b52db Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Tue, 9 Apr 2024 12:29:06 +0200 Subject: [PATCH 162/176] [sway] Attempt at improving startup time of launcher --- stow/sway/.config/sway/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stow/sway/.config/sway/config b/stow/sway/.config/sway/config index 1b9ee29..922a75b 100644 --- a/stow/sway/.config/sway/config +++ b/stow/sway/.config/sway/config @@ -16,8 +16,8 @@ set { $scrollDown button5 # $term kitty || alacritty || foot - $term kitty - $menu j4-dmenu-desktop --dmenu "rofi -dmenu -i" --usage-log="/home/tdpeuter/.local/state/dmenu.log" + $term foot + $menu j4-dmenu-desktop --dmenu="rofi -dmenu -i" --no-generic --usage-log="/home/tdpeuter/.local/state/dmenu.log" --term=$term # TODO Find better location and better way to reference this. $window_switcher /home/tdpeuter/projects/fzf-jump/new.sh $lock swaylock -f From 2ec2004f8724165de5bb6648ac9c357c43875ce7 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Tue, 9 Apr 2024 13:07:11 +0200 Subject: [PATCH 163/176] [yubikey] Enable on desktop --- nixos/hosts/Tibo-NixDesk/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index 4d207b3..cf1eead 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -8,10 +8,13 @@ sisyphus = { desktop.gnome.enable = true; - hardware.nvidia = { - enable = true; - model = "RTX 2060"; - gui-settings = true; + hardware = { + nvidia = { + enable = true; + model = "RTX 2060"; + gui-settings = true; + }; + yubikey.enable = true; }; networking = { From 4cd62682fdac54b270b36d2fc7cc2de9433f31ac Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Tue, 9 Apr 2024 13:07:50 +0200 Subject: [PATCH 164/176] [sway] Switch on desktop --- nixos/hosts/Tibo-NixDesk/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index cf1eead..e75dc2c 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -6,7 +6,7 @@ ]; sisyphus = { - desktop.gnome.enable = true; + desktop.sway.enable = true; hardware = { nvidia = { From 9c61e74df7fce04f896adc957a16cbd3633f6c53 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Tue, 16 Apr 2024 16:29:53 +0200 Subject: [PATCH 165/176] [git] fix: Add safe directory for sshfs --- stow/git/.config/git/config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stow/git/.config/git/config b/stow/git/.config/git/config index 196318f..d0a80e2 100644 --- a/stow/git/.config/git/config +++ b/stow/git/.config/git/config @@ -15,7 +15,7 @@ excludesFile = "~/.config/git/ignore" [help] - autocorrect = 20 + autocorrect = 15 [includeIf "gitdir:~/university/"] # Trailing backslash is necessary! path = "~/.config/git/university" @@ -23,3 +23,6 @@ [init] defaultBranch = "main" +[safe] + directory = "/home/tdpeuter/university/sshfs" + From ea0c3544efe1ce786d414b81454dbb39424a9caa Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Tue, 16 Apr 2024 16:31:08 +0200 Subject: [PATCH 166/176] [cursor] fix: Avoid clash --- nixos/users/tdpeuter/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index 4402d0b..52b2886 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -74,7 +74,6 @@ in { mpv nextcloud-client nsxiv # Lightweight image viewer - phinger-cursors # Cursor theme qalculate-gtk # Calculator spotify tea # Gitea CLI From 8f021010c328c905634cd9bb30bd3eb8951ce93b Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Mon, 29 Apr 2024 15:03:28 +0200 Subject: [PATCH 167/176] [firefox] Remove Qwant from search --- nixos/users/tdpeuter/firefox.nix | 65 ++++++++++++++++---------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/nixos/users/tdpeuter/firefox.nix b/nixos/users/tdpeuter/firefox.nix index ba1e9e2..962eeab 100644 --- a/nixos/users/tdpeuter/firefox.nix +++ b/nixos/users/tdpeuter/firefox.nix @@ -18,42 +18,41 @@ in { DisableFirefoxStudies = true; DisablePocket = true; DisableTelemetry = true; - ExtensionSettings = {}; OfferToSaveLogins = false; }; }; - profiles.tdpeuter = { - search = { - default = "DuckDuckGo"; - force = true; - engines = { - "Bing".metaData.hidden = true; - "eBay".metaData.hidden = true; - - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; - - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@np" ]; - }; - "GitHub" = { - urls = [{ - template = "https://github.com/search"; - params = [ - { name = "q"; value = "{searchTerms}"; } - { name = "type"; value = "repositories"; } - ]; - }]; - - icon = "${pkgs.icosystem}/share/icons/icosystem/scalable/apps/github-mark.svg"; - definedAliases = [ "@gh" ]; - }; + + profiles.tdpeuter.search= { + default = "DuckDuckGo"; + force = true; + engines = { + "Bing".metaData.hidden = true; + "eBay".metaData.hidden = true; + "Qwant".metaData.hidden = true; + + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + "GitHub" = { + urls = [{ + template = "https://github.com/search"; + params = [ + { name = "q"; value = "{searchTerms}"; } + { name = "type"; value = "repositories"; } + ]; + }]; + + icon = "${pkgs.icosystem}/share/icons/icosystem/scalable/apps/github-mark.svg"; + definedAliases = [ "@gh" ]; }; }; }; From 2a4e5b5a96023875068c4a6d44f6c1c65fb2cbae Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Mon, 29 Apr 2024 15:05:07 +0200 Subject: [PATCH 168/176] [eid] Add module --- nixos/hosts/Tibo-NixFat/default.nix | 1 + nixos/modules/hardware/default.nix | 1 + nixos/modules/hardware/eid/default.nix | 18 ++++++++++++++++++ nixos/users/tdpeuter/firefox.nix | 5 +++++ 4 files changed, 25 insertions(+) create mode 100644 nixos/modules/hardware/eid/default.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 87186d4..257d51c 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -9,6 +9,7 @@ desktop.sway.enable = true; hardware = { + eid.enable = true; nvidia = { enable = true; model = "Quadro T2000"; diff --git a/nixos/modules/hardware/default.nix b/nixos/modules/hardware/default.nix index f77ad04..2d38b1e 100644 --- a/nixos/modules/hardware/default.nix +++ b/nixos/modules/hardware/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./eid ./nvidia ./yubikey ]; diff --git a/nixos/modules/hardware/eid/default.nix b/nixos/modules/hardware/eid/default.nix new file mode 100644 index 0000000..5249adf --- /dev/null +++ b/nixos/modules/hardware/eid/default.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.hardware.eid; +in { + options.sisyphus.hardware.eid.enable = lib.mkEnableOption "Electronic identity card (eID)"; + + config = lib.mkIf cfg.enable { + services.pcscd = { + enable = true; + plugins = [ pkgs.ccid ]; + }; + + environment.systemPackages = with pkgs; [ + eid-mw + ]; + }; +} diff --git a/nixos/users/tdpeuter/firefox.nix b/nixos/users/tdpeuter/firefox.nix index 962eeab..4c4a88c 100644 --- a/nixos/users/tdpeuter/firefox.nix +++ b/nixos/users/tdpeuter/firefox.nix @@ -20,6 +20,11 @@ in { DisableTelemetry = true; OfferToSaveLogins = false; }; + + # Support smart cards + pkcs11Modules = with pkgs-unstable; [ + eid-mw + ]; }; profiles.tdpeuter.search= { From dbb547273b650b76842b18c4d3bec95c2f9616b5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Fri, 3 May 2024 09:06:43 +0200 Subject: [PATCH 169/176] [foot] Add config --- nixos/users/tdpeuter/dotfiles.nix | 3 + stow/foot/.config/foot/foot.ini | 225 ++++++++++++++++++++++++++++++ 2 files changed, 228 insertions(+) create mode 100644 stow/foot/.config/foot/foot.ini diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index cfce3e7..324f660 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -20,6 +20,9 @@ in { inherit (config.sisyphus.desktop.sway) enable; source = ../../../stow/dunst/.config/dunst; }; + ".config/foot" = { + source = ../../../stow/foot/.config/foot; + }; ".config/fuzzel" = { recursive = true; source = ../../../stow/fuzzel/.config/fuzzel; diff --git a/stow/foot/.config/foot/foot.ini b/stow/foot/.config/foot/foot.ini new file mode 100644 index 0000000..8ab7a49 --- /dev/null +++ b/stow/foot/.config/foot/foot.ini @@ -0,0 +1,225 @@ +# -*- conf -*- + +# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) +term=xterm-256color +# login-shell=no + +# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode +# title=foot +# locked-title=no + +font=letter extended:size=10 +# font-bold=<bold variant of regular font> +# font-italic=<italic variant of regular font> +# font-bold-italic=<bold+italic variant of regular font> +# font-size-adjustment=0.5 +# line-height=<font metrics> +# letter-spacing=0 +# horizontal-letter-offset=0 +# vertical-letter-offset=0 +# underline-offset=<font metrics> +# underline-thickness=<font underline thickness> +# box-drawings-uses-font-glyphs=no +# dpi-aware=no + +# initial-window-size-pixels=700x500 # Or, +# initial-window-size-chars=<COLSxROWS> +# initial-window-mode=windowed +pad=10x10 # optionally append 'center' +# resize-delay-ms=100 + +# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body} + +# bold-text-in-bright=no +# word-delimiters=,│`|:"'()[]{}<> +# selection-target=primary +# workers=<number of logical CPUs> +# utmp-helper=/usr/lib/utempter/utempter # When utmp backend is ‘libutempter’ (Linux) +# utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ‘ulog’ (FreeBSD) + +[environment] +# name=value + +[bell] +urgent=yes +notify=yes +visual=yes +# command= +# command-focused=no + +[scrollback] +# lines=1000 +# multiplier=3.0 +# indicator-position=relative +# indicator-format="" + +[url] +# launch=xdg-open ${url} +# label-letters=sadfjklewcmpgh +# osc8-underline=url-mode +# protocols=http, https, ftp, ftps, file, gemini, gopher +# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[] + +[cursor] +# style=block +# color=<inverse foreground/background> +# blink=no +# beam-thickness=1.5 +# underline-thickness=<font underline thickness> + +[mouse] +# hide-when-typing=no +# alternate-scroll-mode=yes + +[touch] +# long-press-delay=400 + +[colors] +alpha=0.9 +# background=242424 +# foreground=ffffff +flash=b00020 +# flash-alpha=0.5 + +## Normal/regular colors (color palette 0-7) +# regular0=242424 # black +# regular1=f62b5a # red +# regular2=47b413 # green +# regular3=e3c401 # yellow +# regular4=24acd4 # blue +# regular5=f2affd # magenta +# regular6=13c299 # cyan +# regular7=e6e6e6 # white + +## Bright colors (color palette 8-15) +# bright0=616161 # bright black +# bright1=ff4d51 # bright red +# bright2=35d450 # bright green +# bright3=e9e836 # bright yellow +# bright4=5dc5f8 # bright blue +# bright5=feabf2 # bright magenta +# bright6=24dfc4 # bright cyan +# bright7=ffffff # bright white + +## dimmed colors (see foot.ini(5) man page) +# dim0=<not set> +# ... +# dim7=<not-set> + +## The remaining 256-color palette +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> + +## Misc colors +# selection-foreground=<inverse foreground/background> +# selection-background=<inverse foreground/background> +# jump-labels=<regular0> <regular3> # black-on-yellow +# scrollback-indicator=<regular0> <bright4> # black-on-bright-blue +# search-box-no-match=<regular0> <regular1> # black-on-red +# search-box-match=<regular0> <regular3> # black-on-yellow +# urls=<regular3> + +[csd] +preferred=none +# size=26 +# font=<primary font> +# color=<foreground color> +# hide-when-maximized=no +# double-click-to-maximize=yes +# border-width=0 +# border-color=<csd.color> +# button-width=26 +# button-color=<background color> +# button-minimize-color=<regular4> +# button-maximize-color=<regular2> +# button-close-color=<regular1> + +[key-bindings] +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# scrollback-home=none +# scrollback-end=none +# clipboard-copy=Control+Shift+c XF86Copy +# clipboard-paste=Control+Shift+v XF86Paste +# primary-paste=Shift+Insert +# search-start=Control+Shift+r +# font-increase=Control+plus Control+equal Control+KP_Add +# font-decrease=Control+minus Control+KP_Subtract +# font-reset=Control+0 Control+KP_0 +# spawn-terminal=Control+Shift+n +# minimize=none +# maximize=none +# fullscreen=none +# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-selected=[xargs -r firefox] none +# show-urls-launch=Control+Shift+o +# show-urls-copy=none +# show-urls-persistent=none +# prompt-prev=Control+Shift+z +# prompt-next=Control+Shift+x +# unicode-input=Control+Shift+u +# noop=none + +[search-bindings] +# cancel=Control+g Control+c Escape +# commit=Return +# find-prev=Control+r +# find-next=Control+s +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete +# delete-next-word=Mod1+d Control+Delete +# extend-char=Shift+Right +# extend-to-word-boundary=Control+w Control+Shift+Right +# extend-to-next-whitespace=Control+Shift+w +# extend-line-down=Shift+Down +# extend-backward-char=Shift+Left +# extend-backward-to-word-boundary=Control+Shift+Left +# extend-backward-to-next-whitespace=none +# extend-line-up=Shift+Up +# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste +# primary-paste=Shift+Insert +# unicode-input=none +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# scrollback-home=none +# scrollback-end=none + +[url-bindings] +# cancel=Control+g Control+c Control+d Escape +# toggle-url-visible=t + +[text-bindings] +# \x03=Mod4+c # Map Super+c -> Ctrl+c + +[mouse-bindings] +# scrollback-up-mouse=BTN_BACK +# scrollback-down-mouse=BTN_FORWARD +# selection-override-modifiers=Shift +# primary-paste=BTN_MIDDLE +# select-begin=BTN_LEFT +# select-begin-block=Control+BTN_LEFT +# select-extend=BTN_RIGHT +# select-extend-character-wise=Control+BTN_RIGHT +# select-word=BTN_LEFT-2 +# select-word-whitespace=Control+BTN_LEFT-2 +# select-quote = BTN_LEFT-3 +# select-row=BTN_LEFT-4 + +# vim: ft=dosini From 7866033826b031dba309dd689674d4d714df1735 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Sun, 2 Jun 2024 19:34:05 +0200 Subject: [PATCH 170/176] [waybar] fix: Missing icons in bar --- stow/waybar/.config/waybar/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stow/waybar/.config/waybar/style.css b/stow/waybar/.config/waybar/style.css index a922899..ba632e4 100644 --- a/stow/waybar/.config/waybar/style.css +++ b/stow/waybar/.config/waybar/style.css @@ -15,7 +15,7 @@ @define-color accent #00897b; window#waybar { - font-family: font-awesome, letter, monospace; + font-family: letter, "Font Awesome 6 Free", font-awesome, monospace; font-size: 13px; -webkit-font-smoothing: antialiased; transition-property: background-color; From 19affd8b0ee4caec53096b8da6449c806416c097 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Sun, 2 Jun 2024 19:39:13 +0200 Subject: [PATCH 171/176] [waybar] feat: Add privacy module --- stow/waybar/.config/waybar/config | 1 + stow/waybar/.config/waybar/modules.json | 20 +++++++++++++++++++- stow/waybar/.config/waybar/style.css | 7 +++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/stow/waybar/.config/waybar/config b/stow/waybar/.config/waybar/config index 45b047a..f63a896 100644 --- a/stow/waybar/.config/waybar/config +++ b/stow/waybar/.config/waybar/config @@ -32,6 +32,7 @@ "height": 25, "modules-left": ["sway/mode"], "modules-center": ["clock"], + "modules-right": ["privacy"], "include": [ // Import modules (!) diff --git a/stow/waybar/.config/waybar/modules.json b/stow/waybar/.config/waybar/modules.json index 39e2d9e..55820a5 100644 --- a/stow/waybar/.config/waybar/modules.json +++ b/stow/waybar/.config/waybar/modules.json @@ -128,7 +128,25 @@ // "0:¯\\_(ツ)_/¯": [] // } }, - + + "privacy": { + "icon-spacing": 4, + "icon-size": 18, + "transition-duration": 250, + "modules": [ + { + "type": "screenshare", + "tooltip": true, + "tooltip-icon-size": 18, + }, + { + "type": "audio-in", + "tooltip": true, + "tooltip-icon-size": 18, + }, + ], + }, + "pulseaudio": { "format": "{volume}% {icon}{format_source}", "format-muted": "\uf6a9{format_source}", diff --git a/stow/waybar/.config/waybar/style.css b/stow/waybar/.config/waybar/style.css index ba632e4..2604477 100644 --- a/stow/waybar/.config/waybar/style.css +++ b/stow/waybar/.config/waybar/style.css @@ -134,5 +134,12 @@ label:focus { background-color: #eb4d4b; } +#privacy-item.audio-in, +#privacy-item.audio-out, +#privacy-item.screenshare { + background-color: #ffaa01; + color: #2d3436; +} + @import "sharp.css"; From 386d79432bf25873493b25171ec044dd36f660fe Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Sun, 2 Jun 2024 19:51:04 +0200 Subject: [PATCH 172/176] [waybar] fix: Replace mediaplayer with mpris --- stow/waybar/.config/waybar/default.json | 2 +- stow/waybar/.config/waybar/left.json | 21 ++-- stow/waybar/.config/waybar/mediaplayer.py | 131 ---------------------- stow/waybar/.config/waybar/modules.json | 33 +++--- stow/waybar/.config/waybar/style.css | 7 +- 5 files changed, 35 insertions(+), 159 deletions(-) delete mode 100755 stow/waybar/.config/waybar/mediaplayer.py diff --git a/stow/waybar/.config/waybar/default.json b/stow/waybar/.config/waybar/default.json index 7a3f71c..5a0a753 100644 --- a/stow/waybar/.config/waybar/default.json +++ b/stow/waybar/.config/waybar/default.json @@ -1,7 +1,7 @@ { "modules-left": [ "idle_inhibitor", - "custom/media" + "mpris" ], "modules-center": [ "sway/workspaces" diff --git a/stow/waybar/.config/waybar/left.json b/stow/waybar/.config/waybar/left.json index 23b4b5d..9aa5cd7 100644 --- a/stow/waybar/.config/waybar/left.json +++ b/stow/waybar/.config/waybar/left.json @@ -1,21 +1,22 @@ { - "modules-left": [ + "modules-left": [ "sway/workspaces", "idle_inhibitor", "custom/light-dark-toggle", "custom/night-light-toggle", "custom/toggle-notifications", - "custom/media" + "mpris" ], - "modules-right": [ - "memory", - "cpu", - "temperature", + + "modules-right": [ + "memory", + "cpu", + "temperature", "custom/sep", - "bluetooth", - "network", - "pulseaudio", - "battery", + "bluetooth", + "network", + "pulseaudio", + "battery", "custom/sep", "tray" ] diff --git a/stow/waybar/.config/waybar/mediaplayer.py b/stow/waybar/.config/waybar/mediaplayer.py deleted file mode 100755 index d0d8bbb..0000000 --- a/stow/waybar/.config/waybar/mediaplayer.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# From: -# https://github.com/Alexays/Waybar/blob/master/resources/custom_modules/mediaplayer.py - -import argparse -import logging -import sys -import signal -import gi -import json -gi.require_version('Playerctl', '2.0') -from gi.repository import Playerctl, GLib - -logger = logging.getLogger(__name__) - - -def write_output(text, player): - logger.info('Writing output') - - output = {'text': text, - 'class': 'custom-' + player.props.player_name, - 'alt': player.props.player_name} - - sys.stdout.write(json.dumps(output) + '\n') - sys.stdout.flush() - - -def on_play(player, status, manager): - logger.info('Received new playback status') - on_metadata(player, player.props.metadata, manager) - - -def on_metadata(player, metadata, manager): - logger.info('Received new metadata') - track_info = '' - - if player.props.player_name == 'spotify' and \ - 'mpris:trackid' in metadata.keys() and \ - ':ad:' in player.props.metadata['mpris:trackid']: - track_info = 'AD PLAYING' - elif player.get_artist() != '' and player.get_title() != '': - track_info = '{artist} - {title}'.format(artist=player.get_artist(), - title=player.get_title()) - else: - track_info = player.get_title() - - if player.props.status != 'Playing' and track_info: - track_info = ' ' + track_info - write_output(track_info, player) - - -def on_player_appeared(manager, player, selected_player=None): - if player is not None and (selected_player is None or player.name == selected_player): - init_player(manager, player) - else: - logger.debug("New player appeared, but it's not the selected player, skipping") - - -def on_player_vanished(manager, player): - logger.info('Player has vanished') - sys.stdout.write('\n') - sys.stdout.flush() - - -def init_player(manager, name): - logger.debug('Initialize player: {player}'.format(player=name.name)) - player = Playerctl.Player.new_from_name(name) - player.connect('playback-status', on_play, manager) - player.connect('metadata', on_metadata, manager) - manager.manage_player(player) - on_metadata(player, player.props.metadata, manager) - - -def signal_handler(sig, frame): - logger.debug('Received signal to stop, exiting') - sys.stdout.write('\n') - sys.stdout.flush() - # loop.quit() - sys.exit(0) - - -def parse_arguments(): - parser = argparse.ArgumentParser() - - # Increase verbosity with every occurrence of -v - parser.add_argument('-v', '--verbose', action='count', default=0) - - # Define for which player we're listening - parser.add_argument('--player') - - return parser.parse_args() - - -def main(): - arguments = parse_arguments() - - # Initialize logging - logging.basicConfig(stream=sys.stderr, level=logging.DEBUG, - format='%(name)s %(levelname)s %(message)s') - - # Logging is set by default to WARN and higher. - # With every occurrence of -v it's lowered by one - logger.setLevel(max((3 - arguments.verbose) * 10, 0)) - - # Log the sent command line arguments - logger.debug('Arguments received {}'.format(vars(arguments))) - - manager = Playerctl.PlayerManager() - loop = GLib.MainLoop() - - manager.connect('name-appeared', lambda *args: on_player_appeared(*args, arguments.player)) - manager.connect('player-vanished', on_player_vanished) - - signal.signal(signal.SIGINT, signal_handler) - signal.signal(signal.SIGTERM, signal_handler) - signal.signal(signal.SIGPIPE, signal.SIG_DFL) - - for player in manager.props.player_names: - if arguments.player is not None and arguments.player != player.name: - logger.debug('{player} is not the filtered player, skipping it' - .format(player=player.name) - ) - continue - - init_player(manager, player) - - loop.run() - - -if __name__ == '__main__': - main() diff --git a/stow/waybar/.config/waybar/modules.json b/stow/waybar/.config/waybar/modules.json index 55820a5..ebde88c 100644 --- a/stow/waybar/.config/waybar/modules.json +++ b/stow/waybar/.config/waybar/modules.json @@ -47,19 +47,6 @@ "tooltip-format": "Launch an application" }, - "custom/media": { - "escape": true, - "exec": "~/.config/waybar/mediaplayer.py 2> /dev/null", - "format": "{icon} {}", - "format-icons": { - "default": "\uf51f", - "spotify": "\uf1bc" - }, - "max-length": 40, - "on-click": "playerctl play-pause", - "return-type": "json" - }, - "custom/light-dark-toggle": { "on-click": "bash ${SCRIPT_DIR}/toggle-light-dark.sh", "tooltip-format": "Toggle between light and dark mode", @@ -101,6 +88,26 @@ "on-click": "kitty -e zenith" }, + "mpris": { + // "ignored-players": ["firefox"] + "format": "{player_icon} {dynamic}", + "format-paused": "{status_icon} <i>{dynamic}</i>", + "tooltip-format": "{player} ({status}) {title} - {artist} - {album}", + "player-icons": { + "default": "\uf51f", + "spotify": "\uf1bc", + "mpv": "🎵" + }, + "status-icons": { + "paused": "⏸" + }, + "dynamic-order": [ + "title", + "artist" + ], + "dynamic-len": 40, + }, + "network": { "format-disconnected": "\uf127", "format-ethernet": "\uf6ff {ifname}: {ipadds}/{cidr}", diff --git a/stow/waybar/.config/waybar/style.css b/stow/waybar/.config/waybar/style.css index 2604477..47b81d1 100644 --- a/stow/waybar/.config/waybar/style.css +++ b/stow/waybar/.config/waybar/style.css @@ -101,17 +101,16 @@ label:focus { opacity: 0.6; } -#custom-media { +#mpris { color: #2a5c45; - background-color: #66cc99; min-width: 100px; } -#custom-media.custom-spotify { +#mpris.spotify { background-color: #66cc99; } -#custom-media.custom-vlc { +#mpris.vlc { background-color: #ffa000; } From 0fb52ce59e626185349ea18a241966fb7475b8bc Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Sun, 2 Jun 2024 20:49:04 +0200 Subject: [PATCH 173/176] [nixos] Upgrade to 24.05 --- nixos/flake.lock | 46 +++++++++---------- nixos/flake.nix | 4 +- nixos/hosts/Tibo-NixDesk/default.nix | 2 +- nixos/hosts/Tibo-NixFat/default.nix | 13 +++--- .../modules/virtualisation/docker/default.nix | 3 +- .../virtualisation/virtualbox/default.nix | 4 +- nixos/users/tdpeuter/default.nix | 1 - 7 files changed, 38 insertions(+), 35 deletions(-) diff --git a/nixos/flake.lock b/nixos/flake.lock index 9d83527..91147eb 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -8,11 +8,11 @@ ] }, "locked": { - "lastModified": 1711099426, - "narHash": "sha256-HzpgM/wc3aqpnHJJ2oDqPBkNsqWbW0WfWUO8lKu8nGk=", + "lastModified": 1713532798, + "narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=", "owner": "numtide", "repo": "devshell", - "rev": "2d45b54ca4a183f2fdcf4b19c895b64fbf620ee8", + "rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40", "type": "github" }, "original": { @@ -64,16 +64,16 @@ ] }, "locked": { - "lastModified": 1710888565, - "narHash": "sha256-s9Hi4RHhc6yut4EcYD50sZWRDKsugBJHSbON8KFwoTw=", + "lastModified": 1716736833, + "narHash": "sha256-rNObca6dm7Qs524O4st8VJH6pZ/Xe1gxl+Rx6mcWYo0=", "owner": "nix-community", "repo": "home-manager", - "rev": "f33900124c23c4eca5831b9b5eb32ea5894375ce", + "rev": "a631666f5ec18271e86a5cde998cba68c33d9ac6", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-23.11", + "ref": "release-24.05", "repo": "home-manager", "type": "github" } @@ -101,26 +101,26 @@ }, "nixpkgs": { "locked": { - "lastModified": 1711668574, - "narHash": "sha256-u1dfs0ASQIEr1icTVrsKwg2xToIpn7ZXxW3RHfHxshg=", + "lastModified": 1717144377, + "narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "219951b495fc2eac67b1456824cc1ec1fd2ee659", + "rev": "805a384895c696f802a9bf5bf4720f37385df547", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-23.11", + "ref": "nixos-24.05", "type": "indirect" } }, "nixpkgs-stable": { "locked": { - "lastModified": 1711233294, - "narHash": "sha256-eEu5y4J145BYDw9o/YEmeJyqh8blgnZwuz9k234zuWc=", + "lastModified": 1717265169, + "narHash": "sha256-IITcGd6xpNoyq9SZBigCkv4+qMHSqot0RDPR4xsZ2CA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ac6bdf6181666ebb4f90dd20f31e2fa66ede6b68", + "rev": "3b1b4895b2c5f9f5544d02132896aeb9ceea77bc", "type": "github" }, "original": { @@ -132,11 +132,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1711703276, - "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", + "lastModified": 1716948383, + "narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", + "rev": "ad57eef4ef0659193044870c731987a6df5cf56b", "type": "github" }, "original": { @@ -230,11 +230,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1711249319, - "narHash": "sha256-N+Pp3/8H+rd7cO71VNV/ovV/Kwt+XNeUHNhsmyTabdM=", + "lastModified": 1717297459, + "narHash": "sha256-cZC2f68w5UrJ1f+2NWGV9Gx0dEYmxwomWN2B0lx0QRA=", "owner": "Mic92", "repo": "sops-nix", - "rev": "405987a66cce9a4a82f321f11b205982a7127c88", + "rev": "ab2a43b0d21d1d37d4d5726a892f714eaeb4b075", "type": "github" }, "original": { @@ -316,11 +316,11 @@ ] }, "locked": { - "lastModified": 1696331477, - "narHash": "sha256-YkbRa/1wQWdWkVJ01JvV+75KIdM37UErqKgTf0L54Fk=", + "lastModified": 1715533576, + "narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "bfc53579db89de750b25b0c5e7af299e0c06d7d3", + "rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f", "type": "github" }, "original": { diff --git a/nixos/flake.nix b/nixos/flake.nix index 54d6be8..cda9173 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -2,7 +2,7 @@ description = "System configuration of my machines using flakes"; inputs = { - nixpkgs.url = "nixpkgs/nixos-23.11"; + nixpkgs.url = "nixpkgs/nixos-24.05"; nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; devshell = { @@ -11,7 +11,7 @@ }; flake-utils.url = "github:numtide/flake-utils"; home-manager = { - url = "github:nix-community/home-manager/release-23.11"; + url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; }; openconnect-sso = { diff --git a/nixos/hosts/Tibo-NixDesk/default.nix b/nixos/hosts/Tibo-NixDesk/default.nix index e75dc2c..7858bea 100644 --- a/nixos/hosts/Tibo-NixDesk/default.nix +++ b/nixos/hosts/Tibo-NixDesk/default.nix @@ -80,7 +80,7 @@ xkbVariant = "altgr-intl"; }; - system.stateVersion = "23.11"; + system.stateVersion = "24.05"; time.timeZone = "Europe/Brussels"; diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 257d51c..6f0e53c 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -19,7 +19,7 @@ networking = { networkmanager.enable = true; - openconnect-sso.enable = true; + # openconnect-sso.enable = true; }; nix = { @@ -97,16 +97,17 @@ lidSwitchDocked = "ignore"; }; - xserver = { + xserver.xkb = { # Keyboard layout layout = "us"; - xkbVariant = "altgr-intl"; - # Touchpad - libinput.enable = true; + variant = "altgr-intl"; }; + + # Touchpad + libinput.enable = true; }; - system.stateVersion = "23.11"; + system.stateVersion = "24.05"; time.timeZone = "Europe/Brussels"; diff --git a/nixos/modules/virtualisation/docker/default.nix b/nixos/modules/virtualisation/docker/default.nix index 6b90e37..2218ff3 100644 --- a/nixos/modules/virtualisation/docker/default.nix +++ b/nixos/modules/virtualisation/docker/default.nix @@ -8,9 +8,10 @@ in { config = lib.mkIf cfg.enable { virtualisation.docker = { enable = true; - enableNvidia = true; # Because these are made for development purposes and not for servers enableOnBoot = false; }; + + hardware.nvidia-container-toolkit.enable = true; }; } diff --git a/nixos/modules/virtualisation/virtualbox/default.nix b/nixos/modules/virtualisation/virtualbox/default.nix index a746493..1116887 100644 --- a/nixos/modules/virtualisation/virtualbox/default.nix +++ b/nixos/modules/virtualisation/virtualbox/default.nix @@ -25,10 +25,12 @@ in { }; guest = { enable = true; - x11 = true; + clipboard = true; + seamless = true; }; }; + # Define the group users.groups.vboxusers = {}; sisyphus.users.wantedGroups = [ diff --git a/nixos/users/tdpeuter/default.nix b/nixos/users/tdpeuter/default.nix index 52b2886..1e11671 100644 --- a/nixos/users/tdpeuter/default.nix +++ b/nixos/users/tdpeuter/default.nix @@ -76,7 +76,6 @@ in { nsxiv # Lightweight image viewer qalculate-gtk # Calculator spotify - tea # Gitea CLI unzip vifm # File manager zathura # PDF viewer From 24ac842631ae3253697a1ea3eb7aa1583c1b10d5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Sun, 2 Jun 2024 20:50:03 +0200 Subject: [PATCH 174/176] [waybar] feat: Add keyboard-state module --- stow/waybar/.config/waybar/config | 2 +- stow/waybar/.config/waybar/modules.json | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/stow/waybar/.config/waybar/config b/stow/waybar/.config/waybar/config index f63a896..0040220 100644 --- a/stow/waybar/.config/waybar/config +++ b/stow/waybar/.config/waybar/config @@ -30,7 +30,7 @@ "name": "keep", "position": "top", "height": 25, - "modules-left": ["sway/mode"], + "modules-left": ["sway/mode", "keyboard-state"], "modules-center": ["clock"], "modules-right": ["privacy"], diff --git a/stow/waybar/.config/waybar/modules.json b/stow/waybar/.config/waybar/modules.json index ebde88c..0e9cd7f 100644 --- a/stow/waybar/.config/waybar/modules.json +++ b/stow/waybar/.config/waybar/modules.json @@ -83,6 +83,19 @@ "tooltip": false }, + "keyboard-state": { + "format": { + "capslock": "{icon}", + }, + "format-icons": { + "locked": "\uf023", + "unlocked": "" + }, + "numlock": false, + "capslock": true, + "scrollock": false, + }, + "memory": { "format": "{}% \uf1c0", "on-click": "kitty -e zenith" From 0a7a5181ff9126c7d1ff20b2d579402e22693fa3 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Sun, 2 Jun 2024 20:53:09 +0200 Subject: [PATCH 175/176] [waybar] feat: Add groups and power-profiles module --- stow/waybar/.config/waybar/left.json | 13 ++-- stow/waybar/.config/waybar/modules.json | 96 ++++++++++++++++++++++++- stow/waybar/.config/waybar/style.css | 29 ++++++-- 3 files changed, 123 insertions(+), 15 deletions(-) diff --git a/stow/waybar/.config/waybar/left.json b/stow/waybar/.config/waybar/left.json index 9aa5cd7..b267c82 100644 --- a/stow/waybar/.config/waybar/left.json +++ b/stow/waybar/.config/waybar/left.json @@ -1,17 +1,12 @@ { "modules-left": [ "sway/workspaces", - "idle_inhibitor", - "custom/light-dark-toggle", - "custom/night-light-toggle", - "custom/toggle-notifications", - "mpris" + "custom/scratchpad-indicator", + "mpris", + "group/system", ], - "modules-right": [ - "memory", - "cpu", - "temperature", + "group/hardware", "custom/sep", "bluetooth", "network", diff --git a/stow/waybar/.config/waybar/modules.json b/stow/waybar/.config/waybar/modules.json index 0e9cd7f..4edc818 100644 --- a/stow/waybar/.config/waybar/modules.json +++ b/stow/waybar/.config/waybar/modules.json @@ -58,7 +58,52 @@ "on-click": "bash ${SCRIPT_DIR}/sunset.sh", "tooltip-format": "Toggle night-light on or off", "format": "\uf0eb ", - "tooltip": true + "tooltip": true, + "tooltip-format": "Toggle night-light on or off", + }, + + "custom/scratchpad-indicator": { + "interval": 3, + "return-type": "json", + "exec": "swaymsg -t get_tree | jq --unbuffered --compact-output '(recurse(.nodes[]) | select(.name == \"__i3_scratch\") | .focus) as $scratch_ids | [.. | (.nodes? + .floating_nodes?) // empty | .[] | select(.id |IN($scratch_ids[]))] as $scratch_nodes | if ($scratch_nodes|length) > 0 then { text: \"\\($scratch_nodes | length)\", tooltip: $scratch_nodes | map(\"\\(.app_id // .window_properties.class) (\\(.id)): \\(.name)\") | join(\"\\n\") } else empty end'", + "format": "{} \uf2d2", + "on-click": "exec swaymsg 'scratchpad show'", + "on-click-right": "exec swaymsg 'move scratchpad'" + }, + + "custom/system-lock": { + "format": "\uf09c", + "tooltip": true, + "tooltip-format": "Lock device", + "on-click": "swaylock -f" + }, + + "custom/system-sleep": { + "format": "\uf186", + "tooltip": true, + "tooltip-format": "Put device to sleep", + "on-click": "swaylock -f; systemctl suspend" + }, + + "custom/system-hibernate": { + "format": "\uf2dc", + "tooltip": true, + "tooltip-format": "Hibernate device", + "on-click": "swaylock -f; systemctl hibernate" + }, + + "custom/system-reboot": { + "format": "\uf0e2", + "tooltip": true, + "tooltip-format": "Reboot device", + "on-click": "systemctl reboot" + }, + + "custom/system-shutdown": { + "format": "\uf011", + "tooltip": true, + "tooltip-format": "Shutdown device", + "on-click": "systemctl poweroff -i" }, "custom/toggle-notifications": { @@ -70,10 +115,45 @@ "cpu": { "format": "{usage}% \uf2db", - "on-click": "kitty -e htop", + "on-click": "foot -e htop", "tooltip": true }, + "group/hardware": { + "orientation": "inherit", + "modules": [ + "power-profiles-daemon", + "memory", + "cpu", + "temperature", + "custom/system-shutdown", + "custom/system-reboot", + "custom/system-hibernate", + "custom/system-sleep", + "custom/system-lock", + ], + "drawer": { + "transition-duration": 500, + "transition-left-to-right": false, + "children-class": "drawer-child", + }, + }, + + "group/system": { + "orientation": "inherit", + "modules": [ + "idle_inhibitor", + "custom/light-dark-toggle", + "custom/night-light-toggle", + "custom/toggle-notifications", + ], + "drawer": { + "transition-duration": 500, + "tansition-left-to-right": true, + "children-class": "drawer-child", + }, + }, + "idle_inhibitor": { "format": "{icon}", "format-icons": { @@ -149,6 +229,18 @@ // } }, + "power-profiles-daemon": { + "format": "{icon}", + "tooltip-format": "Power profile: {profile}\nDriver: {driver}", + "tooltip": true, + "format-icons": { + "default": "", + "performance": "", + "balanced": "", + "power-saver": "" + } + }, + "privacy": { "icon-spacing": 4, "icon-size": 18, diff --git a/stow/waybar/.config/waybar/style.css b/stow/waybar/.config/waybar/style.css index 47b81d1..f9fe080 100644 --- a/stow/waybar/.config/waybar/style.css +++ b/stow/waybar/.config/waybar/style.css @@ -49,10 +49,31 @@ window#waybar { } /* All modules individually. */ -#backlight, #battery, #bluetooth, #clock, #cpu, -#custom-browser, #custom-media, #custom-light-dark-toggle, #custom-night-light-toggle, #custom-toggle-notifications, -#disk, #idle_inhibitor, #memory, #mode, #mpd, #network, -#pulseaudio, #temperature, #tray { +#backlight, +#battery, +#bluetooth, +#clock, +#cpu, +#custom-browser, +#custom-light-dark-toggle, +#custom-night-light-toggle, +#custom-system-lock, #custom-system-sleep, #custom-system-hibernate, #custom-system-reboot, #custom-system-shutdown, +#custom-toggle-notifications, +#disk, +#group-hardware, +#group-system, +#idle_inhibitor, +#keyboard-state, +#memory, +#mode, +#mpd, +#mpris, +#network, +#power-profiles-daemon, +#privacy-item.audio-in, #privacy-item.audio-out, #privacy-item.screenshare, +#pulseaudio, +#temperature, +#tray { padding: 0 5px; } From 6ef7e0aef840affc1bd0c35165606ec4cd66c0d0 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter <tibo@depeuter.dev> Date: Wed, 19 Jun 2024 12:50:49 +0200 Subject: [PATCH 176/176] [foot] fix: (simple) theme switching --- nixos/users/tdpeuter/dotfiles.nix | 1 + scripts/toggle-light-dark.sh | 54 ++++++++++++++-- stow/foot/.config/foot/foot.ini | 8 ++- .../.config/foot/themes/tdpeuter-dark.ini | 64 +++++++++++++++++++ .../.config/foot/themes/tdpeuter-light.ini | 64 +++++++++++++++++++ stow/sway/.config/sway/input-output | 2 +- 6 files changed, 184 insertions(+), 9 deletions(-) create mode 100644 stow/foot/.config/foot/themes/tdpeuter-dark.ini create mode 100644 stow/foot/.config/foot/themes/tdpeuter-light.ini diff --git a/nixos/users/tdpeuter/dotfiles.nix b/nixos/users/tdpeuter/dotfiles.nix index 324f660..9766b08 100644 --- a/nixos/users/tdpeuter/dotfiles.nix +++ b/nixos/users/tdpeuter/dotfiles.nix @@ -21,6 +21,7 @@ in { source = ../../../stow/dunst/.config/dunst; }; ".config/foot" = { + recursive = true; source = ../../../stow/foot/.config/foot; }; ".config/fuzzel" = { diff --git a/scripts/toggle-light-dark.sh b/scripts/toggle-light-dark.sh index 34be380..ec38506 100755 --- a/scripts/toggle-light-dark.sh +++ b/scripts/toggle-light-dark.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Toggle light- or dark-mode for your applications -# Usage: toggle [-m light|dark] +# Usage: toggle [-m light|dark] [-g] ################# ### Variables ### @@ -10,7 +10,9 @@ THEME_LIGHT='tdpeuter-light' THEME_DARK='tdpeuter-dark' THEME_DEFAULT="${THEME_LIGHT}" -STATE_FILE="${HOME}/.local/state/sisyphus/theme" +STATE_DIR="${HOME}/.local/state/sisyphus" +STATE_FILE="${STATE_DIR}/theme" +BG_DIR="${HOME}/Nextcloud/Afbeeldingen/wallpapers" declare -A theme_next theme_next[${THEME_LIGHT}]="${THEME_DARK}" @@ -20,8 +22,12 @@ declare -A gsettings_alt gsettings_alt[${THEME_LIGHT}]='default' gsettings_alt[${THEME_DARK}]='prefer-dark' +declare -A gtk_theme +gtk_theme[${THEME_LIGHT}]='Adwaita' +gtk_theme[${THEME_DARK}]='Adwaita-dark' + declare -A wallpaper -wallpaper[${THEME_LIGHT}]="bg" +wallpaper[${THEME_LIGHT}]="bg-light" wallpaper[${THEME_DARK}]="bg-dark" ############# @@ -29,7 +35,7 @@ wallpaper[${THEME_DARK}]="bg-dark" ############# # Parse options -while getopts ":m:" option; do +while getopts ":m:g" option; do case "${option}" in m) if [ "${OPTARG}" == 'light' ]; then @@ -41,6 +47,17 @@ while getopts ":m:" option; do exit 1 fi ;; + g) + previous_theme="$(cat ${STATE_FILE})" + if [ "${previous_theme}" == "${THEME_LIGHT}" ]; then + class="activated" + percentage=1 + else + percentage=0 + fi + printf '{ "class": "%s", "percentage": %d }' "${class}" "${percentage}" + exit 0 + ;; *) >&2 printf "Error: Invalid option: '%s'.\n" "${option}" exit 1 @@ -65,9 +82,33 @@ echo "${theme:=${THEME_DEFAULT}}" > "${STATE_FILE}" ### Set all themes ### ###################### -# GNOME +# Update terminal colors by sending it OSC sequences. +# Alternatively, you could use theme.sh (https://github.com/lemnos/theme.sh) +# Function below loosely based on theme.sh and https://codeberg.org/dnkl/foot/issues/708 +function update_terminal_colors() { + for pid in $(pgrep zsh); do + if [ "${theme}" == "${THEME_LIGHT}" ]; then + printf "\033]10;#000000\007" >> /proc/${pid}/fd/0 + printf "\033]11;#ffffff\007" >> /proc/${pid}/fd/0 + elif [ "${theme}" == "${THEME_DARK}" ]; then + printf "\033]10;#ffffff\007" >> /proc/${pid}/fd/0 + printf "\033]11;#000000\007" >> /proc/${pid}/fd/0 + fi + done +} + +# Foot +if [ "$(command -v foot)" ] ; then + # Make color theme switch 'permanent'. + echo "include=~/.config/foot/themes/${theme}.ini" > ~/.config/foot/theme.ini & + # We will have to change the terminal colors ourselves. + update_terminal_colors & +fi + +# GNOME (GTK) if [ "$(command -v gsettings)" ]; then gsettings set org.gnome.desktop.interface color-scheme "${gsettings_alt[${theme}]}" & + gsettings set org.gnome.desktop.interface gtk-theme "${gtk_theme[${theme}]}" & fi # Kitty @@ -77,7 +118,8 @@ fi # Sway if [ "$(command -v swaybg)" ]; then - pkill swaybg && swaybg --mode fill --image ~/Nextcloud/Afbeeldingen/wallpapers/${wallpaper[${theme}]} && swaymsg reload & + bg_path="${BG_DIR}/${wallpaper[${theme}]}" + /run/current-system/sw/bin/cp "${bg_path}" "${STATE_DIR}/bg" && swaymsg reload & fi # Vifm diff --git a/stow/foot/.config/foot/foot.ini b/stow/foot/.config/foot/foot.ini index 8ab7a49..51fdc7e 100644 --- a/stow/foot/.config/foot/foot.ini +++ b/stow/foot/.config/foot/foot.ini @@ -1,4 +1,8 @@ # -*- conf -*- +# ~/.config/foot/foot.ini + +# Include the correct color scheme +include=~/.config/foot/theme.ini # shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) term=xterm-256color @@ -20,7 +24,7 @@ font=letter extended:size=10 # underline-offset=<font metrics> # underline-thickness=<font underline thickness> # box-drawings-uses-font-glyphs=no -# dpi-aware=no +dpi-aware=yes # initial-window-size-pixels=700x500 # Or, # initial-window-size-chars=<COLSxROWS> @@ -75,7 +79,7 @@ visual=yes # long-press-delay=400 [colors] -alpha=0.9 +alpha=0.8 # background=242424 # foreground=ffffff flash=b00020 diff --git a/stow/foot/.config/foot/themes/tdpeuter-dark.ini b/stow/foot/.config/foot/themes/tdpeuter-dark.ini new file mode 100644 index 0000000..4ee35d8 --- /dev/null +++ b/stow/foot/.config/foot/themes/tdpeuter-dark.ini @@ -0,0 +1,64 @@ +[colors] +# alpha=0.8 +background=171717 +foreground=dcdfe4 +# flash=b00020 +# flash-alpha=0.5 + +## Normal/regular colors (color palette 0-7) +regular0=242424 # black +# regular0=21222c +# regular1=f62b5a # red +regular1=c86564 +regular2=47b413 # green +# regular2=b2bc68 +regular3=e3c401 # yellow +# regular3=f7e03f +# regular4=24acd4 # blue +regular4=80a2be +regular5=f2affd # magenta +# color5 #b294bb +# regular6=13c299 # cyan +regular6=8abeb7 +regular7=e6e6e6 # white +# regular7=ffffff + +## Bright colors (color palette 8-15) +# bright0=616161 # bright black +# bright0=6272a4 +# bright1=ff4d51 # bright red +# color9 #C86564 +# bright2=35d450 # bright green +# color10 #B2BC68 +# bright3=e9e836 # bright yellow +# color11 #f7e03f +# bright4=5dc5f8 # bright blue +# color12 #80A2BE +# bright5=feabf2 # bright magenta +# bright5=b294bb +# bright6=24dfc4 # bright cyan +# bright6=8abeb7 +bright7=ffffff # bright white + +## dimmed colors (see foot.ini(5) man page) +# dim0=<not set> +# ... +# dim7=<not-set> + +## The remaining 256-color palette +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> + +## Misc colors +# selection-foreground=<inverse foreground/background> +# selection-foreground=000000 +# selection-background=<inverse foreground/background> +# selection-background=fffacd +# jump-labels=<regular0> <regular3> # black-on-yellow +# scrollback-indicator=<regular0> <bright4> # black-on-bright-blue +# search-box-no-match=<regular0> <regular1> # black-on-red +# search-box-match=<regular0> <regular3> # black-on-yellow +# urls=<regular3> +urls=0087bd + diff --git a/stow/foot/.config/foot/themes/tdpeuter-light.ini b/stow/foot/.config/foot/themes/tdpeuter-light.ini new file mode 100644 index 0000000..daeebb9 --- /dev/null +++ b/stow/foot/.config/foot/themes/tdpeuter-light.ini @@ -0,0 +1,64 @@ +[colors] +# alpha=0.8 +background=fafafa +foreground=000000 +# flash=b00020 +# flash-alpha=0.5 + +## Normal/regular colors (color palette 0-7) +# regular0=242424 # black +# color0 #383A42 +# regular1=f62b5a # red +# color1 #E45649 +# regular2=47b413 # green +# color2 #40A14F +# regular3=e3c401 # yellow +# color3 #C18401 +# regular4=24acd4 # blue +regular4=0184bc +# regular5=f2affd # magenta +# color5 #A626A4 +# regular6=13c299 # cyan +# color6 #0997B3 +# regular7=e6e6e6 # white +# color7 #FAFAFA + +## Bright colors (color palette 8-15) +# bright0=616161 # bright black +# color8 #6272a4 +# bright1=ff4d51 # bright red +# color9 #E45649 +# bright2=35d450 # bright green +# color10 #40A14F +# bright3=e9e836 # bright yellow +# color11 #C18401 +# bright4=5dc5f8 # bright blue +# color12 #0184BC +# bright5=feabf2 # bright magenta +# color13 #A626A4 +# bright6=24dfc4 # bright cyan +# color14 #0997B3 +# bright7=ffffff # bright white +# color15 #FAFAFA + +## dimmed colors (see foot.ini(5) man page) +# dim0=<not set> +# ... +# dim7=<not-set> + +## The remaining 256-color palette +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> + +## Misc colors +# selection-foreground=<inverse foreground/background> +selection-foreground=383a42 +# selection-background=<inverse foreground/background> +selection-background=bfceff +# jump-labels=<regular0> <regular3> # black-on-yellow +# scrollback-indicator=<regular0> <bright4> # black-on-bright-blue +# search-box-no-match=<regular0> <regular1> # black-on-red +# search-box-match=<regular0> <regular3> # black-on-yellow +urls=f0f0f0 + diff --git a/stow/sway/.config/sway/input-output b/stow/sway/.config/sway/input-output index c336c59..9c23892 100644 --- a/stow/sway/.config/sway/input-output +++ b/stow/sway/.config/sway/input-output @@ -11,7 +11,7 @@ input type:touchpad { } output * { - bg "~/Nextcloud/Afbeeldingen/wallpapers/bg" fill + bg "${HOME}/.local/state/sisyphus/bg" fill } # Vertical display