From 5123cb93a989e2ef12c757e60fd5f6dd20c213bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 22 Oct 2023 17:09:13 +0200 Subject: [PATCH 001/108] Quick commit 2023-10-22T17:09:13+02:00 --- config/nix/.gitignore | 2 ++ config/nix/build.sh | 4 +++ config/nix/configuration.nix | 53 ++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 config/nix/.gitignore create mode 100755 config/nix/build.sh create mode 100644 config/nix/configuration.nix diff --git a/config/nix/.gitignore b/config/nix/.gitignore new file mode 100644 index 0000000..ee0c388 --- /dev/null +++ b/config/nix/.gitignore @@ -0,0 +1,2 @@ +*.qcow2 +result diff --git a/config/nix/build.sh b/config/nix/build.sh new file mode 100755 index 0000000..6b8c518 --- /dev/null +++ b/config/nix/build.sh @@ -0,0 +1,4 @@ +#/usr/bin/env sh +nix-build '' -A vm \ +-I nixpkgs=channel:nixos-23.05 \ +-I nixos-config=./configuration.nix diff --git a/config/nix/configuration.nix b/config/nix/configuration.nix new file mode 100644 index 0000000..df61a89 --- /dev/null +++ b/config/nix/configuration.nix @@ -0,0 +1,53 @@ +{ config, pkgs, ... }: +{ + boot.loader.grub.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "nixos"; + networking.wireless.enable = true; # Enable wireless support via wpa_supplicant + + time.timeZone = "Europe/Amsterdam"; + + # TODO qwerty-fr for console + + # Enable the X11 windowing system + services.xserver.enable = true; + + # TODO qwerty-fr for X11 + + # Enable CUPS to print documents + services.printing.enable = true; + + # Enable sound + sound.enable = true; + hardware.pulseaudio.enable = true; + + # services.xserver.displayManager.gdm.enable = true; + services.xserver.windowManager.i3.enable = true; + + # Users + users.users.geoffrey = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + firefox + tree + lolcat + ]; + initialPassword = "cartable"; + }; + + environment.systemPackages = with pkgs; [ + neovim + wget + ]; + + # Enable the OpenSSH daemon + services.openssh.enable = true; + + # TEST + system.copySystemConfiguration = true; + + # Use defaults from + system.stateVersion = "23.05"; +} From 0aed9118753546f42a3e9a27873ca45e852ad287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 22 Oct 2023 18:40:02 +0200 Subject: [PATCH 002/108] nix: Common bases --- config/automatrop/roles/access/tasks/main.yml | 22 -- .../automatrop/roles/software/tasks/main.yml | 196 ------------------ .../software/templates/package_manager.j2 | 10 - .../snippets/pm_dotfiles_dependencies.j2 | 23 -- .../snippets/pm_terminal_essentials.j2 | 24 --- config/nix/build.sh | 1 + config/nix/configuration.nix | 80 ++++++- 7 files changed, 76 insertions(+), 280 deletions(-) delete mode 100644 config/automatrop/roles/access/tasks/main.yml delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dotfiles_dependencies.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_terminal_essentials.j2 diff --git a/config/automatrop/roles/access/tasks/main.yml b/config/automatrop/roles/access/tasks/main.yml deleted file mode 100644 index d6ab777..0000000 --- a/config/automatrop/roles/access/tasks/main.yml +++ /dev/null @@ -1,22 +0,0 @@ -- name: Set variables - set_fact: - manjaro: "{{ ansible_lsb.id == 'Manjaro' or ansible_lsb.id == 'Manjaro-ARM' }}" - -- name: Enable passwordless sudo access to wheel group (Others) - lineinfile: - path: /etc/sudoers - line: "%wheel ALL=(ALL) NOPASSWD: ALL" - regexp: "^#? *%wheel ALL=\\(ALL\\) NOPASSWD: ALL$" - become: yes - when: not manjaro - -- name: Enable passwordless sudo access to wheel group (Manjaro) - copy: - content: "%wheel ALL=(ALL) NOPASSWD: ALL" - dest: /etc/sudoers.d/11-wheel-nopasswd - mode: "u=rwx,g=rx,o=" - when: manjaro - become: yes -# /etc/sudoers.d/10-installer is the same thing, -# but **with** a password, and it's overwritten -# with each upgrade of manjaro-system, hence this. diff --git a/config/automatrop/roles/software/tasks/main.yml b/config/automatrop/roles/software/tasks/main.yml index 9ef01ef..61403e9 100644 --- a/config/automatrop/roles/software/tasks/main.yml +++ b/config/automatrop/roles/software/tasks/main.yml @@ -1,200 +1,4 @@ -# TODO Install python if not done -# Or maybe not, it requires a lot of automation for something that can be done -# very quickly manually and is usually already installed - -- name: Install python-apt dependency for Termux - block: - # TODO Check if the correct version - - name: Check for DistUtilsExtra (Termux) - command: python -c 'import DistUtilsExtra' - changed_when: False - rescue: - - name: Create temporarty folder for DistUtilsExtra (Termux) - tempfile: - state: directory - suffix: python-distutils-extra - # path: /data/data/com.termux/files/usr/tmp/ - register: pde_tempdir - - - name: Download DistUtilsExtra (Termux) - get_url: - url: "https://launchpad.net/python-distutils-extra/trunk/{{ version }}/+download/python-distutils-extra-{{ version }}.tar.gz" - dest: "{{ pde_tempdir.path }}/python-distutils-extra.tar.gz" - - - name: Extract DistUtilsExtra (Termux) - unarchive: - src: "{{ pde_tempdir.path }}/python-distutils-extra.tar.gz" - remote_src: yes - dest: "{{ pde_tempdir.path }}" - - - name: Install DistUtilsExtra (Termux) - command: - cmd: python3 setup.py install - chdir: "{{ pde_tempdir.path }}/python-distutils-extra-{{ version }}" - when: termux - vars: - version: 2.39 - -- name: Install python-apt (Termux) - pip: - name: python-apt - when: termux - -# Collecting python-apt -# Using cached python-apt-0.7.8.tar.bz2 (49 kB) -# ERROR: Command errored out with exit status 1: -# command: /data/data/com.termux/files/usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-install-dsga__i7/python-apt/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-install-dsga__i7/python-apt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-ptpprl0m -# cwd: /data/data/com.termux/files/usr/tmp/pip-install-dsga__i7/python-apt/ -# Complete output (5 lines): -# Traceback (most recent call last): -# File "", line 1, in -# File "/data/data/com.termux/files/usr/tmp/pip-install-dsga__i7/python-apt/setup.py", line 11, in -# string.split(parse_makefile("python/makefile")["APT_PKG_SRC"])) -# AttributeError: module 'string' has no attribute 'split' -# ---------------------------------------- -# ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. -# WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available. -# You should consider upgrading via the '/data/data/com.termux/files/usr/bin/python3 -m pip install --upgrade pip' command. - -# Arch configuration - -# TODO Patch sudo-fake so it allows using -u so `become` works - -- name: Enable multilib repo - lineinfile: - path: /etc/pacman.conf - regexp: '^#?\s*\[multilib\]$' - line: '[multilib]' - become: yes - when: arch_based and ansible_architecture == "x86_64" - notify: udpate pacman cache - -- name: Configure multilib repo - lineinfile: - path: /etc/pacman.conf - regexp: '^#?\s*Include\s*=\s*/etc/pacman.d/mirrorlist' - line: 'Include = /etc/pacman.d/mirrorlist' - insertafter: '^\[multilib\]$' - become: yes - when: arch_based and ansible_architecture == "x86_64" - notify: udpate pacman cache - -- name: Update cache if needed - meta: flush_handlers - -- name: Install ccache - pacman: - name: ccache - state: present - extra_args: "--asdeps" - become: yes - when: arch_based - -- name: Enable makepkg color - replace: - path: /etc/makepkg.conf - regexp: '^BUILDENV=(.+)!color(.+)$' - replace: 'BUILDENV=\1color\2' - become: yes - when: arch_based - -- name: Enable makepkg ccache - replace: - path: /etc/makepkg.conf - regexp: '^BUILDENV=(.+)!ccache(.+)$' - replace: 'BUILDENV=\1ccache\2' - become: yes - when: arch_based - -- name: Remove -mtune from makepkg CFLAGS - replace: - path: /etc/makepkg.conf - regexp: '^#? *CFLAGS=(.+)-mtune=\S+\s(.*)$' - replace: "CFLAGS=\\1\\2" - become: yes - when: arch_based - -- name: Change -march to native from makepkg CFLAGS - replace: - path: /etc/makepkg.conf - regexp: '^#? *CFLAGS=(.+)-march=\S+(\s)(.*)$' - replace: "CFLAGS=\\1-march=native\\2\\3" - become: yes - when: arch_based - -- name: Set makepkg MAKEFLAGS - replace: - path: /etc/makepkg.conf - regexp: '^#? *MAKEFLAGS=(.+)-j[0-9]+(.+)$' - replace: "MAKEFLAGS=\\1-j{{ j }}\\2" - become: yes - vars: - j: "{{ [ansible_processor_nproc - 1, 1] | max | int }}" - when: arch_based - -- name: Enable pacman ParallelDownloads - lineinfile: - path: /etc/pacman.conf - regexp: '^#?ParallelDownloads' - line: 'ParallelDownloads = 5' - insertafter: '^\[options\]$' - become: yes - when: arch_based - -- name: Enable pacman colors - lineinfile: - path: /etc/pacman.conf - regexp: '^#?Color' - line: 'Color' - insertafter: '^\[options\]$' - become: yes - when: arch_based - -- name: Enable pacman pac-man - lineinfile: - path: /etc/pacman.conf - regexp: '^#?ILoveCandy' - line: 'ILoveCandy' - insertafter: '^#?Color' - become: yes - when: arch_based - - -# Install alternative package managers -- name: List packages from base-devel - command: pacman -Sqg base-devel - register: base_devel_packages - changed_when: no - check_mode: no - -- name: Install dependencies for AUR helpers - pacman: - name: "{{ (base_devel_packages.stdout | split('\n') | reject('eq', 'sudo')) + ['fakeroot'] }}" - become: yes - when: arch_based -# Do not install sudo because maybe sudo-fake is installed (otherwise it conflicts) -# It should already be installed already anyway - -- name: Install AUR package manager (Arch) - aur: - name: yay-bin - when: arch - -- name: Install AUR package manager (Manjaro) - pacman: - name: yay - become: yes - when: manjaro -# Not sure if regular Manjaro has yay in its community packages, -# but Manjaro-ARM sure does - -- name: Create cache folder - file: - state: directory - mode: "u=rwx,g=rx,o=rx" - path: "{{ ansible_user_dir }}/.cache/automatrop" - - name: Generate list of packages for package manager set_fact: packages: "{{ query('template', 'package_manager.j2')[0].split('\n')[:-1]|sort|unique }}" diff --git a/config/automatrop/roles/software/templates/package_manager.j2 b/config/automatrop/roles/software/templates/package_manager.j2 index f8305b4..7f4a943 100644 --- a/config/automatrop/roles/software/templates/package_manager.j2 +++ b/config/automatrop/roles/software/templates/package_manager.j2 @@ -1,15 +1,5 @@ {# Macros #} -{% if debian_based %} -{% set python_prefix = 'python3' %} -{% set lib_suffix = '-common' %} -{% else %} -{% set python_prefix = 'python' %} -{% set lib_suffix = '' %} -{% endif %} {# Include essential snippets #} -{% include 'snippets/pm_dotfiles_dependencies.j2' %} -{% include 'snippets/pm_shell.j2' %} -{% include 'snippets/pm_terminal_essentials.j2' %} {% include 'snippets/pm_remote.j2' %} {% include 'snippets/pm_disk_cleanup.j2' %} {% include 'snippets/pm_local_monitoring.j2' %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dotfiles_dependencies.j2 b/config/automatrop/roles/software/templates/snippets/pm_dotfiles_dependencies.j2 deleted file mode 100644 index 87d4545..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dotfiles_dependencies.j2 +++ /dev/null @@ -1,23 +0,0 @@ -{# -Stuff that is required for scripts/programs of dotfiles to work properly -#} -coreutils -bash -grep -sed -tar -openssl -git -wget -curl -{% if not termux %} -{{ python_prefix }}-pip -{# Termux already has pip via Python #} -{% endif %} -ansible -{# Uncompressors #} -unzip -unrar -p7zip -{{ python_prefix }}-pystache -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_terminal_essentials.j2 b/config/automatrop/roles/software/templates/snippets/pm_terminal_essentials.j2 deleted file mode 100644 index 69a99cd..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_terminal_essentials.j2 +++ /dev/null @@ -1,24 +0,0 @@ -moreutils -man -visidata -{% if can_chown or not arch_based %} -insect -{% endif %} -translate-shell -gnupg -{# Editor #} -{% if termux %} -nvim -{% else %} -neovim -{% endif %} -{% if not termux %} -{{ python_prefix }}-neovim -{% endif %} -{# Downloaders #} -wget -{# Uncompressors #} -unzip -unrar -p7zip -{# EOF #} diff --git a/config/nix/build.sh b/config/nix/build.sh index 6b8c518..2e3ac4d 100755 --- a/config/nix/build.sh +++ b/config/nix/build.sh @@ -1,4 +1,5 @@ #/usr/bin/env sh +export NIXPKGS_ALLOW_UNFREE=1 nix-build '' -A vm \ -I nixpkgs=channel:nixos-23.05 \ -I nixos-config=./configuration.nix diff --git a/config/nix/configuration.nix b/config/nix/configuration.nix index df61a89..f44aeec 100644 --- a/config/nix/configuration.nix +++ b/config/nix/configuration.nix @@ -13,7 +13,7 @@ # Enable the X11 windowing system services.xserver.enable = true; - # TODO qwerty-fr for X11 + # FIXME qwerty-fr for X11 # Enable CUPS to print documents services.printing.enable = true; @@ -22,19 +22,63 @@ sound.enable = true; hardware.pulseaudio.enable = true; - # services.xserver.displayManager.gdm.enable = true; + services.xserver.displayManager.startx.enable = true; services.xserver.windowManager.i3.enable = true; + # Enable passwordless sudo + security.sudo.extraRules = [ + { groups = ["wheel"]; commands = [ { command = "ALL"; options = ["NOPASSWD"]; } ]; } + ]; + # Users users.users.geoffrey = { isNormalUser = true; extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. packages = with pkgs; [ + # dotfiles dependencies + coreutils + bash + gnugrep + gnused + gnutar + openssl + git + wget + curl + python3Packages.pip + ansible # TODO Reevaluate + + # shell + zsh-completions + nix-zsh-completions + zsh-history-substring-search + antigen # TODO Reevaluate + powerline-go + + # terminal essentials + moreutils + man + visidata + nodePackages.insect + translate-shell + unzip + unrar + p7zip + + # remote + openssh + rsync + tigervnc # FIXME Only with display server + + # DEBUG firefox tree lolcat ]; - initialPassword = "cartable"; + initialPassword = "cartable"; # DEBUG + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE41gxrO8oZ5n3saapSwZDViOQphm6RzqgsBUyA88pU geoffrey@frogeye.fr" + ]; }; environment.systemPackages = with pkgs; [ @@ -42,8 +86,34 @@ wget ]; - # Enable the OpenSSH daemon - services.openssh.enable = true; + # Enable compilation cache + programs = { + ccache.enable = true; + # TODO Not enough, see https://nixos.wiki/wiki/CCache. + # Might want to see if it's worth using on NixOS + gnupg.agent.enable = true; + + # TODO Below should be user config + + zsh = { + enable = true; + autosuggestions.enable = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + }; + neovim = { + enable = true; + defaultEditor = true; + vimAlias = true; + viAlias = true; + }; + }; + + services = { + # Enable the OpenSSH daemon + openssh.enable = true; + getty.autologinUser = "geoffrey"; # DEBUG + }; # TEST system.copySystemConfiguration = true; From 96a11d9975a5b518f88ec0a5f0ee342a0afe81a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 22 Oct 2023 19:54:59 +0200 Subject: [PATCH 003/108] nix: Modules system --- config/nix/configuration.nix | 130 +++------------------------------- config/nix/modules/common.nix | 112 +++++++++++++++++++++++++++++ config/nix/modules/x11.nix | 22 ++++++ config/nix/recursiveMerge.nix | 23 ++++++ 4 files changed, 165 insertions(+), 122 deletions(-) create mode 100644 config/nix/modules/common.nix create mode 100644 config/nix/modules/x11.nix create mode 100644 config/nix/recursiveMerge.nix diff --git a/config/nix/configuration.nix b/config/nix/configuration.nix index f44aeec..2c067b8 100644 --- a/config/nix/configuration.nix +++ b/config/nix/configuration.nix @@ -1,123 +1,9 @@ { config, pkgs, ... }: -{ - boot.loader.grub.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "nixos"; - networking.wireless.enable = true; # Enable wireless support via wpa_supplicant - - time.timeZone = "Europe/Amsterdam"; - - # TODO qwerty-fr for console - - # Enable the X11 windowing system - services.xserver.enable = true; - - # FIXME qwerty-fr for X11 - - # Enable CUPS to print documents - services.printing.enable = true; - - # Enable sound - sound.enable = true; - hardware.pulseaudio.enable = true; - - services.xserver.displayManager.startx.enable = true; - services.xserver.windowManager.i3.enable = true; - - # Enable passwordless sudo - security.sudo.extraRules = [ - { groups = ["wheel"]; commands = [ { command = "ALL"; options = ["NOPASSWD"]; } ]; } - ]; - - # Users - users.users.geoffrey = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - # dotfiles dependencies - coreutils - bash - gnugrep - gnused - gnutar - openssl - git - wget - curl - python3Packages.pip - ansible # TODO Reevaluate - - # shell - zsh-completions - nix-zsh-completions - zsh-history-substring-search - antigen # TODO Reevaluate - powerline-go - - # terminal essentials - moreutils - man - visidata - nodePackages.insect - translate-shell - unzip - unrar - p7zip - - # remote - openssh - rsync - tigervnc # FIXME Only with display server - - # DEBUG - firefox - tree - lolcat - ]; - initialPassword = "cartable"; # DEBUG - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE41gxrO8oZ5n3saapSwZDViOQphm6RzqgsBUyA88pU geoffrey@frogeye.fr" - ]; - }; - - environment.systemPackages = with pkgs; [ - neovim - wget - ]; - - # Enable compilation cache - programs = { - ccache.enable = true; - # TODO Not enough, see https://nixos.wiki/wiki/CCache. - # Might want to see if it's worth using on NixOS - gnupg.agent.enable = true; - - # TODO Below should be user config - - zsh = { - enable = true; - autosuggestions.enable = true; - enableCompletion = true; - syntaxHighlighting.enable = true; - }; - neovim = { - enable = true; - defaultEditor = true; - vimAlias = true; - viAlias = true; - }; - }; - - services = { - # Enable the OpenSSH daemon - openssh.enable = true; - getty.autologinUser = "geoffrey"; # DEBUG - }; - - # TEST - system.copySystemConfiguration = true; - - # Use defaults from - system.stateVersion = "23.05"; -} +let + recursiveMerge = import ./recursiveMerge.nix; + getModule = name: import (./modules + "/${name}.nix") { inherit config pkgs; }; +in +recursiveMerge [ + (getModule "common") + (getModule "x11") +] diff --git a/config/nix/modules/common.nix b/config/nix/modules/common.nix new file mode 100644 index 0000000..e71861c --- /dev/null +++ b/config/nix/modules/common.nix @@ -0,0 +1,112 @@ +{ pkgs, ... }: +{ + boot.loader.grub.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "nixos"; + networking.wireless.enable = true; # Enable wireless support via wpa_supplicant + + time.timeZone = "Europe/Amsterdam"; + + # TODO qwerty-fr for console + + # Enable CUPS to print documents + services.printing.enable = true; + + # Enable passwordless sudo + security.sudo.extraRules = [{ + groups = [ "wheel" ]; + commands = [{ + command = "ALL"; + options = [ "NOPASSWD" ]; + }]; + }]; + + # Users + users.users.geoffrey = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + # dotfiles dependencies + coreutils + bash + gnugrep + gnused + gnutar + openssl + git + wget + curl + python3Packages.pip + ansible # TODO Reevaluate + + # shell + zsh-completions + nix-zsh-completions + zsh-history-substring-search + antigen # TODO Reevaluate + powerline-go + + # terminal essentials + moreutils + man + visidata + nodePackages.insect + translate-shell + unzip + unrar + p7zip + + # remote + openssh + rsync + + # DEBUG + tree + lolcat + + ]; + initialPassword = "cartable"; # DEBUG + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE41gxrO8oZ5n3saapSwZDViOQphm6RzqgsBUyA88pU geoffrey@frogeye.fr" + ]; + }; + + environment.systemPackages = with pkgs; [ neovim wget ]; + + # Enable compilation cache + programs = { + ccache.enable = true; + # TODO Not enough, see https://nixos.wiki/wiki/CCache. + # Might want to see if it's worth using on NixOS + gnupg.agent.enable = true; + + # TODO Below should be user config + + zsh = { + enable = true; + autosuggestions.enable = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + }; + neovim = { + enable = true; + defaultEditor = true; + vimAlias = true; + viAlias = true; + }; + }; + + services = { + # Enable the OpenSSH daemon + openssh.enable = true; + getty.autologinUser = "geoffrey"; # DEBUG + }; + + # TEST + system.copySystemConfiguration = true; + + # Use defaults from + system.stateVersion = "23.05"; + +} diff --git a/config/nix/modules/x11.nix b/config/nix/modules/x11.nix new file mode 100644 index 0000000..5bde7b1 --- /dev/null +++ b/config/nix/modules/x11.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + # Enable the X11 windowing system + services.xserver.enable = true; + + # FIXME qwerty-fr for X11 + + # Enable sound + sound.enable = true; + hardware.pulseaudio.enable = true; + + services.xserver.displayManager.startx.enable = true; + services.xserver.windowManager.i3.enable = true; + + users.users.geoffrey. packages = with pkgs; [ + # remote + tigervnc + + # remote + firefox + ]; +} diff --git a/config/nix/recursiveMerge.nix b/config/nix/recursiveMerge.nix new file mode 100644 index 0000000..6c3d87d --- /dev/null +++ b/config/nix/recursiveMerge.nix @@ -0,0 +1,23 @@ +let + + pkgs = import { }; + # Somehow, if fed the pkgs from a nix-build, it creates an infinite recursion, hence the search path + lib = pkgs.lib; + + recursiveMerge = with lib; attrList: + let f = attrPath: + zipAttrsWith (n: values: + if tail values == [ ] + then head values + else if all isList values + then unique (concatLists values) + else if all isAttrs values + then f (attrPath ++ [ n ]) values + else last values + ); + in f [ ] attrList; + + +in + +recursiveMerge From 3af998440f7b4bc2b8744a4626254e1a64e8853c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 22 Oct 2023 22:27:58 +0200 Subject: [PATCH 004/108] nix: Add more packages --- .../software/templates/package_manager.j2 | 20 ----- .../templates/snippets/pm_data_management.j2 | 12 --- .../snippets/pm_desktop_environment.j2 | 71 ---------------- .../templates/snippets/pm_disk_cleanup.j2 | 13 --- .../templates/snippets/pm_local_monitoring.j2 | 24 ------ .../software/templates/snippets/pm_mpd.j2 | 9 -- .../snippets/pm_multimedia_common.j2 | 13 --- .../snippets/pm_multimedia_toolbox.j2 | 4 - .../templates/snippets/pm_noandroid.j2 | 30 ------- .../software/templates/snippets/pm_remote.j2 | 6 -- .../software/templates/snippets/pm_system.j2 | 16 ---- .../software/templates/snippets/pm_termux.j2 | 9 -- config/nix/configuration.nix | 6 +- config/nix/modules/battery.nix | 7 ++ config/nix/modules/common.nix | 51 +++++++++++- config/nix/modules/desktop.nix | 82 +++++++++++++++++++ config/nix/modules/wireless.nix | 4 + config/nix/modules/x11.nix | 22 ----- 18 files changed, 142 insertions(+), 257 deletions(-) delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_data_management.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_mpd.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_remote.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_system.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_termux.j2 create mode 100644 config/nix/modules/battery.nix create mode 100644 config/nix/modules/desktop.nix create mode 100644 config/nix/modules/wireless.nix delete mode 100644 config/nix/modules/x11.nix diff --git a/config/automatrop/roles/software/templates/package_manager.j2 b/config/automatrop/roles/software/templates/package_manager.j2 index 7f4a943..3a10339 100644 --- a/config/automatrop/roles/software/templates/package_manager.j2 +++ b/config/automatrop/roles/software/templates/package_manager.j2 @@ -1,24 +1,4 @@ -{# Macros #} -{# Include essential snippets #} -{% include 'snippets/pm_remote.j2' %} -{% include 'snippets/pm_disk_cleanup.j2' %} -{% include 'snippets/pm_local_monitoring.j2' %} -{% include 'snippets/pm_mpd.j2' %} -{% include 'snippets/pm_multimedia_toolbox.j2' %} -{% include 'snippets/pm_multimedia_common.j2' %} -{% include 'snippets/pm_data_management.j2' %} {# Include rules-determined snippets #} -{% if root_access %} -{% include 'snippets/pm_system.j2' %} -{% endif %} -{% if display_server %} -{% include 'snippets/pm_desktop_environment.j2' %} -{% endif %} -{% if termux %} -{% include 'snippets/pm_termux.j2' %} -{% else %} -{% include 'snippets/pm_noandroid.j2' %} -{% endif %} {% if software_full %} {% include 'snippets/pm_android_tools.j2' %} {% include 'snippets/pm_multimedia_editors.j2' %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_data_management.j2 b/config/automatrop/roles/software/templates/snippets/pm_data_management.j2 deleted file mode 100644 index d6c2768..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_data_management.j2 +++ /dev/null @@ -1,12 +0,0 @@ -{# -Stuff to synchronize/backup data -#} -rsync -borg -syncthing -{% if arch_based %} -{% if ansible_architecture == 'x86_64' and can_chown %} -freefilesync-bin -{# Not worth the compilation if you can't have the binaries #} -{% endif %} -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 b/config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 deleted file mode 100644 index f042a59..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 +++ /dev/null @@ -1,71 +0,0 @@ -{# Essential #} -firefox -qutebrowser -{# Sound #} -pulseaudio -pacmixer -{% if arch_based %} -ttf-dejavu -ttf-twemoji -{% endif %} -{% if arch_based %} -xkb-qwerty-fr -{% endif %} -thunar -gedit -feh -zathura -zbar -{% if arch_based %} -zathura-pdf-mupdf -{% elif debian_based %} -zathura-pdf-poppler -{% endif %} -meld -{{ python_prefix }}-magic -{% if arch_based %} -yubikey-touch-detector -{% endif %} -{% if display_server == "x11" %} -i3-wm -libgnomekbd{{ lib_suffix }} -dunst -i3lock -numlockx -rofi -{% if arch_based %} -rofimoji -{% endif %} -rxvt-unicode -{% if arch_based %} -urxvt-resize-font-git -alacritty -{% endif %} -scrot -simplescreenrecorder -trayer -unclutter -{% if arch_based %} -xautolock -{% endif %} -xclip -{% if arch_based %} -lemonbar-xft-git -wireless_tools -{% else %} -lemonbar -{% endif %} -{# lemonbar dependency #} -notmuch -autorandr -keynav -sct -xorg-xinit -{% if arch_based %} -xorg-xbacklight -{% elif debian_based %} -xbacklight -{% endif %} -{% elif display_server == "wayland" %} -sway -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 b/config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 deleted file mode 100644 index 24361ff..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 +++ /dev/null @@ -1,13 +0,0 @@ -{# -Program that essentially help you reduce disk usage -#} -jdupes -duperemove -optipng -{% if debian_based %} -libjpeg-turbo-progs -{% else %} -libjpeg-turbo -{% endif %} -reflac -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 b/config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 deleted file mode 100644 index 236557e..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 +++ /dev/null @@ -1,24 +0,0 @@ -{# -Shell utilities to see what's going on on the system -#} -htop -{% if root_access %} -iotop -iftop -{% endif %} -ncdu -{% if not termux %} -lsof -{% endif %} -strace -pv -progress -{% if not termux %} -speedtest-cli -{% endif %} -{% if arch_based %} -pacman-contrib -{% endif %} -{% if has_battery %} -powertop -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_mpd.j2 b/config/automatrop/roles/software/templates/snippets/pm_mpd.j2 deleted file mode 100644 index f5744ea..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_mpd.j2 +++ /dev/null @@ -1,9 +0,0 @@ -{# -To play music with Music Player Daemon -#} -mpd -mpc -{% if arch_based %} -ashuffle-git -vimpc-git -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 b/config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 deleted file mode 100644 index 92cedd3..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 +++ /dev/null @@ -1,13 +0,0 @@ -{% if display_server %} -gimp -inkscape -mpv -{% if arch_based %} -mpv-thumbnail-script -{% endif %} -{% if arch_based %} -libreoffice-fresh -{% elif debian_based %} -libreoffice -{% endif %} -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 b/config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 deleted file mode 100644 index 9b8ba1b..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 +++ /dev/null @@ -1,4 +0,0 @@ -ffmpeg -sox -imagemagick -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 b/config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 deleted file mode 100644 index 251d823..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 +++ /dev/null @@ -1,30 +0,0 @@ -{# -Stuff that isn't required on Android because there are apps for that -#} -{# Password handling #} -pass -pwgen -{% if display_server %} -rofi-pass -{# TODO Try autopass.cr #} -{% endif %} -{# Mail #} -isync -msmtp -notmuch -neomutt -lynx -{% if not arch_based %} -{# https://aur.archlinux.org/packages/tiv/#comment-812593 #} -tiv -{% endif %} -{% if display_server %} -thunderbird -{% endif %} -{# Organisation #} -vdirsyncer -khard -khal -todoman -syncthing -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_remote.j2 b/config/automatrop/roles/software/templates/snippets/pm_remote.j2 deleted file mode 100644 index c3bded8..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_remote.j2 +++ /dev/null @@ -1,6 +0,0 @@ -openssh -wget -rsync -{% if display_server %} -tigervnc -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_system.j2 b/config/automatrop/roles/software/templates/snippets/pm_system.j2 deleted file mode 100644 index 726dbec..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_system.j2 +++ /dev/null @@ -1,16 +0,0 @@ -etckeeper -{% if has_battery %} -tlp -{% endif %} -dhcpcd -wpa_supplicant -chrony -{% if encrypt_home_stacked_fs %} -ecryptfs-utils -{% endif %} -kexec-tools -openvpn -{% if arch_based %} -openvpn-update-resolv-conf-git -{# TODO Other distributions #} -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_termux.j2 b/config/automatrop/roles/software/templates/snippets/pm_termux.j2 deleted file mode 100644 index 8cc9822..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_termux.j2 +++ /dev/null @@ -1,9 +0,0 @@ -{# -Stuff that only makes sense on Termux -#} -{% if termux %} -{% if root_access %} -tsu -{% endif %} -termux-api -{% endif %} diff --git a/config/nix/configuration.nix b/config/nix/configuration.nix index 2c067b8..d616772 100644 --- a/config/nix/configuration.nix +++ b/config/nix/configuration.nix @@ -2,8 +2,6 @@ let recursiveMerge = import ./recursiveMerge.nix; getModule = name: import (./modules + "/${name}.nix") { inherit config pkgs; }; + loadModules = modules: recursiveMerge ((map getModule) modules); in -recursiveMerge [ - (getModule "common") - (getModule "x11") -] +loadModules [ "common" "desktop" "battery" "wireless" ] diff --git a/config/nix/modules/battery.nix b/config/nix/modules/battery.nix new file mode 100644 index 0000000..8c01d3d --- /dev/null +++ b/config/nix/modules/battery.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + users.users.geoffrey.packages = with pkgs; [ + powertop + ]; + environment.systemPackages = with pkgs; [ tlp ]; +} diff --git a/config/nix/modules/common.nix b/config/nix/modules/common.nix index e71861c..279531e 100644 --- a/config/nix/modules/common.nix +++ b/config/nix/modules/common.nix @@ -60,10 +60,47 @@ # remote openssh rsync + borgbackup - # DEBUG - tree - lolcat + # cleanup + jdupes + duperemove + optipng + libjpeg + # FIXME reflac not available (but also a dumb shell script) + + # local monitoring + htop + iotop + iftop + lsof + strace + pv + progress + speedtest-cli + + # multimedia toolbox + ffmpeg + sox + imagemagick + + # password + pass + pwgen + + # Mail + isync + msmtp + notmuch + neomutt + lynx + + # Organisation + vdirsyncer + khard + khal + todoman + syncthing ]; initialPassword = "cartable"; # DEBUG @@ -72,7 +109,12 @@ ]; }; - environment.systemPackages = with pkgs; [ neovim wget ]; + environment.systemPackages = with pkgs; [ + wget + kexec-tools + openvpn + update-resolv-conf # TODO Is it what I think it is? + ]; # Enable compilation cache programs = { @@ -101,6 +143,7 @@ # Enable the OpenSSH daemon openssh.enable = true; getty.autologinUser = "geoffrey"; # DEBUG + chrony.enable = true; }; # TEST diff --git a/config/nix/modules/desktop.nix b/config/nix/modules/desktop.nix new file mode 100644 index 0000000..58d46de --- /dev/null +++ b/config/nix/modules/desktop.nix @@ -0,0 +1,82 @@ +{ pkgs, ... }: +{ + # Enable the X11 windowing system + services.xserver.enable = true; + + # FIXME qwerty-fr for X11 + + # Enable sound + sound.enable = true; + hardware.pulseaudio.enable = true; + + services.xserver.displayManager.startx.enable = true; + services.xserver.windowManager.i3.enable = true; + + users.users.geoffrey. packages = with pkgs; [ + # remote + tigervnc + + # music + mpd + mpc-cli + ashuffle + vimpc + + # multimedia common + gimp + inkscape + mpv + mpvScripts.thumbnail + libreoffice + + # data management + freefilesync + + # browsers + firefox + qutebrowser + + # fonts + dejavu_fonts + twemoji-color-font + xfce.thunar + gnome.gedit + feh + zathura + zbar + zathura + meld + python3Packages.magic + yubikey-touch-detector + + # x11-exclusive + libgnomekbd # to show keyboard layout + dunst + i3lock + numlockx + rofi + rofimoji + rxvt-unicode + # TODO urxvt-resize-font-git + scrot + simplescreenrecorder + trayer + unclutter + xautolock + xclip + lemonbar-xft + autorandr + keynav + sct + xorg.xinit + xorg.xbacklight + + alacritty + + # organisation + rofi-pass # TODO Try autopass.cr + thunderbird + ]; + + environment.systemPackages = with pkgs; [ pavucontrol ]; +} diff --git a/config/nix/modules/wireless.nix b/config/nix/modules/wireless.nix new file mode 100644 index 0000000..ba7d7e2 --- /dev/null +++ b/config/nix/modules/wireless.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ wirelesstools ]; +} diff --git a/config/nix/modules/x11.nix b/config/nix/modules/x11.nix deleted file mode 100644 index 5bde7b1..0000000 --- a/config/nix/modules/x11.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: -{ - # Enable the X11 windowing system - services.xserver.enable = true; - - # FIXME qwerty-fr for X11 - - # Enable sound - sound.enable = true; - hardware.pulseaudio.enable = true; - - services.xserver.displayManager.startx.enable = true; - services.xserver.windowManager.i3.enable = true; - - users.users.geoffrey. packages = with pkgs; [ - # remote - tigervnc - - # remote - firefox - ]; -} From 8ae219fb8326f2bbe1b4a8b730c9ee32394c304a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 22 Oct 2023 22:50:22 +0200 Subject: [PATCH 005/108] nix: Remove unecessary module handling Who would have thought, someone thought about this before me :shockedpikachu: --- config/nix/configuration.nix | 14 ++++++++------ config/nix/recursiveMerge.nix | 23 ----------------------- 2 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 config/nix/recursiveMerge.nix diff --git a/config/nix/configuration.nix b/config/nix/configuration.nix index d616772..e27de2a 100644 --- a/config/nix/configuration.nix +++ b/config/nix/configuration.nix @@ -1,7 +1,9 @@ { config, pkgs, ... }: -let - recursiveMerge = import ./recursiveMerge.nix; - getModule = name: import (./modules + "/${name}.nix") { inherit config pkgs; }; - loadModules = modules: recursiveMerge ((map getModule) modules); -in -loadModules [ "common" "desktop" "battery" "wireless" ] +{ + imports = [ + ./modules/common.nix + ./modules/desktop.nix + ./modules/battery.nix + ./modules/wireless.nix + ]; +} diff --git a/config/nix/recursiveMerge.nix b/config/nix/recursiveMerge.nix deleted file mode 100644 index 6c3d87d..0000000 --- a/config/nix/recursiveMerge.nix +++ /dev/null @@ -1,23 +0,0 @@ -let - - pkgs = import { }; - # Somehow, if fed the pkgs from a nix-build, it creates an infinite recursion, hence the search path - lib = pkgs.lib; - - recursiveMerge = with lib; attrList: - let f = attrPath: - zipAttrsWith (n: values: - if tail values == [ ] - then head values - else if all isList values - then unique (concatLists values) - else if all isAttrs values - then f (attrPath ++ [ n ]) values - else last values - ); - in f [ ] attrList; - - -in - -recursiveMerge From 73cbf01b630e0655075c7b65c10adb1e1ee05954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 23 Oct 2023 22:05:56 +0200 Subject: [PATCH 006/108] nix: Extra packages --- .../software/templates/package_manager.j2 | 7 --- .../templates/snippets/pm_android_tools.j2 | 11 ----- .../templates/snippets/pm_document.j2 | 27 ----------- .../templates/snippets/pm_download.j2 | 12 ----- .../snippets/pm_multimedia_editors.j2 | 12 ----- .../software/templates/snippets/pm_shell.j2 | 21 -------- .../software/templates/snippets/pm_wine.j2 | 11 ----- config/nix/configuration.nix | 1 + config/nix/modules/battery.nix | 5 +- config/nix/modules/common.nix | 1 - config/nix/modules/extra.nix | 48 +++++++++++++++++++ config/nix/modules/wireless.nix | 1 + 12 files changed, 51 insertions(+), 106 deletions(-) delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_android_tools.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_document.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_download.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_multimedia_editors.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_shell.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_wine.j2 create mode 100644 config/nix/modules/extra.nix diff --git a/config/automatrop/roles/software/templates/package_manager.j2 b/config/automatrop/roles/software/templates/package_manager.j2 index 3a10339..c79ebde 100644 --- a/config/automatrop/roles/software/templates/package_manager.j2 +++ b/config/automatrop/roles/software/templates/package_manager.j2 @@ -1,11 +1,4 @@ {# Include rules-determined snippets #} -{% if software_full %} -{% include 'snippets/pm_android_tools.j2' %} -{% include 'snippets/pm_multimedia_editors.j2' %} -{% include 'snippets/pm_download.j2' %} -{% include 'snippets/pm_wine.j2' %} -{% include 'snippets/pm_document.j2' %} -{% endif %} {# Inclde dev snippets #} {% if dev_stuffs %} {% include 'snippets/pm_dev_common.j2' %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_android_tools.j2 b/config/automatrop/roles/software/templates/snippets/pm_android_tools.j2 deleted file mode 100644 index 3adfc83..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_android_tools.j2 +++ /dev/null @@ -1,11 +0,0 @@ -{# -Stuff for accessing Android phones -#} -{% if not termux %} -{% if arch_based %} -android-tools -android-udev -{% elif debian_based %} -adb -{% endif %} -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_document.j2 b/config/automatrop/roles/software/templates/snippets/pm_document.j2 deleted file mode 100644 index 0ba2105..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_document.j2 +++ /dev/null @@ -1,27 +0,0 @@ -{# Document utilities #} -pandoc -{% if arch_based %} -texlive-bibtexextra -texlive-core -texlive-fontsextra -texlive-formatsextra -texlive-latexextra -texlive-pictures -texlive-pstricks -texlive-science -{% elif debian_based %} -texlive-base -texlive-lang-european -{% endif %} -pdftk -{% if display_server %} -{# Spell checking #} -hunspell-en_gb -hunspell-en_us -hunspell-fr -hunspell-nl -{# libreoffice-extension-grammalecte-fr #} -{% if arch_based %} -libreoffice-extension-languagetool -{% endif %} -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_download.j2 b/config/automatrop/roles/software/templates/snippets/pm_download.j2 deleted file mode 100644 index 272244c..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_download.j2 +++ /dev/null @@ -1,12 +0,0 @@ -{# -Programs used to download sutff off the internet -#} -wget -curl -rsync -yt-dlp -megatools -transmission-cli -{% if display_server %} -transmission-qt -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_multimedia_editors.j2 b/config/automatrop/roles/software/templates/snippets/pm_multimedia_editors.j2 deleted file mode 100644 index 9462c63..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_multimedia_editors.j2 +++ /dev/null @@ -1,12 +0,0 @@ -{# -Big behemoth applications -#} -{% if display_server %} -gimp -inkscape -darktable -blender -puddletag -musescore -audacity -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_shell.j2 b/config/automatrop/roles/software/templates/snippets/pm_shell.j2 deleted file mode 100644 index 5a519a7..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_shell.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{# -Shell related stuff -#} -{# ZSH #} -zsh -antigen -{% if arch_based %} -{# Antigen takex care of the above for others platforms #} -zsh-autosuggestions -zsh-completions -zsh-history-substring-search -zsh-syntax-highlighting -{% endif %} -tmux -bash-completion -fzf -{% if arch_based and ansible_architecture == 'x86_64' %} -powerline-go-bin -{% else %} -powerline-go -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_wine.j2 b/config/automatrop/roles/software/templates/snippets/pm_wine.j2 deleted file mode 100644 index 410e64c..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_wine.j2 +++ /dev/null @@ -1,11 +0,0 @@ -{% if ansible_architecture == 'x86_64' %} -wine -{% if arch_based %} -wine-gecko -wine-mono -mono -lib32-libpulse -{% elif debian_based %} -mono-runtime -{% endif %} -{% endif %} diff --git a/config/nix/configuration.nix b/config/nix/configuration.nix index e27de2a..2881092 100644 --- a/config/nix/configuration.nix +++ b/config/nix/configuration.nix @@ -5,5 +5,6 @@ ./modules/desktop.nix ./modules/battery.nix ./modules/wireless.nix + # ./modules/extra.nix ]; } diff --git a/config/nix/modules/battery.nix b/config/nix/modules/battery.nix index 8c01d3d..98d754e 100644 --- a/config/nix/modules/battery.nix +++ b/config/nix/modules/battery.nix @@ -1,7 +1,4 @@ { pkgs, ... }: { - users.users.geoffrey.packages = with pkgs; [ - powertop - ]; - environment.systemPackages = with pkgs; [ tlp ]; + environment.systemPackages = with pkgs; [ tlp powertop ]; } diff --git a/config/nix/modules/common.nix b/config/nix/modules/common.nix index 279531e..95fb406 100644 --- a/config/nix/modules/common.nix +++ b/config/nix/modules/common.nix @@ -4,7 +4,6 @@ boot.loader.efi.canTouchEfiVariables = true; networking.hostName = "nixos"; - networking.wireless.enable = true; # Enable wireless support via wpa_supplicant time.timeZone = "Europe/Amsterdam"; diff --git a/config/nix/modules/extra.nix b/config/nix/modules/extra.nix new file mode 100644 index 0000000..36699d5 --- /dev/null +++ b/config/nix/modules/extra.nix @@ -0,0 +1,48 @@ +{ pkgs, ... }: +{ + users.users.geoffrey. packages = with pkgs; [ + # android tools + android-tools + + # multimedia editors + gimp + inkscape + darktable + blender + puddletag + musescore + audacity + + # downloading + yt-dlp + megatools + transmission + transmission-qt + + # wine + wine + # TODO wine-gecko wine-mono lib32-libpulse (?) + + # documents + pandoc + texlive.combined.scheme-full + pdftk + hunspell + hunspellDicts.en_GB-ize + hunspellDicts.en_US + hunspellDicts.fr-moderne + hunspellDicts.nl_NL + # TODO libreoffice-extension-languagetool or libreoffice-extension-grammalecte-fr + + # gaming + steam + yuzu-mainline + minecraft + # TODO factorio + ]; + + environment.systemPackages = with pkgs; [ + # android tools + android-udev-rules + ]; +} diff --git a/config/nix/modules/wireless.nix b/config/nix/modules/wireless.nix index ba7d7e2..ef2a339 100644 --- a/config/nix/modules/wireless.nix +++ b/config/nix/modules/wireless.nix @@ -1,4 +1,5 @@ { pkgs, ... }: { + networking.wireless.enable = true; # Enable wireless support via wpa_supplicant environment.systemPackages = with pkgs; [ wirelesstools ]; } From e0b9bbcfbab38afba639ad7781f0137378ca1903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 24 Oct 2023 21:44:40 +0200 Subject: [PATCH 007/108] nix: Add last packages (dev ones) --- config/automatrop/playbooks/default.yml | 2 - .../automatrop/roles/software/tasks/main.yml | 34 ---------- .../software/templates/package_manager.j2 | 14 ---- .../templates/snippets/pm_dev_ansible.j2 | 4 -- .../software/templates/snippets/pm_dev_c.j2 | 10 --- .../templates/snippets/pm_dev_common.j2 | 18 ----- .../templates/snippets/pm_dev_docker.j2 | 3 - .../templates/snippets/pm_dev_fpga.j2 | 6 -- .../templates/snippets/pm_dev_network.j2 | 14 ---- .../software/templates/snippets/pm_dev_nix.j2 | 3 - .../templates/snippets/pm_dev_perl.j2 | 5 -- .../software/templates/snippets/pm_dev_php.j2 | 1 - .../templates/snippets/pm_dev_python.j2 | 12 ---- .../templates/snippets/pm_dev_shell.j2 | 2 - .../software/templates/snippets/pm_dev_sql.j2 | 1 - config/nix/configuration.nix | 3 +- config/nix/modules/dev.nix | 66 +++++++++++++++++++ 17 files changed, 68 insertions(+), 130 deletions(-) delete mode 100644 config/automatrop/roles/software/tasks/main.yml delete mode 100644 config/automatrop/roles/software/templates/package_manager.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_c.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_common.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_docker.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_fpga.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_network.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_nix.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_perl.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_php.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_python.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_shell.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_sql.j2 create mode 100644 config/nix/modules/dev.nix diff --git a/config/automatrop/playbooks/default.yml b/config/automatrop/playbooks/default.yml index 227b4a4..4a68ab7 100644 --- a/config/automatrop/playbooks/default.yml +++ b/config/automatrop/playbooks/default.yml @@ -6,8 +6,6 @@ - role: access tags: access when: root_access - - role: software - tags: software - role: system tags: system when: root_access diff --git a/config/automatrop/roles/software/tasks/main.yml b/config/automatrop/roles/software/tasks/main.yml deleted file mode 100644 index 61403e9..0000000 --- a/config/automatrop/roles/software/tasks/main.yml +++ /dev/null @@ -1,34 +0,0 @@ - -- name: Generate list of packages for package manager - set_fact: - packages: "{{ query('template', 'package_manager.j2')[0].split('\n')[:-1]|sort|unique }}" - tags: softwarelist - -- name: Install packages (Arch-based) - aur: - name: "{{ packages }}" - extra_args: "--asdeps --needed" - # Nothing is set as installed manually so it can - # be removed by dependency check. - # Current packages will be kept by the meta package - use: yay - notify: "software changed" - tags: softwarelist - when: arch_based - -- name: Check if list of packages changed - copy: - content: "{% for package in packages %}{{ package }}\n{% endfor %}" - dest: "{{ ansible_user_dir }}/.cache/automatrop/package_manager" - notify: "software changed" - tags: softwarelist - -# translate-shell -# $ curl -L git.io/trans > ~/.local/bin/trans -# $ chmod +x ~/.local/bin/trans - -# sct -# $ TMP=$(mktemp /tmp/XXXXXXXXXX.c) -# $ wget https://gist.githubusercontent.com/ajnirp/208c03d3aa7f02c743d2/raw/55bf3eed25739173d8be57b5179ed5542cf40ed6/sct.c -O $TMP -# $ cc $TMP --std=c99 -lX11 -lXrandr -o $HOME/.local/bin/sct -# $ rm $TMP diff --git a/config/automatrop/roles/software/templates/package_manager.j2 b/config/automatrop/roles/software/templates/package_manager.j2 deleted file mode 100644 index c79ebde..0000000 --- a/config/automatrop/roles/software/templates/package_manager.j2 +++ /dev/null @@ -1,14 +0,0 @@ -{# Include rules-determined snippets #} -{# Inclde dev snippets #} -{% if dev_stuffs %} -{% include 'snippets/pm_dev_common.j2' %} -{% for dev_stuff in dev_stuffs %} -{% include 'snippets/pm_dev_' + dev_stuff + '.j2' %} -{% endfor %} -{% endif %} -{# Include custom snippets #} -{% for software_snippet in software_snippets %} -{% if software_snippet.startswith('pm_') %} -{% include 'snippets/' + software_snippet + '.j2' %} -{% endif %} -{% endfor %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 deleted file mode 100644 index 373384a..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 +++ /dev/null @@ -1,4 +0,0 @@ -ansible -ansible-lint -ansible-language-server -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_c.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_c.j2 deleted file mode 100644 index 7353cb9..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_c.j2 +++ /dev/null @@ -1,10 +0,0 @@ -{% if termux %} -{# Otherwise installed by base-devel or equivalent #} -make -gcc -{% endif %} -cmake -clang -ccache -gdb -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_common.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_common.j2 deleted file mode 100644 index 5c0c0ce..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_common.j2 +++ /dev/null @@ -1,18 +0,0 @@ -perf -git -jq -{% if arch_based %} -ctags -{% elif debian_based %} -universal-ctags -{% endif %} -{% if not termux %} -highlight -{% endif %} -{# For nvim's :Telescope live_grep #} -ripgrep -{# Offline documentation #} -{# Relies on qt5-webkit which is a pain to compile -zeal -#} -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_docker.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_docker.j2 deleted file mode 100644 index 012121f..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_docker.j2 +++ /dev/null @@ -1,3 +0,0 @@ -docker -docker-compose -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_fpga.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_fpga.j2 deleted file mode 100644 index 67dcb76..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_fpga.j2 +++ /dev/null @@ -1,6 +0,0 @@ -yosys -iverilog -ghdl -{% if display_server %} -gtkwave -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_network.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_network.j2 deleted file mode 100644 index 2b882d6..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_network.j2 +++ /dev/null @@ -1,14 +0,0 @@ -wget -curl -socat -{% if arch_based %} -bind -{% else %} -dnsutils -{% endif %} -whois -nmap -tcpdump -{% if display_server %} -wireshark-qt -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_nix.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_nix.j2 deleted file mode 100644 index 71a9e74..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_nix.j2 +++ /dev/null @@ -1,3 +0,0 @@ -nix -rnix-lsp - diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_perl.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_perl.j2 deleted file mode 100644 index 693399c..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_perl.j2 +++ /dev/null @@ -1,5 +0,0 @@ -{% if arch_based %} -{# TODO Disabled because it currently doesn't build -perl-perl-languageserver -#} -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_php.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_php.j2 deleted file mode 100644 index dd1fee4..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_php.j2 +++ /dev/null @@ -1 +0,0 @@ -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_python.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_python.j2 deleted file mode 100644 index 5f457a8..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_python.j2 +++ /dev/null @@ -1,12 +0,0 @@ -mypy -{% if not arch_based %} -black -{# On arch it's installed as a dependency, also it's called python-black #} -{% endif %} -{% if arch_based %} -python-lsp-server -python-mypy-ls -python-lsp-black -{% endif %} -ipython -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_shell.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_shell.j2 deleted file mode 100644 index 7cd054e..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_shell.j2 +++ /dev/null @@ -1,2 +0,0 @@ -bash-language-server -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_sql.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_sql.j2 deleted file mode 100644 index e961816..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_sql.j2 +++ /dev/null @@ -1 +0,0 @@ -sql-language-server diff --git a/config/nix/configuration.nix b/config/nix/configuration.nix index 2881092..43a9174 100644 --- a/config/nix/configuration.nix +++ b/config/nix/configuration.nix @@ -5,6 +5,7 @@ ./modules/desktop.nix ./modules/battery.nix ./modules/wireless.nix - # ./modules/extra.nix + ./modules/extra.nix + ./modules/dev.nix ]; } diff --git a/config/nix/modules/dev.nix b/config/nix/modules/dev.nix new file mode 100644 index 0000000..fdde56e --- /dev/null +++ b/config/nix/modules/dev.nix @@ -0,0 +1,66 @@ +{ pkgs, ... }: +{ + # TODO Separate in diffrent packages once the structure is finalized... + # or connvert into per-directory requirements + users.users.geoffrey. packages = with pkgs; [ + # Ansible + ansible + ansible-lint + ansible-language-server + + # C/C++ + cmake + clang + ccache + gdb + + # Common + perf-tools + git + jq + universal-ctags + highlight + ripgrep # For nvim's :Telescope live_grep + zeal-qt6 # Offline documentation + + # Docker + docker + docker-compose + + # FPGA + yosys + verilog + ghdl + gtkwave # TODO Display server only + + # Network + socat + dig + whois + nmap + tcpdump + wireshark-qt # TODO Display server only + + # nix + nix + rnix-lsp + + # Perl + perl536Packages.PLS + + # Python + mypy + python3Packages.black + python3Packages.python-lsp-server + python3Packages.pylsp-mypy + python3Packages.pyls-isort + python3Packages.python-lsp-black + # TODO Are all those for the same language server? + python3Packages.ipython + + # Bash + nodePackages.bash-language-server + sqls + ]; + +} From 6ad06cb349f9ec1616a5bb2381cc57733e10082c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 24 Oct 2023 23:52:45 +0200 Subject: [PATCH 008/108] nix: Some system options, like keyboard --- .../system/files/us_qwert_alt_numpad.patch | 10 -- .../roles/system/files/xorg/keyboard.conf | 7 -- config/automatrop/roles/system/tasks/main.yml | 117 ------------------ config/nix/configuration.nix | 2 + config/nix/modules/battery.nix | 2 +- config/nix/modules/desktop.nix | 26 +++- config/nix/modules/qwerty-fr-keypad.diff | 10 ++ config/nix/us_qwerty-fr | 65 ++++++++++ 8 files changed, 103 insertions(+), 136 deletions(-) delete mode 100644 config/automatrop/roles/system/files/us_qwert_alt_numpad.patch delete mode 100644 config/automatrop/roles/system/files/xorg/keyboard.conf create mode 100644 config/nix/modules/qwerty-fr-keypad.diff create mode 100644 config/nix/us_qwerty-fr diff --git a/config/automatrop/roles/system/files/us_qwert_alt_numpad.patch b/config/automatrop/roles/system/files/us_qwert_alt_numpad.patch deleted file mode 100644 index 6e745b3..0000000 --- a/config/automatrop/roles/system/files/us_qwert_alt_numpad.patch +++ /dev/null @@ -1,10 +0,0 @@ -*************** -*** 6,11 **** ---- 6,12 ---- - { - include "us(basic)" - include "level3(ralt_switch)" -+ include "keypad(oss)" - - name[Group1]= "US keyboard with french symbols - AltGr combination"; - diff --git a/config/automatrop/roles/system/files/xorg/keyboard.conf b/config/automatrop/roles/system/files/xorg/keyboard.conf deleted file mode 100644 index 8248b12..0000000 --- a/config/automatrop/roles/system/files/xorg/keyboard.conf +++ /dev/null @@ -1,7 +0,0 @@ -Section "InputClass" - Identifier "system-keyboard" - MatchIsKeyboard "on" - Option "XkbLayout" "us_qwerty-fr" - #Option "XkbModel" "pc105+inet" - Option "XkbOptions" "terminate:ctrl_alt_bksp" -EndSection diff --git a/config/automatrop/roles/system/tasks/main.yml b/config/automatrop/roles/system/tasks/main.yml index aade07b..8e8f783 100644 --- a/config/automatrop/roles/system/tasks/main.yml +++ b/config/automatrop/roles/system/tasks/main.yml @@ -2,125 +2,8 @@ # Package are installed with --asdeps because they are needed -# Etckeeper - -- name: Check if etckeeper is initialized - stat: - path: /etc/.git - register: etckeeper - become: yes - -- name: Initialize etckeeper - command: "etckeeper init" - become: yes - when: not etckeeper.stat.exists - changed_when: yes - -- name: Configure git user.name for etckeeper - git_config: - scope: local - repo: /etc - name: "{{ item.name }}" - value: "{{ item.value }}" - loop: - - name: "user.name" - value: "etckeeper on {{ inventory_hostname_short }}" - - name: "user.email" - value: "etckeeper@{{ inventory_hostname }}" - become: yes - -# Manjaro configuration - -- name: Remove Manjaro's pamac - pacman: - name: pamac - state: absent - become: yes - when: arch_based and False # I'm trying to remember why I usually delete this thing - -# Verbose logging during boot - -- name: Check if using Uboot - stat: - path: /boot/extlinux/extlinux.conf - register: extlinux -# This (and the following) was made with the Pinebook in mind, -# not sure about compatibility - -- name: Remove non-tty1 console (Uboot) - replace: - path: /boot/extlinux/extlinux.conf - regexp: '^APPEND(.*) console=(?!tty1)\S+(.*)$' - replace: 'APPEND\1\2' - become: yes - when: extlinux.stat.exists -# Only one console= will be removed because regular expression are either hard -# or somewhat limited. It's just what I need anyway - -- name: Remove bootsplash.bootfile (Uboot) - replace: - path: /boot/extlinux/extlinux.conf - regexp: '^APPEND(.*) bootsplash.bootfile=\S+(.*)$' - replace: 'APPEND\1\2' - become: yes - when: extlinux.stat.exists - -- name: Remove bootsplash packages (Arch based) - pacman: - name: - - bootsplash-systemd - - bootsplash-theme-manjaro - state: absent - become: yes - when: arch_based - - -# Display Manager - -- name: Remove display manager packages (Arch based) - pacman: - name: - - sddm - - sddm-breath2-theme - state: absent - become: yes - when: arch_based - # Xorg configuration -- name: Check if there is nvidia-xrun is installed - stat: - path: /etc/X11/nvidia-xorg.conf - register: nvidia_xrun - when: display_server == 'x11' - -- name: Add nvidia-xrun xorg config directory - set_fact: - xorg_common_config_dirs: "{{ xorg_default_config_dirs + xorg_nvidia_config_dirs }}" - vars: - xorg_default_config_dirs: - - /etc/X11/xorg.conf.d - xorg_nvidia_config_dirs: "{{ ['/etc/X11/nvidia-xorg.conf.d'] if nvidia_xrun.stat.exists else [] }}" - when: display_server == 'x11' - -- name: Configure Xorg keyboard layout - copy: - src: xorg/keyboard.conf - dest: "{{ item }}/00-keyboard.conf" - become: yes - when: display_server == 'x11' - notify: etc changed - loop: "{{ xorg_common_config_dirs }}" - -- name: Use Alt keys for numpad - patch: - src: us_qwert_alt_numpad.patch - dest: /usr/share/X11/xkb/symbols/us_qwerty-fr - become: yes - when: display_server == 'x11' -# This is not very nice but it's updated so infrequently that it's not worth -# the trouble - - name: Check if there is Intel backlight stat: path: /sys/class/backlight/intel_backlight diff --git a/config/nix/configuration.nix b/config/nix/configuration.nix index 43a9174..1d7c485 100644 --- a/config/nix/configuration.nix +++ b/config/nix/configuration.nix @@ -1,6 +1,8 @@ { config, pkgs, ... }: { imports = [ + + # ./modules/common.nix ./modules/desktop.nix ./modules/battery.nix diff --git a/config/nix/modules/battery.nix b/config/nix/modules/battery.nix index 98d754e..4052fe2 100644 --- a/config/nix/modules/battery.nix +++ b/config/nix/modules/battery.nix @@ -1,4 +1,4 @@ { pkgs, ... }: { - environment.systemPackages = with pkgs; [ tlp powertop ]; + environment.systemPackages = with pkgs; [ powertop ]; } diff --git a/config/nix/modules/desktop.nix b/config/nix/modules/desktop.nix index 58d46de..c2fe119 100644 --- a/config/nix/modules/desktop.nix +++ b/config/nix/modules/desktop.nix @@ -3,7 +3,30 @@ # Enable the X11 windowing system services.xserver.enable = true; - # FIXME qwerty-fr for X11 + services.xserver = { + extraLayouts.qwerty-fr = { + description = "QWERTY-fr"; + languages = [ "fr" ]; + symbolsFile = "${pkgs.stdenv.mkDerivation { + name = "qwerty-fr-keypad"; + src = builtins.fetchGit { + url = "https://github.com/qwerty-fr/qwerty-fr.git"; + rev = "3a4d13089e8ef016aa20baf6b2bf3ea53de674b8"; + }; + patches = [ ./qwerty-fr-keypad.diff ]; + # TODO This doesn't seem to be applied... it's the whole point of the derivation :( + installPhase = '' + runHook preInstall + mkdir -p $out/linux + cp $src/linux/us_qwerty-fr $out/linux + runHook postInstall + ''; + }}/linux/us_qwerty-fr"; + }; + layout = "qwerty-fr"; + # TODO home.keyboard = null; in home-manager... or something + + }; # Enable sound sound.enable = true; @@ -79,4 +102,5 @@ ]; environment.systemPackages = with pkgs; [ pavucontrol ]; + } diff --git a/config/nix/modules/qwerty-fr-keypad.diff b/config/nix/modules/qwerty-fr-keypad.diff new file mode 100644 index 0000000..d0a0246 --- /dev/null +++ b/config/nix/modules/qwerty-fr-keypad.diff @@ -0,0 +1,10 @@ +--- ./linux/us_qwerty-fr ++++ ./linux/us_qwerty-fr +@@ -4,6 +4,7 @@ + { + include "us(basic)" + include "level3(ralt_switch)" ++ include "keypad(oss)" + + name[Group1]= "US keyboard with french symbols - AltGr combination"; + diff --git a/config/nix/us_qwerty-fr b/config/nix/us_qwerty-fr new file mode 100644 index 0000000..a18b0ea --- /dev/null +++ b/config/nix/us_qwerty-fr @@ -0,0 +1,65 @@ + +partial alphanumeric_keys +xkb_symbols "qwerty-fr" +{ + include "us(basic)" + include "level3(ralt_switch)" + include "keypad(oss)" + + name[Group1]= "US keyboard with french symbols - AltGr combination"; + + key { [ grave, asciitilde, dead_grave, dead_tilde ] }; + key { [ 1, exclam, onesuperior, exclamdown ] }; + key { [ 2, at, twosuperior, dead_doubleacute ] }; + key { [ 3, numbersign, ecircumflex, Ecircumflex ] }; + key { [ 4, dollar, EuroSign, dead_currency ] }; // FIXME: dead_currency has a different mapping than the one we want for qwerty-fr. Need to define a custom dead key instead. See Windows layout for dead key definition. + key { [ 5, percent, dead_macron, dead_abovedot ] }; + key { [ 6, asciicircum, dead_circumflex, dead_caron ] }; + key { [ 7, ampersand, ucircumflex, Ucircumflex ] }; + key { [ 8, asterisk, icircumflex, Icircumflex ] }; + key { [ 9, parenleft, ocircumflex, Ocircumflex ] }; + key { [ 0, parenright, oslash, Oslash ] }; + key { [ minus, underscore, endash, emdash ] }; + key { [ equal, plus, notequal, approxeq ] }; + + key { [ q, Q, acircumflex, Acircumflex ] }; + key { [ w, W, eacute, Eacute ] }; + key { [ e, E, egrave, Egrave ] }; + key { [ r, R, registered, copyright ] }; + key { [ t, T, thorn, THORN ] }; + key { [ y, Y, dead_invertedbreve, dead_breve ] }; + key { [ u, U, ugrave, Ugrave ] }; + key { [ i, I, igrave, Igrave ] }; + key { [ o, O, ograve, Ograve ] }; + key { [ p, P, oe, OE ] }; + key { [ bracketleft, braceleft, guillemotleft, leftdoublequotemark ] }; + key { [ bracketright, braceright, guillemotright, rightdoublequotemark ] }; + + key { [ a, A, agrave, Agrave ] }; + key { [ s, S, ae, AE ] }; + key { [ d, D, ediaeresis, Ediaeresis ] }; + key { [ f, F, VoidSymbol, VoidSymbol ] }; + key { [ g, G, dead_greek, VoidSymbol ] }; // FIXME: dead_greek has a different mapping than the one we want for qwerty-fr. Need to define a custom dead key instead. See Windows layout for dead key definition. + key { [ h, H, ydiaeresis, Ydiaeresis ] }; + key { [ j, J, udiaeresis, Udiaeresis ] }; + key { [ k, K, idiaeresis, Idiaeresis ] }; + key { [ l, L, odiaeresis, Odiaeresis ] }; + key { [ semicolon, colon, dead_acute, dead_abovering ] }; + key { [ apostrophe, quotedbl, dead_grave, dead_diaeresis ] }; + key { [ backslash, bar, VoidSymbol, doublelowquotemark ] }; // „ + + key { [ less, greater, lessthanequal, greaterthanequal ] }; + key { [ z, Z, adiaeresis, Adiaeresis ] }; + key { [ x, X, multiply, division ] }; + key { [ c, C, ccedilla, Ccedilla ] }; + key { [ v, V, VoidSymbol, VoidSymbol ] }; + key { [ b, B, ssharp, U1E9E ] }; // ß, ẞ (capital) + key { [ n, N, ntilde, Ntilde ] }; + key { [ m, M, VoidSymbol, VoidSymbol ] }; + key { [ comma, less, dead_cedilla, dead_ogonek ] }; + key { [ period, greater, periodcentered, ellipsis ] }; // ., >, ·, … + key { [ slash, question, rightsinglequotemark, questiondown ] }; // /, ?, ’, ¿ + key { [ space, space, nobreakspace, 0x100202F ] }; // espace insécable fine + +}; + From 81e5e70d27a14296710dad8f9b22b134bf91e648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 25 Oct 2023 00:27:06 +0200 Subject: [PATCH 009/108] nix: Misc removals The options I use already seems to be default in NixOS. I'm not sure about the backlight and the joystick, keeping this around until I can confirm this is not needed. --- .../roles/system/files/xorg/touchpad.conf | 6 ---- config/automatrop/roles/system/tasks/main.yml | 29 +------------------ 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 config/automatrop/roles/system/files/xorg/touchpad.conf diff --git a/config/automatrop/roles/system/files/xorg/touchpad.conf b/config/automatrop/roles/system/files/xorg/touchpad.conf deleted file mode 100644 index 4bd1a17..0000000 --- a/config/automatrop/roles/system/files/xorg/touchpad.conf +++ /dev/null @@ -1,6 +0,0 @@ -Section "InputClass" - Identifier "touchpad" - Driver "libinput" - MatchIsTouchpad "on" - Option "Tapping" "on" -EndSection diff --git a/config/automatrop/roles/system/tasks/main.yml b/config/automatrop/roles/system/tasks/main.yml index 8e8f783..6b78d93 100644 --- a/config/automatrop/roles/system/tasks/main.yml +++ b/config/automatrop/roles/system/tasks/main.yml @@ -28,15 +28,6 @@ notify: etc changed loop: "{{ xorg_common_config_dirs }}" -- name: Configure Xorg touchpad behaviour - copy: - src: xorg/touchpad.conf - dest: "{{ item }}/30-touchpad.conf" - become: yes - when: display_server == 'x11' - notify: etc changed - loop: "{{ xorg_common_config_dirs }}" - - name: Configure Xorg joystick behaviour copy: src: xorg/joystick.conf @@ -86,25 +77,7 @@ - systemd changed when: not auto_numlock -# TLP configuration - -- name: Start/enable TLP - systemd: - name: tlp - state: started - enabled: yes - become: yes - notify: etc changed - -# Network configuration - -- name: Start/enable dhcpcd - systemd: - name: dhcpcd - state: started - enabled: yes - become: yes - notify: etc changed +### STOPPED HERE ### - name: Configure wpa_supplicant template: From c37a709b01dd0f00b01c9be766e0143af90b6c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 28 Oct 2023 18:53:17 +0200 Subject: [PATCH 010/108] nix: Wi-Fi configuration It's, uh, a bit ugly. But let's try to make it work for now, improve later. Apparently my wpa_supplicant config file was visible for everyone already, so that's not a regression :D --- .../roles/system/files/wpa_supplicant.service | 3 - .../roles/system/handlers/main.yaml | 16 -- config/automatrop/roles/system/tasks/main.yml | 69 -------- .../system/templates/wpa_supplicant.conf.j2 | 102 ----------- config/nix/modules/wireless.nix | 11 +- config/nix/modules/wireless/.gitignore | 2 + config/nix/modules/wireless/import.py | 161 ++++++++++++++++++ 7 files changed, 173 insertions(+), 191 deletions(-) delete mode 100644 config/automatrop/roles/system/files/wpa_supplicant.service delete mode 100644 config/automatrop/roles/system/templates/wpa_supplicant.conf.j2 create mode 100644 config/nix/modules/wireless/.gitignore create mode 100755 config/nix/modules/wireless/import.py diff --git a/config/automatrop/roles/system/files/wpa_supplicant.service b/config/automatrop/roles/system/files/wpa_supplicant.service deleted file mode 100644 index a839d44..0000000 --- a/config/automatrop/roles/system/files/wpa_supplicant.service +++ /dev/null @@ -1,3 +0,0 @@ -[Service] -ExecStart= -ExecStart=/usr/bin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -i%I diff --git a/config/automatrop/roles/system/handlers/main.yaml b/config/automatrop/roles/system/handlers/main.yaml index 595a97f..9bda647 100644 --- a/config/automatrop/roles/system/handlers/main.yaml +++ b/config/automatrop/roles/system/handlers/main.yaml @@ -19,22 +19,6 @@ listen: systemd changed become: yes -- name: Restart wpa_supplicant - systemd: - name: "wpa_supplicant@{{ item }}" - state: restarted - become: yes - loop: "{{ ansible_interfaces }}" - when: "item.startswith('wl')" - listen: wpa_supplicant changed -# Could probably use something better like -# listing /sys/class/ieee80211/*/device/net/ - -- name: Warn about changed Wi-Fi setup - debug: - msg: "The Wi-Fi configuration was changed, but not applied to let this playbook finish. A reboot is required." - listen: wifi setup changed - - name: Warn about changed Panfrost config debug: msg: "The Panfrost display driver configuration was changed, but needs a reboot to be applied." diff --git a/config/automatrop/roles/system/tasks/main.yml b/config/automatrop/roles/system/tasks/main.yml index 6b78d93..7f9ce9f 100644 --- a/config/automatrop/roles/system/tasks/main.yml +++ b/config/automatrop/roles/system/tasks/main.yml @@ -79,75 +79,6 @@ ### STOPPED HERE ### -- name: Configure wpa_supplicant - template: - src: wpa_supplicant.conf.j2 - dest: /etc/wpa_supplicant/wpa_supplicant.conf - notify: - - etc changed - - wpa_supplicant changed - become: yes - tags: - - wificonf - -- name: Prepare directory for wpa_supplicant service override - file: - path: /etc/systemd/system/wpa_supplicant@.service.d - state: directory - mode: "u=rwx,g=rx,o=rx" - become: yes - -- name: Make wpa_supplicant use a common configuration file - copy: - src: wpa_supplicant.service - dest: /etc/systemd/system/wpa_supplicant@.service.d/override.conf - become: yes - notify: - - etc changed - - systemd changed - - wifi setup changed - -- name: Disable wpa_supplicant for networkmanager - systemd: - name: wpa_supplicant - enabled: no - become: yes - notify: - - etc changed - - wifi setup changed - -- name: Start/enable wpa_supplicant for interface - systemd: - name: "wpa_supplicant@{{ item }}" - enabled: yes - become: yes - notify: - - etc changed - - wifi setup changed - loop: "{{ ansible_interfaces }}" - when: "item.startswith('wl')" -# Could probably use something better like -# listing /sys/class/ieee80211/*/device/net/ - -- name: Uninstall networkmanager - pacman: - name: networkmanager - state: absent - extra_args: "--cascade --recursive" - when: arch_based - become: yes - notify: - - wifi setup changed - -- name: Mask systemd-networkd - systemd: - name: systemd-networkd - state: stopped - enabled: no - masked: yes - become: yes - notify: etc changed - # Time synchronisation - name: Mask systemd-timesyncd diff --git a/config/automatrop/roles/system/templates/wpa_supplicant.conf.j2 b/config/automatrop/roles/system/templates/wpa_supplicant.conf.j2 deleted file mode 100644 index b380481..0000000 --- a/config/automatrop/roles/system/templates/wpa_supplicant.conf.j2 +++ /dev/null @@ -1,102 +0,0 @@ -# Giving configuration update rights to wpa_cli -ctrl_interface=/run/wpa_supplicant -ctrl_interface_group=wheel -update_config=1 - -# AP scanning -ap_scan=1 - -# ISO/IEC alpha2 country code in which the device is operating -country=NL - -{% set password_store_path = lookup('env', 'PASSWORD_STORE_DIR') or ansible_user_dir + '/.password-store/' %} -{% set wifi_pass_paths = query('fileglob', password_store_path + 'wifi/*.gpg') %} -{% set names = wifi_pass_paths | map('regex_replace', '^.+/wifi/(.+).gpg$', '\\1') | sort%} -{% for name in names %} -{# -community.general.passwordstore doesn't support path with spaces in it, -so we're using a `ssid` attribute, which default to the names for SSIDs without space. -#} -{% set suffixes = lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=suffixes') or [''] %} -{% set ssid = lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=ssid') or name %} -{% set type = lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=type') or 'wpa' %} -{% if type in ('wpa', 'wep', 'wpa-eap') %} -{% set pass = lookup('community.general.passwordstore', 'wifi/' + name) %} -{% else %} -{% set pass = 'Error, no pass for type ' + type %} -{% endif %} -# {{ name }} -{% for suffix in suffixes %} -network={ - ssid="{{ ssid }}{{ suffix }}" -{% if type == 'wpa' %} - psk="{{ pass }}" -{% elif type == 'wep' %} - key_mgmt=NONE - wep_key0={{ pass }} -{% elif type == 'wpa-eap' %} - key_mgmt=WPA-EAP - eap={{ lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=eap') }} - identity="{{ lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=identity') }}" - password="{{ pass }}" - ca_cert="{{ lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=ca_cert') }}" - altsubject_match="{{ lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=altsubject_match') }}" - phase2="{{ lookup('community.general.passwordstore', 'wifi/' + name + ' subkey=phase2') }}" -{% elif type == 'open' %} - key_mgmt=NONE -{% else %} - # Error, unknown type: {{ type }} -{% endif %} -} -{% endfor %} - -{% endfor %} -{# REFERENCES - -# WPA -network={ - ssid="WPA_SSID" - psk="XXXXXXXXXXXXXXXXXXXXXXXXXX" -} - -# WEP -network={ - ssid="WEP_SSID" - key_mgmt=NONE - wep_key0=FFFFFFFFFFFFFFFFFFFFFFFFFF -} - -# Open -network={ - ssid="OPEN_SSID" - key_mgmt=NONE -} - -# eduroam password -network={ - ssid="eduroam" - key_mgmt=WPA-EAP - eap=PEAP - identity="id@univ.tld" - password="hunter2" -} - -# eduroam certificate -network={ - ssid="eduroam" - key_mgmt=WPA-EAP - # pairwise=CCMP - pairwise=CCMP TKIP - group=CCMP TKIP - eap=TLS - ca_cert="/path/to/ca.pem" - identity="id@univ.tld" - domain_suffix_match="wifi.univ.tld" - client_cert="/path/to/cert.pem" - private_key="/path/to/key.pem" - private_key_passwd="hunter2" - phase2="auth=" - #anonymous_identity="" -} - -#} diff --git a/config/nix/modules/wireless.nix b/config/nix/modules/wireless.nix index ef2a339..e68ba94 100644 --- a/config/nix/modules/wireless.nix +++ b/config/nix/modules/wireless.nix @@ -1,5 +1,14 @@ { pkgs, ... }: { - networking.wireless.enable = true; # Enable wireless support via wpa_supplicant + # wireless support via wpa_supplicant + # TODO This doesn't change anything, at least in the VM + networking.wireless = { + enable = true; + networks = builtins.fromJSON ./wireless/networks.json; # If this file doesn't exist, run ./wireless/import.py + extraConfig = '' + country=NL + ''; + interfaces = ["eth0"]; + }; environment.systemPackages = with pkgs; [ wirelesstools ]; } diff --git a/config/nix/modules/wireless/.gitignore b/config/nix/modules/wireless/.gitignore new file mode 100644 index 0000000..25887d8 --- /dev/null +++ b/config/nix/modules/wireless/.gitignore @@ -0,0 +1,2 @@ +networks.json +networks.env diff --git a/config/nix/modules/wireless/import.py b/config/nix/modules/wireless/import.py new file mode 100755 index 0000000..ea1ea40 --- /dev/null +++ b/config/nix/modules/wireless/import.py @@ -0,0 +1,161 @@ +#!/usr/bin/env python3 + +""" +Exports Wi-Fi networks configuration stored in pass into a format readable by Nix. +""" + +# TODO EAP ca_cert=/etc/ssl/... probably won't work. Example fix: +# builtins.fetchurl { +# url = "https://letsencrypt.org/certs/isrgrootx1.pem"; +# sha256 = "sha256:1la36n2f31j9s03v847ig6ny9lr875q3g7smnq33dcsmf2i5gd92"; +# } + +import hashlib +import json +import os +import subprocess + +import yaml + +# passpy doesn't handle encoding properly, so doing this with calls + +PASSWORD_STORE = os.path.expanduser("~/.password-store") +SUBFOLDER = "wifi" +SEPARATE_PASSWORDS = False +# TODO Find a way to make then env file available at whatever time it is needed + + +class Password: + all: list["Password"] = list() + + def __init__(self, path: str, content: str): + self.path = path + self.content = content + + Password.all.append(self) + + def var(self) -> str: + # return self.path.split("/")[-1].upper() + m = hashlib.sha256() + m.update(self.path.encode()) + return m.hexdigest().upper() + + def val(self) -> str: + return self.content + + def key(self) -> str: + if SEPARATE_PASSWORDS: + return f"@{self.var()}@" + else: + return self.val() + + @classmethod + def vars(cls) -> dict[str, str]: + vars = dict() + for password in cls.all: + if not password.content: + continue + var = password.var() + assert var not in vars, f"Duplicate key: {var}" + vars[var] = password.val() + return vars + + +def list_networks() -> list[str]: + paths = [] + pass_folder = os.path.join(PASSWORD_STORE, SUBFOLDER) + for filename in os.listdir(pass_folder): + if not filename.endswith(".gpg"): + continue + filepath = os.path.join(pass_folder, filename) + if not os.path.isfile(filepath): + continue + + file = filename[:-4] + path = os.path.join(SUBFOLDER, file) + paths.append(path) + return paths + + +def format_wpa_supplicant_conf(conf: dict, indent: str = "") -> str: + lines = [] + for k, v in conf.items(): + if isinstance(v, str): + val = '"' + v.replace('"', '\\"') + '"' + elif isinstance(v, Password): + val = v.key() + elif isinstance(v, list): + assert all( + map(lambda i: isinstance(i, str), v) + ), "Only list of strings supported" + val = " ".join(v) + else: + val = str(v) + lines.append(f"{indent}{k}={val}") + return "\n".join(lines) + + +networks = {} +for path in list_networks(): + proc = subprocess.run(["pass", path], stdout=subprocess.PIPE) + proc.check_returncode() + + raw = proc.stdout.decode() + split = raw.split("\n") + + password = Password(path, split[0]) + data = yaml.safe_load("\n".join(split[1:])) or dict() + # print(path, data) # DEBUG + + # Helpers to prevent repetition + suffixes = data.pop("suffixes", [""]) + data.setdefault("key_mgmt", ["WPA-PSK"] if password else ["NONE"]) + if password: + if any(map(lambda m: "PSK" in m.split("-"), data["key_mgmt"])): + data["psk"] = password + if "NONE" in data["key_mgmt"]: + data["wep_key0"] = password + if any(map(lambda m: "EAP" in m.split("-"), data["key_mgmt"])): + data["password"] = password + assert "ssid" in data, f"{path}: Missing SSID" + + # # Output wpa_supplicant conf, for debug + # for suffix in suffixes: + # wpas = data.copy() + # wpas["ssid"] += suffix + # print(f"# {path}") + # print("network={") + # print(format_wpa_supplicant_conf(wpas, indent=" ")) + # print("}") + # print() + + # Convert to nix configuration + ssid = data.pop("ssid") + network = {} + key_mgmt = data.pop("key_mgmt", None) + psk = data.pop("psk", None) + priority = data.pop("priority", None) + # No support for hidden + # No support for extraConfig (all is assumed to be auth) + if key_mgmt: + network["authProtocols"] = key_mgmt + if psk: + network["pskRaw"] = psk.key() + if data: + raise NotImplementedError(f"{path}: Unhandled non-auth extra: {data}") + else: + if data: + network["auth"] = format_wpa_supplicant_conf(data) + if priority: + network["priority"] = int(priority) + + for suffix in suffixes: + networks[ssid + suffix] = network + +with open("networks.json", "w") as fd: + json.dump(networks, fd, indent=4) + +with open("networks.env", "w") as fd: + if SEPARATE_PASSWORDS: + for k, v in Password.vars().items(): + print(f"{k}={v}", file=fd) From e1788dbd24e0ba9133ef888d009637661070c6ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 28 Oct 2023 19:33:40 +0200 Subject: [PATCH 011/108] nix: chrony --- .../automatrop/roles/system/files/chrony.conf | 7 ---- .../roles/system/files/dhcpcd.exit-hook | 5 --- config/automatrop/roles/system/tasks/main.yml | 37 ------------------- config/nix/modules/common.nix | 11 +++++- config/nix/modules/wireless.nix | 1 + 5 files changed, 10 insertions(+), 51 deletions(-) delete mode 100644 config/automatrop/roles/system/files/chrony.conf delete mode 100644 config/automatrop/roles/system/files/dhcpcd.exit-hook diff --git a/config/automatrop/roles/system/files/chrony.conf b/config/automatrop/roles/system/files/chrony.conf deleted file mode 100644 index ed8df86..0000000 --- a/config/automatrop/roles/system/files/chrony.conf +++ /dev/null @@ -1,7 +0,0 @@ -server 0.europe.pool.ntp.org offline -server 1.europe.pool.ntp.org offline -server 2.europe.pool.ntp.org offline -server 3.europe.pool.ntp.org offline -driftfile /etc/chrony.drift -rtconutc -rtcsync diff --git a/config/automatrop/roles/system/files/dhcpcd.exit-hook b/config/automatrop/roles/system/files/dhcpcd.exit-hook deleted file mode 100644 index 7f08fd8..0000000 --- a/config/automatrop/roles/system/files/dhcpcd.exit-hook +++ /dev/null @@ -1,5 +0,0 @@ -if $if_up; then - chronyc online -elif $if_down; then - chronyc offline -fi diff --git a/config/automatrop/roles/system/tasks/main.yml b/config/automatrop/roles/system/tasks/main.yml index 7f9ce9f..03cdc0d 100644 --- a/config/automatrop/roles/system/tasks/main.yml +++ b/config/automatrop/roles/system/tasks/main.yml @@ -79,43 +79,6 @@ ### STOPPED HERE ### -# Time synchronisation - -- name: Mask systemd-timesyncd - systemd: - name: systemd-timesyncd - state: stopped - enabled: no - masked: yes - become: yes - notify: etc changed - -- name: Configure chrony - copy: - src: chrony.conf - dest: /etc/chrony.conf - become: yes - notify: - - etc changed - - chrony reconfigured -# TODO More configuration, RTC configuration - -- name: Enable chronyd - systemd: - name: chronyd - enabled: yes - become: yes - notify: - - etc changed - - chrony reconfigured - -- name: Configure dhcpcd chrony hook - copy: - src: dhcpcd.exit-hook - dest: /etc/dhcpcd.exit-hook - become: yes - notify: etc changed - - name: Empty motd copy: content: "" diff --git a/config/nix/modules/common.nix b/config/nix/modules/common.nix index 95fb406..17763ac 100644 --- a/config/nix/modules/common.nix +++ b/config/nix/modules/common.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { boot.loader.grub.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -142,7 +142,14 @@ # Enable the OpenSSH daemon openssh.enable = true; getty.autologinUser = "geoffrey"; # DEBUG - chrony.enable = true; + + # Time sychronisation + chrony = { + enable = true; + servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3); + extraConfig = "rtcsync"; + }; + }; # TEST diff --git a/config/nix/modules/wireless.nix b/config/nix/modules/wireless.nix index e68ba94..c583dcf 100644 --- a/config/nix/modules/wireless.nix +++ b/config/nix/modules/wireless.nix @@ -11,4 +11,5 @@ interfaces = ["eth0"]; }; environment.systemPackages = with pkgs; [ wirelesstools ]; + services.chrony.serverOption = "offline"; } From 4a560cf5d495300aad8ce353ed40ce636c892282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 28 Oct 2023 20:45:56 +0200 Subject: [PATCH 012/108] nix: Finish system config --- .../roles/system/files/openvpn-client.service | 11 ---- .../roles/system/handlers/main.yaml | 5 -- config/automatrop/roles/system/tasks/main.yml | 50 ------------------- config/nix/modules/common.nix | 19 +++++-- 4 files changed, 16 insertions(+), 69 deletions(-) delete mode 100644 config/automatrop/roles/system/files/openvpn-client.service diff --git a/config/automatrop/roles/system/files/openvpn-client.service b/config/automatrop/roles/system/files/openvpn-client.service deleted file mode 100644 index 1748351..0000000 --- a/config/automatrop/roles/system/files/openvpn-client.service +++ /dev/null @@ -1,11 +0,0 @@ -[Service] -ExecStart= -ExecStart=/usr/bin/openvpn --suppress-timestamps --nobind --config %i.conf --script-security 2 --up /etc/openvpn/update-resolv-conf --down /etc/openvpn/update-resolv-conf -# The part before --script-security 2 might need upgrading from -# /usr/lib/systemd/system/openvpn-client@.service if it was upgraded -Restart=on-failure -User= -AmbiantCapabilities= -# It's not pretty, but other script only work with systemd or call resolvconf with -p, -# which doesn't work without a local DNS resolver -# TODO Local DNS resolver sounds nice anyway diff --git a/config/automatrop/roles/system/handlers/main.yaml b/config/automatrop/roles/system/handlers/main.yaml index 9bda647..307a93b 100644 --- a/config/automatrop/roles/system/handlers/main.yaml +++ b/config/automatrop/roles/system/handlers/main.yaml @@ -23,8 +23,3 @@ debug: msg: "The Panfrost display driver configuration was changed, but needs a reboot to be applied." listen: panfrost config changed - -- name: Reload systemd-logind - command: systemctl kill -s HUP systemd-logind - become: yes - listen: systemd-logind config changed diff --git a/config/automatrop/roles/system/tasks/main.yml b/config/automatrop/roles/system/tasks/main.yml index 03cdc0d..77a75fc 100644 --- a/config/automatrop/roles/system/tasks/main.yml +++ b/config/automatrop/roles/system/tasks/main.yml @@ -76,53 +76,3 @@ - etc changed - systemd changed when: not auto_numlock - -### STOPPED HERE ### - -- name: Empty motd - copy: - content: "" - dest: /etc/motd - mode: "u=rw,g=r,o=r" - become: yes - notify: - - etc changed - -# VPN configuration - -- name: Prepare directory for openvpn-client service override - file: - path: /etc/systemd/system/openvpn-client@.service.d - state: directory - mode: "u=rwx,g=rx,o=rx" - become: yes - -- name: Make openvpn use hooks for resolvconf - copy: - src: openvpn-client.service - dest: /etc/systemd/system/openvpn-client@.service.d/override.conf - become: yes - notify: - - etc changed - - systemd changed - -- name: Disable power button - lineinfile: - path: /etc/systemd/logind.conf - line: 'HandlePowerKey=ignore' - regexp: '^#? *HandlePowerKey=' - insertafter: '^\[Login\]$' - become: yes - notify: systemd-logind config changed - # Reason: I sometimes press it accidentally - # (hoping to start it when it's already started, - # or really accidentally on the Pinebook). - # Suspend would be nice, but it doesn't have the locker then - -# TODO Hibernation, if that's relevant -# $ sudo blkid | grep 'TYPE="swap"' -# $ sudoedit /etc/default/grub -# Add resume=UUID= to GRUB_CMDLINE_LINUX_DEFAULT -# $ sudo grub-mkconfig -o /boot/grub/grub.cfg - -# TODO udevil diff --git a/config/nix/modules/common.nix b/config/nix/modules/common.nix index 17763ac..193fb81 100644 --- a/config/nix/modules/common.nix +++ b/config/nix/modules/common.nix @@ -122,6 +122,9 @@ # Might want to see if it's worth using on NixOS gnupg.agent.enable = true; + # Let users mount disks + udevil.enable = true; + # TODO Below should be user config zsh = { @@ -145,13 +148,23 @@ # Time sychronisation chrony = { - enable = true; - servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3); - extraConfig = "rtcsync"; + enable = true; + servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3); + extraConfig = "rtcsync"; }; + # Prevent power button from shutting down the computer. + # On Pinebook it's too easy to hit, + # on others I sometimes turn it off when unsuspending. + logind.extraConfig = "HandlePowerKey=ignore"; + }; + # FIXME services.openvpn.servers..updateResolvConf=true + # For profiles in the extensions + + # TODO Hibernation? + # TEST system.copySystemConfiguration = true; From ef9a1ceb26d8c26f5f384eb2147a78becf644365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 28 Oct 2023 20:53:22 +0200 Subject: [PATCH 013/108] nix: Remove already considered things in automatrop --- config/automatrop/playbooks/default.yml | 5 --- .../roles/ecryptfs_automount/README.md | 17 ---------- .../roles/ecryptfs_automount/tasks/main.yml | 34 ------------------- config/automatrop/roles/facts/tasks/main.yml | 20 ----------- .../roles/software/handlers/main.yml | 23 ------------- .../roles/software/templates/PKGBUILD.j2 | 14 -------- .../roles/system/handlers/main.yaml | 14 -------- config/automatrop/roles/system/tasks/main.yml | 8 ----- 8 files changed, 135 deletions(-) delete mode 100644 config/automatrop/roles/ecryptfs_automount/README.md delete mode 100644 config/automatrop/roles/ecryptfs_automount/tasks/main.yml delete mode 100644 config/automatrop/roles/facts/tasks/main.yml delete mode 100644 config/automatrop/roles/software/handlers/main.yml delete mode 100644 config/automatrop/roles/software/templates/PKGBUILD.j2 diff --git a/config/automatrop/playbooks/default.yml b/config/automatrop/playbooks/default.yml index 4a68ab7..61b48a9 100644 --- a/config/automatrop/playbooks/default.yml +++ b/config/automatrop/playbooks/default.yml @@ -1,17 +1,12 @@ - name: Default hosts: all roles: - - role: facts - tags: facts - role: access tags: access when: root_access - role: system tags: system when: root_access - - role: ecryptfs_automount - tags: ecryptfs_automount - when: encrypt_home_stacked_fs - role: dotfiles tags: dotfiles - role: vim diff --git a/config/automatrop/roles/ecryptfs_automount/README.md b/config/automatrop/roles/ecryptfs_automount/README.md deleted file mode 100644 index de12a3b..0000000 --- a/config/automatrop/roles/ecryptfs_automount/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# ecryptfs_automount - -Configure pam to allow auto-mounting of encrypted home directories with eCryptfs. - -## Usage - -You still need to run the following for an user directory to be encrypted: - -```bash -modprobe ecryptfs -ecryptfs-migrate-home -u username -``` - -## Source - -https://wiki.archlinux.org/title/ECryptfs#Auto-mounting - diff --git a/config/automatrop/roles/ecryptfs_automount/tasks/main.yml b/config/automatrop/roles/ecryptfs_automount/tasks/main.yml deleted file mode 100644 index 9cc3a2c..0000000 --- a/config/automatrop/roles/ecryptfs_automount/tasks/main.yml +++ /dev/null @@ -1,34 +0,0 @@ -- name: Setup pam_encryptfs auth - blockinfile: - path: /etc/pam.d/system-auth - block: | - auth [success=1 default=ignore] pam_succeed_if.so service = systemd-user quiet - auth required pam_ecryptfs.so unwrap - insertafter: '^(auth\s+required\s+pam_unix.so|auth\s+\[default=die\]\s+pam_faillock.so\s+authfail)$' - marker: "# {mark} AUTOMATROP ECRYPTFS_AUTOMOUNT AUTH" - become: yes - notify: - - etc changed - -- name: Setup pam_encryptfs password - blockinfile: - path: /etc/pam.d/system-auth - block: | - password optional pam_ecryptfs.so unwrap - insertbefore: '^(password\s+required\s+pam_unix.so|-password\s+\[success=1\s+default=ignore\]\s+pam_systemd_home.so)$' - marker: "# {mark} AUTOMATROP ECRYPTFS_AUTOMOUNT PASSWORD" - become: yes - notify: - - etc changed - -- name: Setup pam_encryptfs session - blockinfile: - path: /etc/pam.d/system-auth - block: | - session [success=1 default=ignore] pam_succeed_if.so service = systemd-user quiet - session optional pam_ecryptfs.so unwrap - insertafter: '^session\s+required\s+pam_unix.so$' - marker: "# {mark} AUTOMATROP ECRYPTFS_AUTOMOUNT SESSION" - become: yes - notify: - - etc changed diff --git a/config/automatrop/roles/facts/tasks/main.yml b/config/automatrop/roles/facts/tasks/main.yml deleted file mode 100644 index fd07ad9..0000000 --- a/config/automatrop/roles/facts/tasks/main.yml +++ /dev/null @@ -1,20 +0,0 @@ -- name: Set facts - set_fact: - arch_based: "{{ ansible_distribution == 'Archlinux' }}" - arch: "{{ ansible_lsb.id == 'Arch' }}" - manjaro: "{{ ansible_lsb.id == 'Manjaro' or ansible_lsb.id == 'Manjaro-ARM' }}" - termux: "{{ ansible_distribution == 'OtherLinux' and ansible_python.executable == '/data/data/com.termux/files/usr/bin/python' }}" - debian: "{{ ansible_distribution == 'Debian' }}" - ubuntu: "{{ ansible_distribution == 'Ubuntu' }}" - junest: "{{ ansible_distribution == 'Archlinux' and ansible_is_chroot }}" # TODO Check if /etc/junest exists - tags: - - always - -- name: Set composed facts - set_fact: - debian_based: "{{ debian or ubuntu }}" - can_chown: "{{ not junest }}" - has_systemd: "{{ not junest }}" - tags: - - always -# TODO Make this a real Ansible fact maybe? diff --git a/config/automatrop/roles/software/handlers/main.yml b/config/automatrop/roles/software/handlers/main.yml deleted file mode 100644 index 2f759f8..0000000 --- a/config/automatrop/roles/software/handlers/main.yml +++ /dev/null @@ -1,23 +0,0 @@ -- name: Create and install meta package for Arch Linux - block: - - name: Generate meta package PKGBUILD - template: - src: PKGBUILD.j2 - dest: "{{ ansible_user_dir }}/.cache/automatrop/PKGBUILD" - listen: "software changed" - - - name: Install meta package - aur: - name: "automatrop-packages-{{ inventory_hostname_short }}" - local_pkgbuild: "{{ ansible_user_dir }}/.cache/automatrop" - use: makepkg - state: latest - listen: "software changed" - when: root_access - when: arch_based - -- name: update pacman cache - pacman: - update_cache: yes - become: yes - when: arch_based diff --git a/config/automatrop/roles/software/templates/PKGBUILD.j2 b/config/automatrop/roles/software/templates/PKGBUILD.j2 deleted file mode 100644 index 8f424c6..0000000 --- a/config/automatrop/roles/software/templates/PKGBUILD.j2 +++ /dev/null @@ -1,14 +0,0 @@ -# Maintainer: Geoffrey Frogeye - -pkgname=automatrop-packages-{{ inventory_hostname_short }} -pkgver={{ ansible_date_time.iso8601_basic_short }} -pkgrel=1 -pkgdesc='Metapackage for packages wanted by Geoffrey via automatrop for {{ inventory_hostname }}' -url='https://git.frogeye.fr/geoffrey/dotfiles/src/branch/master/config/automatrop' -arch=('any') -license=('GPL') -depends=( -{% for package in packages %} - '{{ package }}' -{% endfor %} -) diff --git a/config/automatrop/roles/system/handlers/main.yaml b/config/automatrop/roles/system/handlers/main.yaml index 307a93b..789dcca 100644 --- a/config/automatrop/roles/system/handlers/main.yaml +++ b/config/automatrop/roles/system/handlers/main.yaml @@ -1,17 +1,3 @@ -- name: Create a etckeeper commit - command: "etckeeper commit 'automatrop {{ ansible_date_time.iso8601 }}'" - listen: "etc changed" - become: yes - register: etckeeper_commit - failed_when: "etckeeper_commit.rc != 0 and 'nothing to commit' not in etckeeper_commit.stdout" - changed_when: "'nothing to commit' not in etckeeper_commit.stdout" - -- name: Restart chrony - systemd: - name: chronyd - state: restarted - listen: chrony reconfigured - become: yes - name: Reload systemd daemon systemd: diff --git a/config/automatrop/roles/system/tasks/main.yml b/config/automatrop/roles/system/tasks/main.yml index 77a75fc..f7a3e0d 100644 --- a/config/automatrop/roles/system/tasks/main.yml +++ b/config/automatrop/roles/system/tasks/main.yml @@ -1,7 +1,3 @@ -# TODO For other distributions - -# Package are installed with --asdeps because they are needed - # Xorg configuration - name: Check if there is Intel backlight @@ -25,7 +21,6 @@ dest: "{{ item }}/20-intel_backlight.conf" become: yes when: display_server == 'x11' and intel_backlight.stat.exists - notify: etc changed loop: "{{ xorg_common_config_dirs }}" - name: Configure Xorg joystick behaviour @@ -34,7 +29,6 @@ dest: "{{ item }}/50-joystick.conf" become: yes when: display_server == 'x11' - notify: etc changed loop: "{{ xorg_common_config_dirs }}" - name: List modules we're using @@ -63,7 +57,6 @@ dest: /etc/systemd/system/getty@.service.d/override.conf become: yes notify: - - etc changed - systemd changed when: auto_numlock @@ -73,6 +66,5 @@ state: absent become: yes notify: - - etc changed - systemd changed when: not auto_numlock From 98efabc904fc1b22cc61b2e6eb17ebf7a8dcd6d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 28 Oct 2023 22:09:36 +0200 Subject: [PATCH 014/108] nix: Revise structure for home-manager --- config/nix/build.sh | 2 +- config/nix/configuration.nix | 13 -- config/nix/curacao.nix | 9 + config/nix/hm/common.nix | 100 ++++++++++ config/nix/hm/desktop.nix | 70 +++++++ config/nix/{modules => hm}/dev.nix | 2 +- config/nix/{modules => hm}/extra.nix | 8 +- config/nix/hm/loader.nix | 9 + config/nix/modules/common.nix | 174 ------------------ config/nix/{modules => os}/battery.nix | 0 config/nix/os/common.nix | 73 ++++++++ config/nix/{modules => os}/desktop.nix | 74 +------- config/nix/os/geoffrey.nix | 22 +++ config/nix/os/loader.nix | 10 + .../nix/{modules => os}/qwerty-fr-keypad.diff | 0 config/nix/{modules => os}/wireless.nix | 0 .../nix/{modules => os}/wireless/.gitignore | 0 config/nix/{modules => os}/wireless/import.py | 0 config/nix/pindakaas.nix | 9 + config/nix/testvim.nix | 6 + config/nix/testvm.nix | 8 + 21 files changed, 322 insertions(+), 267 deletions(-) delete mode 100644 config/nix/configuration.nix create mode 100644 config/nix/curacao.nix create mode 100644 config/nix/hm/common.nix create mode 100644 config/nix/hm/desktop.nix rename config/nix/{modules => hm}/dev.nix (95%) rename config/nix/{modules => hm}/extra.nix (80%) create mode 100644 config/nix/hm/loader.nix delete mode 100644 config/nix/modules/common.nix rename config/nix/{modules => os}/battery.nix (100%) create mode 100644 config/nix/os/common.nix rename config/nix/{modules => os}/desktop.nix (50%) create mode 100644 config/nix/os/geoffrey.nix create mode 100644 config/nix/os/loader.nix rename config/nix/{modules => os}/qwerty-fr-keypad.diff (100%) rename config/nix/{modules => os}/wireless.nix (100%) rename config/nix/{modules => os}/wireless/.gitignore (100%) rename config/nix/{modules => os}/wireless/import.py (100%) create mode 100644 config/nix/pindakaas.nix create mode 100644 config/nix/testvim.nix create mode 100644 config/nix/testvm.nix diff --git a/config/nix/build.sh b/config/nix/build.sh index 2e3ac4d..001b47c 100755 --- a/config/nix/build.sh +++ b/config/nix/build.sh @@ -2,4 +2,4 @@ export NIXPKGS_ALLOW_UNFREE=1 nix-build '' -A vm \ -I nixpkgs=channel:nixos-23.05 \ --I nixos-config=./configuration.nix +-I nixos-config=./testvm.nix diff --git a/config/nix/configuration.nix b/config/nix/configuration.nix deleted file mode 100644 index 1d7c485..0000000 --- a/config/nix/configuration.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: -{ - imports = [ - - # - ./modules/common.nix - ./modules/desktop.nix - ./modules/battery.nix - ./modules/wireless.nix - ./modules/extra.nix - ./modules/dev.nix - ]; -} diff --git a/config/nix/curacao.nix b/config/nix/curacao.nix new file mode 100644 index 0000000..73f8c24 --- /dev/null +++ b/config/nix/curacao.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + imports = [ + + ./os/loader.nix + ]; + + networking.hostName = "curacao.geoffrey.frogeye.fr"; +} diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix new file mode 100644 index 0000000..2479899 --- /dev/null +++ b/config/nix/hm/common.nix @@ -0,0 +1,100 @@ +{ pkgs, ... }: +{ + home.stateVersion = "23.05"; + programs.home-manager.enable = true; + + programs = { + zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + enableSyntaxHighlighting = true; + # syntaxHighlighting.enable = true; # 23.11 syntax + }; + neovim = { + enable = true; + defaultEditor = true; + vimAlias = true; + viAlias = true; + }; + }; + + + home.packages = with pkgs; [ + # dotfiles dependencies + coreutils + bash + gnugrep + gnused + gnutar + openssl + git + wget + curl + python3Packages.pip + ansible # TODO Reevaluate + + # shell + zsh-completions + nix-zsh-completions + zsh-history-substring-search + antigen # TODO Reevaluate + powerline-go + + # terminal essentials + moreutils + man + visidata + nodePackages.insect + translate-shell + unzip + unrar + p7zip + + # remote + openssh + rsync + borgbackup + + # cleanup + jdupes + duperemove + optipng + libjpeg + # FIXME reflac not available (but also a dumb shell script) + + # local monitoring + htop + iotop + iftop + lsof + strace + pv + progress + speedtest-cli + + # multimedia toolbox + ffmpeg + sox + imagemagick + + # password + pass + pwgen + + # Mail + isync + msmtp + notmuch + neomutt + lynx + + # Organisation + vdirsyncer + khard + khal + todoman + syncthing + + ]; +} diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix new file mode 100644 index 0000000..4165f1a --- /dev/null +++ b/config/nix/hm/desktop.nix @@ -0,0 +1,70 @@ +{ pkgs, ... }: +{ + xsession.windowManager.i3.enable = true; + + home.packages = with pkgs; [ + # remote + tigervnc + + # music + mpd + mpc-cli + ashuffle + vimpc + + # multimedia common + gimp + inkscape + mpv + mpvScripts.thumbnail + libreoffice + + # data management + freefilesync + + # browsers + firefox + qutebrowser + + # fonts + dejavu_fonts + twemoji-color-font + xfce.thunar + gnome.gedit + feh + zathura + zbar + zathura + meld + python3Packages.magic + yubikey-touch-detector + + # x11-exclusive + libgnomekbd # to show keyboard layout + dunst + i3lock + numlockx + rofi + rofimoji + rxvt-unicode + # TODO urxvt-resize-font-git + scrot + simplescreenrecorder + trayer + unclutter + xautolock + xclip + lemonbar-xft + autorandr + keynav + sct + xorg.xinit + xorg.xbacklight + + alacritty + + # organisation + rofi-pass # TODO Try autopass.cr + thunderbird + ]; +} diff --git a/config/nix/modules/dev.nix b/config/nix/hm/dev.nix similarity index 95% rename from config/nix/modules/dev.nix rename to config/nix/hm/dev.nix index fdde56e..1e68ef8 100644 --- a/config/nix/modules/dev.nix +++ b/config/nix/hm/dev.nix @@ -2,7 +2,7 @@ { # TODO Separate in diffrent packages once the structure is finalized... # or connvert into per-directory requirements - users.users.geoffrey. packages = with pkgs; [ + home.packages = with pkgs; [ # Ansible ansible ansible-lint diff --git a/config/nix/modules/extra.nix b/config/nix/hm/extra.nix similarity index 80% rename from config/nix/modules/extra.nix rename to config/nix/hm/extra.nix index 36699d5..f1c36d3 100644 --- a/config/nix/modules/extra.nix +++ b/config/nix/hm/extra.nix @@ -1,6 +1,6 @@ { pkgs, ... }: { - users.users.geoffrey. packages = with pkgs; [ + home.packages = with pkgs; [ # android tools android-tools @@ -16,7 +16,7 @@ # downloading yt-dlp megatools - transmission + # transmission TODO Collision if both transmissions are active? transmission-qt # wine @@ -41,8 +41,4 @@ # TODO factorio ]; - environment.systemPackages = with pkgs; [ - # android tools - android-udev-rules - ]; } diff --git a/config/nix/hm/loader.nix b/config/nix/hm/loader.nix new file mode 100644 index 0000000..f6f3089 --- /dev/null +++ b/config/nix/hm/loader.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + imports = [ + ./common.nix + ./dev.nix + ./extra.nix + ./desktop.nix + ]; +} diff --git a/config/nix/modules/common.nix b/config/nix/modules/common.nix deleted file mode 100644 index 193fb81..0000000 --- a/config/nix/modules/common.nix +++ /dev/null @@ -1,174 +0,0 @@ -{ pkgs, lib, ... }: -{ - boot.loader.grub.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "nixos"; - - time.timeZone = "Europe/Amsterdam"; - - # TODO qwerty-fr for console - - # Enable CUPS to print documents - services.printing.enable = true; - - # Enable passwordless sudo - security.sudo.extraRules = [{ - groups = [ "wheel" ]; - commands = [{ - command = "ALL"; - options = [ "NOPASSWD" ]; - }]; - }]; - - # Users - users.users.geoffrey = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - # dotfiles dependencies - coreutils - bash - gnugrep - gnused - gnutar - openssl - git - wget - curl - python3Packages.pip - ansible # TODO Reevaluate - - # shell - zsh-completions - nix-zsh-completions - zsh-history-substring-search - antigen # TODO Reevaluate - powerline-go - - # terminal essentials - moreutils - man - visidata - nodePackages.insect - translate-shell - unzip - unrar - p7zip - - # remote - openssh - rsync - borgbackup - - # cleanup - jdupes - duperemove - optipng - libjpeg - # FIXME reflac not available (but also a dumb shell script) - - # local monitoring - htop - iotop - iftop - lsof - strace - pv - progress - speedtest-cli - - # multimedia toolbox - ffmpeg - sox - imagemagick - - # password - pass - pwgen - - # Mail - isync - msmtp - notmuch - neomutt - lynx - - # Organisation - vdirsyncer - khard - khal - todoman - syncthing - - ]; - initialPassword = "cartable"; # DEBUG - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE41gxrO8oZ5n3saapSwZDViOQphm6RzqgsBUyA88pU geoffrey@frogeye.fr" - ]; - }; - - environment.systemPackages = with pkgs; [ - wget - kexec-tools - openvpn - update-resolv-conf # TODO Is it what I think it is? - ]; - - # Enable compilation cache - programs = { - ccache.enable = true; - # TODO Not enough, see https://nixos.wiki/wiki/CCache. - # Might want to see if it's worth using on NixOS - gnupg.agent.enable = true; - - # Let users mount disks - udevil.enable = true; - - # TODO Below should be user config - - zsh = { - enable = true; - autosuggestions.enable = true; - enableCompletion = true; - syntaxHighlighting.enable = true; - }; - neovim = { - enable = true; - defaultEditor = true; - vimAlias = true; - viAlias = true; - }; - }; - - services = { - # Enable the OpenSSH daemon - openssh.enable = true; - getty.autologinUser = "geoffrey"; # DEBUG - - # Time sychronisation - chrony = { - enable = true; - servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3); - extraConfig = "rtcsync"; - }; - - # Prevent power button from shutting down the computer. - # On Pinebook it's too easy to hit, - # on others I sometimes turn it off when unsuspending. - logind.extraConfig = "HandlePowerKey=ignore"; - - }; - - # FIXME services.openvpn.servers..updateResolvConf=true - # For profiles in the extensions - - # TODO Hibernation? - - # TEST - system.copySystemConfiguration = true; - - # Use defaults from - system.stateVersion = "23.05"; - -} diff --git a/config/nix/modules/battery.nix b/config/nix/os/battery.nix similarity index 100% rename from config/nix/modules/battery.nix rename to config/nix/os/battery.nix diff --git a/config/nix/os/common.nix b/config/nix/os/common.nix new file mode 100644 index 0000000..2b8a311 --- /dev/null +++ b/config/nix/os/common.nix @@ -0,0 +1,73 @@ +{ pkgs, lib, ... }: +{ + boot.loader.grub.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + time.timeZone = "Europe/Amsterdam"; + + # TODO qwerty-fr for console + + # Enable CUPS to print documents + services.printing.enable = true; + + # Enable passwordless sudo + security.sudo.extraRules = [{ + groups = [ "wheel" ]; + commands = [{ + command = "ALL"; + options = [ "NOPASSWD" ]; + }]; + }]; + + environment.systemPackages = with pkgs; [ + wget + kexec-tools + openvpn + update-resolv-conf # TODO Is it what I think it is? + + # android tools + android-udev-rules + ]; + + programs = { + # Enable compilation cache + ccache.enable = true; + # TODO Not enough, see https://nixos.wiki/wiki/CCache. + # Might want to see if it's worth using on NixOS + gnupg.agent.enable = true; + + # Let users mount disks + udevil.enable = true; + }; + + services = { + # Enable the OpenSSH daemon + openssh.enable = true; + getty.autologinUser = "geoffrey"; # DEBUG + + # Time sychronisation + chrony = { + enable = true; + servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3); + extraConfig = "rtcsync"; + }; + + # Prevent power button from shutting down the computer. + # On Pinebook it's too easy to hit, + # on others I sometimes turn it off when unsuspending. + logind.extraConfig = "HandlePowerKey=ignore"; + + }; + + # FIXME services.openvpn.servers..updateResolvConf=true + # For profiles in the extensions + + # TODO Hibernation? + + # TEST + system.copySystemConfiguration = true; + + # Use defaults from + system.stateVersion = "23.05"; + +} diff --git a/config/nix/modules/desktop.nix b/config/nix/os/desktop.nix similarity index 50% rename from config/nix/modules/desktop.nix rename to config/nix/os/desktop.nix index c2fe119..e88abd3 100644 --- a/config/nix/modules/desktop.nix +++ b/config/nix/os/desktop.nix @@ -24,83 +24,13 @@ }}/linux/us_qwerty-fr"; }; layout = "qwerty-fr"; - # TODO home.keyboard = null; in home-manager... or something - }; # Enable sound sound.enable = true; hardware.pulseaudio.enable = true; - - services.xserver.displayManager.startx.enable = true; - services.xserver.windowManager.i3.enable = true; - - users.users.geoffrey. packages = with pkgs; [ - # remote - tigervnc - - # music - mpd - mpc-cli - ashuffle - vimpc - - # multimedia common - gimp - inkscape - mpv - mpvScripts.thumbnail - libreoffice - - # data management - freefilesync - - # browsers - firefox - qutebrowser - - # fonts - dejavu_fonts - twemoji-color-font - xfce.thunar - gnome.gedit - feh - zathura - zbar - zathura - meld - python3Packages.magic - yubikey-touch-detector - - # x11-exclusive - libgnomekbd # to show keyboard layout - dunst - i3lock - numlockx - rofi - rofimoji - rxvt-unicode - # TODO urxvt-resize-font-git - scrot - simplescreenrecorder - trayer - unclutter - xautolock - xclip - lemonbar-xft - autorandr - keynav - sct - xorg.xinit - xorg.xbacklight - - alacritty - - # organisation - rofi-pass # TODO Try autopass.cr - thunderbird - ]; - environment.systemPackages = with pkgs; [ pavucontrol ]; + services.xserver.displayManager.startx.enable = true; + } diff --git a/config/nix/os/geoffrey.nix b/config/nix/os/geoffrey.nix new file mode 100644 index 0000000..b04d8c2 --- /dev/null +++ b/config/nix/os/geoffrey.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + imports = [ + + ]; + + users.users.geoffrey = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + + initialPassword = "cartable"; # DEBUG + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE41gxrO8oZ5n3saapSwZDViOQphm6RzqgsBUyA88pU geoffrey@frogeye.fr" + ]; + }; + + home-manager.users.geoffrey = { pkgs, ... }: { + imports = [ + ../hm/loader.nix + ]; + }; +} diff --git a/config/nix/os/loader.nix b/config/nix/os/loader.nix new file mode 100644 index 0000000..69dd3d5 --- /dev/null +++ b/config/nix/os/loader.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + imports = [ + ./battery.nix + ./geoffrey.nix + ./common.nix + ./desktop.nix + ./wireless.nix + ]; +} diff --git a/config/nix/modules/qwerty-fr-keypad.diff b/config/nix/os/qwerty-fr-keypad.diff similarity index 100% rename from config/nix/modules/qwerty-fr-keypad.diff rename to config/nix/os/qwerty-fr-keypad.diff diff --git a/config/nix/modules/wireless.nix b/config/nix/os/wireless.nix similarity index 100% rename from config/nix/modules/wireless.nix rename to config/nix/os/wireless.nix diff --git a/config/nix/modules/wireless/.gitignore b/config/nix/os/wireless/.gitignore similarity index 100% rename from config/nix/modules/wireless/.gitignore rename to config/nix/os/wireless/.gitignore diff --git a/config/nix/modules/wireless/import.py b/config/nix/os/wireless/import.py similarity index 100% rename from config/nix/modules/wireless/import.py rename to config/nix/os/wireless/import.py diff --git a/config/nix/pindakaas.nix b/config/nix/pindakaas.nix new file mode 100644 index 0000000..38584a0 --- /dev/null +++ b/config/nix/pindakaas.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + imports = [ + + ./os/loader.nix + ]; + + networking.hostName = "pindakaas.geoffrey.frogeye.fr"; +} diff --git a/config/nix/testvim.nix b/config/nix/testvim.nix new file mode 100644 index 0000000..a214d0a --- /dev/null +++ b/config/nix/testvim.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }: +{ + imports = [ + ./curacao.nix + ]; +} diff --git a/config/nix/testvm.nix b/config/nix/testvm.nix new file mode 100644 index 0000000..7b62fa8 --- /dev/null +++ b/config/nix/testvm.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + imports = [ + ./os/loader.nix + ]; + + networking.hostName = "nixos"; +} From 0ffe92164d54d6f1953cfed79fbe87e352053f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 28 Oct 2023 23:03:27 +0200 Subject: [PATCH 015/108] nix: Fixes and gnupg --- config/automatrop/playbooks/default.yml | 2 - .../automatrop/roles/dotfiles/tasks/main.yml | 6 --- config/automatrop/roles/gnupg/tasks/main.yml | 51 ------------------- config/automatrop/roles/gnupg/vars/main.yml | 1 - config/nix/hm/common.nix | 39 ++++++++++++-- config/nix/os/geoffrey.nix | 19 +++++-- config/shell/shenv | 1 - 7 files changed, 51 insertions(+), 68 deletions(-) delete mode 100644 config/automatrop/roles/gnupg/tasks/main.yml delete mode 100644 config/automatrop/roles/gnupg/vars/main.yml diff --git a/config/automatrop/playbooks/default.yml b/config/automatrop/playbooks/default.yml index 61b48a9..6b9231c 100644 --- a/config/automatrop/playbooks/default.yml +++ b/config/automatrop/playbooks/default.yml @@ -11,8 +11,6 @@ tags: dotfiles - role: vim tags: vim - - role: gnupg - tags: gnupg - role: mnussbaum.base16-builder-ansible # Required for desktop_environment tags: - color diff --git a/config/automatrop/roles/dotfiles/tasks/main.yml b/config/automatrop/roles/dotfiles/tasks/main.yml index 0498403..3586aa7 100644 --- a/config/automatrop/roles/dotfiles/tasks/main.yml +++ b/config/automatrop/roles/dotfiles/tasks/main.yml @@ -19,12 +19,6 @@ tags: dotfiles_repo # TODO Put actual dotfiles in a subdirectory of the repo, so we don't have to put everything in config -- name: Register as Ansible collection - file: - state: link - src: "{{ ansible_user_dir }}/.dotfiles/config/automatrop" - path: "{{ ansible_user_dir }}/.ansible/collections/ansible_collections/geoffreyfrogeye/automatrop" - - name: Install python dependencies for scripts pip: requirements: "{{ ansible_user_dir }}/.dotfiles/config/scripts/requirements.txt" diff --git a/config/automatrop/roles/gnupg/tasks/main.yml b/config/automatrop/roles/gnupg/tasks/main.yml deleted file mode 100644 index 619119b..0000000 --- a/config/automatrop/roles/gnupg/tasks/main.yml +++ /dev/null @@ -1,51 +0,0 @@ -- name: Create GnuPG directory - file: - path: "{{ gnupghome }}" - state: directory - mode: "u=rwx" - -- name: Create GnuPG configuration files - file: - path: "{{ gnupghome }}/{{ item }}" - state: file - mode: "u=rw,g=r,o=r" - loop: - - gpg-agent.conf - - gpg.conf - -- name: Configure GnuPG - lineinfile: - path: "{{ gnupghome }}/gpg.conf" - regex: "^#?\\s*{{ item.key }}\\s" - line: "{{ item.key }}{% if item.value is defined %} {{ item.value }}{% endif %}" - loop: - # Remove fluff - - key: no-greeting - - key: no-emit-version - - key: no-comments - # Output format that I prefer - - key: keyid-format - value: 0xlong - # Show fingerprints - - key: with-fingerprint - # Make sure to show if key is invalid - # (should be default on most platform, - # but just to be sure) - - key: list-options - value: show-uid-validity - - key: verify-options - value: show-uid-validity - # Stronger algorithm (https://wiki.archlinux.org/title/GnuPG#Different_algorithm) - - key: personal-digest-preferences - value: SHA512 - - key: cert-digest-algo - value: SHA512 - - key: default-preference-list - value: SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed - - key: personal-cipher-preferences - value: TWOFISH CAMELLIA256 AES 3DES - -- name: Install Geoffrey Frogeye's key - gpg_key: - fpr: 4FBA930D314A03215E2CDB0A8312C8CAC1BAC289 - trust: 5 diff --git a/config/automatrop/roles/gnupg/vars/main.yml b/config/automatrop/roles/gnupg/vars/main.yml deleted file mode 100644 index fb95fd1..0000000 --- a/config/automatrop/roles/gnupg/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ -gnupghome: "{{ ansible_user_dir }}/.config/gnupg" diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 2479899..e49e937 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -1,9 +1,12 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: +let + gnupghome = "${config.xdg.dataHome}/gnupg"; +in { home.stateVersion = "23.05"; - programs.home-manager.enable = true; programs = { + home-manager.enable = true; zsh = { enable = true; enableAutosuggestions = true; @@ -17,9 +20,39 @@ vimAlias = true; viAlias = true; }; + gpg = { + enable = true; + homedir = gnupghome; + settings = { + # Remove fluff + no-greeting = true; + no-emit-version = true; + no-comments = true; + # Output format that I prefer + keyid-format = "0xlong"; + # Show fingerprints + with-fingerprint = true; + # Make sure to show if key is invalid + # (should be default on most platform, + # but just to be sure) + list-options = "show-uid-validity"; + verify-options = "show-uid-validity"; + # Stronger algorithm (https://wiki.archlinux.org/title/GnuPG#Different_algorithm) + personal-digest-preferences = "SHA512"; + cert-digest-algo = "SHA512"; + default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed"; + personal-cipher-preferences = "TWOFISH CAMELLIA256 AES 3DES"; + }; + publicKeys = [{ + source = builtins.fetchurl { + url = "https://keys.openpgp.org/vks/v1/by-fingerprint/4FBA930D314A03215E2CDB0A8312C8CAC1BAC289"; + sha256 = "sha256:10y9xqcy1vyk2p8baay14p3vwdnlwynk0fvfbika65hz2z8yw2cm"; + }; + trust = "ultimate"; + }]; + }; }; - home.packages = with pkgs; [ # dotfiles dependencies coreutils diff --git a/config/nix/os/geoffrey.nix b/config/nix/os/geoffrey.nix index b04d8c2..b2ff975 100644 --- a/config/nix/os/geoffrey.nix +++ b/config/nix/os/geoffrey.nix @@ -7,6 +7,7 @@ users.users.geoffrey = { isNormalUser = true; extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + shell = pkgs.zsh; initialPassword = "cartable"; # DEBUG openssh.authorizedKeys.keys = [ @@ -14,9 +15,19 @@ ]; }; - home-manager.users.geoffrey = { pkgs, ... }: { - imports = [ - ../hm/loader.nix - ]; + # Won't allow to set the shell otherwise, + # even though home-manager sets it + programs.zsh.enable = true; + + home-manager = { + users.geoffrey = { pkgs, ... }: { + imports = [ + ../hm/loader.nix + ]; + }; + # Makes VMs able to re-run + useUserPackages = true; + # Adds consistency + useGlobalPkgs = true; }; } diff --git a/config/shell/shenv b/config/shell/shenv index d28d5f0..bb18950 100644 --- a/config/shell/shenv +++ b/config/shell/shenv @@ -29,7 +29,6 @@ direnv CARGOHOME "$HOME/.cache/cargo" # There are config in there that we can ve export CCACHE_CONFIGPATH="$HOME/.config/ccache.conf" direnv CCACHE_DIR "$HOME/.cache/ccache" # The config file alone seems to be not enough direnv DASHT_DOCSETS_DIR "$HOME/.cache/dash_docsets" -direnv GNUPGHOME "$HOME/.config/gnupg" direnv GOPATH "$HOME/.cache/go" direnv GRADLE_USER_HOME "$HOME/.cache/gradle" export INPUTRC="$HOME/.config/inputrc" From 9243536c5f0151fc202c465b3a91bd778f585513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 29 Oct 2023 00:49:22 +0200 Subject: [PATCH 016/108] nix: Fixes & add Stylix --- config/nix/hm/common.nix | 5 +---- config/nix/hm/desktop.nix | 18 +++++++++++++++--- config/nix/hm/loader.nix | 3 ++- config/nix/hm/style.nix | 22 ++++++++++++++++++++++ config/nix/os/common.nix | 1 - config/nix/os/desktop.nix | 8 +++++--- config/nix/os/geoffrey.nix | 4 +++- 7 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 config/nix/hm/style.nix diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index e49e937..274152a 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -1,7 +1,4 @@ { pkgs, config, ... }: -let - gnupghome = "${config.xdg.dataHome}/gnupg"; -in { home.stateVersion = "23.05"; @@ -22,7 +19,7 @@ in }; gpg = { enable = true; - homedir = gnupghome; + homedir = "${config.xdg.dataHome}/gnupg"; settings = { # Remove fluff no-greeting = true; diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 4165f1a..b7ed837 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -1,6 +1,19 @@ { pkgs, ... }: { - xsession.windowManager.i3.enable = true; + xsession.windowManager.i3 = { + enable = true; + config = { + terminal = "alacritty"; + }; + }; + + programs = { + # Browser + qutebrowser.enable = true; + + # Terminal + alacritty.enable = true; + }; home.packages = with pkgs; [ # remote @@ -24,7 +37,6 @@ # browsers firefox - qutebrowser # fonts dejavu_fonts @@ -61,10 +73,10 @@ xorg.xinit xorg.xbacklight - alacritty # organisation rofi-pass # TODO Try autopass.cr thunderbird ]; + } diff --git a/config/nix/hm/loader.nix b/config/nix/hm/loader.nix index f6f3089..717f6c9 100644 --- a/config/nix/hm/loader.nix +++ b/config/nix/hm/loader.nix @@ -2,8 +2,9 @@ { imports = [ ./common.nix + ./desktop.nix ./dev.nix ./extra.nix - ./desktop.nix + ./style.nix ]; } diff --git a/config/nix/hm/style.nix b/config/nix/hm/style.nix new file mode 100644 index 0000000..c9a855c --- /dev/null +++ b/config/nix/hm/style.nix @@ -0,0 +1,22 @@ +{ pkgs, config, ... }: +let + stylix = builtins.fetchGit { + url = "https://github.com/danth/stylix.git"; + ref = "release-23.05"; + }; +in +{ + imports = [ (import stylix).homeManagerModules.stylix ]; + + stylix = { + base16Scheme = "${pkgs.base16-schemes}/share/themes/solarized-dark.yaml"; + image = builtins.fetchurl { + url = "https://get.wallhere.com/photo/sunlight-abstract-minimalism-green-simple-circle-light-leaf-wave-material-line-wing-computer-wallpaper-font-close-up-macro-photography-124350.png"; + sha256 = "sha256:1zfq3f3v34i45mi72pkfqphm8kbhczsg260xjfl6dbydy91d7y93"; + }; + # FIXME This doesn't work + }; + + # Fix https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal + home.packages = [ pkgs.dconf ]; +} diff --git a/config/nix/os/common.nix b/config/nix/os/common.nix index 2b8a311..eb435b0 100644 --- a/config/nix/os/common.nix +++ b/config/nix/os/common.nix @@ -43,7 +43,6 @@ services = { # Enable the OpenSSH daemon openssh.enable = true; - getty.autologinUser = "geoffrey"; # DEBUG # Time sychronisation chrony = { diff --git a/config/nix/os/desktop.nix b/config/nix/os/desktop.nix index e88abd3..e7379ce 100644 --- a/config/nix/os/desktop.nix +++ b/config/nix/os/desktop.nix @@ -4,6 +4,11 @@ services.xserver.enable = true; services.xserver = { + windowManager.i3.enable = true; + desktopManager.gnome.enable = true; + displayManager.defaultSession = "none+i3"; + + # Keyboard layout extraLayouts.qwerty-fr = { description = "QWERTY-fr"; languages = [ "fr" ]; @@ -30,7 +35,4 @@ sound.enable = true; hardware.pulseaudio.enable = true; environment.systemPackages = with pkgs; [ pavucontrol ]; - - services.xserver.displayManager.startx.enable = true; - } diff --git a/config/nix/os/geoffrey.nix b/config/nix/os/geoffrey.nix index b2ff975..d944d19 100644 --- a/config/nix/os/geoffrey.nix +++ b/config/nix/os/geoffrey.nix @@ -9,7 +9,6 @@ extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. shell = pkgs.zsh; - initialPassword = "cartable"; # DEBUG openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE41gxrO8oZ5n3saapSwZDViOQphm6RzqgsBUyA88pU geoffrey@frogeye.fr" ]; @@ -30,4 +29,7 @@ # Adds consistency useGlobalPkgs = true; }; + + # FIXME Make sure I'm the only user & everything is encrypted + services.xserver.displayManager.autoLogin.user = "geoffrey"; } From a521dd4221d13528bdf84b0bb0033eb77804594b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 29 Oct 2023 12:15:56 +0100 Subject: [PATCH 017/108] nix: Start on vim plugins --- config/automatrop/roles/vim/tasks/main.yml | 34 ---------- .../automatrop/roles/vim/templates/loader.j2 | 6 -- .../roles/vim/templates/pluginlist.j2 | 3 - .../roles/vim/templates/plugins/barbar.j2 | 21 ------ .../roles/vim/templates/plugins/base16.j2 | 7 -- .../roles/vim/templates/plugins/scrollview.j2 | 2 - .../roles/vim/templates/plugins/specs.j2 | 6 -- .../automatrop/roles/vim/templates/theme.j2 | 1 - config/nix/hm/common.nix | 15 +++-- config/nix/hm/loader.nix | 1 + config/nix/hm/style.nix | 11 ++++ config/nix/hm/vim.nix | 59 +++++++++++++++++ config/nix/us_qwerty-fr | 65 ------------------- 13 files changed, 80 insertions(+), 151 deletions(-) delete mode 100644 config/automatrop/roles/vim/templates/loader.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/barbar.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/base16.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/scrollview.j2 delete mode 100644 config/automatrop/roles/vim/templates/theme.j2 create mode 100644 config/nix/hm/vim.nix delete mode 100644 config/nix/us_qwerty-fr diff --git a/config/automatrop/roles/vim/tasks/main.yml b/config/automatrop/roles/vim/tasks/main.yml index fb63c5f..def3f1e 100644 --- a/config/automatrop/roles/vim/tasks/main.yml +++ b/config/automatrop/roles/vim/tasks/main.yml @@ -1,37 +1,3 @@ -- name: Set vim variants to use - set_fact: - vim_variants: - - vim - - nvim -# TODO vim-minimal for bsh -# TODO Select those in a clever way - -- name: Create vim configuration directory - file: - state: directory - path: "{{ ansible_user_dir }}/.config/{{ item }}" - mode: "u=rwx,g=rx,o=rx" - loop: "{{ vim_variants }}" - -- name: Install vim-plug - get_url: - url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - dest: "{{ ansible_user_dir }}/.config/vim/plug.vim" - mode: "u=rw,g=r,o=r" - -- name: Install loader - template: - src: loader.j2 - dest: "{{ ansible_user_dir }}/.config/vim/loader.vim" - mode: "u=rw,g=r,o=r" - -- name: Install theme - template: - src: theme.j2 - dest: "{{ ansible_user_dir }}/.config/vim/theme.vim" - mode: "u=rw,g=r,o=r" - tags: - - color - name: Configure vim plugin list template: diff --git a/config/automatrop/roles/vim/templates/loader.j2 b/config/automatrop/roles/vim/templates/loader.j2 deleted file mode 100644 index 0417ff5..0000000 --- a/config/automatrop/roles/vim/templates/loader.j2 +++ /dev/null @@ -1,6 +0,0 @@ -if has('nvim') - let $MYVIMRC="~/.config/nvim/init.vim" -else - let $MYVIMRC="~/.config/vim/init.vim" -endif -source $MYVIMRC diff --git a/config/automatrop/roles/vim/templates/pluginlist.j2 b/config/automatrop/roles/vim/templates/pluginlist.j2 index 3725f9f..1203064 100644 --- a/config/automatrop/roles/vim/templates/pluginlist.j2 +++ b/config/automatrop/roles/vim/templates/pluginlist.j2 @@ -8,11 +8,9 @@ {%- endmacro -%} " Visuals -{{ use_plugin('base16') }} {{ use_plugin('devicons') }} {% if variant == 'nvim' %} {{ use_plugin('specs') }} -{{ use_plugin('scrollview') }} {% endif %} " Theme @@ -20,7 +18,6 @@ source ~/.config/vim/theme.vim " Status/tab lines {% if variant == 'nvim' %} -{{ use_plugin('barbar') }} {{ use_plugin('feline') }} {% else %} {{ use_plugin('airline') }} diff --git a/config/automatrop/roles/vim/templates/plugins/barbar.j2 b/config/automatrop/roles/vim/templates/plugins/barbar.j2 deleted file mode 100644 index ca9167e..0000000 --- a/config/automatrop/roles/vim/templates/plugins/barbar.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{{ add_source('romgrk/barbar.nvim') -}} - -" Move to previous/next -nmap :BufferPrevious -nmap :BufferNext -" Re-order to previous/next -nmap :BufferMovePrevious -nmap :BufferMoveNext -" Goto buffer in position... -nmap :BufferGoto 1 -nmap :BufferGoto 2 -nmap :BufferGoto 3 -nmap :BufferGoto 4 -nmap :BufferGoto 5 -nmap :BufferGoto 6 -nmap :BufferGoto 7 -nmap :BufferGoto 8 -nmap :BufferGoto 0 -nmap :BufferLast - -nmap gb :BufferPick diff --git a/config/automatrop/roles/vim/templates/plugins/base16.j2 b/config/automatrop/roles/vim/templates/plugins/base16.j2 deleted file mode 100644 index 54f96a1..0000000 --- a/config/automatrop/roles/vim/templates/plugins/base16.j2 +++ /dev/null @@ -1,7 +0,0 @@ -{% if variant == 'nvim' %} -{# Beware, doesn't work without RGB colors #} -{{ add_source('RRethy/nvim-base16') -}} -{% else %} -{{ add_source('chriskempson/base16-vim') -}} -{% endif %} - diff --git a/config/automatrop/roles/vim/templates/plugins/scrollview.j2 b/config/automatrop/roles/vim/templates/plugins/scrollview.j2 deleted file mode 100644 index c443dd8..0000000 --- a/config/automatrop/roles/vim/templates/plugins/scrollview.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Customisable status line #} -{{ add_source('dstein64/nvim-scrollview') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/specs.j2 b/config/automatrop/roles/vim/templates/plugins/specs.j2 index 5eb5504..6177dbc 100644 --- a/config/automatrop/roles/vim/templates/plugins/specs.j2 +++ b/config/automatrop/roles/vim/templates/plugins/specs.j2 @@ -2,8 +2,6 @@ {{ add_source('edluffy/specs.nvim') -}} lua << EOF require('specs').setup{ - show_jumps = true, - min_jump = 5, popup = { delay_ms = 0, -- delay before popup displays inc_ms = 10, -- time increments used for fade/resize effects @@ -13,9 +11,5 @@ require('specs').setup{ fader = require('specs').pulse_fader, resizer = require('specs').shrink_resizer }, - ignore_filetypes = {}, - ignore_buftypes = { - nofile = true, - }, } EOF diff --git a/config/automatrop/roles/vim/templates/theme.j2 b/config/automatrop/roles/vim/templates/theme.j2 deleted file mode 100644 index 8300fcc..0000000 --- a/config/automatrop/roles/vim/templates/theme.j2 +++ /dev/null @@ -1 +0,0 @@ -colorscheme base16-{{ base16_scheme }} diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 274152a..0d5b816 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -11,12 +11,14 @@ enableSyntaxHighlighting = true; # syntaxHighlighting.enable = true; # 23.11 syntax }; - neovim = { - enable = true; - defaultEditor = true; - vimAlias = true; - viAlias = true; - }; + # neovim = { + # enable = true; + # defaultEditor = true; + # vimAlias = true; + # viAlias = true; + # vimdiffAlias = true; + # }; + # FIXME Still want this despite using nixvim gpg = { enable = true; homedir = "${config.xdg.dataHome}/gnupg"; @@ -87,6 +89,7 @@ borgbackup # cleanup + ncdu jdupes duperemove optipng diff --git a/config/nix/hm/loader.nix b/config/nix/hm/loader.nix index 717f6c9..2e4ade4 100644 --- a/config/nix/hm/loader.nix +++ b/config/nix/hm/loader.nix @@ -6,5 +6,6 @@ ./dev.nix ./extra.nix ./style.nix + ./vim.nix ]; } diff --git a/config/nix/hm/style.nix b/config/nix/hm/style.nix index c9a855c..6b33a1a 100644 --- a/config/nix/hm/style.nix +++ b/config/nix/hm/style.nix @@ -9,12 +9,23 @@ in imports = [ (import stylix).homeManagerModules.stylix ]; stylix = { + # FIXME Changeable at runtime base16Scheme = "${pkgs.base16-schemes}/share/themes/solarized-dark.yaml"; image = builtins.fetchurl { url = "https://get.wallhere.com/photo/sunlight-abstract-minimalism-green-simple-circle-light-leaf-wave-material-line-wing-computer-wallpaper-font-close-up-macro-photography-124350.png"; sha256 = "sha256:1zfq3f3v34i45mi72pkfqphm8kbhczsg260xjfl6dbydy91d7y93"; }; # FIXME This doesn't work + + # fonts.monospace = { + # package = pkgs.nerdfonts; + # name = "DejaVu Sans Mono Nerd Font"; + # }; + # FIXME We want this, but now we get weird kerning in Alacritty... + # Something I've seen before and probably already fixed, + # maybe something in Alacritty config, which is not imported yet? + + targets.vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR) }; # Fix https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix new file mode 100644 index 0000000..4106e72 --- /dev/null +++ b/config/nix/hm/vim.nix @@ -0,0 +1,59 @@ +{ pkgs, lib, ... }: +let + nixvim = import (builtins.fetchGit { + url = "https://github.com/nix-community/nixvim"; + ref = "nixos-23.05"; + }); +in +{ + imports = [ + nixvim.homeManagerModules.nixvim + ]; + + programs.nixvim = { + enable = true; + colorschemes.base16 = { + # FIXME Dynamic... or use stylix + enable = true; + colorscheme = "solarized-light"; + + }; + plugins = { + # Catches attention when cursor changed position + # TODO Unmapped, do I still want to use it? + specs = { + enable = true; + min_jump = 5; + }; + + # Tabline + barbar.enable = true; + }; + extraPlugins = with pkgs.vimPlugins; [ + nvim-scrollview + ]; + # 23.11: Use keymaps, seems better + maps = { + # barbar + normal."" = { action = "BufferPrevious"; silent = true; }; + normal."" = { action = "BufferNext"; silent = true; }; + # TODO https://www.reddit.com/r/neovim/comments/mbj8m5/how_to_setup_ctrlshiftkey_mappings_in_neovim_and/ + normal."" = { action = "BufferMovePrevious"; silent = true; }; + normal."" = { action = "BufferMoveNext"; silent = true; }; + # TODO gotos don't work + normal."" = { action = "BufferGoto 1"; silent = true; }; + normal."" = { action = "BufferGoto 2"; silent = true; }; + normal."" = { action = "BufferGoto 3"; silent = true; }; + normal."" = { action = "BufferGoto 4"; silent = true; }; + normal."" = { action = "BufferGoto 5"; silent = true; }; + normal."" = { action = "BufferGoto 6"; silent = true; }; + normal."" = { action = "BufferGoto 7"; silent = true; }; + normal."" = { action = "BufferGoto 8"; silent = true; }; + normal."" = { action = "BufferGoto 9"; silent = true; }; + normal."" = { action = "BufferLast"; silent = true; }; + normal."gb" = { action = "BufferPick"; silent = true; }; + # TODO Other useful options? + + }; + }; +} diff --git a/config/nix/us_qwerty-fr b/config/nix/us_qwerty-fr deleted file mode 100644 index a18b0ea..0000000 --- a/config/nix/us_qwerty-fr +++ /dev/null @@ -1,65 +0,0 @@ - -partial alphanumeric_keys -xkb_symbols "qwerty-fr" -{ - include "us(basic)" - include "level3(ralt_switch)" - include "keypad(oss)" - - name[Group1]= "US keyboard with french symbols - AltGr combination"; - - key { [ grave, asciitilde, dead_grave, dead_tilde ] }; - key { [ 1, exclam, onesuperior, exclamdown ] }; - key { [ 2, at, twosuperior, dead_doubleacute ] }; - key { [ 3, numbersign, ecircumflex, Ecircumflex ] }; - key { [ 4, dollar, EuroSign, dead_currency ] }; // FIXME: dead_currency has a different mapping than the one we want for qwerty-fr. Need to define a custom dead key instead. See Windows layout for dead key definition. - key { [ 5, percent, dead_macron, dead_abovedot ] }; - key { [ 6, asciicircum, dead_circumflex, dead_caron ] }; - key { [ 7, ampersand, ucircumflex, Ucircumflex ] }; - key { [ 8, asterisk, icircumflex, Icircumflex ] }; - key { [ 9, parenleft, ocircumflex, Ocircumflex ] }; - key { [ 0, parenright, oslash, Oslash ] }; - key { [ minus, underscore, endash, emdash ] }; - key { [ equal, plus, notequal, approxeq ] }; - - key { [ q, Q, acircumflex, Acircumflex ] }; - key { [ w, W, eacute, Eacute ] }; - key { [ e, E, egrave, Egrave ] }; - key { [ r, R, registered, copyright ] }; - key { [ t, T, thorn, THORN ] }; - key { [ y, Y, dead_invertedbreve, dead_breve ] }; - key { [ u, U, ugrave, Ugrave ] }; - key { [ i, I, igrave, Igrave ] }; - key { [ o, O, ograve, Ograve ] }; - key { [ p, P, oe, OE ] }; - key { [ bracketleft, braceleft, guillemotleft, leftdoublequotemark ] }; - key { [ bracketright, braceright, guillemotright, rightdoublequotemark ] }; - - key { [ a, A, agrave, Agrave ] }; - key { [ s, S, ae, AE ] }; - key { [ d, D, ediaeresis, Ediaeresis ] }; - key { [ f, F, VoidSymbol, VoidSymbol ] }; - key { [ g, G, dead_greek, VoidSymbol ] }; // FIXME: dead_greek has a different mapping than the one we want for qwerty-fr. Need to define a custom dead key instead. See Windows layout for dead key definition. - key { [ h, H, ydiaeresis, Ydiaeresis ] }; - key { [ j, J, udiaeresis, Udiaeresis ] }; - key { [ k, K, idiaeresis, Idiaeresis ] }; - key { [ l, L, odiaeresis, Odiaeresis ] }; - key { [ semicolon, colon, dead_acute, dead_abovering ] }; - key { [ apostrophe, quotedbl, dead_grave, dead_diaeresis ] }; - key { [ backslash, bar, VoidSymbol, doublelowquotemark ] }; // „ - - key { [ less, greater, lessthanequal, greaterthanequal ] }; - key { [ z, Z, adiaeresis, Adiaeresis ] }; - key { [ x, X, multiply, division ] }; - key { [ c, C, ccedilla, Ccedilla ] }; - key { [ v, V, VoidSymbol, VoidSymbol ] }; - key { [ b, B, ssharp, U1E9E ] }; // ß, ẞ (capital) - key { [ n, N, ntilde, Ntilde ] }; - key { [ m, M, VoidSymbol, VoidSymbol ] }; - key { [ comma, less, dead_cedilla, dead_ogonek ] }; - key { [ period, greater, periodcentered, ellipsis ] }; // ., >, ·, … - key { [ slash, question, rightsinglequotemark, questiondown ] }; // /, ?, ’, ¿ - key { [ space, space, nobreakspace, 0x100202F ] }; // espace insécable fine - -}; - From 1139bd65249009ca8335b7ac98e810266fa0db3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 29 Oct 2023 17:20:35 +0100 Subject: [PATCH 018/108] nix: Various tests and cleaning --- config/nix/build-pindakaas-image.sh | 3 +++ config/nix/os/common.nix | 1 - config/nix/pindakaas.nix | 9 +++++---- config/nix/testvim.nix | 6 ------ 4 files changed, 8 insertions(+), 11 deletions(-) create mode 100755 config/nix/build-pindakaas-image.sh delete mode 100644 config/nix/testvim.nix diff --git a/config/nix/build-pindakaas-image.sh b/config/nix/build-pindakaas-image.sh new file mode 100755 index 0000000..4485564 --- /dev/null +++ b/config/nix/build-pindakaas-image.sh @@ -0,0 +1,3 @@ +#/usr/bin/env sh +export NIXPKGS_ALLOW_UNFREE=1 +nix-build '' -A config.system.build.sdImage -I nixos-config=./pindakaas.nix diff --git a/config/nix/os/common.nix b/config/nix/os/common.nix index eb435b0..f6e64f6 100644 --- a/config/nix/os/common.nix +++ b/config/nix/os/common.nix @@ -1,6 +1,5 @@ { pkgs, lib, ... }: { - boot.loader.grub.enable = true; boot.loader.efi.canTouchEfiVariables = true; time.timeZone = "Europe/Amsterdam"; diff --git a/config/nix/pindakaas.nix b/config/nix/pindakaas.nix index 38584a0..928ffd1 100644 --- a/config/nix/pindakaas.nix +++ b/config/nix/pindakaas.nix @@ -1,9 +1,10 @@ { ... }: { imports = [ - - ./os/loader.nix + # + + # ./os/loader.nix # Don't uncomment this before having put extra behind an option! ]; - - networking.hostName = "pindakaas.geoffrey.frogeye.fr"; + nixpkgs.crossSystem.system = "aarch64-linux"; + # networking.hostName = "pindakaas.geoffrey.frogeye.fr"; } diff --git a/config/nix/testvim.nix b/config/nix/testvim.nix deleted file mode 100644 index a214d0a..0000000 --- a/config/nix/testvim.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, pkgs, ... }: -{ - imports = [ - ./curacao.nix - ]; -} From f16367105d59e8cf3400a01c610f1680b48224bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 29 Oct 2023 19:14:58 +0100 Subject: [PATCH 019/108] nix: More vim plugins With broken things. But debugging this with a half system, and not a very quick way of rebuilding is not neat. So let's postpone the fixes to after everything I could import easily is imported, and maybe once I have a home-manager test env. --- .../roles/vim/templates/pluginlist.j2 | 14 ----- .../roles/vim/templates/plugins/airline.j2 | 15 ------ .../roles/vim/templates/plugins/fzf.j2 | 36 ------------- .../roles/vim/templates/plugins/telescope.j2 | 52 ------------------ config/nix/hm/dev.nix | 1 - config/nix/hm/vim.nix | 49 +++++++++++++++++ .../feline.j2 => nix/hm/vim/feline.lua} | 54 +++++++++---------- config/nix/hm/vim/feline_test.vim | 9 ++++ 8 files changed, 85 insertions(+), 145 deletions(-) delete mode 100644 config/automatrop/roles/vim/templates/plugins/airline.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/fzf.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/telescope.j2 rename config/{automatrop/roles/vim/templates/plugins/feline.j2 => nix/hm/vim/feline.lua} (84%) create mode 100644 config/nix/hm/vim/feline_test.vim diff --git a/config/automatrop/roles/vim/templates/pluginlist.j2 b/config/automatrop/roles/vim/templates/pluginlist.j2 index 1203064..1706c64 100644 --- a/config/automatrop/roles/vim/templates/pluginlist.j2 +++ b/config/automatrop/roles/vim/templates/pluginlist.j2 @@ -16,20 +16,6 @@ " Theme source ~/.config/vim/theme.vim -" Status/tab lines -{% if variant == 'nvim' %} -{{ use_plugin('feline') }} -{% else %} -{{ use_plugin('airline') }} -{% endif %} - -" Goto utilities -{% if variant == 'nvim' %} -{{ use_plugin('telescope') }} -{% else %} -{{ use_plugin('fzf') }} -{% endif %} - " Search/replace {{ use_plugin('abolish') }} {{ use_plugin('easy_align') }} diff --git a/config/automatrop/roles/vim/templates/plugins/airline.j2 b/config/automatrop/roles/vim/templates/plugins/airline.j2 deleted file mode 100644 index db93f55..0000000 --- a/config/automatrop/roles/vim/templates/plugins/airline.j2 +++ /dev/null @@ -1,15 +0,0 @@ -{{ add_source('vim-airline/vim-airline') -}} -{{ add_source('vim-airline/vim-airline-themes') -}} -set noshowmode -set laststatus=2 -let g:airline_powerline_fonts = 1 -{% if variant != 'nvim' %} -let g:airline#extensions#tabline#enabled = 1 -{% endif %} - -let g:airline_section_a = airline#section#create(['mode']) -let g:airline_section_b = airline#section#create(['branch', 'hunks']) -" let g:airline_section_z = airline#section#create(['%B', '@', '%l', ':', '%c']) - -let airline#extensions#languageclient#error_symbol = '✖ ' -let airline#extensions#languageclient#warning_symbol = '⚠ ' diff --git a/config/automatrop/roles/vim/templates/plugins/fzf.j2 b/config/automatrop/roles/vim/templates/plugins/fzf.j2 deleted file mode 100644 index 08815c7..0000000 --- a/config/automatrop/roles/vim/templates/plugins/fzf.j2 +++ /dev/null @@ -1,36 +0,0 @@ -{# Fuzzy matching for all kind of stuff #} -{{ add_source('junegunn/fzf', {'do': './install --bin'}) }} -{{ add_source('junegunn/fzf.vim') -}} -let g:fzf_layout = { 'down': '~40%' } -let g:fzf_colors = -\ { 'fg': ['fg', 'Normal'], - \ 'bg': ['bg', 'Normal'], - \ 'hl': ['fg', 'Comment'], - \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], - \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], - \ 'hl+': ['fg', 'Statement'], - \ 'info': ['fg', 'PreProc'], - \ 'border': ['fg', 'Ignore'], - \ 'prompt': ['fg', 'Conditional'], - \ 'pointer': ['fg', 'Exception'], - \ 'marker': ['fg', 'Keyword'], - \ 'spinner': ['fg', 'Label'], - \ 'header': ['fg', 'Comment'] } - -let g:fzf_command_prefix = 'Fzf' -nmap gF :FzfFiles -nmap gf :FzfGFiles -nmap gb :FzfBuffers -nmap gL :FzfLines -nmap gl :FzfBLines -nmap gT :FzfTags -nmap gt :FzfBTags -nmap gm :FzfMarks -nmap gw :FzfWindows -nmap gh :FzfHistory -nmap gH :FzfHistory: -nmap gS :FzfHistory/ -nmap gs :FzfSnippets - -" TODO `gd` → go to tag matching selected word, or show a list with that -" of tags pre-filtered with that word diff --git a/config/automatrop/roles/vim/templates/plugins/telescope.j2 b/config/automatrop/roles/vim/templates/plugins/telescope.j2 deleted file mode 100644 index c8424ca..0000000 --- a/config/automatrop/roles/vim/templates/plugins/telescope.j2 +++ /dev/null @@ -1,52 +0,0 @@ -{{ add_source('nvim-telescope/telescope.nvim') -}} -{# Dependencies #} -{{ add_source('nvim-lua/popup.nvim') -}} -{{ add_source('nvim-lua/plenary.nvim') -}} -{# Extensions #} -{{ add_source('nvim-telescope/telescope-fzf-native.nvim', {'do': 'make'}) -}} - -noremap gF Telescope find_files -noremap gf Telescope git_files -noremap gB Telescope buffers -noremap gl Telescope current_buffer_fuzzy_find -noremap gL Telescope live_grep -noremap gT Telescope tags -noremap gt Telescope treesitter -noremap gm Telescope marks -noremap gh Telescope oldfiles -noremap gH Telescope command_history -noremap gS Telescope search_history -noremap gC Telescope commands -noremap gr Telescope lsp_references -noremap ga Telescope lsp_code_actions -vnoremap ga Telescope lsp_range_code_actions -noremap ge Telescope lsp_document_diagnostics -noremap gE Telescope lsp_workspace_diagnostics -noremap gd Telescope lsp_definitions -noremap gs Telescope lsp_document_symbols - -lua << EOF -require('telescope').setup{ - defaults = { - vimgrep_arguments = { - 'rg', - '--color=never', - '--no-heading', - '--with-filename', - '--line-number', - '--column', - '--smart-case' - }, - }, - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - -- the default case_mode is "smart_case" - } - } -} -require('telescope').load_extension('fzf') -EOF diff --git a/config/nix/hm/dev.nix b/config/nix/hm/dev.nix index 1e68ef8..7e9f634 100644 --- a/config/nix/hm/dev.nix +++ b/config/nix/hm/dev.nix @@ -20,7 +20,6 @@ jq universal-ctags highlight - ripgrep # For nvim's :Telescope live_grep zeal-qt6 # Offline documentation # Docker diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index 4106e72..90189db 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -28,10 +28,59 @@ in # Tabline barbar.enable = true; + + # Go to whatever + telescope = { + enable = true; + # FIXME Crashes nvim on startup, complaining about some keymap + # keymaps = { + # gF = "find_files"; + # gf = "git_files"; + # gB = "buffers"; + # gl = "current_buffer_fuzzy_find"; + # gL = "live_grep"; + # gT = "tags"; + # gt = "treesitter"; + # gm = "marks"; + # gh = "oldfiles"; + # gH = "command_history"; + # gS = "search_history"; + # gC = "commands"; + # gr = "lsp_references"; + # ga = "lsp_code_actions"; + # ge = "lsp_document_diagnostics"; + # gE = "lsp_workspace_diagnostics"; + # gd = "lsp_definitions"; + # gs = "lsp_document_symbols"; + # }; + defaults = { + vimgrep_arguments = [ + "${pkgs.ripgrep}/bin/rg" + "--color=never" + "--no-heading" + "--with-filename" + "--line-number" + "--column" + "--smart-case" + ]; + }; + extensions.fzf-native = { + enable = true; + caseMode = "smart_case"; + fuzzy = true; + overrideFileSorter = true; + overrideGenericSorter = true; + }; + }; }; extraPlugins = with pkgs.vimPlugins; [ nvim-scrollview + + # Status line + feline-nvim # TODO Abandonned. Maybe use lualine? ]; + extraConfigLua = "${builtins.readFile ./vim/feline.lua}"; + # 23.11: Use keymaps, seems better maps = { # barbar diff --git a/config/automatrop/roles/vim/templates/plugins/feline.j2 b/config/nix/hm/vim/feline.lua similarity index 84% rename from config/automatrop/roles/vim/templates/plugins/feline.j2 rename to config/nix/hm/vim/feline.lua index aa49c02..2b5d8fe 100644 --- a/config/automatrop/roles/vim/templates/plugins/feline.j2 +++ b/config/nix/hm/vim/feline.lua @@ -1,32 +1,33 @@ -{# Customisable status line #} -{{ add_source('famiu/feline.nvim') -}} -set noshowmode -set laststatus=2 -lua << EOF -local base16_colors = require('base16-colorscheme').colors +vim.cmd([[ + set noshowmode + set laststatus=2 +]]) +-- local base16_colors = require('base16-colorscheme').colors +-- FIXME Color setting doesn't work, see ./feline_test.vim for a reproducible use case +-- that works on Arch but not on Nix (with Plug stuff removed) local vi_mode_utils = require('feline.providers.vi_mode') local lsp = require('feline.providers.lsp') require('feline').setup({ - default_bg = 'base01', - default_fg = 'base04', - theme = { - base00 = base16_colors.base00, - base01 = base16_colors.base01, - base02 = base16_colors.base02, - base03 = base16_colors.base03, - base04 = base16_colors.base04, - base05 = base16_colors.base05, - base06 = base16_colors.base06, - base07 = base16_colors.base07, - base08 = base16_colors.base08, - base09 = base16_colors.base09, - base0A = base16_colors.base0A, - base0B = base16_colors.base0B, - base0C = base16_colors.base0C, - base0D = base16_colors.base0D, - base0E = base16_colors.base0E, - base0F = base16_colors.base0F, - }, + -- default_bg = 'base01', + -- default_fg = 'base04', + -- theme = { + -- base00 = base16_colors.base00, + -- base01 = base16_colors.base01, + -- base02 = base16_colors.base02, + -- base03 = base16_colors.base03, + -- base04 = base16_colors.base04, + -- base05 = base16_colors.base05, + -- base06 = base16_colors.base06, + -- base07 = base16_colors.base07, + -- base08 = base16_colors.base08, + -- base09 = base16_colors.base09, + -- base0A = base16_colors.base0A, + -- base0B = base16_colors.base0B, + -- base0C = base16_colors.base0C, + -- base0D = base16_colors.base0D, + -- base0E = base16_colors.base0E, + -- base0F = base16_colors.base0F, + -- }, components = { active = { { @@ -164,4 +165,3 @@ require('feline').setup({ }, } }) -EOF diff --git a/config/nix/hm/vim/feline_test.vim b/config/nix/hm/vim/feline_test.vim new file mode 100644 index 0000000..7ddb1cd --- /dev/null +++ b/config/nix/hm/vim/feline_test.vim @@ -0,0 +1,9 @@ +source ~/.config/vim/plug.vim +call plug#begin('~/.cache/nvim/plugged') +Plug 'RRethy/nvim-base16' +call plug#end() + +colorscheme base16-solarized-dark +lua << EOF +a = require('base16-colorscheme').colors.base00 +EOF From e6f25d9fac301c83c92c10f3e8c338b8342ba109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 31 Oct 2023 22:26:01 +0100 Subject: [PATCH 020/108] nix: Even more vim plugins! --- .../roles/vim/templates/pluginlist.j2 | 24 ------- .../roles/vim/templates/plugins/abolish.j2 | 2 - .../roles/vim/templates/plugins/easy_align.j2 | 4 -- .../roles/vim/templates/plugins/gutentags.j2 | 3 - .../vim/templates/plugins/quick_scope.j2 | 2 - .../roles/vim/templates/plugins/registers.j2 | 2 - .../roles/vim/templates/plugins/shot_f.j2 | 2 - .../roles/vim/templates/plugins/surround.j2 | 2 - .../roles/vim/templates/plugins/targets.j2 | 2 - config/nix/hm/vim.nix | 67 ++++++++++++++++++- .../hm/vim/symbols-outline-nvim.lua} | 9 +-- 11 files changed, 65 insertions(+), 54 deletions(-) delete mode 100644 config/automatrop/roles/vim/templates/plugins/abolish.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/easy_align.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/gutentags.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/quick_scope.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/registers.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/shot_f.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/surround.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/targets.j2 rename config/{automatrop/roles/vim/templates/plugins/symbols-outline.j2 => nix/hm/vim/symbols-outline-nvim.lua} (69%) diff --git a/config/automatrop/roles/vim/templates/pluginlist.j2 b/config/automatrop/roles/vim/templates/pluginlist.j2 index 1706c64..277cc90 100644 --- a/config/automatrop/roles/vim/templates/pluginlist.j2 +++ b/config/automatrop/roles/vim/templates/pluginlist.j2 @@ -16,30 +16,6 @@ " Theme source ~/.config/vim/theme.vim -" Search/replace -{{ use_plugin('abolish') }} -{{ use_plugin('easy_align') }} - -" Sourounding pairs -{{ use_plugin('surround') }} -{{ use_plugin('targets') }} - -" f/F mode -{{ use_plugin('shot_f') }} -{{ use_plugin('quick_scope') }} - -" Registers -{{ use_plugin('registers') }} - - -" Tags/Symbols -{{ use_plugin('gutentags') }} -{% if variant == 'nvim' %} -{{ use_plugin('symbols-outline') }} -{% else %} -{{ use_plugin('vista') }} -{% endif %} - " Language Server Client {% if variant == 'nvim' %} {{ use_plugin('nvim_lspconfig') }} diff --git a/config/automatrop/roles/vim/templates/plugins/abolish.j2 b/config/automatrop/roles/vim/templates/plugins/abolish.j2 deleted file mode 100644 index 3a5f5d4..0000000 --- a/config/automatrop/roles/vim/templates/plugins/abolish.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Regex for words, with case in mind #} -{{ add_source('tpope/tpope-vim-abolish') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/easy_align.j2 b/config/automatrop/roles/vim/templates/plugins/easy_align.j2 deleted file mode 100644 index c5fe06d..0000000 --- a/config/automatrop/roles/vim/templates/plugins/easy_align.j2 +++ /dev/null @@ -1,4 +0,0 @@ -{# Aligning lines around a certain character #} -{{ add_source('junegunn/vim-easy-align') -}} -" Align GitHub-flavored Markdown tables -au FileType markdown vmap :EasyAlign* diff --git a/config/automatrop/roles/vim/templates/plugins/gutentags.j2 b/config/automatrop/roles/vim/templates/plugins/gutentags.j2 deleted file mode 100644 index 28dd01b..0000000 --- a/config/automatrop/roles/vim/templates/plugins/gutentags.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{# Generate tags #} -{{ add_source('ludovicchabant/vim-gutentags') -}} -let g:gutentags_cache_dir = expand('~/.cache/{{ variant }}/tags') diff --git a/config/automatrop/roles/vim/templates/plugins/quick_scope.j2 b/config/automatrop/roles/vim/templates/plugins/quick_scope.j2 deleted file mode 100644 index 8e0692f..0000000 --- a/config/automatrop/roles/vim/templates/plugins/quick_scope.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Auto-highlight one character per word for quick f/F movement #} -{{ add_source('unblevable/quick-scope') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/registers.j2 b/config/automatrop/roles/vim/templates/plugins/registers.j2 deleted file mode 100644 index 04cf261..0000000 --- a/config/automatrop/roles/vim/templates/plugins/registers.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Show register content when pressing " #} -{{ add_source('tversteeg/registers.nvim') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/shot_f.j2 b/config/automatrop/roles/vim/templates/plugins/shot_f.j2 deleted file mode 100644 index 20808d2..0000000 --- a/config/automatrop/roles/vim/templates/plugins/shot_f.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# When in f/F/t/T mode, highlight in red the characters that can be jumped to #} -{{ add_source('deris/vim-shot-f') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/surround.j2 b/config/automatrop/roles/vim/templates/plugins/surround.j2 deleted file mode 100644 index d4dfb9a..0000000 --- a/config/automatrop/roles/vim/templates/plugins/surround.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Change surroundings pairs (e.g. brackets, quotes… #} -{{ add_source('tpope/vim-surround') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/targets.j2 b/config/automatrop/roles/vim/templates/plugins/targets.j2 deleted file mode 100644 index b9a7de7..0000000 --- a/config/automatrop/roles/vim/templates/plugins/targets.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Better interaction with surrounding pairs #} -{{ add_source('wellle/targets.vim') -}} diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index 90189db..19c7165 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -4,6 +4,28 @@ let url = "https://github.com/nix-community/nixvim"; ref = "nixos-23.05"; }); + vim-shot-f = pkgs.vimUtils.buildVimPluginFrom2Nix { + pname = "vim-shot-f"; + version = "2016-02-05"; + src = pkgs.fetchFromGitHub { + owner = "deris"; + repo = "vim-shot-f"; + rev = "eea71d2a1038aa87fe175de9150b39dc155e5e7f"; + sha256 = "iAPvIs/lhW+w5kFTZKaY97D/kfCGtqKrJVFvZ8cHu+c="; + }; + meta.homepage = "https://github.com/deris/vim-shot-f"; + }; + quick-scope = pkgs.vimUtils.buildVimPluginFrom2Nix { + pname = "quick-scope"; + version = "2.6.1"; + src = pkgs.fetchFromGitHub { + owner = "deris"; + repo = "quick-scope"; + rev = "2.6.1"; + sha256 = "iAPvIs/lhW+w5kFTZKaY97D/kfCGtqKrJVFvZ8cHu+c="; + }; + meta.homepage = "https://github.com/unblevable/quick-scope"; + }; in { imports = [ @@ -72,14 +94,50 @@ in overrideGenericSorter = true; }; }; + + # Surrounding pairs + surround.enable = true; # Change surrounding pairs (e.g. brackets, quotes) }; extraPlugins = with pkgs.vimPlugins; [ - nvim-scrollview + nvim-scrollview # Scroll bar # Status line - feline-nvim # TODO Abandonned. Maybe use lualine? + feline-nvim # Customizable status line. + # TODO Abandonned. Maybe use lualine? + + # Search/replace + vim-abolish # Regex for words, with case in mind + vim-easy-align # Aligning lines around a certain character + + # Surrounding pairs + targets-vim # Better interaction with surrounding pairs + + # f/F mode + vim-shot-f # Highlight relevant characters for f/F/t/T modes + quick-scope # Highlight relevant characters for f/F modes one per word but always + # FIXME Doesn't work here, :QuickScopeToggle doesn't even work + + # Registers + registers-nvim # Show register content when pressing " + # TODO Doesn't work. Didn't work on Arch either + + # Tags + vim-gutentags # Generate tags + symbols-outline-nvim # Show a symbol panel on the right + # TODO Fails on startup. Same on Arch. Config issue? + ]; + extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [ + ./vim/feline.lua + ./vim/symbols-outline-nvim.lua + ]; + extraConfigVim = '' + " vim-gutentags + let g:gutentags_cache_dir = expand('~/.cache/nvim/tags') + ''; + autoCmd = [ + # vim-easy-align: Align Markdown tables + { event = "FileType markdown"; command = "vmap :EasyAlign*"; } ]; - extraConfigLua = "${builtins.readFile ./vim/feline.lua}"; # 23.11: Use keymaps, seems better maps = { @@ -103,6 +161,9 @@ in normal."gb" = { action = "BufferPick"; silent = true; }; # TODO Other useful options? + # symbols-outline-nvim + normal."s" = { action = "SymbolsOutline"; silent = true; }; + }; }; } diff --git a/config/automatrop/roles/vim/templates/plugins/symbols-outline.j2 b/config/nix/hm/vim/symbols-outline-nvim.lua similarity index 69% rename from config/automatrop/roles/vim/templates/plugins/symbols-outline.j2 rename to config/nix/hm/vim/symbols-outline-nvim.lua index abbe040..4649eb7 100644 --- a/config/automatrop/roles/vim/templates/plugins/symbols-outline.j2 +++ b/config/nix/hm/vim/symbols-outline-nvim.lua @@ -1,9 +1,3 @@ -{# Show a symbol panel on the right #} -{{ add_source('simrat39/symbols-outline.nvim') -}} - -nmap s :SymbolsOutline - -lua << EOF vim.g.symbols_outline = { highlight_hovered_item = true, show_guides = true, @@ -22,5 +16,4 @@ vim.g.symbols_outline = { }, lsp_blacklist = {}, } -EOF -{# TODO Should be hierarchical, doesn't seem to be :/ #} +-- TODO Should be hierarchical, doesn't seem to be :/ From 39294e4b90eb8913e8241bc2dcc2449e3b39447c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 31 Oct 2023 23:48:01 +0100 Subject: [PATCH 021/108] nix: Vim LSP plugins --- .../roles/vim/templates/pluginlist.j2 | 10 -- .../roles/vim/templates/plugins/lightbulb.j2 | 3 - .../vim/templates/plugins/lsp_signature.j2 | 8 -- .../roles/vim/templates/plugins/lspkind.j2 | 6 - .../vim/templates/plugins/nvim_lspconfig.j2 | 70 ------------ .../roles/vim/templates/plugins/vim_lsp.j2 | 39 ------- config/nix/hm/dev.nix | 16 --- config/nix/hm/vim.nix | 103 ++++++++++++++---- config/nix/hm/vim/lsp_signature-nvim.lua | 3 + 9 files changed, 85 insertions(+), 173 deletions(-) delete mode 100644 config/automatrop/roles/vim/templates/plugins/lightbulb.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/lsp_signature.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/lspkind.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/vim_lsp.j2 create mode 100644 config/nix/hm/vim/lsp_signature-nvim.lua diff --git a/config/automatrop/roles/vim/templates/pluginlist.j2 b/config/automatrop/roles/vim/templates/pluginlist.j2 index 277cc90..abaa6be 100644 --- a/config/automatrop/roles/vim/templates/pluginlist.j2 +++ b/config/automatrop/roles/vim/templates/pluginlist.j2 @@ -16,16 +16,6 @@ " Theme source ~/.config/vim/theme.vim -" Language Server Client -{% if variant == 'nvim' %} -{{ use_plugin('nvim_lspconfig') }} -{{ use_plugin('lightbulb') }} -{{ use_plugin('lspkind') }} -{{ use_plugin('lsp_signature') }} -{% else %} -{{ use_plugin('vim_lsp') }} -{% endif %} - " Treesitter {% if variant == 'nvim' %} {{ use_plugin('treesitter') }} diff --git a/config/automatrop/roles/vim/templates/plugins/lightbulb.j2 b/config/automatrop/roles/vim/templates/plugins/lightbulb.j2 deleted file mode 100644 index 426fbd8..0000000 --- a/config/automatrop/roles/vim/templates/plugins/lightbulb.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{# Shows a lightbulb whenever a codeAction is available under the cursor #} -{{ add_source('kosayoda/nvim-lightbulb') -}} -autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb() diff --git a/config/automatrop/roles/vim/templates/plugins/lsp_signature.j2 b/config/automatrop/roles/vim/templates/plugins/lsp_signature.j2 deleted file mode 100644 index 918a056..0000000 --- a/config/automatrop/roles/vim/templates/plugins/lsp_signature.j2 +++ /dev/null @@ -1,8 +0,0 @@ -{# Show argument documentation when typing a function #} -{{ add_source('ray-x/lsp_signature.nvim') -}} - -lua << EOF -require'lsp_signature'.on_attach({ - hint_enable = false, -}) -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/lspkind.j2 b/config/automatrop/roles/vim/templates/plugins/lspkind.j2 deleted file mode 100644 index d81e404..0000000 --- a/config/automatrop/roles/vim/templates/plugins/lspkind.j2 +++ /dev/null @@ -1,6 +0,0 @@ -{# Add icons to LSP completions #} -{{ add_source('onsails/lspkind-nvim') -}} - -lua << EOF -require('lspkind').init() -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 b/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 deleted file mode 100644 index de7fb38..0000000 --- a/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 +++ /dev/null @@ -1,70 +0,0 @@ -{# LSP client for neovim ≥ 0.5 #} -{{ add_source('neovim/nvim-lspconfig') -}} -lua << EOF -local nvim_lsp = require('lspconfig') - --- Mappings. --- See `:help vim.diagnostic.*` for documentation on any of the below functions -local opts = { noremap=true, silent=true } -vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) -vim.keymap.set('n', '[e', vim.diagnostic.goto_prev, opts) -vim.keymap.set('n', ']e', vim.diagnostic.goto_next, opts) --- vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer -local on_attach = function(client, bufnr) - -- Enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - - -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - local bufopts = { noremap=true, silent=true, buffer=bufnr } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) --- vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) - vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) - vim.keymap.set('n', 'wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, bufopts) - vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) --- vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) --- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) -end - --- Use a loop to conveniently call 'setup' on multiple servers and --- map buffer local keybindings when the language server attaches -local servers = { -{% if 'ansible' in dev_stuffs %} - "ansiblels", -{% endif %} -{% if 'nix' in dev_stuffs %} - "rnix", -{% endif %} -{% if 'perl' in dev_stuffs %} - "perlls", -{% endif %} -{% if 'python' in dev_stuffs %} - "pylsp", -{% endif %} -{% if 'php' in dev_stuffs %} - "phpactor", -- Install this one manually https://phpactor.readthedocs.io/en/master/usage/standalone.html#global-installation -{% endif %} -{% if 'sql' in dev_stuffs %} - "sqlls", -{% endif %} -} -for _, lsp in ipairs(servers) do - nvim_lsp[lsp].setup { - on_attach = on_attach, - flags = { - debounce_text_changes = 150, - } - } -end -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/vim_lsp.j2 b/config/automatrop/roles/vim/templates/plugins/vim_lsp.j2 deleted file mode 100644 index dfd0d2e..0000000 --- a/config/automatrop/roles/vim/templates/plugins/vim_lsp.j2 +++ /dev/null @@ -1,39 +0,0 @@ -{# LSP client for Vim8 and neovim #} -{{ add_source('prabirshrestha/vim-lsp') -}} -{{ add_source('mattn/vim-lsp-settings') -}} -" (providers are automatically detected thanks to vim-lsp-settings. -" You can even install some locally using :LspInstallServer) - -let g:lsp_signs_enabled = 1 -let g:lsp_diagnostics_echo_cursor = 1 - -let g:lsp_signs_error = {'text': '✗'} -let g:lsp_signs_warning = {'text': '‼'} -let g:lsp_signs_information = {'text': 'ℹ'} -let g:lsp_signs_hint = {'text': '?'} - -let g:lsp_highlight_references_enabled = 1 - -function! s:on_lsp_buffer_enabled() abort - setlocal omnifunc=lsp#complete - setlocal signcolumn=yes - if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif - nmap gd (lsp-definition) - nmap gD (lsp-declaration) - nmap gr (lsp-references) - nmap gi (lsp-implementation) - nmap rn (lsp-rename) - nmap [d (lsp-previous-diagnostic) - nmap ]d (lsp-next-diagnostic) - nmap K (lsp-hover) - nmap f (lsp-document-format) - vmap f (lsp-document-range-format) - inoremap lsp#scroll(+4) - inoremap lsp#scroll(-4) -endfunction - -augroup lsp_install - au! - " call s:on_lsp_buffer_enabled only for languages that has the server registered. - autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() -augroup END diff --git a/config/nix/hm/dev.nix b/config/nix/hm/dev.nix index 7e9f634..b2b5c66 100644 --- a/config/nix/hm/dev.nix +++ b/config/nix/hm/dev.nix @@ -6,7 +6,6 @@ # Ansible ansible ansible-lint - ansible-language-server # C/C++ cmake @@ -42,24 +41,9 @@ # nix nix - rnix-lsp - - # Perl - perl536Packages.PLS # Python - mypy - python3Packages.black - python3Packages.python-lsp-server - python3Packages.pylsp-mypy - python3Packages.pyls-isort - python3Packages.python-lsp-black - # TODO Are all those for the same language server? python3Packages.ipython - - # Bash - nodePackages.bash-language-server - sqls ]; } diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index 19c7165..b9428f7 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -54,27 +54,27 @@ in # Go to whatever telescope = { enable = true; - # FIXME Crashes nvim on startup, complaining about some keymap - # keymaps = { - # gF = "find_files"; - # gf = "git_files"; - # gB = "buffers"; - # gl = "current_buffer_fuzzy_find"; - # gL = "live_grep"; - # gT = "tags"; - # gt = "treesitter"; - # gm = "marks"; - # gh = "oldfiles"; - # gH = "command_history"; - # gS = "search_history"; - # gC = "commands"; - # gr = "lsp_references"; - # ga = "lsp_code_actions"; - # ge = "lsp_document_diagnostics"; - # gE = "lsp_workspace_diagnostics"; - # gd = "lsp_definitions"; - # gs = "lsp_document_symbols"; - # }; + keymaps = { + gF = "find_files"; + gf = "git_files"; + gB = "buffers"; + gl = "current_buffer_fuzzy_find"; + gL = "live_grep"; + gT = "tags"; + gt = "treesitter"; + gm = "marks"; + gh = "oldfiles"; + gH = "command_history"; + gS = "search_history"; + gC = "commands"; + gr = "lsp_references"; + # ga = "lsp_code_actions"; + # ge = "lsp_document_diagnostics"; + # gE = "lsp_workspace_diagnostics"; + # FIXME Above makes nvim crash on startup, action is not provided + gd = "lsp_definitions"; + gs = "lsp_document_symbols"; + }; defaults = { vimgrep_arguments = [ "${pkgs.ripgrep}/bin/rg" @@ -97,6 +97,63 @@ in # Surrounding pairs surround.enable = true; # Change surrounding pairs (e.g. brackets, quotes) + + # Language Server + lsp = { + enable = true; + keymaps = { + silent = true; + diagnostic = { + "e" = "open_float"; + "[e" = "goto_prev"; + "]e" = "goto_next"; + }; + lspBuf = { + "gD" = "declaration"; + "K" = "hover"; + "gi" = "implementation"; + "" = "signature_help"; + "wa" = "add_workspace_folder"; + "wr" = "remove_workspace_folder"; + # "wl" = "list_workspace_folder"; + # TODO Full thing was function() print(vim.inspect(vim.lsp.buf.list_workspace_folder())) end but not sure I'm ever really using this + # Also makes nvim crash like this, so uncommented + "D" = "type_definition"; + "rn" = "rename"; + "f" = "format"; + # TODO Full thing was function() vim.lsp.buf.format { async = true } end, so async while this isn't + # Maybe replace this with lsp-format? + }; + }; + servers = { + # FIXME ansiblels + bashls.enable = true; # Bash + jsonls.enable = true; # JSON + # FIXME perlls + pylsp = { # Python + enable = true; + settings.plugins = { + black.enabled = true; + flake8.enabled = true; # FIXME Not getting the warnings I would expect + isort.enabled = true; + pylsp_mypy.enabled = true; + }; + }; + # FIXME phpactor. Only from 23.11 + # phpactor.enable = true; # PHP + rnix-lsp.enable = true; # Nix + # FIXME sqlls + yamlls.enable = true; # Nix + # TODO Check out none-ls + }; + # FIXME vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') as onAttach... is it needed? + # FIXME flags = { debounce_text_changes = 150 } is the default value ok? Maybe it was actually ignored + }; + nvim-lightbulb = { # Shows a lightbulb whenever a codeAction is available under the cursor + enable = true; + autocmd.enabled = true; + }; + lspkind.enable = true; # Add icons to LSP completions }; extraPlugins = with pkgs.vimPlugins; [ nvim-scrollview # Scroll bar @@ -125,10 +182,14 @@ in vim-gutentags # Generate tags symbols-outline-nvim # Show a symbol panel on the right # TODO Fails on startup. Same on Arch. Config issue? + + # Language server + lsp_signature-nvim # Show argument definition when typing a function ]; extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [ ./vim/feline.lua ./vim/symbols-outline-nvim.lua + ./vim/lsp_signature-nvim.lua ]; extraConfigVim = '' " vim-gutentags diff --git a/config/nix/hm/vim/lsp_signature-nvim.lua b/config/nix/hm/vim/lsp_signature-nvim.lua new file mode 100644 index 0000000..4f5fff7 --- /dev/null +++ b/config/nix/hm/vim/lsp_signature-nvim.lua @@ -0,0 +1,3 @@ +require'lsp_signature'.on_attach({ + hint_enable = false, +}) From 068a8c9965e7856f62619a9525213cf73f455041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 1 Nov 2023 09:17:01 +0100 Subject: [PATCH 022/108] nix: Add vim treesitter plugins --- .../roles/vim/templates/pluginlist.j2 | 9 --- .../vim/templates/plugins/indent-blankline.j2 | 3 - .../roles/vim/templates/plugins/treesitter.j2 | 66 ------------------- config/nix/hm/vim.nix | 16 +++++ .../hm/vim/nvim-ts-rainbow.lua} | 4 -- 5 files changed, 16 insertions(+), 82 deletions(-) delete mode 100644 config/automatrop/roles/vim/templates/plugins/indent-blankline.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/treesitter.j2 rename config/{automatrop/roles/vim/templates/plugins/ts-rainbow.j2 => nix/hm/vim/nvim-ts-rainbow.lua} (73%) diff --git a/config/automatrop/roles/vim/templates/pluginlist.j2 b/config/automatrop/roles/vim/templates/pluginlist.j2 index abaa6be..aee12e7 100644 --- a/config/automatrop/roles/vim/templates/pluginlist.j2 +++ b/config/automatrop/roles/vim/templates/pluginlist.j2 @@ -16,15 +16,6 @@ " Theme source ~/.config/vim/theme.vim -" Treesitter -{% if variant == 'nvim' %} -{{ use_plugin('treesitter') }} -{{ use_plugin('ts-rainbow') }} -{# TODO -{{ use_plugin('indent-blankline') }} -#} -{% endif %} - " Snippets {{ use_plugin('vsnip') }} diff --git a/config/automatrop/roles/vim/templates/plugins/indent-blankline.j2 b/config/automatrop/roles/vim/templates/plugins/indent-blankline.j2 deleted file mode 100644 index 138e4b1..0000000 --- a/config/automatrop/roles/vim/templates/plugins/indent-blankline.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{# Show ident lines #} -{{ add_source('lukas-reineke/indent-blankline.nvim') -}} -let g:indent_blankline_char_highlight_list = ['Error', 'Function'] diff --git a/config/automatrop/roles/vim/templates/plugins/treesitter.j2 b/config/automatrop/roles/vim/templates/plugins/treesitter.j2 deleted file mode 100644 index 0bfeba3..0000000 --- a/config/automatrop/roles/vim/templates/plugins/treesitter.j2 +++ /dev/null @@ -1,66 +0,0 @@ -{# Allow for better syntax highlighting. Bit experimental #} -{{ add_source('nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}) -}} -{# To check if it's really working -{{ add_source('nvim-treesitter/playground') -}} -#} -lua < Date: Wed, 1 Nov 2023 09:46:49 +0100 Subject: [PATCH 023/108] nix: Add language server missing from Ansible --- config/nix/hm/vim.nix | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index 6cfbaf3..8407289 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -129,34 +129,44 @@ in # FIXME ansiblels bashls.enable = true; # Bash jsonls.enable = true; # JSON + lua-ls.enable = true; # Lua (for Neovim debugging) # FIXME perlls - pylsp = { # Python + pylsp = { + # Python enable = true; settings.plugins = { black.enabled = true; - flake8.enabled = true; # FIXME Not getting the warnings I would expect + flake8.enabled = true; isort.enabled = true; + mccabe.enabled = true; + pycodestyle.enabled = true; + pyflakes.enabled = true; + pylint.enabled = true; pylsp_mypy.enabled = true; + # FIXME Somehow no warning is shown + # TODO Could add some, could also remove some }; }; # FIXME phpactor. Only from 23.11 # phpactor.enable = true; # PHP rnix-lsp.enable = true; # Nix # FIXME sqlls - yamlls.enable = true; # Nix + yamlls.enable = true; # YAML # TODO Check out none-ls }; # FIXME vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') as onAttach... is it needed? # FIXME flags = { debounce_text_changes = 150 } is the default value ok? Maybe it was actually ignored }; - nvim-lightbulb = { # Shows a lightbulb whenever a codeAction is available under the cursor + nvim-lightbulb = { + # Shows a lightbulb whenever a codeAction is available under the cursor enable = true; autocmd.enabled = true; }; lspkind.enable = true; # Add icons to LSP completions # Treesitter - treesitter = { # Allows for better syntax highlighting + treesitter = { + # Allows for better syntax highlighting enable = true; incrementalSelection = { enable = true; From 9b450cc22f9d26ece587409f07a80de28b73c779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 1 Nov 2023 18:03:14 +0100 Subject: [PATCH 024/108] nix: vim: Snippets and auto-completion --- .../roles/vim/templates/pluginlist.j2 | 11 ---------- .../roles/vim/templates/plugins/vsnip.j2 | 4 ---- config/nix/hm/vim.nix | 20 +++++++++++++++++++ .../hm/vim/nvim-compe.lua} | 16 ++------------- 4 files changed, 22 insertions(+), 29 deletions(-) delete mode 100644 config/automatrop/roles/vim/templates/plugins/vsnip.j2 rename config/{automatrop/roles/vim/templates/plugins/nvim_compe.j2 => nix/hm/vim/nvim-compe.lua} (78%) diff --git a/config/automatrop/roles/vim/templates/pluginlist.j2 b/config/automatrop/roles/vim/templates/pluginlist.j2 index aee12e7..2dff490 100644 --- a/config/automatrop/roles/vim/templates/pluginlist.j2 +++ b/config/automatrop/roles/vim/templates/pluginlist.j2 @@ -16,17 +16,6 @@ " Theme source ~/.config/vim/theme.vim -" Snippets -{{ use_plugin('vsnip') }} - -" Auto-completion -{% if variant == 'nvim' %} -{{ use_plugin('nvim_compe') }} -{% else %} -{{ use_plugin('deoplete') }} -{{ use_plugin('supertab') }} -{% endif %} - " Undo management {{ use_plugin('undotree') }} diff --git a/config/automatrop/roles/vim/templates/plugins/vsnip.j2 b/config/automatrop/roles/vim/templates/plugins/vsnip.j2 deleted file mode 100644 index 2c710ca..0000000 --- a/config/automatrop/roles/vim/templates/plugins/vsnip.j2 +++ /dev/null @@ -1,4 +0,0 @@ -{{ add_source('hrsh7th/vim-vsnip') -}} -{{ add_source('hrsh7th/vim-vsnip-integ') -}} -{{ add_source('rafamadriz/friendly-snippets') -}} -{# TODO Ansible snippets? #} diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index 8407289..7c72942 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -210,6 +210,15 @@ in # Treesitter nvim-ts-rainbow # Randomly color parenthesis pairs # 23.11: Replace with plugins.rainbow-delimiters + + # Snippets + vim-vsnip + vim-vsnip-integ + friendly-snippets + + # Auto-completion + nvim-compe + # TODO Archived. Maybe use nvim-cmp and plugins instead? ]; extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [ ./vim/feline.lua @@ -220,6 +229,17 @@ in extraConfigVim = '' " vim-gutentags let g:gutentags_cache_dir = expand('~/.cache/nvim/tags') + + " nvim-compe + " Copy-pasted because I couldn't be bothered + set completeopt=menuone,noselect + + inoremap compe#complete() + inoremap compe#confirm('') + inoremap compe#close('') + inoremap compe#scroll({ 'delta': +4 }) + inoremap compe#scroll({ 'delta': -4 }) + ''; autoCmd = [ # vim-easy-align: Align Markdown tables diff --git a/config/automatrop/roles/vim/templates/plugins/nvim_compe.j2 b/config/nix/hm/vim/nvim-compe.lua similarity index 78% rename from config/automatrop/roles/vim/templates/plugins/nvim_compe.j2 rename to config/nix/hm/vim/nvim-compe.lua index 0c89f21..81d2274 100644 --- a/config/automatrop/roles/vim/templates/plugins/nvim_compe.j2 +++ b/config/nix/hm/vim/nvim-compe.lua @@ -1,7 +1,4 @@ -{{ add_source('hrsh7th/nvim-compe') -}} -{# I'm a bit lost with all this, so this is the default recommended config, -using vim-vsnip because the proposed configuration for tab-completion uses it, so… #} -lua << EOF +-- Default recommended config require'compe'.setup { enabled = true; autocomplete = true; @@ -32,17 +29,9 @@ require'compe'.setup { vsnip = true; }; } -EOF -set completeopt=menuone,noselect +-- Vim instructions were here -inoremap compe#complete() -inoremap compe#confirm('') -inoremap compe#close('') -inoremap compe#scroll({ 'delta': +4 }) -inoremap compe#scroll({ 'delta': -4 }) - -lua << EOF local t = function(str) return vim.api.nvim_replace_termcodes(str, true, true, true) end @@ -81,4 +70,3 @@ vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) -EOF From d811d025e643555a3bf3f07f0902c0cd1f33b691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 2 Nov 2023 15:42:17 +0100 Subject: [PATCH 025/108] nix: Finish adding vim plugins --- .../roles/vim/templates/pluginlist.j2 | 27 --------------- .../roles/vim/templates/plugins/ansible.j2 | 2 -- .../roles/vim/templates/plugins/colorizer.j2 | 7 ---- .../roles/vim/templates/plugins/dap.j2 | 2 -- .../roles/vim/templates/plugins/fugitive.j2 | 4 --- .../roles/vim/templates/plugins/gitgutter.j2 | 2 -- .../roles/vim/templates/plugins/gitsigns.j2 | 7 ---- .../vim/templates/plugins/languagetool.j2 | 3 -- .../roles/vim/templates/plugins/pandoc.j2 | 6 ---- .../roles/vim/templates/plugins/tcomment.j2 | 2 -- .../roles/vim/templates/plugins/undotree.j2 | 3 -- config/nix/hm/vim.nix | 34 +++++++++++++++++++ 12 files changed, 34 insertions(+), 65 deletions(-) delete mode 100644 config/automatrop/roles/vim/templates/plugins/ansible.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/colorizer.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/dap.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/fugitive.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/gitgutter.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/gitsigns.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/languagetool.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/pandoc.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/tcomment.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/undotree.j2 diff --git a/config/automatrop/roles/vim/templates/pluginlist.j2 b/config/automatrop/roles/vim/templates/pluginlist.j2 index 2dff490..e592df2 100644 --- a/config/automatrop/roles/vim/templates/pluginlist.j2 +++ b/config/automatrop/roles/vim/templates/pluginlist.j2 @@ -15,30 +15,3 @@ " Theme source ~/.config/vim/theme.vim - -" Undo management -{{ use_plugin('undotree') }} - -" Git helpers -{{ use_plugin('fugitive') }} -{% if variant == 'nvim' %} -{{ use_plugin('gitsigns') }} -{% else %} -{{ use_plugin('gitgutter') }} -{% endif %} - -" Language-specific stuff -{{ use_plugin('tcomment') }} -{{ use_plugin('languagetool') }} -{{ use_plugin('pandoc') }} -{% if variant == 'nvim' %} -{{ use_plugin('dap') }} -{{ use_plugin('colorizer') }} -{% else %} -{% if 'c' in dev_stuffs or 'c++' in dev_stuffs %} -{{ use_plugin('vebugger') }} -{% endif %} -{% endif %} -{% if 'ansible' in dev_stuffs %} -{{ use_plugin('ansible') }} -{% endif %} diff --git a/config/automatrop/roles/vim/templates/plugins/ansible.j2 b/config/automatrop/roles/vim/templates/plugins/ansible.j2 deleted file mode 100644 index 0fb51fa..0000000 --- a/config/automatrop/roles/vim/templates/plugins/ansible.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Various for Ansible #} -{{ add_source('pearofducks/ansible-vim', { 'do': './UltiSnips/generate.sh'}) -}} diff --git a/config/automatrop/roles/vim/templates/plugins/colorizer.j2 b/config/automatrop/roles/vim/templates/plugins/colorizer.j2 deleted file mode 100644 index 2ce1848..0000000 --- a/config/automatrop/roles/vim/templates/plugins/colorizer.j2 +++ /dev/null @@ -1,7 +0,0 @@ -{# Display the actual color for color codes " #} -{{ add_source('norcalli/nvim-colorizer.lua') -}} -set termguicolors -lua << EOF -require'colorizer'.setup() -EOF -{# TODO Enable for css functions too #} diff --git a/config/automatrop/roles/vim/templates/plugins/dap.j2 b/config/automatrop/roles/vim/templates/plugins/dap.j2 deleted file mode 100644 index 616b124..0000000 --- a/config/automatrop/roles/vim/templates/plugins/dap.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Debug Adapter Protocol client #} -{{ add_source('mfussenegger/nvim-dap') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/fugitive.j2 b/config/automatrop/roles/vim/templates/plugins/fugitive.j2 deleted file mode 100644 index 6abf2e7..0000000 --- a/config/automatrop/roles/vim/templates/plugins/fugitive.j2 +++ /dev/null @@ -1,4 +0,0 @@ -{# Git basics #} -{{ add_source('tpope/vim-fugitive') -}} -{# Open files in GitLab #} -{{ add_source('shumphrey/fugitive-gitlab.vim') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/gitgutter.j2 b/config/automatrop/roles/vim/templates/plugins/gitgutter.j2 deleted file mode 100644 index d6b4fad..0000000 --- a/config/automatrop/roles/vim/templates/plugins/gitgutter.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Show changed git lines in the gutter #} -{{ add_source('airblade/vim-gitgutter') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/gitsigns.j2 b/config/automatrop/roles/vim/templates/plugins/gitsigns.j2 deleted file mode 100644 index ca5608f..0000000 --- a/config/automatrop/roles/vim/templates/plugins/gitsigns.j2 +++ /dev/null @@ -1,7 +0,0 @@ -{# Show changed git lines in the gutter #} -{{ add_source('lewis6991/gitsigns.nvim') -}} -{# Dependency #} -{{ add_source('nvim-lua/plenary.nvim') -}} -lua << EOF -require('gitsigns').setup() -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/languagetool.j2 b/config/automatrop/roles/vim/templates/plugins/languagetool.j2 deleted file mode 100644 index a677f9a..0000000 --- a/config/automatrop/roles/vim/templates/plugins/languagetool.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{# Check grammar for human languages #} -{{ add_source('dpelle/vim-LanguageTool') -}} -let g:languagetool_jar = "/usr/share/java/languagetool/languagetool-commandline.jar" diff --git a/config/automatrop/roles/vim/templates/plugins/pandoc.j2 b/config/automatrop/roles/vim/templates/plugins/pandoc.j2 deleted file mode 100644 index f2acc5d..0000000 --- a/config/automatrop/roles/vim/templates/plugins/pandoc.j2 +++ /dev/null @@ -1,6 +0,0 @@ -{# Pandoc specific stuff because there's no LSP for it #} -{{ add_source('vim-pandoc/vim-pandoc') -}} -{{ add_source('vim-pandoc/vim-pandoc-syntax') -}} -let g:pandoc#modules#disabled = ["folding"] -let g:pandoc#spell#enabled = 0 -let g:pandoc#syntax#conceal#use = 0 diff --git a/config/automatrop/roles/vim/templates/plugins/tcomment.j2 b/config/automatrop/roles/vim/templates/plugins/tcomment.j2 deleted file mode 100644 index 0539d77..0000000 --- a/config/automatrop/roles/vim/templates/plugins/tcomment.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Language-aware (un)commenting #} -{{ add_source('tomtom/tcomment_vim') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/undotree.j2 b/config/automatrop/roles/vim/templates/plugins/undotree.j2 deleted file mode 100644 index 2ad56b1..0000000 --- a/config/automatrop/roles/vim/templates/plugins/undotree.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{# Navigate undo #} -{{ add_source('mbbill/undotree') -}} -nmap u :UndotreeToggle diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index 7c72942..63c6729 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -175,6 +175,16 @@ in }; # TODO Investigate https://github.com/nvim-treesitter/nvim-treesitter-textobjects indent-blankline.enable = true; # 23.11 integrate with rainbow-delimiters and use more of the options + + undotree.enable = true; # Navigate edition history + + # Git + fugitive.enable = true; # Git basics + gitsigns.enable = true; # Show changed lines in the gutter + + # Language-specific + # dap.enable = true; # Debug Adapter Protocol client # 23.11 + nvim-colorizer.enable = true; # Display colors of color-codes }; extraPlugins = with pkgs.vimPlugins; [ nvim-scrollview # Scroll bar @@ -219,6 +229,18 @@ in # Auto-completion nvim-compe # TODO Archived. Maybe use nvim-cmp and plugins instead? + + # Git + fugitive-gitlab-vim # Open files in GitLab + # TODO Connect it! + + # Language-specific + tcomment_vim # Language-aware (un)commenting + vim-LanguageTool # Check grammar for human languages + vim-pandoc # Pandoc-specific stuff because there's no LSP for it + vim-pandoc-syntax + nvim-dap # Debug Adapter Protocol client + ansible-vim # FIXME See if it doesn't require to do ./UltiSnips/generate.sh ]; extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [ ./vim/feline.lua @@ -240,6 +262,15 @@ in inoremap compe#scroll({ 'delta': +4 }) inoremap compe#scroll({ 'delta': -4 }) + " languagetool + let g:languagetool_cmd = "${pkgs.languagetool}/bin/languagetool-commandline" + " TODO Doesn't work + + " vim-pandox + let g:pandoc#modules#disabled = ["folding"] + let g:pandoc#spell#enabled = 0 + let g:pandoc#syntax#conceal#use = 0 + ''; autoCmd = [ # vim-easy-align: Align Markdown tables @@ -271,6 +302,9 @@ in # symbols-outline-nvim normal."s" = { action = "SymbolsOutline"; silent = true; }; + # undotree + normal."u" = { action = "UndotreeToggle"; silent = true; }; + }; }; } From 3d9dc4a4bf481c994d4e7de1edf00cce37360f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 2 Nov 2023 15:46:23 +0100 Subject: [PATCH 026/108] nix: vim: plugins cleanup --- config/automatrop/roles/vim/tasks/main.yml | 11 -------- .../roles/vim/templates/init.vim.j2 | 4 --- .../roles/vim/templates/plugininstall.j2 | 13 ---------- .../roles/vim/templates/pluginlist.j2 | 9 ------- .../roles/vim/templates/plugins/ale.j2 | 10 ------- .../vim/templates/plugins/asyncomplete.j2 | 14 ---------- .../roles/vim/templates/plugins/deoplete.j2 | 26 ------------------- .../vim/templates/plugins/languageclient.j2 | 20 -------------- .../roles/vim/templates/plugins/reload.j2 | 4 --- .../roles/vim/templates/plugins/semshi.j2 | 2 -- .../roles/vim/templates/plugins/shade.j2 | 6 ----- .../vim/templates/plugins/smooth_scroll.j2 | 2 -- .../roles/vim/templates/plugins/supertab.j2 | 7 ----- .../roles/vim/templates/plugins/vebugger.j2 | 2 -- .../roles/vim/templates/plugins/vista.j2 | 12 --------- 15 files changed, 142 deletions(-) delete mode 100644 config/automatrop/roles/vim/templates/plugininstall.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/ale.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/asyncomplete.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/deoplete.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/languageclient.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/reload.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/semshi.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/shade.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/smooth_scroll.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/supertab.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/vebugger.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/vista.j2 diff --git a/config/automatrop/roles/vim/tasks/main.yml b/config/automatrop/roles/vim/tasks/main.yml index def3f1e..864f679 100644 --- a/config/automatrop/roles/vim/tasks/main.yml +++ b/config/automatrop/roles/vim/tasks/main.yml @@ -1,15 +1,4 @@ -- name: Configure vim plugin list - template: - src: plugininstall.j2 - dest: "{{ ansible_user_dir }}/.config/{{ variant }}/plugininstall.vim" - mode: "u=rw,g=r,o=r" - notify: - - "{{ variant }} plugins changed" - loop: "{{ vim_variants }}" - loop_control: - loop_var: variant - - name: Configure vim template: src: init.vim.j2 diff --git a/config/automatrop/roles/vim/templates/init.vim.j2 b/config/automatrop/roles/vim/templates/init.vim.j2 index d123945..63ecb4d 100644 --- a/config/automatrop/roles/vim/templates/init.vim.j2 +++ b/config/automatrop/roles/vim/templates/init.vim.j2 @@ -9,10 +9,6 @@ call system('mkdir ' . vimDir) let &runtimepath.=','.vimDir set viminfo+=n~/.cache/{{ variant }}/viminfo -" PLUGIN INSTALLATION - -source ~/.config/{{ variant }}/plugininstall.vim - " EDITOR CONFIGURATION {% include 'editor.j2' %} diff --git a/config/automatrop/roles/vim/templates/plugininstall.j2 b/config/automatrop/roles/vim/templates/plugininstall.j2 deleted file mode 100644 index 6747065..0000000 --- a/config/automatrop/roles/vim/templates/plugininstall.j2 +++ /dev/null @@ -1,13 +0,0 @@ -source ~/.config/vim/plug.vim -{% set plugins = namespace(sources=[]) %} -{% import 'pluginlist.j2' as pluginlist with context %} - -call plug#begin('~/.cache/{{ variant }}/plugged') -{% for link, extra in plugins.sources %} -{% if extra %} -Plug '{{ link }}', { {% for k, v in extra.items() %}'{{ k }}': '{{ v }}', {% endfor %} } -{% else %} -Plug '{{ link }}' -{% endif %} -{% endfor %} -call plug#end() diff --git a/config/automatrop/roles/vim/templates/pluginlist.j2 b/config/automatrop/roles/vim/templates/pluginlist.j2 index e592df2..038b99a 100644 --- a/config/automatrop/roles/vim/templates/pluginlist.j2 +++ b/config/automatrop/roles/vim/templates/pluginlist.j2 @@ -1,12 +1,3 @@ -{% macro add_source(link, extra={}) -%} -{% set plugins.sources = plugins.sources + [(link, extra)] %} -{%- endmacro -%} -{% macro use_plugin(name) -%} -" START PLUGIN CONFIG {{ name }} -{% include 'plugins/' + name + '.j2' +%} -" END PLUGIN CONFIG {{ name }} -{%- endmacro -%} - " Visuals {{ use_plugin('devicons') }} {% if variant == 'nvim' %} diff --git a/config/automatrop/roles/vim/templates/plugins/ale.j2 b/config/automatrop/roles/vim/templates/plugins/ale.j2 deleted file mode 100644 index 99040cb..0000000 --- a/config/automatrop/roles/vim/templates/plugins/ale.j2 +++ /dev/null @@ -1,10 +0,0 @@ -" Asynchronous Lint Engine -" LSP client for vim and nvim -{{ add_source('dense-analysis/ale') }} - -nmap :ALEFix - -let g:ale_sign_error = '×' -let g:ale_sign_warning = '!' -let g:ale_completion_enabled = 1 -let g:ale_fixers = ['autopep8', 'shfmt', 'uncrustify', 'remove_trailing_lines', 'trim_whitespace', 'phpcbf'] diff --git a/config/automatrop/roles/vim/templates/plugins/asyncomplete.j2 b/config/automatrop/roles/vim/templates/plugins/asyncomplete.j2 deleted file mode 100644 index dcf0070..0000000 --- a/config/automatrop/roles/vim/templates/plugins/asyncomplete.j2 +++ /dev/null @@ -1,14 +0,0 @@ -{{ add_source('prabirshrestha/asyncomplete.vim') -}} -let g:asyncomplete_auto_popup = 1 -inoremap pumvisible() ? "\" : "\" -inoremap pumvisible() ? "\" : "\" -inoremap pumvisible() ? "\" : "\" -imap (asyncomplete_force_refresh) - -{{ add_source('prabirshrestha/asyncomplete-file.vim') -}} -au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({ - \ 'name': 'file', - \ 'whitelist': ['*'], - \ 'priority': 10, - \ 'completor': function('asyncomplete#sources#file#completor') - \ })) diff --git a/config/automatrop/roles/vim/templates/plugins/deoplete.j2 b/config/automatrop/roles/vim/templates/plugins/deoplete.j2 deleted file mode 100644 index 7219c8c..0000000 --- a/config/automatrop/roles/vim/templates/plugins/deoplete.j2 +++ /dev/null @@ -1,26 +0,0 @@ -{# Auto-completion for vim and nvim #} -{% if variant == 'nvim' -%} -{{ add_source('Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'}) -}} -{% else -%} -{{ add_source('Shougo/deoplete.nvim') -}} -{{ add_source('roxma/nvim-yarp') -}} -{{ add_source('roxma/vim-hug-neovim-rpc') -}} -{% endif -%} -{% raw %} -let g:deoplete#enable_at_startup = 1 -inoremap -\ pumvisible() ? "\" : -\ check_back_space() ? "\" : -\ deoplete#manual_complete() -function! s:check_back_space() abort "{{{ -let col = col('.') - 1 -return !col || getline('.')[col - 1] =~ '\s' -endfunction"}}} -{% endraw %} - -" suggested by ssemshi to make it not too slow -" let g:deoplete#auto_complete_delay = 100 -call deoplete#custom#option({ -\ 'auto_complete_delay': 100, -\ 'smart_case': v:true, -\ }) diff --git a/config/automatrop/roles/vim/templates/plugins/languageclient.j2 b/config/automatrop/roles/vim/templates/plugins/languageclient.j2 deleted file mode 100644 index 6f319d9..0000000 --- a/config/automatrop/roles/vim/templates/plugins/languageclient.j2 +++ /dev/null @@ -1,20 +0,0 @@ -{{ add_source('autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh'}) -}} - -let g:LanguageClient_serverCommands = { - \ 'python': ['pyls'], - \ 'sh': ['bash-language-server', 'start'], - \ } -let g:LanguageClient_loggingFile = expand('~/.cache/{{ variant }}/LanguageClient.log') - -function LC_maps() - if has_key(g:LanguageClient_serverCommands, &filetype) - nnoremap K :call LanguageClient#textDocument_hover() - nnoremap gd :call LanguageClient#textDocument_definition() - nnoremap gD :call LanguageClient#textDocument_references() - nnoremap :call LanguageClient#textDocument_rename() - nnoremap :call LanguageClient#textDocument_formatting() - set completefunc=LanguageClient#complete - set omnifunc=LanguageClient#complete - endif -endfunction -autocmd FileType * call LC_maps() diff --git a/config/automatrop/roles/vim/templates/plugins/reload.j2 b/config/automatrop/roles/vim/templates/plugins/reload.j2 deleted file mode 100644 index 483001f..0000000 --- a/config/automatrop/roles/vim/templates/plugins/reload.j2 +++ /dev/null @@ -1,4 +0,0 @@ -{# Live reload #} -{{ add_source('famiu/nvim-reload') -}} -{{ add_source('nvim-lua/plenary.nvim') -}} -{# Not used, this breaks color, and source $MYVIMRC is all that we need to reload colorscheme #} diff --git a/config/automatrop/roles/vim/templates/plugins/semshi.j2 b/config/automatrop/roles/vim/templates/plugins/semshi.j2 deleted file mode 100644 index 1a77fe0..0000000 --- a/config/automatrop/roles/vim/templates/plugins/semshi.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Semantic highlighting for Python for neovim #} -{{ add_source('numirias/semshi', {'do': ':UpdateRemotePlugins'}) -}} diff --git a/config/automatrop/roles/vim/templates/plugins/shade.j2 b/config/automatrop/roles/vim/templates/plugins/shade.j2 deleted file mode 100644 index 1cddf54..0000000 --- a/config/automatrop/roles/vim/templates/plugins/shade.j2 +++ /dev/null @@ -1,6 +0,0 @@ -{# Dim inactive windows #} -{# Not working very well, at least with undotree #} -{{add_source('sunjon/shade.nvim')-}} -lua << EOF -require'shade'.setup() -EOF diff --git a/config/automatrop/roles/vim/templates/plugins/smooth_scroll.j2 b/config/automatrop/roles/vim/templates/plugins/smooth_scroll.j2 deleted file mode 100644 index 36d9752..0000000 --- a/config/automatrop/roles/vim/templates/plugins/smooth_scroll.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Smoooooth scrolling #} -{{ add_source('terryma/vim-smooth-scroll') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/supertab.j2 b/config/automatrop/roles/vim/templates/plugins/supertab.j2 deleted file mode 100644 index 8b3abb6..0000000 --- a/config/automatrop/roles/vim/templates/plugins/supertab.j2 +++ /dev/null @@ -1,7 +0,0 @@ -{# Use TAB for autocompletion #} -{{ add_source('ervandew/supertab') -}} -let g:SuperTabLongestEnhanced = 1 -let g:SuperTabLongestHighlight = 1 -{# TODO longest doesn't work, even when longest is set in completeopt #} -let g:SuperTabDefaultCompletionType = "" " Go down when completing -let g:SuperTabContextDefaultCompletionType = "" diff --git a/config/automatrop/roles/vim/templates/plugins/vebugger.j2 b/config/automatrop/roles/vim/templates/plugins/vebugger.j2 deleted file mode 100644 index 013a066..0000000 --- a/config/automatrop/roles/vim/templates/plugins/vebugger.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{# Debug from the editor #} -{{ add_source('idanarye/vim-vebugger') -}} diff --git a/config/automatrop/roles/vim/templates/plugins/vista.j2 b/config/automatrop/roles/vim/templates/plugins/vista.j2 deleted file mode 100644 index 20cc836..0000000 --- a/config/automatrop/roles/vim/templates/plugins/vista.j2 +++ /dev/null @@ -1,12 +0,0 @@ -{# Tag bar #} -{{ add_source('liuchengxu/vista.vim') -}} -nmap s :Vista!! -let g:vista_icon_indent = ["▸ ", ""] - -let g:vista#renderer#enable_icon = 1 - -" The default icons can't be suitable for all the filetypes, you can extend it as you wish. -let g:vista#renderer#icons = { -\ "function": "f", -\ "variable": "x", -\ } From 7f71eec03c8e561b9b1b88f4ca17f3db69404184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 2 Nov 2023 17:04:53 +0100 Subject: [PATCH 027/108] nix: Editor config Should have started there I guess. --- config/automatrop/roles/vim/handlers/main.yml | 11 -- .../automatrop/roles/vim/templates/editor.j2 | 101 ------------------ .../roles/vim/templates/init.vim.j2 | 15 --- config/nix/hm/common.nix | 2 +- config/nix/hm/vim.nix | 75 +++++++++++++ 5 files changed, 76 insertions(+), 128 deletions(-) delete mode 100644 config/automatrop/roles/vim/handlers/main.yml delete mode 100644 config/automatrop/roles/vim/templates/editor.j2 diff --git a/config/automatrop/roles/vim/handlers/main.yml b/config/automatrop/roles/vim/handlers/main.yml deleted file mode 100644 index e11ae85..0000000 --- a/config/automatrop/roles/vim/handlers/main.yml +++ /dev/null @@ -1,11 +0,0 @@ -- name: Upgrade Neovim plugins - command: "nvim +PlugUpgrade +PlugUpdate +PlugInstall +qall!" - listen: nvim plugins changed - environment: - VIMINIT: "source {{ ansible_user_dir }}/.config/nvim/plugininstall.vim" - -- name: Upgrade Vim plugins - command: "vim +PlugUpgrade +PlugUpdate +PlugInstall +qall!" - listen: vim plugins changed - environment: - VIMINIT: "source {{ ansible_user_dir }}/.config/vim/plugininstall.vim" diff --git a/config/automatrop/roles/vim/templates/editor.j2 b/config/automatrop/roles/vim/templates/editor.j2 deleted file mode 100644 index 0b77445..0000000 --- a/config/automatrop/roles/vim/templates/editor.j2 +++ /dev/null @@ -1,101 +0,0 @@ -" From https://www.hillelwayne.com/post/intermediate-vim/ - -set encoding=utf-8 -set title - -set number -set ruler -set wrap - -set scrolloff=10 - -set ignorecase -set smartcase -set gdefault -if has('nvim') - set inccommand=nosplit " Shows you in realtime what changes your ex command should make. -endif - -set incsearch - -set hlsearch - -set tabstop=4 -set shiftwidth=4 -set expandtab - -set visualbell -set noerrorbells - -set backspace=indent,eol,start - -set hidden -set updatetime=250 -set lazyredraw " Do not redraw screen in the middle of a macro. Makes them complete faster. - -set cursorcolumn - -set splitbelow - -" Turn off relativenumber only for insert mode. -if has('nvim') - set relativenumber - augroup every - autocmd! - au InsertEnter * set norelativenumber - au InsertLeave * set relativenumber - augroup END -endif - -" Keep undo history across sessions by storing it in a file -if has('persistent_undo') - let myUndoDir = expand(vimDir . '/undodir') - " Create dirs - call system('mkdir ' . myUndoDir) - let &undodir = myUndoDir - set undofile -endif - -syntax enable - -" From http://stackoverflow.com/a/5004785/2766106 -set list -set listchars=tab:╾╌,trail:·,extends:↦,precedes:↤,nbsp:_ -set showbreak=↪ - -filetype on -filetype plugin on -filetype indent on - -set wildmode=longest:full,full -set wildmenu -set showcmd - -" Completion - -" Avoid showing message extra message when using completion -set shortmess+=c - -" Close the file explorer once you select a file -let g:netrw_fastbrowse = 0 - -" Allow saving of files as sudo when I forgot to start vim using sudo. -" From https://stackoverflow.com/a/7078429 -cmap w!! w !sudo tee > /dev/null % - -imap jk -vmap - -nmap o -nmap :bp -nmap :bn -nmap kkkkkkkkkkkkkkkkkkkkk -nmap jjjjjjjjjjjjjjjjjjjjj - -" \s to replace globally the word under the cursor -nnoremap s :%s/\<\>/ - -" add extensions to syntax -au BufNewFile,BufRead *.jinja set filetype=jinja2 - -command Reload source $MYVIMRC diff --git a/config/automatrop/roles/vim/templates/init.vim.j2 b/config/automatrop/roles/vim/templates/init.vim.j2 index 63ecb4d..66e45b6 100644 --- a/config/automatrop/roles/vim/templates/init.vim.j2 +++ b/config/automatrop/roles/vim/templates/init.vim.j2 @@ -1,18 +1,3 @@ -set nocompatible -filetype on - -" SET PATHS - -set runtimepath+=~/.config/{{ variant }} -let vimDir = '$HOME/.cache/{{ variant }}' -call system('mkdir ' . vimDir) -let &runtimepath.=','.vimDir -set viminfo+=n~/.cache/{{ variant }}/viminfo - -" EDITOR CONFIGURATION - -{% include 'editor.j2' %} - " PLUGINS CONFIGURATION {% include 'pluginconfig.j2' %} diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 0d5b816..017ed0f 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -21,7 +21,7 @@ # FIXME Still want this despite using nixvim gpg = { enable = true; - homedir = "${config.xdg.dataHome}/gnupg"; + homedir = "${config.xdg.stateHome}/gnupg"; settings = { # Remove fluff no-greeting = true; diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index 63c6729..5e98b6c 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -34,6 +34,40 @@ in programs.nixvim = { enable = true; + options = { + # From https://www.hillelwayne.com/post/intermediate-vim/ + title = true; + number = true; + relativenumber = true; + scrolloff = 10; + lazyredraw = true; # Do not redraw screen in the middle of a macro. Makes them complete faster. + cursorcolumn = true; + + ignorecase = true; + smartcase = true; + gdefault = true; + + tabstop = 4; + shiftwidth = 4; + expandtab = true; + + splitbelow = true; + visualbell = true; + + updatetime = 250; + undofile = true; + + # From http://stackoverflow.com/a/5004785/2766106 + list = true; + listchars = "tab:╾╌,trail:·,extends:↦,precedes:↤,nbsp:_"; + showbreak = "↪"; + + wildmode = "longest:full,full"; + wildmenu = true; + }; + globals = { + netrw_fastbrowse = 0; # Close the file explorer once you select a file + }; colorschemes.base16 = { # FIXME Dynamic... or use stylix enable = true; @@ -249,6 +283,15 @@ in ./vim/nvim-ts-rainbow.lua ]; extraConfigVim = '' + " GENERAL + + " Avoid showing message extra message when using completion + set shortmess+=c + + command Reload source $MYVIMRC + + " PLUGINS + " vim-gutentags let g:gutentags_cache_dir = expand('~/.cache/nvim/tags') @@ -273,12 +316,44 @@ in ''; autoCmd = [ + # Turn off relativenumber only for insert mode + { event = "InsertEnter *"; command = "set norelativenumber"; } + { event = "InsertLeave *"; command = "set relativenumber"; } + + # Additional extensions + { event = "BufNewFile,BufRead"; pattern = "*.jinja"; command = "set filetype=jinja2"; } # TODO Probably GH-specific? + # vim-easy-align: Align Markdown tables { event = "FileType markdown"; command = "vmap :EasyAlign*"; } ]; + userCommands = { + # Reload = { command = "source $MYVIRMC"; }; + # TODO Is not working, options is set to nil even though it shouldn't + }; + # 23.11: Use keymaps, seems better maps = { + # GENERAL + + # Allow saving of files as sudo when I forgot to start vim using sudo. + # From https://stackoverflow.com/a/7078429 + command."w!!" = { action = "w !sudo tee > /dev/null %"; }; + + insert."jk" = { action = ""; }; + visual."" = { action = ""; }; + normal."" = { action = "o"; }; + + # normal."" = { action = ":bp"; }; + # normal."" = { action = ":bn"; }; + normal."" = { action = "kkkkkkkkkkkkkkkkkkkkk"; }; + normal."" = { action = "jjjjjjjjjjjjjjjjjjjjj"; }; + + # \s to replace globally the word under the cursor + normal."s" = { action = ":%s/\\<\\>/"; }; + + # PLUGINS + # barbar normal."" = { action = "BufferPrevious"; silent = true; }; normal."" = { action = "BufferNext"; silent = true; }; From 942dff9d8c0b76fcbe18f4be45300306b01b1f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 2 Nov 2023 17:06:46 +0100 Subject: [PATCH 028/108] nix: Vim: done --- config/automatrop/playbooks/default.yml | 2 -- config/automatrop/roles/vim/tasks/main.yml | 9 --------- config/automatrop/roles/vim/templates/init.vim.j2 | 4 ---- .../roles/vim/templates/pluginconfig.j2 | 2 -- .../automatrop/roles/vim/templates/pluginlist.j2 | 8 -------- .../roles/vim/templates/plugins/devicons.j2 | 5 ----- .../roles/vim/templates/plugins/specs.j2 | 15 --------------- config/nix/hm/vim.nix | 2 ++ 8 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 config/automatrop/roles/vim/tasks/main.yml delete mode 100644 config/automatrop/roles/vim/templates/init.vim.j2 delete mode 100644 config/automatrop/roles/vim/templates/pluginconfig.j2 delete mode 100644 config/automatrop/roles/vim/templates/pluginlist.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/devicons.j2 delete mode 100644 config/automatrop/roles/vim/templates/plugins/specs.j2 diff --git a/config/automatrop/playbooks/default.yml b/config/automatrop/playbooks/default.yml index 6b9231c..bf37348 100644 --- a/config/automatrop/playbooks/default.yml +++ b/config/automatrop/playbooks/default.yml @@ -9,8 +9,6 @@ when: root_access - role: dotfiles tags: dotfiles - - role: vim - tags: vim - role: mnussbaum.base16-builder-ansible # Required for desktop_environment tags: - color diff --git a/config/automatrop/roles/vim/tasks/main.yml b/config/automatrop/roles/vim/tasks/main.yml deleted file mode 100644 index 864f679..0000000 --- a/config/automatrop/roles/vim/tasks/main.yml +++ /dev/null @@ -1,9 +0,0 @@ - -- name: Configure vim - template: - src: init.vim.j2 - dest: "{{ ansible_user_dir }}/.config/{{ variant }}/init.vim" - mode: "u=rw,g=r,o=r" - loop: "{{ vim_variants }}" - loop_control: - loop_var: variant diff --git a/config/automatrop/roles/vim/templates/init.vim.j2 b/config/automatrop/roles/vim/templates/init.vim.j2 deleted file mode 100644 index 66e45b6..0000000 --- a/config/automatrop/roles/vim/templates/init.vim.j2 +++ /dev/null @@ -1,4 +0,0 @@ -" PLUGINS CONFIGURATION - -{% include 'pluginconfig.j2' %} - diff --git a/config/automatrop/roles/vim/templates/pluginconfig.j2 b/config/automatrop/roles/vim/templates/pluginconfig.j2 deleted file mode 100644 index 1be4279..0000000 --- a/config/automatrop/roles/vim/templates/pluginconfig.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{% set plugins = namespace(sources=[]) %} -{% include 'pluginlist.j2' %} diff --git a/config/automatrop/roles/vim/templates/pluginlist.j2 b/config/automatrop/roles/vim/templates/pluginlist.j2 deleted file mode 100644 index 038b99a..0000000 --- a/config/automatrop/roles/vim/templates/pluginlist.j2 +++ /dev/null @@ -1,8 +0,0 @@ -" Visuals -{{ use_plugin('devicons') }} -{% if variant == 'nvim' %} -{{ use_plugin('specs') }} -{% endif %} - -" Theme -source ~/.config/vim/theme.vim diff --git a/config/automatrop/roles/vim/templates/plugins/devicons.j2 b/config/automatrop/roles/vim/templates/plugins/devicons.j2 deleted file mode 100644 index 7b5e65f..0000000 --- a/config/automatrop/roles/vim/templates/plugins/devicons.j2 +++ /dev/null @@ -1,5 +0,0 @@ -{% if variant == 'nvim' %} -{{ add_source('kyazdani42/nvim-web-devicons') -}} -{% else %} -{{ add_source('ryanoasis/vim-devicons') -}} -{% endif %} diff --git a/config/automatrop/roles/vim/templates/plugins/specs.j2 b/config/automatrop/roles/vim/templates/plugins/specs.j2 deleted file mode 100644 index 6177dbc..0000000 --- a/config/automatrop/roles/vim/templates/plugins/specs.j2 +++ /dev/null @@ -1,15 +0,0 @@ -{# Flashes under the cursor when moving far #} -{{ add_source('edluffy/specs.nvim') -}} -lua << EOF -require('specs').setup{ - popup = { - delay_ms = 0, -- delay before popup displays - inc_ms = 10, -- time increments used for fade/resize effects - blend = 10, -- starting blend, between 0-100 (fully transparent), see :h winblend - width = 10, - winhl = "PMenu", - fader = require('specs').pulse_fader, - resizer = require('specs').shrink_resizer - }, -} -EOF diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index 5e98b6c..b2fa87e 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -80,6 +80,8 @@ in specs = { enable = true; min_jump = 5; + fader = { builtin = "pulse_fader"; }; + resizer = { builtin = "shrink_resizer"; }; }; # Tabline From 624f046d7fe54e8003ba8632f6128d8b8a7b30f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 2 Nov 2023 21:57:06 +0100 Subject: [PATCH 029/108] nix: Add alacritty --- config/alacritty/alacritty.yml.j2 | 727 ------------------ .../desktop_environment/handlers/main.yml | 4 - .../roles/desktop_environment/tasks/main.yml | 31 - config/nix/hm/desktop.nix | 38 +- config/nix/hm/dev.nix | 1 + config/nix/hm/style.nix | 11 +- 6 files changed, 42 insertions(+), 770 deletions(-) delete mode 100644 config/alacritty/alacritty.yml.j2 diff --git a/config/alacritty/alacritty.yml.j2 b/config/alacritty/alacritty.yml.j2 deleted file mode 100644 index 6f9cea6..0000000 --- a/config/alacritty/alacritty.yml.j2 +++ /dev/null @@ -1,727 +0,0 @@ -# vi:syntax=yaml -# Configuration for Alacritty, the GPU enhanced terminal emulator. - -# Import additional configuration files -# -# Imports are loaded in order, skipping all missing files, with the importing -# file being loaded last. If a field is already present in a previous import, it -# will be replaced. -# -# All imports must either be absolute paths starting with `/`, or paths relative -# to the user's home directory starting with `~/`. -#import: -# - /path/to/alacritty.yml - -# Any items in the `env` entry below will be added as -# environment variables. Some entries may override variables -# set by alacritty itself. -#env: - # TERM variable - # - # This value is used to set the `$TERM` environment variable for - # each instance of Alacritty. If it is not present, alacritty will - # check the local terminfo database and use `alacritty` if it is - # available, otherwise `xterm-256color` is used. - #TERM: xterm-256color - -window: - # Window dimensions (changes require restart) - # - # Number of lines/columns (not pixels) in the terminal. The number of columns - # must be at least `2`, while using a value of `0` for columns and lines will - # fall back to the window manager's recommended size. - #dimensions: - # columns: 0 - # lines: 0 - - # Window position (changes require restart) - # - # Specified in number of pixels. - # If the position is not set, the window manager will handle the placement. - #position: - # x: 0 - # y: 0 - - # Window padding (changes require restart) - # - # Blank space added around the window in pixels. This padding is scaled - # by DPI and the specified value is always added at both opposing sides. - #padding: - # x: 0 - # y: 0 - - # Spread additional padding evenly around the terminal content. - dynamic_padding: false - - # Window decorations - # - # Values for `decorations`: - # - full: Borders and title bar - # - none: Neither borders nor title bar - # - # Values for `decorations` (macOS only): - # - transparent: Title bar, transparent background and title bar buttons - # - buttonless: Title bar, transparent background and no title bar buttons - #decorations: full - - # Startup Mode (changes require restart) - # - # Values for `startup_mode`: - # - Windowed - # - Maximized - # - Fullscreen - # - # Values for `startup_mode` (macOS only): - # - SimpleFullscreen - #startup_mode: Windowed - - # Window title - #title: Alacritty - - # Allow terminal applications to change Alacritty's window title. - dynamic_title: true - - # Window class (Linux/BSD only): - #class: - # Application instance name - #instance: Alacritty - # General application class - #general: Alacritty - - # GTK theme variant (Linux/BSD only) - # - # Override the variant of the GTK theme. Commonly supported values are `dark` - # and `light`. Set this to `None` to use the default theme variant. - #gtk_theme_variant: None - -#scrolling: - # Maximum number of lines in the scrollback buffer. - # Specifying '0' will disable scrolling. - #history: 10000 - - # Scrolling distance multiplier. - #multiplier: 3 - -# Font configuration -font: - # Normal (roman) font face - normal: - # Font family - # - # Default: - # - (macOS) Menlo - # - (Linux/BSD) monospace - # - (Windows) Consolas - family: DejaVuSansMono Nerd Font Mono - - # The `style` can be specified to pick a specific face. - style: Regular - - # Bold font face - bold: - # Font family - # - # If the bold family is not specified, it will fall back to the - # value specified for the normal font. - family: DejaVuSansMono Nerd Font Mono - - # The `style` can be specified to pick a specific face. - style: Bold - - # Italic font face - italic: - # Font family - # - # If the italic family is not specified, it will fall back to the - # value specified for the normal font. - family: DejaVuSansMono Nerd Font Mono - - # The `style` can be specified to pick a specific face. - style: Oblique - - # Bold italic font face - bold_italic: - # Font family - # - # If the bold italic family is not specified, it will fall back to the - # value specified for the normal font. - family: DejaVuSansMono Nerd Font Mono - - # The `style` can be specified to pick a specific face. - style: Bold Oblique - - # Point size - size: 12.0 - - # Offset is the extra space around each character. `offset.y` can be thought - # of as modifying the line spacing, and `offset.x` as modifying the letter - # spacing. - #offset: - # x: 0 - # y: 0 - - # Glyph offset determines the locations of the glyphs within their cells with - # the default being at the bottom. Increasing `x` moves the glyph to the - # right, increasing `y` moves the glyph upward. - #glyph_offset: - # x: 0 - # y: 0 - - # Thin stroke font rendering (macOS only) - # - # Thin strokes are suitable for retina displays, but for non-retina screens - # it is recommended to set `use_thin_strokes` to `false`. - #use_thin_strokes: true - -{{ base16_schemes['schemes'][base16_scheme]['alacritty']['colors']['base16-' + base16_scheme + '.yml'] }} - -# Bell -# -# The bell is rung every time the BEL control character is received. -bell: - # Visual Bell Animation - # - # Animation effect for flashing the screen when the visual bell is rung. - # - # Values for `animation`: - # - Ease - # - EaseOut - # - EaseOutSine - # - EaseOutQuad - # - EaseOutCubic - # - EaseOutQuart - # - EaseOutQuint - # - EaseOutExpo - # - EaseOutCirc - # - Linear - animation: EaseOutExpo - - # Duration of the visual bell flash in milliseconds. A `duration` of `0` will - # disable the visual bell animation. - duration: 100 - - # Visual bell animation color. - color: '#000000' - - # Bell Command - # - # This program is executed whenever the bell is rung. - # - # When set to `command: None`, no command will be executed. - # - # Example: - # command: - # program: notify-send - # args: ["Hello, World!"] - # - command: - program: play - args: ['-n', 'synth', 'sine', 'C5', 'sine', 'E4', 'remix', '1-2', 'fade', '0.1', '0.2', '0.1'] - # program: notify-send - # args: ["Hello, World!"] - -# Background opacity -# -# Window opacity as a floating point number from `0.0` to `1.0`. -# The value `0.0` is completely transparent and `1.0` is opaque. -#background_opacity: 1.0 - -#selection: - # This string contains all characters that are used as separators for - # "semantic words" in Alacritty. - #semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" - - # When set to `true`, selected text will be copied to the primary clipboard. - #save_to_clipboard: false - -cursor: - # Cursor style - # - # Values for `style`: - # - ▇ Block - # - _ Underline - # - | Beam - #style: Block - - # Cursor blinking state - # - # Values for `blinking`: - # - Never: Prevent the cursor from ever blinking - # - Off: Disable blinking by default - # - On: Enable blinking by default - # - Always: Force the cursor to always blink - #blinking: Off - - # Vi mode cursor style - # - # If the vi mode cursor style is `None` or not specified, it will fall back to - # the style of the active value of the normal cursor. - # - # See `cursor.style` for available options. - vi_mode_style: Underline - - # Cursor blinking interval in milliseconds. - #blink_interval: 750 - - # If this is `true`, the cursor will be rendered as a hollow box when the - # window is not focused. - #unfocused_hollow: true - - # Thickness of the cursor relative to the cell width as floating point number - # from `0.0` to `1.0`. - #thickness: 0.15 - -# Live config reload (changes require restart) -#live_config_reload: true - -# Shell -# -# You can set `shell.program` to the path of your favorite shell, e.g. -# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the -# shell. -# -# Default: -# - (macOS) /bin/bash --login -# - (Linux/BSD) user login shell -# - (Windows) powershell -#shell: -# program: /bin/bash -# args: -# - --login - -# Startup directory -# -# Directory the shell is started in. If this is unset, or `None`, the working -# directory of the parent process will be used. -#working_directory: None - -# WinPTY backend (Windows only) -# -# Alacritty defaults to using the newer ConPTY backend if it is available, -# since it resolves a lot of bugs and is quite a bit faster. If it is not -# available, the WinPTY backend will be used instead. -# -# Setting this option to `true` makes Alacritty use the legacy WinPTY backend, -# even if the ConPTY backend is available. -#winpty_backend: false - -# Send ESC (\x1b) before characters when alt is pressed. -#alt_send_esc: true - -#mouse: - # Click settings - # - # The `double_click` and `triple_click` settings control the time - # alacritty should wait for accepting multiple clicks as one double - # or triple click. - #double_click: { threshold: 300 } - #triple_click: { threshold: 300 } - - # If this is `true`, the cursor is temporarily hidden when typing. - #hide_when_typing: false - -# Regex hints -# -# Terminal hints can be used to find text in the visible part of the terminal -# and pipe it to other applications. -hints: - # Keys used for the hint labels. - #alphabet: "jfkdls;ahgurieowpq" - - # List with all available hints - # - # Each hint must have a `regex` and either an `action` or a `command` field. - # The fields `mouse`, `binding` and `post_processing` are optional. - # - # The fields `command`, `binding.key`, `binding.mods` and `mouse.mods` accept - # the same values as they do in the `key_bindings` section. - # - # The `mouse.enabled` field controls if the hint should be underlined while - # the mouse with all `mouse.mods` keys held or the vi mode cursor is above it. - # - # If the `post_processing` field is set to `true`, heuristics will be used to - # shorten the match if there are characters likely not to be part of the hint - # (e.g. a trailing `.`). This is most useful for URIs. - # - # Values for `action`: - # - Copy - # Copy the hint's text to the clipboard. - # - Paste - # Paste the hint's text to the terminal or search. - # - Select - # Select the hint's text. - # - MoveViModeCursor - # Move the vi mode cursor to the beginning of the hint. - enabled: - - regex: "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ - [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" - command: xdg-open - post_processing: true - mouse: - enabled: true - mods: Control - binding: - key: F - mods: Control|Alt - -# Mouse bindings -# -# Mouse bindings are specified as a list of objects, much like the key -# bindings further below. -# -# To trigger mouse bindings when an application running within Alacritty -# captures the mouse, the `Shift` modifier is automatically added as a -# requirement. -# -# Each mouse binding will specify a: -# -# - `mouse`: -# -# - Middle -# - Left -# - Right -# - Numeric identifier such as `5` -# -# - `action` (see key bindings) -# -# And optionally: -# -# - `mods` (see key bindings) -#mouse_bindings: -# - { mouse: Middle, action: PasteSelection } - -# Key bindings -# -# Key bindings are specified as a list of objects. For example, this is the -# default paste binding: -# -# `- { key: V, mods: Control|Shift, action: Paste }` -# -# Each key binding will specify a: -# -# - `key`: Identifier of the key pressed -# -# - A-Z -# - F1-F24 -# - Key0-Key9 -# -# A full list with available key codes can be found here: -# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants -# -# Instead of using the name of the keys, the `key` field also supports using -# the scancode of the desired key. Scancodes have to be specified as a -# decimal number. This command will allow you to display the hex scancodes -# for certain keys: -# -# `showkey --scancodes`. -# -# Then exactly one of: -# -# - `chars`: Send a byte sequence to the running application -# -# The `chars` field writes the specified string to the terminal. This makes -# it possible to pass escape sequences. To find escape codes for bindings -# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside -# of tmux. Note that applications use terminfo to map escape sequences back -# to keys. It is therefore required to update the terminfo when changing an -# escape sequence. -# -# - `action`: Execute a predefined action -# -# - ToggleViMode -# - SearchForward -# Start searching toward the right of the search origin. -# - SearchBackward -# Start searching toward the left of the search origin. -# - Copy -# - Paste -# - IncreaseFontSize -# - DecreaseFontSize -# - ResetFontSize -# - ScrollPageUp -# - ScrollPageDown -# - ScrollHalfPageUp -# - ScrollHalfPageDown -# - ScrollLineUp -# - ScrollLineDown -# - ScrollToTop -# - ScrollToBottom -# - ClearHistory -# Remove the terminal's scrollback history. -# - Hide -# Hide the Alacritty window. -# - Minimize -# Minimize the Alacritty window. -# - Quit -# Quit Alacritty. -# - ToggleFullscreen -# - SpawnNewInstance -# Spawn a new instance of Alacritty. -# - ClearLogNotice -# Clear Alacritty's UI warning and error notice. -# - ClearSelection -# Remove the active selection. -# - ReceiveChar -# - None -# -# - Vi mode exclusive actions: -# -# - Open -# Perform the action of the first matching hint under the vi mode cursor -# with `mouse.enabled` set to `true`. -# - ToggleNormalSelection -# - ToggleLineSelection -# - ToggleBlockSelection -# - ToggleSemanticSelection -# Toggle semantic selection based on `selection.semantic_escape_chars`. -# -# - Vi mode exclusive cursor motion actions: -# -# - Up -# One line up. -# - Down -# One line down. -# - Left -# One character left. -# - Right -# One character right. -# - First -# First column, or beginning of the line when already at the first column. -# - Last -# Last column, or beginning of the line when already at the last column. -# - FirstOccupied -# First non-empty cell in this terminal row, or first non-empty cell of -# the line when already at the first cell of the row. -# - High -# Top of the screen. -# - Middle -# Center of the screen. -# - Low -# Bottom of the screen. -# - SemanticLeft -# Start of the previous semantically separated word. -# - SemanticRight -# Start of the next semantically separated word. -# - SemanticLeftEnd -# End of the previous semantically separated word. -# - SemanticRightEnd -# End of the next semantically separated word. -# - WordLeft -# Start of the previous whitespace separated word. -# - WordRight -# Start of the next whitespace separated word. -# - WordLeftEnd -# End of the previous whitespace separated word. -# - WordRightEnd -# End of the next whitespace separated word. -# - Bracket -# Character matching the bracket at the cursor's location. -# - SearchNext -# Beginning of the next match. -# - SearchPrevious -# Beginning of the previous match. -# - SearchStart -# Start of the match to the left of the vi mode cursor. -# - SearchEnd -# End of the match to the right of the vi mode cursor. -# -# - Search mode exclusive actions: -# - SearchFocusNext -# Move the focus to the next search match. -# - SearchFocusPrevious -# Move the focus to the previous search match. -# - SearchConfirm -# - SearchCancel -# - SearchClear -# Reset the search regex. -# - SearchDeleteWord -# Delete the last word in the search regex. -# - SearchHistoryPrevious -# Go to the previous regex in the search history. -# - SearchHistoryNext -# Go to the next regex in the search history. -# -# - macOS exclusive actions: -# - ToggleSimpleFullscreen -# Enter fullscreen without occupying another space. -# -# - Linux/BSD exclusive actions: -# -# - CopySelection -# Copy from the selection buffer. -# - PasteSelection -# Paste from the selection buffer. -# -# - `command`: Fork and execute a specified command plus arguments -# -# The `command` field must be a map containing a `program` string and an -# `args` array of command line parameter strings. For example: -# `{ program: "alacritty", args: ["-e", "vttest"] }` -# -# And optionally: -# -# - `mods`: Key modifiers to filter binding actions -# -# - Command -# - Control -# - Option -# - Super -# - Shift -# - Alt -# -# Multiple `mods` can be combined using `|` like this: -# `mods: Control|Shift`. -# Whitespace and capitalization are relevant and must match the example. -# -# - `mode`: Indicate a binding for only specific terminal reported modes -# -# This is mainly used to send applications the correct escape sequences -# when in different modes. -# -# - AppCursor -# - AppKeypad -# - Search -# - Alt -# - Vi -# -# A `~` operator can be used before a mode to apply the binding whenever -# the mode is *not* active, e.g. `~Alt`. -# -# Bindings are always filled by default, but will be replaced when a new -# binding with the same triggers is defined. To unset a default binding, it can -# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for -# a no-op if you do not wish to receive input characters for that binding. -# -# If the same trigger is assigned to multiple actions, all of them are executed -# in the order they were defined in. -key_bindings: - #- { key: Paste, action: Paste } - #- { key: Copy, action: Copy } - #- { key: L, mods: Control, action: ClearLogNotice } - #- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" } - #- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp, } - #- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown } - #- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop, } - #- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom } - - # Vi Mode - #- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom } - - { key: Space, mods: Alt|Control, mode: ~Search, action: ToggleViMode } - #- { key: Escape, mode: Vi|~Search, action: ClearSelection } - #- { key: I, mode: Vi|~Search, action: ScrollToBottom } - #- { key: I, mode: Vi|~Search, action: ToggleViMode } - #- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode } - #- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp } - #- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown } - #- { key: G, mode: Vi|~Search, action: ScrollToTop } - #- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom } - #- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp } - #- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown } - - { key: K, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp } - - { key: J, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown } - #- { key: Y, mode: Vi|~Search, action: Copy } - #- { key: Y, mode: Vi|~Search, action: ClearSelection } - #- { key: Copy, mode: Vi|~Search, action: ClearSelection } - #- { key: V, mode: Vi|~Search, action: ToggleNormalSelection } - #- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection } - #- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection } - #- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection } - #- { key: Return, mode: Vi|~Search, action: Open } - #- { key: K, mode: Vi|~Search, action: Up } - #- { key: J, mode: Vi|~Search, action: Down } - #- { key: H, mode: Vi|~Search, action: Left } - #- { key: L, mode: Vi|~Search, action: Right } - #- { key: Up, mode: Vi|~Search, action: Up } - #- { key: Down, mode: Vi|~Search, action: Down } - #- { key: Left, mode: Vi|~Search, action: Left } - #- { key: Right, mode: Vi|~Search, action: Right } - #- { key: Key0, mode: Vi|~Search, action: First } - #- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last } - #- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied } - #- { key: H, mods: Shift, mode: Vi|~Search, action: High } - #- { key: M, mods: Shift, mode: Vi|~Search, action: Middle } - #- { key: L, mods: Shift, mode: Vi|~Search, action: Low } - #- { key: B, mode: Vi|~Search, action: SemanticLeft } - #- { key: W, mode: Vi|~Search, action: SemanticRight } - #- { key: E, mode: Vi|~Search, action: SemanticRightEnd } - #- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft } - #- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight } - #- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd } - #- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket } - #- { key: Slash, mode: Vi|~Search, action: SearchForward } - #- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward } - #- { key: N, mode: Vi|~Search, action: SearchNext } - #- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious } - - # Search Mode - #- { key: Return, mode: Search|Vi, action: SearchConfirm } - #- { key: Escape, mode: Search, action: SearchCancel } - #- { key: C, mods: Control, mode: Search, action: SearchCancel } - #- { key: U, mods: Control, mode: Search, action: SearchClear } - #- { key: W, mods: Control, mode: Search, action: SearchDeleteWord } - #- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious } - #- { key: N, mods: Control, mode: Search, action: SearchHistoryNext } - #- { key: Up, mode: Search, action: SearchHistoryPrevious } - #- { key: Down, mode: Search, action: SearchHistoryNext } - #- { key: Return, mode: Search|~Vi, action: SearchFocusNext } - #- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious } - - # (Windows, Linux, and BSD only) - - { key: V, mods: Control|Alt, mode: ~Vi, action: Paste } - - { key: C, mods: Control|Alt, action: Copy } - - { key: F, mods: Control|Alt, mode: ~Search, action: SearchForward } - - { key: B, mods: Control|Alt, mode: ~Search, action: SearchBackward } - - { key: C, mods: Control|Alt, mode: Vi|~Search, action: ClearSelection } - #- { key: Insert, mods: Shift, action: PasteSelection } - #- { key: Key0, mods: Control, action: ResetFontSize } - #- { key: Equals, mods: Control, action: IncreaseFontSize } - #- { key: Plus, mods: Control, action: IncreaseFontSize } - #- { key: NumpadAdd, mods: Control, action: IncreaseFontSize } - #- { key: Minus, mods: Control, action: DecreaseFontSize } - #- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } - - # (Windows only) - #- { key: Return, mods: Alt, action: ToggleFullscreen } - - # (macOS only) - #- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" } - #- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory } - #- { key: Key0, mods: Command, action: ResetFontSize } - #- { key: Equals, mods: Command, action: IncreaseFontSize } - #- { key: Plus, mods: Command, action: IncreaseFontSize } - #- { key: NumpadAdd, mods: Command, action: IncreaseFontSize } - #- { key: Minus, mods: Command, action: DecreaseFontSize } - #- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize } - #- { key: V, mods: Command, action: Paste } - #- { key: C, mods: Command, action: Copy } - #- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection } - #- { key: H, mods: Command, action: Hide } - #- { key: H, mods: Command|Alt, action: HideOtherApplications } - #- { key: M, mods: Command, action: Minimize } - #- { key: Q, mods: Command, action: Quit } - #- { key: W, mods: Command, action: Quit } - #- { key: N, mods: Command, action: SpawnNewInstance } - #- { key: F, mods: Command|Control, action: ToggleFullscreen } - #- { key: F, mods: Command, mode: ~Search, action: SearchForward } - #- { key: B, mods: Command, mode: ~Search, action: SearchBackward } - -#debug: - # Display the time it takes to redraw each frame. - #render_timer: false - - # Keep the log file after quitting Alacritty. - #persistent_logging: false - - # Log level - # - # Values for `log_level`: - # - Off - # - Error - # - Warn - # - Info - # - Debug - # - Trace - #log_level: Warn - - # Print all received window events. - #print_events: false diff --git a/config/automatrop/roles/desktop_environment/handlers/main.yml b/config/automatrop/roles/desktop_environment/handlers/main.yml index 5eaac96..bc4101e 100644 --- a/config/automatrop/roles/desktop_environment/handlers/main.yml +++ b/config/automatrop/roles/desktop_environment/handlers/main.yml @@ -1,11 +1,7 @@ --- -- name: Xrdb-reload - ansible.builtin.command: xrdb -I{{ ansible_env.HOME }} {{ ansible_env.HOME }}/.config/Xresources/main - name: I3-reload ansible.builtin.command: i3-msg reload - name: Shell-reload ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApply" - name: Fzf-reload ansible.builtin.command: source {{ ansible_env.HOME }}/.local/bin/colorSchemeApplyFzf -- name: Qutebrowser-reload - ansible.builtin.shell: "! pgrep qutebrowser || qutebrowser :config-source" diff --git a/config/automatrop/roles/desktop_environment/tasks/main.yml b/config/automatrop/roles/desktop_environment/tasks/main.yml index 7bf5de8..fa9f9da 100644 --- a/config/automatrop/roles/desktop_environment/tasks/main.yml +++ b/config/automatrop/roles/desktop_environment/tasks/main.yml @@ -60,37 +60,6 @@ - color - i3 -- name: Configure Alacritty - ansible.builtin.template: - src: "{{ ansible_env.HOME }}/.config/alacritty/alacritty.yml.j2" - dest: "{{ ansible_env.HOME }}/.config/alacritty/alacritty.yml" - mode: u=rw,g=r,o=r - # Alacritty has live config reload, so no command to execute - # However, it doesn't work with yaml includes, hence the template - tags: - - color - -- name: Set base16 theme for Xresources - ansible.builtin.copy: - content: "{{ base16_schemes['schemes'][base16_scheme]['xresources']['xresources']['base16-' + base16_scheme + '-256.Xresources'] }}" - dest: "{{ ansible_env.HOME }}/.config/Xresources/theme" - mode: u=rw,g=r,o=r - notify: - - xrdb-reload - tags: - - color - when: display_server == 'x11' - -- name: Download base16 theme for qutebrowser - ansible.builtin.copy: - content: "{{ base16_schemes['schemes'][base16_scheme]['qutebrowser']['themes/minimal']['base16-' + base16_scheme + '.config.py'] }}" - dest: "{{ ansible_env.HOME }}/.config/qutebrowser/theme.py" - mode: u=rw,g=r,o=r - notify: - - qutebrowser-reload - tags: - - color - - name: Download base16 theme for Tridactyl ansible.builtin.copy: content: "{{ base16_schemes['schemes'][base16_scheme]['tridactyl']['base16-' + base16_scheme + '.config.py'] }}" diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index b7ed837..fdcb5dd 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -12,7 +12,43 @@ qutebrowser.enable = true; # Terminal - alacritty.enable = true; + alacritty = { + enable = true; + settings = { + bell = { + animation = "EaseOutExpo"; + color = "#000000"; + command = { program = "${pkgs.sox}/bin/play"; args = [ "-n" "synth" "sine" "C5" "sine" "E4" "remix" "1-2" "fade" "0.1" "0.2" "0.1" ]; }; + duration = 100; + }; + cursor = { vi_mode_style = "Underline"; }; + hints = { + enabled = [ + { + binding = { mods = "Control|Alt"; key = "F"; }; + command = "${pkgs.xdg-utils}/bin/xdg-open"; + mouse = { enabled = true; mods = "Control"; }; + post_processing = true; + regex = "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\\u0000-\\u001F\\u007F-\\u009F<>\"\\\\s{-}\\\\^⟨⟩`]+"; + } + ]; + }; + key_bindings = [ + { mode = "~Search"; mods = "Alt|Control"; key = "Space"; action = "ToggleViMode"; } + { mode = "Vi|~Search"; mods = "Control"; key = "K"; action = "ScrollHalfPageUp"; } + { mode = "Vi|~Search"; mods = "Control"; key = "J"; action = "ScrollHalfPageDown"; } + { mode = "~Vi"; mods = "Control|Alt"; key = "V"; action = "Paste"; } + { mods = "Control|Alt"; key = "C"; action = "Copy"; } + { mode = "~Search"; mods = "Control|Alt"; key = "F"; action = "SearchForward"; } + { mode = "~Search"; mods = "Control|Alt"; key = "B"; action = "SearchBackward"; } + { mode = "Vi|~Search"; mods = "Control|Alt"; key = "C"; action = "ClearSelection"; } + ]; + window = { + dynamic_padding = false; + dynamic_title = true; + }; + }; + }; }; home.packages = with pkgs; [ diff --git a/config/nix/hm/dev.nix b/config/nix/hm/dev.nix index b2b5c66..6211e5a 100644 --- a/config/nix/hm/dev.nix +++ b/config/nix/hm/dev.nix @@ -17,6 +17,7 @@ perf-tools git jq + yq universal-ctags highlight zeal-qt6 # Offline documentation diff --git a/config/nix/hm/style.nix b/config/nix/hm/style.nix index 6b33a1a..c73eebb 100644 --- a/config/nix/hm/style.nix +++ b/config/nix/hm/style.nix @@ -17,13 +17,10 @@ in }; # FIXME This doesn't work - # fonts.monospace = { - # package = pkgs.nerdfonts; - # name = "DejaVu Sans Mono Nerd Font"; - # }; - # FIXME We want this, but now we get weird kerning in Alacritty... - # Something I've seen before and probably already fixed, - # maybe something in Alacritty config, which is not imported yet? + fonts.monospace = { + package = pkgs.nerdfonts; + name = "DejaVuSansM Nerd Font"; + }; targets.vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR) }; From 4b8c4f29cefb5c02a849e93b5aa1dcdfd5b71840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 3 Nov 2023 01:37:37 +0100 Subject: [PATCH 030/108] nix: Start i3 config And wow, we're starting to get crazy here! --- config/i3/config.j2 | 231 ++---------------------------- config/i3/focus_windows | 12 -- config/i3/terminal | 3 - config/nix/hm/desktop.nix | 179 +++++++++++++++++++++-- config/nix/hm/style.nix | 1 + config/nix/os/desktop.nix | 1 - config/scripts/showKeyboardLayout | 4 - 7 files changed, 181 insertions(+), 250 deletions(-) delete mode 100755 config/i3/focus_windows delete mode 100755 config/i3/terminal delete mode 100755 config/scripts/showKeyboardLayout diff --git a/config/i3/config.j2 b/config/i3/config.j2 index 95f4963..a8bb732 100644 --- a/config/i3/config.j2 +++ b/config/i3/config.j2 @@ -15,126 +15,16 @@ new_float normal # Hide borders hide_edge_borders both -# change borders -#bindsym $mod+u border none -#bindsym $mod+y border pixel 2 -#bindsym $mod+n border normal -# Compatibility layer for people coming from other backgrounds -bindsym Mod1+Tab exec --no-startup-id rofi -modi window -show window -bindsym Mod1+F2 exec --no-startup-id rofi -modi drun -show drun -bindsym Mod1+F4 kill -# Font for window titles. Will also be used by the bar unless a different font -# is used in the bar {} block below. -font pango:DejaVu Sans 8 -font pango:Sans 8 -# Use Mouse+$mod to drag floating windows -floating_modifier $mod - -# kill focused window -bindsym $mod+z kill -bindsym button2 kill - -bindsym $mod+c exec --no-startup-id rofi-pass --last-used -bindsym $mod+i exec --no-startup-id rofimoji -bindsym $mod+plus exec --no-startup-id rofi -modi ssh -show ssh -bindsym $mod+ù exec --no-startup-id rofi -modi ssh -show ssh -ssh-command '{terminal} -e {ssh-client} {host} -t "sudo -s -E"' -bindsym $mod+Tab exec --no-startup-id rofi -modi window -show window - -# start program launcher -bindsym $mod+d exec --no-startup-id rofi -modi run -show run -bindsym $mod+Shift+d exec --no-startup-id rofi -modi drun -show drun - -# Start Applications -# bindsym $mod+Return exec urxvtc -bindsym $mod+Return exec ~/.config/i3/terminal -bindsym $mod+Shift+Return exec urxvt -bindsym $mod+p exec thunar -bindsym $mod+m exec qutebrowser --override-restore --backend=webengine -# bindsym $mod+m exec firefox - -# Volume control -bindsym XF86AudioRaiseVolume exec pactl set-sink-mute @DEFAULT_SINK@ false; exec pactl set-sink-volume @DEFAULT_SINK@ +5% -bindsym XF86AudioLowerVolume exec pactl set-sink-mute @DEFAULT_SINK@ false; exec pactl set-sink-volume @DEFAULT_SINK@ -5% -bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ true -bindsym $mod+F7 exec pactl suspend-sink @DEFAULT_SINK@ 1; exec pactl suspend-sink @DEFAULT_SINK@ 0 -# Re-synchronize bluetooth headset -bindsym XF86AudioPrev exec mpc prev -bindsym XF86AudioPlay exec mpc toggle -bindsym XF86AudioNext exec mpc next -bindsym $mod+F10 exec ~/.config/scripts/showKeyboardLayout -bindsym $mod+F11 exec xterm -e 'pacmixer' -bindsym $mod+F12 exec xterm -e 'pacmixer' - -#Brightness control -bindsym XF86MonBrightnessDown exec xbacklight -dec 5 -time 0 -bindsym XF86MonBrightnessUp exec xbacklight -inc 5 -time 0 - -# Screenshots -bindsym Print exec scrot --focused --exec 'mv $f ~/Screenshots/ && optipng ~/Screenshots/$f' -bindsym $mod+Print exec scrot --exec 'mv $f ~/Screenshots/ && optipng ~/Screenshots/$f' -bindsym Ctrl+Print exec sleep 1 && scrot --select --exec 'mv $f ~/Screenshots/ && optipng ~/Screenshots/$f' - -focus_follows_mouse no mouse_warping output -# change focus -bindsym $mod+h focus left; exec ~/.config/i3/focus_windows -bindsym $mod+j focus down; exec ~/.config/i3/focus_windows -bindsym $mod+k focus up; exec ~/.config/i3/focus_windows -bindsym $mod+l focus right; exec ~/.config/i3/focus_windows -## alternatively, you can use the cursor keys: -#bindsym $mod+Left focus left -#bindsym $mod+Down focus down -#bindsym $mod+Up focus up -#bindsym $mod+Right focus right -# move focused window -bindsym $mod+Shift+h move left; exec ~/.config/i3/focus_windows -bindsym $mod+Shift+j move down; exec ~/.config/i3/focus_windows -bindsym $mod+Shift+k move up; exec ~/.config/i3/focus_windows -bindsym $mod+Shift+l move right; exec ~/.config/i3/focus_windows -## alternatively, you can use the cursor keys: -#bindsym $mod+Shift+Left move left -#bindsym $mod+Shift+Down move down -#bindsym $mod+Shift+Up move up -#bindsym $mod+Shift+Right move right -# workspace back and forth (with/without active container) -workspace_auto_back_and_forth no -bindsym $mod+b workspace back_and_forth; exec ~/.config/i3/focus_windows -bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth; exec ~/.config/i3/focus_windows - -# split in horizontal orientation -bindsym $mod+g split h; exec ~/.config/i3/focus_windows - -# split in vertical orientation -bindsym $mod+v split v; exec ~/.config/i3/focus_windows - -# toggle fullscreen mode for the focused container -bindsym $mod+f fullscreen toggle; exec ~/.config/i3/focus_windows - -# change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking; exec ~/.config/i3/focus_windows -bindsym $mod+w layout tabbed; exec ~/.config/i3/focus_windows -bindsym $mod+e layout toggle split; exec ~/.config/i3/focus_windows - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle; exec ~/.config/i3/focus_windows - -# change focus between tiling / floating windows -bindsym $mod+space focus mode_toggle; exec ~/.config/i3/focus_windows - -# focus the parent container -bindsym $mod+a focus parent; exec ~/.config/i3/focus_windows - -# focus the child container -bindsym $mod+q focus child; exec ~/.config/i3/focus_windows # Workspace names set $WS1 1 @@ -154,77 +44,7 @@ set $WS10 10 workspace "$WS{{ i }}" output {{ screens[(i - 1) % (screens | length)] }} {% endfor %} -# switch to workspace -bindsym $mod+1 workspace $WS1; exec ~/.config/i3/focus_windows -bindsym $mod+2 workspace $WS2; exec ~/.config/i3/focus_windows -bindsym $mod+3 workspace $WS3; exec ~/.config/i3/focus_windows -bindsym $mod+4 workspace $WS4; exec ~/.config/i3/focus_windows -bindsym $mod+5 workspace $WS5; exec ~/.config/i3/focus_windows -bindsym $mod+6 workspace $WS6; exec ~/.config/i3/focus_windows -bindsym $mod+7 workspace $WS7; exec ~/.config/i3/focus_windows -bindsym $mod+8 workspace $WS8; exec ~/.config/i3/focus_windows -bindsym $mod+9 workspace $WS9; exec ~/.config/i3/focus_windows -bindsym $mod+0 workspace $WS10; exec ~/.config/i3/focus_windows -#navigate workspaces next / previous -bindsym $mod+Ctrl+h workspace prev_on_output; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+l workspace next_on_output; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+j workspace prev; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+k workspace next; exec ~/.config/i3/focus_windows - -##navigate workspaces next / previous (arrow keys) -#bindsym $mod+Ctrl+Left workspace prev_on_output -#bindsym $mod+Ctrl+Right workspace next_on_output -#bindsym $mod+Ctrl+Down workspace prev -#bindsym $mod+Ctrl+Up workspace next - -# Move to workspace next / previous with focused container -bindsym $mod+Ctrl+Shift+h move container to workspace prev_on_output; workspace prev_on_output; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+Shift+l move container to workspace next_on_output; workspace next_on_output; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+Shift+j move container to workspace prev; workspace prev; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+Shift+k move container to workspace next; workspace next; exec ~/.config/i3/focus_windows - -## Move to workspace next / previous with focused container (arrow keys) -#bindsym $mod+Ctrl+Shift+Left move container to workspace prev_on_output; workspace prev_on_output -#bindsym $mod+Ctrl+Shift+Right move container to workspace next_on_output; workspace next_on_output -#bindsym $mod+Ctrl+Shift+Down move container to workspace prev; workspace prev -#bindsym $mod+Ctrl+Shift+Up move container to workspace next; workspace next - -# move focused container to workspace -bindsym $mod+ctrl+1 move container to workspace $ws1; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+2 move container to workspace $ws2; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+3 move container to workspace $ws3; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+4 move container to workspace $ws4; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+5 move container to workspace $ws5; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+6 move container to workspace $ws6; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+7 move container to workspace $ws7; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+8 move container to workspace $ws8; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+9 move container to workspace $ws9; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+0 move container to workspace $ws10; exec ~/.config/i3/focus_windows - -# move to workspace with focused container -bindsym $mod+shift+1 move container to workspace $ws1; workspace $ws1; exec ~/.config/i3/focus_windows -bindsym $mod+shift+2 move container to workspace $ws2; workspace $ws2; exec ~/.config/i3/focus_windows -bindsym $mod+shift+3 move container to workspace $ws3; workspace $ws3; exec ~/.config/i3/focus_windows -bindsym $mod+shift+4 move container to workspace $ws4; workspace $ws4; exec ~/.config/i3/focus_windows -bindsym $mod+shift+5 move container to workspace $ws5; workspace $ws5; exec ~/.config/i3/focus_windows -bindsym $mod+shift+6 move container to workspace $ws6; workspace $ws6; exec ~/.config/i3/focus_windows -bindsym $mod+shift+7 move container to workspace $ws7; workspace $ws7; exec ~/.config/i3/focus_windows -bindsym $mod+shift+8 move container to workspace $ws8; workspace $ws8; exec ~/.config/i3/focus_windows -bindsym $mod+shift+9 move container to workspace $ws9; workspace $ws9; exec ~/.config/i3/focus_windows -bindsym $mod+shift+0 move container to workspace $ws10; workspace $ws10; exec ~/.config/i3/focus_windows - -## move workspaces to screen -#bindsym $mod+ctrl+shift+r move workspace to output right -#bindsym $mod+ctrl+shift+l move workspace to output left -#bindsym $mod+Ctrl+Shift+u move workspace to output above -#bindsym $mod+Ctrl+Shift+d move workspace to output below - -# move workspaces to screen (arrow keys) -bindsym $mod+ctrl+shift+Right move workspace to output right; exec ~/.config/i3/focus_windows -bindsym $mod+ctrl+shift+Left move workspace to output left; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+Shift+Up move workspace to output above; exec ~/.config/i3/focus_windows -bindsym $mod+Ctrl+Shift+Down move workspace to output below; exec ~/.config/i3/focus_windows # Default layout = tabs, since I mostly exclusively use them workspace_layout tabbed @@ -242,24 +62,12 @@ for_window [ title="^pdfpc.*" window_role="presentation" ] move to output right, # switch to workspace with urgent window automatically for_window [urgent=latest] focus -# focus urgent window -#bindsym $mod+x [urgent=latest] focus - -# reload the configuration file -bindsym $mod+Shift+c reload - -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -bindsym $mod+Shift+r restart - -# exit i3 (logs you out of your X session) -bindsym $mod+Shift+e exit - # Set shut down, restart and locking features set $mode_kblock Keyboard lock mode "$mode_kblock" { bindsym $mod+Shift+Escape mode "$mode_kblock" } -bindsym $mod+Shift+Escape mode "$mode_kblock" + "$mod+Shift+Escape" = "mode "$mode_kblock""; # Set shut down, restart and locking features set $locker $HOME/.config/i3/lock @@ -276,7 +84,7 @@ mode "$mode_system" { bindsym Return mode "default" bindsym Escape mode "default" } -bindsym $mod+Escape mode "$mode_system" + "$mod+Escape" = "mode "$mode_system""; # resize window (you can also use the mouse for that) mode "Resize" { @@ -302,7 +110,7 @@ mode "Resize" { bindsym Escape mode "default" } -bindsym $mod+r mode "Resize" + "$mod+r" = "mode "Resize""; set $mode_pres_main "Presentation (main display)" mode $mode_pres_main { @@ -323,10 +131,10 @@ mode $mode_pres_sec { bindsym Return mode "default" } -bindsym $mod+Shift+p mode $mode_pres_main + "$mod+Shift+p" = "mode $mode_pres_main"; set $mode_screen Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default -bindsym $mod+t mode "$mode_screen" + "$mod+t" = "mode "$mode_screen""; mode "$mode_screen" { bindsym a exec autorandr --change --force, mode "default" bindsym l exec ~/.config/i3/autorandrloadmenu, mode "default" @@ -340,7 +148,7 @@ mode "$mode_screen" { } # Screen temperature ("redness") setting -bindsym $mod+y mode "$mode_temp" + "$mod+y" = "mode "$mode_temp""; set $mode_temp Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue mode "$mode_temp" { bindsym r exec sct 1000 @@ -358,9 +166,9 @@ mode "$mode_temp" { # Inactivity settings exec --no-startup-id xautolock -time 10 -locker 'xset dpms force standby' -killtime 1 -killer '$locker' -bindsym $mod+F1 exec --no-startup-id sh -c "sleep .25 && xset dpms force off" -bindsym $mod+F4 exec --no-startup-id xautolock -disable -bindsym $mod+F5 exec --no-startup-id xautolock -enable + "$mod+F1" = "exec --no-startup-id sh -c "sleep .25 && xset dpms force off""; + "$mod+F4" = "exec --no-startup-id xautolock -disable"; + "$mod+F5" = "exec --no-startup-id xautolock -enable"; # Autostart applications @@ -381,24 +189,3 @@ exec --no-startup-id ~/.config/i3/batteryNotify -d # Battery state notification {% endif %} # exec --no-startup-id ~/.config/i3/aw_start # Activity tracker - -{{ base16_schemes['schemes'][base16_scheme]['i3']['colors']['base16-' + base16_scheme + '.config'] }} -set $ignore #ff00ff - -# Basic color configuration using the Base16 variables for windows and borders. -# Property Name Border BG Text Indicator Child Border -client.focused $base0B $base0B $base00 $base00 $base0B -client.focused_inactive $base02 $base02 $base05 $base02 $base02 -client.unfocused $base05 $base04 $base00 $base04 $base00 -client.urgent $base0F $base08 $base00 $base08 $base0F -client.placeholder $ignore $base00 $base05 $ignore $base00 -client.background $base07 - -# I set the color of the active tab as the the background color -# of the terminal so they merge together. This is the opposite -# of what I used before: unfocused color was the terminal -# background color. Either I get used to it, or I should revert. - -# bar { -# i3bar_command ~/.config/lemonbar/bar.py -# } diff --git a/config/i3/focus_windows b/config/i3/focus_windows deleted file mode 100755 index bd06f3a..0000000 --- a/config/i3/focus_windows +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -XDT=/usr/bin/xdotool - -WINDOW=`$XDT getwindowfocus` - -# this brings in variables WIDTH and HEIGHT -eval `xdotool getwindowgeometry --shell $WINDOW` - -TX=`expr $WIDTH / 2` -TY=`expr $HEIGHT / 2` - -$XDT mousemove -window $WINDOW $TX $TY diff --git a/config/i3/terminal b/config/i3/terminal deleted file mode 100755 index 8426c9b..0000000 --- a/config/i3/terminal +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -alacritty msg create-window || exec alacritty -e zsh diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index fdcb5dd..505b2f7 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -1,9 +1,168 @@ -{ pkgs, ... }: +{ pkgs, config, lib, ... }: { xsession.windowManager.i3 = { enable = true; config = { terminal = "alacritty"; + # bars = []; # FIXME lemonbar + colors = let ignore = "#ff00ff"; in + with config.lib.stylix.colors.withHashtag; lib.mkForce { + focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; }; + focusedInactive = { border = base02; background = base02; text = base05; indicator = base02; childBorder = base02; }; + unfocused = { border = base05; background = base04; text = base00; indicator = base04; childBorder = base00; }; + urgent = { border = base0F; background = base08; text = base00; indicator = base08; childBorder = base0F; }; + placeholder = { border = ignore; background = base00; text = base05; indicator = ignore; childBorder = base00; }; + background = base07; + # I set the color of the active tab as the the background color of the terminal so they merge together. + }; + focus.followMouse = false; + keybindings = + let + mod = config.xsession.windowManager.i3.config.modifier; + rofi = "exec --no-startup-id ${config.programs.rofi.package}/bin/rofi"; + focus = "exec ${ pkgs.writeShellScript "i3-focus-window" + '' + WINDOW=`${pkgs.xdotool}/bin/xdotool getwindowfocus` + eval `${pkgs.xdotool}/bin/xdotool getwindowgeometry --shell $WINDOW` # this brings in variables WIDTH and HEIGHT + TX=`${pkgs.coreutils}/bin/expr $WIDTH / 2` + TY=`${pkgs.coreutils}/bin/expr $HEIGHT / 2` + ${pkgs.xdotool}/bin/xdotool mousemove -window $WINDOW $TX $TY + '' + }"; + pactl = "exec ${pkgs.pulseaudio}/bin/pactl"; # TODO Use NixOS package if using NixOS + scrot = "${pkgs.scrot}/bin/scrot --exec '${pkgs.coreutils}/bin/mv $f ~/Screenshots/ && ${pkgs.optipng}/bin/optipng ~/Screenshots/$f'"; + # TODO nix path and create directory? + in + { + # Compatibility layer for people coming from other backgrounds + # "Mod1+Tab" = "${rofi} -modi window -show window"; # FIXME When no longer using a VM + "Mod1+F2" = "${rofi} -modi drun -show drun"; + "Mod1+F4" = "kill"; + # kill focused window + "${mod}+z" = "kill"; + button2 = "kill"; + # Rofi + "${mod}+c" = "exec --no-startup-id ${pkgs.rofi-pass}/bin/rofi-pass --last-used"; + # TODO Try autopass.cr + # 23.11 config.programs.rofi.pass.package + "${mod}+i" = "exec --no-startup-id ${pkgs.rofimoji}/bin/rofimoji"; + "${mod}+plus" = "${rofi} -modi ssh -show ssh"; + "${mod}+ù" = "${rofi} -modi ssh -show ssh -ssh-command '{terminal} -e {ssh-client} {host} -t \"sudo -s -E\"'"; + # TODO In which keyboard layout? + "${mod}+Tab" = "${rofi} -modi window -show window"; + # start program launcher + "${mod}+d" = "${rofi} -modi run -show run"; + "${mod}+Shift+d" = "${rofi} -modi drun -show drun"; + # Start Applications + "${mod}+Return" = "exec ${ + pkgs.writeShellScript "terminal" "${config.programs.alacritty.package}/bin/alacritty msg create-window || exec ${config.programs.alacritty.package}/bin/alacritty -e zsh" + # TODO Is -e zsh required? + }"; + "${mod}+Shift+Return" = "exec ${config.programs.urxvt.package}/bin/urxvt"; + "${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/tunar"; + "${mod}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore --backend=webengine"; + # TODO --backend not useful anymore + # Volume control + "XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; + "XF86AudioMute" = "${pactl} set-sink-mute @DEFAULT_SINK@ true"; + "${mod}+F7" = "${pactl} suspend-sink @DEFAULT_SINK@ 1; ${pactl} suspend-sink @DEFAULT_SINK@ 0"; # Re-synchronize bluetooth headset + "${mod}+F11" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; + "${mod}+F12" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; + # TODO Find pacmixer? + # Media control + "XF86AudioPrev" = "exec ${pkgs.mpc-cli}/bin/mpc prev"; + "XF86AudioPlay" = "exec ${pkgs.mpc-cli}/bin/mpc toggle"; + "XF86AudioNext" = "exec ${pkgs.mpc-cli}/bin/mpc next"; + # Misc + "${mod}+F10" = "exec ${ pkgs.writeShellScript "show-keyboard-layout" + '' + layout=`${pkgs.xorg.setxkbmap}/bin/setxkbmap -query | ${pkgs.gnugrep}/bin/grep ^layout: | ${pkgs.gawk}/bin/awk '{ print $2 }'` + ${pkgs.libgnomekbd}/bin/gkbd-keyboard-display -l $layout + '' + }"; + # Screenshots + "Print" = "exec ${scrot} --focused"; + "${mod}+Print" = "exec ${scrot}"; # FIXME Doesn't work at least in the VM + "Ctrl+Print" = "exec ${pkgs.coreutils}/bin/sleep 1 && ${scrot} --select"; + # change focus + "${mod}+h" = "focus left; ${focus}"; + "${mod}+j" = "focus down; ${focus}"; + "${mod}+k" = "focus up; ${focus}"; + "${mod}+l" = "focus right; ${focus}"; + # move focused window + "${mod}+Shift+h" = "move left; ${focus}"; + "${mod}+Shift+j" = "move down; ${focus}"; + "${mod}+Shift+k" = "move up; ${focus}"; + "${mod}+Shift+l" = "move right; ${focus}"; + # workspace back and forth (with/without active container) + "${mod}+b" = "workspace back_and_forth; ${focus}"; + "${mod}+Shift+b" = "move container to workspace back_and_forth; workspace back_and_forth; ${focus}"; + # Change container layout + "${mod}+g" = "split h; ${focus}"; + "${mod}+v" = "split v; ${focus}"; + "${mod}+f" = "fullscreen toggle; ${focus}"; + "${mod}+s" = "layout stacking; ${focus}"; + "${mod}+w" = "layout tabbed; ${focus}"; + "${mod}+e" = "layout toggle split; ${focus}"; + "${mod}+Shift+space" = "floating toggle; ${focus}"; + # Focus container + "${mod}+space" = "focus mode_toggle; ${focus}"; + "${mod}+a" = "focus parent; ${focus}"; + "${mod}+q" = "focus child; ${focus}"; + # Switch to workspace + "${mod}+1" = "workspace 1; ${focus}"; + "${mod}+2" = "workspace 2; ${focus}"; + "${mod}+3" = "workspace 3; ${focus}"; + "${mod}+4" = "workspace 4; ${focus}"; + "${mod}+5" = "workspace 5; ${focus}"; + "${mod}+6" = "workspace 6; ${focus}"; + "${mod}+7" = "workspace 7; ${focus}"; + "${mod}+8" = "workspace 8; ${focus}"; + "${mod}+9" = "workspace 9; ${focus}"; + "${mod}+0" = "workspace 10; ${focus}"; + #navigate workspaces next / previous + "${mod}+Ctrl+h" = "workspace prev_on_output; ${focus}"; + "${mod}+Ctrl+l" = "workspace next_on_output; ${focus}"; + "${mod}+Ctrl+j" = "workspace prev; ${focus}"; + "${mod}+Ctrl+k" = "workspace next; ${focus}"; + # Move to workspace next / previous with focused container + "${mod}+Ctrl+Shift+h" = "move container to workspace prev_on_output; workspace prev_on_output; ${focus}"; + "${mod}+Ctrl+Shift+l" = "move container to workspace next_on_output; workspace next_on_output; ${focus}"; + "${mod}+Ctrl+Shift+j" = "move container to workspace prev; workspace prev; ${focus}"; + "${mod}+Ctrl+Shift+k" = "move container to workspace next; workspace next; ${focus}"; + # move focused container to workspace + "${mod}+ctrl+1" = "move container to workspace 1; ${focus}"; + "${mod}+ctrl+2" = "move container to workspace 2; ${focus}"; + "${mod}+ctrl+3" = "move container to workspace 3; ${focus}"; + "${mod}+ctrl+4" = "move container to workspace 4; ${focus}"; + "${mod}+ctrl+5" = "move container to workspace 5; ${focus}"; + "${mod}+ctrl+6" = "move container to workspace 6; ${focus}"; + "${mod}+ctrl+7" = "move container to workspace 7; ${focus}"; + "${mod}+ctrl+8" = "move container to workspace 8; ${focus}"; + "${mod}+ctrl+9" = "move container to workspace 9; ${focus}"; + "${mod}+ctrl+0" = "move container to workspace 10; ${focus}"; + # move to workspace with focused container + "${mod}+shift+1" = "move container to workspace 1; workspace 1; ${focus}"; + "${mod}+shift+2" = "move container to workspace 2; workspace 2; ${focus}"; + "${mod}+shift+3" = "move container to workspace 3; workspace 3; ${focus}"; + "${mod}+shift+4" = "move container to workspace 4; workspace 4; ${focus}"; + "${mod}+shift+5" = "move container to workspace 5; workspace 5; ${focus}"; + "${mod}+shift+6" = "move container to workspace 6; workspace 6; ${focus}"; + "${mod}+shift+7" = "move container to workspace 7; workspace 7; ${focus}"; + "${mod}+shift+8" = "move container to workspace 8; workspace 8; ${focus}"; + "${mod}+shift+9" = "move container to workspace 9; workspace 9; ${focus}"; + "${mod}+shift+0" = "move container to workspace 10; workspace 10; ${focus}"; + # move workspaces to screen (arrow keys) + "${mod}+ctrl+shift+Right" = "move workspace to output right; ${focus}"; + "${mod}+ctrl+shift+Left" = "move workspace to output left; ${focus}"; + "${mod}+Ctrl+Shift+Up" = "move workspace to output above; ${focus}"; + "${mod}+Ctrl+Shift+Down" = "move workspace to output below; ${focus}"; + # i3 control + "${mod}+Shift+c" = "reload"; + "${mod}+Shift+r" = "restart"; + "${mod}+Shift+e" = "exit"; + }; }; }; @@ -13,6 +172,7 @@ # Terminal alacritty = { + # FIXME Emojis enable = true; settings = { bell = { @@ -49,6 +209,15 @@ }; }; }; + # Backup terminal + urxvt = { + enable = true; + package = pkgs.rxvt-unicode-emoji; + }; + rofi = { + enable = true; + pass.enable = true; + }; }; home.packages = with pkgs; [ @@ -77,7 +246,6 @@ # fonts dejavu_fonts twemoji-color-font - xfce.thunar gnome.gedit feh zathura @@ -88,15 +256,10 @@ yubikey-touch-detector # x11-exclusive - libgnomekbd # to show keyboard layout dunst i3lock numlockx - rofi - rofimoji - rxvt-unicode # TODO urxvt-resize-font-git - scrot simplescreenrecorder trayer unclutter @@ -111,7 +274,7 @@ # organisation - rofi-pass # TODO Try autopass.cr + pass thunderbird ]; diff --git a/config/nix/hm/style.nix b/config/nix/hm/style.nix index c73eebb..22162a6 100644 --- a/config/nix/hm/style.nix +++ b/config/nix/hm/style.nix @@ -23,6 +23,7 @@ in }; targets.vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR) + # targets.i3.enable = false; # I prefer my own styles }; # Fix https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal diff --git a/config/nix/os/desktop.nix b/config/nix/os/desktop.nix index e7379ce..d068c73 100644 --- a/config/nix/os/desktop.nix +++ b/config/nix/os/desktop.nix @@ -34,5 +34,4 @@ # Enable sound sound.enable = true; hardware.pulseaudio.enable = true; - environment.systemPackages = with pkgs; [ pavucontrol ]; } diff --git a/config/scripts/showKeyboardLayout b/config/scripts/showKeyboardLayout deleted file mode 100755 index 379ca37..0000000 --- a/config/scripts/showKeyboardLayout +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/bash -layout=`setxkbmap -query | grep layout | tr -s ' ' | cut -d ' ' -f2` -variant=`setxkbmap -query | grep variant | tr -s ' ' | cut -d ' ' -f2` -gkbd-keyboard-display -l ${layout}$'\t'${variant} From 9686bee77e1ecbd2245733732ce4f67061053c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 3 Nov 2023 18:18:38 +0100 Subject: [PATCH 031/108] nix: i3: few modes --- config/i3/config.j2 | 98 ++-------- config/i3/lock | 24 --- config/i3/lock.png | Bin 266 -> 0 bytes config/i3/lock.svg | 1 - config/nix/hm/desktop.nix | 395 ++++++++++++++++++++++---------------- 5 files changed, 249 insertions(+), 269 deletions(-) delete mode 100755 config/i3/lock delete mode 100644 config/i3/lock.png delete mode 100644 config/i3/lock.svg diff --git a/config/i3/config.j2 b/config/i3/config.j2 index a8bb732..2f2ac69 100644 --- a/config/i3/config.j2 +++ b/config/i3/config.j2 @@ -62,105 +62,37 @@ for_window [ title="^pdfpc.*" window_role="presentation" ] move to output right, # switch to workspace with urgent window automatically for_window [urgent=latest] focus -# Set shut down, restart and locking features -set $mode_kblock Keyboard lock -mode "$mode_kblock" { - bindsym $mod+Shift+Escape mode "$mode_kblock" -} - "$mod+Shift+Escape" = "mode "$mode_kblock""; - # Set shut down, restart and locking features set $locker $HOME/.config/i3/lock -set $mode_system [L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction -mode "$mode_system" { - bindsym l exec --no-startup-id $locker, mode "default" - bindsym e exit, mode "default" - bindsym s exec --no-startup-id $locker & systemctl suspend, mode "default" - bindsym h exec --no-startup-id $locker & systemctl hibernate, mode "default" - bindsym r exec --no-startup-id systemctl reboot, mode "default" - bindsym p exec --no-startup-id systemctl poweroff -i, mode "default" - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} - "$mod+Escape" = "mode "$mode_system""; - -# resize window (you can also use the mouse for that) -mode "Resize" { - # These bindings trigger as soon as you enter the resize mode - - # Pressing left will shrink the window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym h resize shrink width 10 px or 10 ppt; exec ~/.config/i3/focus_windows - bindsym j resize grow height 10 px or 10 ppt; exec ~/.config/i3/focus_windows - bindsym k resize shrink height 10 px or 10 ppt; exec ~/.config/i3/focus_windows - bindsym l resize grow width 10 px or 10 ppt; exec ~/.config/i3/focus_windows - - ## same bindings, but for the arrow keys - #bindsym Left resize shrink width 10 px or 10 ppt - #bindsym Down resize grow height 10 px or 10 ppt - #bindsym Up resize shrink height 10 px or 10 ppt - #bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} - - "$mod+r" = "mode "Resize""; - -set $mode_pres_main "Presentation (main display)" -mode $mode_pres_main { - bindsym b workspace $WS3, workspace $WS4, mode $mode_pres_sec - - # back to normal: Enter or Escape - bindsym q mode "default" - # bindsym Escape mode "default" - bindsym Return mode "default" -} -set $mode_pres_sec "Presentation (secondary display)" -mode $mode_pres_sec { - bindsym b workspace $WS2, workspace $WS1, mode $mode_pres_main - - # back to normal: Enter or Escape - bindsym q mode "default" - # bindsym Escape mode "default" - bindsym Return mode "default" -} - - "$mod+Shift+p" = "mode $mode_pres_main"; set $mode_screen Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default "$mod+t" = "mode "$mode_screen""; mode "$mode_screen" { - bindsym a exec autorandr --change --force, mode "default" - bindsym l exec ~/.config/i3/autorandrloadmenu, mode "default" - bindsym s exec ~/.config/i3/autorandrsavemenu, mode "default" - bindsym r exec ~/.config/i3/autorandrremovemenu, mode "default" - bindsym d exec ~/.config/i3/autorandrdefaultmenu, mode "default" + "a" = "exec autorandr --change --force, mode "default""; + "l" = "exec ~/.config/i3/autorandrloadmenu, mode "default""; + "s" = "exec ~/.config/i3/autorandrsavemenu, mode "default""; + "r" = "exec ~/.config/i3/autorandrremovemenu, mode "default""; + "d" = "exec ~/.config/i3/autorandrdefaultmenu, mode "default""; # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" + "Return" = "mode "default""; + "Escape" = "mode "default""; } # Screen temperature ("redness") setting "$mod+y" = "mode "$mode_temp""; set $mode_temp Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue mode "$mode_temp" { - bindsym r exec sct 1000 - bindsym d exec sct 2000 - bindsym c exec sct 4500 - bindsym o exec sct - bindsym a exec sct 8000 - bindsym b exec sct 10000 + "r" = "exec sct 1000"; + "d" = "exec sct 2000"; + "c" = "exec sct 4500"; + "o" = "exec sct"; + "a" = "exec sct 8000"; + "b" = "exec sct 10000"; # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" + "Return" = "mode "default""; + "Escape" = "mode "default""; } diff --git a/config/i3/lock b/config/i3/lock deleted file mode 100755 index 5ca0609..0000000 --- a/config/i3/lock +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -# Remove SSH and GPG keys from keystores -ssh-add -D -echo RELOADAGENT | gpg-connect-agent -rm -rf "/tmp/cached_pass_$UID" - - -dm-tool lock -if [ $? -ne 0 ]; then - if [ -d ~/.cache/lockpatterns ] - then - pattern=$(find ~/.cache/lockpatterns/ | sort -R | head -1) - else - pattern=$HOME/.config/i3/lock.png - fi - revert() { - xset dpms 0 0 0 - } - trap revert SIGHUP SIGINT SIGTERM - xset dpms 5 5 5 - i3lock --nofork --color 648901 --image=$pattern --tiling --ignore-empty-password - revert -fi diff --git a/config/i3/lock.png b/config/i3/lock.png deleted file mode 100644 index 70cc80b9e4849ec73eb585040a3730f890fbd254..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 266 zcmeAS@N?(olHy`uVBq!ia0vp^#vshX3?xtV>q-JCi2$Dv*Q9pFrX`Hk^BDa~7~OIh zeTx}WIvA?wGP=lyfi$i4ba4!^I9+;aqu?P20hWV_UW^PIA8<2&Qc-qlkO1EZoZP0-Ceu`lxo5Y=TK0HS}H zr-3Ny)`n?jYnGU5XP(W9GW?zzr)^!W|2g#L*>~E{-&OBkKj+u`UbrEsMxye5Gu-^t V*ybRuSqOAEgQu&X%Q~loCIHu=XZ!#F diff --git a/config/i3/lock.svg b/config/i3/lock.svg deleted file mode 100644 index 8eac69f..0000000 --- a/config/i3/lock.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 505b2f7..132f85f 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -2,168 +2,242 @@ { xsession.windowManager.i3 = { enable = true; - config = { - terminal = "alacritty"; - # bars = []; # FIXME lemonbar - colors = let ignore = "#ff00ff"; in - with config.lib.stylix.colors.withHashtag; lib.mkForce { - focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; }; - focusedInactive = { border = base02; background = base02; text = base05; indicator = base02; childBorder = base02; }; - unfocused = { border = base05; background = base04; text = base00; indicator = base04; childBorder = base00; }; - urgent = { border = base0F; background = base08; text = base00; indicator = base08; childBorder = base0F; }; - placeholder = { border = ignore; background = base00; text = base05; indicator = ignore; childBorder = base00; }; - background = base07; - # I set the color of the active tab as the the background color of the terminal so they merge together. - }; - focus.followMouse = false; - keybindings = - let - mod = config.xsession.windowManager.i3.config.modifier; - rofi = "exec --no-startup-id ${config.programs.rofi.package}/bin/rofi"; - focus = "exec ${ pkgs.writeShellScript "i3-focus-window" - '' - WINDOW=`${pkgs.xdotool}/bin/xdotool getwindowfocus` - eval `${pkgs.xdotool}/bin/xdotool getwindowgeometry --shell $WINDOW` # this brings in variables WIDTH and HEIGHT - TX=`${pkgs.coreutils}/bin/expr $WIDTH / 2` - TY=`${pkgs.coreutils}/bin/expr $HEIGHT / 2` - ${pkgs.xdotool}/bin/xdotool mousemove -window $WINDOW $TX $TY - '' - }"; - pactl = "exec ${pkgs.pulseaudio}/bin/pactl"; # TODO Use NixOS package if using NixOS - scrot = "${pkgs.scrot}/bin/scrot --exec '${pkgs.coreutils}/bin/mv $f ~/Screenshots/ && ${pkgs.optipng}/bin/optipng ~/Screenshots/$f'"; - # TODO nix path and create directory? - in - { - # Compatibility layer for people coming from other backgrounds - # "Mod1+Tab" = "${rofi} -modi window -show window"; # FIXME When no longer using a VM - "Mod1+F2" = "${rofi} -modi drun -show drun"; - "Mod1+F4" = "kill"; - # kill focused window - "${mod}+z" = "kill"; - button2 = "kill"; - # Rofi - "${mod}+c" = "exec --no-startup-id ${pkgs.rofi-pass}/bin/rofi-pass --last-used"; - # TODO Try autopass.cr - # 23.11 config.programs.rofi.pass.package - "${mod}+i" = "exec --no-startup-id ${pkgs.rofimoji}/bin/rofimoji"; - "${mod}+plus" = "${rofi} -modi ssh -show ssh"; - "${mod}+ù" = "${rofi} -modi ssh -show ssh -ssh-command '{terminal} -e {ssh-client} {host} -t \"sudo -s -E\"'"; - # TODO In which keyboard layout? - "${mod}+Tab" = "${rofi} -modi window -show window"; - # start program launcher - "${mod}+d" = "${rofi} -modi run -show run"; - "${mod}+Shift+d" = "${rofi} -modi drun -show drun"; - # Start Applications - "${mod}+Return" = "exec ${ + config = + let + # lockColors = with config.lib.stylix.colors.withHashtag; { a = base00; b = base01; d = base00; }; # Black or White, depending on current theme + # lockColors = with config.lib.stylix.colors.withHashtag; { a = base0A; b = base0B; d = base00; }; # Green + Yellow + lockColors = { a = "#82a401"; b = "#466c01"; d = "#648901"; }; # Old + lockSvg = pkgs.writeText "lock.svg" ""; + lockPng = pkgs.runCommand "lock.png" { } "${pkgs.imagemagick}/bin/convert ${lockSvg} $out"; + locker = "exec ${ pkgs.writeShellScript "i3-locker" + '' + # Remove SSH and GPG keys from keystores + ${pkgs.openssh}/bin/ssh-add -D + echo RELOADAGENT | ${pkgs.gnupg}/bin/gpg-connect-agent + ${pkgs.coreutils}/bin/rm -rf "/tmp/cached_pass_$UID" + + ${pkgs.lightdm}/bin/dm-tool lock + # TODO Does that work for all DMs? + if [ $? -ne 0 ]; then + if [ -d ${config.xdg.cacheHome}/lockpatterns ] + then + pattern=$(${pkgs.findutils} ${config.xdg.cacheHome}/lockpatterns | sort -R | head -1) + else + pattern=${lockPng} + fi + revert() { + ${pkgs.xorg.xset} dpms 0 0 0 + } + trap revert SIGHUP SIGINT SIGTERM + ${pkgs.xorg.xset} dpms 5 5 5 + ${pkgs.i3lock}/bin/i3lock --nofork --color ${builtins.substring 1 6 lockColors.d} --image=$pattern --tiling --ignore-empty-password + revert + fi + '' + }"; + focus = "exec ${ pkgs.writeShellScript "i3-focus-window" + '' + WINDOW=`${pkgs.xdotool}/bin/xdotool getwindowfocus` + eval `${pkgs.xdotool}/bin/xdotool getwindowgeometry --shell $WINDOW` # this brings in variables WIDTH and HEIGHT + TX=`${pkgs.coreutils}/bin/expr $WIDTH / 2` + TY=`${pkgs.coreutils}/bin/expr $HEIGHT / 2` + ${pkgs.xdotool}/bin/xdotool mousemove -window $WINDOW $TX $TY + '' + }"; + mode_system = "[L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction"; + mode_resize = "Resize"; + mode_pres_main = "Presentation (main display)"; + mode_pres_sec = "Presentation (secondary display)"; + in + { + terminal = "alacritty"; + # bars = []; # FIXME lemonbar + colors = let ignore = "#ff00ff"; in + with config.lib.stylix.colors.withHashtag; lib.mkForce { + focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; }; + focusedInactive = { border = base02; background = base02; text = base05; indicator = base02; childBorder = base02; }; + unfocused = { border = base05; background = base04; text = base00; indicator = base04; childBorder = base00; }; + urgent = { border = base0F; background = base08; text = base00; indicator = base08; childBorder = base0F; }; + placeholder = { border = ignore; background = base00; text = base05; indicator = ignore; childBorder = base00; }; + background = base07; + # I set the color of the active tab as the the background color of the terminal so they merge together. + }; + focus.followMouse = false; + keybindings = + let + mod = config.xsession.windowManager.i3.config.modifier; + rofi = "exec --no-startup-id ${config.programs.rofi.package}/bin/rofi"; + pactl = "exec ${pkgs.pulseaudio}/bin/pactl"; # TODO Use NixOS package if using NixOS + scrot = "${pkgs.scrot}/bin/scrot --exec '${pkgs.coreutils}/bin/mv $f ~/Screenshots/ && ${pkgs.optipng}/bin/optipng ~/Screenshots/$f'"; + # TODO nix path and create directory? + in + { + # Compatibility layer for people coming from other backgrounds + # "Mod1+Tab" = "${rofi} -modi window -show window"; # FIXME When no longer using a VM + "Mod1+F2" = "${rofi} -modi drun -show drun"; + "Mod1+F4" = "kill"; + # kill focused window + "${mod}+z" = "kill"; + button2 = "kill"; + # Rofi + "${mod}+c" = "exec --no-startup-id ${pkgs.rofi-pass}/bin/rofi-pass --last-used"; + # TODO Try autopass.cr + # 23.11 config.programs.rofi.pass.package + "${mod}+i" = "exec --no-startup-id ${pkgs.rofimoji}/bin/rofimoji"; + "${mod}+plus" = "${rofi} -modi ssh -show ssh"; + "${mod}+ù" = "${rofi} -modi ssh -show ssh -ssh-command '{terminal} -e {ssh-client} {host} -t \"sudo -s -E\"'"; + # TODO In which keyboard layout? + "${mod}+Tab" = "${rofi} -modi window -show window"; + # start program launcher + "${mod}+d" = "${rofi} -modi run -show run"; + "${mod}+Shift+d" = "${rofi} -modi drun -show drun"; + # Start Applications + "${mod}+Return" = "exec ${ pkgs.writeShellScript "terminal" "${config.programs.alacritty.package}/bin/alacritty msg create-window || exec ${config.programs.alacritty.package}/bin/alacritty -e zsh" - # TODO Is -e zsh required? + # -e zsh is for systems where I can't configure my user's shell + # TODO Is a shell script even required? }"; - "${mod}+Shift+Return" = "exec ${config.programs.urxvt.package}/bin/urxvt"; - "${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/tunar"; - "${mod}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore --backend=webengine"; - # TODO --backend not useful anymore - # Volume control - "XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; - "XF86AudioMute" = "${pactl} set-sink-mute @DEFAULT_SINK@ true"; - "${mod}+F7" = "${pactl} suspend-sink @DEFAULT_SINK@ 1; ${pactl} suspend-sink @DEFAULT_SINK@ 0"; # Re-synchronize bluetooth headset - "${mod}+F11" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; - "${mod}+F12" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; - # TODO Find pacmixer? - # Media control - "XF86AudioPrev" = "exec ${pkgs.mpc-cli}/bin/mpc prev"; - "XF86AudioPlay" = "exec ${pkgs.mpc-cli}/bin/mpc toggle"; - "XF86AudioNext" = "exec ${pkgs.mpc-cli}/bin/mpc next"; - # Misc - "${mod}+F10" = "exec ${ pkgs.writeShellScript "show-keyboard-layout" - '' - layout=`${pkgs.xorg.setxkbmap}/bin/setxkbmap -query | ${pkgs.gnugrep}/bin/grep ^layout: | ${pkgs.gawk}/bin/awk '{ print $2 }'` - ${pkgs.libgnomekbd}/bin/gkbd-keyboard-display -l $layout - '' - }"; - # Screenshots - "Print" = "exec ${scrot} --focused"; - "${mod}+Print" = "exec ${scrot}"; # FIXME Doesn't work at least in the VM - "Ctrl+Print" = "exec ${pkgs.coreutils}/bin/sleep 1 && ${scrot} --select"; - # change focus - "${mod}+h" = "focus left; ${focus}"; - "${mod}+j" = "focus down; ${focus}"; - "${mod}+k" = "focus up; ${focus}"; - "${mod}+l" = "focus right; ${focus}"; - # move focused window - "${mod}+Shift+h" = "move left; ${focus}"; - "${mod}+Shift+j" = "move down; ${focus}"; - "${mod}+Shift+k" = "move up; ${focus}"; - "${mod}+Shift+l" = "move right; ${focus}"; - # workspace back and forth (with/without active container) - "${mod}+b" = "workspace back_and_forth; ${focus}"; - "${mod}+Shift+b" = "move container to workspace back_and_forth; workspace back_and_forth; ${focus}"; - # Change container layout - "${mod}+g" = "split h; ${focus}"; - "${mod}+v" = "split v; ${focus}"; - "${mod}+f" = "fullscreen toggle; ${focus}"; - "${mod}+s" = "layout stacking; ${focus}"; - "${mod}+w" = "layout tabbed; ${focus}"; - "${mod}+e" = "layout toggle split; ${focus}"; - "${mod}+Shift+space" = "floating toggle; ${focus}"; - # Focus container - "${mod}+space" = "focus mode_toggle; ${focus}"; - "${mod}+a" = "focus parent; ${focus}"; - "${mod}+q" = "focus child; ${focus}"; - # Switch to workspace - "${mod}+1" = "workspace 1; ${focus}"; - "${mod}+2" = "workspace 2; ${focus}"; - "${mod}+3" = "workspace 3; ${focus}"; - "${mod}+4" = "workspace 4; ${focus}"; - "${mod}+5" = "workspace 5; ${focus}"; - "${mod}+6" = "workspace 6; ${focus}"; - "${mod}+7" = "workspace 7; ${focus}"; - "${mod}+8" = "workspace 8; ${focus}"; - "${mod}+9" = "workspace 9; ${focus}"; - "${mod}+0" = "workspace 10; ${focus}"; - #navigate workspaces next / previous - "${mod}+Ctrl+h" = "workspace prev_on_output; ${focus}"; - "${mod}+Ctrl+l" = "workspace next_on_output; ${focus}"; - "${mod}+Ctrl+j" = "workspace prev; ${focus}"; - "${mod}+Ctrl+k" = "workspace next; ${focus}"; - # Move to workspace next / previous with focused container - "${mod}+Ctrl+Shift+h" = "move container to workspace prev_on_output; workspace prev_on_output; ${focus}"; - "${mod}+Ctrl+Shift+l" = "move container to workspace next_on_output; workspace next_on_output; ${focus}"; - "${mod}+Ctrl+Shift+j" = "move container to workspace prev; workspace prev; ${focus}"; - "${mod}+Ctrl+Shift+k" = "move container to workspace next; workspace next; ${focus}"; - # move focused container to workspace - "${mod}+ctrl+1" = "move container to workspace 1; ${focus}"; - "${mod}+ctrl+2" = "move container to workspace 2; ${focus}"; - "${mod}+ctrl+3" = "move container to workspace 3; ${focus}"; - "${mod}+ctrl+4" = "move container to workspace 4; ${focus}"; - "${mod}+ctrl+5" = "move container to workspace 5; ${focus}"; - "${mod}+ctrl+6" = "move container to workspace 6; ${focus}"; - "${mod}+ctrl+7" = "move container to workspace 7; ${focus}"; - "${mod}+ctrl+8" = "move container to workspace 8; ${focus}"; - "${mod}+ctrl+9" = "move container to workspace 9; ${focus}"; - "${mod}+ctrl+0" = "move container to workspace 10; ${focus}"; - # move to workspace with focused container - "${mod}+shift+1" = "move container to workspace 1; workspace 1; ${focus}"; - "${mod}+shift+2" = "move container to workspace 2; workspace 2; ${focus}"; - "${mod}+shift+3" = "move container to workspace 3; workspace 3; ${focus}"; - "${mod}+shift+4" = "move container to workspace 4; workspace 4; ${focus}"; - "${mod}+shift+5" = "move container to workspace 5; workspace 5; ${focus}"; - "${mod}+shift+6" = "move container to workspace 6; workspace 6; ${focus}"; - "${mod}+shift+7" = "move container to workspace 7; workspace 7; ${focus}"; - "${mod}+shift+8" = "move container to workspace 8; workspace 8; ${focus}"; - "${mod}+shift+9" = "move container to workspace 9; workspace 9; ${focus}"; - "${mod}+shift+0" = "move container to workspace 10; workspace 10; ${focus}"; - # move workspaces to screen (arrow keys) - "${mod}+ctrl+shift+Right" = "move workspace to output right; ${focus}"; - "${mod}+ctrl+shift+Left" = "move workspace to output left; ${focus}"; - "${mod}+Ctrl+Shift+Up" = "move workspace to output above; ${focus}"; - "${mod}+Ctrl+Shift+Down" = "move workspace to output below; ${focus}"; - # i3 control - "${mod}+Shift+c" = "reload"; - "${mod}+Shift+r" = "restart"; - "${mod}+Shift+e" = "exit"; - }; - }; + "${mod}+Shift+Return" = "exec ${config.programs.urxvt.package}/bin/urxvt"; + "${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/tunar"; + "${mod}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore --backend=webengine"; + # TODO --backend not useful anymore + # Volume control + "XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; + "XF86AudioMute" = "${pactl} set-sink-mute @DEFAULT_SINK@ true"; + "${mod}+F7" = "${pactl} suspend-sink @DEFAULT_SINK@ 1; ${pactl} suspend-sink @DEFAULT_SINK@ 0"; # Re-synchronize bluetooth headset + "${mod}+F11" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; + "${mod}+F12" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; + # TODO Find pacmixer? + # Media control + "XF86AudioPrev" = "exec ${pkgs.mpc-cli}/bin/mpc prev"; + "XF86AudioPlay" = "exec ${pkgs.mpc-cli}/bin/mpc toggle"; + "XF86AudioNext" = "exec ${pkgs.mpc-cli}/bin/mpc next"; + # Misc + "${mod}+F10" = "exec ${ pkgs.writeShellScript "show-keyboard-layout" + '' + layout=`${pkgs.xorg.setxkbmap}/bin/setxkbmap -query | ${pkgs.gnugrep}/bin/grep ^layout: | ${pkgs.gawk}/bin/awk '{ print $2 }'` + ${pkgs.libgnomekbd}/bin/gkbd-keyboard-display -l $layout + '' + }"; + # Screenshots + "Print" = "exec ${scrot} --focused"; + "${mod}+Print" = "exec ${scrot}"; # FIXME Doesn't work at least in the VM + "Ctrl+Print" = "exec ${pkgs.coreutils}/bin/sleep 1 && ${scrot} --select"; + # TODO Try using bindsym --release instead of sleep + # change focus + "${mod}+h" = "focus left; ${focus}"; + "${mod}+j" = "focus down; ${focus}"; + "${mod}+k" = "focus up; ${focus}"; + "${mod}+l" = "focus right; ${focus}"; + # move focused window + "${mod}+Shift+h" = "move left; ${focus}"; + "${mod}+Shift+j" = "move down; ${focus}"; + "${mod}+Shift+k" = "move up; ${focus}"; + "${mod}+Shift+l" = "move right; ${focus}"; + # workspace back and forth (with/without active container) + "${mod}+b" = "workspace back_and_forth; ${focus}"; + "${mod}+Shift+b" = "move container to workspace back_and_forth; workspace back_and_forth; ${focus}"; + # Change container layout + "${mod}+g" = "split h; ${focus}"; + "${mod}+v" = "split v; ${focus}"; + "${mod}+f" = "fullscreen toggle; ${focus}"; + "${mod}+s" = "layout stacking; ${focus}"; + "${mod}+w" = "layout tabbed; ${focus}"; + "${mod}+e" = "layout toggle split; ${focus}"; + "${mod}+Shift+space" = "floating toggle; ${focus}"; + # Focus container + "${mod}+space" = "focus mode_toggle; ${focus}"; + "${mod}+a" = "focus parent; ${focus}"; + "${mod}+q" = "focus child; ${focus}"; + # Switch to workspace + "${mod}+1" = "workspace 1; ${focus}"; + "${mod}+2" = "workspace 2; ${focus}"; + "${mod}+3" = "workspace 3; ${focus}"; + "${mod}+4" = "workspace 4; ${focus}"; + "${mod}+5" = "workspace 5; ${focus}"; + "${mod}+6" = "workspace 6; ${focus}"; + "${mod}+7" = "workspace 7; ${focus}"; + "${mod}+8" = "workspace 8; ${focus}"; + "${mod}+9" = "workspace 9; ${focus}"; + "${mod}+0" = "workspace 10; ${focus}"; + #navigate workspaces next / previous + "${mod}+Ctrl+h" = "workspace prev_on_output; ${focus}"; + "${mod}+Ctrl+l" = "workspace next_on_output; ${focus}"; + "${mod}+Ctrl+j" = "workspace prev; ${focus}"; + "${mod}+Ctrl+k" = "workspace next; ${focus}"; + # Move to workspace next / previous with focused container + "${mod}+Ctrl+Shift+h" = "move container to workspace prev_on_output; workspace prev_on_output; ${focus}"; + "${mod}+Ctrl+Shift+l" = "move container to workspace next_on_output; workspace next_on_output; ${focus}"; + "${mod}+Ctrl+Shift+j" = "move container to workspace prev; workspace prev; ${focus}"; + "${mod}+Ctrl+Shift+k" = "move container to workspace next; workspace next; ${focus}"; + # move focused container to workspace + "${mod}+ctrl+1" = "move container to workspace 1; ${focus}"; + "${mod}+ctrl+2" = "move container to workspace 2; ${focus}"; + "${mod}+ctrl+3" = "move container to workspace 3; ${focus}"; + "${mod}+ctrl+4" = "move container to workspace 4; ${focus}"; + "${mod}+ctrl+5" = "move container to workspace 5; ${focus}"; + "${mod}+ctrl+6" = "move container to workspace 6; ${focus}"; + "${mod}+ctrl+7" = "move container to workspace 7; ${focus}"; + "${mod}+ctrl+8" = "move container to workspace 8; ${focus}"; + "${mod}+ctrl+9" = "move container to workspace 9; ${focus}"; + "${mod}+ctrl+0" = "move container to workspace 10; ${focus}"; + # move to workspace with focused container + "${mod}+shift+1" = "move container to workspace 1; workspace 1; ${focus}"; + "${mod}+shift+2" = "move container to workspace 2; workspace 2; ${focus}"; + "${mod}+shift+3" = "move container to workspace 3; workspace 3; ${focus}"; + "${mod}+shift+4" = "move container to workspace 4; workspace 4; ${focus}"; + "${mod}+shift+5" = "move container to workspace 5; workspace 5; ${focus}"; + "${mod}+shift+6" = "move container to workspace 6; workspace 6; ${focus}"; + "${mod}+shift+7" = "move container to workspace 7; workspace 7; ${focus}"; + "${mod}+shift+8" = "move container to workspace 8; workspace 8; ${focus}"; + "${mod}+shift+9" = "move container to workspace 9; workspace 9; ${focus}"; + "${mod}+shift+0" = "move container to workspace 10; workspace 10; ${focus}"; + # move workspaces to screen (arrow keys) + "${mod}+ctrl+shift+Right" = "move workspace to output right; ${focus}"; + "${mod}+ctrl+shift+Left" = "move workspace to output left; ${focus}"; + "${mod}+Ctrl+Shift+Up" = "move workspace to output above; ${focus}"; + "${mod}+Ctrl+Shift+Down" = "move workspace to output below; ${focus}"; + # i3 control + "${mod}+Shift+c" = "reload"; + "${mod}+Shift+r" = "restart"; + "${mod}+Shift+e" = "exit"; + # Modes + "${mod}+Escape" = "mode ${mode_system}"; + "${mod}+r" = "mode ${mode_resize}"; + "${mod}+Shift+p" = "mode ${mode_pres_main}"; + }; + modes = let return_bindings = { + "Return" = "mode default"; + "Escape" = "mode default"; + }; in + { + "${mode_system}" = { + "l" = "exec --no-startup-id ${locker}, mode default"; + "e" = "exit, mode default"; + "s" = "exec --no-startup-id ${locker} & ${pkgs.systemd}/bin/systemctl suspend, mode default"; + "h" = "exec --no-startup-id ${locker} & ${pkgs.systemd}/bin/systemctl hibernate, mode default"; + "r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default"; + "p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default"; + } // return_bindings; + "${mode_resize}" = { + "h" = "resize shrink width 10 px or 10 ppt; ${focus}"; + "j" = "resize grow height 10 px or 10 ppt; ${focus}"; + "k" = "resize shrink height 10 px or 10 ppt; ${focus}"; + "l" = "resize grow width 10 px or 10 ppt; ${focus}"; + } // return_bindings; + "${mode_pres_main}" = { + "b" = "workspace 3, workspace 4, mode $mode_pres_sec"; + "q" = "mode default"; + "Return" = "mode default"; + }; + "${mode_pres_sec}" = { + "b" = "workspace 1, workspace 2, mode $mode_pres_main"; + "q" = "mode default"; + "Return" = "mode default"; + }; + }; + }; }; programs = { @@ -257,7 +331,6 @@ # x11-exclusive dunst - i3lock numlockx # TODO urxvt-resize-font-git simplescreenrecorder From c51aeacd035dd55cffe8313fb1650abbdbf24d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 3 Nov 2023 21:28:29 +0100 Subject: [PATCH 032/108] nix: i3: add autorandr --- config/alacritty/.gitignore | 2 -- config/i3/autorandrdefaultmenu | 10 ---------- config/i3/autorandrloadmenu | 10 ---------- config/i3/autorandrremovemenu | 10 ---------- config/i3/autorandrsavemenu | 10 ---------- config/i3/config.j2 | 14 -------------- config/nix/hm/desktop.nix | 26 +++++++++++++++++++++++--- 7 files changed, 23 insertions(+), 59 deletions(-) delete mode 100644 config/alacritty/.gitignore delete mode 100755 config/i3/autorandrdefaultmenu delete mode 100755 config/i3/autorandrloadmenu delete mode 100755 config/i3/autorandrremovemenu delete mode 100755 config/i3/autorandrsavemenu diff --git a/config/alacritty/.gitignore b/config/alacritty/.gitignore deleted file mode 100644 index f84003c..0000000 --- a/config/alacritty/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -theme.yml -alacritty.yml diff --git a/config/i3/autorandrdefaultmenu b/config/i3/autorandrdefaultmenu deleted file mode 100755 index d2f2d25..0000000 --- a/config/i3/autorandrdefaultmenu +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -shopt -s nullglob globstar - -profile=$(echo -e "$(autorandr 2>&1 | cut -d' ' -f1)" | rofi -dmenu -p "Default profile" "$@") - -[[ -n $profile ]] || exit - -autorandr --default "$profile" - diff --git a/config/i3/autorandrloadmenu b/config/i3/autorandrloadmenu deleted file mode 100755 index 14c5a13..0000000 --- a/config/i3/autorandrloadmenu +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -shopt -s nullglob globstar - -profile=$(echo -e "common\nclone-largest\nhorizontal\nvertical\n$(autorandr 2>&1 | cut -d' ' -f1)" | rofi -dmenu -p "Load profile" "$@") - -[[ -n $profile ]] || exit - -autorandr --load "$profile" - diff --git a/config/i3/autorandrremovemenu b/config/i3/autorandrremovemenu deleted file mode 100755 index 323d72c..0000000 --- a/config/i3/autorandrremovemenu +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -shopt -s nullglob globstar - -profile=$(echo -e "$(autorandr 2>&1 | cut -d' ' -f1)" | rofi -dmenu -p "Remove profile" "$@") - -[[ -n $profile ]] || exit - -autorandr --remove "$profile" - diff --git a/config/i3/autorandrsavemenu b/config/i3/autorandrsavemenu deleted file mode 100755 index e24db48..0000000 --- a/config/i3/autorandrsavemenu +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -shopt -s nullglob globstar - -profile=$(echo -e "$(autorandr 2>&1 | cut -d' ' -f1)" | rofi -dmenu -p "Save profile" "$@") - -[[ -n $profile ]] || exit - -autorandr --save "$profile" - diff --git a/config/i3/config.j2 b/config/i3/config.j2 index d3a131c..d0e0381 100644 --- a/config/i3/config.j2 +++ b/config/i3/config.j2 @@ -65,20 +65,6 @@ for_window [urgent=latest] focus # Set shut down, restart and locking features set $locker $HOME/.config/i3/lock -set $mode_screen Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default - "$mod+t" = "mode "$mode_screen""; -mode "$mode_screen" { - "a" = "exec autorandr --change --force, mode "default""; - "l" = "exec ~/.config/i3/autorandrloadmenu, mode "default""; - "s" = "exec ~/.config/i3/autorandrsavemenu, mode "default""; - "r" = "exec ~/.config/i3/autorandrremovemenu, mode "default""; - "d" = "exec ~/.config/i3/autorandrdefaultmenu, mode "default""; - - # back to normal: Enter or Escape - "Return" = "mode "default""; - "Escape" = "mode "default""; -} - # Screen temperature ("redness") setting "$mod+y" = "mode "$mode_temp""; set $mode_temp Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 132f85f..80fcc15 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -48,6 +48,7 @@ mode_resize = "Resize"; mode_pres_main = "Presentation (main display)"; mode_pres_sec = "Presentation (secondary display)"; + mode_screen = "Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default"; in { terminal = "alacritty"; @@ -206,6 +207,7 @@ "${mod}+Escape" = "mode ${mode_system}"; "${mod}+r" = "mode ${mode_resize}"; "${mod}+Shift+p" = "mode ${mode_pres_main}"; + "${mod}+t" = "mode ${mode_screen}"; }; modes = let return_bindings = { "Return" = "mode default"; @@ -227,15 +229,34 @@ "l" = "resize grow width 10 px or 10 ppt; ${focus}"; } // return_bindings; "${mode_pres_main}" = { - "b" = "workspace 3, workspace 4, mode $mode_pres_sec"; + "b" = "workspace 3, workspace 4, mode ${mode_pres_sec}"; "q" = "mode default"; "Return" = "mode default"; }; "${mode_pres_sec}" = { - "b" = "workspace 1, workspace 2, mode $mode_pres_main"; + "b" = "workspace 1, workspace 2, mode ${mode_pres_main}"; "q" = "mode default"; "Return" = "mode default"; }; + "${mode_screen}" = + let + builtin_configs = [ "off" "common" "clone-largest" "horizontal" "vertical" "horizontal-reverse" "vertical-reverse" ]; + autorandrmenu = { title, option, builtin ? false }: pkgs.writeShellScript "autorandrmenu" + '' + shopt -s nullglob globstar + profiles="${if builtin then lib.strings.concatLines builtin_configs else ""}$(${pkgs.autorandr}/bin/autorandr | ${pkgs.gawk}/bin/awk '{ print $1 }')" + profile="$(echo "$profiles" | ${config.programs.rofi.package}/bin/rofi -dmenu -p "${title}")" + [[ -n "$profile" ]] || exit + ${pkgs.autorandr}/bin/autorandr ${option} "$profile" + ''; + in + { + "a" = "exec ${pkgs.autorandr}/bin/autorandr --change --force, mode default"; + "l" = "exec ${autorandrmenu {title="Load profile"; option="--load"; builtin = true;}}, mode default"; + "s" = "exec ${autorandrmenu {title="Save profile"; option="--save";}}, mode default"; + "r" = "exec ${autorandrmenu {title="Remove profile"; option="--remove";}}, mode default"; + "d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default"; + } // return_bindings; }; }; }; @@ -339,7 +360,6 @@ xautolock xclip lemonbar-xft - autorandr keynav sct xorg.xinit From ab85586a5d667ea31972f55e7f5d822b04889288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 4 Nov 2023 11:59:36 +0100 Subject: [PATCH 033/108] nix: i3: add sct mode --- config/i3/config.j2 | 17 ----------------- config/nix/hm/desktop.nix | 11 ++++++++++- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/config/i3/config.j2 b/config/i3/config.j2 index d0e0381..49075f3 100644 --- a/config/i3/config.j2 +++ b/config/i3/config.j2 @@ -65,23 +65,6 @@ for_window [urgent=latest] focus # Set shut down, restart and locking features set $locker $HOME/.config/i3/lock -# Screen temperature ("redness") setting - "$mod+y" = "mode "$mode_temp""; -set $mode_temp Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue -mode "$mode_temp" { - "r" = "exec sct 1000"; - "d" = "exec sct 2000"; - "c" = "exec sct 4500"; - "o" = "exec sct"; - "a" = "exec sct 8000"; - "b" = "exec sct 10000"; - - # back to normal: Enter or Escape - "Return" = "mode "default""; - "Escape" = "mode "default""; -} - - # Inactivity settings exec --no-startup-id xautolock -time 10 -locker 'xset dpms force standby' -killtime 1 -killer '$locker' "$mod+F1" = "exec --no-startup-id sh -c "sleep .25 && xset dpms force off""; diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 80fcc15..b3a22be 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -49,6 +49,7 @@ mode_pres_main = "Presentation (main display)"; mode_pres_sec = "Presentation (secondary display)"; mode_screen = "Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default"; + mode_temp = "Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue"; in { terminal = "alacritty"; @@ -208,6 +209,7 @@ "${mod}+r" = "mode ${mode_resize}"; "${mod}+Shift+p" = "mode ${mode_pres_main}"; "${mod}+t" = "mode ${mode_screen}"; + "${mod}+y" = "mode ${mode_temp}"; }; modes = let return_bindings = { "Return" = "mode default"; @@ -257,6 +259,14 @@ "r" = "exec ${autorandrmenu {title="Remove profile"; option="--remove";}}, mode default"; "d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default"; } // return_bindings; + "${mode_temp}" = { + "r" = "exec ${pkgs.sct}/bin/sct 1000"; + "d" = "exec ${pkgs.sct}/bin/sct 2000"; + "c" = "exec ${pkgs.sct}/bin/sct 4500"; + "o" = "exec ${pkgs.sct}/bin/sct"; + "a" = "exec ${pkgs.sct}/bin/sct 8000"; + "b" = "exec ${pkgs.sct}/bin/sct 10000"; + } // return_bindings; }; }; }; @@ -361,7 +371,6 @@ xclip lemonbar-xft keynav - sct xorg.xinit xorg.xbacklight From 5f1915c4d049f526c5eafa7dc78af1315cfdd128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 5 Nov 2023 14:32:01 +0100 Subject: [PATCH 034/108] nix: i3: Finish --- .../roles/desktop_environment/tasks/main.yml | 33 ----- config/i3/.gitignore | 2 - config/i3/config.j2 | 90 ------------- .../batteryNotify => nix/hm/batteryNotify.sh} | 6 +- config/nix/hm/desktop.nix | 122 +++++++++++++----- 5 files changed, 91 insertions(+), 162 deletions(-) delete mode 100644 config/i3/.gitignore delete mode 100644 config/i3/config.j2 rename config/{i3/batteryNotify => nix/hm/batteryNotify.sh} (92%) diff --git a/config/automatrop/roles/desktop_environment/tasks/main.yml b/config/automatrop/roles/desktop_environment/tasks/main.yml index fa9f9da..3a5c159 100644 --- a/config/automatrop/roles/desktop_environment/tasks/main.yml +++ b/config/automatrop/roles/desktop_environment/tasks/main.yml @@ -60,39 +60,6 @@ - color - i3 -- name: Download base16 theme for Tridactyl - ansible.builtin.copy: - content: "{{ base16_schemes['schemes'][base16_scheme]['tridactyl']['base16-' + base16_scheme + '.config.py'] }}" - # url: "https://raw.githubusercontent.com/bezmi/base16-tridactyl/master/base16-{{ base16_scheme }}.css" - dest: "{{ ansible_env.HOME }}/.config/tridactyl/themes/theme.css" - mode: u=rw,g=r,o=r - when: false # Not currently used - tags: - - color - -- name: Configure i3 - ansible.builtin.template: - src: "{{ ansible_env.HOME }}/.config/i3/config.j2" - dest: "{{ ansible_env.HOME }}/.config/i3/config" - mode: u=rw,g=r,o=r - notify: - - i3-reload - tags: - - color - - i3 - when: display_server == 'x11' - -- name: Set base16 theme for rofi - ansible.builtin.copy: - content: "{{ base16_schemes['schemes'][base16_scheme]['rofi']['themes']['base16-' + base16_scheme + '.' + item] }}" - dest: "{{ ansible_env.HOME }}/.config/rofi/theme.{{ item }}" - mode: u=rw,g=r,o=r - tags: - - color - loop: - - config - - rasi - - name: Configure Dunst ansible.builtin.template: src: "{{ ansible_env.HOME }}/.config/dunst/dunstrc.j2" diff --git a/config/i3/.gitignore b/config/i3/.gitignore deleted file mode 100644 index d981efa..0000000 --- a/config/i3/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -config -theme diff --git a/config/i3/config.j2 b/config/i3/config.j2 deleted file mode 100644 index 49075f3..0000000 --- a/config/i3/config.j2 +++ /dev/null @@ -1,90 +0,0 @@ -# vi:syntax=conf -# i3 config file (v4) -# Please see http://i3wm.org/docs/userguide.html for a complete reference! - -# Set mod key (Mod1=, Mod4=) -set $mod Mod4 - -# set default desktop layout (default is tiling) -# workspace_layout tabbed - -# Configure border style -new_window pixel 2 -new_float normal - -# Hide borders -hide_edge_borders both - - - - - -mouse_warping output - - - - - - -# Workspace names -set $WS1 1 -set $WS2 2 -set $WS3 3 -set $WS4 4 -set $WS5 5 -set $WS6 6 -set $WS7 7 -set $WS8 8 -set $WS9 9 -set $WS10 10 - -# Workspace output -{% set screens = x11_screens | default(['DEFAULT']) %} -{% for i in range(1, 11) %} -workspace "$WS{{ i }}" output {{ screens[(i - 1) % (screens | length)] }} -{% endfor %} - - - -# Default layout = tabs, since I mostly exclusively use them -workspace_layout tabbed - -# Open specific applications in floating mode -for_window [title="pacmixer"] floating enable border pixel 2 -for_window [class="Firefox"] layout tabbed # Doesn't seem to work anymore -for_window [class="qutebrowser"] layout tabbed - -for_window [window_role="pop-up"] floating enable -for_window [window_role="task_dialog"] floating enable -for_window [ title="^pdfpc.*" window_role="presenter" ] move to output left, fullscreen -for_window [ title="^pdfpc.*" window_role="presentation" ] move to output right, fullscreen - -# switch to workspace with urgent window automatically -for_window [urgent=latest] focus - -# Set shut down, restart and locking features -set $locker $HOME/.config/i3/lock - -# Inactivity settings -exec --no-startup-id xautolock -time 10 -locker 'xset dpms force standby' -killtime 1 -killer '$locker' - "$mod+F1" = "exec --no-startup-id sh -c "sleep .25 && xset dpms force off""; - "$mod+F4" = "exec --no-startup-id xautolock -disable"; - "$mod+F5" = "exec --no-startup-id xautolock -enable"; - - -# Autostart applications -#exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # Password remembering -#exec --no-startup-id gnome-keyring-daemon # Password remembering -# exec --no-startup-id urxvtd -q -f # urxvt daemon -{% if auto_numlock %} -exec --no-startup-id numlockx on # Activate Num lock -{% endif %} -exec --no-startup-id unclutter -root # Hide mouse cursor after some time -#exec --no-startup-id dunst # Notifications (handled by systemd) -exec --no-startup-id keynav # Keyboard cursor controller -#exec --no-startup-id mpd # Music Player Daemon (handled by systemd) -exec --no-startup-id autorandr --change --force # Screen configuration and everything that depends on it -{% if has_battery %} -exec --no-startup-id ~/.config/i3/batteryNotify -d # Battery state notification -{% endif %} - diff --git a/config/i3/batteryNotify b/config/nix/hm/batteryNotify.sh similarity index 92% rename from config/i3/batteryNotify rename to config/nix/hm/batteryNotify.sh index a6a1ed2..73376a5 100755 --- a/config/i3/batteryNotify +++ b/config/nix/hm/batteryNotify.sh @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - BATT="/sys/class/power_supply/BAT0" LOW=10 CRIT=3 @@ -25,10 +23,10 @@ function computeState() { if [ "$acpiStatus" == "Discharging" ] then - if [ $acpiCapacity -le $CRIT ] + if [ "$acpiCapacity" -le $CRIT ] then setState "CRIT" -u critical -i battery-caution "Battery level is critical" "$acpiCapacity %" - elif [ $acpiCapacity -le $LOW ] + elif [ "$acpiCapacity" -le $LOW ] then setState "LOW" -u critical -i battery-low "Battery level is low" "$acpiCapacity %" else diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index b3a22be..ab6ef78 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -9,32 +9,31 @@ lockColors = { a = "#82a401"; b = "#466c01"; d = "#648901"; }; # Old lockSvg = pkgs.writeText "lock.svg" ""; lockPng = pkgs.runCommand "lock.png" { } "${pkgs.imagemagick}/bin/convert ${lockSvg} $out"; - locker = "exec ${ pkgs.writeShellScript "i3-locker" - '' - # Remove SSH and GPG keys from keystores - ${pkgs.openssh}/bin/ssh-add -D - echo RELOADAGENT | ${pkgs.gnupg}/bin/gpg-connect-agent - ${pkgs.coreutils}/bin/rm -rf "/tmp/cached_pass_$UID" + locker = pkgs.writeShellScript "i3-locker" + '' + # Remove SSH and GPG keys from keystores + ${pkgs.openssh}/bin/ssh-add -D + echo RELOADAGENT | ${pkgs.gnupg}/bin/gpg-connect-agent + ${pkgs.coreutils}/bin/rm -rf "/tmp/cached_pass_$UID" - ${pkgs.lightdm}/bin/dm-tool lock - # TODO Does that work for all DMs? - if [ $? -ne 0 ]; then - if [ -d ${config.xdg.cacheHome}/lockpatterns ] - then - pattern=$(${pkgs.findutils} ${config.xdg.cacheHome}/lockpatterns | sort -R | head -1) - else - pattern=${lockPng} - fi - revert() { - ${pkgs.xorg.xset} dpms 0 0 0 - } - trap revert SIGHUP SIGINT SIGTERM - ${pkgs.xorg.xset} dpms 5 5 5 - ${pkgs.i3lock}/bin/i3lock --nofork --color ${builtins.substring 1 6 lockColors.d} --image=$pattern --tiling --ignore-empty-password - revert - fi - '' - }"; + ${pkgs.lightdm}/bin/dm-tool lock + # TODO Does that work for all DMs? + if [ $? -ne 0 ]; then + if [ -d ${config.xdg.cacheHome}/lockpatterns ] + then + pattern=$(${pkgs.findutils} ${config.xdg.cacheHome}/lockpatterns | sort -R | head -1) + else + pattern=${lockPng} + fi + revert() { + ${pkgs.xorg.xset}/bin/xset dpms 0 0 0 + } + trap revert SIGHUP SIGINT SIGTERM + ${pkgs.xorg.xset}/bin/xset dpms 5 5 5 + ${pkgs.i3lock}/bin/i3lock --nofork --color ${builtins.substring 1 6 lockColors.d} --image=$pattern --tiling --ignore-empty-password + revert + fi + ''; focus = "exec ${ pkgs.writeShellScript "i3-focus-window" '' WINDOW=`${pkgs.xdotool}/bin/xdotool getwindowfocus` @@ -52,6 +51,7 @@ mode_temp = "Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue"; in { + modifier = "Mod1"; # FIXME Mod1 for VM, Mod4 for not VM terminal = "alacritty"; # bars = []; # FIXME lemonbar colors = let ignore = "#ff00ff"; in @@ -77,7 +77,7 @@ # Compatibility layer for people coming from other backgrounds # "Mod1+Tab" = "${rofi} -modi window -show window"; # FIXME When no longer using a VM "Mod1+F2" = "${rofi} -modi drun -show drun"; - "Mod1+F4" = "kill"; + # "Mod1+F4" = "kill"; # FIXME When no longer using a VM # kill focused window "${mod}+z" = "kill"; button2 = "kill"; @@ -163,6 +163,7 @@ "${mod}+8" = "workspace 8; ${focus}"; "${mod}+9" = "workspace 9; ${focus}"; "${mod}+0" = "workspace 10; ${focus}"; + # TODO Prevent repetitions, see workspace assignation for example #navigate workspaces next / previous "${mod}+Ctrl+h" = "workspace prev_on_output; ${focus}"; "${mod}+Ctrl+l" = "workspace next_on_output; ${focus}"; @@ -204,6 +205,11 @@ "${mod}+Shift+c" = "reload"; "${mod}+Shift+r" = "restart"; "${mod}+Shift+e" = "exit"; + # Screen off commands + "${mod}+F1" = "exec --no-startup-id ${pkgs.bash}/bin/sh -c \"${pkgs.coreutils}/bin/sleep .25 && ${pkgs.xorg.xset}/bin/xset dpms force off\""; + # TODO --release? + "${mod}+F4" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -disable"; + "${mod}+F5" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -enable"; # Modes "${mod}+Escape" = "mode ${mode_system}"; "${mod}+r" = "mode ${mode_resize}"; @@ -217,10 +223,10 @@ }; in { "${mode_system}" = { - "l" = "exec --no-startup-id ${locker}, mode default"; + "l" = "exec --no-startup-id exec ${locker}, mode default"; "e" = "exit, mode default"; - "s" = "exec --no-startup-id ${locker} & ${pkgs.systemd}/bin/systemctl suspend, mode default"; - "h" = "exec --no-startup-id ${locker} & ${pkgs.systemd}/bin/systemctl hibernate, mode default"; + "s" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl suspend, mode default"; + "h" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl hibernate, mode default"; "r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default"; "p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default"; } // return_bindings; @@ -268,8 +274,53 @@ "b" = "exec ${pkgs.sct}/bin/sct 10000"; } // return_bindings; }; + window = { + hideEdgeBorders = "both"; + titlebar = false; # So that single-container screens are basically almost fullscreen + commands = [ + # Open specific applications in floating mode + { criteria = { class = "Firefox"; }; command = "layout tabbed"; } # Doesn't seem to work anymore + { criteria = { class = "qutebrowser"; }; command = "layout tabbed"; } + { criteria = { title = "^pdfpc.*"; window_role = "presenter"; }; command = "move to output left, fullscreen"; } + { criteria = { title = "^pdfpc.*"; window_role = "presentation"; }; command = "move to output right, fullscreen"; } + # switch to workspace with urgent window automatically + { criteria = { urgent = "latest"; }; command = "focus"; } + ]; + }; + floating = { + criteria = [ + { title = "pacmixer"; } + { window_role = "pop-up"; } + { window_role = "task_dialog"; } + ]; + }; + startup = [ + # Lock screen after 10 minutes + { notification = false; command = "${pkgs.xautolock}/bin/xautolock -time 10 -locker '${pkgs.xorg.xset}/bin/xset dpms force standby' -killtime 1 -killer ${locker}"; } + { + notification = false; + command = "${pkgs.writeShellApplication { + name = "batteryNotify"; + runtimeInputs = with pkgs; [coreutils libnotify]; + text = builtins.readFile ./batteryNotify.sh; + # TODO Use batsignal instead? + # TODO Only on computers with battery + }}/bin/batteryNotify"; + } + # TODO There's a services.screen-locker.xautolock but not sure it can match the above command + ]; + workspaceLayout = "tabbed"; + focus.mouseWarping = true; # i3 only supports warping to workspace, hence ${focus} + workspaceOutputAssign = + let + x11_screens = [ "HDMI-1-0" "eDP1" ]; # FIXME Per computer thing + workspaces = map (i: { name = toString i; key = toString (lib.mod i 10); }) (lib.lists.range 1 10); + forEachWorkspace = f: map (w: f { w = w; workspace = ((builtins.elemAt workspaces w)); }) (lib.lists.range 0 ((builtins.length workspaces) - 1)); + in + forEachWorkspace ({ w, workspace }: { output = builtins.elemAt x11_screens (lib.mod w (builtins.length x11_screens)); workspace = workspace.name; }); }; }; + xsession.numlock.enable = true; # FIXME Only on computers with a separate one programs = { # Browser @@ -323,6 +374,15 @@ enable = true; pass.enable = true; }; + autorandr.enable = true; + }; + + xdg.userDirs.enable = true; # TODO Which ones do we want? + services = { + unclutter.enable = true; + dunst.enable = true; + mpd.enable = true; + autorandr.enable = true; }; home.packages = with pkgs; [ @@ -330,7 +390,6 @@ tigervnc # music - mpd mpc-cli ashuffle vimpc @@ -361,13 +420,10 @@ yubikey-touch-detector # x11-exclusive - dunst numlockx # TODO urxvt-resize-font-git simplescreenrecorder trayer - unclutter - xautolock xclip lemonbar-xft keynav From c696da568d55d1a3dc48b37dc6d1c5ea7a8e0a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 5 Nov 2023 15:52:09 +0100 Subject: [PATCH 035/108] nix: Add dunst --- .../roles/desktop_environment/tasks/main.yml | 9 --- config/dunst/.gitignore | 2 - config/dunst/dunstrc.j2 | 65 ------------------- config/nix/hm/desktop.nix | 51 ++++++++++++++- 4 files changed, 49 insertions(+), 78 deletions(-) delete mode 100644 config/dunst/.gitignore delete mode 100644 config/dunst/dunstrc.j2 diff --git a/config/automatrop/roles/desktop_environment/tasks/main.yml b/config/automatrop/roles/desktop_environment/tasks/main.yml index 3a5c159..748a00a 100644 --- a/config/automatrop/roles/desktop_environment/tasks/main.yml +++ b/config/automatrop/roles/desktop_environment/tasks/main.yml @@ -60,15 +60,6 @@ - color - i3 -- name: Configure Dunst - ansible.builtin.template: - src: "{{ ansible_env.HOME }}/.config/dunst/dunstrc.j2" - dest: "{{ ansible_env.HOME }}/.config/dunst/dunstrc" - mode: u=rw,g=r,o=r - tags: - - color - when: display_server == 'x11' - - name: Download base16 theme for fzf ansible.builtin.copy: content: "{{ base16_schemes['schemes'][base16_scheme]['fzf']['bash']['base16-' + base16_scheme + '.config'] }}" diff --git a/config/dunst/.gitignore b/config/dunst/.gitignore deleted file mode 100644 index 93fb535..0000000 --- a/config/dunst/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -dunstrc -theme diff --git a/config/dunst/dunstrc.j2 b/config/dunst/dunstrc.j2 deleted file mode 100644 index 2fb355e..0000000 --- a/config/dunst/dunstrc.j2 +++ /dev/null @@ -1,65 +0,0 @@ -[global] - alignment = left - always_run_script = true - browser = /usr/bin/qutebrowser - class = Dunst - dmenu = /usr/bin/dmenu -p dunst: - ellipsize = middle - follow = none - font = DejaVu Sans 10 - force_xinerama = false - format = "%s %p\n%b" - frame_color = "#A6E22E" - frame_width = 3 - geometry = "500x5-30+20" - hide_duplicate_count = false - history_length = 20 - horizontal_padding = 8 - icon_path = /usr/share/icons/gnome/256x256/actions/:/usr/share/icons/gnome/256x256/status/:/usr/share/icons/gnome/256x256/devices/ - icon_position = left - idle_threshold = 120 - ignore_newline = no - indicate_hidden = yes - line_height = 0 - markup = full - max_icon_size = 48 - monitor = 0 - notification_height = 0 - padding = 8 - separator_color = frame - separator_height = 2 - show_age_threshold = 60 - show_indicators = yes - shrink = no - sort = yes - stack_duplicates = true - startup_notification = false - sticky_history = yes - title = Dunst - transparency = 0 - verbosity = mesg - word_wrap = yes -[experimental] - per_monitor_dpi = false -[shortcuts] - close_all = ctrl+mod4+n - close = mod4+n - context = mod1+mod4+n - history = shift+mod4+n -[urgency_low] - background = "#272822" - foreground = "#F8F8F2" - frame_color = "#A6E22E" - timeout = 10 -[urgency_normal] - background = "#272822" - foreground = "#F8F8F2" - frame_color = "#F4BF75" - timeout = 10 -[urgency_critical] - background = "#272822" - foreground = "#F8F8F2" - frame_color = "#F92672" - timeout = 0 -{{ base16_schemes['schemes'][base16_scheme]['dunst']['themes']['base16-' + base16_scheme + '.dunstrc'] }} -# TODO Not used. Not sure how it's supposed to be used :D diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index ab6ef78..7622f92 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -377,10 +377,57 @@ autorandr.enable = true; }; - xdg.userDirs.enable = true; # TODO Which ones do we want? + xdg = { + mimeApps = { + enable = true; + associations.added = { + "text/html" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop"; + }; + }; + userDirs.enable = true; # TODO Which ones do we want? + }; services = { unclutter.enable = true; - dunst.enable = true; + dunst = + { + enable = true; + settings = + # TODO Change dmenu for rofi, so we can use context + with config.lib.stylix.colors.withHashtag; { + global = { + separator_color = lib.mkForce base05; + idle_threshold = 120; + markup = "full"; + max_icon_size = 48; + # TODO Those shortcuts don't seem to work, maybe try: + # > define shortcuts inside your window manager and bind them to dunstctl(1) commands + close_all = "ctrl+mod4+n"; + close = "mod4+n"; + context = "mod1+mod4+n"; + history = "shift+mod4+n"; + }; + + urgency_low = { + background = lib.mkForce base01; + foreground = lib.mkForce base03; + frame_color = lib.mkForce base05; + }; + urgency_normal = { + background = lib.mkForce base02; + foreground = lib.mkForce base05; + frame_color = lib.mkForce base05; + }; + urgency_critical = { + background = lib.mkForce base08; + foreground = lib.mkForce base06; + frame_color = lib.mkForce base05; + }; + }; + }; mpd.enable = true; autorandr.enable = true; }; From 832ce41b8e210d281281152ca387b11340d96475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 5 Nov 2023 16:43:01 +0100 Subject: [PATCH 036/108] nix: Finish desktop environment --- config/automatrop/playbooks/default.yml | 7 -- .../desktop_environment/default/main.yml | 1 - .../desktop_environment/handlers/main.yml | 10 -- .../roles/desktop_environment/tasks/main.yml | 106 ------------------ config/automatrop/roles/termux/tasks/main.yml | 10 +- config/lemonbar/display.py | 2 +- config/nix/hm/common.nix | 2 + config/polybar/config | 5 +- 8 files changed, 6 insertions(+), 137 deletions(-) delete mode 100644 config/automatrop/roles/desktop_environment/default/main.yml delete mode 100644 config/automatrop/roles/desktop_environment/handlers/main.yml delete mode 100644 config/automatrop/roles/desktop_environment/tasks/main.yml diff --git a/config/automatrop/playbooks/default.yml b/config/automatrop/playbooks/default.yml index b7760c4..e9da6a0 100644 --- a/config/automatrop/playbooks/default.yml +++ b/config/automatrop/playbooks/default.yml @@ -10,16 +10,9 @@ when: root_access - role: dotfiles tags: dotfiles - - role: mnussbaum.base16-builder-ansible # Required for desktop_environment - tags: - - color - - desktop_environment - role: termux tags: termux when: termux - - role: desktop_environment - tags: desktop_environment - when: display_server - role: extensions tags: extensions # TODO Dependencies diff --git a/config/automatrop/roles/desktop_environment/default/main.yml b/config/automatrop/roles/desktop_environment/default/main.yml deleted file mode 100644 index aaaf42b..0000000 --- a/config/automatrop/roles/desktop_environment/default/main.yml +++ /dev/null @@ -1 +0,0 @@ -base16_scheme: solarized-dark diff --git a/config/automatrop/roles/desktop_environment/handlers/main.yml b/config/automatrop/roles/desktop_environment/handlers/main.yml deleted file mode 100644 index c8b25b0..0000000 --- a/config/automatrop/roles/desktop_environment/handlers/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: I3-reload - ansible.builtin.command: i3-msg reload - listen: i3-reload -- name: Shell-reload - ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApply" - listen: shell-reload -- name: Fzf-reload - ansible.builtin.shell: source {{ ansible_env.HOME }}/.local/bin/colorSchemeApplyFzf - listen: fzf-reload diff --git a/config/automatrop/roles/desktop_environment/tasks/main.yml b/config/automatrop/roles/desktop_environment/tasks/main.yml deleted file mode 100644 index 748a00a..0000000 --- a/config/automatrop/roles/desktop_environment/tasks/main.yml +++ /dev/null @@ -1,106 +0,0 @@ ---- -- name: Ensure directories for desktop applications are present - ansible.builtin.file: - state: directory - path: "{{ ansible_user_dir }}/{{ item }}" - mode: u=rwx,g=rx,o=rx - with_items: - - .config/Xresources - - .config/rofi - - .local/bin - - .local/share/fonts - - .config/qutebrowser - - .config/tridactyl/themes - -# Download fonts -- name: Download Nerd fonts - ansible.builtin.get_url: - url: https://raw.githubusercontent.com/ryanoasis/nerd-fonts/704336735f576781b2a57b12a0c723e3316cbdec/patched-fonts/DejaVuSansMono/{{ item.folder }}/complete/{{ - item.filename | urlencode }} - dest: "{{ ansible_user_dir }}/.local/share/fonts/{{ item.filename }}" - mode: u=rw,g=r,o=r - loop: - - filename: DejaVu Sans Mono Bold Nerd Font Complete Mono.ttf - folder: Bold - - filename: DejaVu Sans Mono Bold Oblique Nerd Font Complete Mono.ttf - folder: Bold-Italic - - filename: DejaVu Sans Mono Nerd Font Complete Mono.ttf - folder: Regular - - filename: DejaVu Sans Mono Oblique Nerd Font Complete Mono.ttf - folder: Italic - -- name: Download icon fonts - ansible.builtin.get_url: - url: https://raw.githubusercontent.com/FortAwesome/Font-Awesome/a8386aae19e200ddb0f6845b5feeee5eb7013687/fonts/fontawesome-webfont.ttf - dest: "{{ ansible_user_dir }}/.local/share/fonts/fontawesome-webfont.ttf" - mode: u=rw,g=r,o=r -# TODO Either replace with ForkAwesome or Nerd Fonts - -- name: Install python dependencies for lemonbar - ansible.builtin.pip: - requirements: "{{ ansible_user_dir }}/.dotfiles/config/lemonbar/requirements.txt" - extra_args: --break-system-packages # It's fine, it's local anyways - -# Build a single color scheme and template and assign it to a variable -- base16_builder: - scheme: "{{ base16_scheme }}" - template: # This requires https://github.com/mnussbaum/base16-builder-ansible/pull/6 - - i3 - - xresources - - rofi - - alacritty - - shell - - fzf - - vim - - qutebrowser - - tridactyl - - dunst - register: base16_schemes - tags: - - color - - i3 - -- name: Download base16 theme for fzf - ansible.builtin.copy: - content: "{{ base16_schemes['schemes'][base16_scheme]['fzf']['bash']['base16-' + base16_scheme + '.config'] }}" - dest: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApplyFzf" - mode: u=rw,g=r,o=r - notify: - - fzf-reload - tags: - - color - -- name: Download base16 theme for shell - ansible.builtin.copy: - content: "{{ base16_schemes['schemes'][base16_scheme]['shell']['script']['base16-' + base16_scheme + '.sh'] }}" - dest: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApply" - mode: u=rwx,g=rx,o=rx - notify: - - shell-reload - when: false # Not currently used - tags: - - color - -- name: Set used base16 theme for vim - ansible.builtin.copy: - path: "{{ ansible_env.HOME }}/.config/vim/colorscheme.vim" - mode: u=rw,g=r,o=r - content: colorscheme base16-{{ base16_scheme }} - when: false # Not currently used - tags: - - color - -- name: Enable user services - ansible.builtin.systemd: - name: "{{ item }}" - state: started - enabled: true - scope: user - loop: - - pulseaudio - - mpd - when: has_systemd - -# TODO bar (might change bar in the future, so...) -# TODO highlight (there IS a template but the colors look different from vim and mostly the same from when there's no config) -# TODO https://github.com/makuto/auto-base16-theme ? :P diff --git a/config/automatrop/roles/termux/tasks/main.yml b/config/automatrop/roles/termux/tasks/main.yml index 8656d6d..35504f6 100644 --- a/config/automatrop/roles/termux/tasks/main.yml +++ b/config/automatrop/roles/termux/tasks/main.yml @@ -13,15 +13,7 @@ path: "{{ ansible_user_dir }}/.hushlogin" mode: u=rw,g=r,o=r -# Build a single color scheme and template and assign it to a variable -- base16_builder: - scheme: "{{ base16_scheme }}" - template: # This requires https://github.com/mnussbaum/base16-builder-ansible/pull/6 - - termux - register: base16_schemes - tags: - - color - +# https://github.com/kdrag0n/base16-termux/blob/master/templates/default.mustache - name: Download base16 theme for Termux ansible.builtin.copy: content: "{{ base16_schemes['schemes'][base16_scheme]['termux']['colors']['base16-' + base16_scheme + '.properties'] }}" diff --git a/config/lemonbar/display.py b/config/lemonbar/display.py index fecdae1..a109e01 100755 --- a/config/lemonbar/display.py +++ b/config/lemonbar/display.py @@ -54,7 +54,7 @@ class Bar: """ # Constants - FONTS = ["DejaVuSansMono Nerd Font Mono", "Font Awesome"] + FONTS = ["DejaVuSansMono Nerd Font Mono"] FONTSIZE = 10 @staticmethod diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 017ed0f..bc454ed 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -50,6 +50,8 @@ trust = "ultimate"; }]; }; + fzf.enable = true; + # TODO highlight or bat }; home.packages = with pkgs; [ diff --git a/config/polybar/config b/config/polybar/config index 8927355..b3f1b77 100644 --- a/config/polybar/config +++ b/config/polybar/config @@ -51,9 +51,8 @@ padding-right = 2 module-margin-left = 1 module-margin-right = 1 -font-0 = "Font Awesome:size=10;0" -font-1 = "DejaVu Sans:size=10;0" -font-2 = "DejaVuSansMono Nerd Font Mono:pixelsize=10;0" +font-0 = "DejaVu Sans:size=10;0" +font-1 = "DejaVuSansMono Nerd Font Mono:pixelsize=10;0" modules-left = i3 From dff024a291ef9eb74720051bf1ea7ff283c3d57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 5 Nov 2023 21:32:31 +0100 Subject: [PATCH 037/108] nix: Reformat --- config/nix/hm/common.nix | 141 ++++---- config/nix/hm/desktop.nix | 670 +++++++++++++++++++------------------- 2 files changed, 409 insertions(+), 402 deletions(-) diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index bc454ed..7b0bdbb 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -1,6 +1,5 @@ { pkgs, config, ... }: { - home.stateVersion = "23.05"; programs = { home-manager.enable = true; @@ -53,83 +52,85 @@ fzf.enable = true; # TODO highlight or bat }; + home = { + stateVersion = "23.05"; + packages = with pkgs; [ + # dotfiles dependencies + coreutils + bash + gnugrep + gnused + gnutar + openssl + git + wget + curl + python3Packages.pip + ansible # TODO Reevaluate - home.packages = with pkgs; [ - # dotfiles dependencies - coreutils - bash - gnugrep - gnused - gnutar - openssl - git - wget - curl - python3Packages.pip - ansible # TODO Reevaluate + # shell + zsh-completions + nix-zsh-completions + zsh-history-substring-search + antigen # TODO Reevaluate + powerline-go - # shell - zsh-completions - nix-zsh-completions - zsh-history-substring-search - antigen # TODO Reevaluate - powerline-go + # terminal essentials + moreutils + man + visidata + nodePackages.insect + translate-shell + unzip + unrar + p7zip - # terminal essentials - moreutils - man - visidata - nodePackages.insect - translate-shell - unzip - unrar - p7zip + # remote + openssh + rsync + borgbackup - # remote - openssh - rsync - borgbackup + # cleanup + ncdu + jdupes + duperemove + optipng + libjpeg + # FIXME reflac not available (but also a dumb shell script) - # cleanup - ncdu - jdupes - duperemove - optipng - libjpeg - # FIXME reflac not available (but also a dumb shell script) + # local monitoring + htop + iotop + iftop + lsof + strace + pv + progress + speedtest-cli - # local monitoring - htop - iotop - iftop - lsof - strace - pv - progress - speedtest-cli + # multimedia toolbox + ffmpeg + sox + imagemagick - # multimedia toolbox - ffmpeg - sox - imagemagick + # password + pass + pwgen - # password - pass - pwgen + # Mail + isync + msmtp + notmuch + neomutt + lynx - # Mail - isync - msmtp - notmuch - neomutt - lynx + # Organisation + vdirsyncer + khard + khal + todoman + syncthing - # Organisation - vdirsyncer - khard - khal - todoman - syncthing - - ]; + ]; + }; } diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 7622f92..778ac39 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -1,40 +1,42 @@ { pkgs, config, lib, ... }: { - xsession.windowManager.i3 = { - enable = true; - config = - let - # lockColors = with config.lib.stylix.colors.withHashtag; { a = base00; b = base01; d = base00; }; # Black or White, depending on current theme - # lockColors = with config.lib.stylix.colors.withHashtag; { a = base0A; b = base0B; d = base00; }; # Green + Yellow - lockColors = { a = "#82a401"; b = "#466c01"; d = "#648901"; }; # Old - lockSvg = pkgs.writeText "lock.svg" ""; - lockPng = pkgs.runCommand "lock.png" { } "${pkgs.imagemagick}/bin/convert ${lockSvg} $out"; - locker = pkgs.writeShellScript "i3-locker" - '' - # Remove SSH and GPG keys from keystores - ${pkgs.openssh}/bin/ssh-add -D - echo RELOADAGENT | ${pkgs.gnupg}/bin/gpg-connect-agent - ${pkgs.coreutils}/bin/rm -rf "/tmp/cached_pass_$UID" + xsession = { + windowManager = { + i3 = { + enable = true; + config = + let + # lockColors = with config.lib.stylix.colors.withHashtag; { a = base00; b = base01; d = base00; }; # Black or White, depending on current theme + # lockColors = with config.lib.stylix.colors.withHashtag; { a = base0A; b = base0B; d = base00; }; # Green + Yellow + lockColors = { a = "#82a401"; b = "#466c01"; d = "#648901"; }; # Old + lockSvg = pkgs.writeText "lock.svg" ""; + lockPng = pkgs.runCommand "lock.png" { } "${pkgs.imagemagick}/bin/convert ${lockSvg} $out"; + locker = pkgs.writeShellScript "i3-locker" + '' + # Remove SSH and GPG keys from keystores + ${pkgs.openssh}/bin/ssh-add -D + echo RELOADAGENT | ${pkgs.gnupg}/bin/gpg-connect-agent + ${pkgs.coreutils}/bin/rm -rf "/tmp/cached_pass_$UID" - ${pkgs.lightdm}/bin/dm-tool lock - # TODO Does that work for all DMs? - if [ $? -ne 0 ]; then - if [ -d ${config.xdg.cacheHome}/lockpatterns ] - then - pattern=$(${pkgs.findutils} ${config.xdg.cacheHome}/lockpatterns | sort -R | head -1) - else - pattern=${lockPng} + ${pkgs.lightdm}/bin/dm-tool lock + # TODO Does that work for all DMs? + if [ $? -ne 0 ]; then + if [ -d ${config.xdg.cacheHome}/lockpatterns ] + then + pattern=$(${pkgs.findutils} ${config.xdg.cacheHome}/lockpatterns | sort -R | head -1) + else + pattern=${lockPng} + fi + revert() { + ${pkgs.xorg.xset}/bin/xset dpms 0 0 0 + } + trap revert SIGHUP SIGINT SIGTERM + ${pkgs.xorg.xset}/bin/xset dpms 5 5 5 + ${pkgs.i3lock}/bin/i3lock --nofork --color ${builtins.substring 1 6 lockColors.d} --image=$pattern --tiling --ignore-empty-password + revert fi - revert() { - ${pkgs.xorg.xset}/bin/xset dpms 0 0 0 - } - trap revert SIGHUP SIGINT SIGTERM - ${pkgs.xorg.xset}/bin/xset dpms 5 5 5 - ${pkgs.i3lock}/bin/i3lock --nofork --color ${builtins.substring 1 6 lockColors.d} --image=$pattern --tiling --ignore-empty-password - revert - fi - ''; - focus = "exec ${ pkgs.writeShellScript "i3-focus-window" + ''; + focus = "exec ${ pkgs.writeShellScript "i3-focus-window" '' WINDOW=`${pkgs.xdotool}/bin/xdotool getwindowfocus` eval `${pkgs.xdotool}/bin/xdotool getwindowgeometry --shell $WINDOW` # this brings in variables WIDTH and HEIGHT @@ -43,284 +45,286 @@ ${pkgs.xdotool}/bin/xdotool mousemove -window $WINDOW $TX $TY '' }"; - mode_system = "[L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction"; - mode_resize = "Resize"; - mode_pres_main = "Presentation (main display)"; - mode_pres_sec = "Presentation (secondary display)"; - mode_screen = "Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default"; - mode_temp = "Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue"; - in - { - modifier = "Mod1"; # FIXME Mod1 for VM, Mod4 for not VM - terminal = "alacritty"; - # bars = []; # FIXME lemonbar - colors = let ignore = "#ff00ff"; in - with config.lib.stylix.colors.withHashtag; lib.mkForce { - focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; }; - focusedInactive = { border = base02; background = base02; text = base05; indicator = base02; childBorder = base02; }; - unfocused = { border = base05; background = base04; text = base00; indicator = base04; childBorder = base00; }; - urgent = { border = base0F; background = base08; text = base00; indicator = base08; childBorder = base0F; }; - placeholder = { border = ignore; background = base00; text = base05; indicator = ignore; childBorder = base00; }; - background = base07; - # I set the color of the active tab as the the background color of the terminal so they merge together. - }; - focus.followMouse = false; - keybindings = - let - mod = config.xsession.windowManager.i3.config.modifier; - rofi = "exec --no-startup-id ${config.programs.rofi.package}/bin/rofi"; - pactl = "exec ${pkgs.pulseaudio}/bin/pactl"; # TODO Use NixOS package if using NixOS - scrot = "${pkgs.scrot}/bin/scrot --exec '${pkgs.coreutils}/bin/mv $f ~/Screenshots/ && ${pkgs.optipng}/bin/optipng ~/Screenshots/$f'"; - # TODO nix path and create directory? + mode_system = "[L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction"; + mode_resize = "Resize"; + mode_pres_main = "Presentation (main display)"; + mode_pres_sec = "Presentation (secondary display)"; + mode_screen = "Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default"; + mode_temp = "Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue"; in { - # Compatibility layer for people coming from other backgrounds - # "Mod1+Tab" = "${rofi} -modi window -show window"; # FIXME When no longer using a VM - "Mod1+F2" = "${rofi} -modi drun -show drun"; - # "Mod1+F4" = "kill"; # FIXME When no longer using a VM - # kill focused window - "${mod}+z" = "kill"; - button2 = "kill"; - # Rofi - "${mod}+c" = "exec --no-startup-id ${pkgs.rofi-pass}/bin/rofi-pass --last-used"; - # TODO Try autopass.cr - # 23.11 config.programs.rofi.pass.package - "${mod}+i" = "exec --no-startup-id ${pkgs.rofimoji}/bin/rofimoji"; - "${mod}+plus" = "${rofi} -modi ssh -show ssh"; - "${mod}+ù" = "${rofi} -modi ssh -show ssh -ssh-command '{terminal} -e {ssh-client} {host} -t \"sudo -s -E\"'"; - # TODO In which keyboard layout? - "${mod}+Tab" = "${rofi} -modi window -show window"; - # start program launcher - "${mod}+d" = "${rofi} -modi run -show run"; - "${mod}+Shift+d" = "${rofi} -modi drun -show drun"; - # Start Applications - "${mod}+Return" = "exec ${ + modifier = "Mod1"; # FIXME Mod1 for VM, Mod4 for not VM + terminal = "alacritty"; + # bars = []; # FIXME lemonbar + colors = let ignore = "#ff00ff"; in + with config.lib.stylix.colors.withHashtag; lib.mkForce { + focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; }; + focusedInactive = { border = base02; background = base02; text = base05; indicator = base02; childBorder = base02; }; + unfocused = { border = base05; background = base04; text = base00; indicator = base04; childBorder = base00; }; + urgent = { border = base0F; background = base08; text = base00; indicator = base08; childBorder = base0F; }; + placeholder = { border = ignore; background = base00; text = base05; indicator = ignore; childBorder = base00; }; + background = base07; + # I set the color of the active tab as the the background color of the terminal so they merge together. + }; + focus.followMouse = false; + keybindings = + let + mod = config.xsession.windowManager.i3.config.modifier; + rofi = "exec --no-startup-id ${config.programs.rofi.package}/bin/rofi"; + pactl = "exec ${pkgs.pulseaudio}/bin/pactl"; # TODO Use NixOS package if using NixOS + scrot = "${pkgs.scrot}/bin/scrot --exec '${pkgs.coreutils}/bin/mv $f ~/Screenshots/ && ${pkgs.optipng}/bin/optipng ~/Screenshots/$f'"; + # TODO nix path and create directory? + in + { + # Compatibility layer for people coming from other backgrounds + # "Mod1+Tab" = "${rofi} -modi window -show window"; # FIXME When no longer using a VM + "Mod1+F2" = "${rofi} -modi drun -show drun"; + # "Mod1+F4" = "kill"; # FIXME When no longer using a VM + # kill focused window + "${mod}+z" = "kill"; + button2 = "kill"; + # Rofi + "${mod}+c" = "exec --no-startup-id ${pkgs.rofi-pass}/bin/rofi-pass --last-used"; + # TODO Try autopass.cr + # 23.11 config.programs.rofi.pass.package + "${mod}+i" = "exec --no-startup-id ${pkgs.rofimoji}/bin/rofimoji"; + "${mod}+plus" = "${rofi} -modi ssh -show ssh"; + "${mod}+ù" = "${rofi} -modi ssh -show ssh -ssh-command '{terminal} -e {ssh-client} {host} -t \"sudo -s -E\"'"; + # TODO In which keyboard layout? + "${mod}+Tab" = "${rofi} -modi window -show window"; + # start program launcher + "${mod}+d" = "${rofi} -modi run -show run"; + "${mod}+Shift+d" = "${rofi} -modi drun -show drun"; + # Start Applications + "${mod}+Return" = "exec ${ pkgs.writeShellScript "terminal" "${config.programs.alacritty.package}/bin/alacritty msg create-window || exec ${config.programs.alacritty.package}/bin/alacritty -e zsh" # -e zsh is for systems where I can't configure my user's shell # TODO Is a shell script even required? }"; - "${mod}+Shift+Return" = "exec ${config.programs.urxvt.package}/bin/urxvt"; - "${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/tunar"; - "${mod}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore --backend=webengine"; - # TODO --backend not useful anymore - # Volume control - "XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; - "XF86AudioMute" = "${pactl} set-sink-mute @DEFAULT_SINK@ true"; - "${mod}+F7" = "${pactl} suspend-sink @DEFAULT_SINK@ 1; ${pactl} suspend-sink @DEFAULT_SINK@ 0"; # Re-synchronize bluetooth headset - "${mod}+F11" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; - "${mod}+F12" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; - # TODO Find pacmixer? - # Media control - "XF86AudioPrev" = "exec ${pkgs.mpc-cli}/bin/mpc prev"; - "XF86AudioPlay" = "exec ${pkgs.mpc-cli}/bin/mpc toggle"; - "XF86AudioNext" = "exec ${pkgs.mpc-cli}/bin/mpc next"; - # Misc - "${mod}+F10" = "exec ${ pkgs.writeShellScript "show-keyboard-layout" + "${mod}+Shift+Return" = "exec ${config.programs.urxvt.package}/bin/urxvt"; + "${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/tunar"; + "${mod}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore --backend=webengine"; + # TODO --backend not useful anymore + # Volume control + "XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; + "XF86AudioMute" = "${pactl} set-sink-mute @DEFAULT_SINK@ true"; + "${mod}+F7" = "${pactl} suspend-sink @DEFAULT_SINK@ 1; ${pactl} suspend-sink @DEFAULT_SINK@ 0"; # Re-synchronize bluetooth headset + "${mod}+F11" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; + "${mod}+F12" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; + # TODO Find pacmixer? + # Media control + "XF86AudioPrev" = "exec ${pkgs.mpc-cli}/bin/mpc prev"; + "XF86AudioPlay" = "exec ${pkgs.mpc-cli}/bin/mpc toggle"; + "XF86AudioNext" = "exec ${pkgs.mpc-cli}/bin/mpc next"; + # Misc + "${mod}+F10" = "exec ${ pkgs.writeShellScript "show-keyboard-layout" '' layout=`${pkgs.xorg.setxkbmap}/bin/setxkbmap -query | ${pkgs.gnugrep}/bin/grep ^layout: | ${pkgs.gawk}/bin/awk '{ print $2 }'` ${pkgs.libgnomekbd}/bin/gkbd-keyboard-display -l $layout '' }"; - # Screenshots - "Print" = "exec ${scrot} --focused"; - "${mod}+Print" = "exec ${scrot}"; # FIXME Doesn't work at least in the VM - "Ctrl+Print" = "exec ${pkgs.coreutils}/bin/sleep 1 && ${scrot} --select"; - # TODO Try using bindsym --release instead of sleep - # change focus - "${mod}+h" = "focus left; ${focus}"; - "${mod}+j" = "focus down; ${focus}"; - "${mod}+k" = "focus up; ${focus}"; - "${mod}+l" = "focus right; ${focus}"; - # move focused window - "${mod}+Shift+h" = "move left; ${focus}"; - "${mod}+Shift+j" = "move down; ${focus}"; - "${mod}+Shift+k" = "move up; ${focus}"; - "${mod}+Shift+l" = "move right; ${focus}"; - # workspace back and forth (with/without active container) - "${mod}+b" = "workspace back_and_forth; ${focus}"; - "${mod}+Shift+b" = "move container to workspace back_and_forth; workspace back_and_forth; ${focus}"; - # Change container layout - "${mod}+g" = "split h; ${focus}"; - "${mod}+v" = "split v; ${focus}"; - "${mod}+f" = "fullscreen toggle; ${focus}"; - "${mod}+s" = "layout stacking; ${focus}"; - "${mod}+w" = "layout tabbed; ${focus}"; - "${mod}+e" = "layout toggle split; ${focus}"; - "${mod}+Shift+space" = "floating toggle; ${focus}"; - # Focus container - "${mod}+space" = "focus mode_toggle; ${focus}"; - "${mod}+a" = "focus parent; ${focus}"; - "${mod}+q" = "focus child; ${focus}"; - # Switch to workspace - "${mod}+1" = "workspace 1; ${focus}"; - "${mod}+2" = "workspace 2; ${focus}"; - "${mod}+3" = "workspace 3; ${focus}"; - "${mod}+4" = "workspace 4; ${focus}"; - "${mod}+5" = "workspace 5; ${focus}"; - "${mod}+6" = "workspace 6; ${focus}"; - "${mod}+7" = "workspace 7; ${focus}"; - "${mod}+8" = "workspace 8; ${focus}"; - "${mod}+9" = "workspace 9; ${focus}"; - "${mod}+0" = "workspace 10; ${focus}"; - # TODO Prevent repetitions, see workspace assignation for example - #navigate workspaces next / previous - "${mod}+Ctrl+h" = "workspace prev_on_output; ${focus}"; - "${mod}+Ctrl+l" = "workspace next_on_output; ${focus}"; - "${mod}+Ctrl+j" = "workspace prev; ${focus}"; - "${mod}+Ctrl+k" = "workspace next; ${focus}"; - # Move to workspace next / previous with focused container - "${mod}+Ctrl+Shift+h" = "move container to workspace prev_on_output; workspace prev_on_output; ${focus}"; - "${mod}+Ctrl+Shift+l" = "move container to workspace next_on_output; workspace next_on_output; ${focus}"; - "${mod}+Ctrl+Shift+j" = "move container to workspace prev; workspace prev; ${focus}"; - "${mod}+Ctrl+Shift+k" = "move container to workspace next; workspace next; ${focus}"; - # move focused container to workspace - "${mod}+ctrl+1" = "move container to workspace 1; ${focus}"; - "${mod}+ctrl+2" = "move container to workspace 2; ${focus}"; - "${mod}+ctrl+3" = "move container to workspace 3; ${focus}"; - "${mod}+ctrl+4" = "move container to workspace 4; ${focus}"; - "${mod}+ctrl+5" = "move container to workspace 5; ${focus}"; - "${mod}+ctrl+6" = "move container to workspace 6; ${focus}"; - "${mod}+ctrl+7" = "move container to workspace 7; ${focus}"; - "${mod}+ctrl+8" = "move container to workspace 8; ${focus}"; - "${mod}+ctrl+9" = "move container to workspace 9; ${focus}"; - "${mod}+ctrl+0" = "move container to workspace 10; ${focus}"; - # move to workspace with focused container - "${mod}+shift+1" = "move container to workspace 1; workspace 1; ${focus}"; - "${mod}+shift+2" = "move container to workspace 2; workspace 2; ${focus}"; - "${mod}+shift+3" = "move container to workspace 3; workspace 3; ${focus}"; - "${mod}+shift+4" = "move container to workspace 4; workspace 4; ${focus}"; - "${mod}+shift+5" = "move container to workspace 5; workspace 5; ${focus}"; - "${mod}+shift+6" = "move container to workspace 6; workspace 6; ${focus}"; - "${mod}+shift+7" = "move container to workspace 7; workspace 7; ${focus}"; - "${mod}+shift+8" = "move container to workspace 8; workspace 8; ${focus}"; - "${mod}+shift+9" = "move container to workspace 9; workspace 9; ${focus}"; - "${mod}+shift+0" = "move container to workspace 10; workspace 10; ${focus}"; - # move workspaces to screen (arrow keys) - "${mod}+ctrl+shift+Right" = "move workspace to output right; ${focus}"; - "${mod}+ctrl+shift+Left" = "move workspace to output left; ${focus}"; - "${mod}+Ctrl+Shift+Up" = "move workspace to output above; ${focus}"; - "${mod}+Ctrl+Shift+Down" = "move workspace to output below; ${focus}"; - # i3 control - "${mod}+Shift+c" = "reload"; - "${mod}+Shift+r" = "restart"; - "${mod}+Shift+e" = "exit"; - # Screen off commands - "${mod}+F1" = "exec --no-startup-id ${pkgs.bash}/bin/sh -c \"${pkgs.coreutils}/bin/sleep .25 && ${pkgs.xorg.xset}/bin/xset dpms force off\""; - # TODO --release? - "${mod}+F4" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -disable"; - "${mod}+F5" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -enable"; - # Modes - "${mod}+Escape" = "mode ${mode_system}"; - "${mod}+r" = "mode ${mode_resize}"; - "${mod}+Shift+p" = "mode ${mode_pres_main}"; - "${mod}+t" = "mode ${mode_screen}"; - "${mod}+y" = "mode ${mode_temp}"; - }; - modes = let return_bindings = { - "Return" = "mode default"; - "Escape" = "mode default"; - }; in - { - "${mode_system}" = { - "l" = "exec --no-startup-id exec ${locker}, mode default"; - "e" = "exit, mode default"; - "s" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl suspend, mode default"; - "h" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl hibernate, mode default"; - "r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default"; - "p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default"; - } // return_bindings; - "${mode_resize}" = { - "h" = "resize shrink width 10 px or 10 ppt; ${focus}"; - "j" = "resize grow height 10 px or 10 ppt; ${focus}"; - "k" = "resize shrink height 10 px or 10 ppt; ${focus}"; - "l" = "resize grow width 10 px or 10 ppt; ${focus}"; - } // return_bindings; - "${mode_pres_main}" = { - "b" = "workspace 3, workspace 4, mode ${mode_pres_sec}"; - "q" = "mode default"; + # Screenshots + "Print" = "exec ${scrot} --focused"; + "${mod}+Print" = "exec ${scrot}"; # FIXME Doesn't work at least in the VM + "Ctrl+Print" = "exec ${pkgs.coreutils}/bin/sleep 1 && ${scrot} --select"; + # TODO Try using bindsym --release instead of sleep + # change focus + "${mod}+h" = "focus left; ${focus}"; + "${mod}+j" = "focus down; ${focus}"; + "${mod}+k" = "focus up; ${focus}"; + "${mod}+l" = "focus right; ${focus}"; + # move focused window + "${mod}+Shift+h" = "move left; ${focus}"; + "${mod}+Shift+j" = "move down; ${focus}"; + "${mod}+Shift+k" = "move up; ${focus}"; + "${mod}+Shift+l" = "move right; ${focus}"; + # workspace back and forth (with/without active container) + "${mod}+b" = "workspace back_and_forth; ${focus}"; + "${mod}+Shift+b" = "move container to workspace back_and_forth; workspace back_and_forth; ${focus}"; + # Change container layout + "${mod}+g" = "split h; ${focus}"; + "${mod}+v" = "split v; ${focus}"; + "${mod}+f" = "fullscreen toggle; ${focus}"; + "${mod}+s" = "layout stacking; ${focus}"; + "${mod}+w" = "layout tabbed; ${focus}"; + "${mod}+e" = "layout toggle split; ${focus}"; + "${mod}+Shift+space" = "floating toggle; ${focus}"; + # Focus container + "${mod}+space" = "focus mode_toggle; ${focus}"; + "${mod}+a" = "focus parent; ${focus}"; + "${mod}+q" = "focus child; ${focus}"; + # Switch to workspace + "${mod}+1" = "workspace 1; ${focus}"; + "${mod}+2" = "workspace 2; ${focus}"; + "${mod}+3" = "workspace 3; ${focus}"; + "${mod}+4" = "workspace 4; ${focus}"; + "${mod}+5" = "workspace 5; ${focus}"; + "${mod}+6" = "workspace 6; ${focus}"; + "${mod}+7" = "workspace 7; ${focus}"; + "${mod}+8" = "workspace 8; ${focus}"; + "${mod}+9" = "workspace 9; ${focus}"; + "${mod}+0" = "workspace 10; ${focus}"; + # TODO Prevent repetitions, see workspace assignation for example + #navigate workspaces next / previous + "${mod}+Ctrl+h" = "workspace prev_on_output; ${focus}"; + "${mod}+Ctrl+l" = "workspace next_on_output; ${focus}"; + "${mod}+Ctrl+j" = "workspace prev; ${focus}"; + "${mod}+Ctrl+k" = "workspace next; ${focus}"; + # Move to workspace next / previous with focused container + "${mod}+Ctrl+Shift+h" = "move container to workspace prev_on_output; workspace prev_on_output; ${focus}"; + "${mod}+Ctrl+Shift+l" = "move container to workspace next_on_output; workspace next_on_output; ${focus}"; + "${mod}+Ctrl+Shift+j" = "move container to workspace prev; workspace prev; ${focus}"; + "${mod}+Ctrl+Shift+k" = "move container to workspace next; workspace next; ${focus}"; + # move focused container to workspace + "${mod}+ctrl+1" = "move container to workspace 1; ${focus}"; + "${mod}+ctrl+2" = "move container to workspace 2; ${focus}"; + "${mod}+ctrl+3" = "move container to workspace 3; ${focus}"; + "${mod}+ctrl+4" = "move container to workspace 4; ${focus}"; + "${mod}+ctrl+5" = "move container to workspace 5; ${focus}"; + "${mod}+ctrl+6" = "move container to workspace 6; ${focus}"; + "${mod}+ctrl+7" = "move container to workspace 7; ${focus}"; + "${mod}+ctrl+8" = "move container to workspace 8; ${focus}"; + "${mod}+ctrl+9" = "move container to workspace 9; ${focus}"; + "${mod}+ctrl+0" = "move container to workspace 10; ${focus}"; + # move to workspace with focused container + "${mod}+shift+1" = "move container to workspace 1; workspace 1; ${focus}"; + "${mod}+shift+2" = "move container to workspace 2; workspace 2; ${focus}"; + "${mod}+shift+3" = "move container to workspace 3; workspace 3; ${focus}"; + "${mod}+shift+4" = "move container to workspace 4; workspace 4; ${focus}"; + "${mod}+shift+5" = "move container to workspace 5; workspace 5; ${focus}"; + "${mod}+shift+6" = "move container to workspace 6; workspace 6; ${focus}"; + "${mod}+shift+7" = "move container to workspace 7; workspace 7; ${focus}"; + "${mod}+shift+8" = "move container to workspace 8; workspace 8; ${focus}"; + "${mod}+shift+9" = "move container to workspace 9; workspace 9; ${focus}"; + "${mod}+shift+0" = "move container to workspace 10; workspace 10; ${focus}"; + # move workspaces to screen (arrow keys) + "${mod}+ctrl+shift+Right" = "move workspace to output right; ${focus}"; + "${mod}+ctrl+shift+Left" = "move workspace to output left; ${focus}"; + "${mod}+Ctrl+Shift+Up" = "move workspace to output above; ${focus}"; + "${mod}+Ctrl+Shift+Down" = "move workspace to output below; ${focus}"; + # i3 control + "${mod}+Shift+c" = "reload"; + "${mod}+Shift+r" = "restart"; + "${mod}+Shift+e" = "exit"; + # Screen off commands + "${mod}+F1" = "exec --no-startup-id ${pkgs.bash}/bin/sh -c \"${pkgs.coreutils}/bin/sleep .25 && ${pkgs.xorg.xset}/bin/xset dpms force off\""; + # TODO --release? + "${mod}+F4" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -disable"; + "${mod}+F5" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -enable"; + # Modes + "${mod}+Escape" = "mode ${mode_system}"; + "${mod}+r" = "mode ${mode_resize}"; + "${mod}+Shift+p" = "mode ${mode_pres_main}"; + "${mod}+t" = "mode ${mode_screen}"; + "${mod}+y" = "mode ${mode_temp}"; + }; + modes = let return_bindings = { "Return" = "mode default"; - }; - "${mode_pres_sec}" = { - "b" = "workspace 1, workspace 2, mode ${mode_pres_main}"; - "q" = "mode default"; - "Return" = "mode default"; - }; - "${mode_screen}" = - let - builtin_configs = [ "off" "common" "clone-largest" "horizontal" "vertical" "horizontal-reverse" "vertical-reverse" ]; - autorandrmenu = { title, option, builtin ? false }: pkgs.writeShellScript "autorandrmenu" - '' - shopt -s nullglob globstar - profiles="${if builtin then lib.strings.concatLines builtin_configs else ""}$(${pkgs.autorandr}/bin/autorandr | ${pkgs.gawk}/bin/awk '{ print $1 }')" - profile="$(echo "$profiles" | ${config.programs.rofi.package}/bin/rofi -dmenu -p "${title}")" - [[ -n "$profile" ]] || exit - ${pkgs.autorandr}/bin/autorandr ${option} "$profile" - ''; - in + "Escape" = "mode default"; + }; in { - "a" = "exec ${pkgs.autorandr}/bin/autorandr --change --force, mode default"; - "l" = "exec ${autorandrmenu {title="Load profile"; option="--load"; builtin = true;}}, mode default"; - "s" = "exec ${autorandrmenu {title="Save profile"; option="--save";}}, mode default"; - "r" = "exec ${autorandrmenu {title="Remove profile"; option="--remove";}}, mode default"; - "d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default"; - } // return_bindings; - "${mode_temp}" = { - "r" = "exec ${pkgs.sct}/bin/sct 1000"; - "d" = "exec ${pkgs.sct}/bin/sct 2000"; - "c" = "exec ${pkgs.sct}/bin/sct 4500"; - "o" = "exec ${pkgs.sct}/bin/sct"; - "a" = "exec ${pkgs.sct}/bin/sct 8000"; - "b" = "exec ${pkgs.sct}/bin/sct 10000"; - } // return_bindings; - }; - window = { - hideEdgeBorders = "both"; - titlebar = false; # So that single-container screens are basically almost fullscreen - commands = [ - # Open specific applications in floating mode - { criteria = { class = "Firefox"; }; command = "layout tabbed"; } # Doesn't seem to work anymore - { criteria = { class = "qutebrowser"; }; command = "layout tabbed"; } - { criteria = { title = "^pdfpc.*"; window_role = "presenter"; }; command = "move to output left, fullscreen"; } - { criteria = { title = "^pdfpc.*"; window_role = "presentation"; }; command = "move to output right, fullscreen"; } - # switch to workspace with urgent window automatically - { criteria = { urgent = "latest"; }; command = "focus"; } - ]; - }; - floating = { - criteria = [ - { title = "pacmixer"; } - { window_role = "pop-up"; } - { window_role = "task_dialog"; } - ]; - }; - startup = [ - # Lock screen after 10 minutes - { notification = false; command = "${pkgs.xautolock}/bin/xautolock -time 10 -locker '${pkgs.xorg.xset}/bin/xset dpms force standby' -killtime 1 -killer ${locker}"; } - { - notification = false; - command = "${pkgs.writeShellApplication { + "${mode_system}" = { + "l" = "exec --no-startup-id exec ${locker}, mode default"; + "e" = "exit, mode default"; + "s" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl suspend, mode default"; + "h" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl hibernate, mode default"; + "r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default"; + "p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default"; + } // return_bindings; + "${mode_resize}" = { + "h" = "resize shrink width 10 px or 10 ppt; ${focus}"; + "j" = "resize grow height 10 px or 10 ppt; ${focus}"; + "k" = "resize shrink height 10 px or 10 ppt; ${focus}"; + "l" = "resize grow width 10 px or 10 ppt; ${focus}"; + } // return_bindings; + "${mode_pres_main}" = { + "b" = "workspace 3, workspace 4, mode ${mode_pres_sec}"; + "q" = "mode default"; + "Return" = "mode default"; + }; + "${mode_pres_sec}" = { + "b" = "workspace 1, workspace 2, mode ${mode_pres_main}"; + "q" = "mode default"; + "Return" = "mode default"; + }; + "${mode_screen}" = + let + builtin_configs = [ "off" "common" "clone-largest" "horizontal" "vertical" "horizontal-reverse" "vertical-reverse" ]; + autorandrmenu = { title, option, builtin ? false }: pkgs.writeShellScript "autorandrmenu" + '' + shopt -s nullglob globstar + profiles="${if builtin then lib.strings.concatLines builtin_configs else ""}$(${pkgs.autorandr}/bin/autorandr | ${pkgs.gawk}/bin/awk '{ print $1 }')" + profile="$(echo "$profiles" | ${config.programs.rofi.package}/bin/rofi -dmenu -p "${title}")" + [[ -n "$profile" ]] || exit + ${pkgs.autorandr}/bin/autorandr ${option} "$profile" + ''; + in + { + "a" = "exec ${pkgs.autorandr}/bin/autorandr --change --force, mode default"; + "l" = "exec ${autorandrmenu {title="Load profile"; option="--load"; builtin = true;}}, mode default"; + "s" = "exec ${autorandrmenu {title="Save profile"; option="--save";}}, mode default"; + "r" = "exec ${autorandrmenu {title="Remove profile"; option="--remove";}}, mode default"; + "d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default"; + } // return_bindings; + "${mode_temp}" = { + "r" = "exec ${pkgs.sct}/bin/sct 1000"; + "d" = "exec ${pkgs.sct}/bin/sct 2000"; + "c" = "exec ${pkgs.sct}/bin/sct 4500"; + "o" = "exec ${pkgs.sct}/bin/sct"; + "a" = "exec ${pkgs.sct}/bin/sct 8000"; + "b" = "exec ${pkgs.sct}/bin/sct 10000"; + } // return_bindings; + }; + window = { + hideEdgeBorders = "both"; + titlebar = false; # So that single-container screens are basically almost fullscreen + commands = [ + # Open specific applications in floating mode + { criteria = { class = "Firefox"; }; command = "layout tabbed"; } # Doesn't seem to work anymore + { criteria = { class = "qutebrowser"; }; command = "layout tabbed"; } + { criteria = { title = "^pdfpc.*"; window_role = "presenter"; }; command = "move to output left, fullscreen"; } + { criteria = { title = "^pdfpc.*"; window_role = "presentation"; }; command = "move to output right, fullscreen"; } + # switch to workspace with urgent window automatically + { criteria = { urgent = "latest"; }; command = "focus"; } + ]; + }; + floating = { + criteria = [ + { title = "pacmixer"; } + { window_role = "pop-up"; } + { window_role = "task_dialog"; } + ]; + }; + startup = [ + # Lock screen after 10 minutes + { notification = false; command = "${pkgs.xautolock}/bin/xautolock -time 10 -locker '${pkgs.xorg.xset}/bin/xset dpms force standby' -killtime 1 -killer ${locker}"; } + { + notification = false; + command = "${pkgs.writeShellApplication { name = "batteryNotify"; runtimeInputs = with pkgs; [coreutils libnotify]; text = builtins.readFile ./batteryNotify.sh; # TODO Use batsignal instead? # TODO Only on computers with battery }}/bin/batteryNotify"; - } - # TODO There's a services.screen-locker.xautolock but not sure it can match the above command - ]; - workspaceLayout = "tabbed"; - focus.mouseWarping = true; # i3 only supports warping to workspace, hence ${focus} - workspaceOutputAssign = - let - x11_screens = [ "HDMI-1-0" "eDP1" ]; # FIXME Per computer thing - workspaces = map (i: { name = toString i; key = toString (lib.mod i 10); }) (lib.lists.range 1 10); - forEachWorkspace = f: map (w: f { w = w; workspace = ((builtins.elemAt workspaces w)); }) (lib.lists.range 0 ((builtins.length workspaces) - 1)); - in - forEachWorkspace ({ w, workspace }: { output = builtins.elemAt x11_screens (lib.mod w (builtins.length x11_screens)); workspace = workspace.name; }); + } + # TODO There's a services.screen-locker.xautolock but not sure it can match the above command + ]; + workspaceLayout = "tabbed"; + focus.mouseWarping = true; # i3 only supports warping to workspace, hence ${focus} + workspaceOutputAssign = + let + x11_screens = [ "HDMI-1-0" "eDP1" ]; # FIXME Per computer thing + workspaces = map (i: { name = toString i; key = toString (lib.mod i 10); }) (lib.lists.range 1 10); + forEachWorkspace = f: map (w: f { w = w; workspace = ((builtins.elemAt workspaces w)); }) (lib.lists.range 0 ((builtins.length workspaces) - 1)); + in + forEachWorkspace ({ w, workspace }: { output = builtins.elemAt x11_screens (lib.mod w (builtins.length x11_screens)); workspace = workspace.name; }); + }; }; + }; + numlock.enable = true; # FIXME Only on computers with a separate one }; - xsession.numlock.enable = true; # FIXME Only on computers with a separate one programs = { # Browser @@ -432,55 +436,57 @@ autorandr.enable = true; }; - home.packages = with pkgs; [ - # remote - tigervnc + home = { + packages = with pkgs; [ + # remote + tigervnc - # music - mpc-cli - ashuffle - vimpc + # music + mpc-cli + ashuffle + vimpc - # multimedia common - gimp - inkscape - mpv - mpvScripts.thumbnail - libreoffice + # multimedia common + gimp + inkscape + mpv + mpvScripts.thumbnail + libreoffice - # data management - freefilesync + # data management + freefilesync - # browsers - firefox + # browsers + firefox - # fonts - dejavu_fonts - twemoji-color-font - gnome.gedit - feh - zathura - zbar - zathura - meld - python3Packages.magic - yubikey-touch-detector + # fonts + dejavu_fonts + twemoji-color-font + gnome.gedit + feh + zathura + zbar + zathura + meld + python3Packages.magic + yubikey-touch-detector - # x11-exclusive - numlockx - # TODO urxvt-resize-font-git - simplescreenrecorder - trayer - xclip - lemonbar-xft - keynav - xorg.xinit - xorg.xbacklight + # x11-exclusive + numlockx + # TODO urxvt-resize-font-git + simplescreenrecorder + trayer + xclip + lemonbar-xft + keynav + xorg.xinit + xorg.xbacklight - # organisation - pass - thunderbird - ]; + # organisation + pass + thunderbird + ]; + }; } From 6d9d2078a68b0af09b47a504540a5c0cd3321dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 5 Nov 2023 21:36:11 +0100 Subject: [PATCH 038/108] nix: Make it work with standalone hm on Arch --- config/nix/hm/common.nix | 5 +++++ config/nix/hm/desktop.nix | 10 ++++++++++ config/nix/hm/style.nix | 5 ++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 7b0bdbb..e1de2bd 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -3,6 +3,7 @@ programs = { home-manager.enable = true; + bash.enable = true; # Just in case the default shell is not ZSH, so we still have the variables zsh = { enable = true; enableAutosuggestions = true; @@ -54,6 +55,10 @@ }; home = { stateVersion = "23.05"; + language = { + base = "en_US.UTF-8"; + time = "en_DK.UTF-8"; + }; packages = with pkgs; [ # dotfiles dependencies coreutils diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 778ac39..d1d136a 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -1,7 +1,9 @@ { pkgs, config, lib, ... }: { xsession = { + enable = true; windowManager = { + command = "${config.xsession.windowManager.i3.package}/bin/i3"; i3 = { enable = true; config = @@ -437,6 +439,14 @@ }; home = { + file = { + ".xinitrc" = { + source = pkgs.writeShellScript "xinitrc" '' + ${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path} + ${config.xsession.windowManager.command} + ''; + }; + }; packages = with pkgs; [ # remote tigervnc diff --git a/config/nix/hm/style.nix b/config/nix/hm/style.nix index 22162a6..06456ed 100644 --- a/config/nix/hm/style.nix +++ b/config/nix/hm/style.nix @@ -27,5 +27,8 @@ in }; # Fix https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal - home.packages = [ pkgs.dconf ]; + # home.packages = [ pkgs.dconf ]; + dconf.enable = false; # Otherwise standalone home-manager complains it can't find /etc/dbus-1/session.conf on Arch. + # Symlinking it to /usr/share/dbus-1/session.conf goes further but not much. + } From 8820d5edc4f7bace4a897cbee4c04bdc114d3a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 5 Nov 2023 21:37:36 +0100 Subject: [PATCH 039/108] nix: Add powerline-go for zsh --- config/nix/hm/common.nix | 21 ++++++++++++ config/shell/commonrc | 1 - config/shell/zshrc | 72 ---------------------------------------- 3 files changed, 21 insertions(+), 73 deletions(-) diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index e1de2bd..5d54b07 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -10,6 +10,27 @@ enableCompletion = true; enableSyntaxHighlighting = true; # syntaxHighlighting.enable = true; # 23.11 syntax + historySubstringSearch.enable = true; + initExtra = '' + # powerline-go duration support + zmodload zsh/datetime + function preexec() { + __TIMER=$EPOCHREALTIME + } + ''; + }; + powerline-go = { + enable = true; + modules = [ "user" "host" "venv" "cwd" "perms" "git" ]; + modulesRight = [ "jobs" "exit" "duration" "load" ]; + settings = { + colorize-hostname = true; + max-width = 25; + cwd-max-dir-size = 10; + duration = "$( test -n \"$__TIMER\" && echo $(( $EPOCHREALTIME - $\{__TIMER:-EPOCHREALTIME})) || echo 0 )"; + # UPST Implement this properly in home-manager + }; + extraUpdatePS1 = ''unset __TIMER''; }; # neovim = { # enable = true; diff --git a/config/shell/commonrc b/config/shell/commonrc index a0bf99e..15331c9 100644 --- a/config/shell/commonrc +++ b/config/shell/commonrc @@ -23,7 +23,6 @@ alias dmesg='dmesg --ctime' alias wget='wget --hsts-file $HOME/.cache/wget-hsts' # [ -f ~/.local/bin/colorSchemeApplyFzf ] && . ~/.local/bin/colorSchemeApplyFzf # Only applies RGB colors... -POWERLINE_GO_DEFAULT_OPTS=(-colorize-hostname -max-width 25 -cwd-max-dir-size 10 -modules 'user,host,venv,cwd,perms,git' -modules-right 'jobs,exit,duration,load') # For reading by shell profiles FZF_DEFAULT_OPTS="--height 40% --layout=default" FZF_CTRL_T_OPTS="--preview '[[ -d {} ]] && ls -l --color=always {} || [[ \$(file --mime {}) =~ binary ]] && file --brief {} || (highlight -O ansi -l {} || coderay {} || rougify {} || cat {}) 2> /dev/null | head -500'" FZF_COMPLETION_OPTS="${FZF_CTRL_T_OPTS}" diff --git a/config/shell/zshrc b/config/shell/zshrc index cc92c3b..96c7e31 100644 --- a/config/shell/zshrc +++ b/config/shell/zshrc @@ -5,79 +5,7 @@ # # TODO Learn `setopt extendedglob` -# TODO Add asdf (oh-my-zsh plugin is air, git clone is the way (aur package outdated)) -# Approximate RGB colors by terminal colors -[[ "$COLORTERM" == (24bit|truecolor) || "${terminfo[colors]}" -eq '16777216' ]] || zmodload zsh/nearcolor - -# Plugins -ADOTDIR=~/.cache/antigen -mkdir -p $ADOTDIR -typeset -a ANTIGEN_CHECK_FILES=(~/.config/shell/zshrc) - -if [ -f /usr/share/zsh/share/antigen.zsh ] -then - source /usr/share/zsh/share/antigen.zsh -else - [ -f ~/.local/share/zsh/antigen.zsh ] || (mkdir -p ~/.local/share/zsh/ && curl -L git.io/antigen > ~/.local/share/zsh/antigen.zsh) - # TODO If the downloaded file is wrong then we're doomed - source ~/.local/share/zsh/antigen.zsh -fi - -# This is better to have them installed as system since we can use them as root -# pacman -S zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting zsh-completions --needed -function plugin() { - if [ -d "/usr/share/licenses/$2" ] - then - trysource "/usr/share/zsh/plugins/$2/$2.zsh" - # It's ok if it fails - else - antigen bundle "$1/$2" - fi -} -plugin zsh-users zsh-completions -plugin zsh-users zsh-syntax-highlighting -plugin zsh-users zsh-autosuggestions -plugin zsh-users zsh-history-substring-search -antigen apply - -# Prompt customization -zmodload zsh/datetime - -function preexec() { - __TIMER=$EPOCHREALTIME -} - -if command -v powerline-go > /dev/null -then - function powerline_precmd() { - local __ERRCODE=$? - local __DURATION=0 - - if [ -n $__TIMER ]; then - local __ERT=$EPOCHREALTIME - __DURATION="$(($__ERT - ${__TIMER:-__ERT}))" - fi - - echo -en "\033]0; ${USER}@${HOST} $PWD\007" - # echo -en "… $\r" - eval "$(powerline-go -shell zsh -eval -duration $__DURATION -error $__ERRCODE "${POWERLINE_GO_DEFAULT_OPTS[@]}")" - unset __TIMER - } - - function install_powerline_precmd() { - for s in "${precmd_functions[@]}"; do - if [ "$s" = "powerline_precmd" ]; then - return - fi - done - precmd_functions+=(powerline_precmd) - } - - install_powerline_precmd -else - export PS1="\[\e]2;\u@\H \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] " -fi # Cursor based on mode if [ $TERM = "linux" ]; then From dcb03fa8959c92975ba1ea1eb7c9351bb807916c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 5 Nov 2023 22:28:38 +0100 Subject: [PATCH 040/108] nix: Make alacritty and other GL apps runnable Not everyone works, but already something. --- config/nix/hm/desktop.nix | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index d1d136a..cd56666 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -3,7 +3,6 @@ xsession = { enable = true; windowManager = { - command = "${config.xsession.windowManager.i3.package}/bin/i3"; i3 = { enable = true; config = @@ -439,14 +438,24 @@ }; home = { - file = { - ".xinitrc" = { - source = pkgs.writeShellScript "xinitrc" '' - ${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path} - ${config.xsession.windowManager.command} - ''; + file = + let + nixgl = import + (builtins.fetchGit { + url = "https://github.com/nix-community/nixGL"; + rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5"; + }) + { }; + in + { + ".xinitrc" = { + # TODO Configurable + source = pkgs.writeShellScript "xinitrc" '' + ${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path} + ${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ${config.xsession.windowManager.command} + ''; + }; }; - }; packages = with pkgs; [ # remote tigervnc From beca99a134560b92be78788087f48978d2a44b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 5 Nov 2023 23:19:04 +0100 Subject: [PATCH 041/108] nix: zsh more config --- config/nix/hm/common.nix | 13 +++++----- config/nix/hm/zshrc.sh | 42 ++++++++++++++++++++++++++++++ config/shell/zshrc | 55 ---------------------------------------- 3 files changed, 48 insertions(+), 62 deletions(-) create mode 100644 config/nix/hm/zshrc.sh diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 5d54b07..3dacf87 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -11,13 +11,8 @@ enableSyntaxHighlighting = true; # syntaxHighlighting.enable = true; # 23.11 syntax historySubstringSearch.enable = true; - initExtra = '' - # powerline-go duration support - zmodload zsh/datetime - function preexec() { - __TIMER=$EPOCHREALTIME - } - ''; + initExtra = builtins.readFile ./zshrc.sh; + defaultKeymap = "viins"; }; powerline-go = { enable = true; @@ -73,6 +68,10 @@ }; fzf.enable = true; # TODO highlight or bat + nix-index = { + enable = true; + enableZshIntegration = true; + }; }; home = { stateVersion = "23.05"; diff --git a/config/nix/hm/zshrc.sh b/config/nix/hm/zshrc.sh new file mode 100644 index 0000000..0e5bda3 --- /dev/null +++ b/config/nix/hm/zshrc.sh @@ -0,0 +1,42 @@ +# powerline-go duration support +zmodload zsh/datetime +function preexec() { + __TIMER=$EPOCHREALTIME +} + +# Cursor based on mode +if [ $TERM = "linux" ]; then + _LINE_CURSOR="\e[?0c" + _BLOCK_CURSOR="\e[?8c" +else + _LINE_CURSOR="\e[6 q" + _BLOCK_CURSOR="\e[2 q" +fi +function zle-keymap-select zle-line-init +{ + case $KEYMAP in + vicmd) print -n -- "$_BLOCK_CURSOR";; + viins|main) print -n -- "$_LINE_CURSOR";; + esac +} +function zle-line-finish +{ + print -n -- "$_BLOCK_CURSOR" +} +zle -N zle-line-init +zle -N zle-line-finish +zle -N zle-keymap-select + +# Also return to normal mode from jk shortcut +bindkey 'jk' vi-cmd-mode + +# Edit command line +autoload edit-command-line +zle -N edit-command-line +bindkey -M vicmd v edit-command-line + +# Additional history-substring-search bindings for vi cmd mode +# TODO Doesn't work, as home-manager loads history-substring at the very end of the file +# bindkey -M vicmd 'k' history-substring-search-up +# bindkey -M vicmd 'j' history-substring-search-down + diff --git a/config/shell/zshrc b/config/shell/zshrc index 96c7e31..faf0f50 100644 --- a/config/shell/zshrc +++ b/config/shell/zshrc @@ -7,61 +7,6 @@ # TODO Learn `setopt extendedglob` -# Cursor based on mode -if [ $TERM = "linux" ]; then - _LINE_CURSOR="\e[?0c" - _BLOCK_CURSOR="\e[?8c" -else - _LINE_CURSOR="\e[6 q" - _BLOCK_CURSOR="\e[2 q" -fi -function zle-keymap-select zle-line-init -{ - case $KEYMAP in - vicmd) print -n -- "$_BLOCK_CURSOR";; - viins|main) print -n -- "$_LINE_CURSOR";; - esac - - # zle reset-prompt - # zle -R -} - -function zle-line-finish -{ - print -n -- "$_BLOCK_CURSOR" -} - -zle -N zle-line-init -zle -N zle-line-finish -zle -N zle-keymap-select - -# Should I really put a comment to explain what this does? -bindkey 'jk' vi-cmd-mode - -# Edit command line -autoload edit-command-line -zle -N edit-command-line -bindkey -M vicmd v edit-command-line - -# History search -# bind UP and DOWN arrow keys -zmodload zsh/terminfo -bindkey "$terminfo[kcuu1]" history-substring-search-up -bindkey "$terminfo[kcud1]" history-substring-search-down - -# bind UP and DOWN arrow keys (compatibility fallback -# for Ubuntu 12.04, Fedora 21, and MacOSX 10.9 users) -bindkey '^[[A' history-substring-search-up -bindkey '^[[B' history-substring-search-down - -# bind P and N for EMACS mode -bindkey -M emacs '^P' history-substring-search-up -bindkey -M emacs '^N' history-substring-search-down - -# bind k and j for VI mode -bindkey -M vicmd 'k' history-substring-search-up -bindkey -M vicmd 'j' history-substring-search-down - # Autocompletion autoload -Uz promptinit promptinit From b5c39614c924942275f1cc6c9ea320875a8d9323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 6 Nov 2023 23:12:47 +0100 Subject: [PATCH 042/108] nix: Added remaining of zshrc Basically added the whole file with little edits... sad :( --- config/nix/hm/common.nix | 5 +++ config/nix/hm/zshrc.sh | 70 +++++++++++++++++++++++++++++++++ config/shell/zshrc | 84 ---------------------------------------- 3 files changed, 75 insertions(+), 84 deletions(-) delete mode 100644 config/shell/zshrc diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 3dacf87..b800181 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -13,6 +13,11 @@ historySubstringSearch.enable = true; initExtra = builtins.readFile ./zshrc.sh; defaultKeymap = "viins"; + history = { + size = 100000; + save = 100000; + expireDuplicatesFirst = true; + }; }; powerline-go = { enable = true; diff --git a/config/nix/hm/zshrc.sh b/config/nix/hm/zshrc.sh index 0e5bda3..5130f51 100644 --- a/config/nix/hm/zshrc.sh +++ b/config/nix/hm/zshrc.sh @@ -1,3 +1,10 @@ +# +# ZSH aliases and customizations +# Am not sure what everything does in there... +# + +# TODO Learn `setopt extendedglob` + # powerline-go duration support zmodload zsh/datetime function preexec() { @@ -40,3 +47,66 @@ bindkey -M vicmd v edit-command-line # bindkey -M vicmd 'k' history-substring-search-up # bindkey -M vicmd 'j' history-substring-search-down +# Autocompletion +autoload -Uz promptinit +promptinit + +# Color common prefix +zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==35=00}:${(s.:.)LS_COLORS}")' + + +setopt GLOBDOTS # Complete hidden files + +setopt NO_BEEP # that annoying beep goes away +# setopt NO_LIST_BEEP # beeping is only turned off for ambiguous completions +# +setopt AUTO_LIST # when the completion is ambiguous you get a list without having to type ^D +# setopt BASH_AUTO_LIST # the list only happens the second time you hit tab on an ambiguous completion +# setopt LIST_AMBIGUOUS # this is modified so that nothing is listed if there is an unambiguous prefix or suffix to be inserted --- this can be combined with BASH_AUTO_LIST, so that where both are applicable you need to hit tab three times for a listing +unsetopt REC_EXACT # if the string on the command line exactly matches one of the possible completions, it is accepted, even if there is another completion (i.e. that string with something else added) that also matches +unsetopt MENU_COMPLETE # one completion is always inserted completely, then when you hit TAB it changes to the next, and so on until you get back to where you started +unsetopt AUTO_MENU # you only get the menu behaviour when you hit TAB again on the ambiguous completion. +unsetopt AUTO_REMOVE_SLASH + +# Help +# TODO ~~Doesn't work (how ironic)~~ Works but it's just man? +autoload -Uz run-help +unalias run-help +alias help=run-help +autoload -Uz run-help-git +autoload -Uz run-help-ip +autoload -Uz run-help-openssl +autoload -Uz run-help-p4 +autoload -Uz run-help-sudo +autoload -Uz run-help-svk +autoload -Uz run-help-svn + +# Dir stack +DIRSTACKFILE="$HOME/.cache/zsh_dirstack" +if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then + dirstack=( ${(f)"$(< $DIRSTACKFILE)"} ) + # [[ -d $dirstack[1] ]] && cd $dirstack[1] +fi +chpwd() { + print -l $PWD ${(u)dirstack} >$DIRSTACKFILE +} + +DIRSTACKSIZE=20 + +setopt AUTO_PUSHD PUSHD_SILENT PUSHD_TO_HOME +setopt PUSHD_IGNORE_DUPS # Remove duplicate entries +setopt PUSHD_MINUS # This reverts the +/- operators. + + +# History + +# From https://unix.stackexchange.com/a/273863 +setopt BANG_HIST # Treat the '!' character specially during expansion. +setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits. +setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate. +setopt HIST_FIND_NO_DUPS # Do not display a line previously found. +setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file. +setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry. +unsetopt HIST_VERIFY # Don't execute immediately upon history expansion. +unsetopt HIST_BEEP # Beep when accessing nonexistent history. + diff --git a/config/shell/zshrc b/config/shell/zshrc deleted file mode 100644 index faf0f50..0000000 --- a/config/shell/zshrc +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env zsh - -# -# ZSH aliases and customizations -# - -# TODO Learn `setopt extendedglob` - - -# Autocompletion -autoload -Uz promptinit -promptinit - -# Color common prefix -zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==35=00}:${(s.:.)LS_COLORS}")' - -setopt GLOBDOTS # Complete hidden files - -setopt NO_BEEP # that annoying beep goes away -# setopt NO_LIST_BEEP # beeping is only turned off for ambiguous completions -setopt AUTO_LIST # when the completion is ambiguous you get a list without having to type ^D -# setopt BASH_AUTO_LIST # the list only happens the second time you hit tab on an ambiguous completion -# setopt LIST_AMBIGUOUS # this is modified so that nothing is listed if there is an unambiguous prefix or suffix to be inserted --- this can be combined with BASH_AUTO_LIST, so that where both are applicable you need to hit tab three times for a listing -unsetopt REC_EXACT # if the string on the command line exactly matches one of the possible completions, it is accepted, even if there is another completion (i.e. that string with something else added) that also matches -unsetopt MENU_COMPLETE # one completion is always inserted completely, then when you hit TAB it changes to the next, and so on until you get back to where you started -unsetopt AUTO_MENU # you only get the menu behaviour when you hit TAB again on the ambiguous completion. -unsetopt AUTO_REMOVE_SLASH - -# Fuzzy matching all the way -# trysource /usr/share/fzf/completion.zsh -trysource /usr/share/fzf/key-bindings.zsh - -# Help -# TODO Doesn't work (how ironic) -autoload -Uz run-help -unalias run-help -alias help=run-help -autoload -Uz run-help-git -autoload -Uz run-help-ip -autoload -Uz run-help-openssl -autoload -Uz run-help-p4 -autoload -Uz run-help-sudo -autoload -Uz run-help-svk -autoload -Uz run-help-svn - -# Dir stack -DIRSTACKFILE="$HOME/.cache/zsh/dirs" -if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then - dirstack=( ${(f)"$(< $DIRSTACKFILE)"} ) - # [[ -d $dirstack[1] ]] && cd $dirstack[1] -fi -chpwd() { - print -l $PWD ${(u)dirstack} >$DIRSTACKFILE -} - -DIRSTACKSIZE=20 - -setopt AUTO_PUSHD PUSHD_SILENT PUSHD_TO_HOME -setopt PUSHD_IGNORE_DUPS # Remove duplicate entries -setopt PUSHD_MINUS # This reverts the +/- operators. - - -# Command not found -# (since we have syntax highlighting we are not forced to wait to see that we typed crap) -trysource /usr/share/doc/pkgfile/command-not-found.zsh - -# History - -# From https://unix.stackexchange.com/a/273863 -SAVEHIST=$HISTSIZE -setopt BANG_HIST # Treat the '!' character specially during expansion. -unsetopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format. -setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits. -setopt SHARE_HISTORY # Share history between all sessions. -setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history. -setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again. -setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate. -setopt HIST_FIND_NO_DUPS # Do not display a line previously found. -setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space. -setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file. -setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry. -unsetopt HIST_VERIFY # Don't execute immediately upon history expansion. -unsetopt HIST_BEEP # Beep when accessing nonexistent history. - From ab4e33a82589d2c9d99e4ad5e65e5639a2079d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 7 Nov 2023 21:49:36 +0100 Subject: [PATCH 043/108] nix: Integrate more shell files Also I was thinking of getting rid of bash but... I spent so much time differentiating which options are for sh/bash/zsh that I don't feel like losing this data for now. --- config/nix/hm/common.nix | 233 +++++++++++++++++++++++++++------------ config/shell/bashrc | 49 -------- config/shell/commonenv | 16 --- config/shell/commonrc | 64 ----------- 4 files changed, 160 insertions(+), 202 deletions(-) delete mode 100644 config/shell/bashrc delete mode 100644 config/shell/commonenv delete mode 100644 config/shell/commonrc diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index b800181..db07da3 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -1,83 +1,169 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: { - programs = { - home-manager.enable = true; - bash.enable = true; # Just in case the default shell is not ZSH, so we still have the variables - zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - enableSyntaxHighlighting = true; - # syntaxHighlighting.enable = true; # 23.11 syntax - historySubstringSearch.enable = true; - initExtra = builtins.readFile ./zshrc.sh; - defaultKeymap = "viins"; - history = { - size = 100000; - save = 100000; - expireDuplicatesFirst = true; + programs = + let + commonRc = '' + # Colored ls + # TODO Doesn't allow completion + _colored_ls() { + \ls -lh --color=always $@ | awk ' + BEGIN { + FPAT = "([[:space:]]*[^[:space:]]+)"; + OFS = ""; + } + { + $1 = "\033[36m" $1 "\033[0m"; + $2 = "\033[31m" $2 "\033[0m"; + $3 = "\033[32m" $3 "\033[0m"; + $4 = "\033[32m" $4 "\033[0m"; + $5 = "\033[31m" $5 "\033[0m"; + $6 = "\033[34m" $6 "\033[0m"; + $7 = "\033[34m" $7 "\033[0m"; + print + } + ' + } + alias ll="_colored_ls" + alias la="_colored_ls -a" + ''; + commonSessionVariables = { + TIME_STYLE = "+%Y-%m-%d %H:%M:%S"; + # Less colors + LESS = "-R"; + LESS_TERMCAP_mb = "$'\E[1;31m'"; # begin blink + LESS_TERMCAP_md = "$'\E[1;36m'"; # begin bold + LESS_TERMCAP_me = "$'\E[0m'"; # reset bold/blink + LESS_TERMCAP_so = "$'\E[01;44;33m'"; # begin reverse video + LESS_TERMCAP_se = "$'\E[0m'"; # reset reverse video + LESS_TERMCAP_us = "$'\E[1;32m'"; # begin underline + LESS_TERMCAP_ue = "$'\E[0m'"; # reset underline + # Fzf + FZF_COMPLETION_OPTS = "${lib.strings.concatStringsSep " " config.programs.fzf.fileWidgetOptions}"; }; - }; - powerline-go = { - enable = true; - modules = [ "user" "host" "venv" "cwd" "perms" "git" ]; - modulesRight = [ "jobs" "exit" "duration" "load" ]; - settings = { - colorize-hostname = true; - max-width = 25; - cwd-max-dir-size = 10; - duration = "$( test -n \"$__TIMER\" && echo $(( $EPOCHREALTIME - $\{__TIMER:-EPOCHREALTIME})) || echo 0 )"; - # UPST Implement this properly in home-manager + commonShellAliases = { + cp = "cp -i --reflink=auto"; + grep = "grep --color=auto"; + dd = "dd status=progress"; + rm = "rm -v --one-file-system"; + free = "free -m"; + diff = "diff --color=auto"; + dmesg = "dmesg --ctime"; + wget = "wget --hsts-file ${config.xdg.cacheHome}/wget-hsts"; }; - extraUpdatePS1 = ''unset __TIMER''; - }; - # neovim = { - # enable = true; - # defaultEditor = true; - # vimAlias = true; - # viAlias = true; - # vimdiffAlias = true; - # }; - # FIXME Still want this despite using nixvim - gpg = { - enable = true; - homedir = "${config.xdg.stateHome}/gnupg"; - settings = { - # Remove fluff - no-greeting = true; - no-emit-version = true; - no-comments = true; - # Output format that I prefer - keyid-format = "0xlong"; - # Show fingerprints - with-fingerprint = true; - # Make sure to show if key is invalid - # (should be default on most platform, - # but just to be sure) - list-options = "show-uid-validity"; - verify-options = "show-uid-validity"; - # Stronger algorithm (https://wiki.archlinux.org/title/GnuPG#Different_algorithm) - personal-digest-preferences = "SHA512"; - cert-digest-algo = "SHA512"; - default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed"; - personal-cipher-preferences = "TWOFISH CAMELLIA256 AES 3DES"; + historySize = 100000; + historyFile = "${config.xdg.cacheHome}/shell_history"; + in + { + home-manager.enable = true; + bash = { + enable = true; + bashrcExtra = lib.strings.concatLines [ + commonRc + '' + shopt -s expand_aliases + shopt -s histappend + '' + ]; + sessionVariables = commonSessionVariables; + historySize = historySize; + historyFile = historyFile; + historyFileSize = historySize; + historyControl = [ "erasedups" "ignoredups" "ignorespace" ]; + shellAliases = commonShellAliases; }; - publicKeys = [{ - source = builtins.fetchurl { - url = "https://keys.openpgp.org/vks/v1/by-fingerprint/4FBA930D314A03215E2CDB0A8312C8CAC1BAC289"; - sha256 = "sha256:10y9xqcy1vyk2p8baay14p3vwdnlwynk0fvfbika65hz2z8yw2cm"; + zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + enableSyntaxHighlighting = true; + # syntaxHighlighting.enable = true; # 23.11 syntax + historySubstringSearch.enable = true; + initExtra = lib.strings.concatLines [ + commonRc + (builtins.readFile ./zshrc.sh) + ]; + defaultKeymap = "viins"; + history = { + size = historySize; + save = historySize; + path = historyFile; + expireDuplicatesFirst = true; }; - trust = "ultimate"; - }]; + sessionVariables = commonSessionVariables; + shellAliases = commonShellAliases; + }; + dircolors = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + # UPST This thing put stuff in .dircolors when it actually doesn't have to + }; + powerline-go = { + enable = true; + modules = [ "user" "host" "venv" "cwd" "perms" "git" ]; + modulesRight = [ "jobs" "exit" "duration" "load" ]; + settings = { + colorize-hostname = true; + max-width = 25; + cwd-max-dir-size = 10; + duration = "$( test -n \"$__TIMER\" && echo $(( $EPOCHREALTIME - $\{__TIMER:-EPOCHREALTIME})) || echo 0 )"; + # UPST Implement this properly in home-manager, would allow for bash support + }; + extraUpdatePS1 = ''unset __TIMER''; + }; + # neovim = { + # enable = true; + # defaultEditor = true; + # vimAlias = true; + # viAlias = true; + # vimdiffAlias = true; + # }; + # FIXME Still want this despite using nixvim + gpg = { + enable = true; + homedir = "${config.xdg.stateHome}/gnupg"; + settings = { + # Remove fluff + no-greeting = true; + no-emit-version = true; + no-comments = true; + # Output format that I prefer + keyid-format = "0xlong"; + # Show fingerprints + with-fingerprint = true; + # Make sure to show if key is invalid + # (should be default on most platform, + # but just to be sure) + list-options = "show-uid-validity"; + verify-options = "show-uid-validity"; + # Stronger algorithm (https://wiki.archlinux.org/title/GnuPG#Different_algorithm) + personal-digest-preferences = "SHA512"; + cert-digest-algo = "SHA512"; + default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed"; + personal-cipher-preferences = "TWOFISH CAMELLIA256 AES 3DES"; + }; + publicKeys = [{ + source = builtins.fetchurl { + url = "https://keys.openpgp.org/vks/v1/by-fingerprint/4FBA930D314A03215E2CDB0A8312C8CAC1BAC289"; + sha256 = "sha256:10y9xqcy1vyk2p8baay14p3vwdnlwynk0fvfbika65hz2z8yw2cm"; + }; + trust = "ultimate"; + }]; + }; + fzf = { + enable = true; + enableZshIntegration = true; + defaultOptions = [ "--height 40%" "--layout=default" ]; + fileWidgetOptions = [ "--preview '[[ -d {} ]] && ls -l --color=always {} || [[ \$(file --mime {}) =~ binary ]] && file --brief {} || (highlight -O ansi -l {} || coderay {} || rougify {} || cat {}) 2> /dev/null | head -500'" ]; + }; + # TODO highlight or bat + nix-index = { + enable = true; + enableZshIntegration = true; + }; + less.enable = true; }; - fzf.enable = true; - # TODO highlight or bat - nix-index = { - enable = true; - enableZshIntegration = true; - }; - }; home = { stateVersion = "23.05"; language = { @@ -162,5 +248,6 @@ syncthing ]; + sessionVariables = { }; }; } diff --git a/config/shell/bashrc b/config/shell/bashrc deleted file mode 100644 index 3288858..0000000 --- a/config/shell/bashrc +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash - -# -# Bash aliases and customizations -# - -# Shell options - -shopt -s expand_aliases -shopt -s histappend - -HISTCONTROL=ignoreboth:erasedups - -# Prompt customization - -if command -v powerline-go > /dev/null -then - INTERACTIVE_BASHPID_TIMER="${HOME}/.cache/bash_timer_$$" - - PS0='$(echo $SECONDS > "$INTERACTIVE_BASHPID_TIMER")' - - function _update_ps1() { - local __ERRCODE=$? - - local __DURATION=0 - if [ -e "$INTERACTIVE_BASHPID_TIMER" ]; then - local __END=$SECONDS - local __START=$(cat "$INTERACTIVE_BASHPID_TIMER") - __DURATION="$(($__END - ${__START:-__END}))" - \rm -f "$INTERACTIVE_BASHPID_TIMER" - fi - - echo -en "\033]0; ${USER}@${HOSTNAME} $PWD\007" - # echo -en "… $\r" - eval "$(powerline-go -shell bash -eval -duration $__DURATION -error $__ERRCODE "${POWERLINE_GO_DEFAULT_OPTS[@]}")" - } - - PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" - -else - export PS1="\[\e]2;\u@\H \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] " -fi - -# Completion -trysource /usr/share/bash-completion/bash_completion - -# Fuzzy matching all the way -trysource /usr/share/fzf/completion.bash -trysource /usr/share/fzf/key-bindings.bash diff --git a/config/shell/commonenv b/config/shell/commonenv deleted file mode 100644 index 20ad15c..0000000 --- a/config/shell/commonenv +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env sh - -# -# Bash / ZSH common environment variables and functions -# - -export TIME_STYLE='+%Y-%m-%d %H:%M:%S' -export LESS=-R -export LESS_TERMCAP_mb=$'\E[1;31m' # begin blink -export LESS_TERMCAP_md=$'\E[1;36m' # begin bold -export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink -export LESS_TERMCAP_so=$'\E[01;44;33m' # begin reverse video -export LESS_TERMCAP_se=$'\E[0m' # reset reverse video -export LESS_TERMCAP_us=$'\E[1;32m' # begin underline -export LESS_TERMCAP_ue=$'\E[0m' # reset underline -eval $(dircolors --sh) diff --git a/config/shell/commonrc b/config/shell/commonrc deleted file mode 100644 index 15331c9..0000000 --- a/config/shell/commonrc +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env sh - -# -# Bash / ZSH aliases and customizations -# - -# Shell options - -HISTSIZE=100000 -HISTFILE="$HOME/.cache/shell_history" - -## COMMAND CONFIGURATION - -# Completion for existing commands - -alias cp="cp -i --reflink=auto" -alias grep="grep --color=auto" -alias dd='dd status=progress' -alias rm='rm -v --one-file-system' -alias free='free -m' -alias diff='diff --color=auto' -alias dmesg='dmesg --ctime' -alias wget='wget --hsts-file $HOME/.cache/wget-hsts' - -# [ -f ~/.local/bin/colorSchemeApplyFzf ] && . ~/.local/bin/colorSchemeApplyFzf # Only applies RGB colors... -FZF_DEFAULT_OPTS="--height 40% --layout=default" -FZF_CTRL_T_OPTS="--preview '[[ -d {} ]] && ls -l --color=always {} || [[ \$(file --mime {}) =~ binary ]] && file --brief {} || (highlight -O ansi -l {} || coderay {} || rougify {} || cat {}) 2> /dev/null | head -500'" -FZF_COMPLETION_OPTS="${FZF_CTRL_T_OPTS}" - -# Colored ls -_colored_ls() { - \ls -lh --color=always $@ | awk ' - BEGIN { - FPAT = "([[:space:]]*[^[:space:]]+)"; - OFS = ""; - } - { - $1 = "\033[36m" $1 "\033[0m"; - $2 = "\033[31m" $2 "\033[0m"; - $3 = "\033[32m" $3 "\033[0m"; - $4 = "\033[32m" $4 "\033[0m"; - $5 = "\033[31m" $5 "\033[0m"; - $6 = "\033[34m" $6 "\033[0m"; - $7 = "\033[34m" $7 "\033[0m"; - print - } - ' -} -alias ll="_colored_ls" -alias la="_colored_ls -a" - -# To keep until https://github.com/openssh/openssh-portable/commit/f64f8c00d158acc1359b8a096835849b23aa2e86 -# is merged -function _ssh { - if [ "${TERM}" = "alacritty" ] - then - TERM=xterm-256color ssh "$@" - else - ssh "$@" - fi -} -alias ssh='_ssh' - -## FUNCTIONS From 77eef949b6241448bed329e384aefa0a2d88860c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 7 Nov 2023 23:17:40 +0100 Subject: [PATCH 044/108] nix: Add most of shenv --- config/nix/hm/common.nix | 95 +++++++++++++++++++++++++++++----------- config/shell/shenv | 95 ---------------------------------------- 2 files changed, 70 insertions(+), 120 deletions(-) diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index db07da3..bf47783 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -1,32 +1,53 @@ { pkgs, config, lib, ... }: +let + direnv = { + # Environment variables making programs stay out of $HOME, but also needing we create a directory for them + CARGOHOME = "${config.xdg.cacheHome}/cargo"; # There are config in there that we can version if one want + CCACHE_DIR = "${config.xdg.cacheHome}/ccache"; # The config file alone seems to be not enough + DASHT_DOCSETS_DIR = "${config.xdg.cacheHome}/dash_docsets"; + GOPATH = "${config.xdg.cacheHome}/go"; + GRADLE_USER_HOME = "${config.xdg.cacheHome}/gradle"; + MIX_ARCHIVES = "${config.xdg.cacheHome}/mix/archives"; + MONO_GAC_PREFIX = "${config.xdg.cacheHome}/mono"; + npm_config_cache = "${config.xdg.cacheHome}/npm"; + PARALLEL_HOME = "${config.xdg.cacheHome}/parallel"; + TERMINFO = "${config.xdg.configHome}/terminfo"; + WINEPREFIX = "${config.xdg.stateHome}/wineprefix/default"; + YARN_CACHE_FOLDER = "${config.xdg.cacheHome}/yarn"; + # TODO Some of that stuff is not really relavant any more + }; + dotfilesPath = "$HOME/.dotfiles"; # FIXME I think we want it in ~/.config/dotfiles, also, should be an option +in { programs = let - commonRc = '' - # Colored ls - # TODO Doesn't allow completion - _colored_ls() { - \ls -lh --color=always $@ | awk ' - BEGIN { - FPAT = "([[:space:]]*[^[:space:]]+)"; - OFS = ""; - } - { - $1 = "\033[36m" $1 "\033[0m"; - $2 = "\033[31m" $2 "\033[0m"; - $3 = "\033[32m" $3 "\033[0m"; - $4 = "\033[32m" $4 "\033[0m"; - $5 = "\033[31m" $5 "\033[0m"; - $6 = "\033[34m" $6 "\033[0m"; - $7 = "\033[34m" $7 "\033[0m"; - print - } - ' - } - alias ll="_colored_ls" - alias la="_colored_ls -a" - ''; + commonRc = lib.strings.concatLines ([ + '' + # Colored ls + # TODO Doesn't allow completion + _colored_ls() { + \ls -lh --color=always $@ | awk ' + BEGIN { + FPAT = "([[:space:]]*[^[:space:]]+)"; + OFS = ""; + } + { + $1 = "\033[36m" $1 "\033[0m"; + $2 = "\033[31m" $2 "\033[0m"; + $3 = "\033[32m" $3 "\033[0m"; + $4 = "\033[32m" $4 "\033[0m"; + $5 = "\033[31m" $5 "\033[0m"; + $6 = "\033[34m" $6 "\033[0m"; + $7 = "\033[34m" $7 "\033[0m"; + print + } + ' + } + alias ll="_colored_ls" + alias la="_colored_ls -a" + '' + ] ++ map (d: "mkdir -p ${d}") (builtins.attrValues direnv)); commonSessionVariables = { TIME_STYLE = "+%Y-%m-%d %H:%M:%S"; # Less colors @@ -248,6 +269,30 @@ syncthing ]; - sessionVariables = { }; + sessionVariables = { + # Favourite commands + PAGER = "${pkgs.coreutils}/bin/less"; + EDITOR = "${pkgs.neovim}/bin/nvim"; + VISUAL = "${pkgs.neovim}/bin/nvim"; + BROWSER = "${config.programs.qutebrowser.package}/bin/qutebrowser"; + } // direnv // { + BOOT9_PATH = "${config.xdg.dataHome}/citra-emu/sysdata/boot9.bin"; + CCACHE_CONFIGPATH = "${config.xdg.configHome}/ccache.conf"; + INPUTRC = "${config.xdg.configHome}/inputrc"; + LESSHISTFILE = "${config.xdg.stateHome}/lesshst"; + NODE_REPL_HISTORY = "${config.xdg.cacheHome}/node_repl_history"; + PYTHONSTARTUP = "${config.xdg.configHome}/pythonstartup.py"; + RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed + SCREENRC = "${config.xdg.configHome}/screenrc"; + SQLITE_HISTFILE = "${config.xdg.stateHome}/sqlite_history"; + YARN_DISABLE_SELF_UPDATE_CHECK = "true"; # This also disable the creation of a ~/.yarnrc file + # XAUTHORITY = "${config.xdg.configHome}/Xauthority"; # Disabled as this causes lock-ups with DMs + }; + # TODO Session variables only get reloaded on login I think. + sessionPath = [ + "$HOME/.local/bin" + "${config.home.sessionVariables.GOPATH}" + "${dotfilesPath}/config/scripts" + ]; }; } diff --git a/config/shell/shenv b/config/shell/shenv index bb18950..40b8349 100644 --- a/config/shell/shenv +++ b/config/shell/shenv @@ -5,105 +5,10 @@ # # Favourite commands -export PAGER=less -export EDITOR=nvim -export VISUAL=nvim -export BROWSER=qutebrowser - -direnv() { # environment variable name, path - export "$1"="$2" - mkdir -p "$2" -} - -# Program-specific - -export JAVA_FONTS=/usr/share/fonts/TTF # 2019-04-25 Attempt to remove .java/fonts remove if it didn't work -# export ANDROID_HOME=/opt/android-sdk -# export ARDUINO=/usr/share/arduino -# export ARDUINO_DIR=$ARDUINO -# export ARDMK_VENDOR=archlinux-arduino - -# Get out of my $HOME! -export BOOT9_PATH="$HOME/.local/share/citra-emu/sysdata/boot9.bin" -direnv CARGOHOME "$HOME/.cache/cargo" # There are config in there that we can version if one want -export CCACHE_CONFIGPATH="$HOME/.config/ccache.conf" -direnv CCACHE_DIR "$HOME/.cache/ccache" # The config file alone seems to be not enough -direnv DASHT_DOCSETS_DIR "$HOME/.cache/dash_docsets" -direnv GOPATH "$HOME/.cache/go" -direnv GRADLE_USER_HOME "$HOME/.cache/gradle" -export INPUTRC="$HOME/.config/inputrc" -export LESSHISTFILE="$HOME/.cache/lesshst" -direnv MIX_ARCHIVES "$HOME/.cache/mix/archives" -direnv MONO_GAC_PREFIX "$HOME/.cache/mono" -export NODE_REPL_HISTORY="$HOME/.cache/node_repl_history" -direnv npm_config_cache "$HOME/.cache/npm" -direnv PARALLEL_HOME "$HOME/.cache/parallel" -export PYTHONSTARTUP="$HOME/.config/pythonstartup.py" -export SCREENRC="$HOME/.config/screenrc" -export SQLITE_HISTFILE="$HOME/.cache/sqlite_history" -direnv TERMINFO "$HOME/.config/terminfo" -export RXVT_SOCKET="$HOME/.cache/urxvtd-$HOST" -export VIMINIT="source $HOME/.config/vim/loader.vim" -direnv WINEPREFIX "$HOME/.cache/wineprefix/default" -direnv YARN_CACHE_FOLDER "$HOME/.cache/yarn" -export YARN_DISABLE_SELF_UPDATE_CHECK=true # This also disable the creation of a ~/.yarnrc file -# Disabled since this causes lockups with DMs -# export XAUTHORITY="$HOME/.config/Xauthority" # And for the rest, see aliases direnv JUNKHOME "$HOME/.cache/junkhome" -# For software that did not understand that XDG variables have defaults -direnv XDG_DATA_HOME "$HOME/.local/share" -direnv XDG_CONFIG_HOME "$HOME/.config" -export XDG_DATA_DIRS="/usr/local/share/:/usr/share/" -export XDG_CONFIG_DIRS="/etc/xdg" -direnv XDG_CACHE_HOME "$HOME/.cache" -# Please don't set XDG_RUNTIME_DIR as it -# screw with user daemons such as PulseAudio - -# Path - -# Function stolen from Arch Linux /etc/profile -appendpath() { - if [ ! -d "$1" ]; then - return - fi - case ":$PATH:" in - *:"$1":*) ;; - - *) - export PATH="${PATH:+$PATH:}$1" - ;; - esac -} - -prependpath() { - if [ ! -d "$1" ]; then - return - fi - case ":$PATH:" in - *:"$1":*) ;; - - *) - export PATH="$1${PATH:+:$PATH}" - ;; - esac -} - -prependpath '/usr/lib/ccache/bin' -prependpath "${GOPATH}/bin" -prependpath "$HOME/.local/bin" -prependpath "$HOME/.config/scripts" - -# If running on termux, load those extra scripts -[ -d /data/data/com.termux/ ] && ( - prependpath "$HOME/.termux/scripts" - prependpath "$HOME/.termux/bin" -) - -# For superseding commands with better ones if they are present - # SSH Agent From 87f5b3099560ab9579f65acb9d63f8293272c10f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 8 Nov 2023 12:23:30 +0100 Subject: [PATCH 045/108] nix: Add GPG and SSH agent --- config/nix/hm/common.nix | 14 +++++++++++++- config/shell/shenv | 39 --------------------------------------- config/shell/shrc | 8 -------- 3 files changed, 13 insertions(+), 48 deletions(-) diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index bf47783..493eafe 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -48,6 +48,7 @@ in alias la="_colored_ls -a" '' ] ++ map (d: "mkdir -p ${d}") (builtins.attrValues direnv)); + # TODO Those directory creations should probably done on home-manager activation commonSessionVariables = { TIME_STYLE = "+%Y-%m-%d %H:%M:%S"; # Less colors @@ -185,6 +186,17 @@ in }; less.enable = true; }; + services = { + gpg-agent = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + enableSshSupport = true; + pinentryFlavor = "gtk2"; # Falls back to curses when needed + sshKeys = ["72A5F2913026776593947CF00DFF330E820E731D"]; # TODO This seems to prevent other keys from being added? + # FIXME For g extension, as base is not supposed to have private keys + }; + }; home = { stateVersion = "23.05"; language = { @@ -278,7 +290,7 @@ in } // direnv // { BOOT9_PATH = "${config.xdg.dataHome}/citra-emu/sysdata/boot9.bin"; CCACHE_CONFIGPATH = "${config.xdg.configHome}/ccache.conf"; - INPUTRC = "${config.xdg.configHome}/inputrc"; + # INPUTRC = "${config.xdg.configHome}/inputrc"; # UPST Will use programs.readline, but doesn't allow path setting LESSHISTFILE = "${config.xdg.stateHome}/lesshst"; NODE_REPL_HISTORY = "${config.xdg.cacheHome}/node_repl_history"; PYTHONSTARTUP = "${config.xdg.configHome}/pythonstartup.py"; diff --git a/config/shell/shenv b/config/shell/shenv index 40b8349..286e1a6 100644 --- a/config/shell/shenv +++ b/config/shell/shenv @@ -4,44 +4,5 @@ # Shell common environment variables and functions (BusyBox compatible) # -# Favourite commands - # And for the rest, see aliases direnv JUNKHOME "$HOME/.cache/junkhome" - -# SSH Agent - - -# If GPG agent is configured for SSH -if grep -q ^enable-ssh-support$ $GNUPGHOME/gpg-agent.conf 2> /dev/null -then - # Load GPG agent - unset SSH_AGENT_PID - if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then - export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" - fi - -else - # Start regular SSH agent if not already started - SSH_ENV="$HOME/.ssh/agent" - - start_agent() { - ssh-agent > "${SSH_ENV}" - chmod 600 "${SSH_ENV}" - . "${SSH_ENV}" > /dev/null - } - - if [ -f "${SSH_ENV}" ] - then - . "${SSH_ENV}" > /dev/null - if [ ! -d "/proc/${SSH_AGENT_PID}" ] || [ "$(cat "/proc/${SSH_AGENT_PID}/comm")" != "ssh-agent" ] - then - start_agent - fi - else - start_agent - fi -fi - -# TODO Service sytem that works without systemd, -# and can stop processes on logout diff --git a/config/shell/shrc b/config/shell/shrc index 7be4a5e..1e7a9ab 100644 --- a/config/shell/shrc +++ b/config/shell/shrc @@ -100,13 +100,5 @@ unset _i_prefer # trysource ~/.local/bin/colorSchemeApply # Needed because xterm/urxvt won't use the last color, needed for vim -## GPG -# Makes the last open terminal the ones that receives the pinentry message (if -# not run from a terminal with DESKTOP) -# TODO Only run if gpg-agent is started? -# TODO Make a command out of this for easy management (and maybe remove the below) -export GPG_TTY=$(tty) -gpg-connect-agent updatestartuptty /bye >/dev/null - ## EXTENSIONS trysource ~/.config/shell/extrc From b9974a790a8b44c8950817a85f69023bf7ea1968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 10 Nov 2023 23:31:11 +0100 Subject: [PATCH 046/108] nix: Finish shell --- bash_logout | 2 - bash_profile | 7 --- bashrc | 5 -- config/nix/hm/common.nix | 70 +++++++++++++++++++++++-- config/nix/hm/desktop.nix | 2 +- config/shell/.gitignore | 3 -- config/shell/.zprofile | 4 -- config/shell/.zshrc | 5 -- config/shell/shenv | 8 --- config/shell/shrc | 104 -------------------------------------- profile | 4 -- zshenv | 3 -- 12 files changed, 68 insertions(+), 149 deletions(-) delete mode 100644 bash_logout delete mode 100644 bash_profile delete mode 100644 bashrc delete mode 100644 config/shell/.gitignore delete mode 100644 config/shell/.zprofile delete mode 100644 config/shell/.zshrc delete mode 100644 config/shell/shenv delete mode 100644 config/shell/shrc delete mode 100644 profile delete mode 100644 zshenv diff --git a/bash_logout b/bash_logout deleted file mode 100644 index 9bccd62..0000000 --- a/bash_logout +++ /dev/null @@ -1,2 +0,0 @@ -clear -reset diff --git a/bash_profile b/bash_profile deleted file mode 100644 index c2a182e..0000000 --- a/bash_profile +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -source ~/.config/shell/shenv -source ~/.config/shell/commonenv -source ~/.config/shell/shrc -source ~/.config/shell/commonrc -source ~/.config/shell/bashrc diff --git a/bashrc b/bashrc deleted file mode 100644 index b666d4d..0000000 --- a/bashrc +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -source ~/.config/shell/shrc -source ~/.config/shell/commonrc -source ~/.config/shell/bashrc diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 493eafe..b0ab15f 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -63,16 +63,80 @@ in # Fzf FZF_COMPLETION_OPTS = "${lib.strings.concatStringsSep " " config.programs.fzf.fileWidgetOptions}"; }; + treatsHomeAsJunk = [ + # Programs that think $HOME is a reasonable place to put their junk + # and don't allow the user to change those questionable choices + "adb" + "audacity" + "binwalk" # Should use .config according to the GitHub code though + "cabal" # TODO May have options but last time I tried it it crashed + "cmake" + "ddd" + "ghidra" + "itch" + "simplescreenrecorder" # Easy fix https://github.com/MaartenBaert/ssr/blob/1556ae456e833992fb6d39d40f7c7d7c337a4160/src/Main.cpp#L252 + "vd" + "wpa_cli" + # TODO Maybe we can do something about node-gyp + ]; commonShellAliases = { + # Completion for existing commands + ls = "ls -h --color=auto"; + mkdir = "mkdir -v"; + # cp = "cp -i"; # Disabled because conflicts with the ZSH/Bash one. This separation is confusing I swear. + mv = "mv -iv"; + free = "free -h"; + df = "df -h"; + ffmpeg = "ffmpeg -hide_banner"; + ffprobe = "ffprobe -hide_banner"; + ffplay = "ffplay -hide_banner"; + # TODO Add ipython --no-confirm-exit --pdb + + # Frequent mistakes + sl = "ls"; + al = "la"; + mdkir = "mkdir"; + systemclt = "systemctl"; + please = "sudo"; + + # Shortcuts for commonly used commands + # ll = "ls -l"; # Disabled because would overwrite the colored one + # la = "ls -la"; # Eh maybe it's not that bad, but for now let's keep compatibility + s = "sudo -s -E"; + # n = "$HOME/.config/i3/terminal & disown"; # Not used anymore since alacritty daemon mode doesn't preserve environment variables + x = "startx ${config.xdg.configHome}/xinitrc; logout"; + nx = "nvidia-xrun ${config.xdg.configHome}/xinitrc; sudo systemctl start nvidia-xrun-pm; logout"; + # TODO Put in display.nix + # Was also thinking of not storing the config in .config and use nix-store instead, + # but maybe it's a bad idea as home-manager switch doesn't replace aliases in running shells + # FIXME Is it still relevant with NixOS? + + + # Give additional config to those programs, and not have them in my path + bower = "bower --config.storage.packages=${config.xdg.cacheHome}/bower/packages --config.storage.registry=${config.xdg.cacheHome}/bower/registry --config.storage.links=${config.xdg.cacheHome}/bower/links"; + gdb = "gdb -x ${config.xdg.configHome}/gdbinit"; + iftop = "iftop -c ${config.xdg.configHome}/iftoprc"; + lmms = "lmms --config ${config.xdg.configHome}/lmmsrc.xml"; + tmux = "tmux -f ${config.xdg.configHome}/tmux/tmux.conf"; + + # Preference + vi = "nvim"; + vim = "nvim"; + wol = "wakeonlan"; # TODO Really, isn't wol better? Also wtf Arch aliases to pass because neither is installed anyways x) + mutt = "neomutt"; + + # Bash/Zsh only cp = "cp -i --reflink=auto"; grep = "grep --color=auto"; dd = "dd status=progress"; rm = "rm -v --one-file-system"; - free = "free -m"; + # free = "free -m"; # Disabled because... no? Why? diff = "diff --color=auto"; dmesg = "dmesg --ctime"; wget = "wget --hsts-file ${config.xdg.cacheHome}/wget-hsts"; - }; + } // lib.attrsets.mergeAttrsList (map (p: {"${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}";}) treatsHomeAsJunk); + # TODO Maybe make nixpkg wrapper instead? So it also works from dmenu + # Could also accept my fate... Home-manager doesn't necessarily make it easy to put things out of the home directory historySize = 100000; historyFile = "${config.xdg.cacheHome}/shell_history"; in @@ -193,7 +257,7 @@ in enableZshIntegration = true; enableSshSupport = true; pinentryFlavor = "gtk2"; # Falls back to curses when needed - sshKeys = ["72A5F2913026776593947CF00DFF330E820E731D"]; # TODO This seems to prevent other keys from being added? + sshKeys = [ "72A5F2913026776593947CF00DFF330E820E731D" ]; # TODO This seems to prevent other keys from being added? # FIXME For g extension, as base is not supposed to have private keys }; }; diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index cd56666..9a07883 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -448,7 +448,7 @@ { }; in { - ".xinitrc" = { + "${config.xdg.configHome}/xinitrc" = { # TODO Configurable source = pkgs.writeShellScript "xinitrc" '' ${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path} diff --git a/config/shell/.gitignore b/config/shell/.gitignore deleted file mode 100644 index 3cb575e..0000000 --- a/config/shell/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -extrc -*.zwc -.zcompdump diff --git a/config/shell/.zprofile b/config/shell/.zprofile deleted file mode 100644 index ff174ee..0000000 --- a/config/shell/.zprofile +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env zsh - -source ~/.config/shell/shenv -source ~/.config/shell/commonenv diff --git a/config/shell/.zshrc b/config/shell/.zshrc deleted file mode 100644 index c6a82e6..0000000 --- a/config/shell/.zshrc +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env zsh - -source ~/.config/shell/shrc -source ~/.config/shell/commonrc -source ~/.config/shell/zshrc diff --git a/config/shell/shenv b/config/shell/shenv deleted file mode 100644 index 286e1a6..0000000 --- a/config/shell/shenv +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env sh - -# -# Shell common environment variables and functions (BusyBox compatible) -# - -# And for the rest, see aliases -direnv JUNKHOME "$HOME/.cache/junkhome" diff --git a/config/shell/shrc b/config/shell/shrc deleted file mode 100644 index 1e7a9ab..0000000 --- a/config/shell/shrc +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env sh - -# -# Shell common aliases and customizations (BusyBox compatible) -# - -## COMMAND CONFIGURATION - -# Completion for existing commands -alias ls='ls -h --color=auto' -alias mkdir='mkdir -v' -alias cp="cp -i" -alias mv="mv -iv" -alias free='free -h' -alias df='df -h' - -alias ffmpeg='ffmpeg -hide_banner' -alias ffprobe='ffprobe -hide_banner' -alias ffplay='ffplay -hide_banner' - -# ALIASES - -# Frequent mistakes -alias sl=ls -alias al=la -alias mdkir=mkdir -alias systemclt=systemctl -alias please=sudo - -# Shortcuts for commonly used commands -alias ll="ls -l" -alias la="ls -la" -alias s='sudo -s -E' -alias n='$HOME/.config/i3/terminal & disown' -alias x='startx $HOME/.config/xinitrc; logout' -alias nx='nvidia-xrun $HOME/.config/xinitrc; sudo systemctl start nvidia-xrun-pm; logout' - -# For programs that think $HOME is a reasonable place to put their junk -# and don't allow the user to change those questionable choices -alias adb='HOME=$JUNKHOME adb' -alias audacity='HOME=$JUNKHOME audacity' -alias binwalk='HOME=$JUNKHOME binwalk' # Should use .config according to the GitHub code though -alias cabal='HOME=$JUNKHOME cabal' # TODO May have options but last time I tried it it crashed -alias cmake='HOME=$JUNKHOME cmake' -alias ddd='HOME=$JUNKHOME ddd' -alias ghidra='HOME=$JUNKHOME ghidra' -alias itch='HOME=$JUNKHOME itch' -alias simplescreenrecorder='HOME=$JUNKHOME simplescreenrecorder' # Easy fix https://github.com/MaartenBaert/ssr/blob/1556ae456e833992fb6d39d40f7c7d7c337a4160/src/Main.cpp#L252 -alias vd='HOME=$JUNKHOME vd' -alias wpa_cli='HOME=$JUNKHOME wpa_cli' -# TODO Maybe we can do something about node-gyp - -alias bower='bower --config.storage.packages=~/.cache/bower/packages --config.storage.registry=~/.cache/bower/registry --config.storage.links=~/.cache/bower/links' -alias gdb='gdb -x $HOME/.config/gdbinit' -alias iftop='iftop -c $HOME/.config/iftoprc' -alias lmms='lmms --config $HOME/.config/lmmsrc.xml' -alias tmux='tmux -f $HOME/.config/tmux/tmux.conf' - -# TODO ruby's gem when I find a use for it - -# FUNCTIONS -trysource() { - if [ -f "$1" ] - then - . "$1" - else - return 1 - fi -} - -_i_prefer() { # executables... - for candidate in "$@" - do - if [ -x "$(command -v "$candidate")" ] - then - choice="$candidate" - break - fi - done - if [ -z "$choice" ] - then - return - fi - for candidate in "$@" - do - if [ "$candidate" != "$choice" ] - then - alias "$candidate"="$choice" - fi - done -} -_i_prefer nvim vim vi -_i_prefer gopass pass -_i_prefer wakeonlan wol -_i_prefer neomutt mutt -unset _i_prefer - -## COLORS - -# trysource ~/.local/bin/colorSchemeApply -# Needed because xterm/urxvt won't use the last color, needed for vim - -## EXTENSIONS -trysource ~/.config/shell/extrc diff --git a/profile b/profile deleted file mode 100644 index 664271f..0000000 --- a/profile +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh - -. ~/.config/shell/shenv -. ~/.config/shell/shrc diff --git a/zshenv b/zshenv deleted file mode 100644 index f78ec50..0000000 --- a/zshenv +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env zsh - -ZDOTDIR=~/.config/shell From 3995e664d090d3f776ea16d4825cb69b3e26dfb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 12 Nov 2023 21:53:52 +0100 Subject: [PATCH 047/108] nix: Various fixes --- config/nix/hm/common.nix | 3 ++- config/nix/hm/desktop.nix | 2 +- config/nix/hm/style.nix | 12 +++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index b0ab15f..06c7859 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -241,7 +241,8 @@ in enable = true; enableZshIntegration = true; defaultOptions = [ "--height 40%" "--layout=default" ]; - fileWidgetOptions = [ "--preview '[[ -d {} ]] && ls -l --color=always {} || [[ \$(file --mime {}) =~ binary ]] && file --brief {} || (highlight -O ansi -l {} || coderay {} || rougify {} || cat {}) 2> /dev/null | head -500'" ]; + fileWidgetOptions = [ "--preview '[[ -d {} ]] && ${pkgs.coreutils}/bin/ls -l --color=always {} || [[ \$(${pkgs.file}/bin/file --mime {}) =~ binary ]] && ${pkgs.file}/bin/file --brief {} || (${pkgs.highlight}/bin/highlight -O ansi -l {} || coderay {} || rougify {} || ${pkgs.coreutils}/bin/cat {}) 2> /dev/null | head -500'" ]; + # file and friends are not in PATH by default... so here we want aboslute paths, which means those won't get reloaded. Meh. }; # TODO highlight or bat nix-index = { diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 9a07883..941eab1 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -103,7 +103,7 @@ # TODO Is a shell script even required? }"; "${mod}+Shift+Return" = "exec ${config.programs.urxvt.package}/bin/urxvt"; - "${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/tunar"; + "${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/thunar"; "${mod}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore --backend=webengine"; # TODO --backend not useful anymore # Volume control diff --git a/config/nix/hm/style.nix b/config/nix/hm/style.nix index 06456ed..935dc5c 100644 --- a/config/nix/hm/style.nix +++ b/config/nix/hm/style.nix @@ -17,9 +17,15 @@ in }; # FIXME This doesn't work - fonts.monospace = { - package = pkgs.nerdfonts; - name = "DejaVuSansM Nerd Font"; + fonts = { + sizes = { + applications = 10; + terminal = 10; + }; + monospace = { + package = pkgs.nerdfonts; + name = "DejaVuSansM Nerd Font"; + }; }; targets.vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR) From 0316638e21f388dfb2d800968fa860137fd522f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 12 Nov 2023 22:44:20 +0100 Subject: [PATCH 048/108] nix: Process some more dotfiles --- config/ccache.conf | 1 - config/flake8 | 3 - config/gdbinit | 3 - config/git/.gitignore | 1 - config/git/config | 19 ---- config/git/gitignore | 5 -- config/gtk-3.0/.gitignore | 1 - config/gtk-3.0/settings.ini | 16 ---- config/iftoprc | 61 ------------- config/nix/hm/common.nix | 89 ++++++++++++++++++- config/{ => nix/hm}/inputrc | 24 ----- config/nix/hm/vim.nix | 5 +- .../unprocessed/config}/j4status/config | 0 .../{ => nix/unprocessed/config}/khal/config | 0 .../unprocessed/config}/khard/khard.conf | 0 .../unprocessed/config}/polybar/bars.ini | 0 .../unprocessed/config}/polybar/bbswitch | 0 .../unprocessed/config}/polybar/config | 0 .../unprocessed/config}/polybar/config.ini | 0 .../unprocessed/config}/polybar/keystore | 0 .../unprocessed/config}/polybar/launch.sh | 0 .../unprocessed/config}/polybar/linuxmismatch | 0 .../unprocessed/config}/polybar/modules.ini | 0 .../{ => nix/unprocessed/config}/polybar/todo | 0 .../unprocessed/config}/todoman/todoman.conf | 0 .../unprocessed/config}/vdirsyncer/.dfrecur | 0 .../unprocessed/config}/vdirsyncer/config | 0 27 files changed, 91 insertions(+), 137 deletions(-) delete mode 100644 config/ccache.conf delete mode 100644 config/flake8 delete mode 100644 config/gdbinit delete mode 100644 config/git/.gitignore delete mode 100644 config/git/config delete mode 100644 config/git/gitignore delete mode 100644 config/gtk-3.0/.gitignore delete mode 100644 config/gtk-3.0/settings.ini delete mode 100644 config/iftoprc rename config/{ => nix/hm}/inputrc (52%) rename config/{ => nix/unprocessed/config}/j4status/config (100%) rename config/{ => nix/unprocessed/config}/khal/config (100%) rename config/{ => nix/unprocessed/config}/khard/khard.conf (100%) rename config/{ => nix/unprocessed/config}/polybar/bars.ini (100%) rename config/{ => nix/unprocessed/config}/polybar/bbswitch (100%) rename config/{ => nix/unprocessed/config}/polybar/config (100%) rename config/{ => nix/unprocessed/config}/polybar/config.ini (100%) rename config/{ => nix/unprocessed/config}/polybar/keystore (100%) rename config/{ => nix/unprocessed/config}/polybar/launch.sh (100%) rename config/{ => nix/unprocessed/config}/polybar/linuxmismatch (100%) rename config/{ => nix/unprocessed/config}/polybar/modules.ini (100%) rename config/{ => nix/unprocessed/config}/polybar/todo (100%) rename config/{ => nix/unprocessed/config}/todoman/todoman.conf (100%) rename config/{ => nix/unprocessed/config}/vdirsyncer/.dfrecur (100%) rename config/{ => nix/unprocessed/config}/vdirsyncer/config (100%) diff --git a/config/ccache.conf b/config/ccache.conf deleted file mode 100644 index ec8132c..0000000 --- a/config/ccache.conf +++ /dev/null @@ -1 +0,0 @@ -ccache_dir = $HOME/.cache/ccache diff --git a/config/flake8 b/config/flake8 deleted file mode 100644 index b66470c..0000000 --- a/config/flake8 +++ /dev/null @@ -1,3 +0,0 @@ -[flake8] -# Compatibility with Black -max-line-length = 88 diff --git a/config/gdbinit b/config/gdbinit deleted file mode 100644 index 9569b3d..0000000 --- a/config/gdbinit +++ /dev/null @@ -1,3 +0,0 @@ -define hook-quit - set confirm off -end diff --git a/config/git/.gitignore b/config/git/.gitignore deleted file mode 100644 index f5fff02..0000000 --- a/config/git/.gitignore +++ /dev/null @@ -1 +0,0 @@ -gitk diff --git a/config/git/config b/config/git/config deleted file mode 100644 index b99c120..0000000 --- a/config/git/config +++ /dev/null @@ -1,19 +0,0 @@ -[user] - name = Geoffrey “Frogeye” Preud'homme - email = geoffrey@frogeye.fr - signingkey = 0x8312C8CAC1BAC289 -[core] - editor = nvim - excludesfile = ~/.config/git/gitignore -[push] - default = matching -[alias] - git = !exec git -[filter "lfs"] - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f - process = git-lfs filter-process - required = true -[pull] - ff = only - diff --git a/config/git/gitignore b/config/git/gitignore deleted file mode 100644 index 97ef313..0000000 --- a/config/git/gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.swp -*.swo -*.ycm_extra_conf.py -tags -.mypy_cache diff --git a/config/gtk-3.0/.gitignore b/config/gtk-3.0/.gitignore deleted file mode 100644 index 7e1f6a7..0000000 --- a/config/gtk-3.0/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bookmarks diff --git a/config/gtk-3.0/settings.ini b/config/gtk-3.0/settings.ini deleted file mode 100644 index 8d29faa..0000000 --- a/config/gtk-3.0/settings.ini +++ /dev/null @@ -1,16 +0,0 @@ -[Settings] -gtk-theme-name=Greenbird -gtk-icon-theme-name=Faenza-Green -gtk-font-name=Sans 10 -gtk-cursor-theme-size=0 -gtk-toolbar-style=GTK_TOOLBAR_BOTH -gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR -gtk-button-images=1 -gtk-menu-images=1 -gtk-enable-event-sounds=1 -gtk-enable-input-feedback-sounds=1 -gtk-xft-antialias=1 -gtk-xft-hinting=1 -gtk-xft-hintstyle=hintslight -gtk-xft-rgba=rgb -gtk-cursor-theme-name=Menda-Cursor diff --git a/config/iftoprc b/config/iftoprc deleted file mode 100644 index 7867980..0000000 --- a/config/iftoprc +++ /dev/null @@ -1,61 +0,0 @@ -# interface: if -# Sets the network interface to if. - -dns-resolution: yes -# Controls reverse lookup of IP addresses. - -port-resolution: no -# Controls conversion of port numbers to service names. - -# filter-code: bpf -# Sets the filter code to bpf. - -show-bars: yes -# Controls display of bar graphs. - -promiscuous: no -# Puts the interface into promiscuous mode. - -port-display: on -# Controls display of port numbers. - -link-local: yes -# Determines displaying of link-local IPv6 addresses. - -hide-source: no -# Hides source host names. - -hide-destination: no -# Hides destination host names. - -use-bytes: yes -# Use bytes for bandwidth display, rather than bits. - -sort: 10s -# Sets which column is used to sort the display. - -line-display: two-line -# Controls the appearance of each item in the display. - -show-totals: yes -# Shows cumulative total for each item. - -log-scale: yes -# Use a logarithmic scale for bar graphs. - -# max-bandwidth: bw -# Fixes the maximum for the bar graph scale to bw, e.g. "10M". -# Note that the value has to always be in bits, regardless if the -# option to display in bytes has been chosen. - -# net-filter: net/mask -# Defines an IP network boundary for determining packet direc‐ -# tion. - -# net-filter6: net6/mask6 -# Defines an IPv6 network boundary for determining packet direc‐ -# tion. - -# screen-filter: regexp -# Sets a regular expression to filter screen output. - diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 06c7859..af0a19e 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -134,7 +134,7 @@ in diff = "diff --color=auto"; dmesg = "dmesg --ctime"; wget = "wget --hsts-file ${config.xdg.cacheHome}/wget-hsts"; - } // lib.attrsets.mergeAttrsList (map (p: {"${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}";}) treatsHomeAsJunk); + } // lib.attrsets.mergeAttrsList (map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) treatsHomeAsJunk); # TODO Maybe make nixpkg wrapper instead? So it also works from dmenu # Could also accept my fate... Home-manager doesn't necessarily make it easy to put things out of the home directory historySize = 100000; @@ -250,6 +250,66 @@ in enableZshIntegration = true; }; less.enable = true; + git = { + enable = true; + aliases = { + "git" = "!exec git"; # In case I write one too many git + }; + ignores = [ + "*.swp" + "*.swo" + "*.ycm_extra_conf.py" + "tags" + ".mypy_cache" + ]; + lfs.enable = true; + signing = { + key = "0x8312C8CAC1BAC289"; # FIXME Only in extension + # TODO signByDefault? + }; + userEmail = "geoffrey@frogeye.fr"; + userName = "Geoffrey “Frogeye” Preud'homme"; + extraConfig = { + core = { + editor = "nvim"; + }; + push = { + default = "matching"; + }; + pull = { + ff = "only"; + }; + }; + # TODO Delta syntax highlighter... and other cool-looking options? + }; + readline = { + enable = true; + variables = { + "bell-style" = "none"; + "colored-completion-prefix" = true; + "colored-stats" = true; + "completion-ignore-case" = true; + "completion-query-items" = 200; + "editing-mode" = "vi"; + "history-preserve-point" = true; + "history-size" = 10000; + "horizontal-scroll-mode" = false; + "mark-directories" = true; + "mark-modified-lines" = false; + "mark-symlinked-directories" = true; + "match-hidden-files" = true; + "menu-complete-display-prefix" = true; + "page-completions" = true; + "print-completions-horizontally" = false; + "revert-all-at-newline" = false; + "show-all-if-ambiguous" = true; + "show-all-if-unmodified" = true; + "show-mode-in-prompt" = true; + "skip-completed-text" = true; + "visible-stats" = false; + }; + extraConfig = builtins.readFile ./inputrc; + }; }; services = { gpg-agent = { @@ -262,6 +322,32 @@ in # FIXME For g extension, as base is not supposed to have private keys }; }; + xdg = { + configFile = { + # TODO Should be xdg.configFile + "ccache.conf" = { + text = "ccache_dir = ${config.xdg.cacheHome}/ccache"; + }; + "gdbinit" = { + text = '' + define hook-quit + set confirm off + end + ''; + }; + "iftoprc" = { + text = '' + port-resolution: no + promiscuous: no + port-display: on + link-local: yes + use-bytes: yes + show-totals: yes + log-scale: yes + ''; + }; + }; + }; home = { stateVersion = "23.05"; language = { @@ -276,7 +362,6 @@ in gnused gnutar openssl - git wget curl python3Packages.pip diff --git a/config/inputrc b/config/nix/hm/inputrc similarity index 52% rename from config/inputrc rename to config/nix/hm/inputrc index b6fe014..8f5b381 100644 --- a/config/inputrc +++ b/config/nix/hm/inputrc @@ -1,27 +1,3 @@ -$include /etc/inputrc -set bell-style none -set colored-completion-prefix on -set colored-stats on -set completion-ignore-case on -set completion-query-items 200 -set editing-mode vi -set history-preserve-point on -set history-size 10000 -set horizontal-scroll-mode off -set mark-directories on -set mark-modified-lines off -set mark-symlinked-directories on -set match-hidden-files on -set menu-complete-display-prefix on -set page-completions on -set print-completions-horizontally off -set revert-all-at-newline off -set show-all-if-ambiguous on -set show-all-if-unmodified on -set show-mode-in-prompt on -set skip-completed-text on -set visible-stats off - $if mode=vi # these are for vi-command mode set keymap vi-command diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index b2fa87e..89ce9e3 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -172,7 +172,10 @@ in enable = true; settings.plugins = { black.enabled = true; - flake8.enabled = true; + flake8 = { + enabled = true; + maxLineLength = 88; # Compatibility with Black + }; isort.enabled = true; mccabe.enabled = true; pycodestyle.enabled = true; diff --git a/config/j4status/config b/config/nix/unprocessed/config/j4status/config similarity index 100% rename from config/j4status/config rename to config/nix/unprocessed/config/j4status/config diff --git a/config/khal/config b/config/nix/unprocessed/config/khal/config similarity index 100% rename from config/khal/config rename to config/nix/unprocessed/config/khal/config diff --git a/config/khard/khard.conf b/config/nix/unprocessed/config/khard/khard.conf similarity index 100% rename from config/khard/khard.conf rename to config/nix/unprocessed/config/khard/khard.conf diff --git a/config/polybar/bars.ini b/config/nix/unprocessed/config/polybar/bars.ini similarity index 100% rename from config/polybar/bars.ini rename to config/nix/unprocessed/config/polybar/bars.ini diff --git a/config/polybar/bbswitch b/config/nix/unprocessed/config/polybar/bbswitch similarity index 100% rename from config/polybar/bbswitch rename to config/nix/unprocessed/config/polybar/bbswitch diff --git a/config/polybar/config b/config/nix/unprocessed/config/polybar/config similarity index 100% rename from config/polybar/config rename to config/nix/unprocessed/config/polybar/config diff --git a/config/polybar/config.ini b/config/nix/unprocessed/config/polybar/config.ini similarity index 100% rename from config/polybar/config.ini rename to config/nix/unprocessed/config/polybar/config.ini diff --git a/config/polybar/keystore b/config/nix/unprocessed/config/polybar/keystore similarity index 100% rename from config/polybar/keystore rename to config/nix/unprocessed/config/polybar/keystore diff --git a/config/polybar/launch.sh b/config/nix/unprocessed/config/polybar/launch.sh similarity index 100% rename from config/polybar/launch.sh rename to config/nix/unprocessed/config/polybar/launch.sh diff --git a/config/polybar/linuxmismatch b/config/nix/unprocessed/config/polybar/linuxmismatch similarity index 100% rename from config/polybar/linuxmismatch rename to config/nix/unprocessed/config/polybar/linuxmismatch diff --git a/config/polybar/modules.ini b/config/nix/unprocessed/config/polybar/modules.ini similarity index 100% rename from config/polybar/modules.ini rename to config/nix/unprocessed/config/polybar/modules.ini diff --git a/config/polybar/todo b/config/nix/unprocessed/config/polybar/todo similarity index 100% rename from config/polybar/todo rename to config/nix/unprocessed/config/polybar/todo diff --git a/config/todoman/todoman.conf b/config/nix/unprocessed/config/todoman/todoman.conf similarity index 100% rename from config/todoman/todoman.conf rename to config/nix/unprocessed/config/todoman/todoman.conf diff --git a/config/vdirsyncer/.dfrecur b/config/nix/unprocessed/config/vdirsyncer/.dfrecur similarity index 100% rename from config/vdirsyncer/.dfrecur rename to config/nix/unprocessed/config/vdirsyncer/.dfrecur diff --git a/config/vdirsyncer/config b/config/nix/unprocessed/config/vdirsyncer/config similarity index 100% rename from config/vdirsyncer/config rename to config/nix/unprocessed/config/vdirsyncer/config From 47a19d7f82cd5973010e592850977b8bf9cb7e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 19 Nov 2023 20:51:05 +0100 Subject: [PATCH 049/108] nix: frobar Semi-proper Python packaging, and non-conflicting names, yahoo! --- config/lemonbar/launch.sh | 13 -------- config/lemonbar/requirements.txt | 13 -------- config/nix/hm/common.nix | 2 +- config/nix/hm/desktop.nix | 3 +- .../{lemonbar => nix/hm/frobar/.dev}/barng.py | 0 .../hm/frobar/.dev}/oldbar.py | 0 .../{lemonbar => nix/hm/frobar/.dev}/pip.py | 0 config/{lemonbar => nix/hm/frobar/.dev}/x.py | 0 config/nix/hm/frobar/.gitignore | 2 ++ config/nix/hm/frobar/default.nix | 31 +++++++++++++++++++ .../hm/frobar/frobar/__init__.py} | 4 +-- .../hm/frobar/frobar}/display.py | 16 +++++----- config/nix/hm/frobar/frobar/notbusy.py | 5 +++ .../hm/frobar/frobar}/providers.py | 25 +++++++-------- .../hm/frobar/frobar}/updaters.py | 17 +++++----- config/nix/hm/frobar/setup.py | 20 ++++++++++++ 16 files changed, 92 insertions(+), 59 deletions(-) delete mode 100755 config/lemonbar/launch.sh delete mode 100644 config/lemonbar/requirements.txt rename config/{lemonbar => nix/hm/frobar/.dev}/barng.py (100%) rename config/{lemonbar => nix/hm/frobar/.dev}/oldbar.py (100%) rename config/{lemonbar => nix/hm/frobar/.dev}/pip.py (100%) rename config/{lemonbar => nix/hm/frobar/.dev}/x.py (100%) create mode 100644 config/nix/hm/frobar/.gitignore create mode 100644 config/nix/hm/frobar/default.nix rename config/{lemonbar/bar.py => nix/hm/frobar/frobar/__init__.py} (97%) mode change 100755 => 100644 rename config/{lemonbar => nix/hm/frobar/frobar}/display.py (99%) mode change 100755 => 100644 create mode 100644 config/nix/hm/frobar/frobar/notbusy.py rename config/{lemonbar => nix/hm/frobar/frobar}/providers.py (99%) mode change 100755 => 100644 rename config/{lemonbar => nix/hm/frobar/frobar}/updaters.py (99%) mode change 100755 => 100644 create mode 100644 config/nix/hm/frobar/setup.py diff --git a/config/lemonbar/launch.sh b/config/lemonbar/launch.sh deleted file mode 100755 index 42c747e..0000000 --- a/config/lemonbar/launch.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env sh - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -ex="$DIR/bar.py" - -# Terminate already running bar instances -ps x | grep "python3 $ex" | grep -v grep | awk '{print $1}' | while read p; do kill $p; done -killall -q lemonbar - -$ex - - diff --git a/config/lemonbar/requirements.txt b/config/lemonbar/requirements.txt deleted file mode 100644 index 33e73b9..0000000 --- a/config/lemonbar/requirements.txt +++ /dev/null @@ -1,13 +0,0 @@ -coloredlogs==10.0 -enum-compat==0.0.2 -humanfriendly==4.16.1 -i3ipc==1.6.0 -ifaddr==0.1.4 -ipaddress==1.0.22 -psutil==5.4.7 -pulsectl>=23.5.2<24 -pyinotify==0.9.6 -python-mpd2>=3.0.0<4 -python-uinput==0.11.2 -yoke==0.1.1 -zeroconf==0.21.3 diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index af0a19e..7269f79 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -25,7 +25,7 @@ in commonRc = lib.strings.concatLines ([ '' # Colored ls - # TODO Doesn't allow completion + # TODO Doesn't allow completion. Check out lsd instead _colored_ls() { \ls -lh --color=always $@ | awk ' BEGIN { diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 941eab1..6587326 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -496,10 +496,11 @@ simplescreenrecorder trayer xclip - lemonbar-xft keynav xorg.xinit xorg.xbacklight + # TODO Make this clean. Service? + (callPackage (import ./frobar) {}) # FIXME Call it where needed # organisation diff --git a/config/lemonbar/barng.py b/config/nix/hm/frobar/.dev/barng.py similarity index 100% rename from config/lemonbar/barng.py rename to config/nix/hm/frobar/.dev/barng.py diff --git a/config/lemonbar/oldbar.py b/config/nix/hm/frobar/.dev/oldbar.py similarity index 100% rename from config/lemonbar/oldbar.py rename to config/nix/hm/frobar/.dev/oldbar.py diff --git a/config/lemonbar/pip.py b/config/nix/hm/frobar/.dev/pip.py similarity index 100% rename from config/lemonbar/pip.py rename to config/nix/hm/frobar/.dev/pip.py diff --git a/config/lemonbar/x.py b/config/nix/hm/frobar/.dev/x.py similarity index 100% rename from config/lemonbar/x.py rename to config/nix/hm/frobar/.dev/x.py diff --git a/config/nix/hm/frobar/.gitignore b/config/nix/hm/frobar/.gitignore new file mode 100644 index 0000000..be91729 --- /dev/null +++ b/config/nix/hm/frobar/.gitignore @@ -0,0 +1,2 @@ +dist/* +frobar.egg-info/* diff --git a/config/nix/hm/frobar/default.nix b/config/nix/hm/frobar/default.nix new file mode 100644 index 0000000..cf1d7a7 --- /dev/null +++ b/config/nix/hm/frobar/default.nix @@ -0,0 +1,31 @@ +{ pkgs ? import { config = { }; overlays = [ ]; } }: +# Tried using pyproject.nix but mpd2 dependency wouldn't resolve, +# is called pyton-mpd2 on PyPi but mpd2 in nixpkgs. +let + frobar = pkgs.python3Packages.buildPythonApplication { + pname = "frobar"; + version = "2.0"; + + propagatedBuildInputs = with pkgs.python3Packages; [ + coloredlogs + notmuch + i3ipc + mpd2 + psutil + pulsectl + pyinotify + ]; + + src = ./.; + }; + frobar_launcher = pkgs.writeShellApplication + { + name = "frobar_launcher"; + runtimeInputs = with pkgs; [ lemonbar-xft wirelesstools ]; + text = '' + ${pkgs.procps}/bin/pkill /bin/frobar || true + ${frobar}/bin/frobar + ''; + }; +in +frobar_launcher diff --git a/config/lemonbar/bar.py b/config/nix/hm/frobar/frobar/__init__.py old mode 100755 new mode 100644 similarity index 97% rename from config/lemonbar/bar.py rename to config/nix/hm/frobar/frobar/__init__.py index 9854fe7..a54813e --- a/config/lemonbar/bar.py +++ b/config/nix/hm/frobar/frobar/__init__.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 -from providers import * +from frobar.providers import * # TODO If multiple screen, expand the sections and share them # TODO Graceful exit -if __name__ == "__main__": +def run(): Bar.init() Updater.init() diff --git a/config/lemonbar/display.py b/config/nix/hm/frobar/frobar/display.py old mode 100755 new mode 100644 similarity index 99% rename from config/lemonbar/display.py rename to config/nix/hm/frobar/frobar/display.py index a109e01..3a18af7 --- a/config/lemonbar/display.py +++ b/config/nix/hm/frobar/frobar/display.py @@ -1,15 +1,17 @@ #!/usr/bin/env python3 import enum -import threading -import time -import i3ipc +import logging import os import signal import subprocess -import logging +import threading +import time + import coloredlogs -import updaters +import i3ipc + +from frobar.notbusy import notBusy coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s") log = logging.getLogger() @@ -168,7 +170,6 @@ class Bar: @staticmethod def updateAll(): - if Bar.running: Bar.string = "" for bar in Bar.everyone: @@ -295,7 +296,7 @@ class SectionThread(threading.Thread): def run(self): while Section.somethingChanged.wait(): - updaters.notBusy.wait() + notBusy.wait() Section.updateAll() animTime = self.ANIMATION_START frameTime = time.perf_counter() @@ -311,7 +312,6 @@ class SectionThread(threading.Thread): class Section: - # TODO Update all of that to base16 # COLORS = ['#272822', '#383830', '#49483e', '#75715e', '#a59f85', '#f8f8f2', # '#f5f4f1', '#f9f8f5', '#f92672', '#fd971f', '#f4bf75', '#a6e22e', diff --git a/config/nix/hm/frobar/frobar/notbusy.py b/config/nix/hm/frobar/frobar/notbusy.py new file mode 100644 index 0000000..690e304 --- /dev/null +++ b/config/nix/hm/frobar/frobar/notbusy.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 + +import threading + +notBusy = threading.Event() diff --git a/config/lemonbar/providers.py b/config/nix/hm/frobar/frobar/providers.py old mode 100755 new mode 100644 similarity index 99% rename from config/lemonbar/providers.py rename to config/nix/hm/frobar/frobar/providers.py index c65f528..219fd20 --- a/config/lemonbar/providers.py +++ b/config/nix/hm/frobar/frobar/providers.py @@ -1,20 +1,21 @@ #!/usr/bin/env python3 import datetime -from updaters import * -from display import * -import pulsectl -import psutil -import subprocess -import socket import ipaddress -import logging -import coloredlogs import json -import notmuch -import mpd +import logging import random -import math +import socket +import subprocess + +import coloredlogs +import mpd +import notmuch +import psutil +import pulsectl + +from frobar.display import * +from frobar.updaters import * coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s") log = logging.getLogger() @@ -43,7 +44,6 @@ def randomColor(seed=0): class TimeProvider(StatefulSection, PeriodicUpdater): - FORMATS = ["%H:%M", "%m-%d %H:%M:%S", "%a %y-%m-%d %H:%M:%S"] NUMBER_STATES = len(FORMATS) DEFAULT_STATE = 1 @@ -257,7 +257,6 @@ class PulseaudioProvider(StatefulSection, ThreadedUpdater): class NetworkProviderSection(StatefulSection, Updater): - NUMBER_STATES = 5 DEFAULT_STATE = 1 diff --git a/config/lemonbar/updaters.py b/config/nix/hm/frobar/frobar/updaters.py old mode 100755 new mode 100644 similarity index 99% rename from config/lemonbar/updaters.py rename to config/nix/hm/frobar/frobar/updaters.py index d3e5986..06b65f3 --- a/config/lemonbar/updaters.py +++ b/config/nix/hm/frobar/frobar/updaters.py @@ -1,22 +1,24 @@ #!/usr/bin/env python3 -import math import functools -import threading -import pyinotify -import os -import time import logging +import math +import os +import threading +import time + import coloredlogs import i3ipc -from display import Text +import pyinotify + +from frobar.display import Text +from frobar.notbusy import notBusy coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s") log = logging.getLogger() # TODO Sync bar update with PeriodicUpdater updates -notBusy = threading.Event() class Updater: @@ -241,7 +243,6 @@ class I3Updater(ThreadedUpdater): class MergedUpdater(Updater): - # TODO OPTI Do not update until end of periodic batch def fetcher(self): text = Text() diff --git a/config/nix/hm/frobar/setup.py b/config/nix/hm/frobar/setup.py new file mode 100644 index 0000000..275440c --- /dev/null +++ b/config/nix/hm/frobar/setup.py @@ -0,0 +1,20 @@ +from setuptools import setup + +setup( + name="frobar", + version="2.0", + install_requires=[ + "coloredlogs", + "notmuch", + "i3ipc", + "python-mpd2", + "psutil", + "pulsectl", + "pyinotify", + ], + entry_points={ + "console_scripts": [ + "frobar = frobar:run", + ] + }, +) From 2d89e1b22423f92726e5843d30939df6302010bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 19 Nov 2023 21:28:42 +0100 Subject: [PATCH 050/108] nix: add mpd conf --- config/llpp.conf | 1 - config/mpd/.dfrecur | 0 config/mpd/mpd.conf | 413 ------------------ config/nix/hm/desktop.nix | 36 +- .../{linuxColors.sh => scripts/linuxColors} | 0 5 files changed, 32 insertions(+), 418 deletions(-) delete mode 100644 config/llpp.conf delete mode 100644 config/mpd/.dfrecur delete mode 100644 config/mpd/mpd.conf rename config/{linuxColors.sh => scripts/linuxColors} (100%) mode change 100644 => 100755 diff --git a/config/llpp.conf b/config/llpp.conf deleted file mode 100644 index 298f180..0000000 --- a/config/llpp.conf +++ /dev/null @@ -1 +0,0 @@ -savepath-command='echo %s' diff --git a/config/mpd/.dfrecur b/config/mpd/.dfrecur deleted file mode 100644 index e69de29..0000000 diff --git a/config/mpd/mpd.conf b/config/mpd/mpd.conf deleted file mode 100644 index 07db98a..0000000 --- a/config/mpd/mpd.conf +++ /dev/null @@ -1,413 +0,0 @@ -# An example configuration file for MPD. -# Read the user manual for documentation: http://www.musicpd.org/doc/user/ - - -# Files and directories ####################################################### -# -# This setting controls the top directory which MPD will search to discover the -# available audio files and add them to the daemon's online database. This -# setting defaults to the XDG directory, otherwise the music directory will be -# be disabled and audio files will only be accepted over ipc socket (using -# file:// protocol) or streaming files over an accepted protocol. -# -music_directory "~/Musiques" -# -# This setting sets the MPD internal playlist directory. The purpose of this -# directory is storage for playlists created by MPD. The server will use -# playlist files not created by the server but only if they are in the MPD -# format. This setting defaults to playlist saving being disabled. -# -playlist_directory "~/.config/mpd/playlists" -# -# This setting sets the location of the MPD database. This file is used to -# load the database at server start up and store the database while the -# server is not up. This setting defaults to disabled which will allow -# MPD to accept files over ipc socket (using file:// protocol) or streaming -# files over an accepted protocol. -# -db_file "~/.cache/mpd/database" -# -# These settings are the locations for the daemon log files for the daemon. -# These logs are great for troubleshooting, depending on your log_level -# settings. -# -# The special value "syslog" makes MPD use the local syslog daemon. This -# setting defaults to logging to syslog, otherwise logging is disabled. -# -log_file "~/.cache/mpd/log" -# -# This setting sets the location of the file which stores the process ID -# for use of mpd --kill and some init scripts. This setting is disabled by -# default and the pid file will not be stored. -# -pid_file "~/.cache/mpd/pid" -# -# This setting sets the location of the file which contains information about -# most variables to get MPD back into the same general shape it was in before -# it was brought down. This setting is disabled by default and the server -# state will be reset on server start up. -# -state_file "~/.cache/mpd/state" -# -# The location of the sticker database. This is a database which -# manages dynamic information attached to songs. -# -sticker_file "~/.cache/mpd/sticker.sql" -# -############################################################################### - - -# General music daemon options ################################################ -# -# This setting specifies the user that MPD will run as. MPD should never run as -# root and you may use this setting to make MPD change its user ID after -# initialization. This setting is disabled by default and MPD is run as the -# current user. -# -#user "nobody" -# -# This setting specifies the group that MPD will run as. If not specified -# primary group of user specified with "user" setting will be used (if set). -# This is useful if MPD needs to be a member of group such as "audio" to -# have permission to use sound card. -# -#group "nogroup" -# -# This setting sets the address for the daemon to listen on. Careful attention -# should be paid if this is assigned to anything other then the default, any. -# This setting can deny access to control of the daemon. -# -# For network -#bind_to_address "any" -# -# And for Unix Socket -#bind_to_address "~/.mpd/socket" -# -# This setting is the TCP port that is desired for the daemon to get assigned -# to. -# -#port "6600" -# -# This setting controls the type of information which is logged. Available -# setting arguments are "default", "secure" or "verbose". The "verbose" setting -# argument is recommended for troubleshooting, though can quickly stretch -# available resources on limited hardware storage. -# -log_level "default" -# -# If you have a problem with your MP3s ending abruptly it is recommended that -# you set this argument to "no" to attempt to fix the problem. If this solves -# the problem, it is highly recommended to fix the MP3 files with vbrfix -# (available from ), at which -# point gapless MP3 playback can be enabled. -# -#gapless_mp3_playback "yes" -# -# Setting "restore_paused" to "yes" puts MPD into pause mode instead -# of starting playback after startup. -# -restore_paused "yes" -# -# This setting enables MPD to create playlists in a format usable by other -# music players. -# -#save_absolute_paths_in_playlists "no" -# -# This setting defines a list of tag types that will be extracted during the -# audio file discovery process. The complete list of possible values can be -# found in the user manual. -#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" -# -# This setting enables automatic update of MPD's database when files in -# music_directory are changed. -# -auto_update "yes" -# -# Limit the depth of the directories being watched, 0 means only watch -# the music directory itself. There is no limit by default. -# -#auto_update_depth "3" -# -############################################################################### - - -# Symbolic link behavior ###################################################### -# -# If this setting is set to "yes", MPD will discover audio files by following -# symbolic links outside of the configured music_directory. -# -#follow_outside_symlinks "yes" -# -# If this setting is set to "yes", MPD will discover audio files by following -# symbolic links inside of the configured music_directory. -# -#follow_inside_symlinks "yes" -# -############################################################################### - - -# Zeroconf / Avahi Service Discovery ########################################## -# -# If this setting is set to "yes", service information will be published with -# Zeroconf / Avahi. -# -#zeroconf_enabled "yes" -# -# The argument to this setting will be the Zeroconf / Avahi unique name for -# this MPD server on the network. -# -#zeroconf_name "Music Player" -# -############################################################################### - - -# Permissions ################################################################# -# -# If this setting is set, MPD will require password authorization. The password -# can setting can be specified multiple times for different password profiles. -# -#password "password@read,add,control,admin" -# -# This setting specifies the permissions a user has who has not yet logged in. -# -#default_permissions "read,add,control,admin" -# -############################################################################### - - -# Database ####################################################################### -# - -#database { -# plugin "proxy" -# host "other.mpd.host" -# port "6600" -#} - -# Input ####################################################################### -# - -input { - plugin "curl" -# proxy "proxy.isp.com:8080" -# proxy_user "user" -# proxy_password "password" -} - -# -############################################################################### - -# Audio Output ################################################################ -# -# MPD supports various audio output types, as well as playing through multiple -# audio outputs at the same time, through multiple audio_output settings -# blocks. Setting this block is optional, though the server will only attempt -# autodetection for one sound card. -# -# An example of an ALSA output: -# -#audio_output { -# type "alsa" -# name "My ALSA Device" -## device "hw:0,0" # optional -## mixer_type "hardware" # optional -## mixer_device "default" # optional -## mixer_control "PCM" # optional -## mixer_index "0" # optional -#} -# -# An example of an OSS output: -# -#audio_output { -# type "oss" -# name "My OSS Device" -## device "/dev/dsp" # optional -## mixer_type "hardware" # optional -## mixer_device "/dev/mixer" # optional -## mixer_control "PCM" # optional -#} -# -# An example of a shout output (for streaming to Icecast): -# -#audio_output { -# type "shout" -# encoding "ogg" # optional -# name "My Shout Stream" -# host "localhost" -# port "8000" -# mount "/mpd.ogg" -# password "hackme" -# quality "5.0" -# bitrate "128" -# format "44100:16:1" -## protocol "icecast2" # optional -## user "source" # optional -## description "My Stream Description" # optional -## url "http://example.com" # optional -## genre "jazz" # optional -## public "no" # optional -## timeout "2" # optional -## mixer_type "software" # optional -#} -# -# An example of a recorder output: -# -#audio_output { -# type "recorder" -# name "My recorder" -# encoder "vorbis" # optional, vorbis or lame -# path "/var/lib/mpd/recorder/mpd.ogg" -## quality "5.0" # do not define if bitrate is defined -# bitrate "128" # do not define if quality is defined -# format "44100:16:1" -#} -# -# An example of a httpd output (built-in HTTP streaming server): -# -audio_output { - type "httpd" - name "geoffrey-music-httpd" - encoder "vorbis" # optional, vorbis or lame - port "8600" - bind_to_address "0.0.0.0" # optional, IPv4 or IPv6 -# quality "5.0" # do not define if bitrate is defined - bitrate "128" # do not define if quality is defined - format "44100:16:1" - max_clients "0" # optional 0=no limit -} -# -# An example of a pulseaudio output (streaming to a remote pulseaudio server) -# -audio_output { - type "pulse" - name "geoffrey-music-pulse" -## server "remote_server" # optional -## sink "remote_server_sink" # optional -} -# -# An example of a winmm output (Windows multimedia API). -# -#audio_output { -# type "winmm" -# name "My WinMM output" -## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional -# or -## device "0" # optional -## mixer_type "hardware" # optional -#} -# -# An example of an openal output. -# -#audio_output { -# type "openal" -# name "My OpenAL output" -## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional -#} -# -## Example "pipe" output: -# -#audio_output { -# type "pipe" -# name "my pipe" -# command "aplay -f cd 2>/dev/null" -## Or if you're want to use AudioCompress -# command "AudioCompress -m | aplay -f cd 2>/dev/null" -## Or to send raw PCM stream through PCM: -# command "nc example.org 8765" -# format "44100:16:2" -#} -# -## An example of a null output (for no audio output): -# -#audio_output { -# type "null" -# name "My Null Output" -# mixer_type "none" # optional -#} -# -# If MPD has been compiled with libsamplerate support, this setting specifies -# the sample rate converter to use. Possible values can be found in the -# mpd.conf man page or the libsamplerate documentation. By default, this is -# setting is disabled. -# -#samplerate_converter "Fastest Sinc Interpolator" -# -############################################################################### - - -# Normalization automatic volume adjustments ################################## -# -# This setting specifies the type of ReplayGain to use. This setting can have -# the argument "off", "album", "track" or "auto". "auto" is a special mode that -# chooses between "track" and "album" depending on the current state of -# random playback. If random playback is enabled then "track" mode is used. -# See for more details about ReplayGain. -# This setting is off by default. -# -replaygain "auto" -# -# This setting sets the pre-amp used for files that have ReplayGain tags. By -# default this setting is disabled. -# -#replaygain_preamp "0" -# -# This setting sets the pre-amp used for files that do NOT have ReplayGain tags. -# By default this setting is disabled. -# -#replaygain_missing_preamp "0" -# -# This setting enables or disables ReplayGain limiting. -# MPD calculates actual amplification based on the ReplayGain tags -# and replaygain_preamp / replaygain_missing_preamp setting. -# If replaygain_limit is enabled MPD will never amplify audio signal -# above its original level. If replaygain_limit is disabled such amplification -# might occur. By default this setting is enabled. -# -#replaygain_limit "yes" -# -# This setting enables on-the-fly normalization volume adjustment. This will -# result in the volume of all playing audio to be adjusted so the output has -# equal "loudness". This setting is disabled by default. -# -#volume_normalization "no" -# -############################################################################### - -# Character Encoding ########################################################## -# -# If file or directory names do not display correctly for your locale then you -# may need to modify this setting. -# -#filesystem_charset "UTF-8" -# -# This setting controls the encoding that ID3v1 tags should be converted from. -# -#id3v1_encoding "ISO-8859-1" -# -############################################################################### - - -# SIDPlay decoder ############################################################# -# -# songlength_database: -# Location of your songlengths file, as distributed with the HVSC. -# The sidplay plugin checks this for matching MD5 fingerprints. -# See http://www.c64.org/HVSC/DOCUMENTS/Songlengths.faq -# -# default_songlength: -# This is the default playing time in seconds for songs not in the -# songlength database, or in case you're not using a database. -# A value of 0 means play indefinitely. -# -# filter: -# Turns the SID filter emulation on or off. -# -#decoder { -# plugin "sidplay" -# songlength_database "/media/C64Music/DOCUMENTS/Songlengths.txt" -# default_songlength "120" -# filter "true" -#} -# -############################################################################### - diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 6587326..efe64a0 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -393,7 +393,21 @@ "x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop"; }; }; - userDirs.enable = true; # TODO Which ones do we want? + userDirs = { + enable = true; # TODO Which ones do we want? + createDirectories = true; + # French, because then it there's a different initial for each, making navigation easier + desktop = null; + download = "${config.home.homeDirectory}/Téléchargements"; + music = "${config.home.homeDirectory}/Musiques"; + pictures = "${config.home.homeDirectory}/Images"; + publicShare = null; + templates = null; + videos = "${config.home.homeDirectory}/Vidéos"; + extraConfig = { + XDG_SCREENSHOTS_DIR = "${config.home.homeDirectory}/Screenshots"; + }; + }; }; services = { unclutter.enable = true; @@ -433,12 +447,23 @@ }; }; }; - mpd.enable = true; + mpd = { + enable = true; + network = { + listenAddress = "0.0.0.0"; # So it can be controlled from home + # TODO ... and whoever is the Wi-Fi network I'm using, which, not great + port = 8601; # FIXME Chose a different one for testing, should revert + startWhenNeeded = true; + }; + extraConfig = '' + restore_paused "yes" + ''; + }; autorandr.enable = true; }; home = { - file = + file = # TODO Should be a xdg.something instead of file in configHome let nixgl = import (builtins.fetchGit { @@ -500,13 +525,16 @@ xorg.xinit xorg.xbacklight # TODO Make this clean. Service? - (callPackage (import ./frobar) {}) # FIXME Call it where needed + (callPackage (import ./frobar) { }) # FIXME Call it where needed # organisation pass thunderbird ]; + sessionVariables = { + MPD_PORT = "${toString config.services.mpd.network.port}"; + }; }; } diff --git a/config/linuxColors.sh b/config/scripts/linuxColors old mode 100644 new mode 100755 similarity index 100% rename from config/linuxColors.sh rename to config/scripts/linuxColors From c9e0c79ab22d3c673844a7202ca43c73f15ab095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 19 Nov 2023 21:48:35 +0100 Subject: [PATCH 051/108] nix: Add mpv --- config/mpv/.dfrecur | 0 .../lua-settings/mpv_thumbnail_script.conf | 71 ------------------- config/mpv/mpv.conf | 4 -- .../mpv_thumbnail_script_client_osc.lua | 1 - .../scripts/mpv_thumbnail_script_server.lua | 1 - config/nix/hm/desktop.nix | 16 ++++- 6 files changed, 14 insertions(+), 79 deletions(-) delete mode 100644 config/mpv/.dfrecur delete mode 100644 config/mpv/lua-settings/mpv_thumbnail_script.conf delete mode 100644 config/mpv/mpv.conf delete mode 120000 config/mpv/scripts/mpv_thumbnail_script_client_osc.lua delete mode 120000 config/mpv/scripts/mpv_thumbnail_script_server.lua diff --git a/config/mpv/.dfrecur b/config/mpv/.dfrecur deleted file mode 100644 index e69de29..0000000 diff --git a/config/mpv/lua-settings/mpv_thumbnail_script.conf b/config/mpv/lua-settings/mpv_thumbnail_script.conf deleted file mode 100644 index c132e4f..0000000 --- a/config/mpv/lua-settings/mpv_thumbnail_script.conf +++ /dev/null @@ -1,71 +0,0 @@ -# The thumbnail cache directory. -# On Windows this defaults to %TEMP%\mpv_thumbs_cache, -# and on other platforms to /tmp/mpv_thumbs_cache. -# The directory will be created automatically, but must be writeable! -# Use absolute paths, and take note that environment variables like %TEMP% are unsupported (despite the default)! -# cache_directory=%HOME%/.cache/mpv/thumbnails -cache_directory=/tmp/my_mpv_thumbnails -# THIS IS NOT A WINDOWS PATH. COMMENT IT OUT OR ADJUST IT YOURSELF. - -# Whether to generate thumbnails automatically on video load, without a keypress -# Defaults to yes -autogenerate=no - -# Only automatically thumbnail videos shorter than this (in seconds) -# You will have to press T (or your own keybind) to enable the thumbnail previews -# Set to 0 to disable the check, ie. thumbnail videos no matter how long they are -# Defaults to 3600 (one hour) -autogenerate_max_duration=3600 - -# Use mpv to generate thumbnail even if ffmpeg is found in PATH -# ffmpeg is slightly faster than mpv but lacks support for ordered chapters in MKVs, -# which can break the resulting thumbnails. You have been warned. -# Defaults to yes (don't use ffmpeg) -prefer_mpv=no - -# Explicitly disable subtitles on the mpv sub-calls -# mpv can and will by default render subtitles into the thumbnails. -# If this is not what you wish, set mpv_no_sub to yes -# Defaults to no -mpv_no_sub=no - -# Enable to disable the built-in keybind ("T") to add your own, see after the block -disable_keybinds=no - -# The maximum dimensions of the thumbnails, in pixels -# Defaults to 200 and 200 -thumbnail_width=200 -thumbnail_height=200 - -# The thumbnail count target -# (This will result in a thumbnail every ~10 seconds for a 25 minute video) -thumbnail_count=150 - -# The above target count will be adjusted by the minimum and -# maximum time difference between thumbnails. -# The thumbnail_count will be used to calculate a target separation, -# and min/max_delta will be used to constrict it. - -# In other words, thumbnails will be: -# - at least min_delta seconds apart (limiting the amount) -# - at most max_delta seconds apart (raising the amount if needed) -# Defaults to 5 and 90, values are seconds -min_delta=5 -max_delta=90 -# 120 seconds aka 2 minutes will add more thumbnails only when the video is over 5 hours long! - -# Below are overrides for remote urls (you generally want less thumbnails, because it's slow!) -# Thumbnailing network paths will be done with mpv (leveraging youtube-dl) - -# Allow thumbnailing network paths (naive check for "://") -# Defaults to no -thumbnail_network=no -# Override thumbnail count, min/max delta, as above -remote_thumbnail_count=60 -remote_min_delta=15 -remote_max_delta=120 - -# Try to grab the raw stream and disable ytdl for the mpv subcalls -# Much faster than passing the url to ytdl again, but may cause problems with some sites -# Defaults to yes -remote_direct_stream=yes diff --git a/config/mpv/mpv.conf b/config/mpv/mpv.conf deleted file mode 100644 index b5f1c61..0000000 --- a/config/mpv/mpv.conf +++ /dev/null @@ -1,4 +0,0 @@ -no-audio-display -save-position-on-quit -# Required by thumbnails script -osc=no diff --git a/config/mpv/scripts/mpv_thumbnail_script_client_osc.lua b/config/mpv/scripts/mpv_thumbnail_script_client_osc.lua deleted file mode 120000 index 533c030..0000000 --- a/config/mpv/scripts/mpv_thumbnail_script_client_osc.lua +++ /dev/null @@ -1 +0,0 @@ -/usr/share/mpv/scripts/mpv_thumbnail_script_client_osc.lua \ No newline at end of file diff --git a/config/mpv/scripts/mpv_thumbnail_script_server.lua b/config/mpv/scripts/mpv_thumbnail_script_server.lua deleted file mode 120000 index b8c2ab0..0000000 --- a/config/mpv/scripts/mpv_thumbnail_script_server.lua +++ /dev/null @@ -1 +0,0 @@ -/usr/share/mpv/scripts/mpv_thumbnail_script_server.lua \ No newline at end of file diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index efe64a0..f377623 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -380,6 +380,20 @@ pass.enable = true; }; autorandr.enable = true; + mpv = { + enable = true; + config = { + audio-display = false; + save-position-on-quit = true; + osc = false; # # Required by thumbnail script + }; + scripts = with pkgs.mpvScripts; [ thumbnail ]; + scriptOpts = { + mpv_thumbnail_script = { + cache_directory = "/tmp/mpv_thumbs_${config.home.username}"; + }; + }; + }; }; xdg = { @@ -493,8 +507,6 @@ # multimedia common gimp inkscape - mpv - mpvScripts.thumbnail libreoffice # data management From fe1303ccc9836bb6ab2887200e64d57177cc5121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 19 Nov 2023 22:41:09 +0100 Subject: [PATCH 052/108] nix: More misc config --- config/mypy/config | 7 ---- config/nix/hm/common.nix | 4 +- config/nix/hm/desktop.nix | 39 ++++++++++--------- config/{ => nix/hm}/pythonstartup.py | 5 ++- config/nix/hm/vim.nix | 19 +++++++-- .../unprocessed/config}/offlineimap.py | 0 .../{ => nix/unprocessed/config}/optiSvgo.yml | 0 config/pulse/.dfrecur | 0 config/pulse/client.conf | 1 - config/pycodestyle | 3 -- config/scripts/optimize | 2 + 11 files changed, 45 insertions(+), 35 deletions(-) delete mode 100644 config/mypy/config rename config/{ => nix/hm}/pythonstartup.py (96%) rename config/{ => nix/unprocessed/config}/offlineimap.py (100%) rename config/{ => nix/unprocessed/config}/optiSvgo.yml (100%) delete mode 100644 config/pulse/.dfrecur delete mode 100644 config/pulse/client.conf delete mode 100644 config/pycodestyle diff --git a/config/mypy/config b/config/mypy/config deleted file mode 100644 index 8352875..0000000 --- a/config/mypy/config +++ /dev/null @@ -1,7 +0,0 @@ -[mypy] -cache_dir = ~/.cache/mypy -ignore_missing_imports = True -disallow_untyped_defs = True -disallow_untyped_calls = True -disallow_incomplete_defs = True -disallow_untyped_decorators = True diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 7269f79..af472d5 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -324,7 +324,6 @@ in }; xdg = { configFile = { - # TODO Should be xdg.configFile "ccache.conf" = { text = "ccache_dir = ${config.xdg.cacheHome}/ccache"; }; @@ -346,6 +345,9 @@ in log-scale: yes ''; }; + "pythonstartup.py" = { + text = (builtins.readFile ./pythonstartup.py); + }; }; }; home = { diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index f377623..8e4b5b7 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -422,6 +422,27 @@ XDG_SCREENSHOTS_DIR = "${config.home.homeDirectory}/Screenshots"; }; }; + configFile = { + "pulse/client.conf" = { + text = ''cookie-file = .config/pulse/pulse-cookie''; + }; + "xinitrc" = + let + nixgl = import + (builtins.fetchGit { + url = "https://github.com/nix-community/nixGL"; + rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5"; + }) + { }; + in + { + # TODO Configurable + source = pkgs.writeShellScript "xinitrc" '' + ${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path} + ${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ${config.xsession.windowManager.command} + ''; + }; + }; }; services = { unclutter.enable = true; @@ -477,24 +498,6 @@ }; home = { - file = # TODO Should be a xdg.something instead of file in configHome - let - nixgl = import - (builtins.fetchGit { - url = "https://github.com/nix-community/nixGL"; - rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5"; - }) - { }; - in - { - "${config.xdg.configHome}/xinitrc" = { - # TODO Configurable - source = pkgs.writeShellScript "xinitrc" '' - ${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path} - ${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ${config.xsession.windowManager.command} - ''; - }; - }; packages = with pkgs; [ # remote tigervnc diff --git a/config/pythonstartup.py b/config/nix/hm/pythonstartup.py similarity index 96% rename from config/pythonstartup.py rename to config/nix/hm/pythonstartup.py index b2837ad..61f068c 100644 --- a/config/pythonstartup.py +++ b/config/nix/hm/pythonstartup.py @@ -1,10 +1,11 @@ -import rlcompleter +#!/usr/bin/env python3 + import sys import os # From https://github.com/python/cpython/blob/v3.7.0b5/Lib/site.py#L436 # Changing the history file -def register_readline(): +def register_readline() -> None: import atexit try: import readline diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index 89ce9e3..76bcb44 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, config, ... }: let nixvim = import (builtins.fetchGit { url = "https://github.com/nix-community/nixvim"; @@ -178,10 +178,23 @@ in }; isort.enabled = true; mccabe.enabled = true; - pycodestyle.enabled = true; + pycodestyle = { + enabled = true; + maxLineLength = 88; # Compatibility with Black + }; pyflakes.enabled = true; pylint.enabled = true; - pylsp_mypy.enabled = true; + pylsp_mypy = { + enabled = true; + overrides = [ + "--cache-dir=${config.xdg.cacheHome}/mypy" + "--ignore-missing-imports" + "--disallow-untyped-defs" + "--disallow-untyped-calls" + "--disallow-incomplete-defs" + "--disallow-untyped-decorators" + ]; + }; # FIXME Somehow no warning is shown # TODO Could add some, could also remove some }; diff --git a/config/offlineimap.py b/config/nix/unprocessed/config/offlineimap.py similarity index 100% rename from config/offlineimap.py rename to config/nix/unprocessed/config/offlineimap.py diff --git a/config/optiSvgo.yml b/config/nix/unprocessed/config/optiSvgo.yml similarity index 100% rename from config/optiSvgo.yml rename to config/nix/unprocessed/config/optiSvgo.yml diff --git a/config/pulse/.dfrecur b/config/pulse/.dfrecur deleted file mode 100644 index e69de29..0000000 diff --git a/config/pulse/client.conf b/config/pulse/client.conf deleted file mode 100644 index 199bd83..0000000 --- a/config/pulse/client.conf +++ /dev/null @@ -1 +0,0 @@ -cookie-file = .config/pulse/pulse-cookie diff --git a/config/pycodestyle b/config/pycodestyle deleted file mode 100644 index c89fb1c..0000000 --- a/config/pycodestyle +++ /dev/null @@ -1,3 +0,0 @@ -[pycodestyle] -# Compatibility with Black -max-line-length = 88 diff --git a/config/scripts/optimize b/config/scripts/optimize index c2ef705..2113bd2 100755 --- a/config/scripts/optimize +++ b/config/scripts/optimize @@ -1,5 +1,6 @@ #!/usr/bin/env bash + # Optimizes everything the script can find in a folder, # meaning it will compress files as much as possible, # without losing any data (verification will be done @@ -8,6 +9,7 @@ # TODO Run in parallel # TODO Lots of dupplicated code there +# TODO Maybe replace part with https://github.com/toy/image_optim? dir=${1:-$PWD} total=$(mktemp) From dfb47f17f59736cb0854db6a7b247fa7bda87400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 19 Nov 2023 23:09:10 +0100 Subject: [PATCH 053/108] nix: Add qutebrowser --- config/nix/hm/desktop.nix | 54 +++++++++++++++++++++++- config/qutebrowser/.dfrecur | 0 config/qutebrowser/config.py | 81 ------------------------------------ 3 files changed, 53 insertions(+), 82 deletions(-) delete mode 100644 config/qutebrowser/.dfrecur delete mode 100644 config/qutebrowser/config.py diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 8e4b5b7..21ede78 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -329,7 +329,59 @@ programs = { # Browser - qutebrowser.enable = true; + qutebrowser = { + enable = true; + keyBindings = { + normal = { + # Match tab behaviour to i3. Not that I use them. + "H" = "tab-prev"; + "J" = "back"; + "K" = "forward"; + "L" = "tab-next"; + # "T" = null; + "af" = "spawn --userscript freshrss"; # TODO Broken? + "as" = "spawn --userscript shaarli"; # TODO I don't use shaarli anymore + # "d" = null; + "u" = "undo --window"; + # TODO Unbind d and T (?) + }; + }; + loadAutoconfig = true; # FIXME Salvage stuff from autoconfig.yml + searchEngines = rec { + DEFAULT = ecosia; + ampwhat = "http://www.amp-what.com/unicode/search/{}"; + aw = ampwhat; + ddg = duckduckgo; + duckduckgo = "https://duckduckgo.com/?q={}&ia=web"; + ecosia = "https://www.ecosia.org/search?q={}"; + github = "https://github.com/search?q={}"; + google = "https://www.google.fr/search?q={}"; + g = google; + npm = "https://www.npmjs.com/search?q={}"; + q = qwant; + qwant = "https://www.qwant.com/?t=web&q={}"; + wolfram = "https://www.wolframalpha.com/input/?i={}"; + youtube = "https://www.youtube.com/results?search_query={}"; + yt = youtube; + }; + settings = { + downloads.location.prompt = false; + tabs = { + show = "never"; + tabs_are_windows = true; + }; + url = { + open_base_url = true; + start_pages = "https://geoffrey.frogeye.fr/blank.html"; + }; + content = { + # I had this setting below, not sure if it did something special + # config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*") + cookies.accept = "no-3rdparty"; + prefers_reduced_motion = true; + }; + }; + }; # Terminal alacritty = { diff --git a/config/qutebrowser/.dfrecur b/config/qutebrowser/.dfrecur deleted file mode 100644 index e69de29..0000000 diff --git a/config/qutebrowser/config.py b/config/qutebrowser/config.py deleted file mode 100644 index 82d5b3b..0000000 --- a/config/qutebrowser/config.py +++ /dev/null @@ -1,81 +0,0 @@ -import os - -# Public static configuration for qutebrowser -# Note that private stuff (permissions, per-site rules) -# are in autoconfig in gdotfiles - -# Prompt the user for the download location. If set to false, -# `downloads.location.directory` will be used. -# Type: Bool -c.downloads.location.prompt = False - -# When to show the tab bar. -# Type: String -# Valid values: -# - always: Always show the tab bar. -# - never: Always hide the tab bar. -# - multiple: Hide the tab bar if only one tab is open. -# - switching: Show the tab bar when switching tabs. -c.tabs.show = "never" - -# Open a new window for every tab. -# Type: Bool -c.tabs.tabs_are_windows = True - -# Open base URL of the searchengine if a searchengine shortcut is -# invoked without parameters. -# Type: Bool -c.url.open_base_url = True - -# Search engines which can be used via the address bar. Maps a search -# engine name (such as `DEFAULT`, or `ddg`) to a URL with a `{}` -# placeholder. The placeholder will be replaced by the search term, use -# `{{` and `}}` for literal `{`/`}` signs. The search engine named -# `DEFAULT` is used when `url.auto_search` is turned on and something -# else than a URL was entered to be opened. Other search engines can be -# used by prepending the search engine name to the search term, e.g. -# `:open google qutebrowser`. -# Type: Dict -c.url.searchengines = { - "DEFAULT": "https://www.ecosia.org/search?q={}", - "aw": "http://www.amp-what.com/unicode/search/{}", - "ddg": "https://duckduckgo.com/?q={}&ia=web", - "duckduckgo": "https://duckduckgo.com/?q={}&ia=web", - "ecosia": "https://www.ecosia.org/search?q={}", - "github": "https://github.com/search?q={}", - "google": "https://www.google.fr/search?q={}", - "npm": "https://www.npmjs.com/search?q={}", - "q": "https://www.qwant.com/?t=web&q={}", - "qwant": "https://www.qwant.com/?t=web&q={}", - "wolfram": "https://www.wolframalpha.com/input/?i={}", - "youtube": "https://www.youtube.com/results?search_query={}", -} - -# Only allow first party cookies -config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*") - -# Request websites to reduce non-essential motion/animations -config.set("content.prefers_reduced_motion", True) - -# Page(s) to open at the start. -# Type: List of FuzzyUrl, or FuzzyUrl -c.url.start_pages = "https://geoffrey.frogeye.fr/blank.html" - -# Bindings for normal mode -config.bind("H", "tab-prev") -config.bind("J", "back") -config.bind("K", "forward") -config.bind("L", "tab-next") -config.unbind("T") -config.bind("af", "spawn --userscript freshrss") -config.bind("as", "spawn --userscript shaarli") -config.bind("u", "undo --window") - -dirname = os.path.dirname(__file__) -filename = os.path.join(dirname, "theme.py") -if os.path.exists(filename): - with open(filename) as file: - exec(file.read()) - -# Uncomment this to still load settings configured via autoconfig.yml -config.load_autoconfig() From d0c743ec3094b2630fb198df90cdd6b3c5768869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 19 Nov 2023 23:19:03 +0100 Subject: [PATCH 054/108] nix: Even more misc config --- config/nix/hm/common.nix | 3 +++ config/nix/hm/desktop.nix | 11 +++++++++++ config/{ => nix/hm}/screenrc | 0 .../unprocessed/config}/systemd/user/.gitignore | 0 .../config}/systemd/user/ipfs.service | 0 .../config}/systemd/user/melfetch.service | 0 .../config}/systemd/user/melfetch.timer | 0 .../config}/systemd/user/urxvtd.service | 0 .../config}/systemd/user/urxvtd.socket | 0 .../config}/systemd/user/x0vncserver.service | 0 config/rofi/.gitignore | 2 -- config/rofi/config | 4 ---- config/rofi/config.rasi | 5 ----- config/rofimoji.rc | 3 --- config/terminfo/a/alacritty | Bin 2376 -> 0 bytes config/terminfo/a/alacritty-256color | Bin 2402 -> 0 bytes config/terminfo/r/rxvt-unicode | Bin 2213 -> 0 bytes config/terminfo/r/rxvt-unicode-256color | Bin 2239 -> 0 bytes 18 files changed, 14 insertions(+), 14 deletions(-) rename config/{ => nix/hm}/screenrc (100%) rename config/{ => nix/unprocessed/config}/systemd/user/.gitignore (100%) rename config/{ => nix/unprocessed/config}/systemd/user/ipfs.service (100%) rename config/{ => nix/unprocessed/config}/systemd/user/melfetch.service (100%) rename config/{ => nix/unprocessed/config}/systemd/user/melfetch.timer (100%) rename config/{ => nix/unprocessed/config}/systemd/user/urxvtd.service (100%) rename config/{ => nix/unprocessed/config}/systemd/user/urxvtd.socket (100%) rename config/{ => nix/unprocessed/config}/systemd/user/x0vncserver.service (100%) delete mode 100644 config/rofi/.gitignore delete mode 100644 config/rofi/config delete mode 100644 config/rofi/config.rasi delete mode 100644 config/rofimoji.rc delete mode 100644 config/terminfo/a/alacritty delete mode 100644 config/terminfo/a/alacritty-256color delete mode 100644 config/terminfo/r/rxvt-unicode delete mode 100644 config/terminfo/r/rxvt-unicode-256color diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index af472d5..85c095d 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -348,6 +348,9 @@ in "pythonstartup.py" = { text = (builtins.readFile ./pythonstartup.py); }; + "screenrc" = { + text = (builtins.readFile ./screenrc); + }; }; }; home = { diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 21ede78..9d9df2a 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -430,6 +430,10 @@ rofi = { enable = true; pass.enable = true; + extraConfig = { + lazy-grab = false; + matching = "regex"; + }; }; autorandr.enable = true; mpv = { @@ -494,6 +498,13 @@ ${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ${config.xsession.windowManager.command} ''; }; + "rofimoji.rc" = { + text = '' + skin-tone = neutral + files = [emojis, math] + action = clipboard + ''; + }; }; }; services = { diff --git a/config/screenrc b/config/nix/hm/screenrc similarity index 100% rename from config/screenrc rename to config/nix/hm/screenrc diff --git a/config/systemd/user/.gitignore b/config/nix/unprocessed/config/systemd/user/.gitignore similarity index 100% rename from config/systemd/user/.gitignore rename to config/nix/unprocessed/config/systemd/user/.gitignore diff --git a/config/systemd/user/ipfs.service b/config/nix/unprocessed/config/systemd/user/ipfs.service similarity index 100% rename from config/systemd/user/ipfs.service rename to config/nix/unprocessed/config/systemd/user/ipfs.service diff --git a/config/systemd/user/melfetch.service b/config/nix/unprocessed/config/systemd/user/melfetch.service similarity index 100% rename from config/systemd/user/melfetch.service rename to config/nix/unprocessed/config/systemd/user/melfetch.service diff --git a/config/systemd/user/melfetch.timer b/config/nix/unprocessed/config/systemd/user/melfetch.timer similarity index 100% rename from config/systemd/user/melfetch.timer rename to config/nix/unprocessed/config/systemd/user/melfetch.timer diff --git a/config/systemd/user/urxvtd.service b/config/nix/unprocessed/config/systemd/user/urxvtd.service similarity index 100% rename from config/systemd/user/urxvtd.service rename to config/nix/unprocessed/config/systemd/user/urxvtd.service diff --git a/config/systemd/user/urxvtd.socket b/config/nix/unprocessed/config/systemd/user/urxvtd.socket similarity index 100% rename from config/systemd/user/urxvtd.socket rename to config/nix/unprocessed/config/systemd/user/urxvtd.socket diff --git a/config/systemd/user/x0vncserver.service b/config/nix/unprocessed/config/systemd/user/x0vncserver.service similarity index 100% rename from config/systemd/user/x0vncserver.service rename to config/nix/unprocessed/config/systemd/user/x0vncserver.service diff --git a/config/rofi/.gitignore b/config/rofi/.gitignore deleted file mode 100644 index ba58f6e..0000000 --- a/config/rofi/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -theme.config -theme.rasi diff --git a/config/rofi/config b/config/rofi/config deleted file mode 100644 index fc193ca..0000000 --- a/config/rofi/config +++ /dev/null @@ -1,4 +0,0 @@ -#include "theme.config" -rofi.theme: theme -rofi.lazy-grab: false -rofi.matching: regex diff --git a/config/rofi/config.rasi b/config/rofi/config.rasi deleted file mode 100644 index 9843b5f..0000000 --- a/config/rofi/config.rasi +++ /dev/null @@ -1,5 +0,0 @@ -configuration { - lazy-grab: false; - matching: "regex"; -} -@theme "theme" diff --git a/config/rofimoji.rc b/config/rofimoji.rc deleted file mode 100644 index 25e7911..0000000 --- a/config/rofimoji.rc +++ /dev/null @@ -1,3 +0,0 @@ -skin-tone = neutral -files = [emojis, math] -action = clipboard diff --git a/config/terminfo/a/alacritty b/config/terminfo/a/alacritty deleted file mode 100644 index d02394cd0f368493f0388e36e8b1105b1a78fe64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2376 zcma)6U1(fI6rQ;=Ym8zQrC_+WR_xePwYhih+}*vsF{@3hF-_QLw8m}&NwfLcWV78Q z+a~E|qo5*1P{aoj9~4Cd`%sXIRS{OopTE7?ZwBn7&f7%7g7&J`+^rR5z>N(j~e2tag3g8!8E1HBdEUWoc8|Ev>K zaB>S&w~_7SA+m?;1&4_AkY3VHUI6|g8HYSYN@S5NYxkGQtK>9!6ZnVZ6Y?40S#pk? zCl|;i@&ow^+E>U`a*h10N7w5u)GVnDaGT}#1MalEUf)e0p^_%)KH5nS&>q@P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5-(GSm1j0JG0W_kJ6Sg IdbO_pUk}w;Gynhq diff --git a/config/terminfo/a/alacritty-256color b/config/terminfo/a/alacritty-256color deleted file mode 100644 index a76418fddfc1a3f7ee6bbfa1cf648641e2730c33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2402 zcma)6U1(fI6rQ;=Yph}wMKD}jBX(@5Ho151y}NsRV^*71W16thXpP+llJ4eblg(zc zyKRzgHVP_I1Vwxh@j+2Uunz^PXho|}?Sn``1ocUTg4CBj6zNN3J!fWi(_n;zob!G2 z&75!M&d=_&I>`=lC&|;b*mz+)Th3Rj%ll*y&(0U-%PSo%tz$7?o$i2+4%Jg3gsOi8 zASxrle`pN>zZK#>h{hKGj1^RHatlVzB^y}Q-lX!NqDS(+VTqb$c}S%uZuE9?#S z4tt+{%+9dS*?IOoyTmTDU)b;LPj-#nU=7yBxAS}X{rn;R2={ozd--8L%riX8XZQkN z;xF;n`CI&5{sI4#pXFcj@AyUjBmbFizX(M+KJ0tR<b#?Ab3-d`s|GC2RsacXhuD?PIW;axecT~ zh?EQp@I-*PvY?vN(CCGDLW_|MP#J<4B=#N$FqnhnVoJG=A5O!hGIAoP3W`M8$BHDf zL@W8o)S5@Y<^YDBK}~tU)Y5Bu_yv%qDwV1%6-@8yb{(gy2ZqCX?aYHEU|!@y9YhZ( z1L`ZhRbr>XJdNv>F1DV5cot$96gL1R<0e#2svKgL4&-znG9(9q#8JoLY1|AqlHiH} z+mhB>qvuVz)AnP~1)t%mg)4#^pgtDYp~zs9ppQ}>ZxURYQU;m?7oZfJTao9Q1n15} z_?Ut`!QLzmlA`9;#XgZcPVB5b3MbPBBmT2dNf6Do$Pqh%7h#ZylqiLw3dbuZ;9x{# zXB^bxq8hm(LK*;-no6L)rmiS?Vg=d>-S&Y7nkIlIMFdCON4CMH9U^06}DQ?=U4O1-{{hj0`kmB1ZMCE)DS zPeR~sdJ!HLo(U)j>ik-wIz-(HS|aYJ#7mNqzA45Nf?~KP2yjyn^kp$+34=+4p+@N# zgz?JJEJ*rhToh>UKzj$;J22knDn=TU21AYDt#s)c^bGnM-6*cT%x2L^5UWDwNF zUU&q9z5`d(l6BE7s-BuyOeo2XD=lpH b!!r~U9vrG(o_Yow%l%EtU1vkRzoGtLgl%Dg diff --git a/config/terminfo/r/rxvt-unicode b/config/terminfo/r/rxvt-unicode deleted file mode 100644 index 7650d3cfe25183d4d8a251406a8fdee3b5f3f96d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2213 zcmb_cO=w(I6h8O8j8#iP5m7s&rrKNEv`yyy&5zIgwoOA!ZD}kHO;eh5@-ykoWHOoj z&qV2>f_6~^!3uVv2-#F9qG)m9-@--R2!g9_-T8wcbRp00oHt{WCPgZ~;e7Y|&OPVe z`|de!wkwYs>1isey^+$wT=~FkA$x8rGg?_In#!Z4e6}#0Yub};dL>)POwBh9EY6fi z^Lt4t`p1M2G=2=~I6X*D!VzqE($u+QGyk2y2(pL_YM{qyJ3T|YsTm%RdZ?HBX#o5r zjR41JlFGC|74Qpmk=~@sU_o$2@G5;kt8|S%r5p4WJm1p~^b_3z`;~sDKP9F`*(wO) zFn*F4+hARydsM$Vq0;J%%BV?IRCB7LE~wWrcL{b`y{+DrxFEQy-d7*ic(~F=TvgZA z4fTz>seV+q)X(ZSb-R{f7!Md*jUaf$cnlZ>M~pt>q>(mG8AHZL@LV@O7Jm?YW_)3M zX?$yZC;BFEo5>lEnor2sD9E1rv%`EAzUMah>+_qB`w?%Mamn(5o#tV)Pt;4m0bxOq zu8q9LX>-J!FbihcTryuXFPfLkx7N&VzRQ2}zH^`JzGtqQ*UV4M&yn}F$Cn{-L9?iSHspw82wbFF|sqFBU@-2MF(|O7cHIfbFc^wPs{^};%AFNeV8>e95rng0yTP4B z0Fv_jdT=NBP`rlk_^$8yaX;n93BjabiqVcSid%9HLB-i6@wIzvr)V2o^6GqXLXOr6pFli(G9d$X(qAXM ztW5EWLSC*Du1gl?GI)S<7{klCuZu|{t=1nIiYB-tH-7Iq_g-_+)5Mjq^m3xA+fk1}CyCEQ_ROO)gHCPQs_HgfcJ-(P zJEGz><%+UuDlWG5*#l?Ag`q5rT-7yi0<~t(@Gpk{nws&2?dzt$ E0c9C}>i_@% diff --git a/config/terminfo/r/rxvt-unicode-256color b/config/terminfo/r/rxvt-unicode-256color deleted file mode 100644 index 3f43d0d567f4bc450e2354e00fde5760e82074a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2239 zcmb_cO=w(I6h8O8j8#iPDWZ0WPPMl`X_L&m?`LLwCex&C8e;lGV{vGj(j+rUCY`^` zy!_9k(nSUBq6mTtcA*H_R4AfoapB*>McoL3t8U%-gCKMv&vVXuW0NLDD!$=-_dDM` z=idA7Id67|OV1v=E!mds8ut ziE&UZwl@=dC11*x=VL>QH7{4(2SUI<#stvEAAx|A@Gv}uiof9j;a}WLzZ)3AEC3B! z;0f3P&%thJL&b(Z=!ZcVLVg;?5GP<7JXnA_@=I_T-hivfeE%KBYw!WA!gcr*Zo*fn zd=EdsPjDOAukbtk$uS*53Ey|n=t<((h1SDCGi^0T|v7l z-V*O}obO)~?~4yZ9;~zxSH%r+Q+y+Ci66yn@w50%+zB%@?ICTe=KGIn+Yx>Ls5YRT z)-u`|ZAAMBl^fc}to#0F+85fF+PB(w?B7D%rc=h_`jb4iGLq7Kp3$F2ZO;b1IluXM z0OJka;Vc*NpngOjVDC8M5HsJ;gd?qSRv*)+^pfuBOZuz&W&Mi&=9<~fclmGX+Yh+z zd-|$=UH?S?9P_^B+}$m&x2)g$mwSAg{bLhteb&EwcfvLPYS|hIqMwemMs`MIWD9JA z=&;PoiXpSEtSFhSqF_!U^hbx)0FE!A(HKS@y-S0Hes~n6ezdf*3;4MqF;s!wDRd5@ z^#r1;Y*J359fRnIa<@QqZyY_lh+q(;jkuMfAd4VD5`#sIkD0-oUUZ7VPz`emC|LxG z;}s{Q?WtWas(5EN2I1LoyWyP`1WYQ@>!F;WL(v+p=~}MsI&R8!9M_1);{*nRmBP2- zwGU$MAY4Q=R}knJ$#V#XL9Svn6mf$C42!wVm|#pYrU+G>kY&y}jGjXh$A|aU4bd)? z_|@s+m>g>oIsq$mGA2V!GT0=vEKkvjOkQphs!JZtBCrw0aSSf!fi5PAX<>h4A)26$ z;3KAG#gU$CNLM0NNUeYxvSP|Q`ia1|klF!FAWcfQNEs>VVS~sVmRhxKJn*i=|SzT&c{=RI9a`=grQ}&CSm*EG#ZAEiEtC z>y5_BN_$U7@BTvv4#$s7_2sFr&!D9f)OhJc0dSyVouD`2%9^{7aYd8F41xrKBFLgS zL~H`ONX0#%I74ww6_;0W4=C;dGgz7HZ*sgD^bCD=c%}GNW=|n?N(k7biWVj_Q?8Z5 zk7C4fxu$M)a_j}V<7LOTO}io6X8T`f2UsD@?Vf%aGZv^{@0RR91 From 5d5750b2dbfa6d7b2ee0d18da4372110cfb0d24e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 20 Nov 2023 22:09:28 +0100 Subject: [PATCH 055/108] nix: Add tmux --- config/nix/hm/common.nix | 26 +++++++++++++++++++++++++- config/nix/hm/style.nix | 8 ++++++-- config/{tmux => nix/hm}/tmux.conf | 15 --------------- 3 files changed, 31 insertions(+), 18 deletions(-) rename config/{tmux => nix/hm}/tmux.conf (54%) diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 85c095d..bde8dfc 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -117,7 +117,6 @@ in gdb = "gdb -x ${config.xdg.configHome}/gdbinit"; iftop = "iftop -c ${config.xdg.configHome}/iftoprc"; lmms = "lmms --config ${config.xdg.configHome}/lmmsrc.xml"; - tmux = "tmux -f ${config.xdg.configHome}/tmux/tmux.conf"; # Preference vi = "nvim"; @@ -310,6 +309,31 @@ in }; extraConfig = builtins.readFile ./inputrc; }; + tmux = + let + themepack = pkgs.tmuxPlugins.mkTmuxPlugin + rec { + pluginName = "tmux-themepack"; + version = "1.1.0"; + rtpFilePath = "themepack.tmux"; + src = pkgs.fetchFromGitHub { + owner = "jimeh"; + repo = "tmux-themepack"; + rev = "${version}"; + sha256 = "f6y92kYsKDFanNx5ATx4BkaB/E7UrmyIHU/5Z01otQE="; + }; + }; + in + { + enable = true; + mouse = false; + clock24 = true; + # TODO Vim mode? + plugins = with pkgs.tmuxPlugins; [ + sensible + ]; + extraConfig = builtins.readFile ./tmux.conf + "source-file ${themepack}/share/tmux-plugins/tmux-themepack/powerline/default/green.tmuxtheme\n"; + }; }; services = { gpg-agent = { diff --git a/config/nix/hm/style.nix b/config/nix/hm/style.nix index 935dc5c..07b0700 100644 --- a/config/nix/hm/style.nix +++ b/config/nix/hm/style.nix @@ -28,8 +28,11 @@ in }; }; - targets.vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR) - # targets.i3.enable = false; # I prefer my own styles + targets = { + vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR) + i3.enable = false; # I prefer my own styles + tmux.enable = false; # Using another theme + }; }; # Fix https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal @@ -37,4 +40,5 @@ in dconf.enable = false; # Otherwise standalone home-manager complains it can't find /etc/dbus-1/session.conf on Arch. # Symlinking it to /usr/share/dbus-1/session.conf goes further but not much. + } diff --git a/config/tmux/tmux.conf b/config/nix/hm/tmux.conf similarity index 54% rename from config/tmux/tmux.conf rename to config/nix/hm/tmux.conf index bca3ae4..4164508 100644 --- a/config/tmux/tmux.conf +++ b/config/nix/hm/tmux.conf @@ -9,24 +9,9 @@ bind-key -n M-7 select-window -t 7 bind-key -n M-8 select-window -t 8 bind-key -n M-9 select-window -t 9 -set -g mouse off # https://superuser.com/a/1007721 bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'" # Inform tmux that alacritty supports RGB # (because for some reason terminfo doesn't?) set -ga terminal-overrides ',alacritty*:RGB' - -# List of plugins -set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'tmux-plugins/tmux-sensible' - -set -g @plugin 'jimeh/tmux-themepack' -set -g @themepack 'powerline/block/green' - -set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.cache/tmuxplugins/' - -# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) -if "test ! -d ~/.cache/tmuxplugins/tpm" \ - "run 'git clone https://github.com/tmux-plugins/tpm ~/.cache/tmuxplugins/tpm && ~/.cache/tmuxplugins/tpm/bin/install_plugins'" -run -b '~/.cache/tmuxplugins/tpm/tpm' From c7d5a229d75d955ac157c8f77a04ef21f9254b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 20 Nov 2023 22:42:51 +0100 Subject: [PATCH 056/108] nix: Finishing misc in config --- config/Xresources/.gitignore | 1 - config/Xresources/main | 4 -- config/Xresources/urxvt | 61 ------------------- config/Xresources/xft | 9 --- config/Xresources/xterm | 15 ----- config/nix/hm/common.nix | 2 + config/nix/hm/desktop.nix | 17 +++++- .../config}/tridactyl/themes/.gitignore | 0 .../unprocessed/config}/tridactyl/tridactylrc | 0 config/{ => nix/unprocessed/config}/xinitrc | 0 config/user-dirs.dirs | 15 ----- config/user-dirs.locale | 1 - config/ycm_extra_conf.py | 4 -- 13 files changed, 18 insertions(+), 111 deletions(-) delete mode 100644 config/Xresources/.gitignore delete mode 100644 config/Xresources/main delete mode 100644 config/Xresources/urxvt delete mode 100644 config/Xresources/xft delete mode 100644 config/Xresources/xterm rename config/{ => nix/unprocessed/config}/tridactyl/themes/.gitignore (100%) rename config/{ => nix/unprocessed/config}/tridactyl/tridactylrc (100%) rename config/{ => nix/unprocessed/config}/xinitrc (100%) delete mode 100644 config/user-dirs.dirs delete mode 100755 config/user-dirs.locale delete mode 100644 config/ycm_extra_conf.py diff --git a/config/Xresources/.gitignore b/config/Xresources/.gitignore deleted file mode 100644 index 62fd177..0000000 --- a/config/Xresources/.gitignore +++ /dev/null @@ -1 +0,0 @@ -theme diff --git a/config/Xresources/main b/config/Xresources/main deleted file mode 100644 index 7e8e091..0000000 --- a/config/Xresources/main +++ /dev/null @@ -1,4 +0,0 @@ -#include ".config/Xresources/xft" -#include ".config/Xresources/theme" -#include ".config/Xresources/xterm" -#include ".config/Xresources/urxvt" diff --git a/config/Xresources/urxvt b/config/Xresources/urxvt deleted file mode 100644 index 1ea3a06..0000000 --- a/config/Xresources/urxvt +++ /dev/null @@ -1,61 +0,0 @@ -! Scrollback position -! TODO Does not work - -! do not scroll with output -URxvt*scrollTtyOutput: false - -! scroll in relation to buffer (with mouse scroll or Shift+Page Up) -URxvt*scrollWithBuffer: true - -! scroll back to the bottom on keypress -URxvt*scrollTtyKeypress: true - - -! Scrollback buffer in secondary screen -! TODO Does not work -URxvt.secondaryScreen: 1 -URxvt.secondaryScroll: 0 - - -! No scroll bar -URxvt*scrollBar: false - - -! Font declaration -URxvt.font: xft:DejaVuSansMono Nerd Font Mono:size=12:antialias=true,xft:Twemoji:size=12:antialias=true,xft:symbola:size=12:minspace=False - -! Font spacing -URxvt.letterSpace: 0 - -! Disable Ctrl+Shift default bindings -URxvt.iso14755: false -URxvt.iso14755_52: false - -! Copy/Paste CLIPBOARD selection with Ctrl+Shift+C/V -URxvt.keysym.C-S-C: eval:selection_to_clipboard -URxvt.keysym.C-S-V: eval:paste_clipboard - - -! Extensions -URxvt.perl-ext-common: resize-font,bell-command,readline,selection - -! Changing font size on the fly (extension: resize-font, package: urxvt-resize-font-git) -URxvt.keysym.C-KP_Subtract: resize-font:smaller -URxvt.keysym.C-KP_Add: resize-font:bigger - -! Fake transparency (without compositing manager) -urxvt*transparent: true -urxvt*shading: 30 - -! True transparency (with compositing manager) -!urxvt*depth: 32 -!urxvt*background: rgba:2700/2800/2200/c800 - -! Bell command (extension: bell-command) -URxvt.bell-command: play -n synth sine C5 sine E4 remix 1-2 fade 0.1 0.2 0.1 &> /dev/null - -! Open URL in browser (extension: matcher) -! URxvt.url-launcher: o -! URxvt.matcher.button: 1 -! URxvt.matcher.rend.0: Uline Bold fg5 - diff --git a/config/Xresources/xft b/config/Xresources/xft deleted file mode 100644 index 9cf2b58..0000000 --- a/config/Xresources/xft +++ /dev/null @@ -1,9 +0,0 @@ -Xft.dpi: 96 -Xft.antialias: true -Xft.hinting: true -Xft.rgba: rgb -Xft.autohint: false -Xft.hintstyle: hintslight -Xft.lcdfilter: lcddefault -Xcursor.theme: Menda-Cursor -Xcursor.size: 0 diff --git a/config/Xresources/xterm b/config/Xresources/xterm deleted file mode 100644 index cb5531d..0000000 --- a/config/Xresources/xterm +++ /dev/null @@ -1,15 +0,0 @@ -xterm*faceName : DejaVuSansMono Nerd Font Mono:size=12:antialias=true -xterm*dynamicColors: true -xterm*utf8: 2 -xterm*eightBitInput: true -xterm*saveLines: 512 -xterm*scrollKey: true -xterm*scrollTtyOutput: false -xterm*scrollBar: false -xterm*rightScrollBar: false -xterm*jumpScroll: true -xterm*multiScroll: true -xterm*toolBar: false -XTerm.vt100.translations: #override \n\ - Ctrl Shift C: copy-selection(CLIPBOARD) \n\ - Ctrl Shift V: insert-selection(CLIPBOARD) diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index bde8dfc..2349987 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -474,6 +474,8 @@ in NODE_REPL_HISTORY = "${config.xdg.cacheHome}/node_repl_history"; PYTHONSTARTUP = "${config.xdg.configHome}/pythonstartup.py"; RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed + # TODO I think we're not using the urxvt daemon on purpose? + # TODO this should be desktop only, as a few things are too. SCREENRC = "${config.xdg.configHome}/screenrc"; SQLITE_HISTFILE = "${config.xdg.stateHome}/sqlite_history"; YARN_DISABLE_SELF_UPDATE_CHECK = "true"; # This also disable the creation of a ~/.yarnrc file diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 9d9df2a..23fe543 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -426,6 +426,22 @@ urxvt = { enable = true; package = pkgs.rxvt-unicode-emoji; + scroll = { + bar.enable = false; + }; + iso14755 = false; # Disable Ctrl+Shift default bindings + keybindings = { + "Shift-Control-C" = "eval:selection_to_clipboard"; + "Shift-Control-V" = "eval:paste_clipboard"; + # TODO Not sure resizing works, Nix doesn't have the package (urxvt-resize-font-git on Arch) + "Control-KP_Subtract" = "resize-font:smaller"; + "Control-KP_Add" = "resize-font:bigger"; + }; + extraConfig = { + "letterSpace" = 0; + "perl-ext-common" = "resize-font,bell-command,readline,selection"; + "bell-command" = "${pkgs.sox}/bin/play -n synth sine C5 sine E4 remix 1-2 fade 0.1 0.2 0.1 &> /dev/null"; + }; }; rofi = { enable = true; @@ -595,7 +611,6 @@ # x11-exclusive numlockx - # TODO urxvt-resize-font-git simplescreenrecorder trayer xclip diff --git a/config/tridactyl/themes/.gitignore b/config/nix/unprocessed/config/tridactyl/themes/.gitignore similarity index 100% rename from config/tridactyl/themes/.gitignore rename to config/nix/unprocessed/config/tridactyl/themes/.gitignore diff --git a/config/tridactyl/tridactylrc b/config/nix/unprocessed/config/tridactyl/tridactylrc similarity index 100% rename from config/tridactyl/tridactylrc rename to config/nix/unprocessed/config/tridactyl/tridactylrc diff --git a/config/xinitrc b/config/nix/unprocessed/config/xinitrc similarity index 100% rename from config/xinitrc rename to config/nix/unprocessed/config/xinitrc diff --git a/config/user-dirs.dirs b/config/user-dirs.dirs deleted file mode 100644 index 0958aae..0000000 --- a/config/user-dirs.dirs +++ /dev/null @@ -1,15 +0,0 @@ -# This file is written by xdg-user-dirs-update -# If you want to change or add directories, just edit the line you're -# interested in. All local changes will be retained on the next run -# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped -# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an -# absolute path. No other format is supported. -# -XDG_DESKTOP_DIR="$HOME/Bureau" -XDG_DOWNLOAD_DIR="$HOME/Téléchargements" -XDG_TEMPLATES_DIR="$HOME/Modèles" -XDG_PUBLICSHARE_DIR="$HOME/Public" -XDG_DOCUMENTS_DIR="$HOME/Documents" -XDG_MUSIC_DIR="$HOME/Musique" -XDG_PICTURES_DIR="$HOME/Images" -XDG_VIDEOS_DIR="$HOME/Vidéos" diff --git a/config/user-dirs.locale b/config/user-dirs.locale deleted file mode 100755 index 9f0da78..0000000 --- a/config/user-dirs.locale +++ /dev/null @@ -1 +0,0 @@ -fr_FR \ No newline at end of file diff --git a/config/ycm_extra_conf.py b/config/ycm_extra_conf.py deleted file mode 100644 index 31b416f..0000000 --- a/config/ycm_extra_conf.py +++ /dev/null @@ -1,4 +0,0 @@ -def FlagsForFile(filename, **kwargs): - return { - 'flags': ['-Wall', '-Wextra', '-lm'], - } From 471966197a119b130c2fd33d845e239917242aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 21 Nov 2023 21:01:56 +0100 Subject: [PATCH 057/108] nix: Reduce default size with options --- config/nix/curacao.nix | 1 + config/nix/curacao_test.nix | 12 ++++++++++++ config/nix/hm/desktop.nix | 6 +++--- config/nix/hm/extra.nix | 4 ++-- config/nix/hm/loader.nix | 1 + config/nix/hm/style.nix | 10 ++++++---- config/nix/options.nix | 7 +++++++ config/nix/os/desktop.nix | 1 - config/nix/os/geoffrey.nix | 3 ++- config/nix/os/loader.nix | 1 + config/nix/testvm.nix | 1 + 11 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 config/nix/curacao_test.nix create mode 100644 config/nix/options.nix diff --git a/config/nix/curacao.nix b/config/nix/curacao.nix index 73f8c24..c1fcf5b 100644 --- a/config/nix/curacao.nix +++ b/config/nix/curacao.nix @@ -6,4 +6,5 @@ ]; networking.hostName = "curacao.geoffrey.frogeye.fr"; + frogeye.extra = true; } diff --git a/config/nix/curacao_test.nix b/config/nix/curacao_test.nix new file mode 100644 index 0000000..ecb1b16 --- /dev/null +++ b/config/nix/curacao_test.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + imports = [ + ./hm/loader.nix + ]; + + home.username = "gnix"; + home.homeDirectory = "/home/gnix"; + + frogeye.extra = true; + frogeye.desktop.nixGLIntel = true; +} diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 23fe543..b508335 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -506,12 +506,13 @@ rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5"; }) { }; + nixGLIntelPrefix = "${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel "; + wmPrefix = "${lib.optionalString config.frogeye.desktop.nixGLIntel nixGLIntelPrefix}"; in { - # TODO Configurable source = pkgs.writeShellScript "xinitrc" '' ${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path} - ${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ${config.xsession.windowManager.command} + ${wmPrefix}${config.xsession.windowManager.command} ''; }; "rofimoji.rc" = { @@ -629,5 +630,4 @@ MPD_PORT = "${toString config.services.mpd.network.port}"; }; }; - } diff --git a/config/nix/hm/extra.nix b/config/nix/hm/extra.nix index f1c36d3..b8b6ee0 100644 --- a/config/nix/hm/extra.nix +++ b/config/nix/hm/extra.nix @@ -1,6 +1,6 @@ -{ pkgs, ... }: +{ pkgs, lib, config, ... }: { - home.packages = with pkgs; [ + home.packages = with pkgs; lib.mkIf config.frogeye.extra [ # android tools android-tools diff --git a/config/nix/hm/loader.nix b/config/nix/hm/loader.nix index 2e4ade4..4aa7b32 100644 --- a/config/nix/hm/loader.nix +++ b/config/nix/hm/loader.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ../options.nix ./common.nix ./desktop.nix ./dev.nix diff --git a/config/nix/hm/style.nix b/config/nix/hm/style.nix index 07b0700..5bf2fce 100644 --- a/config/nix/hm/style.nix +++ b/config/nix/hm/style.nix @@ -23,15 +23,17 @@ in terminal = 10; }; monospace = { - package = pkgs.nerdfonts; + package = pkgs.nerdfonts.override { + fonts = [ "DejaVuSansMono" ]; # Choose from https://github.com/NixOS/nixpkgs/blob/6ba3207643fd27ffa25a172911e3d6825814d155/pkgs/data/fonts/nerdfonts/shas.nix + }; name = "DejaVuSansM Nerd Font"; }; }; targets = { - vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR) - i3.enable = false; # I prefer my own styles - tmux.enable = false; # Using another theme + vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR) + i3.enable = false; # I prefer my own styles + tmux.enable = false; # Using another theme }; }; diff --git a/config/nix/options.nix b/config/nix/options.nix new file mode 100644 index 0000000..0b2bf4e --- /dev/null +++ b/config/nix/options.nix @@ -0,0 +1,7 @@ +{ lib, ... }: +{ + options.frogeye = { + extra = lib.mkEnableOption "Big software"; + desktop.nixGLIntel = lib.mkEnableOption "Enable nixGLIntel/nixVulkanIntel for windows manager"; + }; +} diff --git a/config/nix/os/desktop.nix b/config/nix/os/desktop.nix index d068c73..51b95dd 100644 --- a/config/nix/os/desktop.nix +++ b/config/nix/os/desktop.nix @@ -5,7 +5,6 @@ services.xserver = { windowManager.i3.enable = true; - desktopManager.gnome.enable = true; displayManager.defaultSession = "none+i3"; # Keyboard layout diff --git a/config/nix/os/geoffrey.nix b/config/nix/os/geoffrey.nix index d944d19..5f5eb56 100644 --- a/config/nix/os/geoffrey.nix +++ b/config/nix/os/geoffrey.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { imports = [ @@ -23,6 +23,7 @@ imports = [ ../hm/loader.nix ]; + frogeye = config.frogeye; }; # Makes VMs able to re-run useUserPackages = true; diff --git a/config/nix/os/loader.nix b/config/nix/os/loader.nix index 69dd3d5..cf9d18a 100644 --- a/config/nix/os/loader.nix +++ b/config/nix/os/loader.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ../options.nix ./battery.nix ./geoffrey.nix ./common.nix diff --git a/config/nix/testvm.nix b/config/nix/testvm.nix index 7b62fa8..e1dcc21 100644 --- a/config/nix/testvm.nix +++ b/config/nix/testvm.nix @@ -5,4 +5,5 @@ ]; networking.hostName = "nixos"; + frogeye.extra = true; } From 5125e05266e5de73620b61350e8f040876f19c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 22 Nov 2023 00:52:31 +0100 Subject: [PATCH 058/108] nix: Build on aarch64 --- config/nix/add_channels.sh | 6 ++++++ config/nix/build-pindakaas-image.sh | 19 ++++++++++++++++++- config/nix/build-vm.sh | 18 ++++++++++++++++++ config/nix/build.sh | 5 ----- config/nix/curacao.nix | 2 +- config/nix/hm/common.nix | 3 ++- config/nix/hm/desktop.nix | 13 +++++++------ config/nix/hm/dev.nix | 5 ++--- config/nix/hm/vim.nix | 6 +++--- config/nix/os/common.nix | 2 ++ config/nix/os/wireless.nix | 2 +- config/nix/pindakaas.nix | 5 ++--- config/nix/testvm.nix | 9 --------- 13 files changed, 62 insertions(+), 33 deletions(-) create mode 100755 config/nix/add_channels.sh create mode 100755 config/nix/build-vm.sh delete mode 100755 config/nix/build.sh delete mode 100644 config/nix/testvm.nix diff --git a/config/nix/add_channels.sh b/config/nix/add_channels.sh new file mode 100755 index 0000000..d5323e4 --- /dev/null +++ b/config/nix/add_channels.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# TODO Surely there's more elegant? +nix-channel --add https://nixos.org/channels/nixos-23.05 nixpkgs +nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager +nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware diff --git a/config/nix/build-pindakaas-image.sh b/config/nix/build-pindakaas-image.sh index 4485564..2d679c5 100755 --- a/config/nix/build-pindakaas-image.sh +++ b/config/nix/build-pindakaas-image.sh @@ -1,3 +1,20 @@ #/usr/bin/env sh + +# Build a disk image for testing on pindakaas via sd card + export NIXPKGS_ALLOW_UNFREE=1 -nix-build '' -A config.system.build.sdImage -I nixos-config=./pindakaas.nix +extra="" +if [ "$(uname -m)" != "aarch64" ] +then + # If we have binfmt QEMU (https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_binfmt_QEMU), + # we can pretend we're aarch64. + if [ -f /proc/sys/fs/binfmt_misc/qemu-aarch64 ] + then + extra="--argstr system aarch64-linux" + # Otherwise, use cross-compilation... + # theorically faster but doesn't use the cache and never got it to build a full customized image + else + extra="--argstr nixpkgs.crossSystem.system aarch64-linux" + fi +fi +nix-build '' -A config.system.build.sdImage -I nixos-config=./pindakaas.nix $extra --show-trace diff --git a/config/nix/build-vm.sh b/config/nix/build-vm.sh new file mode 100755 index 0000000..b1da329 --- /dev/null +++ b/config/nix/build-vm.sh @@ -0,0 +1,18 @@ +#/usr/bin/env sh + +# Build a NixOS VM for testing +# +# For x86_64 hosts: use curacao config +# For aarch64 hosts: use pindakaas config + +export NIXPKGS_ALLOW_UNFREE=1 +if [ "$(uname -m)" == "x86_64" ] +then + config=./curacao.nix +elif [ "$(uname -m)" == "aarch64" ] +then + config=./pindakaas.nix +fi +nix-build '' -A vm \ +-I nixpkgs=channel:nixos-23.05 \ +-I nixos-config=${config} diff --git a/config/nix/build.sh b/config/nix/build.sh deleted file mode 100755 index 001b47c..0000000 --- a/config/nix/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#/usr/bin/env sh -export NIXPKGS_ALLOW_UNFREE=1 -nix-build '' -A vm \ --I nixpkgs=channel:nixos-23.05 \ --I nixos-config=./testvm.nix diff --git a/config/nix/curacao.nix b/config/nix/curacao.nix index c1fcf5b..6dc088d 100644 --- a/config/nix/curacao.nix +++ b/config/nix/curacao.nix @@ -5,6 +5,6 @@ ./os/loader.nix ]; - networking.hostName = "curacao.geoffrey.frogeye.fr"; + networking.hostName = "curacao"; frogeye.extra = true; } diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 2349987..661885e 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -407,7 +407,8 @@ in moreutils man visidata - nodePackages.insect + # nodePackages.insect # FIXME Don't install on aarch64 + # TODO Use whatever replaces insect translate-shell unzip unrar diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index b508335..9c6bd90 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -269,12 +269,13 @@ "d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default"; } // return_bindings; "${mode_temp}" = { - "r" = "exec ${pkgs.sct}/bin/sct 1000"; - "d" = "exec ${pkgs.sct}/bin/sct 2000"; - "c" = "exec ${pkgs.sct}/bin/sct 4500"; - "o" = "exec ${pkgs.sct}/bin/sct"; - "a" = "exec ${pkgs.sct}/bin/sct 8000"; - "b" = "exec ${pkgs.sct}/bin/sct 10000"; + # "r" = "exec ${pkgs.sct}/bin/sct 1000"; + # "d" = "exec ${pkgs.sct}/bin/sct 2000"; + # "c" = "exec ${pkgs.sct}/bin/sct 4500"; + # "o" = "exec ${pkgs.sct}/bin/sct"; + # "a" = "exec ${pkgs.sct}/bin/sct 8000"; + # "b" = "exec ${pkgs.sct}/bin/sct 10000"; + # FIXME Not on aarch64 } // return_bindings; }; window = { diff --git a/config/nix/hm/dev.nix b/config/nix/hm/dev.nix index 6211e5a..2f1f4db 100644 --- a/config/nix/hm/dev.nix +++ b/config/nix/hm/dev.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { # TODO Separate in diffrent packages once the structure is finalized... # or connvert into per-directory requirements home.packages = with pkgs; [ @@ -29,7 +28,7 @@ # FPGA yosys verilog - ghdl + # ghdl # TODO Not on aarch64 gtkwave # TODO Display server only # Network diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index 76bcb44..22a4c94 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -15,13 +15,13 @@ let }; meta.homepage = "https://github.com/deris/vim-shot-f"; }; - quick-scope = pkgs.vimUtils.buildVimPluginFrom2Nix { + quick-scope = pkgs.vimUtils.buildVimPluginFrom2Nix rec { pname = "quick-scope"; version = "2.6.1"; src = pkgs.fetchFromGitHub { - owner = "deris"; + owner = "unblevable"; repo = "quick-scope"; - rev = "2.6.1"; + rev = "v${version}"; sha256 = "iAPvIs/lhW+w5kFTZKaY97D/kfCGtqKrJVFvZ8cHu+c="; }; meta.homepage = "https://github.com/unblevable/quick-scope"; diff --git a/config/nix/os/common.nix b/config/nix/os/common.nix index f6e64f6..eedc29d 100644 --- a/config/nix/os/common.nix +++ b/config/nix/os/common.nix @@ -1,5 +1,7 @@ { pkgs, lib, ... }: { + networking.domain = "geoffrey.frogeye.fr"; + boot.loader.efi.canTouchEfiVariables = true; time.timeZone = "Europe/Amsterdam"; diff --git a/config/nix/os/wireless.nix b/config/nix/os/wireless.nix index c583dcf..2c97fe9 100644 --- a/config/nix/os/wireless.nix +++ b/config/nix/os/wireless.nix @@ -4,7 +4,7 @@ # TODO This doesn't change anything, at least in the VM networking.wireless = { enable = true; - networks = builtins.fromJSON ./wireless/networks.json; # If this file doesn't exist, run ./wireless/import.py + networks = builtins.fromJSON (builtins.readFile ./wireless/networks.json); # If this file doesn't exist, run ./wireless/import.py extraConfig = '' country=NL ''; diff --git a/config/nix/pindakaas.nix b/config/nix/pindakaas.nix index 928ffd1..aef4544 100644 --- a/config/nix/pindakaas.nix +++ b/config/nix/pindakaas.nix @@ -3,8 +3,7 @@ imports = [ # - # ./os/loader.nix # Don't uncomment this before having put extra behind an option! + ./os/loader.nix ]; - nixpkgs.crossSystem.system = "aarch64-linux"; - # networking.hostName = "pindakaas.geoffrey.frogeye.fr"; + networking.hostName = "pindakaas"; } diff --git a/config/nix/testvm.nix b/config/nix/testvm.nix deleted file mode 100644 index e1dcc21..0000000 --- a/config/nix/testvm.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - imports = [ - ./os/loader.nix - ]; - - networking.hostName = "nixos"; - frogeye.extra = true; -} From c7e2263d644d7db92aa87b757cb713965aa20a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 22 Nov 2023 01:51:48 +0100 Subject: [PATCH 059/108] =?UTF-8?q?nix:=20nom=20nom=20=F0=9F=98=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/nix/build-pindakaas-image.sh | 21 ++++++++++++--------- config/nix/build-vm.sh | 10 +++++++--- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/config/nix/build-pindakaas-image.sh b/config/nix/build-pindakaas-image.sh index 2d679c5..da22a96 100755 --- a/config/nix/build-pindakaas-image.sh +++ b/config/nix/build-pindakaas-image.sh @@ -2,19 +2,22 @@ # Build a disk image for testing on pindakaas via sd card +if ! command -v nom-build +then + exec nix-shell -p nix-output-monitor --run $0 +fi + export NIXPKGS_ALLOW_UNFREE=1 extra="" if [ "$(uname -m)" != "aarch64" ] then - # If we have binfmt QEMU (https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_binfmt_QEMU), - # we can pretend we're aarch64. - if [ -f /proc/sys/fs/binfmt_misc/qemu-aarch64 ] + if [ ! -f /proc/sys/fs/binfmt_misc/qemu-aarch64 ] then - extra="--argstr system aarch64-linux" - # Otherwise, use cross-compilation... - # theorically faster but doesn't use the cache and never got it to build a full customized image - else - extra="--argstr nixpkgs.crossSystem.system aarch64-linux" + echo "Use binfmt QEMU!" + echo "https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_binfmt_QEMU" + exit 1 fi + extra="--argstr system aarch64-linux" fi -nix-build '' -A config.system.build.sdImage -I nixos-config=./pindakaas.nix $extra --show-trace +nom-build '' -A config.system.build.sdImage \ + -I nixos-config=./pindakaas.nix $extra --show-trace diff --git a/config/nix/build-vm.sh b/config/nix/build-vm.sh index b1da329..a9d06ef 100755 --- a/config/nix/build-vm.sh +++ b/config/nix/build-vm.sh @@ -5,6 +5,11 @@ # For x86_64 hosts: use curacao config # For aarch64 hosts: use pindakaas config +if ! command -v nom-build +then + exec nix-shell -p nix-output-monitor --run $0 +fi + export NIXPKGS_ALLOW_UNFREE=1 if [ "$(uname -m)" == "x86_64" ] then @@ -13,6 +18,5 @@ elif [ "$(uname -m)" == "aarch64" ] then config=./pindakaas.nix fi -nix-build '' -A vm \ --I nixpkgs=channel:nixos-23.05 \ --I nixos-config=${config} +nom-build '' -A vm \ + -I nixos-config=${config} From 9a18827cbce3faa9ac73545c67cea8d7a23b9431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 22 Nov 2023 13:38:25 +0100 Subject: [PATCH 060/108] nix: Make nixos-hardware work for pindakaas --- config/nix/add_channels.sh | 5 ++++- config/nix/pindakaas.nix | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config/nix/add_channels.sh b/config/nix/add_channels.sh index d5323e4..aea4785 100755 --- a/config/nix/add_channels.sh +++ b/config/nix/add_channels.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash # TODO Surely there's more elegant? + nix-channel --add https://nixos.org/channels/nixos-23.05 nixpkgs nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager -nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware +# First commit before 23.05 release date: +nix-channel --add https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz nixos-hardware +nix-channel --update diff --git a/config/nix/pindakaas.nix b/config/nix/pindakaas.nix index aef4544..a7f49c9 100644 --- a/config/nix/pindakaas.nix +++ b/config/nix/pindakaas.nix @@ -1,9 +1,12 @@ -{ ... }: +{ pkgs, config, ... }: { imports = [ - # + ./os/loader.nix ]; networking.hostName = "pindakaas"; + # nixos-hardware use latest kernel by default. This obviously runs quickly out of sync with zfs packages. + # zfs packages are included despite me asking anything zfs, probably they're in the image for installation purposes? + boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; } From eb2f12b6c51fa5e9f275efe02606815d2bf788fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 22 Nov 2023 14:05:48 +0100 Subject: [PATCH 061/108] nix: Put desktop behind option --- config/nix/curacao.nix | 1 + config/nix/curacao_test.nix | 1 + config/nix/hm/common.nix | 15 +- config/nix/hm/desktop.nix | 1170 ++++++++++++++++++----------------- config/nix/hm/dev.nix | 16 +- config/nix/hm/extra.nix | 36 +- config/nix/options.nix | 5 +- config/nix/os/desktop.nix | 34 +- config/nix/pindakaas.nix | 4 +- 9 files changed, 655 insertions(+), 627 deletions(-) diff --git a/config/nix/curacao.nix b/config/nix/curacao.nix index 6dc088d..9b389a1 100644 --- a/config/nix/curacao.nix +++ b/config/nix/curacao.nix @@ -7,4 +7,5 @@ networking.hostName = "curacao"; frogeye.extra = true; + frogeye.desktop.xorg = true; } diff --git a/config/nix/curacao_test.nix b/config/nix/curacao_test.nix index ecb1b16..815e13d 100644 --- a/config/nix/curacao_test.nix +++ b/config/nix/curacao_test.nix @@ -8,5 +8,6 @@ home.homeDirectory = "/home/gnix"; frogeye.extra = true; + frogeye.desktop.xorg = true; frogeye.desktop.nixGLIntel = true; } diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 661885e..e839ae9 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -465,23 +465,28 @@ in # Favourite commands PAGER = "${pkgs.coreutils}/bin/less"; EDITOR = "${pkgs.neovim}/bin/nvim"; - VISUAL = "${pkgs.neovim}/bin/nvim"; - BROWSER = "${config.programs.qutebrowser.package}/bin/qutebrowser"; - } // direnv // { + + # Extra config BOOT9_PATH = "${config.xdg.dataHome}/citra-emu/sysdata/boot9.bin"; CCACHE_CONFIGPATH = "${config.xdg.configHome}/ccache.conf"; # INPUTRC = "${config.xdg.configHome}/inputrc"; # UPST Will use programs.readline, but doesn't allow path setting LESSHISTFILE = "${config.xdg.stateHome}/lesshst"; NODE_REPL_HISTORY = "${config.xdg.cacheHome}/node_repl_history"; PYTHONSTARTUP = "${config.xdg.configHome}/pythonstartup.py"; - RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed # TODO I think we're not using the urxvt daemon on purpose? # TODO this should be desktop only, as a few things are too. SCREENRC = "${config.xdg.configHome}/screenrc"; SQLITE_HISTFILE = "${config.xdg.stateHome}/sqlite_history"; YARN_DISABLE_SELF_UPDATE_CHECK = "true"; # This also disable the creation of a ~/.yarnrc file + } // lib.optionalAttrs config.frogeye.desktop.xorg { + # Favourite commands + VISUAL = "${pkgs.neovim}/bin/nvim"; + BROWSER = "${config.programs.qutebrowser.package}/bin/qutebrowser"; + + # Extra config + RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed # XAUTHORITY = "${config.xdg.configHome}/Xauthority"; # Disabled as this causes lock-ups with DMs - }; + } // direnv; # TODO Session variables only get reloaded on login I think. sessionPath = [ "$HOME/.local/bin" diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 9c6bd90..6038026 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -1,43 +1,44 @@ { pkgs, config, lib, ... }: { - xsession = { - enable = true; - windowManager = { - i3 = { - enable = true; - config = - let - # lockColors = with config.lib.stylix.colors.withHashtag; { a = base00; b = base01; d = base00; }; # Black or White, depending on current theme - # lockColors = with config.lib.stylix.colors.withHashtag; { a = base0A; b = base0B; d = base00; }; # Green + Yellow - lockColors = { a = "#82a401"; b = "#466c01"; d = "#648901"; }; # Old - lockSvg = pkgs.writeText "lock.svg" ""; - lockPng = pkgs.runCommand "lock.png" { } "${pkgs.imagemagick}/bin/convert ${lockSvg} $out"; - locker = pkgs.writeShellScript "i3-locker" - '' - # Remove SSH and GPG keys from keystores - ${pkgs.openssh}/bin/ssh-add -D - echo RELOADAGENT | ${pkgs.gnupg}/bin/gpg-connect-agent - ${pkgs.coreutils}/bin/rm -rf "/tmp/cached_pass_$UID" + config = lib.mkIf config.frogeye.desktop.xorg { + xsession = { + enable = true; + windowManager = { + i3 = { + enable = true; + config = + let + # lockColors = with config.lib.stylix.colors.withHashtag; { a = base00; b = base01; d = base00; }; # Black or White, depending on current theme + # lockColors = with config.lib.stylix.colors.withHashtag; { a = base0A; b = base0B; d = base00; }; # Green + Yellow + lockColors = { a = "#82a401"; b = "#466c01"; d = "#648901"; }; # Old + lockSvg = pkgs.writeText "lock.svg" ""; + lockPng = pkgs.runCommand "lock.png" { } "${pkgs.imagemagick}/bin/convert ${lockSvg} $out"; + locker = pkgs.writeShellScript "i3-locker" + '' + # Remove SSH and GPG keys from keystores + ${pkgs.openssh}/bin/ssh-add -D + echo RELOADAGENT | ${pkgs.gnupg}/bin/gpg-connect-agent + ${pkgs.coreutils}/bin/rm -rf "/tmp/cached_pass_$UID" - ${pkgs.lightdm}/bin/dm-tool lock - # TODO Does that work for all DMs? - if [ $? -ne 0 ]; then - if [ -d ${config.xdg.cacheHome}/lockpatterns ] - then - pattern=$(${pkgs.findutils} ${config.xdg.cacheHome}/lockpatterns | sort -R | head -1) - else - pattern=${lockPng} - fi - revert() { - ${pkgs.xorg.xset}/bin/xset dpms 0 0 0 - } - trap revert SIGHUP SIGINT SIGTERM - ${pkgs.xorg.xset}/bin/xset dpms 5 5 5 - ${pkgs.i3lock}/bin/i3lock --nofork --color ${builtins.substring 1 6 lockColors.d} --image=$pattern --tiling --ignore-empty-password - revert - fi - ''; - focus = "exec ${ pkgs.writeShellScript "i3-focus-window" + ${pkgs.lightdm}/bin/dm-tool lock + # TODO Does that work for all DMs? + if [ $? -ne 0 ]; then + if [ -d ${config.xdg.cacheHome}/lockpatterns ] + then + pattern=$(${pkgs.findutils} ${config.xdg.cacheHome}/lockpatterns | sort -R | head -1) + else + pattern=${lockPng} + fi + revert() { + ${pkgs.xorg.xset}/bin/xset dpms 0 0 0 + } + trap revert SIGHUP SIGINT SIGTERM + ${pkgs.xorg.xset}/bin/xset dpms 5 5 5 + ${pkgs.i3lock}/bin/i3lock --nofork --color ${builtins.substring 1 6 lockColors.d} --image=$pattern --tiling --ignore-empty-password + revert + fi + ''; + focus = "exec ${ pkgs.writeShellScript "i3-focus-window" '' WINDOW=`${pkgs.xdotool}/bin/xdotool getwindowfocus` eval `${pkgs.xdotool}/bin/xdotool getwindowgeometry --shell $WINDOW` # this brings in variables WIDTH and HEIGHT @@ -46,589 +47,590 @@ ${pkgs.xdotool}/bin/xdotool mousemove -window $WINDOW $TX $TY '' }"; - mode_system = "[L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction"; - mode_resize = "Resize"; - mode_pres_main = "Presentation (main display)"; - mode_pres_sec = "Presentation (secondary display)"; - mode_screen = "Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default"; - mode_temp = "Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue"; - in - { - modifier = "Mod1"; # FIXME Mod1 for VM, Mod4 for not VM - terminal = "alacritty"; - # bars = []; # FIXME lemonbar - colors = let ignore = "#ff00ff"; in - with config.lib.stylix.colors.withHashtag; lib.mkForce { - focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; }; - focusedInactive = { border = base02; background = base02; text = base05; indicator = base02; childBorder = base02; }; - unfocused = { border = base05; background = base04; text = base00; indicator = base04; childBorder = base00; }; - urgent = { border = base0F; background = base08; text = base00; indicator = base08; childBorder = base0F; }; - placeholder = { border = ignore; background = base00; text = base05; indicator = ignore; childBorder = base00; }; - background = base07; - # I set the color of the active tab as the the background color of the terminal so they merge together. - }; - focus.followMouse = false; - keybindings = - let - mod = config.xsession.windowManager.i3.config.modifier; - rofi = "exec --no-startup-id ${config.programs.rofi.package}/bin/rofi"; - pactl = "exec ${pkgs.pulseaudio}/bin/pactl"; # TODO Use NixOS package if using NixOS - scrot = "${pkgs.scrot}/bin/scrot --exec '${pkgs.coreutils}/bin/mv $f ~/Screenshots/ && ${pkgs.optipng}/bin/optipng ~/Screenshots/$f'"; - # TODO nix path and create directory? - in - { - # Compatibility layer for people coming from other backgrounds - # "Mod1+Tab" = "${rofi} -modi window -show window"; # FIXME When no longer using a VM - "Mod1+F2" = "${rofi} -modi drun -show drun"; - # "Mod1+F4" = "kill"; # FIXME When no longer using a VM - # kill focused window - "${mod}+z" = "kill"; - button2 = "kill"; - # Rofi - "${mod}+c" = "exec --no-startup-id ${pkgs.rofi-pass}/bin/rofi-pass --last-used"; - # TODO Try autopass.cr - # 23.11 config.programs.rofi.pass.package - "${mod}+i" = "exec --no-startup-id ${pkgs.rofimoji}/bin/rofimoji"; - "${mod}+plus" = "${rofi} -modi ssh -show ssh"; - "${mod}+ù" = "${rofi} -modi ssh -show ssh -ssh-command '{terminal} -e {ssh-client} {host} -t \"sudo -s -E\"'"; - # TODO In which keyboard layout? - "${mod}+Tab" = "${rofi} -modi window -show window"; - # start program launcher - "${mod}+d" = "${rofi} -modi run -show run"; - "${mod}+Shift+d" = "${rofi} -modi drun -show drun"; - # Start Applications - "${mod}+Return" = "exec ${ + mode_system = "[L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction"; + mode_resize = "Resize"; + mode_pres_main = "Presentation (main display)"; + mode_pres_sec = "Presentation (secondary display)"; + mode_screen = "Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default"; + mode_temp = "Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue"; + in + { + modifier = "Mod1"; # FIXME Mod1 for VM, Mod4 for not VM + terminal = "alacritty"; + # bars = []; # FIXME lemonbar + colors = let ignore = "#ff00ff"; in + with config.lib.stylix.colors.withHashtag; lib.mkForce { + focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; }; + focusedInactive = { border = base02; background = base02; text = base05; indicator = base02; childBorder = base02; }; + unfocused = { border = base05; background = base04; text = base00; indicator = base04; childBorder = base00; }; + urgent = { border = base0F; background = base08; text = base00; indicator = base08; childBorder = base0F; }; + placeholder = { border = ignore; background = base00; text = base05; indicator = ignore; childBorder = base00; }; + background = base07; + # I set the color of the active tab as the the background color of the terminal so they merge together. + }; + focus.followMouse = false; + keybindings = + let + mod = config.xsession.windowManager.i3.config.modifier; + rofi = "exec --no-startup-id ${config.programs.rofi.package}/bin/rofi"; + pactl = "exec ${pkgs.pulseaudio}/bin/pactl"; # TODO Use NixOS package if using NixOS + scrot = "${pkgs.scrot}/bin/scrot --exec '${pkgs.coreutils}/bin/mv $f ~/Screenshots/ && ${pkgs.optipng}/bin/optipng ~/Screenshots/$f'"; + # TODO nix path and create directory? + in + { + # Compatibility layer for people coming from other backgrounds + # "Mod1+Tab" = "${rofi} -modi window -show window"; # FIXME When no longer using a VM + "Mod1+F2" = "${rofi} -modi drun -show drun"; + # "Mod1+F4" = "kill"; # FIXME When no longer using a VM + # kill focused window + "${mod}+z" = "kill"; + button2 = "kill"; + # Rofi + "${mod}+c" = "exec --no-startup-id ${pkgs.rofi-pass}/bin/rofi-pass --last-used"; + # TODO Try autopass.cr + # 23.11 config.programs.rofi.pass.package + "${mod}+i" = "exec --no-startup-id ${pkgs.rofimoji}/bin/rofimoji"; + "${mod}+plus" = "${rofi} -modi ssh -show ssh"; + "${mod}+ù" = "${rofi} -modi ssh -show ssh -ssh-command '{terminal} -e {ssh-client} {host} -t \"sudo -s -E\"'"; + # TODO In which keyboard layout? + "${mod}+Tab" = "${rofi} -modi window -show window"; + # start program launcher + "${mod}+d" = "${rofi} -modi run -show run"; + "${mod}+Shift+d" = "${rofi} -modi drun -show drun"; + # Start Applications + "${mod}+Return" = "exec ${ pkgs.writeShellScript "terminal" "${config.programs.alacritty.package}/bin/alacritty msg create-window || exec ${config.programs.alacritty.package}/bin/alacritty -e zsh" # -e zsh is for systems where I can't configure my user's shell # TODO Is a shell script even required? }"; - "${mod}+Shift+Return" = "exec ${config.programs.urxvt.package}/bin/urxvt"; - "${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/thunar"; - "${mod}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore --backend=webengine"; - # TODO --backend not useful anymore - # Volume control - "XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; - "XF86AudioMute" = "${pactl} set-sink-mute @DEFAULT_SINK@ true"; - "${mod}+F7" = "${pactl} suspend-sink @DEFAULT_SINK@ 1; ${pactl} suspend-sink @DEFAULT_SINK@ 0"; # Re-synchronize bluetooth headset - "${mod}+F11" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; - "${mod}+F12" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; - # TODO Find pacmixer? - # Media control - "XF86AudioPrev" = "exec ${pkgs.mpc-cli}/bin/mpc prev"; - "XF86AudioPlay" = "exec ${pkgs.mpc-cli}/bin/mpc toggle"; - "XF86AudioNext" = "exec ${pkgs.mpc-cli}/bin/mpc next"; - # Misc - "${mod}+F10" = "exec ${ pkgs.writeShellScript "show-keyboard-layout" + "${mod}+Shift+Return" = "exec ${config.programs.urxvt.package}/bin/urxvt"; + "${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/thunar"; + "${mod}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore --backend=webengine"; + # TODO --backend not useful anymore + # Volume control + "XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; + "XF86AudioMute" = "${pactl} set-sink-mute @DEFAULT_SINK@ true"; + "${mod}+F7" = "${pactl} suspend-sink @DEFAULT_SINK@ 1; ${pactl} suspend-sink @DEFAULT_SINK@ 0"; # Re-synchronize bluetooth headset + "${mod}+F11" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; + "${mod}+F12" = "exec ${pkgs.pavucontrol}/bin/pavucontrol"; + # TODO Find pacmixer? + # Media control + "XF86AudioPrev" = "exec ${pkgs.mpc-cli}/bin/mpc prev"; + "XF86AudioPlay" = "exec ${pkgs.mpc-cli}/bin/mpc toggle"; + "XF86AudioNext" = "exec ${pkgs.mpc-cli}/bin/mpc next"; + # Misc + "${mod}+F10" = "exec ${ pkgs.writeShellScript "show-keyboard-layout" '' layout=`${pkgs.xorg.setxkbmap}/bin/setxkbmap -query | ${pkgs.gnugrep}/bin/grep ^layout: | ${pkgs.gawk}/bin/awk '{ print $2 }'` ${pkgs.libgnomekbd}/bin/gkbd-keyboard-display -l $layout '' }"; - # Screenshots - "Print" = "exec ${scrot} --focused"; - "${mod}+Print" = "exec ${scrot}"; # FIXME Doesn't work at least in the VM - "Ctrl+Print" = "exec ${pkgs.coreutils}/bin/sleep 1 && ${scrot} --select"; - # TODO Try using bindsym --release instead of sleep - # change focus - "${mod}+h" = "focus left; ${focus}"; - "${mod}+j" = "focus down; ${focus}"; - "${mod}+k" = "focus up; ${focus}"; - "${mod}+l" = "focus right; ${focus}"; - # move focused window - "${mod}+Shift+h" = "move left; ${focus}"; - "${mod}+Shift+j" = "move down; ${focus}"; - "${mod}+Shift+k" = "move up; ${focus}"; - "${mod}+Shift+l" = "move right; ${focus}"; - # workspace back and forth (with/without active container) - "${mod}+b" = "workspace back_and_forth; ${focus}"; - "${mod}+Shift+b" = "move container to workspace back_and_forth; workspace back_and_forth; ${focus}"; - # Change container layout - "${mod}+g" = "split h; ${focus}"; - "${mod}+v" = "split v; ${focus}"; - "${mod}+f" = "fullscreen toggle; ${focus}"; - "${mod}+s" = "layout stacking; ${focus}"; - "${mod}+w" = "layout tabbed; ${focus}"; - "${mod}+e" = "layout toggle split; ${focus}"; - "${mod}+Shift+space" = "floating toggle; ${focus}"; - # Focus container - "${mod}+space" = "focus mode_toggle; ${focus}"; - "${mod}+a" = "focus parent; ${focus}"; - "${mod}+q" = "focus child; ${focus}"; - # Switch to workspace - "${mod}+1" = "workspace 1; ${focus}"; - "${mod}+2" = "workspace 2; ${focus}"; - "${mod}+3" = "workspace 3; ${focus}"; - "${mod}+4" = "workspace 4; ${focus}"; - "${mod}+5" = "workspace 5; ${focus}"; - "${mod}+6" = "workspace 6; ${focus}"; - "${mod}+7" = "workspace 7; ${focus}"; - "${mod}+8" = "workspace 8; ${focus}"; - "${mod}+9" = "workspace 9; ${focus}"; - "${mod}+0" = "workspace 10; ${focus}"; - # TODO Prevent repetitions, see workspace assignation for example - #navigate workspaces next / previous - "${mod}+Ctrl+h" = "workspace prev_on_output; ${focus}"; - "${mod}+Ctrl+l" = "workspace next_on_output; ${focus}"; - "${mod}+Ctrl+j" = "workspace prev; ${focus}"; - "${mod}+Ctrl+k" = "workspace next; ${focus}"; - # Move to workspace next / previous with focused container - "${mod}+Ctrl+Shift+h" = "move container to workspace prev_on_output; workspace prev_on_output; ${focus}"; - "${mod}+Ctrl+Shift+l" = "move container to workspace next_on_output; workspace next_on_output; ${focus}"; - "${mod}+Ctrl+Shift+j" = "move container to workspace prev; workspace prev; ${focus}"; - "${mod}+Ctrl+Shift+k" = "move container to workspace next; workspace next; ${focus}"; - # move focused container to workspace - "${mod}+ctrl+1" = "move container to workspace 1; ${focus}"; - "${mod}+ctrl+2" = "move container to workspace 2; ${focus}"; - "${mod}+ctrl+3" = "move container to workspace 3; ${focus}"; - "${mod}+ctrl+4" = "move container to workspace 4; ${focus}"; - "${mod}+ctrl+5" = "move container to workspace 5; ${focus}"; - "${mod}+ctrl+6" = "move container to workspace 6; ${focus}"; - "${mod}+ctrl+7" = "move container to workspace 7; ${focus}"; - "${mod}+ctrl+8" = "move container to workspace 8; ${focus}"; - "${mod}+ctrl+9" = "move container to workspace 9; ${focus}"; - "${mod}+ctrl+0" = "move container to workspace 10; ${focus}"; - # move to workspace with focused container - "${mod}+shift+1" = "move container to workspace 1; workspace 1; ${focus}"; - "${mod}+shift+2" = "move container to workspace 2; workspace 2; ${focus}"; - "${mod}+shift+3" = "move container to workspace 3; workspace 3; ${focus}"; - "${mod}+shift+4" = "move container to workspace 4; workspace 4; ${focus}"; - "${mod}+shift+5" = "move container to workspace 5; workspace 5; ${focus}"; - "${mod}+shift+6" = "move container to workspace 6; workspace 6; ${focus}"; - "${mod}+shift+7" = "move container to workspace 7; workspace 7; ${focus}"; - "${mod}+shift+8" = "move container to workspace 8; workspace 8; ${focus}"; - "${mod}+shift+9" = "move container to workspace 9; workspace 9; ${focus}"; - "${mod}+shift+0" = "move container to workspace 10; workspace 10; ${focus}"; - # move workspaces to screen (arrow keys) - "${mod}+ctrl+shift+Right" = "move workspace to output right; ${focus}"; - "${mod}+ctrl+shift+Left" = "move workspace to output left; ${focus}"; - "${mod}+Ctrl+Shift+Up" = "move workspace to output above; ${focus}"; - "${mod}+Ctrl+Shift+Down" = "move workspace to output below; ${focus}"; - # i3 control - "${mod}+Shift+c" = "reload"; - "${mod}+Shift+r" = "restart"; - "${mod}+Shift+e" = "exit"; - # Screen off commands - "${mod}+F1" = "exec --no-startup-id ${pkgs.bash}/bin/sh -c \"${pkgs.coreutils}/bin/sleep .25 && ${pkgs.xorg.xset}/bin/xset dpms force off\""; - # TODO --release? - "${mod}+F4" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -disable"; - "${mod}+F5" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -enable"; - # Modes - "${mod}+Escape" = "mode ${mode_system}"; - "${mod}+r" = "mode ${mode_resize}"; - "${mod}+Shift+p" = "mode ${mode_pres_main}"; - "${mod}+t" = "mode ${mode_screen}"; - "${mod}+y" = "mode ${mode_temp}"; - }; - modes = let return_bindings = { - "Return" = "mode default"; - "Escape" = "mode default"; - }; in - { - "${mode_system}" = { - "l" = "exec --no-startup-id exec ${locker}, mode default"; - "e" = "exit, mode default"; - "s" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl suspend, mode default"; - "h" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl hibernate, mode default"; - "r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default"; - "p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default"; - } // return_bindings; - "${mode_resize}" = { - "h" = "resize shrink width 10 px or 10 ppt; ${focus}"; - "j" = "resize grow height 10 px or 10 ppt; ${focus}"; - "k" = "resize shrink height 10 px or 10 ppt; ${focus}"; - "l" = "resize grow width 10 px or 10 ppt; ${focus}"; - } // return_bindings; - "${mode_pres_main}" = { - "b" = "workspace 3, workspace 4, mode ${mode_pres_sec}"; - "q" = "mode default"; - "Return" = "mode default"; + # Screenshots + "Print" = "exec ${scrot} --focused"; + "${mod}+Print" = "exec ${scrot}"; # FIXME Doesn't work at least in the VM + "Ctrl+Print" = "exec ${pkgs.coreutils}/bin/sleep 1 && ${scrot} --select"; + # TODO Try using bindsym --release instead of sleep + # change focus + "${mod}+h" = "focus left; ${focus}"; + "${mod}+j" = "focus down; ${focus}"; + "${mod}+k" = "focus up; ${focus}"; + "${mod}+l" = "focus right; ${focus}"; + # move focused window + "${mod}+Shift+h" = "move left; ${focus}"; + "${mod}+Shift+j" = "move down; ${focus}"; + "${mod}+Shift+k" = "move up; ${focus}"; + "${mod}+Shift+l" = "move right; ${focus}"; + # workspace back and forth (with/without active container) + "${mod}+b" = "workspace back_and_forth; ${focus}"; + "${mod}+Shift+b" = "move container to workspace back_and_forth; workspace back_and_forth; ${focus}"; + # Change container layout + "${mod}+g" = "split h; ${focus}"; + "${mod}+v" = "split v; ${focus}"; + "${mod}+f" = "fullscreen toggle; ${focus}"; + "${mod}+s" = "layout stacking; ${focus}"; + "${mod}+w" = "layout tabbed; ${focus}"; + "${mod}+e" = "layout toggle split; ${focus}"; + "${mod}+Shift+space" = "floating toggle; ${focus}"; + # Focus container + "${mod}+space" = "focus mode_toggle; ${focus}"; + "${mod}+a" = "focus parent; ${focus}"; + "${mod}+q" = "focus child; ${focus}"; + # Switch to workspace + "${mod}+1" = "workspace 1; ${focus}"; + "${mod}+2" = "workspace 2; ${focus}"; + "${mod}+3" = "workspace 3; ${focus}"; + "${mod}+4" = "workspace 4; ${focus}"; + "${mod}+5" = "workspace 5; ${focus}"; + "${mod}+6" = "workspace 6; ${focus}"; + "${mod}+7" = "workspace 7; ${focus}"; + "${mod}+8" = "workspace 8; ${focus}"; + "${mod}+9" = "workspace 9; ${focus}"; + "${mod}+0" = "workspace 10; ${focus}"; + # TODO Prevent repetitions, see workspace assignation for example + #navigate workspaces next / previous + "${mod}+Ctrl+h" = "workspace prev_on_output; ${focus}"; + "${mod}+Ctrl+l" = "workspace next_on_output; ${focus}"; + "${mod}+Ctrl+j" = "workspace prev; ${focus}"; + "${mod}+Ctrl+k" = "workspace next; ${focus}"; + # Move to workspace next / previous with focused container + "${mod}+Ctrl+Shift+h" = "move container to workspace prev_on_output; workspace prev_on_output; ${focus}"; + "${mod}+Ctrl+Shift+l" = "move container to workspace next_on_output; workspace next_on_output; ${focus}"; + "${mod}+Ctrl+Shift+j" = "move container to workspace prev; workspace prev; ${focus}"; + "${mod}+Ctrl+Shift+k" = "move container to workspace next; workspace next; ${focus}"; + # move focused container to workspace + "${mod}+ctrl+1" = "move container to workspace 1; ${focus}"; + "${mod}+ctrl+2" = "move container to workspace 2; ${focus}"; + "${mod}+ctrl+3" = "move container to workspace 3; ${focus}"; + "${mod}+ctrl+4" = "move container to workspace 4; ${focus}"; + "${mod}+ctrl+5" = "move container to workspace 5; ${focus}"; + "${mod}+ctrl+6" = "move container to workspace 6; ${focus}"; + "${mod}+ctrl+7" = "move container to workspace 7; ${focus}"; + "${mod}+ctrl+8" = "move container to workspace 8; ${focus}"; + "${mod}+ctrl+9" = "move container to workspace 9; ${focus}"; + "${mod}+ctrl+0" = "move container to workspace 10; ${focus}"; + # move to workspace with focused container + "${mod}+shift+1" = "move container to workspace 1; workspace 1; ${focus}"; + "${mod}+shift+2" = "move container to workspace 2; workspace 2; ${focus}"; + "${mod}+shift+3" = "move container to workspace 3; workspace 3; ${focus}"; + "${mod}+shift+4" = "move container to workspace 4; workspace 4; ${focus}"; + "${mod}+shift+5" = "move container to workspace 5; workspace 5; ${focus}"; + "${mod}+shift+6" = "move container to workspace 6; workspace 6; ${focus}"; + "${mod}+shift+7" = "move container to workspace 7; workspace 7; ${focus}"; + "${mod}+shift+8" = "move container to workspace 8; workspace 8; ${focus}"; + "${mod}+shift+9" = "move container to workspace 9; workspace 9; ${focus}"; + "${mod}+shift+0" = "move container to workspace 10; workspace 10; ${focus}"; + # move workspaces to screen (arrow keys) + "${mod}+ctrl+shift+Right" = "move workspace to output right; ${focus}"; + "${mod}+ctrl+shift+Left" = "move workspace to output left; ${focus}"; + "${mod}+Ctrl+Shift+Up" = "move workspace to output above; ${focus}"; + "${mod}+Ctrl+Shift+Down" = "move workspace to output below; ${focus}"; + # i3 control + "${mod}+Shift+c" = "reload"; + "${mod}+Shift+r" = "restart"; + "${mod}+Shift+e" = "exit"; + # Screen off commands + "${mod}+F1" = "exec --no-startup-id ${pkgs.bash}/bin/sh -c \"${pkgs.coreutils}/bin/sleep .25 && ${pkgs.xorg.xset}/bin/xset dpms force off\""; + # TODO --release? + "${mod}+F4" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -disable"; + "${mod}+F5" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -enable"; + # Modes + "${mod}+Escape" = "mode ${mode_system}"; + "${mod}+r" = "mode ${mode_resize}"; + "${mod}+Shift+p" = "mode ${mode_pres_main}"; + "${mod}+t" = "mode ${mode_screen}"; + "${mod}+y" = "mode ${mode_temp}"; }; - "${mode_pres_sec}" = { - "b" = "workspace 1, workspace 2, mode ${mode_pres_main}"; - "q" = "mode default"; - "Return" = "mode default"; - }; - "${mode_screen}" = - let - builtin_configs = [ "off" "common" "clone-largest" "horizontal" "vertical" "horizontal-reverse" "vertical-reverse" ]; - autorandrmenu = { title, option, builtin ? false }: pkgs.writeShellScript "autorandrmenu" - '' - shopt -s nullglob globstar - profiles="${if builtin then lib.strings.concatLines builtin_configs else ""}$(${pkgs.autorandr}/bin/autorandr | ${pkgs.gawk}/bin/awk '{ print $1 }')" - profile="$(echo "$profiles" | ${config.programs.rofi.package}/bin/rofi -dmenu -p "${title}")" - [[ -n "$profile" ]] || exit - ${pkgs.autorandr}/bin/autorandr ${option} "$profile" - ''; - in - { - "a" = "exec ${pkgs.autorandr}/bin/autorandr --change --force, mode default"; - "l" = "exec ${autorandrmenu {title="Load profile"; option="--load"; builtin = true;}}, mode default"; - "s" = "exec ${autorandrmenu {title="Save profile"; option="--save";}}, mode default"; - "r" = "exec ${autorandrmenu {title="Remove profile"; option="--remove";}}, mode default"; - "d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default"; + modes = let return_bindings = { + "Return" = "mode default"; + "Escape" = "mode default"; + }; in + { + "${mode_system}" = { + "l" = "exec --no-startup-id exec ${locker}, mode default"; + "e" = "exit, mode default"; + "s" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl suspend, mode default"; + "h" = "exec --no-startup-id exec ${locker} & ${pkgs.systemd}/bin/systemctl hibernate, mode default"; + "r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default"; + "p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default"; } // return_bindings; - "${mode_temp}" = { - # "r" = "exec ${pkgs.sct}/bin/sct 1000"; - # "d" = "exec ${pkgs.sct}/bin/sct 2000"; - # "c" = "exec ${pkgs.sct}/bin/sct 4500"; - # "o" = "exec ${pkgs.sct}/bin/sct"; - # "a" = "exec ${pkgs.sct}/bin/sct 8000"; - # "b" = "exec ${pkgs.sct}/bin/sct 10000"; - # FIXME Not on aarch64 - } // return_bindings; + "${mode_resize}" = { + "h" = "resize shrink width 10 px or 10 ppt; ${focus}"; + "j" = "resize grow height 10 px or 10 ppt; ${focus}"; + "k" = "resize shrink height 10 px or 10 ppt; ${focus}"; + "l" = "resize grow width 10 px or 10 ppt; ${focus}"; + } // return_bindings; + "${mode_pres_main}" = { + "b" = "workspace 3, workspace 4, mode ${mode_pres_sec}"; + "q" = "mode default"; + "Return" = "mode default"; + }; + "${mode_pres_sec}" = { + "b" = "workspace 1, workspace 2, mode ${mode_pres_main}"; + "q" = "mode default"; + "Return" = "mode default"; + }; + "${mode_screen}" = + let + builtin_configs = [ "off" "common" "clone-largest" "horizontal" "vertical" "horizontal-reverse" "vertical-reverse" ]; + autorandrmenu = { title, option, builtin ? false }: pkgs.writeShellScript "autorandrmenu" + '' + shopt -s nullglob globstar + profiles="${if builtin then lib.strings.concatLines builtin_configs else ""}$(${pkgs.autorandr}/bin/autorandr | ${pkgs.gawk}/bin/awk '{ print $1 }')" + profile="$(echo "$profiles" | ${config.programs.rofi.package}/bin/rofi -dmenu -p "${title}")" + [[ -n "$profile" ]] || exit + ${pkgs.autorandr}/bin/autorandr ${option} "$profile" + ''; + in + { + "a" = "exec ${pkgs.autorandr}/bin/autorandr --change --force, mode default"; + "l" = "exec ${autorandrmenu {title="Load profile"; option="--load"; builtin = true;}}, mode default"; + "s" = "exec ${autorandrmenu {title="Save profile"; option="--save";}}, mode default"; + "r" = "exec ${autorandrmenu {title="Remove profile"; option="--remove";}}, mode default"; + "d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default"; + } // return_bindings; + "${mode_temp}" = { + # "r" = "exec ${pkgs.sct}/bin/sct 1000"; + # "d" = "exec ${pkgs.sct}/bin/sct 2000"; + # "c" = "exec ${pkgs.sct}/bin/sct 4500"; + # "o" = "exec ${pkgs.sct}/bin/sct"; + # "a" = "exec ${pkgs.sct}/bin/sct 8000"; + # "b" = "exec ${pkgs.sct}/bin/sct 10000"; + # FIXME Not on aarch64 + } // return_bindings; + }; + window = { + hideEdgeBorders = "both"; + titlebar = false; # So that single-container screens are basically almost fullscreen + commands = [ + # Open specific applications in floating mode + { criteria = { class = "Firefox"; }; command = "layout tabbed"; } # Doesn't seem to work anymore + { criteria = { class = "qutebrowser"; }; command = "layout tabbed"; } + { criteria = { title = "^pdfpc.*"; window_role = "presenter"; }; command = "move to output left, fullscreen"; } + { criteria = { title = "^pdfpc.*"; window_role = "presentation"; }; command = "move to output right, fullscreen"; } + # switch to workspace with urgent window automatically + { criteria = { urgent = "latest"; }; command = "focus"; } + ]; }; - window = { - hideEdgeBorders = "both"; - titlebar = false; # So that single-container screens are basically almost fullscreen - commands = [ - # Open specific applications in floating mode - { criteria = { class = "Firefox"; }; command = "layout tabbed"; } # Doesn't seem to work anymore - { criteria = { class = "qutebrowser"; }; command = "layout tabbed"; } - { criteria = { title = "^pdfpc.*"; window_role = "presenter"; }; command = "move to output left, fullscreen"; } - { criteria = { title = "^pdfpc.*"; window_role = "presentation"; }; command = "move to output right, fullscreen"; } - # switch to workspace with urgent window automatically - { criteria = { urgent = "latest"; }; command = "focus"; } - ]; - }; - floating = { - criteria = [ - { title = "pacmixer"; } - { window_role = "pop-up"; } - { window_role = "task_dialog"; } - ]; - }; - startup = [ - # Lock screen after 10 minutes - { notification = false; command = "${pkgs.xautolock}/bin/xautolock -time 10 -locker '${pkgs.xorg.xset}/bin/xset dpms force standby' -killtime 1 -killer ${locker}"; } - { - notification = false; - command = "${pkgs.writeShellApplication { + floating = { + criteria = [ + { title = "pacmixer"; } + { window_role = "pop-up"; } + { window_role = "task_dialog"; } + ]; + }; + startup = [ + # Lock screen after 10 minutes + { notification = false; command = "${pkgs.xautolock}/bin/xautolock -time 10 -locker '${pkgs.xorg.xset}/bin/xset dpms force standby' -killtime 1 -killer ${locker}"; } + { + notification = false; + command = "${pkgs.writeShellApplication { name = "batteryNotify"; runtimeInputs = with pkgs; [coreutils libnotify]; text = builtins.readFile ./batteryNotify.sh; # TODO Use batsignal instead? # TODO Only on computers with battery }}/bin/batteryNotify"; - } - # TODO There's a services.screen-locker.xautolock but not sure it can match the above command - ]; - workspaceLayout = "tabbed"; - focus.mouseWarping = true; # i3 only supports warping to workspace, hence ${focus} - workspaceOutputAssign = - let - x11_screens = [ "HDMI-1-0" "eDP1" ]; # FIXME Per computer thing - workspaces = map (i: { name = toString i; key = toString (lib.mod i 10); }) (lib.lists.range 1 10); - forEachWorkspace = f: map (w: f { w = w; workspace = ((builtins.elemAt workspaces w)); }) (lib.lists.range 0 ((builtins.length workspaces) - 1)); - in - forEachWorkspace ({ w, workspace }: { output = builtins.elemAt x11_screens (lib.mod w (builtins.length x11_screens)); workspace = workspace.name; }); + } + # TODO There's a services.screen-locker.xautolock but not sure it can match the above command + ]; + workspaceLayout = "tabbed"; + focus.mouseWarping = true; # i3 only supports warping to workspace, hence ${focus} + workspaceOutputAssign = + let + x11_screens = [ "HDMI-1-0" "eDP1" ]; # FIXME Per computer thing + workspaces = map (i: { name = toString i; key = toString (lib.mod i 10); }) (lib.lists.range 1 10); + forEachWorkspace = f: map (w: f { w = w; workspace = ((builtins.elemAt workspaces w)); }) (lib.lists.range 0 ((builtins.length workspaces) - 1)); + in + forEachWorkspace ({ w, workspace }: { output = builtins.elemAt x11_screens (lib.mod w (builtins.length x11_screens)); workspace = workspace.name; }); + }; + }; + }; + numlock.enable = true; # FIXME Only on computers with a separate one + }; + + programs = { + # Browser + qutebrowser = { + enable = true; + keyBindings = { + normal = { + # Match tab behaviour to i3. Not that I use them. + "H" = "tab-prev"; + "J" = "back"; + "K" = "forward"; + "L" = "tab-next"; + # "T" = null; + "af" = "spawn --userscript freshrss"; # TODO Broken? + "as" = "spawn --userscript shaarli"; # TODO I don't use shaarli anymore + # "d" = null; + "u" = "undo --window"; + # TODO Unbind d and T (?) }; + }; + loadAutoconfig = true; # FIXME Salvage stuff from autoconfig.yml + searchEngines = rec { + DEFAULT = ecosia; + ampwhat = "http://www.amp-what.com/unicode/search/{}"; + aw = ampwhat; + ddg = duckduckgo; + duckduckgo = "https://duckduckgo.com/?q={}&ia=web"; + ecosia = "https://www.ecosia.org/search?q={}"; + github = "https://github.com/search?q={}"; + google = "https://www.google.fr/search?q={}"; + g = google; + npm = "https://www.npmjs.com/search?q={}"; + q = qwant; + qwant = "https://www.qwant.com/?t=web&q={}"; + wolfram = "https://www.wolframalpha.com/input/?i={}"; + youtube = "https://www.youtube.com/results?search_query={}"; + yt = youtube; + }; + settings = { + downloads.location.prompt = false; + tabs = { + show = "never"; + tabs_are_windows = true; + }; + url = { + open_base_url = true; + start_pages = "https://geoffrey.frogeye.fr/blank.html"; + }; + content = { + # I had this setting below, not sure if it did something special + # config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*") + cookies.accept = "no-3rdparty"; + prefers_reduced_motion = true; + }; + }; }; - }; - numlock.enable = true; # FIXME Only on computers with a separate one - }; - programs = { - # Browser - qutebrowser = { - enable = true; - keyBindings = { - normal = { - # Match tab behaviour to i3. Not that I use them. - "H" = "tab-prev"; - "J" = "back"; - "K" = "forward"; - "L" = "tab-next"; - # "T" = null; - "af" = "spawn --userscript freshrss"; # TODO Broken? - "as" = "spawn --userscript shaarli"; # TODO I don't use shaarli anymore - # "d" = null; - "u" = "undo --window"; - # TODO Unbind d and T (?) - }; - }; - loadAutoconfig = true; # FIXME Salvage stuff from autoconfig.yml - searchEngines = rec { - DEFAULT = ecosia; - ampwhat = "http://www.amp-what.com/unicode/search/{}"; - aw = ampwhat; - ddg = duckduckgo; - duckduckgo = "https://duckduckgo.com/?q={}&ia=web"; - ecosia = "https://www.ecosia.org/search?q={}"; - github = "https://github.com/search?q={}"; - google = "https://www.google.fr/search?q={}"; - g = google; - npm = "https://www.npmjs.com/search?q={}"; - q = qwant; - qwant = "https://www.qwant.com/?t=web&q={}"; - wolfram = "https://www.wolframalpha.com/input/?i={}"; - youtube = "https://www.youtube.com/results?search_query={}"; - yt = youtube; - }; - settings = { - downloads.location.prompt = false; - tabs = { - show = "never"; - tabs_are_windows = true; - }; - url = { - open_base_url = true; - start_pages = "https://geoffrey.frogeye.fr/blank.html"; - }; - content = { - # I had this setting below, not sure if it did something special - # config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*") - cookies.accept = "no-3rdparty"; - prefers_reduced_motion = true; - }; - }; - }; - - # Terminal - alacritty = { - # FIXME Emojis - enable = true; - settings = { - bell = { - animation = "EaseOutExpo"; - color = "#000000"; - command = { program = "${pkgs.sox}/bin/play"; args = [ "-n" "synth" "sine" "C5" "sine" "E4" "remix" "1-2" "fade" "0.1" "0.2" "0.1" ]; }; - duration = 100; - }; - cursor = { vi_mode_style = "Underline"; }; - hints = { - enabled = [ - { - binding = { mods = "Control|Alt"; key = "F"; }; - command = "${pkgs.xdg-utils}/bin/xdg-open"; - mouse = { enabled = true; mods = "Control"; }; - post_processing = true; - regex = "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\\u0000-\\u001F\\u007F-\\u009F<>\"\\\\s{-}\\\\^⟨⟩`]+"; - } + # Terminal + alacritty = { + # FIXME Emojis + enable = true; + settings = { + bell = { + animation = "EaseOutExpo"; + color = "#000000"; + command = { program = "${pkgs.sox}/bin/play"; args = [ "-n" "synth" "sine" "C5" "sine" "E4" "remix" "1-2" "fade" "0.1" "0.2" "0.1" ]; }; + duration = 100; + }; + cursor = { vi_mode_style = "Underline"; }; + hints = { + enabled = [ + { + binding = { mods = "Control|Alt"; key = "F"; }; + command = "${pkgs.xdg-utils}/bin/xdg-open"; + mouse = { enabled = true; mods = "Control"; }; + post_processing = true; + regex = "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\\u0000-\\u001F\\u007F-\\u009F<>\"\\\\s{-}\\\\^⟨⟩`]+"; + } + ]; + }; + key_bindings = [ + { mode = "~Search"; mods = "Alt|Control"; key = "Space"; action = "ToggleViMode"; } + { mode = "Vi|~Search"; mods = "Control"; key = "K"; action = "ScrollHalfPageUp"; } + { mode = "Vi|~Search"; mods = "Control"; key = "J"; action = "ScrollHalfPageDown"; } + { mode = "~Vi"; mods = "Control|Alt"; key = "V"; action = "Paste"; } + { mods = "Control|Alt"; key = "C"; action = "Copy"; } + { mode = "~Search"; mods = "Control|Alt"; key = "F"; action = "SearchForward"; } + { mode = "~Search"; mods = "Control|Alt"; key = "B"; action = "SearchBackward"; } + { mode = "Vi|~Search"; mods = "Control|Alt"; key = "C"; action = "ClearSelection"; } ]; + window = { + dynamic_padding = false; + dynamic_title = true; + }; }; - key_bindings = [ - { mode = "~Search"; mods = "Alt|Control"; key = "Space"; action = "ToggleViMode"; } - { mode = "Vi|~Search"; mods = "Control"; key = "K"; action = "ScrollHalfPageUp"; } - { mode = "Vi|~Search"; mods = "Control"; key = "J"; action = "ScrollHalfPageDown"; } - { mode = "~Vi"; mods = "Control|Alt"; key = "V"; action = "Paste"; } - { mods = "Control|Alt"; key = "C"; action = "Copy"; } - { mode = "~Search"; mods = "Control|Alt"; key = "F"; action = "SearchForward"; } - { mode = "~Search"; mods = "Control|Alt"; key = "B"; action = "SearchBackward"; } - { mode = "Vi|~Search"; mods = "Control|Alt"; key = "C"; action = "ClearSelection"; } - ]; - window = { - dynamic_padding = false; - dynamic_title = true; + }; + # Backup terminal + urxvt = { + enable = true; + package = pkgs.rxvt-unicode-emoji; + scroll = { + bar.enable = false; + }; + iso14755 = false; # Disable Ctrl+Shift default bindings + keybindings = { + "Shift-Control-C" = "eval:selection_to_clipboard"; + "Shift-Control-V" = "eval:paste_clipboard"; + # TODO Not sure resizing works, Nix doesn't have the package (urxvt-resize-font-git on Arch) + "Control-KP_Subtract" = "resize-font:smaller"; + "Control-KP_Add" = "resize-font:bigger"; + }; + extraConfig = { + "letterSpace" = 0; + "perl-ext-common" = "resize-font,bell-command,readline,selection"; + "bell-command" = "${pkgs.sox}/bin/play -n synth sine C5 sine E4 remix 1-2 fade 0.1 0.2 0.1 &> /dev/null"; + }; + }; + rofi = { + enable = true; + pass.enable = true; + extraConfig = { + lazy-grab = false; + matching = "regex"; + }; + }; + autorandr.enable = true; + mpv = { + enable = true; + config = { + audio-display = false; + save-position-on-quit = true; + osc = false; # # Required by thumbnail script + }; + scripts = with pkgs.mpvScripts; [ thumbnail ]; + scriptOpts = { + mpv_thumbnail_script = { + cache_directory = "/tmp/mpv_thumbs_${config.home.username}"; + }; }; }; }; - # Backup terminal - urxvt = { - enable = true; - package = pkgs.rxvt-unicode-emoji; - scroll = { - bar.enable = false; - }; - iso14755 = false; # Disable Ctrl+Shift default bindings - keybindings = { - "Shift-Control-C" = "eval:selection_to_clipboard"; - "Shift-Control-V" = "eval:paste_clipboard"; - # TODO Not sure resizing works, Nix doesn't have the package (urxvt-resize-font-git on Arch) - "Control-KP_Subtract" = "resize-font:smaller"; - "Control-KP_Add" = "resize-font:bigger"; - }; - extraConfig = { - "letterSpace" = 0; - "perl-ext-common" = "resize-font,bell-command,readline,selection"; - "bell-command" = "${pkgs.sox}/bin/play -n synth sine C5 sine E4 remix 1-2 fade 0.1 0.2 0.1 &> /dev/null"; - }; - }; - rofi = { - enable = true; - pass.enable = true; - extraConfig = { - lazy-grab = false; - matching = "regex"; - }; - }; - autorandr.enable = true; - mpv = { - enable = true; - config = { - audio-display = false; - save-position-on-quit = true; - osc = false; # # Required by thumbnail script - }; - scripts = with pkgs.mpvScripts; [ thumbnail ]; - scriptOpts = { - mpv_thumbnail_script = { - cache_directory = "/tmp/mpv_thumbs_${config.home.username}"; - }; - }; - }; - }; - xdg = { - mimeApps = { - enable = true; - associations.added = { - "text/html" = "org.qutebrowser.qutebrowser.desktop"; - "x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop"; - "x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop"; - "x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop"; - "x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop"; + xdg = { + mimeApps = { + enable = true; + associations.added = { + "text/html" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop"; + }; }; - }; - userDirs = { - enable = true; # TODO Which ones do we want? - createDirectories = true; - # French, because then it there's a different initial for each, making navigation easier - desktop = null; - download = "${config.home.homeDirectory}/Téléchargements"; - music = "${config.home.homeDirectory}/Musiques"; - pictures = "${config.home.homeDirectory}/Images"; - publicShare = null; - templates = null; - videos = "${config.home.homeDirectory}/Vidéos"; - extraConfig = { - XDG_SCREENSHOTS_DIR = "${config.home.homeDirectory}/Screenshots"; + userDirs = { + enable = true; # TODO Which ones do we want? + createDirectories = true; + # French, because then it there's a different initial for each, making navigation easier + desktop = null; + download = "${config.home.homeDirectory}/Téléchargements"; + music = "${config.home.homeDirectory}/Musiques"; + pictures = "${config.home.homeDirectory}/Images"; + publicShare = null; + templates = null; + videos = "${config.home.homeDirectory}/Vidéos"; + extraConfig = { + XDG_SCREENSHOTS_DIR = "${config.home.homeDirectory}/Screenshots"; + }; }; - }; - configFile = { - "pulse/client.conf" = { - text = ''cookie-file = .config/pulse/pulse-cookie''; - }; - "xinitrc" = - let - nixgl = import - (builtins.fetchGit { - url = "https://github.com/nix-community/nixGL"; - rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5"; - }) - { }; - nixGLIntelPrefix = "${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel "; - wmPrefix = "${lib.optionalString config.frogeye.desktop.nixGLIntel nixGLIntelPrefix}"; - in - { - source = pkgs.writeShellScript "xinitrc" '' - ${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path} - ${wmPrefix}${config.xsession.windowManager.command} + configFile = { + "pulse/client.conf" = { + text = ''cookie-file = .config/pulse/pulse-cookie''; + }; + "xinitrc" = + let + nixgl = import + (builtins.fetchGit { + url = "https://github.com/nix-community/nixGL"; + rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5"; + }) + { }; + nixGLIntelPrefix = "${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel "; + wmPrefix = "${lib.optionalString config.frogeye.desktop.nixGLIntel nixGLIntelPrefix}"; + in + { + source = pkgs.writeShellScript "xinitrc" '' + ${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path} + ${wmPrefix}${config.xsession.windowManager.command} + ''; + }; + "rofimoji.rc" = { + text = '' + skin-tone = neutral + files = [emojis, math] + action = clipboard ''; }; - "rofimoji.rc" = { - text = '' - skin-tone = neutral - files = [emojis, math] - action = clipboard + }; + }; + services = { + unclutter.enable = true; + dunst = + { + enable = true; + settings = + # TODO Change dmenu for rofi, so we can use context + with config.lib.stylix.colors.withHashtag; { + global = { + separator_color = lib.mkForce base05; + idle_threshold = 120; + markup = "full"; + max_icon_size = 48; + # TODO Those shortcuts don't seem to work, maybe try: + # > define shortcuts inside your window manager and bind them to dunstctl(1) commands + close_all = "ctrl+mod4+n"; + close = "mod4+n"; + context = "mod1+mod4+n"; + history = "shift+mod4+n"; + }; + + urgency_low = { + background = lib.mkForce base01; + foreground = lib.mkForce base03; + frame_color = lib.mkForce base05; + }; + urgency_normal = { + background = lib.mkForce base02; + foreground = lib.mkForce base05; + frame_color = lib.mkForce base05; + }; + urgency_critical = { + background = lib.mkForce base08; + foreground = lib.mkForce base06; + frame_color = lib.mkForce base05; + }; + }; + }; + mpd = { + enable = true; + network = { + listenAddress = "0.0.0.0"; # So it can be controlled from home + # TODO ... and whoever is the Wi-Fi network I'm using, which, not great + port = 8601; # FIXME Chose a different one for testing, should revert + startWhenNeeded = true; + }; + extraConfig = '' + restore_paused "yes" ''; }; + autorandr.enable = true; }; - }; - services = { - unclutter.enable = true; - dunst = - { - enable = true; - settings = - # TODO Change dmenu for rofi, so we can use context - with config.lib.stylix.colors.withHashtag; { - global = { - separator_color = lib.mkForce base05; - idle_threshold = 120; - markup = "full"; - max_icon_size = 48; - # TODO Those shortcuts don't seem to work, maybe try: - # > define shortcuts inside your window manager and bind them to dunstctl(1) commands - close_all = "ctrl+mod4+n"; - close = "mod4+n"; - context = "mod1+mod4+n"; - history = "shift+mod4+n"; - }; - urgency_low = { - background = lib.mkForce base01; - foreground = lib.mkForce base03; - frame_color = lib.mkForce base05; - }; - urgency_normal = { - background = lib.mkForce base02; - foreground = lib.mkForce base05; - frame_color = lib.mkForce base05; - }; - urgency_critical = { - background = lib.mkForce base08; - foreground = lib.mkForce base06; - frame_color = lib.mkForce base05; - }; - }; + home = { + packages = with pkgs; [ + # remote + tigervnc + + # music + mpc-cli + ashuffle + vimpc + + # multimedia common + gimp + inkscape + libreoffice + + # data management + freefilesync + + # browsers + firefox + + # fonts + dejavu_fonts + twemoji-color-font + gnome.gedit + feh + zathura + zbar + zathura + meld + python3Packages.magic + yubikey-touch-detector + + # x11-exclusive + numlockx + simplescreenrecorder + trayer + xclip + keynav + xorg.xinit + xorg.xbacklight + # TODO Make this clean. Service? + (callPackage (import ./frobar) { }) # FIXME Call it where needed + + + # organisation + pass + thunderbird + ]; + sessionVariables = { + MPD_PORT = "${toString config.services.mpd.network.port}"; }; - mpd = { - enable = true; - network = { - listenAddress = "0.0.0.0"; # So it can be controlled from home - # TODO ... and whoever is the Wi-Fi network I'm using, which, not great - port = 8601; # FIXME Chose a different one for testing, should revert - startWhenNeeded = true; - }; - extraConfig = '' - restore_paused "yes" - ''; - }; - autorandr.enable = true; - }; - - home = { - packages = with pkgs; [ - # remote - tigervnc - - # music - mpc-cli - ashuffle - vimpc - - # multimedia common - gimp - inkscape - libreoffice - - # data management - freefilesync - - # browsers - firefox - - # fonts - dejavu_fonts - twemoji-color-font - gnome.gedit - feh - zathura - zbar - zathura - meld - python3Packages.magic - yubikey-touch-detector - - # x11-exclusive - numlockx - simplescreenrecorder - trayer - xclip - keynav - xorg.xinit - xorg.xbacklight - # TODO Make this clean. Service? - (callPackage (import ./frobar) { }) # FIXME Call it where needed - - - # organisation - pass - thunderbird - ]; - sessionVariables = { - MPD_PORT = "${toString config.services.mpd.network.port}"; }; }; } diff --git a/config/nix/hm/dev.nix b/config/nix/hm/dev.nix index 2f1f4db..a7c5287 100644 --- a/config/nix/hm/dev.nix +++ b/config/nix/hm/dev.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ pkgs, config, ... }: { # TODO Separate in diffrent packages once the structure is finalized... # or connvert into per-directory requirements home.packages = with pkgs; [ @@ -19,17 +19,14 @@ yq universal-ctags highlight - zeal-qt6 # Offline documentation # Docker docker docker-compose # FPGA - yosys verilog # ghdl # TODO Not on aarch64 - gtkwave # TODO Display server only # Network socat @@ -37,13 +34,22 @@ whois nmap tcpdump - wireshark-qt # TODO Display server only # nix nix # Python python3Packages.ipython + ] ++ lib.optionals config.frogeye.desktop.xorg [ + # Common + zeal-qt6 # Offline documentation + + # FPGA + yosys + gtkwave + + # Network + wireshark-qt ]; } diff --git a/config/nix/hm/extra.nix b/config/nix/hm/extra.nix index b8b6ee0..efd2b78 100644 --- a/config/nix/hm/extra.nix +++ b/config/nix/hm/extra.nix @@ -1,27 +1,14 @@ { pkgs, lib, config, ... }: { - home.packages = with pkgs; lib.mkIf config.frogeye.extra [ + home.packages = with pkgs; lib.mkIf config.frogeye.extra ([ # android tools android-tools - # multimedia editors - gimp - inkscape - darktable - blender - puddletag - musescore - audacity - # downloading yt-dlp megatools # transmission TODO Collision if both transmissions are active? - transmission-qt - # wine - wine - # TODO wine-gecko wine-mono lib32-libpulse (?) # documents pandoc @@ -34,11 +21,30 @@ hunspellDicts.nl_NL # TODO libreoffice-extension-languagetool or libreoffice-extension-grammalecte-fr + ] ++ lib.optionals config.frogeye.desktop.xorg [ + + # multimedia editors + gimp + inkscape + darktable + blender + puddletag + musescore + audacity + + # downloading + transmission-qt + + # wine + wine + # TODO wine-gecko wine-mono lib32-libpulse (?) + # gaming steam yuzu-mainline minecraft # TODO factorio - ]; + + ]); } diff --git a/config/nix/options.nix b/config/nix/options.nix index 0b2bf4e..5162440 100644 --- a/config/nix/options.nix +++ b/config/nix/options.nix @@ -2,6 +2,9 @@ { options.frogeye = { extra = lib.mkEnableOption "Big software"; - desktop.nixGLIntel = lib.mkEnableOption "Enable nixGLIntel/nixVulkanIntel for windows manager"; + desktop = { + xorg = lib.mkEnableOption "Enable X11 support"; + nixGLIntel = lib.mkEnableOption "Enable nixGLIntel/nixVulkanIntel for windows manager"; + }; }; } diff --git a/config/nix/os/desktop.nix b/config/nix/os/desktop.nix index 51b95dd..c6a2d16 100644 --- a/config/nix/os/desktop.nix +++ b/config/nix/os/desktop.nix @@ -1,17 +1,18 @@ -{ pkgs, ... }: +{ pkgs, lib, config, ... }: { - # Enable the X11 windowing system - services.xserver.enable = true; + config = lib.mkIf config.frogeye.desktop.xorg { + # Enable the X11 windowing system - services.xserver = { - windowManager.i3.enable = true; - displayManager.defaultSession = "none+i3"; + services.xserver = { + enable = true; + windowManager.i3.enable = true; + displayManager.defaultSession = "none+i3"; - # Keyboard layout - extraLayouts.qwerty-fr = { - description = "QWERTY-fr"; - languages = [ "fr" ]; - symbolsFile = "${pkgs.stdenv.mkDerivation { + # Keyboard layout + extraLayouts.qwerty-fr = { + description = "QWERTY-fr"; + languages = [ "fr" ]; + symbolsFile = "${pkgs.stdenv.mkDerivation { name = "qwerty-fr-keypad"; src = builtins.fetchGit { url = "https://github.com/qwerty-fr/qwerty-fr.git"; @@ -26,11 +27,12 @@ runHook postInstall ''; }}/linux/us_qwerty-fr"; + }; + layout = "qwerty-fr"; }; - layout = "qwerty-fr"; - }; - # Enable sound - sound.enable = true; - hardware.pulseaudio.enable = true; + # Enable sound + sound.enable = true; + hardware.pulseaudio.enable = true; + }; } diff --git a/config/nix/pindakaas.nix b/config/nix/pindakaas.nix index a7f49c9..576b163 100644 --- a/config/nix/pindakaas.nix +++ b/config/nix/pindakaas.nix @@ -5,8 +5,10 @@ ./os/loader.nix ]; - networking.hostName = "pindakaas"; # nixos-hardware use latest kernel by default. This obviously runs quickly out of sync with zfs packages. # zfs packages are included despite me asking anything zfs, probably they're in the image for installation purposes? boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; + + networking.hostName = "pindakaas"; + frogeye.desktop.xorg = true; } From 37a8134c23a87dc1a4ed03abb5847f96c6db744d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 22 Nov 2023 16:32:20 +0100 Subject: [PATCH 062/108] nix: Dev stuff & misc behind options --- config/nix/curacao.nix | 1 + config/nix/curacao_test.nix | 5 +++ config/nix/hm/common.nix | 4 -- config/nix/hm/dev.nix | 59 +++++++++++++++----------- config/nix/hm/extra.nix | 83 ++++++++++++++++++++----------------- config/nix/hm/vim.nix | 8 +++- config/nix/options.nix | 16 +++++++ config/nix/pindakaas.nix | 3 ++ 8 files changed, 112 insertions(+), 67 deletions(-) diff --git a/config/nix/curacao.nix b/config/nix/curacao.nix index 9b389a1..9285531 100644 --- a/config/nix/curacao.nix +++ b/config/nix/curacao.nix @@ -8,4 +8,5 @@ networking.hostName = "curacao"; frogeye.extra = true; frogeye.desktop.xorg = true; + frogeye.dev.docker = true; } diff --git a/config/nix/curacao_test.nix b/config/nix/curacao_test.nix index 815e13d..10293e7 100644 --- a/config/nix/curacao_test.nix +++ b/config/nix/curacao_test.nix @@ -10,4 +10,9 @@ frogeye.extra = true; frogeye.desktop.xorg = true; frogeye.desktop.nixGLIntel = true; + frogeye.dev.ansible.enable = true; + frogeye.dev.c.enable = true; + frogeye.dev.docker.enable = true; + frogeye.dev.fpga.enable = true; + frogeye.dev.python.enable = true; } diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index e839ae9..a355330 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -394,19 +394,16 @@ in wget curl python3Packages.pip - ansible # TODO Reevaluate # shell zsh-completions nix-zsh-completions zsh-history-substring-search - antigen # TODO Reevaluate powerline-go # terminal essentials moreutils man - visidata # nodePackages.insect # FIXME Don't install on aarch64 # TODO Use whatever replaces insect translate-shell @@ -438,7 +435,6 @@ in speedtest-cli # multimedia toolbox - ffmpeg sox imagemagick diff --git a/config/nix/hm/dev.nix b/config/nix/hm/dev.nix index a7c5287..f98bcf9 100644 --- a/config/nix/hm/dev.nix +++ b/config/nix/hm/dev.nix @@ -1,17 +1,9 @@ { pkgs, config, ... }: { - # TODO Separate in diffrent packages once the structure is finalized... - # or connvert into per-directory requirements + # TODO Maybe should be per-directory dotenv + # Or not, for neovim + + # Always on home.packages = with pkgs; [ - # Ansible - ansible - ansible-lint - - # C/C++ - cmake - clang - ccache - gdb - # Common perf-tools git @@ -20,14 +12,6 @@ universal-ctags highlight - # Docker - docker - docker-compose - - # FPGA - verilog - # ghdl # TODO Not on aarch64 - # Network socat dig @@ -38,18 +22,45 @@ # nix nix - # Python - python3Packages.ipython + # Always on (graphical) ] ++ lib.optionals config.frogeye.desktop.xorg [ # Common zeal-qt6 # Offline documentation + # Network + wireshark-qt + + # Ansible + ] ++ lib.optionals config.frogeye.dev.ansible [ + ansible + ansible-lint + + # C/C++ + ] ++ lib.optionals config.frogeye.dev.c [ + cmake + clang + ccache + gdb + + # Docker + ] ++ lib.optionals config.frogeye.dev.docker [ + docker + docker-compose + # FPGA + ] ++ lib.optionals config.frogeye.dev.fpga [ + verilog + # ghdl # TODO Not on aarch64 + + # FPGA (graphical) + ] ++ lib.optionals (config.frogeye.desktop.xorg && config.frogeye.dev.fpga) [ yosys gtkwave - # Network - wireshark-qt + # Python + ] ++ lib.optionals config.frogeye.dev.python [ + python3Packages.ipython + ]; } diff --git a/config/nix/hm/extra.nix b/config/nix/hm/extra.nix index efd2b78..2a7fa0d 100644 --- a/config/nix/hm/extra.nix +++ b/config/nix/hm/extra.nix @@ -1,50 +1,57 @@ { pkgs, lib, config, ... }: { - home.packages = with pkgs; lib.mkIf config.frogeye.extra ([ - # android tools - android-tools + config = lib.mkIf config.frogeye.extra { + programs = { + pandoc.enable = true; + }; + home.packages = with pkgs; ([ + # android tools + android-tools - # downloading - yt-dlp - megatools - # transmission TODO Collision if both transmissions are active? + # downloading + yt-dlp + megatools + # transmission TODO Collision if both transmissions are active? + # Multimedia toolbox + ffmpeg - # documents - pandoc - texlive.combined.scheme-full - pdftk - hunspell - hunspellDicts.en_GB-ize - hunspellDicts.en_US - hunspellDicts.fr-moderne - hunspellDicts.nl_NL - # TODO libreoffice-extension-languagetool or libreoffice-extension-grammalecte-fr + # documents + visidata + texlive.combined.scheme-full + pdftk + hunspell + hunspellDicts.en_GB-ize + hunspellDicts.en_US + hunspellDicts.fr-moderne + hunspellDicts.nl_NL + # TODO libreoffice-extension-languagetool or libreoffice-extension-grammalecte-fr - ] ++ lib.optionals config.frogeye.desktop.xorg [ + ] ++ lib.optionals config.frogeye.desktop.xorg [ - # multimedia editors - gimp - inkscape - darktable - blender - puddletag - musescore - audacity + # multimedia editors + gimp + inkscape + darktable + blender + puddletag + musescore + audacity - # downloading - transmission-qt + # downloading + transmission-qt - # wine - wine - # TODO wine-gecko wine-mono lib32-libpulse (?) + # FIXME Below not on aarch64 + # wine + wine + # TODO wine-gecko wine-mono lib32-libpulse (?) - # gaming - steam - yuzu-mainline - minecraft - # TODO factorio - - ]); + # gaming + steam + yuzu-mainline + minecraft + # TODO factorio + ]); + }; } diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index 22a4c94..fee2740 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -167,7 +167,7 @@ in jsonls.enable = true; # JSON lua-ls.enable = true; # Lua (for Neovim debugging) # FIXME perlls - pylsp = { + pylsp = lib.mkIf config.frogeye.dev.python { # Python enable = true; settings.plugins = { @@ -288,10 +288,14 @@ in # Language-specific tcomment_vim # Language-aware (un)commenting + ] ++ lib.optionals config.frogeye.extra [ vim-LanguageTool # Check grammar for human languages + ] ++ lib.optionals config.programs.pandoc.enable [ vim-pandoc # Pandoc-specific stuff because there's no LSP for it vim-pandoc-syntax + ] ++ lib.optionals config.frogeye.dev.c [ nvim-dap # Debug Adapter Protocol client + ] ++ lib.optionals config.frogeye.dev.ansible [ ansible-vim # FIXME See if it doesn't require to do ./UltiSnips/generate.sh ]; extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [ @@ -323,10 +327,12 @@ in inoremap compe#scroll({ 'delta': +4 }) inoremap compe#scroll({ 'delta': -4 }) + '' + lib.optionalString config.frogeye.extra '' " languagetool let g:languagetool_cmd = "${pkgs.languagetool}/bin/languagetool-commandline" " TODO Doesn't work + '' + lib.optionalString config.programs.pandoc.enable '' " vim-pandox let g:pandoc#modules#disabled = ["folding"] let g:pandoc#spell#enabled = 0 diff --git a/config/nix/options.nix b/config/nix/options.nix index 5162440..baa7a76 100644 --- a/config/nix/options.nix +++ b/config/nix/options.nix @@ -6,5 +6,21 @@ xorg = lib.mkEnableOption "Enable X11 support"; nixGLIntel = lib.mkEnableOption "Enable nixGLIntel/nixVulkanIntel for windows manager"; }; + dev = { + ansible = lib.mkEnableOption "Ansible dev stuff"; + c = lib.mkEnableOption "C/C++ dev stuff"; + docker = lib.mkEnableOption "Docker dev stuff"; + fpga = lib.mkEnableOption "FPGA dev stuff"; + python = lib.mkEnableOption "Python dev stuff"; + }; + }; + + config = { + frogeye = { + dev = { + ansible = lib.mkDefault true; + python = lib.mkDefault true; + }; + }; }; } diff --git a/config/nix/pindakaas.nix b/config/nix/pindakaas.nix index 576b163..fd4f437 100644 --- a/config/nix/pindakaas.nix +++ b/config/nix/pindakaas.nix @@ -10,5 +10,8 @@ boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; networking.hostName = "pindakaas"; + + frogeye.extra = false; # FIXME Not working yet frogeye.desktop.xorg = true; + frogeye.dev.docker = true; } From 63b5e9c2523c2f3b63d99426949345d9fbc7a03f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 23 Nov 2023 13:20:44 +0100 Subject: [PATCH 063/108] nix: Fix wireless config --- config/nix/os/wireless.nix | 1 - config/nix/os/wireless/import.py | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/nix/os/wireless.nix b/config/nix/os/wireless.nix index 2c97fe9..a82666b 100644 --- a/config/nix/os/wireless.nix +++ b/config/nix/os/wireless.nix @@ -8,7 +8,6 @@ extraConfig = '' country=NL ''; - interfaces = ["eth0"]; }; environment.systemPackages = with pkgs; [ wirelesstools ]; services.chrony.serverOption = "offline"; diff --git a/config/nix/os/wireless/import.py b/config/nix/os/wireless/import.py index ea1ea40..85ac1d5 100755 --- a/config/nix/os/wireless/import.py +++ b/config/nix/os/wireless/import.py @@ -43,6 +43,9 @@ class Password: def val(self) -> str: return self.content + def exists(self) -> bool: + return not not self.content + def key(self) -> str: if SEPARATE_PASSWORDS: return f"@{self.var()}@" @@ -109,7 +112,7 @@ for path in list_networks(): # Helpers to prevent repetition suffixes = data.pop("suffixes", [""]) - data.setdefault("key_mgmt", ["WPA-PSK"] if password else ["NONE"]) + data.setdefault("key_mgmt", ["WPA-PSK"] if password.exists() else ["NONE"]) if password: if any(map(lambda m: "PSK" in m.split("-"), data["key_mgmt"])): data["psk"] = password @@ -140,7 +143,7 @@ for path in list_networks(): if key_mgmt: network["authProtocols"] = key_mgmt if psk: - network["pskRaw"] = psk.key() + network["psk"] = psk.key() if data: raise NotImplementedError(f"{path}: Unhandled non-auth extra: {data}") else: From 42954e7214625ae9d31d8206cddf03db0e011687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 23 Nov 2023 13:21:29 +0100 Subject: [PATCH 064/108] nix: Move unfree allowing into os config Might need the same for HM config? --- config/nix/build-pindakaas-image.sh | 1 - config/nix/build-vm.sh | 1 - config/nix/os/common.nix | 2 ++ 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/nix/build-pindakaas-image.sh b/config/nix/build-pindakaas-image.sh index da22a96..e48ebd1 100755 --- a/config/nix/build-pindakaas-image.sh +++ b/config/nix/build-pindakaas-image.sh @@ -7,7 +7,6 @@ then exec nix-shell -p nix-output-monitor --run $0 fi -export NIXPKGS_ALLOW_UNFREE=1 extra="" if [ "$(uname -m)" != "aarch64" ] then diff --git a/config/nix/build-vm.sh b/config/nix/build-vm.sh index a9d06ef..4cb07b0 100755 --- a/config/nix/build-vm.sh +++ b/config/nix/build-vm.sh @@ -10,7 +10,6 @@ then exec nix-shell -p nix-output-monitor --run $0 fi -export NIXPKGS_ALLOW_UNFREE=1 if [ "$(uname -m)" == "x86_64" ] then config=./curacao.nix diff --git a/config/nix/os/common.nix b/config/nix/os/common.nix index eedc29d..6bdf5be 100644 --- a/config/nix/os/common.nix +++ b/config/nix/os/common.nix @@ -30,6 +30,8 @@ android-udev-rules ]; + nixpkgs.config.allowUnfree = true; + programs = { # Enable compilation cache ccache.enable = true; From 55f2304223f40537bab8efde52c6f6789121a4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 23 Nov 2023 13:24:59 +0100 Subject: [PATCH 065/108] nix: Various fixes So that explains why quick-scope didn't work so far... but not why it built without it. --- config/nix/hm/common.nix | 2 +- config/nix/hm/vim.nix | 3 +-- config/nix/os/common.nix | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index a355330..da49d73 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -381,7 +381,7 @@ in stateVersion = "23.05"; language = { base = "en_US.UTF-8"; - time = "en_DK.UTF-8"; + # time = "en_DK.UTF-8"; # FIXME Disabled because complaints during nixos-rebuild switch }; packages = with pkgs; [ # dotfiles dependencies diff --git a/config/nix/hm/vim.nix b/config/nix/hm/vim.nix index fee2740..bcad6fc 100644 --- a/config/nix/hm/vim.nix +++ b/config/nix/hm/vim.nix @@ -22,7 +22,7 @@ let owner = "unblevable"; repo = "quick-scope"; rev = "v${version}"; - sha256 = "iAPvIs/lhW+w5kFTZKaY97D/kfCGtqKrJVFvZ8cHu+c="; + sha256 = "TcA4jZIdnQd06V+JrXGiCMr0Yhm9gB6OMiTSdzMt/Qw="; }; meta.homepage = "https://github.com/unblevable/quick-scope"; }; @@ -255,7 +255,6 @@ in # f/F mode vim-shot-f # Highlight relevant characters for f/F/t/T modes quick-scope # Highlight relevant characters for f/F modes one per word but always - # FIXME Doesn't work here, :QuickScopeToggle doesn't even work # Registers registers-nvim # Show register content when pressing " diff --git a/config/nix/os/common.nix b/config/nix/os/common.nix index 6bdf5be..11d480e 100644 --- a/config/nix/os/common.nix +++ b/config/nix/os/common.nix @@ -28,6 +28,9 @@ # android tools android-udev-rules + + # Needed for all the fetchFromGit in this repo on nixos-rebuild + git ]; nixpkgs.config.allowUnfree = true; From 86f225ea679012a1c9dfad7eaa47535e921d21b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 23 Nov 2023 13:42:52 +0100 Subject: [PATCH 066/108] nix: Remove ability to build pindakaas SD image The idea to create an image burnable on a SD card that is already configured is a nice one, however I encountered many issues: - Used something that was designed to be an installer: - Cannot change from unencrypted ext4 partition (AFAICS) - Comes with installer tools (i.e. tools for various filesystems), which creates conflicts - Takes a lot of space and time to build, had to put /tmp on a non-tmpfs - Has to extend the filesystem manually afterwards - I think it rebuilt the full system on nixos-rebuilt anyways. Maybe because I used binfmt compilation? Could also be because installer has some overlays. Since I had nix on Manjaro already, I surely could have built the system directly on the SD card from there. Maybe that's what I will do to test the partitionning/boot scheme setup actually. --- config/nix/build-pindakaas-image.sh | 22 ---------------------- config/nix/pindakaas.nix | 2 -- 2 files changed, 24 deletions(-) delete mode 100755 config/nix/build-pindakaas-image.sh diff --git a/config/nix/build-pindakaas-image.sh b/config/nix/build-pindakaas-image.sh deleted file mode 100755 index e48ebd1..0000000 --- a/config/nix/build-pindakaas-image.sh +++ /dev/null @@ -1,22 +0,0 @@ -#/usr/bin/env sh - -# Build a disk image for testing on pindakaas via sd card - -if ! command -v nom-build -then - exec nix-shell -p nix-output-monitor --run $0 -fi - -extra="" -if [ "$(uname -m)" != "aarch64" ] -then - if [ ! -f /proc/sys/fs/binfmt_misc/qemu-aarch64 ] - then - echo "Use binfmt QEMU!" - echo "https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_binfmt_QEMU" - exit 1 - fi - extra="--argstr system aarch64-linux" -fi -nom-build '' -A config.system.build.sdImage \ - -I nixos-config=./pindakaas.nix $extra --show-trace diff --git a/config/nix/pindakaas.nix b/config/nix/pindakaas.nix index fd4f437..7fbef93 100644 --- a/config/nix/pindakaas.nix +++ b/config/nix/pindakaas.nix @@ -2,11 +2,9 @@ { imports = [ - ./os/loader.nix ]; # nixos-hardware use latest kernel by default. This obviously runs quickly out of sync with zfs packages. - # zfs packages are included despite me asking anything zfs, probably they're in the image for installation purposes? boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; networking.hostName = "pindakaas"; From 5c274bbfe941c5bd0f3da249c2fb8e2fd3fcd1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 23 Nov 2023 22:54:20 +0100 Subject: [PATCH 067/108] nix: Fix typos --- config/nix/curacao_test.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/nix/curacao_test.nix b/config/nix/curacao_test.nix index 10293e7..485bb16 100644 --- a/config/nix/curacao_test.nix +++ b/config/nix/curacao_test.nix @@ -10,9 +10,9 @@ frogeye.extra = true; frogeye.desktop.xorg = true; frogeye.desktop.nixGLIntel = true; - frogeye.dev.ansible.enable = true; - frogeye.dev.c.enable = true; - frogeye.dev.docker.enable = true; - frogeye.dev.fpga.enable = true; - frogeye.dev.python.enable = true; + frogeye.dev.ansible = true; + frogeye.dev.c = true; + frogeye.dev.docker = true; + frogeye.dev.fpga = true; + frogeye.dev.python = true; } From 1f61ceb395a1f313ab25c91d6252538037574f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 26 Nov 2023 21:04:58 +0100 Subject: [PATCH 068/108] nix: Migrate scripts They're a bit slower to start :(. Hopefully this is something that flakes will help with, otherwise I'll find another way. --- config/nix/hm/common.nix | 29 ++- config/nix/hm/desktop.nix | 1 - config/nix/options.nix | 9 +- config/nix/os/common.nix | 2 +- config/{ => nix}/scripts/.bsh/bashrc | 0 .../{ => nix}/scripts/.bsh/bashrc_unsortable | 0 config/{ => nix}/scripts/.bsh/inputrc | 0 config/{ => nix}/scripts/.bsh/vimrc | 0 config/{ => nix}/scripts/.gitignore | 0 config/{ => nix}/scripts/archive | 4 +- config/{ => nix}/scripts/bsh | 4 +- config/{ => nix}/scripts/cached_pass | 4 +- config/{ => nix}/scripts/camera_name_date | 4 +- config/{ => nix}/scripts/cleandev | 4 +- .../{ => nix}/scripts/compressPictureMovies | 4 +- config/{ => nix}/scripts/crepuscule | 2 + config/{ => nix}/scripts/docker-image-childs | 4 +- config/{ => nix}/scripts/docker-rm | 5 +- config/{ => nix}/scripts/dummy | 4 +- config/nix/scripts/emergency-clean | 19 ++ config/{ => nix}/scripts/gitCheckoutModes | 4 +- config/{ => nix}/scripts/gitghost | 4 +- config/{ => nix}/scripts/jour | 2 + config/{ => nix}/scripts/lestrte | 4 +- config/{ => nix}/scripts/letrtes | 4 +- config/{ => nix}/scripts/lip | 4 +- config/{ => nix}/scripts/lorem | 4 +- config/{ => nix}/scripts/mediaDuration | 4 +- config/{ => nix}/scripts/music_remove_dashes | 4 +- config/{ => nix}/scripts/nuit | 2 + config/{ => nix}/scripts/o | 4 +- config/{ => nix}/scripts/optimize | 15 +- config/{ => nix}/scripts/overpdf | 4 +- config/{ => nix}/scripts/pdfpages | 4 +- config/{ => nix}/scripts/pdfrename | 4 +- config/{ => nix}/scripts/picture_name_date | 4 +- config/{ => nix}/scripts/pushToTalk | 4 +- config/{ => nix}/scripts/raw_move_precomp | 4 +- config/{ => nix}/scripts/rep | 4 +- config/{ => nix}/scripts/replayGain | 6 +- config/{ => nix}/scripts/rmf | 4 +- config/{ => nix}/scripts/rssVideos | 5 +- config/{ => nix}/scripts/smtpdummy | 4 +- config/{ => nix}/scripts/spongebob | 4 +- config/{ => nix}/scripts/syncthingRestore | 4 +- config/{ => nix}/scripts/tagCreatorPhotos | 4 +- config/{ => nix}/scripts/ter | 4 +- config/{ => nix}/scripts/unziptree | 4 +- .../{ => nix}/scripts/updateCompressedMusic | 4 +- config/{ => nix}/scripts/videoQuota | 4 +- config/{ => nix}/scripts/wttr | 4 +- .../unprocessed/config/linuxColors.sh} | 0 .../config}/scripts/adb_backup_extract | 0 .../unprocessed/config}/scripts/arch-kexec | 0 .../unprocessed/config}/scripts/cudarun | 0 .../unprocessed/config}/scripts/dafont | 0 .../unprocessed/config}/scripts/debloc | 0 .../unprocessed/config}/scripts/diapo | 0 .../{ => nix/unprocessed/config}/scripts/hc | 0 .../{ => nix/unprocessed/config}/scripts/hl | 0 .../unprocessed/config}/scripts/html2pdf | 0 .../unprocessed/config}/scripts/install-wsl | 0 .../unprocessed/config}/scripts/logstasync | 0 .../unprocessed/config}/scripts/machines | 0 .../unprocessed/config}/scripts/md2html | 0 .../{ => nix/unprocessed/config}/scripts/mel | 0 .../unprocessed/config}/scripts/melConf | 0 .../unprocessed/config}/scripts/musiqueBof | 0 .../{ => nix/unprocessed/config}/scripts/nv | 0 .../config}/scripts/package-lock.json | 0 .../unprocessed/config}/scripts/package.json | 0 .../unprocessed/config}/scripts/proxy | 0 .../unprocessed/config}/scripts/remcrlf | 2 + .../unprocessed/config}/scripts/tunnel | 0 .../unprocessed/config}/scripts/tvshow | 0 .../unprocessed/config}/scripts/updatedate | 0 config/scripts/arch-rankmirrors | 21 -- config/scripts/automatrop | 10 - config/scripts/beep | 3 - config/scripts/dotfiles | 190 ------------------ config/scripts/emergency-clean | 13 -- config/scripts/heavyPackages | 10 - config/scripts/newestFile | 2 - config/scripts/noise | 3 - config/scripts/oldestFile | 2 - config/scripts/ovhcli | 62 ------ config/scripts/pw | 9 - config/scripts/requirements.txt | 7 - config/scripts/rms | 2 - config/scripts/sedrename | 47 ----- config/scripts/tracefiles | 2 - config/scripts/transfer | 20 -- config/scripts/vidcmp | 18 -- 93 files changed, 178 insertions(+), 478 deletions(-) rename config/{ => nix}/scripts/.bsh/bashrc (100%) rename config/{ => nix}/scripts/.bsh/bashrc_unsortable (100%) rename config/{ => nix}/scripts/.bsh/inputrc (100%) rename config/{ => nix}/scripts/.bsh/vimrc (100%) rename config/{ => nix}/scripts/.gitignore (100%) rename config/{ => nix}/scripts/archive (98%) rename config/{ => nix}/scripts/bsh (95%) rename config/{ => nix}/scripts/cached_pass (83%) rename config/{ => nix}/scripts/camera_name_date (96%) rename config/{ => nix}/scripts/cleandev (82%) rename config/{ => nix}/scripts/compressPictureMovies (98%) rename config/{ => nix}/scripts/crepuscule (97%) rename config/{ => nix}/scripts/docker-image-childs (69%) rename config/{ => nix}/scripts/docker-rm (57%) rename config/{ => nix}/scripts/dummy (76%) create mode 100755 config/nix/scripts/emergency-clean rename config/{ => nix}/scripts/gitCheckoutModes (70%) rename config/{ => nix}/scripts/gitghost (93%) rename config/{ => nix}/scripts/jour (97%) rename config/{ => nix}/scripts/lestrte (83%) rename config/{ => nix}/scripts/letrtes (84%) rename config/{ => nix}/scripts/lip (81%) rename config/{ => nix}/scripts/lorem (96%) rename config/{ => nix}/scripts/mediaDuration (91%) rename config/{ => nix}/scripts/music_remove_dashes (90%) rename config/{ => nix}/scripts/nuit (97%) rename config/{ => nix}/scripts/o (93%) rename config/{ => nix}/scripts/optimize (93%) rename config/{ => nix}/scripts/overpdf (95%) rename config/{ => nix}/scripts/pdfpages (63%) rename config/{ => nix}/scripts/pdfrename (92%) rename config/{ => nix}/scripts/picture_name_date (96%) rename config/{ => nix}/scripts/pushToTalk (94%) rename config/{ => nix}/scripts/raw_move_precomp (95%) rename config/{ => nix}/scripts/rep (82%) rename config/{ => nix}/scripts/replayGain (90%) rename config/{ => nix}/scripts/rmf (99%) rename config/{ => nix}/scripts/rssVideos (98%) rename config/{ => nix}/scripts/smtpdummy (98%) rename config/{ => nix}/scripts/spongebob (78%) rename config/{ => nix}/scripts/syncthingRestore (85%) rename config/{ => nix}/scripts/tagCreatorPhotos (79%) rename config/{ => nix}/scripts/ter (95%) rename config/{ => nix}/scripts/unziptree (96%) rename config/{ => nix}/scripts/updateCompressedMusic (97%) rename config/{ => nix}/scripts/videoQuota (93%) rename config/{ => nix}/scripts/wttr (68%) rename config/{scripts/linuxColors => nix/unprocessed/config/linuxColors.sh} (100%) mode change 100755 => 100644 rename config/{ => nix/unprocessed/config}/scripts/adb_backup_extract (100%) rename config/{ => nix/unprocessed/config}/scripts/arch-kexec (100%) rename config/{ => nix/unprocessed/config}/scripts/cudarun (100%) rename config/{ => nix/unprocessed/config}/scripts/dafont (100%) rename config/{ => nix/unprocessed/config}/scripts/debloc (100%) rename config/{ => nix/unprocessed/config}/scripts/diapo (100%) rename config/{ => nix/unprocessed/config}/scripts/hc (100%) rename config/{ => nix/unprocessed/config}/scripts/hl (100%) rename config/{ => nix/unprocessed/config}/scripts/html2pdf (100%) rename config/{ => nix/unprocessed/config}/scripts/install-wsl (100%) rename config/{ => nix/unprocessed/config}/scripts/logstasync (100%) rename config/{ => nix/unprocessed/config}/scripts/machines (100%) rename config/{ => nix/unprocessed/config}/scripts/md2html (100%) rename config/{ => nix/unprocessed/config}/scripts/mel (100%) rename config/{ => nix/unprocessed/config}/scripts/melConf (100%) rename config/{ => nix/unprocessed/config}/scripts/musiqueBof (100%) rename config/{ => nix/unprocessed/config}/scripts/nv (100%) rename config/{ => nix/unprocessed/config}/scripts/package-lock.json (100%) rename config/{ => nix/unprocessed/config}/scripts/package.json (100%) rename config/{ => nix/unprocessed/config}/scripts/proxy (100%) rename config/{ => nix/unprocessed/config}/scripts/remcrlf (77%) rename config/{ => nix/unprocessed/config}/scripts/tunnel (100%) rename config/{ => nix/unprocessed/config}/scripts/tvshow (100%) rename config/{ => nix/unprocessed/config}/scripts/updatedate (100%) delete mode 100755 config/scripts/arch-rankmirrors delete mode 100755 config/scripts/automatrop delete mode 100755 config/scripts/beep delete mode 100755 config/scripts/dotfiles delete mode 100755 config/scripts/emergency-clean delete mode 100755 config/scripts/heavyPackages delete mode 100755 config/scripts/newestFile delete mode 100755 config/scripts/noise delete mode 100755 config/scripts/oldestFile delete mode 100755 config/scripts/ovhcli delete mode 100755 config/scripts/pw delete mode 100644 config/scripts/requirements.txt delete mode 100755 config/scripts/rms delete mode 100755 config/scripts/sedrename delete mode 100755 config/scripts/tracefiles delete mode 100755 config/scripts/transfer delete mode 100755 config/scripts/vidcmp diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 34088c5..93ff9e0 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -16,7 +16,6 @@ let YARN_CACHE_FOLDER = "${config.xdg.cacheHome}/yarn"; # TODO Some of that stuff is not really relavant any more }; - dotfilesPath = "$HOME/.dotfiles"; # FIXME I think we want it in ~/.config/dotfiles, also, should be an option in { @@ -133,6 +132,18 @@ in diff = "diff --color=auto"; dmesg = "dmesg --ctime"; wget = "wget --hsts-file ${config.xdg.cacheHome}/wget-hsts"; + + # Imported from scripts + rms = ''${pkgs.findutils}/bin/find . -name "*.sync-conflict-*" -delete''; # Remove syncthing conflict files + pw = ''${pkgs.pwgen}/bin/pwgen 32 -y''; # Generate passwords. ln((26*2+10)**32)/ln(2) ≅ 190 bits of entropy + newestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | tail''; + oldestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | head''; + tracefiles = ''${pkgs.strace}/bin/strace -f -t -e trace=file''; + } // lib.optionalAttrs config.frogeye.desktop.xorg { + noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise''; + beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null''; + # FIXME ALSA lib dlmisc.c:337:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_pulse.so (/nix/store/9b06fxbvm07iy9f9dvi5vk2iy9pk8hyz-alsa-lib-1.2.8/lib/alsa-lib/libasound_module_pcm_pulse.so: cannot open shared object file: No such file or directory) + } // lib.attrsets.mergeAttrsList (map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) treatsHomeAsJunk); # TODO Maybe make nixpkg wrapper instead? So it also works from dmenu # Could also accept my fate... Home-manager doesn't necessarily make it easy to put things out of the home directory @@ -279,10 +290,10 @@ in ff = "only"; }; } // lib.optionalAttrs config.frogeye.desktop.xorg { - diff.tool = "meld"; - difftool.prompt = false; - "difftool \"meld\"".cmd = "${pkgs.meld}/bin/meld \"$LOCAL\" \"$REMOTE\""; - # This escapes quotes, which isn't the case in the original, hoping this isn't an issue. + diff.tool = "meld"; + difftool.prompt = false; + "difftool \"meld\"".cmd = "${pkgs.meld}/bin/meld \"$LOCAL\" \"$REMOTE\""; + # This escapes quotes, which isn't the case in the original, hoping this isn't an issue. }; # TODO Delta syntax highlighter... and other cool-looking options? }; @@ -399,6 +410,7 @@ in wget curl python3Packages.pip + rename # shell zsh-completions @@ -425,9 +437,6 @@ in ncdu jdupes duperemove - optipng - libjpeg - # FIXME reflac not available (but also a dumb shell script) # local monitoring htop @@ -490,9 +499,9 @@ in } // direnv; # TODO Session variables only get reloaded on login I think. sessionPath = [ - "$HOME/.local/bin" + "${config.home.homeDirectory}/.local/bin" "${config.home.sessionVariables.GOPATH}" - "${dotfilesPath}/config/scripts" + "${config.frogeye.dotfiles.path}/config/nix/scripts" ]; }; } diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index dd8aac1..0874ec7 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -605,7 +605,6 @@ twemoji-color-font gnome.gedit feh - zathura zbar zathura meld diff --git a/config/nix/options.nix b/config/nix/options.nix index baa7a76..e083890 100644 --- a/config/nix/options.nix +++ b/config/nix/options.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ lib, config, ... }: { options.frogeye = { extra = lib.mkEnableOption "Big software"; @@ -13,6 +13,13 @@ fpga = lib.mkEnableOption "FPGA dev stuff"; python = lib.mkEnableOption "Python dev stuff"; }; + dotfiles = { + path = lib.mkOption { + type = lib.types.str; + default = "${config.home.homeDirectory}/.dotfiles"; # FIXME I think we want it in ~/.config/dotfiles + # FIXME References to this use config/nix subfolder, which we might want to make root + }; + }; }; config = { diff --git a/config/nix/os/common.nix b/config/nix/os/common.nix index 11d480e..727eebd 100644 --- a/config/nix/os/common.nix +++ b/config/nix/os/common.nix @@ -54,7 +54,7 @@ chrony = { enable = true; servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3); - extraConfig = "rtcsync"; + extraConfig = "rtcsync"; # See 23.11 release notes }; # Prevent power button from shutting down the computer. diff --git a/config/scripts/.bsh/bashrc b/config/nix/scripts/.bsh/bashrc similarity index 100% rename from config/scripts/.bsh/bashrc rename to config/nix/scripts/.bsh/bashrc diff --git a/config/scripts/.bsh/bashrc_unsortable b/config/nix/scripts/.bsh/bashrc_unsortable similarity index 100% rename from config/scripts/.bsh/bashrc_unsortable rename to config/nix/scripts/.bsh/bashrc_unsortable diff --git a/config/scripts/.bsh/inputrc b/config/nix/scripts/.bsh/inputrc similarity index 100% rename from config/scripts/.bsh/inputrc rename to config/nix/scripts/.bsh/inputrc diff --git a/config/scripts/.bsh/vimrc b/config/nix/scripts/.bsh/vimrc similarity index 100% rename from config/scripts/.bsh/vimrc rename to config/nix/scripts/.bsh/vimrc diff --git a/config/scripts/.gitignore b/config/nix/scripts/.gitignore similarity index 100% rename from config/scripts/.gitignore rename to config/nix/scripts/.gitignore diff --git a/config/scripts/archive b/config/nix/scripts/archive similarity index 98% rename from config/scripts/archive rename to config/nix/scripts/archive index 8ac60ee..c53e962 100755 --- a/config/scripts/archive +++ b/config/nix/scripts/archive @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs import argparse import logging diff --git a/config/scripts/bsh b/config/nix/scripts/bsh similarity index 95% rename from config/scripts/bsh rename to config/nix/scripts/bsh index 45e21a7..9ad639b 100755 --- a/config/scripts/bsh +++ b/config/nix/scripts/bsh @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash openssh coreutils gawk gnused # TODO More integrated with current config diff --git a/config/scripts/cached_pass b/config/nix/scripts/cached_pass similarity index 83% rename from config/scripts/cached_pass rename to config/nix/scripts/cached_pass index 401b797..d52ecfd 100755 --- a/config/scripts/cached_pass +++ b/config/nix/scripts/cached_pass @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash +#! nix-shell -p bash pass libnotify # TODO Password changed? diff --git a/config/scripts/camera_name_date b/config/nix/scripts/camera_name_date similarity index 96% rename from config/scripts/camera_name_date rename to config/nix/scripts/camera_name_date index 0001baa..55bb9e2 100755 --- a/config/scripts/camera_name_date +++ b/config/nix/scripts/camera_name_date @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs """ Same as picture_name_date diff --git a/config/scripts/cleandev b/config/nix/scripts/cleandev similarity index 82% rename from config/scripts/cleandev rename to config/nix/scripts/cleandev index 1beff42..4f7886d 100755 --- a/config/scripts/cleandev +++ b/config/nix/scripts/cleandev @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash findutils git gnumake # Removes files that can be regenerated # from a dev environment diff --git a/config/scripts/compressPictureMovies b/config/nix/scripts/compressPictureMovies similarity index 98% rename from config/scripts/compressPictureMovies rename to config/nix/scripts/compressPictureMovies index 79701e9..16c4a4c 100755 --- a/config/scripts/compressPictureMovies +++ b/config/nix/scripts/compressPictureMovies @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.progressbar2 ffmpeg import datetime import hashlib diff --git a/config/scripts/crepuscule b/config/nix/scripts/crepuscule similarity index 97% rename from config/scripts/crepuscule rename to config/nix/scripts/crepuscule index abf456b..bedc04e 100755 --- a/config/scripts/crepuscule +++ b/config/nix/scripts/crepuscule @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# FIXME + if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] then echo 10000 | sudo tee /sys/class/backlight/intel_backlight/brightness diff --git a/config/scripts/docker-image-childs b/config/nix/scripts/docker-image-childs similarity index 69% rename from config/scripts/docker-image-childs rename to config/nix/scripts/docker-image-childs index cf72ad1..c463d29 100755 --- a/config/scripts/docker-image-childs +++ b/config/nix/scripts/docker-image-childs @@ -1,4 +1,6 @@ -#!/usr/bin/env sh +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash docker gnugrep coreutils # Find the dependent child image from an image diff --git a/config/scripts/docker-rm b/config/nix/scripts/docker-rm similarity index 57% rename from config/scripts/docker-rm rename to config/nix/scripts/docker-rm index aadc6fb..ffa1ea8 100755 --- a/config/scripts/docker-rm +++ b/config/nix/scripts/docker-rm @@ -1,4 +1,7 @@ -#!/usr/bin/env sh +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash docker + docker unpause $(docker ps -q) docker kill $(docker ps -q) docker container prune -f diff --git a/config/scripts/dummy b/config/nix/scripts/dummy similarity index 76% rename from config/scripts/dummy rename to config/nix/scripts/dummy index 1423b2a..c723378 100755 --- a/config/scripts/dummy +++ b/config/nix/scripts/dummy @@ -1,4 +1,6 @@ -#!/usr/bin/bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash tree coreutils # Remplace le contenu d'un dossier par un fichier texte # relatant son arborescense diff --git a/config/nix/scripts/emergency-clean b/config/nix/scripts/emergency-clean new file mode 100755 index 0000000..f8fb79d --- /dev/null +++ b/config/nix/scripts/emergency-clean @@ -0,0 +1,19 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash + +# Clears everything it can to save space + +rm -rf $HOME/.cache +if command -v pacman > /dev/null; then + sudo pacman -Scc +fi +if command -v apt-get > /dev/null; then + sudo apt-get clean +fi +if command -v nix-store > /dev/null; then + sudo journalctl --vacuum-size=100M +fi +if command -v journalctl > /dev/null; then + sudo journalctl --vacuum-size=100M +fi diff --git a/config/scripts/gitCheckoutModes b/config/nix/scripts/gitCheckoutModes similarity index 70% rename from config/scripts/gitCheckoutModes rename to config/nix/scripts/gitCheckoutModes index f4bdbb2..dfc1e72 100755 --- a/config/scripts/gitCheckoutModes +++ b/config/nix/scripts/gitCheckoutModes @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash git gnugrep coreutils findutils # From https://stackoverflow.com/a/2083563 diff --git a/config/scripts/gitghost b/config/nix/scripts/gitghost similarity index 93% rename from config/scripts/gitghost rename to config/nix/scripts/gitghost index dc24cf1..6a89c6e 100755 --- a/config/scripts/gitghost +++ b/config/nix/scripts/gitghost @@ -1,4 +1,6 @@ -#!/usr/bin/bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash coreutils git gnused # Replace git folders with a placeholder containing the remote and the commit diff --git a/config/scripts/jour b/config/nix/scripts/jour similarity index 97% rename from config/scripts/jour rename to config/nix/scripts/jour index 72e9cbf..eb086d5 100755 --- a/config/scripts/jour +++ b/config/nix/scripts/jour @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# FIXME + if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] then echo 40000 | sudo tee /sys/class/backlight/intel_backlight/brightness diff --git a/config/scripts/lestrte b/config/nix/scripts/lestrte similarity index 83% rename from config/scripts/lestrte rename to config/nix/scripts/lestrte index 65a16cb..8ade6c6 100755 --- a/config/scripts/lestrte +++ b/config/nix/scripts/lestrte @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import random import sys diff --git a/config/scripts/letrtes b/config/nix/scripts/letrtes similarity index 84% rename from config/scripts/letrtes rename to config/nix/scripts/letrtes index 2124fdc..5636e84 100755 --- a/config/scripts/letrtes +++ b/config/nix/scripts/letrtes @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import random import sys diff --git a/config/scripts/lip b/config/nix/scripts/lip similarity index 81% rename from config/scripts/lip rename to config/nix/scripts/lip index 66a0b1d..3663bd2 100755 --- a/config/scripts/lip +++ b/config/nix/scripts/lip @@ -1,4 +1,6 @@ -#!/usr/bin/env sh +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash jq curl findutils coreutils set -euo pipefail diff --git a/config/scripts/lorem b/config/nix/scripts/lorem similarity index 96% rename from config/scripts/lorem rename to config/nix/scripts/lorem index 77e3998..771c67b 100755 --- a/config/scripts/lorem +++ b/config/nix/scripts/lorem @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash # Generates Lorem Ipsum diff --git a/config/scripts/mediaDuration b/config/nix/scripts/mediaDuration similarity index 91% rename from config/scripts/mediaDuration rename to config/nix/scripts/mediaDuration index 6ae8d70..0c8f9ee 100755 --- a/config/scripts/mediaDuration +++ b/config/nix/scripts/mediaDuration @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs ffmpeg import logging import os diff --git a/config/scripts/music_remove_dashes b/config/nix/scripts/music_remove_dashes similarity index 90% rename from config/scripts/music_remove_dashes rename to config/nix/scripts/music_remove_dashes index 2693a5b..25101d2 100755 --- a/config/scripts/music_remove_dashes +++ b/config/nix/scripts/music_remove_dashes @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 """ Small script to convert music files in the form: diff --git a/config/scripts/nuit b/config/nix/scripts/nuit similarity index 97% rename from config/scripts/nuit rename to config/nix/scripts/nuit index 9666d97..5f409ec 100755 --- a/config/scripts/nuit +++ b/config/nix/scripts/nuit @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# FIXME + if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] then echo 1 | sudo tee /sys/class/backlight/intel_backlight/brightness diff --git a/config/scripts/o b/config/nix/scripts/o similarity index 93% rename from config/scripts/o rename to config/nix/scripts/o index f427b8a..94d5e78 100755 --- a/config/scripts/o +++ b/config/nix/scripts/o @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 +#! nix-shell -p python3 python3Packages.magic xdg-utils feh zathura # pylint: disable=C0103 """ diff --git a/config/scripts/optimize b/config/nix/scripts/optimize similarity index 93% rename from config/scripts/optimize rename to config/nix/scripts/optimize index 2113bd2..fbbfa36 100755 --- a/config/scripts/optimize +++ b/config/nix/scripts/optimize @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash coreutils imagemagick libjpeg optipng ffmpeg diffutils # Optimizes everything the script can find in a folder, @@ -11,6 +13,7 @@ # TODO Lots of dupplicated code there # TODO Maybe replace part with https://github.com/toy/image_optim? +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) dir=${1:-$PWD} total=$(mktemp) echo -n 0 > $total @@ -148,20 +151,18 @@ do done <<< "$(find "$dir/" -type f -iname "*.png")" -# FLAC (requires reflac) +# FLAC (requires ffmpeg) while read music do if [ -z "$music" ]; then continue; fi echo Processing $music - temp_dir=$(mktemp --directory) - temp="$temp_dir/to_optimize.flac" + temp=$(mktemp --suffix .flac) cp "$music" "$temp" - reflac --best "$temp_dir" + ffmpeg -8 -o "$temp" echo "→ Optimize done" replace "$temp" "$music" - rm -rf "$temp_dir" done <<< "$(find "$dir/" -type f -iname "*.flac")" @@ -186,6 +187,6 @@ done <<< "$(find "$dir/" -type f -iname "*.flac")" # - I might want to keep editor data and/or ids for some of them # So rather use scour explicitely when needed -cleandev +${SCRIPT_DIR}/cleandev showtotal diff --git a/config/scripts/overpdf b/config/nix/scripts/overpdf similarity index 95% rename from config/scripts/overpdf rename to config/nix/scripts/overpdf index 1fb9752..32cbcd6 100755 --- a/config/scripts/overpdf +++ b/config/nix/scripts/overpdf @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash pdftk inkscape gnused coreutils file # Utility to write over a PDF file pages diff --git a/config/scripts/pdfpages b/config/nix/scripts/pdfpages similarity index 63% rename from config/scripts/pdfpages rename to config/nix/scripts/pdfpages index 1b86e2d..969fcf5 100755 --- a/config/scripts/pdfpages +++ b/config/nix/scripts/pdfpages @@ -1,4 +1,6 @@ -#!/usr/bin/bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash pdftk gnugrep gawk # From https://stackoverflow.com/a/14736593 for FILE in "$@" diff --git a/config/scripts/pdfrename b/config/nix/scripts/pdfrename similarity index 92% rename from config/scripts/pdfrename rename to config/nix/scripts/pdfrename index 7cfdd9c..c48c112 100755 --- a/config/scripts/pdfrename +++ b/config/nix/scripts/pdfrename @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash pdftk coreutils # Change the title of a PDF file diff --git a/config/scripts/picture_name_date b/config/nix/scripts/picture_name_date similarity index 96% rename from config/scripts/picture_name_date rename to config/nix/scripts/picture_name_date index a327499..6235729 100755 --- a/config/scripts/picture_name_date +++ b/config/nix/scripts/picture_name_date @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.exifread import argparse import datetime diff --git a/config/scripts/pushToTalk b/config/nix/scripts/pushToTalk similarity index 94% rename from config/scripts/pushToTalk rename to config/nix/scripts/pushToTalk index b7add24..f987a08 100755 --- a/config/scripts/pushToTalk +++ b/config/nix/scripts/pushToTalk @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.pulsectl python3Packages.xlib import sys diff --git a/config/scripts/raw_move_precomp b/config/nix/scripts/raw_move_precomp similarity index 95% rename from config/scripts/raw_move_precomp rename to config/nix/scripts/raw_move_precomp index 9b62408..e00535a 100755 --- a/config/scripts/raw_move_precomp +++ b/config/nix/scripts/raw_move_precomp @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs """ Same as picture_name_date diff --git a/config/scripts/rep b/config/nix/scripts/rep similarity index 82% rename from config/scripts/rep rename to config/nix/scripts/rep index 789f25f..086d7dc 100755 --- a/config/scripts/rep +++ b/config/nix/scripts/rep @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash coreutils # Moves a file to another place and put a symbolic link in place diff --git a/config/scripts/replayGain b/config/nix/scripts/replayGain similarity index 90% rename from config/scripts/replayGain rename to config/nix/scripts/replayGain index 9f48e35..3d3e574 100755 --- a/config/scripts/replayGain +++ b/config/nix/scripts/replayGain @@ -1,4 +1,8 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.r128gain + +# TODO r128gain is not maintainted anymore # Normalisation is done at the default of each program, # which is usually -89.0 dB diff --git a/config/scripts/rmf b/config/nix/scripts/rmf similarity index 99% rename from config/scripts/rmf rename to config/nix/scripts/rmf index 53e3fbe..1bbc2b7 100755 --- a/config/scripts/rmf +++ b/config/nix/scripts/rmf @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.progressbar2 # Handles sync-conflict files diff --git a/config/scripts/rssVideos b/config/nix/scripts/rssVideos similarity index 98% rename from config/scripts/rssVideos rename to config/nix/scripts/rssVideos index 22f6539..9b1401c 100755 --- a/config/scripts/rssVideos +++ b/config/nix/scripts/rssVideos @@ -1,4 +1,7 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.configargparse python3Packages.filelock python3Packages.filelock python3Packages.requests python3Packages.yt-dlp ffmpeg +# Also needs mpv but if I put it there it's not using the configured one """ diff --git a/config/scripts/smtpdummy b/config/nix/scripts/smtpdummy similarity index 98% rename from config/scripts/smtpdummy rename to config/nix/scripts/smtpdummy index 67be437..df3776a 100755 --- a/config/scripts/smtpdummy +++ b/config/nix/scripts/smtpdummy @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 +#! nix-shell -p python3 python3Packages.colorama python3Packages.configargparse import base64 import datetime diff --git a/config/scripts/spongebob b/config/nix/scripts/spongebob similarity index 78% rename from config/scripts/spongebob rename to config/nix/scripts/spongebob index 6bdfdf0..980616a 100755 --- a/config/scripts/spongebob +++ b/config/nix/scripts/spongebob @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import random import sys diff --git a/config/scripts/syncthingRestore b/config/nix/scripts/syncthingRestore similarity index 85% rename from config/scripts/syncthingRestore rename to config/nix/scripts/syncthingRestore index f6b41f7..0accfb6 100755 --- a/config/scripts/syncthingRestore +++ b/config/nix/scripts/syncthingRestore @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import os import shutil diff --git a/config/scripts/tagCreatorPhotos b/config/nix/scripts/tagCreatorPhotos similarity index 79% rename from config/scripts/tagCreatorPhotos rename to config/nix/scripts/tagCreatorPhotos index 7bec346..d5146c1 100755 --- a/config/scripts/tagCreatorPhotos +++ b/config/nix/scripts/tagCreatorPhotos @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.piexif import os import sys diff --git a/config/scripts/ter b/config/nix/scripts/ter similarity index 95% rename from config/scripts/ter rename to config/nix/scripts/ter index ec432a5..01fbc3b 100755 --- a/config/scripts/ter +++ b/config/nix/scripts/ter @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 import sys from math import inf diff --git a/config/scripts/unziptree b/config/nix/scripts/unziptree similarity index 96% rename from config/scripts/unziptree rename to config/nix/scripts/unziptree index 83eb81b..0b6720c 100755 --- a/config/scripts/unziptree +++ b/config/nix/scripts/unziptree @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.magic unzip p7zip unrar gnutar gzip import logging import os diff --git a/config/scripts/updateCompressedMusic b/config/nix/scripts/updateCompressedMusic similarity index 97% rename from config/scripts/updateCompressedMusic rename to config/nix/scripts/updateCompressedMusic index 49c9a8a..11a48d3 100755 --- a/config/scripts/updateCompressedMusic +++ b/config/nix/scripts/updateCompressedMusic @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 python3Packages.coloredlogs python3Packages.progresbar2 ffmpeg # pylint: disable=C0103 import logging diff --git a/config/scripts/videoQuota b/config/nix/scripts/videoQuota similarity index 93% rename from config/scripts/videoQuota rename to config/nix/scripts/videoQuota index b139836..10cea98 100755 --- a/config/scripts/videoQuota +++ b/config/nix/scripts/videoQuota @@ -1,4 +1,6 @@ -#!/usr/bin/env python3 +#!/usr/bin/env nix-shell +#! nix-shell -i python3 --pure +#! nix-shell -p python3 ffmpeg # Compress a video to make it fit under a certain size. # Usage: videoQuota SIZE SRC DST diff --git a/config/scripts/wttr b/config/nix/scripts/wttr similarity index 68% rename from config/scripts/wttr rename to config/nix/scripts/wttr index f1b368c..9b327c9 100755 --- a/config/scripts/wttr +++ b/config/nix/scripts/wttr @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash --pure +#! nix-shell -p bash curl ncurses # change Paris to your default location request="v2.wttr.in/${1-Amsterdam}" diff --git a/config/scripts/linuxColors b/config/nix/unprocessed/config/linuxColors.sh old mode 100755 new mode 100644 similarity index 100% rename from config/scripts/linuxColors rename to config/nix/unprocessed/config/linuxColors.sh diff --git a/config/scripts/adb_backup_extract b/config/nix/unprocessed/config/scripts/adb_backup_extract similarity index 100% rename from config/scripts/adb_backup_extract rename to config/nix/unprocessed/config/scripts/adb_backup_extract diff --git a/config/scripts/arch-kexec b/config/nix/unprocessed/config/scripts/arch-kexec similarity index 100% rename from config/scripts/arch-kexec rename to config/nix/unprocessed/config/scripts/arch-kexec diff --git a/config/scripts/cudarun b/config/nix/unprocessed/config/scripts/cudarun similarity index 100% rename from config/scripts/cudarun rename to config/nix/unprocessed/config/scripts/cudarun diff --git a/config/scripts/dafont b/config/nix/unprocessed/config/scripts/dafont similarity index 100% rename from config/scripts/dafont rename to config/nix/unprocessed/config/scripts/dafont diff --git a/config/scripts/debloc b/config/nix/unprocessed/config/scripts/debloc similarity index 100% rename from config/scripts/debloc rename to config/nix/unprocessed/config/scripts/debloc diff --git a/config/scripts/diapo b/config/nix/unprocessed/config/scripts/diapo similarity index 100% rename from config/scripts/diapo rename to config/nix/unprocessed/config/scripts/diapo diff --git a/config/scripts/hc b/config/nix/unprocessed/config/scripts/hc similarity index 100% rename from config/scripts/hc rename to config/nix/unprocessed/config/scripts/hc diff --git a/config/scripts/hl b/config/nix/unprocessed/config/scripts/hl similarity index 100% rename from config/scripts/hl rename to config/nix/unprocessed/config/scripts/hl diff --git a/config/scripts/html2pdf b/config/nix/unprocessed/config/scripts/html2pdf similarity index 100% rename from config/scripts/html2pdf rename to config/nix/unprocessed/config/scripts/html2pdf diff --git a/config/scripts/install-wsl b/config/nix/unprocessed/config/scripts/install-wsl similarity index 100% rename from config/scripts/install-wsl rename to config/nix/unprocessed/config/scripts/install-wsl diff --git a/config/scripts/logstasync b/config/nix/unprocessed/config/scripts/logstasync similarity index 100% rename from config/scripts/logstasync rename to config/nix/unprocessed/config/scripts/logstasync diff --git a/config/scripts/machines b/config/nix/unprocessed/config/scripts/machines similarity index 100% rename from config/scripts/machines rename to config/nix/unprocessed/config/scripts/machines diff --git a/config/scripts/md2html b/config/nix/unprocessed/config/scripts/md2html similarity index 100% rename from config/scripts/md2html rename to config/nix/unprocessed/config/scripts/md2html diff --git a/config/scripts/mel b/config/nix/unprocessed/config/scripts/mel similarity index 100% rename from config/scripts/mel rename to config/nix/unprocessed/config/scripts/mel diff --git a/config/scripts/melConf b/config/nix/unprocessed/config/scripts/melConf similarity index 100% rename from config/scripts/melConf rename to config/nix/unprocessed/config/scripts/melConf diff --git a/config/scripts/musiqueBof b/config/nix/unprocessed/config/scripts/musiqueBof similarity index 100% rename from config/scripts/musiqueBof rename to config/nix/unprocessed/config/scripts/musiqueBof diff --git a/config/scripts/nv b/config/nix/unprocessed/config/scripts/nv similarity index 100% rename from config/scripts/nv rename to config/nix/unprocessed/config/scripts/nv diff --git a/config/scripts/package-lock.json b/config/nix/unprocessed/config/scripts/package-lock.json similarity index 100% rename from config/scripts/package-lock.json rename to config/nix/unprocessed/config/scripts/package-lock.json diff --git a/config/scripts/package.json b/config/nix/unprocessed/config/scripts/package.json similarity index 100% rename from config/scripts/package.json rename to config/nix/unprocessed/config/scripts/package.json diff --git a/config/scripts/proxy b/config/nix/unprocessed/config/scripts/proxy similarity index 100% rename from config/scripts/proxy rename to config/nix/unprocessed/config/scripts/proxy diff --git a/config/scripts/remcrlf b/config/nix/unprocessed/config/scripts/remcrlf similarity index 77% rename from config/scripts/remcrlf rename to config/nix/unprocessed/config/scripts/remcrlf index 09e5882..8364e2a 100755 --- a/config/scripts/remcrlf +++ b/config/nix/unprocessed/config/scripts/remcrlf @@ -1,4 +1,6 @@ #!/usr/bin/env bash +#! nix-shell -i bash --pure +#! nix-shell -p bash # Removes CRLF (^M or \r) from a file diff --git a/config/scripts/tunnel b/config/nix/unprocessed/config/scripts/tunnel similarity index 100% rename from config/scripts/tunnel rename to config/nix/unprocessed/config/scripts/tunnel diff --git a/config/scripts/tvshow b/config/nix/unprocessed/config/scripts/tvshow similarity index 100% rename from config/scripts/tvshow rename to config/nix/unprocessed/config/scripts/tvshow diff --git a/config/scripts/updatedate b/config/nix/unprocessed/config/scripts/updatedate similarity index 100% rename from config/scripts/updatedate rename to config/nix/unprocessed/config/scripts/updatedate diff --git a/config/scripts/arch-rankmirrors b/config/scripts/arch-rankmirrors deleted file mode 100755 index 939eb56..0000000 --- a/config/scripts/arch-rankmirrors +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [ $USER != root ] -then - echo "This script should be run as root." - exit 1 -fi - -if ! pacman -Qq pacman-mirrorlist &> /dev/null -then - pacman -S pacman-mirrorlist -fi - -if [ ! -f /etc/pacman.d/mirrorlist.pacnew ] -then - cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.pacnew -fi - -egrep -o 'Server = .+' /etc/pacman.d/mirrorlist.pacnew | /usr/bin/rankmirrors -n 6 - > /etc/pacman.d/mirrorlist diff --git a/config/scripts/automatrop b/config/scripts/automatrop deleted file mode 100755 index d463b74..0000000 --- a/config/scripts/automatrop +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -cd ~/.dotfiles/config/automatrop -if [ -f ~/.config/automatrop/self_name ] -then - hostname=$(cat ~/.config/automatrop/self_name) -else - hostname="$HOSTNAME" -fi -ansible-playbook --diff playbooks/default.yml --limit $hostname --connection local "$@" diff --git a/config/scripts/beep b/config/scripts/beep deleted file mode 100755 index 5cd87e2..0000000 --- a/config/scripts/beep +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh -play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null -# echo  diff --git a/config/scripts/dotfiles b/config/scripts/dotfiles deleted file mode 100755 index 4d6cddf..0000000 --- a/config/scripts/dotfiles +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/env bash - -# Handles dotfiles -# Yes there are tons of similar scipts yet I wanted no more nor less than what I needed - -# Config - -if [ -z "$DOTHOME" ]; then - DOTHOME="$HOME" -fi -if [ -z "$DOTREPO" ]; then - DOTREPO="$HOME/.dotfiles" -fi - -# Common functions - -# From http://stackoverflow.com/a/12498485 -function relativePath { - # both $1 and $2 are absolute paths beginning with / - # returns relative path to $2/$target from $1/$source - source=$1 - target=$2 - - common_part=$source # for now - result="" # for now - - while [[ "${target#$common_part}" == "${target}" ]]; do - # no match, means that candidate common part is not correct - # go up one level (reduce common part) - common_part="$(dirname $common_part)" - # and record that we went back, with correct / handling - if [[ -z $result ]]; then - result=".." - else - result="../$result" - fi - done - - if [[ $common_part == "/" ]]; then - # special case for root (no common path) - result="$result/" - fi - - # since we now have identified the common part, - # compute the non-common part - forward_part="${target#$common_part}" - - - # and now stick all parts together - if [[ -n $result ]] && [[ -n $forward_part ]]; then - result="$result$forward_part" - elif [[ -n $forward_part ]]; then - # extra slash removal - # result="${forward_part:1}" # Removes the . in the beginning... - result="${forward_part#/}" - fi - - echo "$result" -} - - -# Script common functions - -function _dotfiles-install-dir { # dir - local dir - local absSource - local absTarget - local relTarget - - dir="${1%/}" - dir="${dir#/}" - - ls -A "$DOTREPO/$dir" | while read file; do - if [[ -z "$dir" && $(echo $file | grep '^\(\.\|LICENSE\|README\)') ]]; then - continue - fi - if [[ $(echo $file | grep '^.dfrecur$') ]]; then - continue - fi - - if [ -z "$dir" ]; then - absSource="$DOTHOME/.$file" - absTarget="$DOTREPO/$file" - else - absSource="$DOTHOME/.$dir/$file" - absTarget="$DOTREPO/$dir/$file" - fi - relTarget="$(relativePath "$DOTHOME/$dir" "$absTarget")" - recurIndicator="$absTarget/.dfrecur" - - if [[ -h "$absTarget" ]]; then - if [ -e "$absSource" ]; then - if [ -h "$absSource" ]; then - cmd="cp --no-dereference --force $absTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - yes | $cmd - fi - else - echo "[ERROR] $absSource already exists, but is not a link" - fi - else - cmd="cp --no-dereference --force $absTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - yes | $cmd - fi - fi - elif [[ -f "$absTarget" || ( -d $absTarget && ! -f $recurIndicator ) ]]; then - if [ -e "$absSource" ]; then - if [ -h "$absSource" ]; then - cmd="ln --symbolic --no-dereference --force $relTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - $cmd - fi - else - echo "[ERROR] $absSource already exists, but is not a symbolic link" - fi - else - cmd="ln --symbolic --no-dereference $relTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - $cmd - fi - fi - elif [[ -d "$absTarget" && -f $recurIndicator ]]; then - if [ -e "$absSource" ]; then - if [ -d "$absSource" ]; then - # echo "Directory $absSource already exists" - _dotfiles-install-dir $dir/$file - else - echo "[ERROR] $absSource already exists, but is not a directory" - fi - else - cmd="mkdir $absSource" - if [ $DRY_RUN ]; then - echo $cmd - else - $cmd - fi - _dotfiles-install-dir $dir/$file - fi - else - echo "[WARNING] Skipped $absTarget" - fi - done - -} - -# Script functions - -function dotfiles_install { - _dotfiles-install-dir / -} - -function dotfiles_help { - command="$1" - if [ -n "$command" ]; then - if type "dotfiles_${command}_help" &> /dev/null; then - shift - "dotfiles_${command}_help" "$@" - return $? - fi - fi - echo "Usage: $0 COMMAND" - echo - echo "Commands:" - echo " install Install dotfiles from repository" - echo " help Get help with commands" - echo - echo "Environment variables:" - echo " DOTHOME Where to install dotfiles" - echo " DOTREPO Where do the dotfiles comes from" - return 0 -} - -# MAIN -command="$1" -shift -if type "dotfiles_$command" &> /dev/null; then - "dotfiles_$command" "$@" -else - dotfiles_help -fi - diff --git a/config/scripts/emergency-clean b/config/scripts/emergency-clean deleted file mode 100755 index be88836..0000000 --- a/config/scripts/emergency-clean +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# Clears everything it can to save space - -rm -rf $HOME/.cache -if which pacman &> /dev/null; then - sudo pacman -Scc -elif which apt-get &> /deb/null; then - sudo apt-get clean -fi -if which journalctl &> /dev/null; then - sudo journalctl --vacuum-size=100M -fi diff --git a/config/scripts/heavyPackages b/config/scripts/heavyPackages deleted file mode 100755 index 8235b61..0000000 --- a/config/scripts/heavyPackages +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Return a list of packages sorted by size - -(echo PACKAGE SIZE; \ - for A in /var/lib/pacman/local/*/desc; do - (sed -n 2p $A; (grep '^%SIZE%$' $A -A1 | tail -1)) | tr '\n' ' '; echo - done \ - | sort -nrk2) \ -| column -t diff --git a/config/scripts/newestFile b/config/scripts/newestFile deleted file mode 100755 index 508a762..0000000 --- a/config/scripts/newestFile +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -find -type f -printf '%T+ %p\n' | sort | tail "$@" diff --git a/config/scripts/noise b/config/scripts/noise deleted file mode 100755 index eeb8ac8..0000000 --- a/config/scripts/noise +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -play -c 2 -n synth ${1}noise diff --git a/config/scripts/oldestFile b/config/scripts/oldestFile deleted file mode 100755 index 4f90f83..0000000 --- a/config/scripts/oldestFile +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -find -type f -printf '%T+ %p\n' | sort | head "$@" diff --git a/config/scripts/ovhcli b/config/scripts/ovhcli deleted file mode 100755 index 880dc62..0000000 --- a/config/scripts/ovhcli +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import json -import logging -import os -import urllib.request -from pprint import pprint - -import coloredlogs -import ovh -import xdg.BaseDirectory - -coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s") -log = logging.getLogger() - -debug = None - - -class OvhCli: - ROOT = "https://api.ovh.com/1.0?null" - - def __init__(self): - self.cacheDir = os.path.join(xdg.BaseDirectory.xdg_cache_home, "ovhcli") - # TODO Corner cases: links, cache dir not done, configurable cache - if not os.path.isdir(self.cacheDir): - assert not os.path.exists(self.cacheDir) - os.makedirs(self.cacheDir) - - def updateCache(self): - log.info("Downloading the API description") - rootJsonPath = os.path.join(self.cacheDir, "root.json") - log.debug(f"{self.ROOT} -> {rootJsonPath}") - urllib.request.urlretrieve(self.ROOT, rootJsonPath) - with open(rootJsonPath, "rt") as rootJson: - root = json.load(rootJson) - basePath = root["basePath"] - - for apiRoot in root["apis"]: - fmt = "json" - assert fmt in apiRoot["format"] - path = apiRoot["path"] - schema = apiRoot["schema"].format(format=fmt, path=path) - apiJsonPath = os.path.join(self.cacheDir, schema[1:]) - apiJsonUrl = basePath + schema - log.debug(f"{apiJsonUrl} -> {apiJsonPath}") - apiJsonPathDir = os.path.dirname(apiJsonPath) - if not os.path.isdir(apiJsonPathDir): - os.makedirs(apiJsonPathDir) - urllib.request.urlretrieve(apiJsonUrl, apiJsonPath) - - def createParser(self): - parser = argparse.ArgumentParser(description="Access the OVH API") - return parser - - -if __name__ == "__main__": - cli = OvhCli() - # cli.updateCache() - parser = cli.createParser() - args = parser.parse_args() - print(args) diff --git a/config/scripts/pw b/config/scripts/pw deleted file mode 100755 index e1dd8c4..0000000 --- a/config/scripts/pw +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# Generate strong enough password(s) - -# This generates a password with ln((26*2+10)**32)/ln(2) ≅ 190 bits of entropy, -# which is a bit above the recommended standars (128 bits) while still having -# a 0 probability that the service will break because of incompatible character - -pwgen 32 -y diff --git a/config/scripts/requirements.txt b/config/scripts/requirements.txt deleted file mode 100644 index f806981..0000000 --- a/config/scripts/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -coloredlogs>=10.0<11 -progressbar2>=3.47.0<4 -yt-dlp>=2021.10.22 -ConfigArgParse>=1.5<2 -asyncinotify -ffmpeg -r128gain diff --git a/config/scripts/rms b/config/scripts/rms deleted file mode 100755 index 885b287..0000000 --- a/config/scripts/rms +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -find . -name "*.sync-conflict-*" -delete diff --git a/config/scripts/sedrename b/config/scripts/sedrename deleted file mode 100755 index 42a6f23..0000000 --- a/config/scripts/sedrename +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -# Rename a list of files with a sed pattern - -usage() { - echo "Usage: $0 PATTERN [-d] < filelist" - echo - echo "Arguments:" - echo " PATTERN Sed pattern to apply" - echo - echo "Options:" - echo " -d Dry run" - exit 1 -} - -if [[ -z "$1" ]]; then - usage -fi - -pattern="$1" - -dry=1 -if [[ -n "$2" ]]; then - if [[ "$2" = '-d' ]]; then - dry=0 - else - usage - fi -fi - -while read src -do - dst="$(echo "$src" | sed "$pattern")" - if [[ $? != 0 ]]; then - echo "ERREUR Invalid sed pattern" - exit 2 - fi - if [[ $dry == 0 ]]; then - echo "$src" → "$dst" - else - mv -- "$src" "$dst" - fi - -done - - - diff --git a/config/scripts/tracefiles b/config/scripts/tracefiles deleted file mode 100755 index 662f59e..0000000 --- a/config/scripts/tracefiles +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -strace -f -t -e trace=file $@ diff --git a/config/scripts/transfer b/config/scripts/transfer deleted file mode 100755 index a937228..0000000 --- a/config/scripts/transfer +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env sh - -if [ $# -eq 0 ] -then - echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" - return 1 -fi - -tmpfile=$( mktemp -t transferXXX ) - -if tty -s -then - basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g') - curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile -else - curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile -fi - -cat $tmpfile -rm -f $tmpfile diff --git a/config/scripts/vidcmp b/config/scripts/vidcmp deleted file mode 100755 index 7a284b9..0000000 --- a/config/scripts/vidcmp +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python3 - -# Compresses video using FFMPEG using -# FFMPEG's reasonable default settings - -import os -import subprocess -import sys - -files = sys.argv[1:] - -remove = False -if "-r" in files: - files.remove("-r") - remove = True - -for f in files: - print(os.path.splitext(f)) From 24dd21368f5b55746fbd393ce590186b20eb7d41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 26 Nov 2023 22:45:07 +0100 Subject: [PATCH 069/108] nix: Integrate root-level files --- config/nix/hm/common.nix | 7 + config/nix/hm/desktop.nix | 12 ++ config/nix/hm/face.svg | 192 ++++++++++++++++++ .../nix/unprocessed/Zeal}/Zeal.conf | 0 .../nix/unprocessed/termux}/.gitignore | 0 .../nix/unprocessed/termux}/bin/.gitignore | 0 .../nix/unprocessed/termux}/boot/autosvc | 0 .../nix/unprocessed/termux}/boot/symlink | 0 .../nix/unprocessed/termux}/font.ttf | Bin .../nix/unprocessed/termux}/scripts/autosvc | 0 .../nix/unprocessed/termux}/scripts/service | 0 .../nix/unprocessed/termux}/scripts/sudo | 0 .../nix/unprocessed/termux}/scripts/tsu.old | 0 .../nix/unprocessed/termux}/scripts/yt | 0 .../nix/unprocessed/termux}/services/autosvc | 0 .../nix/unprocessed/termux}/services/crond | 0 .../nix/unprocessed/termux}/services/sshd | 0 .../unprocessed/termux}/services/syncthing | 0 .../termux}/services/syncthing.user | 0 .../nix/unprocessed/termux}/shell | 0 xsession => config/nix/unprocessed/xsession | 0 face | Bin 87261 -> 0 bytes vimpcrc | 8 - 23 files changed, 211 insertions(+), 8 deletions(-) create mode 100644 config/nix/hm/face.svg rename {Zeal => config/nix/unprocessed/Zeal}/Zeal.conf (100%) rename {termux => config/nix/unprocessed/termux}/.gitignore (100%) rename {termux => config/nix/unprocessed/termux}/bin/.gitignore (100%) rename {termux => config/nix/unprocessed/termux}/boot/autosvc (100%) rename {termux => config/nix/unprocessed/termux}/boot/symlink (100%) rename {termux => config/nix/unprocessed/termux}/font.ttf (100%) rename {termux => config/nix/unprocessed/termux}/scripts/autosvc (100%) rename {termux => config/nix/unprocessed/termux}/scripts/service (100%) rename {termux => config/nix/unprocessed/termux}/scripts/sudo (100%) rename {termux => config/nix/unprocessed/termux}/scripts/tsu.old (100%) rename {termux => config/nix/unprocessed/termux}/scripts/yt (100%) rename {termux => config/nix/unprocessed/termux}/services/autosvc (100%) rename {termux => config/nix/unprocessed/termux}/services/crond (100%) rename {termux => config/nix/unprocessed/termux}/services/sshd (100%) rename {termux => config/nix/unprocessed/termux}/services/syncthing (100%) rename {termux => config/nix/unprocessed/termux}/services/syncthing.user (100%) rename {termux => config/nix/unprocessed/termux}/shell (100%) rename xsession => config/nix/unprocessed/xsession (100%) delete mode 100644 face delete mode 100644 vimpcrc diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 93ff9e0..75ca5b2 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -470,6 +470,8 @@ in todoman syncthing + # TODO Lots of redundancy with other way things are defined here + ]; sessionVariables = { # Favourite commands @@ -503,5 +505,10 @@ in "${config.home.sessionVariables.GOPATH}" "${config.frogeye.dotfiles.path}/config/nix/scripts" ]; + file = { + ".face" = { + source = pkgs.runCommand "face.png" { } "${pkgs.inkscape}/bin/inkscape ${./face.svg} -w 1024 -o $out"; + }; + }; }; } diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 0874ec7..944b5f2 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -524,6 +524,18 @@ action = clipboard ''; }; + "vimpc/vimpcrc" = { + text = '' + map FF :browsegg/ + map à :set add nexta:set add end + map @ :set add nexta:set add end:next + map ° D:browseA:shuffle:play:playlist + set songformat {%a - %b: %t}|{%f}$E$R $H[$H%l$H]$H + set libraryformat %n \| {%t}|{%f}$E$R $H[$H%l$H]$H + set ignorecase + set sort library + ''; + }; }; }; services = { diff --git a/config/nix/hm/face.svg b/config/nix/hm/face.svg new file mode 100644 index 0000000..28e7708 --- /dev/null +++ b/config/nix/hm/face.svg @@ -0,0 +1,192 @@ + + + +image/svg+xml diff --git a/Zeal/Zeal.conf b/config/nix/unprocessed/Zeal/Zeal.conf similarity index 100% rename from Zeal/Zeal.conf rename to config/nix/unprocessed/Zeal/Zeal.conf diff --git a/termux/.gitignore b/config/nix/unprocessed/termux/.gitignore similarity index 100% rename from termux/.gitignore rename to config/nix/unprocessed/termux/.gitignore diff --git a/termux/bin/.gitignore b/config/nix/unprocessed/termux/bin/.gitignore similarity index 100% rename from termux/bin/.gitignore rename to config/nix/unprocessed/termux/bin/.gitignore diff --git a/termux/boot/autosvc b/config/nix/unprocessed/termux/boot/autosvc similarity index 100% rename from termux/boot/autosvc rename to config/nix/unprocessed/termux/boot/autosvc diff --git a/termux/boot/symlink b/config/nix/unprocessed/termux/boot/symlink similarity index 100% rename from termux/boot/symlink rename to config/nix/unprocessed/termux/boot/symlink diff --git a/termux/font.ttf b/config/nix/unprocessed/termux/font.ttf similarity index 100% rename from termux/font.ttf rename to config/nix/unprocessed/termux/font.ttf diff --git a/termux/scripts/autosvc b/config/nix/unprocessed/termux/scripts/autosvc similarity index 100% rename from termux/scripts/autosvc rename to config/nix/unprocessed/termux/scripts/autosvc diff --git a/termux/scripts/service b/config/nix/unprocessed/termux/scripts/service similarity index 100% rename from termux/scripts/service rename to config/nix/unprocessed/termux/scripts/service diff --git a/termux/scripts/sudo b/config/nix/unprocessed/termux/scripts/sudo similarity index 100% rename from termux/scripts/sudo rename to config/nix/unprocessed/termux/scripts/sudo diff --git a/termux/scripts/tsu.old b/config/nix/unprocessed/termux/scripts/tsu.old similarity index 100% rename from termux/scripts/tsu.old rename to config/nix/unprocessed/termux/scripts/tsu.old diff --git a/termux/scripts/yt b/config/nix/unprocessed/termux/scripts/yt similarity index 100% rename from termux/scripts/yt rename to config/nix/unprocessed/termux/scripts/yt diff --git a/termux/services/autosvc b/config/nix/unprocessed/termux/services/autosvc similarity index 100% rename from termux/services/autosvc rename to config/nix/unprocessed/termux/services/autosvc diff --git a/termux/services/crond b/config/nix/unprocessed/termux/services/crond similarity index 100% rename from termux/services/crond rename to config/nix/unprocessed/termux/services/crond diff --git a/termux/services/sshd b/config/nix/unprocessed/termux/services/sshd similarity index 100% rename from termux/services/sshd rename to config/nix/unprocessed/termux/services/sshd diff --git a/termux/services/syncthing b/config/nix/unprocessed/termux/services/syncthing similarity index 100% rename from termux/services/syncthing rename to config/nix/unprocessed/termux/services/syncthing diff --git a/termux/services/syncthing.user b/config/nix/unprocessed/termux/services/syncthing.user similarity index 100% rename from termux/services/syncthing.user rename to config/nix/unprocessed/termux/services/syncthing.user diff --git a/termux/shell b/config/nix/unprocessed/termux/shell similarity index 100% rename from termux/shell rename to config/nix/unprocessed/termux/shell diff --git a/xsession b/config/nix/unprocessed/xsession similarity index 100% rename from xsession rename to config/nix/unprocessed/xsession diff --git a/face b/face deleted file mode 100644 index 8e4514cadfc6bd8e686bfdb508c6a7929bfd006b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 87261 zcmeFYby$>L*ET*3NJ>a5Afa@Ppmc}QAR?WLNJ&Y9v`C2{E!`>IIiz%VcXz|U%zPKO z_xnEgef*y1_s{oze|+z8AC3nzxShSPwbx$jJkPau;7cWGTx@b|5D0`TDh=E`cdEqirp(|2~c4_<<{*#nTRWjgFq#rI5%(Z0H3jJWVGx+AdW}3e^K(5 z=fZ(slG{Jmv{$u$Z}0TxqcP~^8#60=4yEU>X&j$&aC2}zd2;$O6$Cywz{FfIB2<2~|!GHx(7SsB_%-{LjdN4tlpua!MJz&*j4m_tEe_M|jFzsL0 z=j9cQDF&*}DNA({|I7NsKw#j{zt#(^RaXiGZhD@G+ko@e^??b1Y5%fbFwNp4;CCF` zA2#*=wjM8F+P~Twgz{e|Jov|i|CsO}FZ}a3|8tQ4iG}|ivHwXY|D==uPQw3WWCELi zK+T_M@E=@=`46=I6JY<(hSp)AOAy9?XT(3=c*z5tMGX0Gd5qp8^Lq?`8SaG+@Sy*| zjWVA6WgzJGJOANE|AXkIOfeFM!S^?s4bWH#fY`z?{yVGQzWI~d?h&d4Klv*Qe)gYT zg4XY^1OFeT%QB$)P}IL!Lad1%&>>Ph|7NuR(k3|WRbUeRWw@9x=syC~SNH!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z3)PZ->;k%g&CT&Yk7axNJjRihiu6y{KX`!DM2P~-+r#D}L&-GM32b(*>>mvI?_-~( zPHAw!Ed6>8KmONa{A$ABAQUInExQC#G)(_CiiYz|$MQdqjk2*Hp+grB9Ttw@_GfuE zdm#Y8tmH|7EsN??p}&nz{68LZ4GUu=@%g0AnMnMx7Sh`h3=0h1;A3Y|NCxR{tzV7e zPE=3`}b@>@}F_p5Vx$$v2?sdM-c7`niSO;@cZ51Qlsnvqlhv3TV7B*G7W zKi2b&lLD<|{(7zhYF9Y;`}^%Uf*g#A#kFXB;0P-6+-$VimBnOsD*pZVrffO7CAl;LkZZl`}cACfEKCf9$;! diff --git a/vimpcrc b/vimpcrc deleted file mode 100644 index d3f547c..0000000 --- a/vimpcrc +++ /dev/null @@ -1,8 +0,0 @@ -map FF :browsegg/ -map à :set add nexta:set add end -map @ :set add nexta:set add end:next -map ° D:browseA:shuffle:play:playlist -set songformat {%a - %b: %t}|{%f}$E$R $H[$H%l$H]$H -set libraryformat %n \| {%t}|{%f}$E$R $H[$H%l$H]$H -set ignorecase -set sort library From 550eed06e07e2b37a4d5f6eaa637ee0db23ba26e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 26 Nov 2023 23:47:15 +0100 Subject: [PATCH 070/108] nix: Various fixes frobar, autorandr and automatrop --- config/automatrop/plugins/modules/aur | 1 - config/automatrop/plugins/modules/gpg_key | 1 - .../automatrop/roles/dotfiles/tasks/main.yml | 26 - config/automatrop/roles/kewlfft.aur/LICENSE | 674 ------------------ config/automatrop/roles/kewlfft.aur/README.md | 126 ---- .../roles/kewlfft.aur/library/aur.py | 397 ----------- .../kewlfft.aur/meta/.galaxy_install_info | 2 - .../roles/kewlfft.aur/meta/main.yml | 17 - .../roles/mnussbaum.base16-builder-ansible | 1 - config/nix/hm/desktop.nix | 15 +- config/nix/hm/frobar/default.nix | 10 +- config/nix/hm/style.nix | 3 +- .../unprocessed/config}/automatrop/.gitignore | 0 .../unprocessed/config}/automatrop/README.md | 0 .../config}/automatrop/ansible.cfg | 0 .../config}/automatrop/group_vars/all | 0 .../host_vars/curacao.geoffrey.frogeye.fr | 0 .../host_vars/gho.geoffrey.frogeye.fr | 0 .../host_vars/pindakaas.geoffrey.frogeye.fr | 0 .../unprocessed/config}/automatrop/hosts | 0 .../config}/automatrop/playbooks/default.yml | 3 - .../roles/dotfiles/handlers/main.yml | 0 .../automatrop/roles/dotfiles/tasks/main.yml | 9 + .../roles/extensions/tasks/main.yml | 0 .../roles/extensions/templates/extrc.sh.j2 | 0 .../roles/system/files/getty.service | 0 .../system/files/xorg/intel_backlight.conf | 0 .../roles/system/files/xorg/joystick.conf | 0 .../roles/system/handlers/main.yaml | 0 .../automatrop/roles/system/tasks/main.yml | 0 .../automatrop/roles/termux/tasks/main.yml | 0 .../roles/vdirsyncer/templates/config.j2 | 0 .../unprocessed/config}/autorandr/.dfrecur | 0 .../{ => nix/unprocessed/config}/autorandr/bg | 0 .../unprocessed/config}/autorandr/postswitch | 0 35 files changed, 31 insertions(+), 1254 deletions(-) delete mode 160000 config/automatrop/plugins/modules/aur delete mode 160000 config/automatrop/plugins/modules/gpg_key delete mode 100644 config/automatrop/roles/dotfiles/tasks/main.yml delete mode 100644 config/automatrop/roles/kewlfft.aur/LICENSE delete mode 100644 config/automatrop/roles/kewlfft.aur/README.md delete mode 100644 config/automatrop/roles/kewlfft.aur/library/aur.py delete mode 100644 config/automatrop/roles/kewlfft.aur/meta/.galaxy_install_info delete mode 100644 config/automatrop/roles/kewlfft.aur/meta/main.yml delete mode 160000 config/automatrop/roles/mnussbaum.base16-builder-ansible rename config/{ => nix/unprocessed/config}/automatrop/.gitignore (100%) rename config/{ => nix/unprocessed/config}/automatrop/README.md (100%) rename config/{ => nix/unprocessed/config}/automatrop/ansible.cfg (100%) rename config/{ => nix/unprocessed/config}/automatrop/group_vars/all (100%) rename config/{ => nix/unprocessed/config}/automatrop/host_vars/curacao.geoffrey.frogeye.fr (100%) rename config/{ => nix/unprocessed/config}/automatrop/host_vars/gho.geoffrey.frogeye.fr (100%) rename config/{ => nix/unprocessed/config}/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr (100%) rename config/{ => nix/unprocessed/config}/automatrop/hosts (100%) rename config/{ => nix/unprocessed/config}/automatrop/playbooks/default.yml (81%) rename config/{ => nix/unprocessed/config}/automatrop/roles/dotfiles/handlers/main.yml (100%) create mode 100644 config/nix/unprocessed/config/automatrop/roles/dotfiles/tasks/main.yml rename config/{ => nix/unprocessed/config}/automatrop/roles/extensions/tasks/main.yml (100%) rename config/{ => nix/unprocessed/config}/automatrop/roles/extensions/templates/extrc.sh.j2 (100%) rename config/{ => nix/unprocessed/config}/automatrop/roles/system/files/getty.service (100%) rename config/{ => nix/unprocessed/config}/automatrop/roles/system/files/xorg/intel_backlight.conf (100%) rename config/{ => nix/unprocessed/config}/automatrop/roles/system/files/xorg/joystick.conf (100%) rename config/{ => nix/unprocessed/config}/automatrop/roles/system/handlers/main.yaml (100%) rename config/{ => nix/unprocessed/config}/automatrop/roles/system/tasks/main.yml (100%) rename config/{ => nix/unprocessed/config}/automatrop/roles/termux/tasks/main.yml (100%) rename config/{ => nix/unprocessed/config}/automatrop/roles/vdirsyncer/templates/config.j2 (100%) rename config/{ => nix/unprocessed/config}/autorandr/.dfrecur (100%) rename config/{ => nix/unprocessed/config}/autorandr/bg (100%) rename config/{ => nix/unprocessed/config}/autorandr/postswitch (100%) diff --git a/config/automatrop/plugins/modules/aur b/config/automatrop/plugins/modules/aur deleted file mode 160000 index 592c6d9..0000000 --- a/config/automatrop/plugins/modules/aur +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 592c6d9841674211f904cf9ea2a951fca3fd5a80 diff --git a/config/automatrop/plugins/modules/gpg_key b/config/automatrop/plugins/modules/gpg_key deleted file mode 160000 index 435f8e6..0000000 --- a/config/automatrop/plugins/modules/gpg_key +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 435f8e6aea0ba9be482c4409db380868a23fea9c diff --git a/config/automatrop/roles/dotfiles/tasks/main.yml b/config/automatrop/roles/dotfiles/tasks/main.yml deleted file mode 100644 index 61fa7d8..0000000 --- a/config/automatrop/roles/dotfiles/tasks/main.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: Ensure directories for applications are present - ansible.builtin.file: - state: directory - path: "{{ ansible_user_dir }}/{{ item }}" - mode: u=rwx,g=rx,o=rx - with_items: - - .cache/zsh - - .cache/mpd - - .ssh - - .local/bin - - .ansible/collections/ansible_collections/geoffreyfrogeye - -- name: Install dotfiles repository - ansible.builtin.git: - repo: "{% if has_forge_access %}git@git.frogeye.fr:{% else %}https://git.frogeye.fr/{% endif %}geoffrey/dotfiles.git" - dest: "{{ ansible_user_dir }}/.dotfiles" - update: true - notify: install dotfiles - tags: dotfiles_repo -# TODO Put actual dotfiles in a subdirectory of the repo, so we don't have to put everything in config - -- name: Install python dependencies for scripts - ansible.builtin.pip: - requirements: "{{ ansible_user_dir }}/.dotfiles/config/scripts/requirements.txt" - extra_args: --break-system-packages # It's fine, it's local anyways diff --git a/config/automatrop/roles/kewlfft.aur/LICENSE b/config/automatrop/roles/kewlfft.aur/LICENSE deleted file mode 100644 index 94a9ed0..0000000 --- a/config/automatrop/roles/kewlfft.aur/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/config/automatrop/roles/kewlfft.aur/README.md b/config/automatrop/roles/kewlfft.aur/README.md deleted file mode 100644 index 45bd730..0000000 --- a/config/automatrop/roles/kewlfft.aur/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# Ansible AUR helper -Ansible module to use some Arch User Repository (AUR) helpers as well as makepkg. - -The following helpers are supported and automatically selected, if present, in the order listed below: -- [yay](https://github.com/Jguer/yay) -- [paru](https://github.com/Morganamilo/paru) -- [pacaur](https://github.com/E5ten/pacaur) -- [trizen](https://github.com/trizen/trizen) -- [pikaur](https://github.com/actionless/pikaur) -- [aurman](https://github.com/polygamma/aurman) (discontinued) - -*makepkg* will be used if no helper was found or if it is explicitly specified: -- [makepkg](https://wiki.archlinux.org/index.php/makepkg) - -## Options -|Parameter |Choices/**Default** |Comments| -|--- |--- |---| -|name | |Name or list of names of the package(s) to install or upgrade.| -|state |**present**, latest |Desired state of the package, 'present' skips operations if the package is already installed.| -|upgrade |yes, **no** |Whether or not to upgrade whole system.| -|use |**auto**, yay, paru, pacaur, trizen, pikaur, aurman, makepkg |The tool to use, 'auto' uses the first known helper found and makepkg as a fallback.| -|extra_args |**null** |A list of additional arguments to pass directly to the tool. Cannot be used in 'auto' mode.| -|aur_only |yes, **no** |Limit helper operation to the AUR.| -|local_pkgbuild |Local directory with PKGBUILD, **null** |Only valid with makepkg or pikaur. Don't download the package from AUR. Build the package using a local PKGBUILD and the other build files.| -|skip_pgp_check |yes, **no** |Only valid with makepkg. Skip PGP signatures verification of source file, useful when installing packages without GnuPG properly configured.| -|ignore_arch |yes, **no** |Only valid with makepkg. Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field.| - -### Note -* Either *name* or *upgrade* is required, both cannot be used together. -* In the *use*=*auto* mode, makepkg is used as a fallback if no known helper is found. - -## Installing -### AUR package -The [ansible-aur-git](https://aur.archlinux.org/packages/ansible-aur-git) package is available in the AUR. - -Note: The module is installed in `/usr/share/ansible/plugins/modules` which is one of the default module library paths. - -### Manual installation -Just clone the *ansible-aur* repository into your user custom-module directory: -``` -git clone https://github.com/kewlfft/ansible-aur.git ~/.ansible/plugins/modules/aur -``` - -### Ansible Galaxy -*ansible-aur* is available in Galaxy which is a hub for sharing Ansible content. To download it, use: -``` -ansible-galaxy install kewlfft.aur -``` - -Note: If this module is installed from Ansible Galaxy, you will need to list it explicitly in your playbook: -``` -# playbook.yml -- hosts: localhost - roles: - - kewlfft.aur - tasks: - - aur: name=package_name -``` - -or in your role: -``` -# meta/main.yml -dependencies: -- kewlfft.aur -``` - -``` -# tasks/main.yml -- aur: name=package_name -``` - -## Usage -### Notes -* The scope of this module is installation and update from the AUR; for package removal or for updates from the repositories, it is recommended to use the official *pacman* module. -* The *--needed* parameter of the helper is systematically used, it means if a package is up-to-date, it is not built and reinstalled. - -### Create the "aur_builder" user -While Ansible expects to SSH as root, makepkg or AUR helpers do not allow executing operations as root, they fail with "you cannot perform this operation as root". It is therefore recommended to create a user, which is non-root but has no need for password with pacman in sudoers, let's call it *aur_builder*. - -This user can be created in an Ansible task with the following actions: -``` -- user: - name: aur_builder - create_home: no - group: wheel -- lineinfile: - path: /etc/sudoers.d/11-install-aur_builder - line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman' - create: yes - validate: 'visudo -cf %s' -``` - -### Examples -Use it in a task, as in the following examples: -``` -# Install trizen using makepkg, skip if it is already installed -- aur: name=trizen use=makepkg state=present - become: yes - become_user: aur_builder - -# Install package_name using the first known helper found -- aur: name=package_name - become: yes - become_user: aur_builder - -# Install package_name_1 and package_name_2 using yay -- aur: - use: yay - name: - - package_name_1 - - package_name_2 - -# Upgrade the system using yay, only act on AUR packages. -# Note: Dependency resolving will still include repository packages. -- aur: upgrade=yes use=yay aur_only=yes - -# Install gnome-shell-extension-caffeine-git using pikaur and a local PKGBUILD. -# Skip if it is already installed -- aur: - name: gnome-shell-extension-caffeine-git - use: pikaur - local_pkgbuild: {{ role_path }}/files/gnome-shell-extension-caffeine-git - state: present - become: yes - become_user: aur_builder -``` diff --git a/config/automatrop/roles/kewlfft.aur/library/aur.py b/config/automatrop/roles/kewlfft.aur/library/aur.py deleted file mode 100644 index b52442d..0000000 --- a/config/automatrop/roles/kewlfft.aur/library/aur.py +++ /dev/null @@ -1,397 +0,0 @@ -#!/usr/bin/python - -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.urls import open_url -import json -import shlex -import tarfile -import os -import os.path -import shutil -import tempfile -import urllib.parse - - -DOCUMENTATION = ''' ---- -module: aur -short_description: Manage packages from the AUR -description: - - Manage packages from the Arch User Repository (AUR) -author: - - Kewl -options: - name: - description: - - Name or list of names of the package(s) to install or upgrade. - - state: - description: - - Desired state of the package. - default: present - choices: [ present, latest ] - - upgrade: - description: - - Whether or not to upgrade whole system. - default: no - type: bool - - use: - description: - - The tool to use, 'auto' uses the first known helper found and makepkg as a fallback. - default: auto - choices: [ auto, yay, paru, pacaur, trizen, pikaur, aurman, makepkg ] - - extra_args: - description: - - Arguments to pass to the tool. - Requires that the 'use' option be set to something other than 'auto'. - type: str - - skip_pgp_check: - description: - - Only valid with makepkg. - Skip PGP signatures verification of source file. - This is useful when installing packages without GnuPG (properly) configured. - Cannot be used unless use is set to 'makepkg'. - type: bool - default: no - - ignore_arch: - description: - - Only valid with makepkg. - Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field. - Cannot be used unless use is set to 'makepkg'. - type: bool - default: no - - aur_only: - description: - - Limit helper operation to the AUR. - type: bool - default: no - - local_pkgbuild: - description: - - Only valid with makepkg or pikaur. - Directory with PKGBUILD and build files. - Cannot be used unless use is set to 'makepkg' or 'pikaur'. - type: path - default: no -notes: - - When used with a `loop:` each package will be processed individually, - it is much more efficient to pass the list directly to the `name` option. -''' - -RETURN = ''' -msg: - description: action that has been taken -helper: - the helper that was actually used -''' - -EXAMPLES = ''' -- name: Install trizen using makepkg, skip if trizen is already installed - aur: name=trizen use=makepkg state=present - become: yes - become_user: aur_builder -''' - -def_lang = ['env', 'LC_ALL=C'] - -use_cmd = { - 'yay': ['yay', '-S', '--noconfirm', '--needed', '--cleanafter'], - 'paru': ['paru', '-S', '--noconfirm', '--needed', '--cleanafter'], - 'pacaur': ['pacaur', '-S', '--noconfirm', '--noedit', '--needed'], - 'trizen': ['trizen', '-S', '--noconfirm', '--noedit', '--needed'], - 'pikaur': ['pikaur', '-S', '--noconfirm', '--noedit', '--needed'], - 'aurman': ['aurman', '-S', '--noconfirm', '--noedit', '--needed', '--skip_news', '--pgp_fetch', '--skip_new_locations'], - 'makepkg': ['makepkg', '--syncdeps', '--install', '--noconfirm', '--needed'] -} - -use_cmd_local_pkgbuild = { - 'pikaur': ['pikaur', '-P', '--noconfirm', '--noedit', '--needed', '--install'], - 'makepkg': ['makepkg', '--syncdeps', '--install', '--noconfirm', '--needed'] -} - -has_aur_option = ['yay', 'paru', 'pacaur', 'trizen', 'pikaur', 'aurman'] - - -def package_installed(module, package): - """ - Determine if the package is already installed - """ - rc, _, _ = module.run_command(['pacman', '-Q', package], check_rc=False) - return rc == 0 - - -def check_packages(module, packages): - """ - Inform the user what would change if the module were run - """ - would_be_changed = [] - diff = { - 'before': '', - 'after': '', - } - - for package in packages: - installed = package_installed(module, package) - if not installed: - would_be_changed.append(package) - if module._diff: - diff['after'] += package + "\n" - - if would_be_changed: - status = True - if len(packages) > 1: - message = '{} package(s) would be installed'.format(len(would_be_changed)) - else: - message = 'package would be installed' - else: - status = False - if len(packages) > 1: - message = 'all packages are already installed' - else: - message = 'package is already installed' - module.exit_json(changed=status, msg=message, diff=diff) - - -def build_command_prefix(use, extra_args, skip_pgp_check=False, ignore_arch=False, aur_only=False, local_pkgbuild=None): - """ - Create the prefix of a command that can be used by the install and upgrade functions. - """ - if local_pkgbuild: - command = def_lang + use_cmd_local_pkgbuild[use] - else: - command = def_lang + use_cmd[use] - if skip_pgp_check: - command.append('--skippgpcheck') - if ignore_arch: - command.append('--ignorearch') - if aur_only and use in has_aur_option: - command.append('--aur') - if local_pkgbuild and use != 'makepkg': - command.append(local_pkgbuild) - if extra_args: - command += shlex.split(extra_args) - return command - - -def install_with_makepkg(module, package, extra_args, skip_pgp_check, ignore_arch, local_pkgbuild=None): - """ - Install the specified package or a local PKGBUILD with makepkg - """ - if not local_pkgbuild: - module.get_bin_path('fakeroot', required=True) - f = open_url('https://aur.archlinux.org/rpc/?v=5&type=info&arg={}'.format(urllib.parse.quote(package))) - result = json.loads(f.read().decode('utf8')) - if result['resultcount'] != 1: - return (1, '', 'package {} not found'.format(package)) - result = result['results'][0] - f = open_url('https://aur.archlinux.org/{}'.format(result['URLPath'])) - with tempfile.TemporaryDirectory() as tmpdir: - if local_pkgbuild: - shutil.copytree(local_pkgbuild, tmpdir, dirs_exist_ok=True) - command = build_command_prefix('makepkg', extra_args) - rc, out, err = module.run_command(command, cwd=tmpdir, check_rc=True) - else: - tar = tarfile.open(mode='r|*', fileobj=f) - tar.extractall(tmpdir) - tar.close() - command = build_command_prefix('makepkg', extra_args, skip_pgp_check=skip_pgp_check, ignore_arch=ignore_arch) - rc, out, err = module.run_command(command, cwd=os.path.join(tmpdir, result['Name']), check_rc=True) - return (rc, out, err) - - -def install_local_package(module, package, use, extra_args, local_pkgbuild): - """ - Install the specified package with a local PKGBUILD - """ - with tempfile.TemporaryDirectory() as tmpdir: - shutil.copytree(local_pkgbuild, tmpdir, dirs_exist_ok=True) - command = build_command_prefix(use, extra_args, local_pkgbuild=tmpdir + '/PKGBUILD') - rc, out, err = module.run_command(command, check_rc=True) - return (rc, out, err) - - -def check_upgrade(module, use): - """ - Inform user how many packages would be upgraded - """ - rc, stdout, stderr = module.run_command([use, '-Qu'], check_rc=True) - data = stdout.split('\n') - data.remove('') - module.exit_json( - changed=len(data) > 0, - msg="{} package(s) would be upgraded".format(len(data)), - helper=use, - ) - - -def upgrade(module, use, extra_args, aur_only): - """ - Upgrade the whole system - """ - assert use in use_cmd - - command = build_command_prefix(use, extra_args, aur_only=aur_only) - command.append('-u') - - rc, out, err = module.run_command(command, check_rc=True) - - module.exit_json( - changed=not (out == '' or 'nothing to do' in out or 'No AUR updates found' in out), - msg='upgraded system', - helper=use, - ) - - -def install_packages(module, packages, use, extra_args, state, skip_pgp_check, ignore_arch, aur_only, local_pkgbuild): - """ - Install the specified packages - """ - if local_pkgbuild: - assert use in use_cmd_local_pkgbuild - else: - assert use in use_cmd - - changed_iter = False - - for package in packages: - if state == 'present': - if package_installed(module, package): - rc = 0 - continue - if use == 'makepkg': - rc, out, err = install_with_makepkg(module, package, extra_args, skip_pgp_check, ignore_arch, local_pkgbuild) - elif local_pkgbuild: - rc, out, err = install_local_package(module, package, use, extra_args, local_pkgbuild) - else: - command = build_command_prefix(use, extra_args, aur_only=aur_only) - command.append(package) - rc, out, err = module.run_command(command, check_rc=True) - - changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'nothing to do' in out) - - message = 'installed package(s)' if changed_iter else 'package(s) already installed' - - module.exit_json( - changed=changed_iter, - msg=message if not rc else err, - helper=use, - rc=rc, - ) - - -def make_module(): - module = AnsibleModule( - argument_spec={ - 'name': { - 'type': 'list', - }, - 'state': { - 'default': 'present', - 'choices': ['present', 'latest'], - }, - 'upgrade': { - 'type': 'bool', - }, - 'use': { - 'default': 'auto', - 'choices': ['auto'] + list(use_cmd.keys()), - }, - 'extra_args': { - 'default': None, - 'type': 'str', - }, - 'skip_pgp_check': { - 'default': False, - 'type': 'bool', - }, - 'ignore_arch': { - 'default': False, - 'type': 'bool', - }, - 'aur_only': { - 'default': False, - 'type': 'bool', - }, - 'local_pkgbuild': { - 'default': None, - 'type': 'path', - }, - }, - mutually_exclusive=[['name', 'upgrade']], - required_one_of=[['name', 'upgrade']], - supports_check_mode=True - ) - - params = module.params - - use = params['use'] - - if params['name'] == []: - module.fail_json(msg="'name' cannot be empty.") - - if use == 'auto': - if params['extra_args'] is not None: - module.fail_json(msg="'extra_args' cannot be used with 'auto', a tool must be specified.") - use = 'makepkg' - # auto: select the first helper for which the bin is found - for k in use_cmd: - if module.get_bin_path(k): - use = k - break - - if use != 'makepkg' and (params['skip_pgp_check'] or params['ignore_arch']): - module.fail_json(msg="This option is only available with 'makepkg'.") - - if not (use in use_cmd_local_pkgbuild) and params['local_pkgbuild']: - module.fail_json(msg="This option is not available with '%s'" % use) - - if params['local_pkgbuild'] and not os.path.isdir(params['local_pkgbuild']): - module.fail_json(msg="Directory %s not found" % (params['local_pkgbuild'])) - - if params['local_pkgbuild'] and not os.access(params['local_pkgbuild'] + '/PKGBUILD', os.R_OK): - module.fail_json(msg="PKGBUILD inside %s not readable" % (params['local_pkgbuild'])) - - if params.get('upgrade', False) and use == 'makepkg': - module.fail_json(msg="The 'upgrade' action cannot be used with 'makepkg'.") - - return module, use - - -def apply_module(module, use): - params = module.params - - if params.get('upgrade', False): - if module.check_mode: - check_upgrade(module, use) - else: - upgrade(module, use, params['extra_args'], params['aur_only']) - else: - if module.check_mode: - check_packages(module, params['name']) - else: - install_packages(module, - params['name'], - use, - params['extra_args'], - params['state'], - params['skip_pgp_check'], - params['ignore_arch'], - params['aur_only'], - params['local_pkgbuild']) - - -def main(): - module, use = make_module() - apply_module(module, use) - - -if __name__ == '__main__': - main() diff --git a/config/automatrop/roles/kewlfft.aur/meta/.galaxy_install_info b/config/automatrop/roles/kewlfft.aur/meta/.galaxy_install_info deleted file mode 100644 index 262dba5..0000000 --- a/config/automatrop/roles/kewlfft.aur/meta/.galaxy_install_info +++ /dev/null @@ -1,2 +0,0 @@ -install_date: Sun Feb 21 21:18:27 2021 -version: master diff --git a/config/automatrop/roles/kewlfft.aur/meta/main.yml b/config/automatrop/roles/kewlfft.aur/meta/main.yml deleted file mode 100644 index f65f2df..0000000 --- a/config/automatrop/roles/kewlfft.aur/meta/main.yml +++ /dev/null @@ -1,17 +0,0 @@ -galaxy_info: - author: kewlfft - role_name: aur - description: Ansible module to use some Arch User Repository (AUR) helpers as well as makepkg. - license: GPL-3.0-or-later - min_ansible_version: 2.0 - - # https://galaxy.ansible.com/api/v1/platforms/ - platforms: - - name: ArchLinux - versions: - - any - - galaxy_tags: - - aur - -dependencies: [] diff --git a/config/automatrop/roles/mnussbaum.base16-builder-ansible b/config/automatrop/roles/mnussbaum.base16-builder-ansible deleted file mode 160000 index a977bb2..0000000 --- a/config/automatrop/roles/mnussbaum.base16-builder-ansible +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a977bb298fb9e1c057e0b2587dbd4d047e13f5bd diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 944b5f2..d022f51 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -57,7 +57,7 @@ { modifier = "Mod1"; # FIXME Mod1 for VM, Mod4 for not VM terminal = "alacritty"; - # bars = []; # FIXME lemonbar + bars = []; # Using frobar colors = let ignore = "#ff00ff"; in with config.lib.stylix.colors.withHashtag; lib.mkForce { focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; }; @@ -453,7 +453,17 @@ matching = "regex"; }; }; - autorandr.enable = true; + autorandr = { + enable = true; + hooks.postswitch = + let + frobar = (pkgs.callPackage (import ./frobar) { }); + in + { + "background" = "${pkgs.feh}/bin/feh --no-fehbg --bg-fill ${config.stylix.image}"; + "frobar" = "${pkgs.i3}/bin/i3-msg exec ${frobar}/bin/frobar_launcher"; + }; + }; mpv = { enable = true; config = { @@ -632,7 +642,6 @@ xorg.xinit xorg.xbacklight # TODO Make this clean. Service? - (callPackage (import ./frobar) { }) # FIXME Call it where needed # organisation diff --git a/config/nix/hm/frobar/default.nix b/config/nix/hm/frobar/default.nix index cf1d7a7..e7a3f12 100644 --- a/config/nix/hm/frobar/default.nix +++ b/config/nix/hm/frobar/default.nix @@ -23,9 +23,15 @@ let name = "frobar_launcher"; runtimeInputs = with pkgs; [ lemonbar-xft wirelesstools ]; text = '' - ${pkgs.procps}/bin/pkill /bin/frobar || true - ${frobar}/bin/frobar + pidfile=$XDG_RUNTIME_DIR/frobar/$DISPLAY.pid + ${pkgs.coreutils}/bin/mkdir -p "$(${pkgs.coreutils}/bin/dirname "$pidfile")" + ([ -f "$pidfile" ] && ${pkgs.procps}/bin/kill "$(<"$pidfile")") || true + ${frobar}/bin/frobar & disown + echo $! > "$pidfile" ''; }; in frobar_launcher +# FIXME Doesn't kill the old bar +# FIXME Not using Nerdfont +# TODO Connection with i3 is lost sometimes, more often than with Arch? diff --git a/config/nix/hm/style.nix b/config/nix/hm/style.nix index 5bf2fce..e177958 100644 --- a/config/nix/hm/style.nix +++ b/config/nix/hm/style.nix @@ -15,13 +15,14 @@ in url = "https://get.wallhere.com/photo/sunlight-abstract-minimalism-green-simple-circle-light-leaf-wave-material-line-wing-computer-wallpaper-font-close-up-macro-photography-124350.png"; sha256 = "sha256:1zfq3f3v34i45mi72pkfqphm8kbhczsg260xjfl6dbydy91d7y93"; }; - # FIXME This doesn't work + # The background is set on some occasions, autorandr + feh do the rest fonts = { sizes = { applications = 10; terminal = 10; }; + # FIXME Somehow this seems smaller than Arch on the left screen, yet bigger on the right... monospace = { package = pkgs.nerdfonts.override { fonts = [ "DejaVuSansMono" ]; # Choose from https://github.com/NixOS/nixpkgs/blob/6ba3207643fd27ffa25a172911e3d6825814d155/pkgs/data/fonts/nerdfonts/shas.nix diff --git a/config/automatrop/.gitignore b/config/nix/unprocessed/config/automatrop/.gitignore similarity index 100% rename from config/automatrop/.gitignore rename to config/nix/unprocessed/config/automatrop/.gitignore diff --git a/config/automatrop/README.md b/config/nix/unprocessed/config/automatrop/README.md similarity index 100% rename from config/automatrop/README.md rename to config/nix/unprocessed/config/automatrop/README.md diff --git a/config/automatrop/ansible.cfg b/config/nix/unprocessed/config/automatrop/ansible.cfg similarity index 100% rename from config/automatrop/ansible.cfg rename to config/nix/unprocessed/config/automatrop/ansible.cfg diff --git a/config/automatrop/group_vars/all b/config/nix/unprocessed/config/automatrop/group_vars/all similarity index 100% rename from config/automatrop/group_vars/all rename to config/nix/unprocessed/config/automatrop/group_vars/all diff --git a/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr b/config/nix/unprocessed/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr similarity index 100% rename from config/automatrop/host_vars/curacao.geoffrey.frogeye.fr rename to config/nix/unprocessed/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr diff --git a/config/automatrop/host_vars/gho.geoffrey.frogeye.fr b/config/nix/unprocessed/config/automatrop/host_vars/gho.geoffrey.frogeye.fr similarity index 100% rename from config/automatrop/host_vars/gho.geoffrey.frogeye.fr rename to config/nix/unprocessed/config/automatrop/host_vars/gho.geoffrey.frogeye.fr diff --git a/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr b/config/nix/unprocessed/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr similarity index 100% rename from config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr rename to config/nix/unprocessed/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr diff --git a/config/automatrop/hosts b/config/nix/unprocessed/config/automatrop/hosts similarity index 100% rename from config/automatrop/hosts rename to config/nix/unprocessed/config/automatrop/hosts diff --git a/config/automatrop/playbooks/default.yml b/config/nix/unprocessed/config/automatrop/playbooks/default.yml similarity index 81% rename from config/automatrop/playbooks/default.yml rename to config/nix/unprocessed/config/automatrop/playbooks/default.yml index e9da6a0..b02d58a 100644 --- a/config/automatrop/playbooks/default.yml +++ b/config/nix/unprocessed/config/automatrop/playbooks/default.yml @@ -2,9 +2,6 @@ - name: Default hosts: all roles: - - role: access - tags: access - when: root_access - role: system tags: system when: root_access diff --git a/config/automatrop/roles/dotfiles/handlers/main.yml b/config/nix/unprocessed/config/automatrop/roles/dotfiles/handlers/main.yml similarity index 100% rename from config/automatrop/roles/dotfiles/handlers/main.yml rename to config/nix/unprocessed/config/automatrop/roles/dotfiles/handlers/main.yml diff --git a/config/nix/unprocessed/config/automatrop/roles/dotfiles/tasks/main.yml b/config/nix/unprocessed/config/automatrop/roles/dotfiles/tasks/main.yml new file mode 100644 index 0000000..ced1daf --- /dev/null +++ b/config/nix/unprocessed/config/automatrop/roles/dotfiles/tasks/main.yml @@ -0,0 +1,9 @@ +--- +- name: Install dotfiles repository + ansible.builtin.git: + repo: "{% if has_forge_access %}git@git.frogeye.fr:{% else %}https://git.frogeye.fr/{% endif %}geoffrey/dotfiles.git" + dest: "{{ ansible_user_dir }}/.dotfiles" + update: true + notify: install dotfiles + tags: dotfiles_repo +# TODO Put actual dotfiles in a subdirectory of the repo, so we don't have to put everything in config diff --git a/config/automatrop/roles/extensions/tasks/main.yml b/config/nix/unprocessed/config/automatrop/roles/extensions/tasks/main.yml similarity index 100% rename from config/automatrop/roles/extensions/tasks/main.yml rename to config/nix/unprocessed/config/automatrop/roles/extensions/tasks/main.yml diff --git a/config/automatrop/roles/extensions/templates/extrc.sh.j2 b/config/nix/unprocessed/config/automatrop/roles/extensions/templates/extrc.sh.j2 similarity index 100% rename from config/automatrop/roles/extensions/templates/extrc.sh.j2 rename to config/nix/unprocessed/config/automatrop/roles/extensions/templates/extrc.sh.j2 diff --git a/config/automatrop/roles/system/files/getty.service b/config/nix/unprocessed/config/automatrop/roles/system/files/getty.service similarity index 100% rename from config/automatrop/roles/system/files/getty.service rename to config/nix/unprocessed/config/automatrop/roles/system/files/getty.service diff --git a/config/automatrop/roles/system/files/xorg/intel_backlight.conf b/config/nix/unprocessed/config/automatrop/roles/system/files/xorg/intel_backlight.conf similarity index 100% rename from config/automatrop/roles/system/files/xorg/intel_backlight.conf rename to config/nix/unprocessed/config/automatrop/roles/system/files/xorg/intel_backlight.conf diff --git a/config/automatrop/roles/system/files/xorg/joystick.conf b/config/nix/unprocessed/config/automatrop/roles/system/files/xorg/joystick.conf similarity index 100% rename from config/automatrop/roles/system/files/xorg/joystick.conf rename to config/nix/unprocessed/config/automatrop/roles/system/files/xorg/joystick.conf diff --git a/config/automatrop/roles/system/handlers/main.yaml b/config/nix/unprocessed/config/automatrop/roles/system/handlers/main.yaml similarity index 100% rename from config/automatrop/roles/system/handlers/main.yaml rename to config/nix/unprocessed/config/automatrop/roles/system/handlers/main.yaml diff --git a/config/automatrop/roles/system/tasks/main.yml b/config/nix/unprocessed/config/automatrop/roles/system/tasks/main.yml similarity index 100% rename from config/automatrop/roles/system/tasks/main.yml rename to config/nix/unprocessed/config/automatrop/roles/system/tasks/main.yml diff --git a/config/automatrop/roles/termux/tasks/main.yml b/config/nix/unprocessed/config/automatrop/roles/termux/tasks/main.yml similarity index 100% rename from config/automatrop/roles/termux/tasks/main.yml rename to config/nix/unprocessed/config/automatrop/roles/termux/tasks/main.yml diff --git a/config/automatrop/roles/vdirsyncer/templates/config.j2 b/config/nix/unprocessed/config/automatrop/roles/vdirsyncer/templates/config.j2 similarity index 100% rename from config/automatrop/roles/vdirsyncer/templates/config.j2 rename to config/nix/unprocessed/config/automatrop/roles/vdirsyncer/templates/config.j2 diff --git a/config/autorandr/.dfrecur b/config/nix/unprocessed/config/autorandr/.dfrecur similarity index 100% rename from config/autorandr/.dfrecur rename to config/nix/unprocessed/config/autorandr/.dfrecur diff --git a/config/autorandr/bg b/config/nix/unprocessed/config/autorandr/bg similarity index 100% rename from config/autorandr/bg rename to config/nix/unprocessed/config/autorandr/bg diff --git a/config/autorandr/postswitch b/config/nix/unprocessed/config/autorandr/postswitch similarity index 100% rename from config/autorandr/postswitch rename to config/nix/unprocessed/config/autorandr/postswitch From ee178b7d57bca5a39d76a62233c095436702a0da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 26 Nov 2023 23:58:22 +0100 Subject: [PATCH 071/108] nix: Make nix the root Which means now I'll have to think about real prefixes in commit names. --- .gitignore | 3 ++- config/nix/add_channels.sh => add_channels.sh | 0 config/nix/build-vm.sh => build-vm.sh | 0 config/nix/.gitignore | 2 -- config/nix/unprocessed/config/vdirsyncer/.dfrecur | 0 config/nix/curacao.nix => curacao.nix | 0 config/nix/curacao_test.nix => curacao_test.nix | 0 {config/nix/hm => hm}/batteryNotify.sh | 0 {config/nix/hm => hm}/common.nix | 2 +- {config/nix/hm => hm}/desktop.nix | 0 {config/nix/hm => hm}/dev.nix | 0 {config/nix/hm => hm}/extra.nix | 0 {config/nix/hm => hm}/face.svg | 0 {config/nix/hm => hm}/frobar/.dev/barng.py | 0 {config/nix/hm => hm}/frobar/.dev/oldbar.py | 0 {config/nix/hm => hm}/frobar/.dev/pip.py | 0 {config/nix/hm => hm}/frobar/.dev/x.py | 0 {config/nix/hm => hm}/frobar/.gitignore | 1 + {config/nix/hm => hm}/frobar/default.nix | 0 {config/nix/hm => hm}/frobar/frobar/__init__.py | 0 {config/nix/hm => hm}/frobar/frobar/display.py | 0 {config/nix/hm => hm}/frobar/frobar/notbusy.py | 0 {config/nix/hm => hm}/frobar/frobar/providers.py | 0 {config/nix/hm => hm}/frobar/frobar/updaters.py | 0 {config/nix/hm => hm}/frobar/setup.py | 0 {config/nix/hm => hm}/inputrc | 0 {config/nix/hm => hm}/loader.nix | 0 {config/nix/hm => hm}/pythonstartup.py | 0 {config/nix/hm => hm}/screenrc | 0 {config/nix/hm => hm}/style.nix | 0 {config/nix/hm => hm}/tmux.conf | 0 {config/nix/hm => hm}/vim.nix | 0 {config/nix/hm => hm}/vim/feline.lua | 0 {config/nix/hm => hm}/vim/feline_test.vim | 0 {config/nix/hm => hm}/vim/lsp_signature-nvim.lua | 0 {config/nix/hm => hm}/vim/nvim-compe.lua | 0 {config/nix/hm => hm}/vim/nvim-ts-rainbow.lua | 0 {config/nix/hm => hm}/vim/symbols-outline-nvim.lua | 0 {config/nix/hm => hm}/zshrc.sh | 0 config/nix/options.nix => options.nix | 3 +-- {config/nix/os => os}/battery.nix | 0 {config/nix/os => os}/common.nix | 0 {config/nix/os => os}/desktop.nix | 0 {config/nix/os => os}/geoffrey.nix | 0 {config/nix/os => os}/loader.nix | 0 {config/nix/os => os}/qwerty-fr-keypad.diff | 0 {config/nix/os => os}/wireless.nix | 0 {config/nix/os => os}/wireless/.gitignore | 0 {config/nix/os => os}/wireless/import.py | 0 config/nix/pindakaas.nix => pindakaas.nix | 0 {config/nix/scripts => scripts}/.bsh/bashrc | 0 .../nix/scripts => scripts}/.bsh/bashrc_unsortable | 0 {config/nix/scripts => scripts}/.bsh/inputrc | 0 {config/nix/scripts => scripts}/.bsh/vimrc | 0 {config/nix/scripts => scripts}/.gitignore | 0 {config/nix/scripts => scripts}/archive | 0 {config/nix/scripts => scripts}/bsh | 0 {config/nix/scripts => scripts}/cached_pass | 0 {config/nix/scripts => scripts}/camera_name_date | 0 {config/nix/scripts => scripts}/cleandev | 0 .../nix/scripts => scripts}/compressPictureMovies | 0 {config/nix/scripts => scripts}/crepuscule | 0 {config/nix/scripts => scripts}/docker-image-childs | 0 {config/nix/scripts => scripts}/docker-rm | 0 {config/nix/scripts => scripts}/dummy | 0 {config/nix/scripts => scripts}/emergency-clean | 0 {config/nix/scripts => scripts}/gitCheckoutModes | 0 {config/nix/scripts => scripts}/gitghost | 0 {config/nix/scripts => scripts}/jour | 0 {config/nix/scripts => scripts}/lestrte | 0 {config/nix/scripts => scripts}/letrtes | 0 {config/nix/scripts => scripts}/lip | 0 {config/nix/scripts => scripts}/lorem | 0 {config/nix/scripts => scripts}/mediaDuration | 0 {config/nix/scripts => scripts}/music_remove_dashes | 0 {config/nix/scripts => scripts}/nuit | 0 {config/nix/scripts => scripts}/o | 0 {config/nix/scripts => scripts}/optimize | 0 {config/nix/scripts => scripts}/overpdf | 0 {config/nix/scripts => scripts}/pdfpages | 0 {config/nix/scripts => scripts}/pdfrename | 0 {config/nix/scripts => scripts}/picture_name_date | 0 {config/nix/scripts => scripts}/pushToTalk | 0 {config/nix/scripts => scripts}/raw_move_precomp | 0 {config/nix/scripts => scripts}/rep | 0 {config/nix/scripts => scripts}/replayGain | 0 {config/nix/scripts => scripts}/rmf | 0 {config/nix/scripts => scripts}/rssVideos | 0 {config/nix/scripts => scripts}/smtpdummy | 0 {config/nix/scripts => scripts}/spongebob | 0 {config/nix/scripts => scripts}/syncthingRestore | 0 {config/nix/scripts => scripts}/tagCreatorPhotos | 0 {config/nix/scripts => scripts}/ter | 0 {config/nix/scripts => scripts}/unziptree | 0 .../nix/scripts => scripts}/updateCompressedMusic | 0 {config/nix/scripts => scripts}/videoQuota | 0 {config/nix/scripts => scripts}/wttr | 0 .../nix/unprocessed => unprocessed}/Zeal/Zeal.conf | 0 .../config/automatrop/.gitignore | 0 .../config/automatrop/README.md | 0 .../config/automatrop/ansible.cfg | 0 .../config/automatrop/group_vars/all | 0 .../host_vars/curacao.geoffrey.frogeye.fr | 0 .../automatrop/host_vars/gho.geoffrey.frogeye.fr | 0 .../host_vars/pindakaas.geoffrey.frogeye.fr | 0 .../config/automatrop/hosts | 0 .../config/automatrop/playbooks/default.yml | 0 .../automatrop/roles/dotfiles/handlers/main.yml | 0 .../config/automatrop/roles/dotfiles/tasks/main.yml | 0 .../automatrop/roles/extensions/tasks/main.yml | 0 .../roles/extensions/templates/extrc.sh.j2 | 0 .../automatrop/roles/system/files/getty.service | 0 .../roles/system/files/xorg/intel_backlight.conf | 0 .../roles/system/files/xorg/joystick.conf | 0 .../automatrop/roles/system/handlers/main.yaml | 0 .../config/automatrop/roles/system/tasks/main.yml | 0 .../config/automatrop/roles/termux/tasks/main.yml | 0 .../automatrop/roles/vdirsyncer/templates/config.j2 | 0 {config => unprocessed/config/autorandr}/.dfrecur | 0 .../unprocessed => unprocessed}/config/autorandr/bg | 0 .../config/autorandr/postswitch | 0 .../config/j4status/config | 0 .../unprocessed => unprocessed}/config/khal/config | 0 .../config/khard/khard.conf | 0 .../config/linuxColors.sh | 0 .../config/offlineimap.py | 0 .../unprocessed => unprocessed}/config/optiSvgo.yml | 0 .../config/polybar/bars.ini | 0 .../config/polybar/bbswitch | 0 .../config/polybar/config | 0 .../config/polybar/config.ini | 0 .../config/polybar/keystore | 0 .../config/polybar/launch.sh | 0 .../config/polybar/linuxmismatch | 0 .../config/polybar/modules.ini | 0 .../unprocessed => unprocessed}/config/polybar/todo | 0 .../config/scripts/adb_backup_extract | 0 .../config/scripts/arch-kexec | 0 .../config/scripts/cudarun | 0 .../config/scripts/dafont | 0 .../config/scripts/debloc | 0 .../config/scripts/diapo | 0 .../unprocessed => unprocessed}/config/scripts/hc | 0 .../unprocessed => unprocessed}/config/scripts/hl | 0 .../config/scripts/html2pdf | 0 .../config/scripts/install-wsl | 0 .../config/scripts/logstasync | 0 .../config/scripts/machines | 0 .../config/scripts/md2html | 0 .../unprocessed => unprocessed}/config/scripts/mel | 0 .../config/scripts/melConf | 0 .../config/scripts/musiqueBof | 0 .../unprocessed => unprocessed}/config/scripts/nv | 0 .../config/scripts/package-lock.json | 0 .../config/scripts/package.json | 0 .../config/scripts/proxy | 0 .../config/scripts/remcrlf | 0 .../config/scripts/tunnel | 0 .../config/scripts/tvshow | 0 .../config/scripts/updatedate | 0 .../config/systemd/user/.gitignore | 0 .../config/systemd/user/ipfs.service | 0 .../config/systemd/user/melfetch.service | 0 .../config/systemd/user/melfetch.timer | 0 .../config/systemd/user/urxvtd.service | 0 .../config/systemd/user/urxvtd.socket | 0 .../config/systemd/user/x0vncserver.service | 0 .../config/todoman/todoman.conf | 0 .../config/tridactyl/themes/.gitignore | 0 .../config/tridactyl/tridactylrc | 0 .../config/vdirsyncer}/.dfrecur | 0 .../config/vdirsyncer/config | 0 .../nix/unprocessed => unprocessed}/config/xinitrc | 0 .../unprocessed => unprocessed}/termux/.gitignore | 0 .../termux/bin/.gitignore | 0 .../unprocessed => unprocessed}/termux/boot/autosvc | 0 .../unprocessed => unprocessed}/termux/boot/symlink | 0 .../nix/unprocessed => unprocessed}/termux/font.ttf | Bin .../termux/scripts/autosvc | 0 .../termux/scripts/service | 0 .../unprocessed => unprocessed}/termux/scripts/sudo | 0 .../termux/scripts/tsu.old | 0 .../unprocessed => unprocessed}/termux/scripts/yt | 0 .../termux/services/autosvc | 0 .../termux/services/crond | 0 .../termux/services/sshd | 0 .../termux/services/syncthing | 0 .../termux/services/syncthing.user | 0 .../nix/unprocessed => unprocessed}/termux/shell | 0 {config/nix/unprocessed => unprocessed}/xsession | 0 190 files changed, 5 insertions(+), 6 deletions(-) rename config/nix/add_channels.sh => add_channels.sh (100%) rename config/nix/build-vm.sh => build-vm.sh (100%) delete mode 100644 config/nix/.gitignore delete mode 100644 config/nix/unprocessed/config/vdirsyncer/.dfrecur rename config/nix/curacao.nix => curacao.nix (100%) rename config/nix/curacao_test.nix => curacao_test.nix (100%) rename {config/nix/hm => hm}/batteryNotify.sh (100%) rename {config/nix/hm => hm}/common.nix (99%) rename {config/nix/hm => hm}/desktop.nix (100%) rename {config/nix/hm => hm}/dev.nix (100%) rename {config/nix/hm => hm}/extra.nix (100%) rename {config/nix/hm => hm}/face.svg (100%) rename {config/nix/hm => hm}/frobar/.dev/barng.py (100%) rename {config/nix/hm => hm}/frobar/.dev/oldbar.py (100%) rename {config/nix/hm => hm}/frobar/.dev/pip.py (100%) rename {config/nix/hm => hm}/frobar/.dev/x.py (100%) rename {config/nix/hm => hm}/frobar/.gitignore (67%) rename {config/nix/hm => hm}/frobar/default.nix (100%) rename {config/nix/hm => hm}/frobar/frobar/__init__.py (100%) rename {config/nix/hm => hm}/frobar/frobar/display.py (100%) rename {config/nix/hm => hm}/frobar/frobar/notbusy.py (100%) rename {config/nix/hm => hm}/frobar/frobar/providers.py (100%) rename {config/nix/hm => hm}/frobar/frobar/updaters.py (100%) rename {config/nix/hm => hm}/frobar/setup.py (100%) rename {config/nix/hm => hm}/inputrc (100%) rename {config/nix/hm => hm}/loader.nix (100%) rename {config/nix/hm => hm}/pythonstartup.py (100%) rename {config/nix/hm => hm}/screenrc (100%) rename {config/nix/hm => hm}/style.nix (100%) rename {config/nix/hm => hm}/tmux.conf (100%) rename {config/nix/hm => hm}/vim.nix (100%) rename {config/nix/hm => hm}/vim/feline.lua (100%) rename {config/nix/hm => hm}/vim/feline_test.vim (100%) rename {config/nix/hm => hm}/vim/lsp_signature-nvim.lua (100%) rename {config/nix/hm => hm}/vim/nvim-compe.lua (100%) rename {config/nix/hm => hm}/vim/nvim-ts-rainbow.lua (100%) rename {config/nix/hm => hm}/vim/symbols-outline-nvim.lua (100%) rename {config/nix/hm => hm}/zshrc.sh (100%) rename config/nix/options.nix => options.nix (79%) rename {config/nix/os => os}/battery.nix (100%) rename {config/nix/os => os}/common.nix (100%) rename {config/nix/os => os}/desktop.nix (100%) rename {config/nix/os => os}/geoffrey.nix (100%) rename {config/nix/os => os}/loader.nix (100%) rename {config/nix/os => os}/qwerty-fr-keypad.diff (100%) rename {config/nix/os => os}/wireless.nix (100%) rename {config/nix/os => os}/wireless/.gitignore (100%) rename {config/nix/os => os}/wireless/import.py (100%) rename config/nix/pindakaas.nix => pindakaas.nix (100%) rename {config/nix/scripts => scripts}/.bsh/bashrc (100%) rename {config/nix/scripts => scripts}/.bsh/bashrc_unsortable (100%) rename {config/nix/scripts => scripts}/.bsh/inputrc (100%) rename {config/nix/scripts => scripts}/.bsh/vimrc (100%) rename {config/nix/scripts => scripts}/.gitignore (100%) rename {config/nix/scripts => scripts}/archive (100%) rename {config/nix/scripts => scripts}/bsh (100%) rename {config/nix/scripts => scripts}/cached_pass (100%) rename {config/nix/scripts => scripts}/camera_name_date (100%) rename {config/nix/scripts => scripts}/cleandev (100%) rename {config/nix/scripts => scripts}/compressPictureMovies (100%) rename {config/nix/scripts => scripts}/crepuscule (100%) rename {config/nix/scripts => scripts}/docker-image-childs (100%) rename {config/nix/scripts => scripts}/docker-rm (100%) rename {config/nix/scripts => scripts}/dummy (100%) rename {config/nix/scripts => scripts}/emergency-clean (100%) rename {config/nix/scripts => scripts}/gitCheckoutModes (100%) rename {config/nix/scripts => scripts}/gitghost (100%) rename {config/nix/scripts => scripts}/jour (100%) rename {config/nix/scripts => scripts}/lestrte (100%) rename {config/nix/scripts => scripts}/letrtes (100%) rename {config/nix/scripts => scripts}/lip (100%) rename {config/nix/scripts => scripts}/lorem (100%) rename {config/nix/scripts => scripts}/mediaDuration (100%) rename {config/nix/scripts => scripts}/music_remove_dashes (100%) rename {config/nix/scripts => scripts}/nuit (100%) rename {config/nix/scripts => scripts}/o (100%) rename {config/nix/scripts => scripts}/optimize (100%) rename {config/nix/scripts => scripts}/overpdf (100%) rename {config/nix/scripts => scripts}/pdfpages (100%) rename {config/nix/scripts => scripts}/pdfrename (100%) rename {config/nix/scripts => scripts}/picture_name_date (100%) rename {config/nix/scripts => scripts}/pushToTalk (100%) rename {config/nix/scripts => scripts}/raw_move_precomp (100%) rename {config/nix/scripts => scripts}/rep (100%) rename {config/nix/scripts => scripts}/replayGain (100%) rename {config/nix/scripts => scripts}/rmf (100%) rename {config/nix/scripts => scripts}/rssVideos (100%) rename {config/nix/scripts => scripts}/smtpdummy (100%) rename {config/nix/scripts => scripts}/spongebob (100%) rename {config/nix/scripts => scripts}/syncthingRestore (100%) rename {config/nix/scripts => scripts}/tagCreatorPhotos (100%) rename {config/nix/scripts => scripts}/ter (100%) rename {config/nix/scripts => scripts}/unziptree (100%) rename {config/nix/scripts => scripts}/updateCompressedMusic (100%) rename {config/nix/scripts => scripts}/videoQuota (100%) rename {config/nix/scripts => scripts}/wttr (100%) rename {config/nix/unprocessed => unprocessed}/Zeal/Zeal.conf (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/.gitignore (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/README.md (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/ansible.cfg (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/group_vars/all (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/host_vars/gho.geoffrey.frogeye.fr (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/hosts (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/playbooks/default.yml (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/roles/dotfiles/handlers/main.yml (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/roles/dotfiles/tasks/main.yml (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/roles/extensions/tasks/main.yml (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/roles/extensions/templates/extrc.sh.j2 (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/roles/system/files/getty.service (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/roles/system/files/xorg/intel_backlight.conf (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/roles/system/files/xorg/joystick.conf (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/roles/system/handlers/main.yaml (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/roles/system/tasks/main.yml (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/roles/termux/tasks/main.yml (100%) rename {config/nix/unprocessed => unprocessed}/config/automatrop/roles/vdirsyncer/templates/config.j2 (100%) rename {config => unprocessed/config/autorandr}/.dfrecur (100%) rename {config/nix/unprocessed => unprocessed}/config/autorandr/bg (100%) rename {config/nix/unprocessed => unprocessed}/config/autorandr/postswitch (100%) rename {config/nix/unprocessed => unprocessed}/config/j4status/config (100%) rename {config/nix/unprocessed => unprocessed}/config/khal/config (100%) rename {config/nix/unprocessed => unprocessed}/config/khard/khard.conf (100%) rename {config/nix/unprocessed => unprocessed}/config/linuxColors.sh (100%) rename {config/nix/unprocessed => unprocessed}/config/offlineimap.py (100%) rename {config/nix/unprocessed => unprocessed}/config/optiSvgo.yml (100%) rename {config/nix/unprocessed => unprocessed}/config/polybar/bars.ini (100%) rename {config/nix/unprocessed => unprocessed}/config/polybar/bbswitch (100%) rename {config/nix/unprocessed => unprocessed}/config/polybar/config (100%) rename {config/nix/unprocessed => unprocessed}/config/polybar/config.ini (100%) rename {config/nix/unprocessed => unprocessed}/config/polybar/keystore (100%) rename {config/nix/unprocessed => unprocessed}/config/polybar/launch.sh (100%) rename {config/nix/unprocessed => unprocessed}/config/polybar/linuxmismatch (100%) rename {config/nix/unprocessed => unprocessed}/config/polybar/modules.ini (100%) rename {config/nix/unprocessed => unprocessed}/config/polybar/todo (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/adb_backup_extract (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/arch-kexec (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/cudarun (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/dafont (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/debloc (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/diapo (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/hc (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/hl (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/html2pdf (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/install-wsl (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/logstasync (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/machines (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/md2html (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/mel (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/melConf (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/musiqueBof (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/nv (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/package-lock.json (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/package.json (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/proxy (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/remcrlf (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/tunnel (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/tvshow (100%) rename {config/nix/unprocessed => unprocessed}/config/scripts/updatedate (100%) rename {config/nix/unprocessed => unprocessed}/config/systemd/user/.gitignore (100%) rename {config/nix/unprocessed => unprocessed}/config/systemd/user/ipfs.service (100%) rename {config/nix/unprocessed => unprocessed}/config/systemd/user/melfetch.service (100%) rename {config/nix/unprocessed => unprocessed}/config/systemd/user/melfetch.timer (100%) rename {config/nix/unprocessed => unprocessed}/config/systemd/user/urxvtd.service (100%) rename {config/nix/unprocessed => unprocessed}/config/systemd/user/urxvtd.socket (100%) rename {config/nix/unprocessed => unprocessed}/config/systemd/user/x0vncserver.service (100%) rename {config/nix/unprocessed => unprocessed}/config/todoman/todoman.conf (100%) rename {config/nix/unprocessed => unprocessed}/config/tridactyl/themes/.gitignore (100%) rename {config/nix/unprocessed => unprocessed}/config/tridactyl/tridactylrc (100%) rename {config/nix/unprocessed/config/autorandr => unprocessed/config/vdirsyncer}/.dfrecur (100%) rename {config/nix/unprocessed => unprocessed}/config/vdirsyncer/config (100%) rename {config/nix/unprocessed => unprocessed}/config/xinitrc (100%) rename {config/nix/unprocessed => unprocessed}/termux/.gitignore (100%) rename {config/nix/unprocessed => unprocessed}/termux/bin/.gitignore (100%) rename {config/nix/unprocessed => unprocessed}/termux/boot/autosvc (100%) rename {config/nix/unprocessed => unprocessed}/termux/boot/symlink (100%) rename {config/nix/unprocessed => unprocessed}/termux/font.ttf (100%) rename {config/nix/unprocessed => unprocessed}/termux/scripts/autosvc (100%) rename {config/nix/unprocessed => unprocessed}/termux/scripts/service (100%) rename {config/nix/unprocessed => unprocessed}/termux/scripts/sudo (100%) rename {config/nix/unprocessed => unprocessed}/termux/scripts/tsu.old (100%) rename {config/nix/unprocessed => unprocessed}/termux/scripts/yt (100%) rename {config/nix/unprocessed => unprocessed}/termux/services/autosvc (100%) rename {config/nix/unprocessed => unprocessed}/termux/services/crond (100%) rename {config/nix/unprocessed => unprocessed}/termux/services/sshd (100%) rename {config/nix/unprocessed => unprocessed}/termux/services/syncthing (100%) rename {config/nix/unprocessed => unprocessed}/termux/services/syncthing.user (100%) rename {config/nix/unprocessed => unprocessed}/termux/shell (100%) rename {config/nix/unprocessed => unprocessed}/xsession (100%) diff --git a/.gitignore b/.gitignore index bee8a64..ee0c388 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -__pycache__ +*.qcow2 +result diff --git a/config/nix/add_channels.sh b/add_channels.sh similarity index 100% rename from config/nix/add_channels.sh rename to add_channels.sh diff --git a/config/nix/build-vm.sh b/build-vm.sh similarity index 100% rename from config/nix/build-vm.sh rename to build-vm.sh diff --git a/config/nix/.gitignore b/config/nix/.gitignore deleted file mode 100644 index ee0c388..0000000 --- a/config/nix/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.qcow2 -result diff --git a/config/nix/unprocessed/config/vdirsyncer/.dfrecur b/config/nix/unprocessed/config/vdirsyncer/.dfrecur deleted file mode 100644 index e69de29..0000000 diff --git a/config/nix/curacao.nix b/curacao.nix similarity index 100% rename from config/nix/curacao.nix rename to curacao.nix diff --git a/config/nix/curacao_test.nix b/curacao_test.nix similarity index 100% rename from config/nix/curacao_test.nix rename to curacao_test.nix diff --git a/config/nix/hm/batteryNotify.sh b/hm/batteryNotify.sh similarity index 100% rename from config/nix/hm/batteryNotify.sh rename to hm/batteryNotify.sh diff --git a/config/nix/hm/common.nix b/hm/common.nix similarity index 99% rename from config/nix/hm/common.nix rename to hm/common.nix index 75ca5b2..2f9d0fa 100644 --- a/config/nix/hm/common.nix +++ b/hm/common.nix @@ -503,7 +503,7 @@ in sessionPath = [ "${config.home.homeDirectory}/.local/bin" "${config.home.sessionVariables.GOPATH}" - "${config.frogeye.dotfiles.path}/config/nix/scripts" + "${config.frogeye.dotfiles.path}/scripts" ]; file = { ".face" = { diff --git a/config/nix/hm/desktop.nix b/hm/desktop.nix similarity index 100% rename from config/nix/hm/desktop.nix rename to hm/desktop.nix diff --git a/config/nix/hm/dev.nix b/hm/dev.nix similarity index 100% rename from config/nix/hm/dev.nix rename to hm/dev.nix diff --git a/config/nix/hm/extra.nix b/hm/extra.nix similarity index 100% rename from config/nix/hm/extra.nix rename to hm/extra.nix diff --git a/config/nix/hm/face.svg b/hm/face.svg similarity index 100% rename from config/nix/hm/face.svg rename to hm/face.svg diff --git a/config/nix/hm/frobar/.dev/barng.py b/hm/frobar/.dev/barng.py similarity index 100% rename from config/nix/hm/frobar/.dev/barng.py rename to hm/frobar/.dev/barng.py diff --git a/config/nix/hm/frobar/.dev/oldbar.py b/hm/frobar/.dev/oldbar.py similarity index 100% rename from config/nix/hm/frobar/.dev/oldbar.py rename to hm/frobar/.dev/oldbar.py diff --git a/config/nix/hm/frobar/.dev/pip.py b/hm/frobar/.dev/pip.py similarity index 100% rename from config/nix/hm/frobar/.dev/pip.py rename to hm/frobar/.dev/pip.py diff --git a/config/nix/hm/frobar/.dev/x.py b/hm/frobar/.dev/x.py similarity index 100% rename from config/nix/hm/frobar/.dev/x.py rename to hm/frobar/.dev/x.py diff --git a/config/nix/hm/frobar/.gitignore b/hm/frobar/.gitignore similarity index 67% rename from config/nix/hm/frobar/.gitignore rename to hm/frobar/.gitignore index be91729..d9ae3ac 100644 --- a/config/nix/hm/frobar/.gitignore +++ b/hm/frobar/.gitignore @@ -1,2 +1,3 @@ dist/* frobar.egg-info/* +__pycache__ diff --git a/config/nix/hm/frobar/default.nix b/hm/frobar/default.nix similarity index 100% rename from config/nix/hm/frobar/default.nix rename to hm/frobar/default.nix diff --git a/config/nix/hm/frobar/frobar/__init__.py b/hm/frobar/frobar/__init__.py similarity index 100% rename from config/nix/hm/frobar/frobar/__init__.py rename to hm/frobar/frobar/__init__.py diff --git a/config/nix/hm/frobar/frobar/display.py b/hm/frobar/frobar/display.py similarity index 100% rename from config/nix/hm/frobar/frobar/display.py rename to hm/frobar/frobar/display.py diff --git a/config/nix/hm/frobar/frobar/notbusy.py b/hm/frobar/frobar/notbusy.py similarity index 100% rename from config/nix/hm/frobar/frobar/notbusy.py rename to hm/frobar/frobar/notbusy.py diff --git a/config/nix/hm/frobar/frobar/providers.py b/hm/frobar/frobar/providers.py similarity index 100% rename from config/nix/hm/frobar/frobar/providers.py rename to hm/frobar/frobar/providers.py diff --git a/config/nix/hm/frobar/frobar/updaters.py b/hm/frobar/frobar/updaters.py similarity index 100% rename from config/nix/hm/frobar/frobar/updaters.py rename to hm/frobar/frobar/updaters.py diff --git a/config/nix/hm/frobar/setup.py b/hm/frobar/setup.py similarity index 100% rename from config/nix/hm/frobar/setup.py rename to hm/frobar/setup.py diff --git a/config/nix/hm/inputrc b/hm/inputrc similarity index 100% rename from config/nix/hm/inputrc rename to hm/inputrc diff --git a/config/nix/hm/loader.nix b/hm/loader.nix similarity index 100% rename from config/nix/hm/loader.nix rename to hm/loader.nix diff --git a/config/nix/hm/pythonstartup.py b/hm/pythonstartup.py similarity index 100% rename from config/nix/hm/pythonstartup.py rename to hm/pythonstartup.py diff --git a/config/nix/hm/screenrc b/hm/screenrc similarity index 100% rename from config/nix/hm/screenrc rename to hm/screenrc diff --git a/config/nix/hm/style.nix b/hm/style.nix similarity index 100% rename from config/nix/hm/style.nix rename to hm/style.nix diff --git a/config/nix/hm/tmux.conf b/hm/tmux.conf similarity index 100% rename from config/nix/hm/tmux.conf rename to hm/tmux.conf diff --git a/config/nix/hm/vim.nix b/hm/vim.nix similarity index 100% rename from config/nix/hm/vim.nix rename to hm/vim.nix diff --git a/config/nix/hm/vim/feline.lua b/hm/vim/feline.lua similarity index 100% rename from config/nix/hm/vim/feline.lua rename to hm/vim/feline.lua diff --git a/config/nix/hm/vim/feline_test.vim b/hm/vim/feline_test.vim similarity index 100% rename from config/nix/hm/vim/feline_test.vim rename to hm/vim/feline_test.vim diff --git a/config/nix/hm/vim/lsp_signature-nvim.lua b/hm/vim/lsp_signature-nvim.lua similarity index 100% rename from config/nix/hm/vim/lsp_signature-nvim.lua rename to hm/vim/lsp_signature-nvim.lua diff --git a/config/nix/hm/vim/nvim-compe.lua b/hm/vim/nvim-compe.lua similarity index 100% rename from config/nix/hm/vim/nvim-compe.lua rename to hm/vim/nvim-compe.lua diff --git a/config/nix/hm/vim/nvim-ts-rainbow.lua b/hm/vim/nvim-ts-rainbow.lua similarity index 100% rename from config/nix/hm/vim/nvim-ts-rainbow.lua rename to hm/vim/nvim-ts-rainbow.lua diff --git a/config/nix/hm/vim/symbols-outline-nvim.lua b/hm/vim/symbols-outline-nvim.lua similarity index 100% rename from config/nix/hm/vim/symbols-outline-nvim.lua rename to hm/vim/symbols-outline-nvim.lua diff --git a/config/nix/hm/zshrc.sh b/hm/zshrc.sh similarity index 100% rename from config/nix/hm/zshrc.sh rename to hm/zshrc.sh diff --git a/config/nix/options.nix b/options.nix similarity index 79% rename from config/nix/options.nix rename to options.nix index e083890..1a2c67d 100644 --- a/config/nix/options.nix +++ b/options.nix @@ -16,8 +16,7 @@ dotfiles = { path = lib.mkOption { type = lib.types.str; - default = "${config.home.homeDirectory}/.dotfiles"; # FIXME I think we want it in ~/.config/dotfiles - # FIXME References to this use config/nix subfolder, which we might want to make root + default = "${config.home.homeDirectory}/.config/dotfiles"; }; }; }; diff --git a/config/nix/os/battery.nix b/os/battery.nix similarity index 100% rename from config/nix/os/battery.nix rename to os/battery.nix diff --git a/config/nix/os/common.nix b/os/common.nix similarity index 100% rename from config/nix/os/common.nix rename to os/common.nix diff --git a/config/nix/os/desktop.nix b/os/desktop.nix similarity index 100% rename from config/nix/os/desktop.nix rename to os/desktop.nix diff --git a/config/nix/os/geoffrey.nix b/os/geoffrey.nix similarity index 100% rename from config/nix/os/geoffrey.nix rename to os/geoffrey.nix diff --git a/config/nix/os/loader.nix b/os/loader.nix similarity index 100% rename from config/nix/os/loader.nix rename to os/loader.nix diff --git a/config/nix/os/qwerty-fr-keypad.diff b/os/qwerty-fr-keypad.diff similarity index 100% rename from config/nix/os/qwerty-fr-keypad.diff rename to os/qwerty-fr-keypad.diff diff --git a/config/nix/os/wireless.nix b/os/wireless.nix similarity index 100% rename from config/nix/os/wireless.nix rename to os/wireless.nix diff --git a/config/nix/os/wireless/.gitignore b/os/wireless/.gitignore similarity index 100% rename from config/nix/os/wireless/.gitignore rename to os/wireless/.gitignore diff --git a/config/nix/os/wireless/import.py b/os/wireless/import.py similarity index 100% rename from config/nix/os/wireless/import.py rename to os/wireless/import.py diff --git a/config/nix/pindakaas.nix b/pindakaas.nix similarity index 100% rename from config/nix/pindakaas.nix rename to pindakaas.nix diff --git a/config/nix/scripts/.bsh/bashrc b/scripts/.bsh/bashrc similarity index 100% rename from config/nix/scripts/.bsh/bashrc rename to scripts/.bsh/bashrc diff --git a/config/nix/scripts/.bsh/bashrc_unsortable b/scripts/.bsh/bashrc_unsortable similarity index 100% rename from config/nix/scripts/.bsh/bashrc_unsortable rename to scripts/.bsh/bashrc_unsortable diff --git a/config/nix/scripts/.bsh/inputrc b/scripts/.bsh/inputrc similarity index 100% rename from config/nix/scripts/.bsh/inputrc rename to scripts/.bsh/inputrc diff --git a/config/nix/scripts/.bsh/vimrc b/scripts/.bsh/vimrc similarity index 100% rename from config/nix/scripts/.bsh/vimrc rename to scripts/.bsh/vimrc diff --git a/config/nix/scripts/.gitignore b/scripts/.gitignore similarity index 100% rename from config/nix/scripts/.gitignore rename to scripts/.gitignore diff --git a/config/nix/scripts/archive b/scripts/archive similarity index 100% rename from config/nix/scripts/archive rename to scripts/archive diff --git a/config/nix/scripts/bsh b/scripts/bsh similarity index 100% rename from config/nix/scripts/bsh rename to scripts/bsh diff --git a/config/nix/scripts/cached_pass b/scripts/cached_pass similarity index 100% rename from config/nix/scripts/cached_pass rename to scripts/cached_pass diff --git a/config/nix/scripts/camera_name_date b/scripts/camera_name_date similarity index 100% rename from config/nix/scripts/camera_name_date rename to scripts/camera_name_date diff --git a/config/nix/scripts/cleandev b/scripts/cleandev similarity index 100% rename from config/nix/scripts/cleandev rename to scripts/cleandev diff --git a/config/nix/scripts/compressPictureMovies b/scripts/compressPictureMovies similarity index 100% rename from config/nix/scripts/compressPictureMovies rename to scripts/compressPictureMovies diff --git a/config/nix/scripts/crepuscule b/scripts/crepuscule similarity index 100% rename from config/nix/scripts/crepuscule rename to scripts/crepuscule diff --git a/config/nix/scripts/docker-image-childs b/scripts/docker-image-childs similarity index 100% rename from config/nix/scripts/docker-image-childs rename to scripts/docker-image-childs diff --git a/config/nix/scripts/docker-rm b/scripts/docker-rm similarity index 100% rename from config/nix/scripts/docker-rm rename to scripts/docker-rm diff --git a/config/nix/scripts/dummy b/scripts/dummy similarity index 100% rename from config/nix/scripts/dummy rename to scripts/dummy diff --git a/config/nix/scripts/emergency-clean b/scripts/emergency-clean similarity index 100% rename from config/nix/scripts/emergency-clean rename to scripts/emergency-clean diff --git a/config/nix/scripts/gitCheckoutModes b/scripts/gitCheckoutModes similarity index 100% rename from config/nix/scripts/gitCheckoutModes rename to scripts/gitCheckoutModes diff --git a/config/nix/scripts/gitghost b/scripts/gitghost similarity index 100% rename from config/nix/scripts/gitghost rename to scripts/gitghost diff --git a/config/nix/scripts/jour b/scripts/jour similarity index 100% rename from config/nix/scripts/jour rename to scripts/jour diff --git a/config/nix/scripts/lestrte b/scripts/lestrte similarity index 100% rename from config/nix/scripts/lestrte rename to scripts/lestrte diff --git a/config/nix/scripts/letrtes b/scripts/letrtes similarity index 100% rename from config/nix/scripts/letrtes rename to scripts/letrtes diff --git a/config/nix/scripts/lip b/scripts/lip similarity index 100% rename from config/nix/scripts/lip rename to scripts/lip diff --git a/config/nix/scripts/lorem b/scripts/lorem similarity index 100% rename from config/nix/scripts/lorem rename to scripts/lorem diff --git a/config/nix/scripts/mediaDuration b/scripts/mediaDuration similarity index 100% rename from config/nix/scripts/mediaDuration rename to scripts/mediaDuration diff --git a/config/nix/scripts/music_remove_dashes b/scripts/music_remove_dashes similarity index 100% rename from config/nix/scripts/music_remove_dashes rename to scripts/music_remove_dashes diff --git a/config/nix/scripts/nuit b/scripts/nuit similarity index 100% rename from config/nix/scripts/nuit rename to scripts/nuit diff --git a/config/nix/scripts/o b/scripts/o similarity index 100% rename from config/nix/scripts/o rename to scripts/o diff --git a/config/nix/scripts/optimize b/scripts/optimize similarity index 100% rename from config/nix/scripts/optimize rename to scripts/optimize diff --git a/config/nix/scripts/overpdf b/scripts/overpdf similarity index 100% rename from config/nix/scripts/overpdf rename to scripts/overpdf diff --git a/config/nix/scripts/pdfpages b/scripts/pdfpages similarity index 100% rename from config/nix/scripts/pdfpages rename to scripts/pdfpages diff --git a/config/nix/scripts/pdfrename b/scripts/pdfrename similarity index 100% rename from config/nix/scripts/pdfrename rename to scripts/pdfrename diff --git a/config/nix/scripts/picture_name_date b/scripts/picture_name_date similarity index 100% rename from config/nix/scripts/picture_name_date rename to scripts/picture_name_date diff --git a/config/nix/scripts/pushToTalk b/scripts/pushToTalk similarity index 100% rename from config/nix/scripts/pushToTalk rename to scripts/pushToTalk diff --git a/config/nix/scripts/raw_move_precomp b/scripts/raw_move_precomp similarity index 100% rename from config/nix/scripts/raw_move_precomp rename to scripts/raw_move_precomp diff --git a/config/nix/scripts/rep b/scripts/rep similarity index 100% rename from config/nix/scripts/rep rename to scripts/rep diff --git a/config/nix/scripts/replayGain b/scripts/replayGain similarity index 100% rename from config/nix/scripts/replayGain rename to scripts/replayGain diff --git a/config/nix/scripts/rmf b/scripts/rmf similarity index 100% rename from config/nix/scripts/rmf rename to scripts/rmf diff --git a/config/nix/scripts/rssVideos b/scripts/rssVideos similarity index 100% rename from config/nix/scripts/rssVideos rename to scripts/rssVideos diff --git a/config/nix/scripts/smtpdummy b/scripts/smtpdummy similarity index 100% rename from config/nix/scripts/smtpdummy rename to scripts/smtpdummy diff --git a/config/nix/scripts/spongebob b/scripts/spongebob similarity index 100% rename from config/nix/scripts/spongebob rename to scripts/spongebob diff --git a/config/nix/scripts/syncthingRestore b/scripts/syncthingRestore similarity index 100% rename from config/nix/scripts/syncthingRestore rename to scripts/syncthingRestore diff --git a/config/nix/scripts/tagCreatorPhotos b/scripts/tagCreatorPhotos similarity index 100% rename from config/nix/scripts/tagCreatorPhotos rename to scripts/tagCreatorPhotos diff --git a/config/nix/scripts/ter b/scripts/ter similarity index 100% rename from config/nix/scripts/ter rename to scripts/ter diff --git a/config/nix/scripts/unziptree b/scripts/unziptree similarity index 100% rename from config/nix/scripts/unziptree rename to scripts/unziptree diff --git a/config/nix/scripts/updateCompressedMusic b/scripts/updateCompressedMusic similarity index 100% rename from config/nix/scripts/updateCompressedMusic rename to scripts/updateCompressedMusic diff --git a/config/nix/scripts/videoQuota b/scripts/videoQuota similarity index 100% rename from config/nix/scripts/videoQuota rename to scripts/videoQuota diff --git a/config/nix/scripts/wttr b/scripts/wttr similarity index 100% rename from config/nix/scripts/wttr rename to scripts/wttr diff --git a/config/nix/unprocessed/Zeal/Zeal.conf b/unprocessed/Zeal/Zeal.conf similarity index 100% rename from config/nix/unprocessed/Zeal/Zeal.conf rename to unprocessed/Zeal/Zeal.conf diff --git a/config/nix/unprocessed/config/automatrop/.gitignore b/unprocessed/config/automatrop/.gitignore similarity index 100% rename from config/nix/unprocessed/config/automatrop/.gitignore rename to unprocessed/config/automatrop/.gitignore diff --git a/config/nix/unprocessed/config/automatrop/README.md b/unprocessed/config/automatrop/README.md similarity index 100% rename from config/nix/unprocessed/config/automatrop/README.md rename to unprocessed/config/automatrop/README.md diff --git a/config/nix/unprocessed/config/automatrop/ansible.cfg b/unprocessed/config/automatrop/ansible.cfg similarity index 100% rename from config/nix/unprocessed/config/automatrop/ansible.cfg rename to unprocessed/config/automatrop/ansible.cfg diff --git a/config/nix/unprocessed/config/automatrop/group_vars/all b/unprocessed/config/automatrop/group_vars/all similarity index 100% rename from config/nix/unprocessed/config/automatrop/group_vars/all rename to unprocessed/config/automatrop/group_vars/all diff --git a/config/nix/unprocessed/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr b/unprocessed/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr similarity index 100% rename from config/nix/unprocessed/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr rename to unprocessed/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr diff --git a/config/nix/unprocessed/config/automatrop/host_vars/gho.geoffrey.frogeye.fr b/unprocessed/config/automatrop/host_vars/gho.geoffrey.frogeye.fr similarity index 100% rename from config/nix/unprocessed/config/automatrop/host_vars/gho.geoffrey.frogeye.fr rename to unprocessed/config/automatrop/host_vars/gho.geoffrey.frogeye.fr diff --git a/config/nix/unprocessed/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr b/unprocessed/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr similarity index 100% rename from config/nix/unprocessed/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr rename to unprocessed/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr diff --git a/config/nix/unprocessed/config/automatrop/hosts b/unprocessed/config/automatrop/hosts similarity index 100% rename from config/nix/unprocessed/config/automatrop/hosts rename to unprocessed/config/automatrop/hosts diff --git a/config/nix/unprocessed/config/automatrop/playbooks/default.yml b/unprocessed/config/automatrop/playbooks/default.yml similarity index 100% rename from config/nix/unprocessed/config/automatrop/playbooks/default.yml rename to unprocessed/config/automatrop/playbooks/default.yml diff --git a/config/nix/unprocessed/config/automatrop/roles/dotfiles/handlers/main.yml b/unprocessed/config/automatrop/roles/dotfiles/handlers/main.yml similarity index 100% rename from config/nix/unprocessed/config/automatrop/roles/dotfiles/handlers/main.yml rename to unprocessed/config/automatrop/roles/dotfiles/handlers/main.yml diff --git a/config/nix/unprocessed/config/automatrop/roles/dotfiles/tasks/main.yml b/unprocessed/config/automatrop/roles/dotfiles/tasks/main.yml similarity index 100% rename from config/nix/unprocessed/config/automatrop/roles/dotfiles/tasks/main.yml rename to unprocessed/config/automatrop/roles/dotfiles/tasks/main.yml diff --git a/config/nix/unprocessed/config/automatrop/roles/extensions/tasks/main.yml b/unprocessed/config/automatrop/roles/extensions/tasks/main.yml similarity index 100% rename from config/nix/unprocessed/config/automatrop/roles/extensions/tasks/main.yml rename to unprocessed/config/automatrop/roles/extensions/tasks/main.yml diff --git a/config/nix/unprocessed/config/automatrop/roles/extensions/templates/extrc.sh.j2 b/unprocessed/config/automatrop/roles/extensions/templates/extrc.sh.j2 similarity index 100% rename from config/nix/unprocessed/config/automatrop/roles/extensions/templates/extrc.sh.j2 rename to unprocessed/config/automatrop/roles/extensions/templates/extrc.sh.j2 diff --git a/config/nix/unprocessed/config/automatrop/roles/system/files/getty.service b/unprocessed/config/automatrop/roles/system/files/getty.service similarity index 100% rename from config/nix/unprocessed/config/automatrop/roles/system/files/getty.service rename to unprocessed/config/automatrop/roles/system/files/getty.service diff --git a/config/nix/unprocessed/config/automatrop/roles/system/files/xorg/intel_backlight.conf b/unprocessed/config/automatrop/roles/system/files/xorg/intel_backlight.conf similarity index 100% rename from config/nix/unprocessed/config/automatrop/roles/system/files/xorg/intel_backlight.conf rename to unprocessed/config/automatrop/roles/system/files/xorg/intel_backlight.conf diff --git a/config/nix/unprocessed/config/automatrop/roles/system/files/xorg/joystick.conf b/unprocessed/config/automatrop/roles/system/files/xorg/joystick.conf similarity index 100% rename from config/nix/unprocessed/config/automatrop/roles/system/files/xorg/joystick.conf rename to unprocessed/config/automatrop/roles/system/files/xorg/joystick.conf diff --git a/config/nix/unprocessed/config/automatrop/roles/system/handlers/main.yaml b/unprocessed/config/automatrop/roles/system/handlers/main.yaml similarity index 100% rename from config/nix/unprocessed/config/automatrop/roles/system/handlers/main.yaml rename to unprocessed/config/automatrop/roles/system/handlers/main.yaml diff --git a/config/nix/unprocessed/config/automatrop/roles/system/tasks/main.yml b/unprocessed/config/automatrop/roles/system/tasks/main.yml similarity index 100% rename from config/nix/unprocessed/config/automatrop/roles/system/tasks/main.yml rename to unprocessed/config/automatrop/roles/system/tasks/main.yml diff --git a/config/nix/unprocessed/config/automatrop/roles/termux/tasks/main.yml b/unprocessed/config/automatrop/roles/termux/tasks/main.yml similarity index 100% rename from config/nix/unprocessed/config/automatrop/roles/termux/tasks/main.yml rename to unprocessed/config/automatrop/roles/termux/tasks/main.yml diff --git a/config/nix/unprocessed/config/automatrop/roles/vdirsyncer/templates/config.j2 b/unprocessed/config/automatrop/roles/vdirsyncer/templates/config.j2 similarity index 100% rename from config/nix/unprocessed/config/automatrop/roles/vdirsyncer/templates/config.j2 rename to unprocessed/config/automatrop/roles/vdirsyncer/templates/config.j2 diff --git a/config/.dfrecur b/unprocessed/config/autorandr/.dfrecur similarity index 100% rename from config/.dfrecur rename to unprocessed/config/autorandr/.dfrecur diff --git a/config/nix/unprocessed/config/autorandr/bg b/unprocessed/config/autorandr/bg similarity index 100% rename from config/nix/unprocessed/config/autorandr/bg rename to unprocessed/config/autorandr/bg diff --git a/config/nix/unprocessed/config/autorandr/postswitch b/unprocessed/config/autorandr/postswitch similarity index 100% rename from config/nix/unprocessed/config/autorandr/postswitch rename to unprocessed/config/autorandr/postswitch diff --git a/config/nix/unprocessed/config/j4status/config b/unprocessed/config/j4status/config similarity index 100% rename from config/nix/unprocessed/config/j4status/config rename to unprocessed/config/j4status/config diff --git a/config/nix/unprocessed/config/khal/config b/unprocessed/config/khal/config similarity index 100% rename from config/nix/unprocessed/config/khal/config rename to unprocessed/config/khal/config diff --git a/config/nix/unprocessed/config/khard/khard.conf b/unprocessed/config/khard/khard.conf similarity index 100% rename from config/nix/unprocessed/config/khard/khard.conf rename to unprocessed/config/khard/khard.conf diff --git a/config/nix/unprocessed/config/linuxColors.sh b/unprocessed/config/linuxColors.sh similarity index 100% rename from config/nix/unprocessed/config/linuxColors.sh rename to unprocessed/config/linuxColors.sh diff --git a/config/nix/unprocessed/config/offlineimap.py b/unprocessed/config/offlineimap.py similarity index 100% rename from config/nix/unprocessed/config/offlineimap.py rename to unprocessed/config/offlineimap.py diff --git a/config/nix/unprocessed/config/optiSvgo.yml b/unprocessed/config/optiSvgo.yml similarity index 100% rename from config/nix/unprocessed/config/optiSvgo.yml rename to unprocessed/config/optiSvgo.yml diff --git a/config/nix/unprocessed/config/polybar/bars.ini b/unprocessed/config/polybar/bars.ini similarity index 100% rename from config/nix/unprocessed/config/polybar/bars.ini rename to unprocessed/config/polybar/bars.ini diff --git a/config/nix/unprocessed/config/polybar/bbswitch b/unprocessed/config/polybar/bbswitch similarity index 100% rename from config/nix/unprocessed/config/polybar/bbswitch rename to unprocessed/config/polybar/bbswitch diff --git a/config/nix/unprocessed/config/polybar/config b/unprocessed/config/polybar/config similarity index 100% rename from config/nix/unprocessed/config/polybar/config rename to unprocessed/config/polybar/config diff --git a/config/nix/unprocessed/config/polybar/config.ini b/unprocessed/config/polybar/config.ini similarity index 100% rename from config/nix/unprocessed/config/polybar/config.ini rename to unprocessed/config/polybar/config.ini diff --git a/config/nix/unprocessed/config/polybar/keystore b/unprocessed/config/polybar/keystore similarity index 100% rename from config/nix/unprocessed/config/polybar/keystore rename to unprocessed/config/polybar/keystore diff --git a/config/nix/unprocessed/config/polybar/launch.sh b/unprocessed/config/polybar/launch.sh similarity index 100% rename from config/nix/unprocessed/config/polybar/launch.sh rename to unprocessed/config/polybar/launch.sh diff --git a/config/nix/unprocessed/config/polybar/linuxmismatch b/unprocessed/config/polybar/linuxmismatch similarity index 100% rename from config/nix/unprocessed/config/polybar/linuxmismatch rename to unprocessed/config/polybar/linuxmismatch diff --git a/config/nix/unprocessed/config/polybar/modules.ini b/unprocessed/config/polybar/modules.ini similarity index 100% rename from config/nix/unprocessed/config/polybar/modules.ini rename to unprocessed/config/polybar/modules.ini diff --git a/config/nix/unprocessed/config/polybar/todo b/unprocessed/config/polybar/todo similarity index 100% rename from config/nix/unprocessed/config/polybar/todo rename to unprocessed/config/polybar/todo diff --git a/config/nix/unprocessed/config/scripts/adb_backup_extract b/unprocessed/config/scripts/adb_backup_extract similarity index 100% rename from config/nix/unprocessed/config/scripts/adb_backup_extract rename to unprocessed/config/scripts/adb_backup_extract diff --git a/config/nix/unprocessed/config/scripts/arch-kexec b/unprocessed/config/scripts/arch-kexec similarity index 100% rename from config/nix/unprocessed/config/scripts/arch-kexec rename to unprocessed/config/scripts/arch-kexec diff --git a/config/nix/unprocessed/config/scripts/cudarun b/unprocessed/config/scripts/cudarun similarity index 100% rename from config/nix/unprocessed/config/scripts/cudarun rename to unprocessed/config/scripts/cudarun diff --git a/config/nix/unprocessed/config/scripts/dafont b/unprocessed/config/scripts/dafont similarity index 100% rename from config/nix/unprocessed/config/scripts/dafont rename to unprocessed/config/scripts/dafont diff --git a/config/nix/unprocessed/config/scripts/debloc b/unprocessed/config/scripts/debloc similarity index 100% rename from config/nix/unprocessed/config/scripts/debloc rename to unprocessed/config/scripts/debloc diff --git a/config/nix/unprocessed/config/scripts/diapo b/unprocessed/config/scripts/diapo similarity index 100% rename from config/nix/unprocessed/config/scripts/diapo rename to unprocessed/config/scripts/diapo diff --git a/config/nix/unprocessed/config/scripts/hc b/unprocessed/config/scripts/hc similarity index 100% rename from config/nix/unprocessed/config/scripts/hc rename to unprocessed/config/scripts/hc diff --git a/config/nix/unprocessed/config/scripts/hl b/unprocessed/config/scripts/hl similarity index 100% rename from config/nix/unprocessed/config/scripts/hl rename to unprocessed/config/scripts/hl diff --git a/config/nix/unprocessed/config/scripts/html2pdf b/unprocessed/config/scripts/html2pdf similarity index 100% rename from config/nix/unprocessed/config/scripts/html2pdf rename to unprocessed/config/scripts/html2pdf diff --git a/config/nix/unprocessed/config/scripts/install-wsl b/unprocessed/config/scripts/install-wsl similarity index 100% rename from config/nix/unprocessed/config/scripts/install-wsl rename to unprocessed/config/scripts/install-wsl diff --git a/config/nix/unprocessed/config/scripts/logstasync b/unprocessed/config/scripts/logstasync similarity index 100% rename from config/nix/unprocessed/config/scripts/logstasync rename to unprocessed/config/scripts/logstasync diff --git a/config/nix/unprocessed/config/scripts/machines b/unprocessed/config/scripts/machines similarity index 100% rename from config/nix/unprocessed/config/scripts/machines rename to unprocessed/config/scripts/machines diff --git a/config/nix/unprocessed/config/scripts/md2html b/unprocessed/config/scripts/md2html similarity index 100% rename from config/nix/unprocessed/config/scripts/md2html rename to unprocessed/config/scripts/md2html diff --git a/config/nix/unprocessed/config/scripts/mel b/unprocessed/config/scripts/mel similarity index 100% rename from config/nix/unprocessed/config/scripts/mel rename to unprocessed/config/scripts/mel diff --git a/config/nix/unprocessed/config/scripts/melConf b/unprocessed/config/scripts/melConf similarity index 100% rename from config/nix/unprocessed/config/scripts/melConf rename to unprocessed/config/scripts/melConf diff --git a/config/nix/unprocessed/config/scripts/musiqueBof b/unprocessed/config/scripts/musiqueBof similarity index 100% rename from config/nix/unprocessed/config/scripts/musiqueBof rename to unprocessed/config/scripts/musiqueBof diff --git a/config/nix/unprocessed/config/scripts/nv b/unprocessed/config/scripts/nv similarity index 100% rename from config/nix/unprocessed/config/scripts/nv rename to unprocessed/config/scripts/nv diff --git a/config/nix/unprocessed/config/scripts/package-lock.json b/unprocessed/config/scripts/package-lock.json similarity index 100% rename from config/nix/unprocessed/config/scripts/package-lock.json rename to unprocessed/config/scripts/package-lock.json diff --git a/config/nix/unprocessed/config/scripts/package.json b/unprocessed/config/scripts/package.json similarity index 100% rename from config/nix/unprocessed/config/scripts/package.json rename to unprocessed/config/scripts/package.json diff --git a/config/nix/unprocessed/config/scripts/proxy b/unprocessed/config/scripts/proxy similarity index 100% rename from config/nix/unprocessed/config/scripts/proxy rename to unprocessed/config/scripts/proxy diff --git a/config/nix/unprocessed/config/scripts/remcrlf b/unprocessed/config/scripts/remcrlf similarity index 100% rename from config/nix/unprocessed/config/scripts/remcrlf rename to unprocessed/config/scripts/remcrlf diff --git a/config/nix/unprocessed/config/scripts/tunnel b/unprocessed/config/scripts/tunnel similarity index 100% rename from config/nix/unprocessed/config/scripts/tunnel rename to unprocessed/config/scripts/tunnel diff --git a/config/nix/unprocessed/config/scripts/tvshow b/unprocessed/config/scripts/tvshow similarity index 100% rename from config/nix/unprocessed/config/scripts/tvshow rename to unprocessed/config/scripts/tvshow diff --git a/config/nix/unprocessed/config/scripts/updatedate b/unprocessed/config/scripts/updatedate similarity index 100% rename from config/nix/unprocessed/config/scripts/updatedate rename to unprocessed/config/scripts/updatedate diff --git a/config/nix/unprocessed/config/systemd/user/.gitignore b/unprocessed/config/systemd/user/.gitignore similarity index 100% rename from config/nix/unprocessed/config/systemd/user/.gitignore rename to unprocessed/config/systemd/user/.gitignore diff --git a/config/nix/unprocessed/config/systemd/user/ipfs.service b/unprocessed/config/systemd/user/ipfs.service similarity index 100% rename from config/nix/unprocessed/config/systemd/user/ipfs.service rename to unprocessed/config/systemd/user/ipfs.service diff --git a/config/nix/unprocessed/config/systemd/user/melfetch.service b/unprocessed/config/systemd/user/melfetch.service similarity index 100% rename from config/nix/unprocessed/config/systemd/user/melfetch.service rename to unprocessed/config/systemd/user/melfetch.service diff --git a/config/nix/unprocessed/config/systemd/user/melfetch.timer b/unprocessed/config/systemd/user/melfetch.timer similarity index 100% rename from config/nix/unprocessed/config/systemd/user/melfetch.timer rename to unprocessed/config/systemd/user/melfetch.timer diff --git a/config/nix/unprocessed/config/systemd/user/urxvtd.service b/unprocessed/config/systemd/user/urxvtd.service similarity index 100% rename from config/nix/unprocessed/config/systemd/user/urxvtd.service rename to unprocessed/config/systemd/user/urxvtd.service diff --git a/config/nix/unprocessed/config/systemd/user/urxvtd.socket b/unprocessed/config/systemd/user/urxvtd.socket similarity index 100% rename from config/nix/unprocessed/config/systemd/user/urxvtd.socket rename to unprocessed/config/systemd/user/urxvtd.socket diff --git a/config/nix/unprocessed/config/systemd/user/x0vncserver.service b/unprocessed/config/systemd/user/x0vncserver.service similarity index 100% rename from config/nix/unprocessed/config/systemd/user/x0vncserver.service rename to unprocessed/config/systemd/user/x0vncserver.service diff --git a/config/nix/unprocessed/config/todoman/todoman.conf b/unprocessed/config/todoman/todoman.conf similarity index 100% rename from config/nix/unprocessed/config/todoman/todoman.conf rename to unprocessed/config/todoman/todoman.conf diff --git a/config/nix/unprocessed/config/tridactyl/themes/.gitignore b/unprocessed/config/tridactyl/themes/.gitignore similarity index 100% rename from config/nix/unprocessed/config/tridactyl/themes/.gitignore rename to unprocessed/config/tridactyl/themes/.gitignore diff --git a/config/nix/unprocessed/config/tridactyl/tridactylrc b/unprocessed/config/tridactyl/tridactylrc similarity index 100% rename from config/nix/unprocessed/config/tridactyl/tridactylrc rename to unprocessed/config/tridactyl/tridactylrc diff --git a/config/nix/unprocessed/config/autorandr/.dfrecur b/unprocessed/config/vdirsyncer/.dfrecur similarity index 100% rename from config/nix/unprocessed/config/autorandr/.dfrecur rename to unprocessed/config/vdirsyncer/.dfrecur diff --git a/config/nix/unprocessed/config/vdirsyncer/config b/unprocessed/config/vdirsyncer/config similarity index 100% rename from config/nix/unprocessed/config/vdirsyncer/config rename to unprocessed/config/vdirsyncer/config diff --git a/config/nix/unprocessed/config/xinitrc b/unprocessed/config/xinitrc similarity index 100% rename from config/nix/unprocessed/config/xinitrc rename to unprocessed/config/xinitrc diff --git a/config/nix/unprocessed/termux/.gitignore b/unprocessed/termux/.gitignore similarity index 100% rename from config/nix/unprocessed/termux/.gitignore rename to unprocessed/termux/.gitignore diff --git a/config/nix/unprocessed/termux/bin/.gitignore b/unprocessed/termux/bin/.gitignore similarity index 100% rename from config/nix/unprocessed/termux/bin/.gitignore rename to unprocessed/termux/bin/.gitignore diff --git a/config/nix/unprocessed/termux/boot/autosvc b/unprocessed/termux/boot/autosvc similarity index 100% rename from config/nix/unprocessed/termux/boot/autosvc rename to unprocessed/termux/boot/autosvc diff --git a/config/nix/unprocessed/termux/boot/symlink b/unprocessed/termux/boot/symlink similarity index 100% rename from config/nix/unprocessed/termux/boot/symlink rename to unprocessed/termux/boot/symlink diff --git a/config/nix/unprocessed/termux/font.ttf b/unprocessed/termux/font.ttf similarity index 100% rename from config/nix/unprocessed/termux/font.ttf rename to unprocessed/termux/font.ttf diff --git a/config/nix/unprocessed/termux/scripts/autosvc b/unprocessed/termux/scripts/autosvc similarity index 100% rename from config/nix/unprocessed/termux/scripts/autosvc rename to unprocessed/termux/scripts/autosvc diff --git a/config/nix/unprocessed/termux/scripts/service b/unprocessed/termux/scripts/service similarity index 100% rename from config/nix/unprocessed/termux/scripts/service rename to unprocessed/termux/scripts/service diff --git a/config/nix/unprocessed/termux/scripts/sudo b/unprocessed/termux/scripts/sudo similarity index 100% rename from config/nix/unprocessed/termux/scripts/sudo rename to unprocessed/termux/scripts/sudo diff --git a/config/nix/unprocessed/termux/scripts/tsu.old b/unprocessed/termux/scripts/tsu.old similarity index 100% rename from config/nix/unprocessed/termux/scripts/tsu.old rename to unprocessed/termux/scripts/tsu.old diff --git a/config/nix/unprocessed/termux/scripts/yt b/unprocessed/termux/scripts/yt similarity index 100% rename from config/nix/unprocessed/termux/scripts/yt rename to unprocessed/termux/scripts/yt diff --git a/config/nix/unprocessed/termux/services/autosvc b/unprocessed/termux/services/autosvc similarity index 100% rename from config/nix/unprocessed/termux/services/autosvc rename to unprocessed/termux/services/autosvc diff --git a/config/nix/unprocessed/termux/services/crond b/unprocessed/termux/services/crond similarity index 100% rename from config/nix/unprocessed/termux/services/crond rename to unprocessed/termux/services/crond diff --git a/config/nix/unprocessed/termux/services/sshd b/unprocessed/termux/services/sshd similarity index 100% rename from config/nix/unprocessed/termux/services/sshd rename to unprocessed/termux/services/sshd diff --git a/config/nix/unprocessed/termux/services/syncthing b/unprocessed/termux/services/syncthing similarity index 100% rename from config/nix/unprocessed/termux/services/syncthing rename to unprocessed/termux/services/syncthing diff --git a/config/nix/unprocessed/termux/services/syncthing.user b/unprocessed/termux/services/syncthing.user similarity index 100% rename from config/nix/unprocessed/termux/services/syncthing.user rename to unprocessed/termux/services/syncthing.user diff --git a/config/nix/unprocessed/termux/shell b/unprocessed/termux/shell similarity index 100% rename from config/nix/unprocessed/termux/shell rename to unprocessed/termux/shell diff --git a/config/nix/unprocessed/xsession b/unprocessed/xsession similarity index 100% rename from config/nix/unprocessed/xsession rename to unprocessed/xsession From 8cd906e6a27ced187a11dbb26966cb5c1454aec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 27 Nov 2023 00:02:12 +0100 Subject: [PATCH 072/108] Remove .gitmodules --- .gitmodules | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index bd1e309..0000000 --- a/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "config/automatrop/roles/mnussbaum.base16-builder-ansible"] - path = config/automatrop/roles/mnussbaum.base16-builder-ansible - url = https://github.com/GeoffreyFrogeye/base16-builder-ansible.git -[submodule "config/automatrop/plugins/modules/aur"] - path = config/automatrop/plugins/modules/aur - url = https://github.com/kewlfft/ansible-aur.git -[submodule "config/automatrop/plugins/modules/gpg_key"] - path = config/automatrop/plugins/modules/gpg_key - url = https://github.com/netson/ansible-gpg-key.git From 76003a686c96deee6decd24200fb97f1f5f3f897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 27 Nov 2023 00:13:11 +0100 Subject: [PATCH 073/108] frobar: Remove outdated comment --- hm/frobar/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/hm/frobar/default.nix b/hm/frobar/default.nix index e7a3f12..5bbfa92 100644 --- a/hm/frobar/default.nix +++ b/hm/frobar/default.nix @@ -32,6 +32,5 @@ let }; in frobar_launcher -# FIXME Doesn't kill the old bar # FIXME Not using Nerdfont # TODO Connection with i3 is lost sometimes, more often than with Arch? From b626cb89f4dfccd499dcb929e0781c7b91ae454a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 27 Nov 2023 18:01:20 +0100 Subject: [PATCH 074/108] hm: Various fixes --- hm/common.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hm/common.nix b/hm/common.nix index 2f9d0fa..d429363 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -26,7 +26,7 @@ in # Colored ls # TODO Doesn't allow completion. Check out lsd instead _colored_ls() { - \ls -lh --color=always $@ | awk ' + ${pkgs.coreutils}/bin/ls -lh --color=always $@ | ${pkgs.gnuawk}/bin/awk ' BEGIN { FPAT = "([[:space:]]*[^[:space:]]+)"; OFS = ""; @@ -475,7 +475,7 @@ in ]; sessionVariables = { # Favourite commands - PAGER = "${pkgs.coreutils}/bin/less"; + PAGER = "${pkgs.less}/bin/less"; EDITOR = "${pkgs.neovim}/bin/nvim"; # Extra config From bae9c4c524fa18d90f39034d7eebf751a72b9351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 28 Nov 2023 00:30:52 +0100 Subject: [PATCH 075/108] hm: Fix fix --- hm/common.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hm/common.nix b/hm/common.nix index d429363..c958b61 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -26,7 +26,7 @@ in # Colored ls # TODO Doesn't allow completion. Check out lsd instead _colored_ls() { - ${pkgs.coreutils}/bin/ls -lh --color=always $@ | ${pkgs.gnuawk}/bin/awk ' + ${pkgs.coreutils}/bin/ls -lh --color=always $@ | ${pkgs.gawk}/bin/awk ' BEGIN { FPAT = "([[:space:]]*[^[:space:]]+)"; OFS = ""; From 7e49ed2e1943d5e465c0ea8cdd75e766cf58b534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 28 Nov 2023 00:33:03 +0100 Subject: [PATCH 076/108] Reduce number of channels used This was a fix attempt before I discovered that the issue was that nixos-install uses the root user's channels. Doesn't hurt anyways. --- add_channels.sh | 3 +-- curacao.nix | 2 +- os/geoffrey.nix | 2 +- os/loader.nix | 1 + pindakaas.nix | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/add_channels.sh b/add_channels.sh index aea4785..86094df 100755 --- a/add_channels.sh +++ b/add_channels.sh @@ -3,7 +3,6 @@ # TODO Surely there's more elegant? nix-channel --add https://nixos.org/channels/nixos-23.05 nixpkgs +# Below probably only needed on non-NixOS nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager -# First commit before 23.05 release date: -nix-channel --add https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz nixos-hardware nix-channel --update diff --git a/curacao.nix b/curacao.nix index 9285531..e02df95 100644 --- a/curacao.nix +++ b/curacao.nix @@ -1,7 +1,7 @@ { ... }: { imports = [ - + "${builtins.fetchTarball "https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz"}/dell/g3/3779" ./os/loader.nix ]; diff --git a/os/geoffrey.nix b/os/geoffrey.nix index 5f5eb56..38c642b 100644 --- a/os/geoffrey.nix +++ b/os/geoffrey.nix @@ -1,7 +1,7 @@ { pkgs, config, ... }: { imports = [ - + "${builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz"}/nixos" ]; users.users.geoffrey = { diff --git a/os/loader.nix b/os/loader.nix index cf9d18a..c60ff95 100644 --- a/os/loader.nix +++ b/os/loader.nix @@ -7,5 +7,6 @@ ./common.nix ./desktop.nix ./wireless.nix + "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22.tar.gz"}/module.nix" ]; } diff --git a/pindakaas.nix b/pindakaas.nix index 7fbef93..08da534 100644 --- a/pindakaas.nix +++ b/pindakaas.nix @@ -1,7 +1,8 @@ { pkgs, config, ... }: { imports = [ - + # First commit before 23.05 release date: + "${builtins.fetchTarball "https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz"}/pine64/pinebook-pro" ./os/loader.nix ]; # nixos-hardware use latest kernel by default. This obviously runs quickly out of sync with zfs packages. From dd6f579f74df7209c1d94bb0dba46c19b5e3d572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 28 Nov 2023 00:34:30 +0100 Subject: [PATCH 077/108] Booting pindakaas on SD card --- build-pindakaas-disk.sh | 71 +++++++++++++++++++++++++++++++++++++ curacao.nix | 2 ++ options.nix | 4 ++- os/common.nix | 5 +-- os/geoffrey.nix | 1 + pindakaas.nix | 32 ++++++++++++++--- pindakaas_disko.nix | 78 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 185 insertions(+), 8 deletions(-) create mode 100755 build-pindakaas-disk.sh create mode 100644 pindakaas_disko.nix diff --git a/build-pindakaas-disk.sh b/build-pindakaas-disk.sh new file mode 100755 index 0000000..4c0a658 --- /dev/null +++ b/build-pindakaas-disk.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash +#! nix-shell -p bash nixos-install-tools + +set -euo pipefail + +# Parse arguments +function help { + echo "Usage: $0 -e" + echo + echo "Options:" + echo " -h: Display this help message." + echo " -e: Erase the disk. This can be used in case the wanted partition scheme doesn't match." +} + +disko_mode=mount +while getopts "e" OPTION +do + case "$OPTION" in + h) + help + exit 0 + ;; + e) + disko_mode=disko + ;; + ?) + help + exit 2 + ;; + esac +done +shift "$(($OPTIND -1))" + +if [ "$#" -gt 0 ] +then + help + exit 2 +fi + +set -x + +# Add channels to root user, as nixos-install uses those. +# Not great, but fixable with flakes I guess +sudo ./add_channels.sh + +# Format or mount disk +sudo nix --extra-experimental-features nix-command --extra-experimental-features flakes run github:nix-community/disko -- --mode $disko_mode ./pindakaas_disko.nix + +# Generate hardware-config.nix +sudo nixos-generate-config --no-filesystems --root /mnt +# --no-filesystems because they are imported via disko + +# Plug system configuration into this git repo +sudo mkdir -p /mnt/etc/nixos +echo "{ ... }: { imports = [ ./hardware-configuration.nix /home/geoffrey/.config/dotfiles/pindakaas.nix ]; }" | sudo tee /mnt/etc/nixos/configuration.nix > /dev/null +# Everything there should be covered by (and conflicts with) the repo anyways. + +# Install NixOS! Or create a new generation. +sudo nixos-install + +# Install dotfiles. Actually not needed by nixos-install since it doesn't rewrite global paths to /mnt. +# Without it no nixos-rebuild from the system itself once installed though. +# Should probably be replaced with something like git-sync +# sudo mkdir -p /mnt/home/geoffrey/.config/ +# sudo cp -a ../dotfiles /mnt/home/geoffrey/.config/ +# sudo chown geoffrey:geoffrey /mnt/home/geoffrey -R + +# Signal we're done! +# Although it might ask for passwords beforehand, so not sure it's really useful +echo  diff --git a/curacao.nix b/curacao.nix index e02df95..1344c11 100644 --- a/curacao.nix +++ b/curacao.nix @@ -5,6 +5,8 @@ ./os/loader.nix ]; + boot.loader.efi.canTouchEfiVariables = true; + networking.hostName = "curacao"; frogeye.extra = true; frogeye.desktop.xorg = true; diff --git a/options.nix b/options.nix index 1a2c67d..3ce3b36 100644 --- a/options.nix +++ b/options.nix @@ -16,7 +16,9 @@ dotfiles = { path = lib.mkOption { type = lib.types.str; - default = "${config.home.homeDirectory}/.config/dotfiles"; + # default = "${config.home.homeDirectory}/.config/dotfiles"; + # FIXME Above doesn't work outside home-manager context + default = "/home/geoffrey/.config/dotfiles"; }; }; }; diff --git a/os/common.nix b/os/common.nix index 727eebd..b65873b 100644 --- a/os/common.nix +++ b/os/common.nix @@ -2,10 +2,11 @@ { networking.domain = "geoffrey.frogeye.fr"; - boot.loader.efi.canTouchEfiVariables = true; - time.timeZone = "Europe/Amsterdam"; + # Might fill emptiness? + boot.consoleLogLevel = 6; # KERN_INFO + # TODO qwerty-fr for console # Enable CUPS to print documents diff --git a/os/geoffrey.nix b/os/geoffrey.nix index 38c642b..1597880 100644 --- a/os/geoffrey.nix +++ b/os/geoffrey.nix @@ -9,6 +9,7 @@ extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. shell = pkgs.zsh; + initialHashedPassword = "$y$j9T$e64bjL7iyVlniEKwKbM9g0$cCn74za0r6L9QMO20Fdxz3/SX0yvhz3Xd6.2BhtbRL1"; # Not a real password openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE41gxrO8oZ5n3saapSwZDViOQphm6RzqgsBUyA88pU geoffrey@frogeye.fr" ]; diff --git a/pindakaas.nix b/pindakaas.nix index 08da534..d52901c 100644 --- a/pindakaas.nix +++ b/pindakaas.nix @@ -4,13 +4,35 @@ # First commit before 23.05 release date: "${builtins.fetchTarball "https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz"}/pine64/pinebook-pro" ./os/loader.nix + ./pindakaas_disko.nix ]; - # nixos-hardware use latest kernel by default. This obviously runs quickly out of sync with zfs packages. - boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; + boot = { + # nixos-hardware use latest kernel by default. It has been set a while ago, we maybe don't need it anymore? + kernelPackages = pkgs.linuxPackages; + + # Pinebook supports UEFI, at least when tow-boot is installed on the SPI + loader = { + # EFI Variables don't work (no generation appears in systemd-boot) + efi.canTouchEfiVariables = false; + + # systemd-boot crashes after booting, so GRUB it is + grub = { + enable = true; + efiSupport = true; + efiInstallAsRemovable = true; + device = "nodev"; + }; + }; + }; + networking.hostName = "pindakaas"; - frogeye.extra = false; # FIXME Not working yet - frogeye.desktop.xorg = true; - frogeye.dev.docker = true; + # DEBUG Barebones is faster + frogeye.dev.ansible = false; + frogeye.dev.python = false; + + # frogeye.extra = false; # FIXME Not working yet + # frogeye.desktop.xorg = true; + # frogeye.dev.docker = true; } diff --git a/pindakaas_disko.nix b/pindakaas_disko.nix new file mode 100644 index 0000000..bd93cc7 --- /dev/null +++ b/pindakaas_disko.nix @@ -0,0 +1,78 @@ +{ + disko.devices = { + disk = { + pindakaas_sd = { + type = "disk"; + device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99"; + content = { + type = "gpt"; + partitions = { + ESP = { + # Needs enough to store multiple kernel generations + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + # FIXME Hang on Linux boot, for some reason + # luks = { + # size = "100%"; + # content = { + # type = "luks"; + # name = "pindakaas_sd"; + # # disable settings.keyFile if you want to use interactive password entry + # #passwordFile = "/tmp/secret.key"; # Interactive + # settings = { + # # Not having SSDs die fast is more important than crypto + # # nerds that could potentially discover which filesystem I + # # use from TRIM patterns + # allowDiscards = true; + # # keyFile = "/tmp/secret.key"; + # fallbackToPassword = true; # TEST + # }; + # # additionalKeyFiles = [ "/tmp/additionalSecret.key" ]; + # content = { + # type = "btrfs"; + # extraArgs = [ "-f" ]; + # subvolumes = { + # "/nixos" = { + # mountpoint = "/"; + # mountOptions = [ "compress=zstd" "noatime" ]; + # }; + # "/home" = { + # mountpoint = "/home"; + # mountOptions = [ "compress=zstd" "relatime" ]; + # }; + # "/nix" = { + # mountpoint = "/nix"; + # mountOptions = [ "compress=zstd" "noatime" ]; + # }; + # # Maybe later + # # "/swap" = { + # # mountpoint = "/.swapvol"; + # # swap.swapfile.size = "20M"; + # # }; + # }; + # }; + # }; + # }; + }; + }; + }; + }; + }; +} From 6444f8f517dc8ae02fadd064de13b4b436901a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 28 Nov 2023 20:53:18 +0100 Subject: [PATCH 078/108] Reorganize configuration root While I might still bikeshed how the rest of the configuration is sourced, at least the import points should be stable. --- build-vm.sh | 21 ----------- curacao.nix | 14 ------- curacao/hardware.nix | 8 ++++ curacao/options.nix | 10 +++++ curacao/os.nix | 11 ++++++ curacao_test.nix | 18 --------- curacao_test/hm.nix | 12 ++++++ hm/{loader.nix => default.nix} | 0 build-pindakaas-disk.sh => install_os.sh | 37 +++++++++++++++---- os/{loader.nix => default.nix} | 0 os/geoffrey.nix | 2 +- pindakaas.nix => pindakaas/hardware.nix | 13 +------ pindakaas/options.nix | 6 +++ pindakaas/os.nix | 11 ++++++ pindakaas_disko.nix => pindakaas_sd/disko.nix | 31 ++++++++++++++-- pindakaas_sd/options.nix | 6 +++ pindakaas_sd/os.nix | 11 ++++++ .gitignore => vm/.gitignore | 0 vm/build.sh | 11 ++++++ vm/options.nix | 14 +++++++ vm/os.nix | 10 +++++ 21 files changed, 169 insertions(+), 77 deletions(-) delete mode 100755 build-vm.sh delete mode 100644 curacao.nix create mode 100644 curacao/hardware.nix create mode 100644 curacao/options.nix create mode 100644 curacao/os.nix delete mode 100644 curacao_test.nix create mode 100644 curacao_test/hm.nix rename hm/{loader.nix => default.nix} (100%) rename build-pindakaas-disk.sh => install_os.sh (67%) rename os/{loader.nix => default.nix} (100%) rename pindakaas.nix => pindakaas/hardware.nix (73%) create mode 100644 pindakaas/options.nix create mode 100644 pindakaas/os.nix rename pindakaas_disko.nix => pindakaas_sd/disko.nix (72%) create mode 100644 pindakaas_sd/options.nix create mode 100644 pindakaas_sd/os.nix rename .gitignore => vm/.gitignore (100%) create mode 100755 vm/build.sh create mode 100644 vm/options.nix create mode 100644 vm/os.nix diff --git a/build-vm.sh b/build-vm.sh deleted file mode 100755 index 4cb07b0..0000000 --- a/build-vm.sh +++ /dev/null @@ -1,21 +0,0 @@ -#/usr/bin/env sh - -# Build a NixOS VM for testing -# -# For x86_64 hosts: use curacao config -# For aarch64 hosts: use pindakaas config - -if ! command -v nom-build -then - exec nix-shell -p nix-output-monitor --run $0 -fi - -if [ "$(uname -m)" == "x86_64" ] -then - config=./curacao.nix -elif [ "$(uname -m)" == "aarch64" ] -then - config=./pindakaas.nix -fi -nom-build '' -A vm \ - -I nixos-config=${config} diff --git a/curacao.nix b/curacao.nix deleted file mode 100644 index 1344c11..0000000 --- a/curacao.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ ... }: -{ - imports = [ - "${builtins.fetchTarball "https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz"}/dell/g3/3779" - ./os/loader.nix - ]; - - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "curacao"; - frogeye.extra = true; - frogeye.desktop.xorg = true; - frogeye.dev.docker = true; -} diff --git a/curacao/hardware.nix b/curacao/hardware.nix new file mode 100644 index 0000000..b7e23b5 --- /dev/null +++ b/curacao/hardware.nix @@ -0,0 +1,8 @@ +{ lib, ... }: +{ + imports = [ + "${builtins.fetchTarball "https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz"}/dell/g3/3779" + ]; + + boot.loader.efi.canTouchEfiVariables = lib.mkDefault true; +} diff --git a/curacao/options.nix b/curacao/options.nix new file mode 100644 index 0000000..0fcf285 --- /dev/null +++ b/curacao/options.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + frogeye = { + desktop.xorg = true; + dev = { + docker = true; + }; + extra = true; + }; +} diff --git a/curacao/os.nix b/curacao/os.nix new file mode 100644 index 0000000..fd60a8c --- /dev/null +++ b/curacao/os.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + imports = [ + ../os + ./options.nix + ./hardware.nix + ./disko.nix + ]; + + networking.hostName = "curacao"; +} diff --git a/curacao_test.nix b/curacao_test.nix deleted file mode 100644 index 485bb16..0000000 --- a/curacao_test.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ ... }: -{ - imports = [ - ./hm/loader.nix - ]; - - home.username = "gnix"; - home.homeDirectory = "/home/gnix"; - - frogeye.extra = true; - frogeye.desktop.xorg = true; - frogeye.desktop.nixGLIntel = true; - frogeye.dev.ansible = true; - frogeye.dev.c = true; - frogeye.dev.docker = true; - frogeye.dev.fpga = true; - frogeye.dev.python = true; -} diff --git a/curacao_test/hm.nix b/curacao_test/hm.nix new file mode 100644 index 0000000..b6f615d --- /dev/null +++ b/curacao_test/hm.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + imports = [ + ../hm + ../curacao/options.nix + ]; + + home.username = "gnix"; + home.homeDirectory = "/home/gnix"; + + frogeye.desktop.nixGLIntel = true; +} diff --git a/hm/loader.nix b/hm/default.nix similarity index 100% rename from hm/loader.nix rename to hm/default.nix diff --git a/build-pindakaas-disk.sh b/install_os.sh similarity index 67% rename from build-pindakaas-disk.sh rename to install_os.sh index 4c0a658..cf9a66c 100755 --- a/build-pindakaas-disk.sh +++ b/install_os.sh @@ -3,10 +3,14 @@ #! nix-shell -p bash nixos-install-tools set -euo pipefail +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # Parse arguments function help { - echo "Usage: $0 -e" + echo "Usage: $0 profile [-e]" + echo + echo "Arguments:" + echo " file: OS/disk profile to use" echo echo "Options:" echo " -h: Display this help message." @@ -32,11 +36,31 @@ do done shift "$(($OPTIND -1))" -if [ "$#" -gt 0 ] +if [ "$#" -ne 1 ] then help exit 2 fi +profile="$1" + +profile_dir="${SCRIPT_DIR}/${profile}" +if [ ! -d "$profile_dir" ] +then + echo "Profile not found." +fi + +disko_config="${profile_dir}/disko.nix" +if [ ! -f "$disko_config" ] +then + echo "Disk configuration not found." +fi + +nixos_config="${profile_dir}/os.nix" +if [ ! -f "$nixos_config" ] +then + echo "NixOS configuration not found." +fi + set -x @@ -45,7 +69,7 @@ set -x sudo ./add_channels.sh # Format or mount disk -sudo nix --extra-experimental-features nix-command --extra-experimental-features flakes run github:nix-community/disko -- --mode $disko_mode ./pindakaas_disko.nix +sudo nix --extra-experimental-features nix-command --extra-experimental-features flakes run github:nix-community/disko -- --mode "$disko_mode" "$disko_config" # Generate hardware-config.nix sudo nixos-generate-config --no-filesystems --root /mnt @@ -53,11 +77,11 @@ sudo nixos-generate-config --no-filesystems --root /mnt # Plug system configuration into this git repo sudo mkdir -p /mnt/etc/nixos -echo "{ ... }: { imports = [ ./hardware-configuration.nix /home/geoffrey/.config/dotfiles/pindakaas.nix ]; }" | sudo tee /mnt/etc/nixos/configuration.nix > /dev/null +echo "{ ... }: { imports = [ ./hardware-configuration.nix ${nixos_config} ]; }" | sudo tee /mnt/etc/nixos/configuration.nix > /dev/null # Everything there should be covered by (and conflicts with) the repo anyways. # Install NixOS! Or create a new generation. -sudo nixos-install +sudo nixos-install --no-root-password # Install dotfiles. Actually not needed by nixos-install since it doesn't rewrite global paths to /mnt. # Without it no nixos-rebuild from the system itself once installed though. @@ -66,6 +90,5 @@ sudo nixos-install # sudo cp -a ../dotfiles /mnt/home/geoffrey/.config/ # sudo chown geoffrey:geoffrey /mnt/home/geoffrey -R -# Signal we're done! -# Although it might ask for passwords beforehand, so not sure it's really useful +# Signal the installation is done! echo  diff --git a/os/loader.nix b/os/default.nix similarity index 100% rename from os/loader.nix rename to os/default.nix diff --git a/os/geoffrey.nix b/os/geoffrey.nix index 1597880..d828426 100644 --- a/os/geoffrey.nix +++ b/os/geoffrey.nix @@ -22,7 +22,7 @@ home-manager = { users.geoffrey = { pkgs, ... }: { imports = [ - ../hm/loader.nix + ../hm ]; frogeye = config.frogeye; }; diff --git a/pindakaas.nix b/pindakaas/hardware.nix similarity index 73% rename from pindakaas.nix rename to pindakaas/hardware.nix index d52901c..0dc278b 100644 --- a/pindakaas.nix +++ b/pindakaas/hardware.nix @@ -3,9 +3,8 @@ imports = [ # First commit before 23.05 release date: "${builtins.fetchTarball "https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz"}/pine64/pinebook-pro" - ./os/loader.nix - ./pindakaas_disko.nix ]; + boot = { # nixos-hardware use latest kernel by default. It has been set a while ago, we maybe don't need it anymore? kernelPackages = pkgs.linuxPackages; @@ -25,14 +24,4 @@ }; }; - - networking.hostName = "pindakaas"; - - # DEBUG Barebones is faster - frogeye.dev.ansible = false; - frogeye.dev.python = false; - - # frogeye.extra = false; # FIXME Not working yet - # frogeye.desktop.xorg = true; - # frogeye.dev.docker = true; } diff --git a/pindakaas/options.nix b/pindakaas/options.nix new file mode 100644 index 0000000..f14ad67 --- /dev/null +++ b/pindakaas/options.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + frogeye.extra = false; # FIXME Not working yet + frogeye.desktop.xorg = true; + frogeye.dev.docker = true; +} diff --git a/pindakaas/os.nix b/pindakaas/os.nix new file mode 100644 index 0000000..e0e1f93 --- /dev/null +++ b/pindakaas/os.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + imports = [ + ../os + ./hardware.nix + ./disko.nix + ./options.nix + ]; + + networking.hostName = "pindakaas"; +} diff --git a/pindakaas_disko.nix b/pindakaas_sd/disko.nix similarity index 72% rename from pindakaas_disko.nix rename to pindakaas_sd/disko.nix index bd93cc7..2074c00 100644 --- a/pindakaas_disko.nix +++ b/pindakaas_sd/disko.nix @@ -22,11 +22,34 @@ }; root = { size = "100%"; + # content = { + # type = "filesystem"; + # format = "ext4"; + # mountpoint = "/"; + # }; content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/nixos" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = [ "compress=zstd" "relatime" ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + # Maybe later + # "/swap" = { + # mountpoint = "/.swapvol"; + # swap.swapfile.size = "20M"; + # }; + }; + }; }; # FIXME Hang on Linux boot, for some reason # luks = { diff --git a/pindakaas_sd/options.nix b/pindakaas_sd/options.nix new file mode 100644 index 0000000..d825514 --- /dev/null +++ b/pindakaas_sd/options.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + # Barebones is faster to test partition schemes + frogeye.dev.ansible = false; + frogeye.dev.python = false; +} diff --git a/pindakaas_sd/os.nix b/pindakaas_sd/os.nix new file mode 100644 index 0000000..87c9333 --- /dev/null +++ b/pindakaas_sd/os.nix @@ -0,0 +1,11 @@ +{ pkgs, config, ... }: +{ + imports = [ + ../os + ../pindakaas/hardware.nix + ./disko.nix + ./options.nix + ]; + + networking.hostName = "pindakaas_sd"; +} diff --git a/.gitignore b/vm/.gitignore similarity index 100% rename from .gitignore rename to vm/.gitignore diff --git a/vm/build.sh b/vm/build.sh new file mode 100755 index 0000000..97e698d --- /dev/null +++ b/vm/build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash +#! nix-shell -p bash nix-output-monitor + +# Build a NixOS VM for testing + +set -euo pipefail +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +nom-build '' -A vm \ + -I nixos-config=./os.nix diff --git a/vm/options.nix b/vm/options.nix new file mode 100644 index 0000000..f342e90 --- /dev/null +++ b/vm/options.nix @@ -0,0 +1,14 @@ +{ ... }: +{ + frogeye = { + desktop.xorg = true; + dev = { + ansible = true; + c = true; + docker = true; + fpga = true; + python = true; + }; + # extra = true; # FIXME Should support aarch64 + }; +} diff --git a/vm/os.nix b/vm/os.nix new file mode 100644 index 0000000..e74e854 --- /dev/null +++ b/vm/os.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + imports = [ + ../os + ./options.nix + ]; + + # Create a different disk image depending on the architecture + networking.hostName = "${builtins.currentSystem}"; +} From 5e456c54a78c8799f2f778d4f40a4778f15552f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 29 Nov 2023 11:39:58 +0100 Subject: [PATCH 079/108] Add results from LUKS debugging session --- install_os.sh | 2 +- pindakaas_sd/disko-desired.nix | 64 +++++++++++++++++++++ pindakaas_sd/disko-hanging.nix | 38 ++++++++++++ pindakaas_sd/disko-working.nix | 32 +++++++++++ pindakaas_sd/disko.nix | 102 +-------------------------------- pindakaas_sd/os.nix | 8 ++- 6 files changed, 142 insertions(+), 104 deletions(-) create mode 100644 pindakaas_sd/disko-desired.nix create mode 100644 pindakaas_sd/disko-hanging.nix create mode 100644 pindakaas_sd/disko-working.nix mode change 100644 => 120000 pindakaas_sd/disko.nix diff --git a/install_os.sh b/install_os.sh index cf9a66c..1052206 100755 --- a/install_os.sh +++ b/install_os.sh @@ -7,7 +7,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # Parse arguments function help { - echo "Usage: $0 profile [-e]" + echo "Usage: $0 [-e] [-h] profile" echo echo "Arguments:" echo " file: OS/disk profile to use" diff --git a/pindakaas_sd/disko-desired.nix b/pindakaas_sd/disko-desired.nix new file mode 100644 index 0000000..e31c34f --- /dev/null +++ b/pindakaas_sd/disko-desired.nix @@ -0,0 +1,64 @@ +{ + disko.devices = { + disk = { + pindakaas_sd = { + type = "disk"; + device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99"; + content = { + type = "gpt"; + partitions = { + ESP = { + # Needs enough to store multiple kernel generations + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "pindakaas_sd"; + #passwordFile = "/tmp/secret.key"; # Commented out so asked interactively + settings = { + # Not having SSDs die fast is more important than crypto + # nerds that could potentially discover which filesystem I + # use from TRIM patterns + allowDiscards = true; + }; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/nixos" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = [ "compress=zstd" "relatime" ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + # Maybe later + # "/swap" = { + # mountpoint = "/.swapvol"; + # swap.swapfile.size = "20M"; + # }; + }; + }; + }; + }; + }; + }; + }; + }; + } diff --git a/pindakaas_sd/disko-hanging.nix b/pindakaas_sd/disko-hanging.nix new file mode 100644 index 0000000..187c6db --- /dev/null +++ b/pindakaas_sd/disko-hanging.nix @@ -0,0 +1,38 @@ +{ + disko.devices = { + disk = { + vdb = { + type = "disk"; + device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + settings.allowDiscards = true; + passwordFile = "/tmp/secret.key"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/pindakaas_sd/disko-working.nix b/pindakaas_sd/disko-working.nix new file mode 100644 index 0000000..8b682eb --- /dev/null +++ b/pindakaas_sd/disko-working.nix @@ -0,0 +1,32 @@ +{ + disko.devices = { + disk = { + vdb = { + type = "disk"; + device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/pindakaas_sd/disko.nix b/pindakaas_sd/disko.nix deleted file mode 100644 index 2074c00..0000000 --- a/pindakaas_sd/disko.nix +++ /dev/null @@ -1,101 +0,0 @@ -{ - disko.devices = { - disk = { - pindakaas_sd = { - type = "disk"; - device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99"; - content = { - type = "gpt"; - partitions = { - ESP = { - # Needs enough to store multiple kernel generations - size = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ - "defaults" - ]; - }; - }; - root = { - size = "100%"; - # content = { - # type = "filesystem"; - # format = "ext4"; - # mountpoint = "/"; - # }; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; - subvolumes = { - "/nixos" = { - mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - "/home" = { - mountpoint = "/home"; - mountOptions = [ "compress=zstd" "relatime" ]; - }; - "/nix" = { - mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - # Maybe later - # "/swap" = { - # mountpoint = "/.swapvol"; - # swap.swapfile.size = "20M"; - # }; - }; - }; - }; - # FIXME Hang on Linux boot, for some reason - # luks = { - # size = "100%"; - # content = { - # type = "luks"; - # name = "pindakaas_sd"; - # # disable settings.keyFile if you want to use interactive password entry - # #passwordFile = "/tmp/secret.key"; # Interactive - # settings = { - # # Not having SSDs die fast is more important than crypto - # # nerds that could potentially discover which filesystem I - # # use from TRIM patterns - # allowDiscards = true; - # # keyFile = "/tmp/secret.key"; - # fallbackToPassword = true; # TEST - # }; - # # additionalKeyFiles = [ "/tmp/additionalSecret.key" ]; - # content = { - # type = "btrfs"; - # extraArgs = [ "-f" ]; - # subvolumes = { - # "/nixos" = { - # mountpoint = "/"; - # mountOptions = [ "compress=zstd" "noatime" ]; - # }; - # "/home" = { - # mountpoint = "/home"; - # mountOptions = [ "compress=zstd" "relatime" ]; - # }; - # "/nix" = { - # mountpoint = "/nix"; - # mountOptions = [ "compress=zstd" "noatime" ]; - # }; - # # Maybe later - # # "/swap" = { - # # mountpoint = "/.swapvol"; - # # swap.swapfile.size = "20M"; - # # }; - # }; - # }; - # }; - # }; - }; - }; - }; - }; - }; -} diff --git a/pindakaas_sd/disko.nix b/pindakaas_sd/disko.nix new file mode 120000 index 0000000..5ce14d9 --- /dev/null +++ b/pindakaas_sd/disko.nix @@ -0,0 +1 @@ +disko-hanging.nix \ No newline at end of file diff --git a/pindakaas_sd/os.nix b/pindakaas_sd/os.nix index 87c9333..869e1de 100644 --- a/pindakaas_sd/os.nix +++ b/pindakaas_sd/os.nix @@ -1,11 +1,15 @@ { pkgs, config, ... }: { imports = [ - ../os + # START DEBUG + # ../os + # ./options.nix + "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22.tar.gz"}/module.nix" + # END DEBUG ../pindakaas/hardware.nix ./disko.nix - ./options.nix ]; + nixpkgs.config.allowUnfree = true; # DEBUG networking.hostName = "pindakaas_sd"; } From 29504dab6c5e8132b6e6f0b6bfc53f54d494d1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 29 Nov 2023 14:27:29 +0100 Subject: [PATCH 080/108] Add curacao_usb for further debugging --- curacao_usb/disko-desired.nix | 64 +++++++++++++++++++++++++++++++++++ curacao_usb/disko-hanging.nix | 38 +++++++++++++++++++++ curacao_usb/disko-working.nix | 32 ++++++++++++++++++ curacao_usb/disko.nix | 1 + curacao_usb/os.nix | 30 ++++++++++++++++ install_os.sh | 22 +++++++----- 6 files changed, 178 insertions(+), 9 deletions(-) create mode 100644 curacao_usb/disko-desired.nix create mode 100644 curacao_usb/disko-hanging.nix create mode 100644 curacao_usb/disko-working.nix create mode 120000 curacao_usb/disko.nix create mode 100644 curacao_usb/os.nix diff --git a/curacao_usb/disko-desired.nix b/curacao_usb/disko-desired.nix new file mode 100644 index 0000000..fa2a024 --- /dev/null +++ b/curacao_usb/disko-desired.nix @@ -0,0 +1,64 @@ +{ + disko.devices = { + disk = { + pindakaas_sd = { + type = "disk"; + device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; + content = { + type = "gpt"; + partitions = { + ESP = { + # Needs enough to store multiple kernel generations + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "pindakaas_sd"; + #passwordFile = "/tmp/secret.key"; # Commented out so asked interactively + settings = { + # Not having SSDs die fast is more important than crypto + # nerds that could potentially discover which filesystem I + # use from TRIM patterns + allowDiscards = true; + }; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/nixos" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = [ "compress=zstd" "relatime" ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + # Maybe later + # "/swap" = { + # mountpoint = "/.swapvol"; + # swap.swapfile.size = "20M"; + # }; + }; + }; + }; + }; + }; + }; + }; + }; + } diff --git a/curacao_usb/disko-hanging.nix b/curacao_usb/disko-hanging.nix new file mode 100644 index 0000000..addc8ca --- /dev/null +++ b/curacao_usb/disko-hanging.nix @@ -0,0 +1,38 @@ +{ + disko.devices = { + disk = { + vdb = { + type = "disk"; + device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + settings.allowDiscards = true; + passwordFile = "/tmp/secret.key"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/curacao_usb/disko-working.nix b/curacao_usb/disko-working.nix new file mode 100644 index 0000000..dceed99 --- /dev/null +++ b/curacao_usb/disko-working.nix @@ -0,0 +1,32 @@ +{ + disko.devices = { + disk = { + vdb = { + type = "disk"; + device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/curacao_usb/disko.nix b/curacao_usb/disko.nix new file mode 120000 index 0000000..5ce14d9 --- /dev/null +++ b/curacao_usb/disko.nix @@ -0,0 +1 @@ +disko-hanging.nix \ No newline at end of file diff --git a/curacao_usb/os.nix b/curacao_usb/os.nix new file mode 100644 index 0000000..702f872 --- /dev/null +++ b/curacao_usb/os.nix @@ -0,0 +1,30 @@ +{ pkgs, config, ... }: +{ + # This whole folder is DEBUG + imports = [ + "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22.tar.gz"}/module.nix" + ./disko.nix + ]; + + nixpkgs.config.allowUnfree = true; + networking.hostName = "curacao_usb"; + + boot = { + # nixos-hardware use latest kernel by default. It has been set a while ago, we maybe don't need it anymore? + kernelPackages = pkgs.linuxPackages; + + # Pinebook supports UEFI, at least when tow-boot is installed on the SPI + loader = { + # EFI Variables don't work (no generation appears in systemd-boot) + efi.canTouchEfiVariables = false; + + # systemd-boot crashes after booting, so GRUB it is + grub = { + enable = true; + efiSupport = true; + efiInstallAsRemovable = true; + device = "nodev"; + }; + }; + }; +} diff --git a/install_os.sh b/install_os.sh index 1052206..a77eb18 100755 --- a/install_os.sh +++ b/install_os.sh @@ -61,34 +61,38 @@ then echo "NixOS configuration not found." fi +mountpoint="/mnt/nixos" +nix_flakes_cmd="nix --extra-experimental-features nix-command --extra-experimental-features flakes" set -x +sudo mkdir -p "$mountpoint" + # Add channels to root user, as nixos-install uses those. # Not great, but fixable with flakes I guess sudo ./add_channels.sh # Format or mount disk -sudo nix --extra-experimental-features nix-command --extra-experimental-features flakes run github:nix-community/disko -- --mode "$disko_mode" "$disko_config" +sudo $nix_flakes_cmd run github:nix-community/disko -- --root-mountpoint "$mountpoint" --mode "$disko_mode" "$disko_config" # Generate hardware-config.nix -sudo nixos-generate-config --no-filesystems --root /mnt +sudo nixos-generate-config --no-filesystems --root "$mountpoint" # --no-filesystems because they are imported via disko # Plug system configuration into this git repo -sudo mkdir -p /mnt/etc/nixos -echo "{ ... }: { imports = [ ./hardware-configuration.nix ${nixos_config} ]; }" | sudo tee /mnt/etc/nixos/configuration.nix > /dev/null +sudo mkdir -p "${mountpoint}/etc/nixos" +echo "{ ... }: { imports = [ ./hardware-configuration.nix ${nixos_config} ]; }" | sudo tee "${mountpoint}/etc/nixos/configuration.nix" > /dev/null # Everything there should be covered by (and conflicts with) the repo anyways. # Install NixOS! Or create a new generation. -sudo nixos-install --no-root-password +sudo nixos-install --no-root-password --root "$mountpoint" -# Install dotfiles. Actually not needed by nixos-install since it doesn't rewrite global paths to /mnt. +# Install dotfiles. Actually not needed by nixos-install since it doesn't rewrite global paths to the mountpoint. # Without it no nixos-rebuild from the system itself once installed though. # Should probably be replaced with something like git-sync -# sudo mkdir -p /mnt/home/geoffrey/.config/ -# sudo cp -a ../dotfiles /mnt/home/geoffrey/.config/ -# sudo chown geoffrey:geoffrey /mnt/home/geoffrey -R +# sudo mkdir -p $mountpoint/home/geoffrey/.config/ +# sudo cp -a ../dotfiles $mountpoint/home/geoffrey/.config/ +# sudo chown geoffrey:geoffrey $mountpoint/home/geoffrey -R # Signal the installation is done! echo  From 36608fa9e447cc73dfe60bdf48d96148f7cbd099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 29 Nov 2023 23:00:46 +0100 Subject: [PATCH 081/108] Fix LUKS on pindakaas It took 3 days to investigate by myself and only get a partial idea of the issue, but 5 minutes to ask for support and another 5 to get a working solution. Hopefully lesson learned. --- pindakaas/hardware.nix | 3 ++ pindakaas_sd/disko-desired.nix | 64 --------------------------------- pindakaas_sd/disko-hanging.nix | 38 -------------------- pindakaas_sd/disko-working.nix | 32 ----------------- pindakaas_sd/disko.nix | 66 +++++++++++++++++++++++++++++++++- pindakaas_sd/hybrid | 1 + pindakaas_sd/options.nix | 6 ---- pindakaas_sd/os.nix | 8 ++--- 8 files changed, 71 insertions(+), 147 deletions(-) delete mode 100644 pindakaas_sd/disko-desired.nix delete mode 100644 pindakaas_sd/disko-hanging.nix delete mode 100644 pindakaas_sd/disko-working.nix mode change 120000 => 100644 pindakaas_sd/disko.nix create mode 120000 pindakaas_sd/hybrid delete mode 100644 pindakaas_sd/options.nix diff --git a/pindakaas/hardware.nix b/pindakaas/hardware.nix index 0dc278b..d91bb76 100644 --- a/pindakaas/hardware.nix +++ b/pindakaas/hardware.nix @@ -9,6 +9,9 @@ # nixos-hardware use latest kernel by default. It has been set a while ago, we maybe don't need it anymore? kernelPackages = pkgs.linuxPackages; + # Otherwise it will not show stage1 echo and prompt + kernelParams = ["console=tty0"]; + # Pinebook supports UEFI, at least when tow-boot is installed on the SPI loader = { # EFI Variables don't work (no generation appears in systemd-boot) diff --git a/pindakaas_sd/disko-desired.nix b/pindakaas_sd/disko-desired.nix deleted file mode 100644 index e31c34f..0000000 --- a/pindakaas_sd/disko-desired.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ - disko.devices = { - disk = { - pindakaas_sd = { - type = "disk"; - device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99"; - content = { - type = "gpt"; - partitions = { - ESP = { - # Needs enough to store multiple kernel generations - size = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ - "defaults" - ]; - }; - }; - luks = { - size = "100%"; - content = { - type = "luks"; - name = "pindakaas_sd"; - #passwordFile = "/tmp/secret.key"; # Commented out so asked interactively - settings = { - # Not having SSDs die fast is more important than crypto - # nerds that could potentially discover which filesystem I - # use from TRIM patterns - allowDiscards = true; - }; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; - subvolumes = { - "/nixos" = { - mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - "/home" = { - mountpoint = "/home"; - mountOptions = [ "compress=zstd" "relatime" ]; - }; - "/nix" = { - mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - # Maybe later - # "/swap" = { - # mountpoint = "/.swapvol"; - # swap.swapfile.size = "20M"; - # }; - }; - }; - }; - }; - }; - }; - }; - }; - } diff --git a/pindakaas_sd/disko-hanging.nix b/pindakaas_sd/disko-hanging.nix deleted file mode 100644 index 187c6db..0000000 --- a/pindakaas_sd/disko-hanging.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - disko.devices = { - disk = { - vdb = { - type = "disk"; - device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99"; - content = { - type = "gpt"; - partitions = { - ESP = { - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - luks = { - size = "100%"; - content = { - type = "luks"; - name = "crypted"; - settings.allowDiscards = true; - passwordFile = "/tmp/secret.key"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/pindakaas_sd/disko-working.nix b/pindakaas_sd/disko-working.nix deleted file mode 100644 index 8b682eb..0000000 --- a/pindakaas_sd/disko-working.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - disko.devices = { - disk = { - vdb = { - type = "disk"; - device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99"; - content = { - type = "gpt"; - partitions = { - ESP = { - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - root = { - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/pindakaas_sd/disko.nix b/pindakaas_sd/disko.nix deleted file mode 120000 index 5ce14d9..0000000 --- a/pindakaas_sd/disko.nix +++ /dev/null @@ -1 +0,0 @@ -disko-hanging.nix \ No newline at end of file diff --git a/pindakaas_sd/disko.nix b/pindakaas_sd/disko.nix new file mode 100644 index 0000000..58afe2e --- /dev/null +++ b/pindakaas_sd/disko.nix @@ -0,0 +1,65 @@ +{ + disko.devices = { + disk = { + pindakaas_sd = { + type = "disk"; + device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99"; + content = { + type = "gpt"; + partitions = { + ESP = { + # Needs enough to store multiple kernel generations + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "pindakaas_sd"; + passwordFile = "/tmp/secret.key"; # TODO Generate this somehow + settings = { + # Not having SSDs die fast is more important than crypto + # nerds that could potentially discover which filesystem I + # use from TRIM patterns + allowDiscards = true; + }; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/nixos" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = [ "compress=zstd" "relatime" ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + # Maybe later + # "/swap" = { + # mountpoint = "/.swapvol"; + # swap.swapfile.size = "20M"; + # }; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/pindakaas_sd/hybrid b/pindakaas_sd/hybrid new file mode 120000 index 0000000..5060844 --- /dev/null +++ b/pindakaas_sd/hybrid @@ -0,0 +1 @@ +/nix/store/bz6nqy0ky5l33rfrkb6k66bzkgw18k90-nixos-system-pindakaas_sd-23.05.4981.5b528f99f73c \ No newline at end of file diff --git a/pindakaas_sd/options.nix b/pindakaas_sd/options.nix deleted file mode 100644 index d825514..0000000 --- a/pindakaas_sd/options.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - # Barebones is faster to test partition schemes - frogeye.dev.ansible = false; - frogeye.dev.python = false; -} diff --git a/pindakaas_sd/os.nix b/pindakaas_sd/os.nix index 869e1de..351874c 100644 --- a/pindakaas_sd/os.nix +++ b/pindakaas_sd/os.nix @@ -1,15 +1,11 @@ { pkgs, config, ... }: { imports = [ - # START DEBUG - # ../os - # ./options.nix - "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22.tar.gz"}/module.nix" - # END DEBUG + ../os + ../pindakaas/options.nix ../pindakaas/hardware.nix ./disko.nix ]; - nixpkgs.config.allowUnfree = true; # DEBUG networking.hostName = "pindakaas_sd"; } From 3806e023f6984fcbf10db6338590564cc87bf6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 30 Nov 2023 18:57:58 +0100 Subject: [PATCH 082/108] disko: Reorganize a bit --- curacao_usb/disko-hanging.nix | 38 ----------- curacao_usb/disko-working.nix | 32 --------- curacao_usb/disko.nix | 2 +- .../single_uefi_btrfs.nix | 12 ++-- pindakaas_sd/disko.nix | 66 +------------------ 5 files changed, 9 insertions(+), 141 deletions(-) delete mode 100644 curacao_usb/disko-hanging.nix delete mode 100644 curacao_usb/disko-working.nix mode change 120000 => 100644 curacao_usb/disko.nix rename curacao_usb/disko-desired.nix => dk/single_uefi_btrfs.nix (88%) diff --git a/curacao_usb/disko-hanging.nix b/curacao_usb/disko-hanging.nix deleted file mode 100644 index addc8ca..0000000 --- a/curacao_usb/disko-hanging.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - disko.devices = { - disk = { - vdb = { - type = "disk"; - device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; - content = { - type = "gpt"; - partitions = { - ESP = { - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - luks = { - size = "100%"; - content = { - type = "luks"; - name = "crypted"; - settings.allowDiscards = true; - passwordFile = "/tmp/secret.key"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/curacao_usb/disko-working.nix b/curacao_usb/disko-working.nix deleted file mode 100644 index dceed99..0000000 --- a/curacao_usb/disko-working.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - disko.devices = { - disk = { - vdb = { - type = "disk"; - device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; - content = { - type = "gpt"; - partitions = { - ESP = { - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - root = { - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/curacao_usb/disko.nix b/curacao_usb/disko.nix deleted file mode 120000 index 5ce14d9..0000000 --- a/curacao_usb/disko.nix +++ /dev/null @@ -1 +0,0 @@ -disko-hanging.nix \ No newline at end of file diff --git a/curacao_usb/disko.nix b/curacao_usb/disko.nix new file mode 100644 index 0000000..962cba1 --- /dev/null +++ b/curacao_usb/disko.nix @@ -0,0 +1 @@ +import ../dk/single_uefi_btrfs.nix { id = "usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; name = "curacao_usb"; } diff --git a/curacao_usb/disko-desired.nix b/dk/single_uefi_btrfs.nix similarity index 88% rename from curacao_usb/disko-desired.nix rename to dk/single_uefi_btrfs.nix index fa2a024..b839c1f 100644 --- a/curacao_usb/disko-desired.nix +++ b/dk/single_uefi_btrfs.nix @@ -1,9 +1,10 @@ +{ id, name, ... }: { disko.devices = { disk = { - pindakaas_sd = { + "${name}" = { type = "disk"; - device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; + device = "/dev/disk/by-id/${id}"; content = { type = "gpt"; partitions = { @@ -24,8 +25,8 @@ size = "100%"; content = { type = "luks"; - name = "pindakaas_sd"; - #passwordFile = "/tmp/secret.key"; # Commented out so asked interactively + name = "${name}"; + passwordFile = "/tmp/secret.key"; # TODO Generate this somehow settings = { # Not having SSDs die fast is more important than crypto # nerds that could potentially discover which filesystem I @@ -61,4 +62,5 @@ }; }; }; - } + }; +} diff --git a/pindakaas_sd/disko.nix b/pindakaas_sd/disko.nix index 58afe2e..f3b4eae 100644 --- a/pindakaas_sd/disko.nix +++ b/pindakaas_sd/disko.nix @@ -1,65 +1 @@ -{ - disko.devices = { - disk = { - pindakaas_sd = { - type = "disk"; - device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99"; - content = { - type = "gpt"; - partitions = { - ESP = { - # Needs enough to store multiple kernel generations - size = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ - "defaults" - ]; - }; - }; - luks = { - size = "100%"; - content = { - type = "luks"; - name = "pindakaas_sd"; - passwordFile = "/tmp/secret.key"; # TODO Generate this somehow - settings = { - # Not having SSDs die fast is more important than crypto - # nerds that could potentially discover which filesystem I - # use from TRIM patterns - allowDiscards = true; - }; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; - subvolumes = { - "/nixos" = { - mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - "/home" = { - mountpoint = "/home"; - mountOptions = [ "compress=zstd" "relatime" ]; - }; - "/nix" = { - mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - # Maybe later - # "/swap" = { - # mountpoint = "/.swapvol"; - # swap.swapfile.size = "20M"; - # }; - }; - }; - }; - }; - }; - }; - }; - }; - }; -} +import ../dk/single_uefi_btrfs.nix { id = "mmc-SN32G_0xfb19ae99"; name = "pindakaas_sd"; } From 224f769324191250697da5c00533dd1d872edea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 30 Nov 2023 18:59:50 +0100 Subject: [PATCH 083/108] Do not restrict VMs to a single config Also "allows" full-system build without install. --- .gitignore | 4 +++ build_os.sh | 66 ++++++++++++++++++++++++++++++++++++++++ full/README.md | 6 ++++ {vm => full}/options.nix | 2 +- {vm => full}/os.nix | 0 install_os.sh | 6 ++-- vm/.gitignore | 2 -- vm/build.sh | 11 ------- 8 files changed, 80 insertions(+), 17 deletions(-) create mode 100644 .gitignore create mode 100755 build_os.sh create mode 100644 full/README.md rename {vm => full}/options.nix (77%) rename {vm => full}/os.nix (100%) delete mode 100644 vm/.gitignore delete mode 100755 vm/build.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..29ae37f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*/system +*/vm +*/vmWithBootLoader +*.qcow2 diff --git a/build_os.sh b/build_os.sh new file mode 100755 index 0000000..7c15d89 --- /dev/null +++ b/build_os.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash +#! nix-shell -p bash nix-output-monitor + +set -euo pipefail +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +# Parse arguments +function help { + echo "Usage: $0 [-h|-v|-b] profile" + echo + echo "Arguments:" + echo " profile: OS/disk profile to use" + echo + echo "Options:" + echo " -h: Display this help message." + echo " -v: Build a virtual machine." + echo " -b: Build a virtual machine with boot loader." +} + +attr=system +while getopts "hvb" OPTION +do + case "$OPTION" in + h) + help + exit 0 + ;; + v) + attr=vm + ;; + b) + attr=vmWithBootLoader + ;; + ?) + help + exit 2 + ;; + esac +done +shift "$(($OPTIND -1))" + +if [ "$#" -ne 1 ] +then + help + exit 2 +fi +profile="$1" + +profile_dir="${SCRIPT_DIR}/${profile}" +if [ ! -d "$profile_dir" ] +then + echo "Profile not found." +fi + +nixos_config="${profile_dir}/os.nix" +if [ ! -f "$nixos_config" ] +then + echo "NixOS configuration not found." +fi + +set -x + +nom-build '' -I "nixos-config=${nixos_config}" -A "$attr" -o "${profile_dir}/${attr}" + +echo  diff --git a/full/README.md b/full/README.md new file mode 100644 index 0000000..0f087b5 --- /dev/null +++ b/full/README.md @@ -0,0 +1,6 @@ +# full profile + +Fake configuration that contains everything I could ever need, +used for debugging. +Can't build a full system due to not having a filesystem / bootloader configuration, +build as a VM (without bootloader). diff --git a/vm/options.nix b/full/options.nix similarity index 77% rename from vm/options.nix rename to full/options.nix index f342e90..33b7620 100644 --- a/vm/options.nix +++ b/full/options.nix @@ -9,6 +9,6 @@ fpga = true; python = true; }; - # extra = true; # FIXME Should support aarch64 + extra = true; }; } diff --git a/vm/os.nix b/full/os.nix similarity index 100% rename from vm/os.nix rename to full/os.nix diff --git a/install_os.sh b/install_os.sh index a77eb18..87bf1b3 100755 --- a/install_os.sh +++ b/install_os.sh @@ -7,10 +7,10 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # Parse arguments function help { - echo "Usage: $0 [-e] [-h] profile" + echo "Usage: $0 [-h|-e] profile" echo echo "Arguments:" - echo " file: OS/disk profile to use" + echo " profile: OS/disk profile to use" echo echo "Options:" echo " -h: Display this help message." @@ -18,7 +18,7 @@ function help { } disko_mode=mount -while getopts "e" OPTION +while getopts "he" OPTION do case "$OPTION" in h) diff --git a/vm/.gitignore b/vm/.gitignore deleted file mode 100644 index ee0c388..0000000 --- a/vm/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.qcow2 -result diff --git a/vm/build.sh b/vm/build.sh deleted file mode 100755 index 97e698d..0000000 --- a/vm/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env nix-shell -#! nix-shell -i bash -#! nix-shell -p bash nix-output-monitor - -# Build a NixOS VM for testing - -set -euo pipefail -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -nom-build '' -A vm \ - -I nixos-config=./os.nix From bc4676dec0811aac4ace8a577319c4f19dc4fabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 30 Nov 2023 19:01:55 +0100 Subject: [PATCH 084/108] Fix/reorganize profile variants --- curacao/hardware.nix | 11 +++++++++-- curacao_usb/os.nix | 30 +++++++++++------------------- pindakaas/hardware.nix | 4 ++-- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/curacao/hardware.nix b/curacao/hardware.nix index b7e23b5..996cf10 100644 --- a/curacao/hardware.nix +++ b/curacao/hardware.nix @@ -1,8 +1,15 @@ { lib, ... }: { imports = [ - "${builtins.fetchTarball "https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz"}/dell/g3/3779" + ]; - boot.loader.efi.canTouchEfiVariables = lib.mkDefault true; + # UEFI works here, and variables can be touched + boot.loader = { + efi.canTouchEfiVariables = lib.mkDefault true; + grub = { + enable = true; + efiSupport = true; + }; + }; } diff --git a/curacao_usb/os.nix b/curacao_usb/os.nix index 702f872..32b2211 100644 --- a/curacao_usb/os.nix +++ b/curacao_usb/os.nix @@ -1,30 +1,22 @@ { pkgs, config, ... }: { - # This whole folder is DEBUG imports = [ - "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22.tar.gz"}/module.nix" + ../os + ../curacao/options.nix + ../curacao/hardware.nix ./disko.nix ]; - nixpkgs.config.allowUnfree = true; networking.hostName = "curacao_usb"; - boot = { - # nixos-hardware use latest kernel by default. It has been set a while ago, we maybe don't need it anymore? - kernelPackages = pkgs.linuxPackages; - - # Pinebook supports UEFI, at least when tow-boot is installed on the SPI - loader = { - # EFI Variables don't work (no generation appears in systemd-boot) - efi.canTouchEfiVariables = false; - - # systemd-boot crashes after booting, so GRUB it is - grub = { - enable = true; - efiSupport = true; - efiInstallAsRemovable = true; - device = "nodev"; - }; + # It's a removable drive, so no touching EFI vars + # (quite a lot of stuff to set for that!) + boot.loader = { + efi.canTouchEfiVariables = false; + grub = { + efiInstallAsRemovable = true; + device = "nodev"; }; }; + } diff --git a/pindakaas/hardware.nix b/pindakaas/hardware.nix index d91bb76..3fd9443 100644 --- a/pindakaas/hardware.nix +++ b/pindakaas/hardware.nix @@ -1,8 +1,7 @@ { pkgs, config, ... }: { imports = [ - # First commit before 23.05 release date: - "${builtins.fetchTarball "https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz"}/pine64/pinebook-pro" + ]; boot = { @@ -10,6 +9,7 @@ kernelPackages = pkgs.linuxPackages; # Otherwise it will not show stage1 echo and prompt + # UPST kernelParams = ["console=tty0"]; # Pinebook supports UEFI, at least when tow-boot is installed on the SPI From 5ee5e5fc52b3e6686d96317cf265772c7b57aca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 30 Nov 2023 19:02:32 +0100 Subject: [PATCH 085/108] Upgrade to NixOS 23.11 --- add_channels.sh | 8 ++++---- hm/extra.nix | 2 +- hm/style.nix | 3 ++- hm/vim.nix | 9 ++++----- os/common.nix | 1 - os/geoffrey.nix | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/add_channels.sh b/add_channels.sh index 86094df..5ad032b 100755 --- a/add_channels.sh +++ b/add_channels.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -# TODO Surely there's more elegant? +# TODO Flakes -nix-channel --add https://nixos.org/channels/nixos-23.05 nixpkgs -# Below probably only needed on non-NixOS -nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager +nix-channel --add https://nixos.org/channels/nixos-23.11 nixpkgs +nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager +nix-channel --add https://github.com/NixOS/nixos-hardware/archive/8772491ed75f150f02552c60694e1beff9f46013.tar.gz nixos-hardware nix-channel --update diff --git a/hm/extra.nix b/hm/extra.nix index 2a7fa0d..72461e2 100644 --- a/hm/extra.nix +++ b/hm/extra.nix @@ -47,7 +47,7 @@ # TODO wine-gecko wine-mono lib32-libpulse (?) # gaming - steam + # steam # FIXME Requires i686-linux or something. IIRC the package says to use the NixOS config and not it directly. yuzu-mainline minecraft # TODO factorio diff --git a/hm/style.nix b/hm/style.nix index e177958..ed8362a 100644 --- a/hm/style.nix +++ b/hm/style.nix @@ -2,7 +2,8 @@ let stylix = builtins.fetchGit { url = "https://github.com/danth/stylix.git"; - ref = "release-23.05"; + # No 23.11 branch last I checked + rev = "8b3f61727f3b86c27096c3c014ae602aa40670ba"; }; in { diff --git a/hm/vim.nix b/hm/vim.nix index bcad6fc..18be6d7 100644 --- a/hm/vim.nix +++ b/hm/vim.nix @@ -2,7 +2,7 @@ let nixvim = import (builtins.fetchGit { url = "https://github.com/nix-community/nixvim"; - ref = "nixos-23.05"; + ref = "nixos-23.11"; }); vim-shot-f = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "vim-shot-f"; @@ -199,8 +199,7 @@ in # TODO Could add some, could also remove some }; }; - # FIXME phpactor. Only from 23.11 - # phpactor.enable = true; # PHP + phpactor.enable = true; # PHP rnix-lsp.enable = true; # Nix # FIXME sqlls yamlls.enable = true; # YAML @@ -226,7 +225,7 @@ in # indent = true; # Not very working last time I tried apparently }; # TODO Investigate https://github.com/nvim-treesitter/nvim-treesitter-textobjects - indent-blankline.enable = true; # 23.11 integrate with rainbow-delimiters and use more of the options + indent-blankline.enable = true; # TODO integrate with rainbow-delimiters and use more of the options undotree.enable = true; # Navigate edition history @@ -270,7 +269,7 @@ in # Treesitter nvim-ts-rainbow # Randomly color parenthesis pairs - # 23.11: Replace with plugins.rainbow-delimiters + # TODO Replace with plugins.rainbow-delimiters # Snippets vim-vsnip diff --git a/os/common.nix b/os/common.nix index b65873b..388fe34 100644 --- a/os/common.nix +++ b/os/common.nix @@ -55,7 +55,6 @@ chrony = { enable = true; servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3); - extraConfig = "rtcsync"; # See 23.11 release notes }; # Prevent power button from shutting down the computer. diff --git a/os/geoffrey.nix b/os/geoffrey.nix index d828426..556663d 100644 --- a/os/geoffrey.nix +++ b/os/geoffrey.nix @@ -1,7 +1,7 @@ { pkgs, config, ... }: { imports = [ - "${builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz"}/nixos" + ]; users.users.geoffrey = { From 02e03857c264be88eefd12083978b39bffb3cd98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 30 Nov 2023 19:07:03 +0100 Subject: [PATCH 086/108] Update stateVersions to 23.11 No change needed! --- hm/common.nix | 2 +- os/common.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hm/common.nix b/hm/common.nix index c958b61..3aa513e 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -394,7 +394,7 @@ in }; }; home = { - stateVersion = "23.05"; + stateVersion = "23.11"; language = { base = "en_US.UTF-8"; # time = "en_DK.UTF-8"; # FIXME Disabled because complaints during nixos-rebuild switch diff --git a/os/common.nix b/os/common.nix index 388fe34..8332453 100644 --- a/os/common.nix +++ b/os/common.nix @@ -73,6 +73,6 @@ system.copySystemConfiguration = true; # Use defaults from - system.stateVersion = "23.05"; + system.stateVersion = "23.11"; } From 05b1f2d88ae592350e086adfb8e1772e5d976a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 30 Nov 2023 20:37:25 +0100 Subject: [PATCH 087/108] Process 23.11 deprecations and new things --- hm/common.nix | 5 ++-- hm/vim.nix | 69 ++++++++++++++++++++++----------------------- pindakaas_sd/hybrid | 1 - 3 files changed, 36 insertions(+), 39 deletions(-) delete mode 120000 pindakaas_sd/hybrid diff --git a/hm/common.nix b/hm/common.nix index 3aa513e..e5c668b 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -172,8 +172,7 @@ in enable = true; enableAutosuggestions = true; enableCompletion = true; - enableSyntaxHighlighting = true; - # syntaxHighlighting.enable = true; # 23.11 syntax + syntaxHighlighting.enable = true; historySubstringSearch.enable = true; initExtra = lib.strings.concatLines [ commonRc @@ -350,6 +349,7 @@ in ]; extraConfig = builtins.readFile ./tmux.conf + "source-file ${themepack}/share/tmux-plugins/tmux-themepack/powerline/default/green.tmuxtheme\n"; }; + translate-shell.enable = true; # TODO Cool config? }; services = { gpg-agent = { @@ -423,7 +423,6 @@ in man # nodePackages.insect # FIXME Don't install on aarch64 # TODO Use whatever replaces insect - translate-shell unzip unrar p7zip diff --git a/hm/vim.nix b/hm/vim.nix index 18be6d7..d234871 100644 --- a/hm/vim.nix +++ b/hm/vim.nix @@ -4,7 +4,7 @@ let url = "https://github.com/nix-community/nixvim"; ref = "nixos-23.11"; }); - vim-shot-f = pkgs.vimUtils.buildVimPluginFrom2Nix { + vim-shot-f = pkgs.vimUtils.buildVimPlugin { pname = "vim-shot-f"; version = "2016-02-05"; src = pkgs.fetchFromGitHub { @@ -15,7 +15,7 @@ let }; meta.homepage = "https://github.com/deris/vim-shot-f"; }; - quick-scope = pkgs.vimUtils.buildVimPluginFrom2Nix rec { + quick-scope = pkgs.vimUtils.buildVimPlugin rec { pname = "quick-scope"; version = "2.6.1"; src = pkgs.fetchFromGitHub { @@ -286,14 +286,14 @@ in # Language-specific tcomment_vim # Language-aware (un)commenting - ] ++ lib.optionals config.frogeye.extra [ + ] ++ lib.optionals config.frogeye.extra [ vim-LanguageTool # Check grammar for human languages - ] ++ lib.optionals config.programs.pandoc.enable [ + ] ++ lib.optionals config.programs.pandoc.enable [ vim-pandoc # Pandoc-specific stuff because there's no LSP for it vim-pandoc-syntax - ] ++ lib.optionals config.frogeye.dev.c [ + ] ++ lib.optionals config.frogeye.dev.c [ nvim-dap # Debug Adapter Protocol client - ] ++ lib.optionals config.frogeye.dev.ansible [ + ] ++ lib.optionals config.frogeye.dev.ansible [ ansible-vim # FIXME See if it doesn't require to do ./UltiSnips/generate.sh ]; extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [ @@ -354,54 +354,53 @@ in # TODO Is not working, options is set to nil even though it shouldn't }; - # 23.11: Use keymaps, seems better - maps = { + keymaps = [ # GENERAL # Allow saving of files as sudo when I forgot to start vim using sudo. # From https://stackoverflow.com/a/7078429 - command."w!!" = { action = "w !sudo tee > /dev/null %"; }; + { mode = "c"; key = "w!!"; action = "w !sudo tee > /dev/null %"; } - insert."jk" = { action = ""; }; - visual."" = { action = ""; }; - normal."" = { action = "o"; }; + { mode = "i"; key = "jk"; action = ""; } + { mode = "v"; key = ""; action = ""; } + { key = ""; action = "o"; } - # normal."" = { action = ":bp"; }; - # normal."" = { action = ":bn"; }; - normal."" = { action = "kkkkkkkkkkkkkkkkkkkkk"; }; - normal."" = { action = "jjjjjjjjjjjjjjjjjjjjj"; }; + # { key = ""; action = ":bp"; } + # { key = ""; action = ":bn"; } + { key = ""; action = "kkkkkkkkkkkkkkkkkkkkk"; } + { key = ""; action = "jjjjjjjjjjjjjjjjjjjjj"; } # \s to replace globally the word under the cursor - normal."s" = { action = ":%s/\\<\\>/"; }; + { key = "s"; action = ":%s/\\<\\>/"; } # PLUGINS # barbar - normal."" = { action = "BufferPrevious"; silent = true; }; - normal."" = { action = "BufferNext"; silent = true; }; + { key = ""; action = "BufferPrevious"; options = { silent = true; }; } + { key = ""; action = "BufferNext"; options = { silent = true; }; } # TODO https://www.reddit.com/r/neovim/comments/mbj8m5/how_to_setup_ctrlshiftkey_mappings_in_neovim_and/ - normal."" = { action = "BufferMovePrevious"; silent = true; }; - normal."" = { action = "BufferMoveNext"; silent = true; }; + { key = ""; action = "BufferMovePrevious"; options = { silent = true; }; } + { key = ""; action = "BufferMoveNext"; options = { silent = true; }; } # TODO gotos don't work - normal."" = { action = "BufferGoto 1"; silent = true; }; - normal."" = { action = "BufferGoto 2"; silent = true; }; - normal."" = { action = "BufferGoto 3"; silent = true; }; - normal."" = { action = "BufferGoto 4"; silent = true; }; - normal."" = { action = "BufferGoto 5"; silent = true; }; - normal."" = { action = "BufferGoto 6"; silent = true; }; - normal."" = { action = "BufferGoto 7"; silent = true; }; - normal."" = { action = "BufferGoto 8"; silent = true; }; - normal."" = { action = "BufferGoto 9"; silent = true; }; - normal."" = { action = "BufferLast"; silent = true; }; - normal."gb" = { action = "BufferPick"; silent = true; }; + { key = ""; action = "BufferGoto 1"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 2"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 3"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 4"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 5"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 6"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 7"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 8"; options = { silent = true; }; } + { key = ""; action = "BufferGoto 9"; options = { silent = true; }; } + { key = ""; action = "BufferLast"; options = { silent = true; }; } + { key = "gb"; action = "BufferPick"; options = { silent = true; }; } # TODO Other useful options? # symbols-outline-nvim - normal."s" = { action = "SymbolsOutline"; silent = true; }; + { key = "s"; action = "SymbolsOutline"; options = { silent = true; }; } # undotree - normal."u" = { action = "UndotreeToggle"; silent = true; }; + { key = "u"; action = "UndotreeToggle"; options = { silent = true; }; } - }; + ]; }; } diff --git a/pindakaas_sd/hybrid b/pindakaas_sd/hybrid deleted file mode 120000 index 5060844..0000000 --- a/pindakaas_sd/hybrid +++ /dev/null @@ -1 +0,0 @@ -/nix/store/bz6nqy0ky5l33rfrkb6k66bzkgw18k90-nixos-system-pindakaas_sd-23.05.4981.5b528f99f73c \ No newline at end of file From 88d087c3ce60055249747e31d9ee4c1e4649c4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 30 Nov 2023 21:49:37 +0100 Subject: [PATCH 088/108] Move some PGP-related things to extension --- hm/common.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/hm/common.nix b/hm/common.nix index e5c668b..1d9f92d 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -272,10 +272,6 @@ in ".mypy_cache" ]; lfs.enable = true; - signing = { - key = "0x8312C8CAC1BAC289"; # FIXME Only in extension - # TODO signByDefault? - }; userEmail = "geoffrey@frogeye.fr"; userName = "Geoffrey “Frogeye” Preud'homme"; extraConfig = { @@ -356,10 +352,7 @@ in enable = true; enableBashIntegration = true; enableZshIntegration = true; - enableSshSupport = true; pinentryFlavor = "gtk2"; # Falls back to curses when needed - sshKeys = [ "72A5F2913026776593947CF00DFF330E820E731D" ]; # TODO This seems to prevent other keys from being added? - # FIXME For g extension, as base is not supposed to have private keys }; }; xdg = { From 050901da2f3df87390db51ca299ab6ed51c6ec28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 30 Nov 2023 21:51:11 +0100 Subject: [PATCH 089/108] Move yt-dlp configuration from g extension --- hm/extra.nix | 12 +++++++++++- options.nix | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/hm/extra.nix b/hm/extra.nix index 72461e2..b20de1b 100644 --- a/hm/extra.nix +++ b/hm/extra.nix @@ -3,13 +3,23 @@ config = lib.mkIf config.frogeye.extra { programs = { pandoc.enable = true; + yt-dlp = { + enable = true; + settings = { + format = "bestvideo[height<=${builtins.toString config.frogeye.desktop.maxVideoHeight}]+bestaudio/best"; + sponsorblock-mark = "all"; + sponsorblock-remove = "intro,outro,sponsor,selfpromo,preview,interaction,music_offtopic"; + sub-langs = "en,fr"; + write-auto-subs = true; + write-subs = true; + }; + }; }; home.packages = with pkgs; ([ # android tools android-tools # downloading - yt-dlp megatools # transmission TODO Collision if both transmissions are active? diff --git a/options.nix b/options.nix index 3ce3b36..0242b89 100644 --- a/options.nix +++ b/options.nix @@ -5,6 +5,11 @@ desktop = { xorg = lib.mkEnableOption "Enable X11 support"; nixGLIntel = lib.mkEnableOption "Enable nixGLIntel/nixVulkanIntel for windows manager"; + maxVideoHeight = lib.mkOption { + type = lib.types.int; + description = "Maximum video height in pixel the machine can reasonably watch"; + default = 1080; + }; }; dev = { ansible = lib.mkEnableOption "Ansible dev stuff"; @@ -16,6 +21,7 @@ dotfiles = { path = lib.mkOption { type = lib.types.str; + description = "Absolute path to the present dotfiles directory"; # default = "${config.home.homeDirectory}/.config/dotfiles"; # FIXME Above doesn't work outside home-manager context default = "/home/geoffrey/.config/dotfiles"; From edeef96133a2c642da1e7ca1fb7f2459e40ef63c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 30 Nov 2023 22:09:44 +0100 Subject: [PATCH 090/108] Move scripts dir inside hm And remove weird path contraptions --- hm/common.nix | 4 ++-- {scripts => hm/scripts}/.bsh/bashrc | 0 {scripts => hm/scripts}/.bsh/bashrc_unsortable | 0 {scripts => hm/scripts}/.bsh/inputrc | 0 {scripts => hm/scripts}/.bsh/vimrc | 0 {scripts => hm/scripts}/.gitignore | 0 {scripts => hm/scripts}/archive | 0 {scripts => hm/scripts}/bsh | 0 {scripts => hm/scripts}/cached_pass | 0 {scripts => hm/scripts}/camera_name_date | 0 {scripts => hm/scripts}/cleandev | 0 {scripts => hm/scripts}/compressPictureMovies | 0 {scripts => hm/scripts}/crepuscule | 0 {scripts => hm/scripts}/docker-image-childs | 0 {scripts => hm/scripts}/docker-rm | 0 {scripts => hm/scripts}/dummy | 0 {scripts => hm/scripts}/emergency-clean | 0 {scripts => hm/scripts}/gitCheckoutModes | 0 {scripts => hm/scripts}/gitghost | 0 {scripts => hm/scripts}/jour | 0 {scripts => hm/scripts}/lestrte | 0 {scripts => hm/scripts}/letrtes | 0 {scripts => hm/scripts}/lip | 0 {scripts => hm/scripts}/lorem | 0 {scripts => hm/scripts}/mediaDuration | 0 {scripts => hm/scripts}/music_remove_dashes | 0 {scripts => hm/scripts}/nuit | 0 {scripts => hm/scripts}/o | 0 {scripts => hm/scripts}/optimize | 0 {scripts => hm/scripts}/overpdf | 0 {scripts => hm/scripts}/pdfpages | 0 {scripts => hm/scripts}/pdfrename | 0 {scripts => hm/scripts}/picture_name_date | 0 {scripts => hm/scripts}/pushToTalk | 0 {scripts => hm/scripts}/raw_move_precomp | 0 {scripts => hm/scripts}/rep | 0 {scripts => hm/scripts}/replayGain | 0 {scripts => hm/scripts}/rmf | 0 {scripts => hm/scripts}/rssVideos | 0 {scripts => hm/scripts}/smtpdummy | 0 {scripts => hm/scripts}/spongebob | 0 {scripts => hm/scripts}/syncthingRestore | 0 {scripts => hm/scripts}/tagCreatorPhotos | 0 {scripts => hm/scripts}/ter | 0 {scripts => hm/scripts}/unziptree | 0 {scripts => hm/scripts}/updateCompressedMusic | 0 {scripts => hm/scripts}/videoQuota | 0 {scripts => hm/scripts}/wttr | 0 options.nix | 9 --------- 49 files changed, 2 insertions(+), 11 deletions(-) rename {scripts => hm/scripts}/.bsh/bashrc (100%) rename {scripts => hm/scripts}/.bsh/bashrc_unsortable (100%) rename {scripts => hm/scripts}/.bsh/inputrc (100%) rename {scripts => hm/scripts}/.bsh/vimrc (100%) rename {scripts => hm/scripts}/.gitignore (100%) rename {scripts => hm/scripts}/archive (100%) rename {scripts => hm/scripts}/bsh (100%) rename {scripts => hm/scripts}/cached_pass (100%) rename {scripts => hm/scripts}/camera_name_date (100%) rename {scripts => hm/scripts}/cleandev (100%) rename {scripts => hm/scripts}/compressPictureMovies (100%) rename {scripts => hm/scripts}/crepuscule (100%) rename {scripts => hm/scripts}/docker-image-childs (100%) rename {scripts => hm/scripts}/docker-rm (100%) rename {scripts => hm/scripts}/dummy (100%) rename {scripts => hm/scripts}/emergency-clean (100%) rename {scripts => hm/scripts}/gitCheckoutModes (100%) rename {scripts => hm/scripts}/gitghost (100%) rename {scripts => hm/scripts}/jour (100%) rename {scripts => hm/scripts}/lestrte (100%) rename {scripts => hm/scripts}/letrtes (100%) rename {scripts => hm/scripts}/lip (100%) rename {scripts => hm/scripts}/lorem (100%) rename {scripts => hm/scripts}/mediaDuration (100%) rename {scripts => hm/scripts}/music_remove_dashes (100%) rename {scripts => hm/scripts}/nuit (100%) rename {scripts => hm/scripts}/o (100%) rename {scripts => hm/scripts}/optimize (100%) rename {scripts => hm/scripts}/overpdf (100%) rename {scripts => hm/scripts}/pdfpages (100%) rename {scripts => hm/scripts}/pdfrename (100%) rename {scripts => hm/scripts}/picture_name_date (100%) rename {scripts => hm/scripts}/pushToTalk (100%) rename {scripts => hm/scripts}/raw_move_precomp (100%) rename {scripts => hm/scripts}/rep (100%) rename {scripts => hm/scripts}/replayGain (100%) rename {scripts => hm/scripts}/rmf (100%) rename {scripts => hm/scripts}/rssVideos (100%) rename {scripts => hm/scripts}/smtpdummy (100%) rename {scripts => hm/scripts}/spongebob (100%) rename {scripts => hm/scripts}/syncthingRestore (100%) rename {scripts => hm/scripts}/tagCreatorPhotos (100%) rename {scripts => hm/scripts}/ter (100%) rename {scripts => hm/scripts}/unziptree (100%) rename {scripts => hm/scripts}/updateCompressedMusic (100%) rename {scripts => hm/scripts}/videoQuota (100%) rename {scripts => hm/scripts}/wttr (100%) diff --git a/hm/common.nix b/hm/common.nix index 1d9f92d..94ef5b3 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -349,7 +349,7 @@ in }; services = { gpg-agent = { - enable = true; + enable = true; # TODO Consider not enabling it when not having any private key enableBashIntegration = true; enableZshIntegration = true; pinentryFlavor = "gtk2"; # Falls back to curses when needed @@ -495,7 +495,7 @@ in sessionPath = [ "${config.home.homeDirectory}/.local/bin" "${config.home.sessionVariables.GOPATH}" - "${config.frogeye.dotfiles.path}/scripts" + (builtins.toString ./scripts) ]; file = { ".face" = { diff --git a/scripts/.bsh/bashrc b/hm/scripts/.bsh/bashrc similarity index 100% rename from scripts/.bsh/bashrc rename to hm/scripts/.bsh/bashrc diff --git a/scripts/.bsh/bashrc_unsortable b/hm/scripts/.bsh/bashrc_unsortable similarity index 100% rename from scripts/.bsh/bashrc_unsortable rename to hm/scripts/.bsh/bashrc_unsortable diff --git a/scripts/.bsh/inputrc b/hm/scripts/.bsh/inputrc similarity index 100% rename from scripts/.bsh/inputrc rename to hm/scripts/.bsh/inputrc diff --git a/scripts/.bsh/vimrc b/hm/scripts/.bsh/vimrc similarity index 100% rename from scripts/.bsh/vimrc rename to hm/scripts/.bsh/vimrc diff --git a/scripts/.gitignore b/hm/scripts/.gitignore similarity index 100% rename from scripts/.gitignore rename to hm/scripts/.gitignore diff --git a/scripts/archive b/hm/scripts/archive similarity index 100% rename from scripts/archive rename to hm/scripts/archive diff --git a/scripts/bsh b/hm/scripts/bsh similarity index 100% rename from scripts/bsh rename to hm/scripts/bsh diff --git a/scripts/cached_pass b/hm/scripts/cached_pass similarity index 100% rename from scripts/cached_pass rename to hm/scripts/cached_pass diff --git a/scripts/camera_name_date b/hm/scripts/camera_name_date similarity index 100% rename from scripts/camera_name_date rename to hm/scripts/camera_name_date diff --git a/scripts/cleandev b/hm/scripts/cleandev similarity index 100% rename from scripts/cleandev rename to hm/scripts/cleandev diff --git a/scripts/compressPictureMovies b/hm/scripts/compressPictureMovies similarity index 100% rename from scripts/compressPictureMovies rename to hm/scripts/compressPictureMovies diff --git a/scripts/crepuscule b/hm/scripts/crepuscule similarity index 100% rename from scripts/crepuscule rename to hm/scripts/crepuscule diff --git a/scripts/docker-image-childs b/hm/scripts/docker-image-childs similarity index 100% rename from scripts/docker-image-childs rename to hm/scripts/docker-image-childs diff --git a/scripts/docker-rm b/hm/scripts/docker-rm similarity index 100% rename from scripts/docker-rm rename to hm/scripts/docker-rm diff --git a/scripts/dummy b/hm/scripts/dummy similarity index 100% rename from scripts/dummy rename to hm/scripts/dummy diff --git a/scripts/emergency-clean b/hm/scripts/emergency-clean similarity index 100% rename from scripts/emergency-clean rename to hm/scripts/emergency-clean diff --git a/scripts/gitCheckoutModes b/hm/scripts/gitCheckoutModes similarity index 100% rename from scripts/gitCheckoutModes rename to hm/scripts/gitCheckoutModes diff --git a/scripts/gitghost b/hm/scripts/gitghost similarity index 100% rename from scripts/gitghost rename to hm/scripts/gitghost diff --git a/scripts/jour b/hm/scripts/jour similarity index 100% rename from scripts/jour rename to hm/scripts/jour diff --git a/scripts/lestrte b/hm/scripts/lestrte similarity index 100% rename from scripts/lestrte rename to hm/scripts/lestrte diff --git a/scripts/letrtes b/hm/scripts/letrtes similarity index 100% rename from scripts/letrtes rename to hm/scripts/letrtes diff --git a/scripts/lip b/hm/scripts/lip similarity index 100% rename from scripts/lip rename to hm/scripts/lip diff --git a/scripts/lorem b/hm/scripts/lorem similarity index 100% rename from scripts/lorem rename to hm/scripts/lorem diff --git a/scripts/mediaDuration b/hm/scripts/mediaDuration similarity index 100% rename from scripts/mediaDuration rename to hm/scripts/mediaDuration diff --git a/scripts/music_remove_dashes b/hm/scripts/music_remove_dashes similarity index 100% rename from scripts/music_remove_dashes rename to hm/scripts/music_remove_dashes diff --git a/scripts/nuit b/hm/scripts/nuit similarity index 100% rename from scripts/nuit rename to hm/scripts/nuit diff --git a/scripts/o b/hm/scripts/o similarity index 100% rename from scripts/o rename to hm/scripts/o diff --git a/scripts/optimize b/hm/scripts/optimize similarity index 100% rename from scripts/optimize rename to hm/scripts/optimize diff --git a/scripts/overpdf b/hm/scripts/overpdf similarity index 100% rename from scripts/overpdf rename to hm/scripts/overpdf diff --git a/scripts/pdfpages b/hm/scripts/pdfpages similarity index 100% rename from scripts/pdfpages rename to hm/scripts/pdfpages diff --git a/scripts/pdfrename b/hm/scripts/pdfrename similarity index 100% rename from scripts/pdfrename rename to hm/scripts/pdfrename diff --git a/scripts/picture_name_date b/hm/scripts/picture_name_date similarity index 100% rename from scripts/picture_name_date rename to hm/scripts/picture_name_date diff --git a/scripts/pushToTalk b/hm/scripts/pushToTalk similarity index 100% rename from scripts/pushToTalk rename to hm/scripts/pushToTalk diff --git a/scripts/raw_move_precomp b/hm/scripts/raw_move_precomp similarity index 100% rename from scripts/raw_move_precomp rename to hm/scripts/raw_move_precomp diff --git a/scripts/rep b/hm/scripts/rep similarity index 100% rename from scripts/rep rename to hm/scripts/rep diff --git a/scripts/replayGain b/hm/scripts/replayGain similarity index 100% rename from scripts/replayGain rename to hm/scripts/replayGain diff --git a/scripts/rmf b/hm/scripts/rmf similarity index 100% rename from scripts/rmf rename to hm/scripts/rmf diff --git a/scripts/rssVideos b/hm/scripts/rssVideos similarity index 100% rename from scripts/rssVideos rename to hm/scripts/rssVideos diff --git a/scripts/smtpdummy b/hm/scripts/smtpdummy similarity index 100% rename from scripts/smtpdummy rename to hm/scripts/smtpdummy diff --git a/scripts/spongebob b/hm/scripts/spongebob similarity index 100% rename from scripts/spongebob rename to hm/scripts/spongebob diff --git a/scripts/syncthingRestore b/hm/scripts/syncthingRestore similarity index 100% rename from scripts/syncthingRestore rename to hm/scripts/syncthingRestore diff --git a/scripts/tagCreatorPhotos b/hm/scripts/tagCreatorPhotos similarity index 100% rename from scripts/tagCreatorPhotos rename to hm/scripts/tagCreatorPhotos diff --git a/scripts/ter b/hm/scripts/ter similarity index 100% rename from scripts/ter rename to hm/scripts/ter diff --git a/scripts/unziptree b/hm/scripts/unziptree similarity index 100% rename from scripts/unziptree rename to hm/scripts/unziptree diff --git a/scripts/updateCompressedMusic b/hm/scripts/updateCompressedMusic similarity index 100% rename from scripts/updateCompressedMusic rename to hm/scripts/updateCompressedMusic diff --git a/scripts/videoQuota b/hm/scripts/videoQuota similarity index 100% rename from scripts/videoQuota rename to hm/scripts/videoQuota diff --git a/scripts/wttr b/hm/scripts/wttr similarity index 100% rename from scripts/wttr rename to hm/scripts/wttr diff --git a/options.nix b/options.nix index 0242b89..995cffa 100644 --- a/options.nix +++ b/options.nix @@ -18,15 +18,6 @@ fpga = lib.mkEnableOption "FPGA dev stuff"; python = lib.mkEnableOption "Python dev stuff"; }; - dotfiles = { - path = lib.mkOption { - type = lib.types.str; - description = "Absolute path to the present dotfiles directory"; - # default = "${config.home.homeDirectory}/.config/dotfiles"; - # FIXME Above doesn't work outside home-manager context - default = "/home/geoffrey/.config/dotfiles"; - }; - }; }; config = { From cc13cabad58da9e1662629a91d8d0288e858936d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 1 Dec 2023 22:19:52 +0100 Subject: [PATCH 091/108] Misc things proted from extension, and fixes Back to the non-descriptive commit names again lol --- hm/common.nix | 2 ++ hm/desktop.nix | 31 +++++++++++++++++++++++++------ hm/extra.nix | 1 - 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/hm/common.nix b/hm/common.nix index 94ef5b3..f8afb9f 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -19,6 +19,8 @@ let in { + nixpkgs.config.allowUnfree = true; + programs = let commonRc = lib.strings.concatLines ([ diff --git a/hm/desktop.nix b/hm/desktop.nix index d022f51..e78d47b 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -57,7 +57,7 @@ { modifier = "Mod1"; # FIXME Mod1 for VM, Mod4 for not VM terminal = "alacritty"; - bars = []; # Using frobar + bars = [ ]; # Using frobar colors = let ignore = "#ff00ff"; in with config.lib.stylix.colors.withHashtag; lib.mkForce { focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; }; @@ -348,17 +348,28 @@ # TODO Unbind d and T (?) }; }; - loadAutoconfig = true; # FIXME Salvage stuff from autoconfig.yml + loadAutoconfig = true; searchEngines = rec { DEFAULT = ecosia; + alpinep = "https://pkgs.alpinelinux.org/packages?name={}&branch=edge"; ampwhat = "http://www.amp-what.com/unicode/search/{}"; + arch = "https://wiki.archlinux.org/?search={}"; + archp = "https://www.archlinux.org/packages/?q={}"; + aur = "https://aur.archlinux.org/packages/?K={}"; aw = ampwhat; ddg = duckduckgo; + dockerhub = "https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q={}&starCount=0"; duckduckgo = "https://duckduckgo.com/?q={}&ia=web"; ecosia = "https://www.ecosia.org/search?q={}"; + gfr = "https://www.google.fr/search?hl=fr&q={}"; + g = google; + gh = github; + gi = "http://images.google.com/search?q={}"; + giphy = "https://giphy.com/search/{}"; github = "https://github.com/search?q={}"; google = "https://www.google.fr/search?q={}"; - g = google; + invidious = "https://invidious.frogeye.fr/search?q={}"; + inv = invidious; npm = "https://www.npmjs.com/search?q={}"; q = qwant; qwant = "https://www.qwant.com/?t=web&q={}"; @@ -372,16 +383,23 @@ show = "never"; tabs_are_windows = true; }; - url = { + url = rec { open_base_url = true; - start_pages = "https://geoffrey.frogeye.fr/blank.html"; + start_pages = lib.mkDefault "https://geoffrey.frogeye.fr/blank.html"; + default_page = start_pages; }; content = { # I had this setting below, not sure if it did something special # config.set("content.cookies.accept", "no-3rdparty", "chrome://*/*") cookies.accept = "no-3rdparty"; prefers_reduced_motion = true; + headers.accept_language = "fr-FR, fr;q=0.9, en-GB;q=0.8, en-US;q=0.7, en;q=0.6"; + tls.certificate_errors = "ask-block-thirdparty"; }; + editor.command = [ "${pkgs.neovide}/bin/neovide" "--" "-f" "{file}" "-c" "normal {line}G{column0}l" ]; + # TODO Doesn't work on Arch. Does it even load the right profile on Nix? + # TODO spellcheck.languages = ["fr-FR" "en-GB" "en-US"]; + }; }; @@ -446,6 +464,8 @@ }; }; rofi = { + # TODO This theme template, that was used for Arch, looks much better: + # https://gitlab.com/jordiorlando/base16-rofi/-/blob/master/templates/default.mustache enable = true; pass.enable = true; extraConfig = { @@ -631,7 +651,6 @@ zathura meld python3Packages.magic - yubikey-touch-detector # x11-exclusive numlockx diff --git a/hm/extra.nix b/hm/extra.nix index b20de1b..22d2eb7 100644 --- a/hm/extra.nix +++ b/hm/extra.nix @@ -20,7 +20,6 @@ android-tools # downloading - megatools # transmission TODO Collision if both transmissions are active? # Multimedia toolbox From e01c454d68ff12e9bd744255fd862e9f8e797a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 2 Dec 2023 17:37:34 +0100 Subject: [PATCH 092/108] Port common SSH config from extension --- hm/common.nix | 4 ++-- hm/ssh.nix | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 hm/ssh.nix diff --git a/hm/common.nix b/hm/common.nix index f8afb9f..f291247 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -274,8 +274,8 @@ in ".mypy_cache" ]; lfs.enable = true; - userEmail = "geoffrey@frogeye.fr"; - userName = "Geoffrey “Frogeye” Preud'homme"; + userEmail = lib.mkDefault "geoffrey@frogeye.fr"; + userName = lib.mkDefault "Geoffrey Frogeye"; extraConfig = { core = { editor = "nvim"; diff --git a/hm/ssh.nix b/hm/ssh.nix new file mode 100644 index 0000000..f085041 --- /dev/null +++ b/hm/ssh.nix @@ -0,0 +1,24 @@ +{ ... }: +{ + config = { + programs.ssh = { + enable = true; + controlMaster = "auto"; + controlPersist = "60s"; # TODO Default is 10minutes... makes more sense no? + # Ping the server frequently enough so it doesn't think we left (non-spoofable) + serverAliveInterval = 30; + matchBlocks."*" = { + # Do not forward the agent (-A) to a machine by default, + # as it is kinda a security concern + forwardAgent = false; + # Restrict terminal features (servers don't necessarily have the terminfo for my cutting edge terminal) + sendEnv = [ "!TERM" ]; + # TODO Why not TERM=xterm-256color? + extraOptions = { + # Check SSHFP records + VerifyHostKeyDNS = "yes"; + }; + }; + }; + }; +} From 25011a33536c8d1cf061c75efe8b794536c63cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 2 Dec 2023 18:05:33 +0100 Subject: [PATCH 093/108] Add options for aliases So they can be added from extensions --- hm/common.nix | 17 +++-------------- hm/default.nix | 1 + hm/desktop.nix | 12 ++++++++++++ options.nix | 14 ++++++++++++++ 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/hm/common.nix b/hm/common.nix index f291247..7f3f353 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -104,13 +104,6 @@ in # ll = "ls -l"; # Disabled because would overwrite the colored one # la = "ls -la"; # Eh maybe it's not that bad, but for now let's keep compatibility s = "sudo -s -E"; - # n = "$HOME/.config/i3/terminal & disown"; # Not used anymore since alacritty daemon mode doesn't preserve environment variables - x = "startx ${config.xdg.configHome}/xinitrc; logout"; - nx = "nvidia-xrun ${config.xdg.configHome}/xinitrc; sudo systemctl start nvidia-xrun-pm; logout"; - # TODO Put in display.nix - # Was also thinking of not storing the config in .config and use nix-store instead, - # but maybe it's a bad idea as home-manager switch doesn't replace aliases in running shells - # FIXME Is it still relevant with NixOS? # Give additional config to those programs, and not have them in my path @@ -141,11 +134,6 @@ in newestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | tail''; oldestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | head''; tracefiles = ''${pkgs.strace}/bin/strace -f -t -e trace=file''; - } // lib.optionalAttrs config.frogeye.desktop.xorg { - noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise''; - beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null''; - # FIXME ALSA lib dlmisc.c:337:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_pulse.so (/nix/store/9b06fxbvm07iy9f9dvi5vk2iy9pk8hyz-alsa-lib-1.2.8/lib/alsa-lib/libasound_module_pcm_pulse.so: cannot open shared object file: No such file or directory) - } // lib.attrsets.mergeAttrsList (map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) treatsHomeAsJunk); # TODO Maybe make nixpkg wrapper instead? So it also works from dmenu # Could also accept my fate... Home-manager doesn't necessarily make it easy to put things out of the home directory @@ -153,6 +141,7 @@ in historyFile = "${config.xdg.cacheHome}/shell_history"; in { + home-manager.enable = true; bash = { enable = true; @@ -168,7 +157,7 @@ in historyFile = historyFile; historyFileSize = historySize; historyControl = [ "erasedups" "ignoredups" "ignorespace" ]; - shellAliases = commonShellAliases; + shellAliases = commonShellAliases // config.frogeye.shellAliases; }; zsh = { enable = true; @@ -188,7 +177,7 @@ in expireDuplicatesFirst = true; }; sessionVariables = commonSessionVariables; - shellAliases = commonShellAliases; + shellAliases = commonShellAliases // config.frogeye.shellAliases; }; dircolors = { enable = true; diff --git a/hm/default.nix b/hm/default.nix index 4aa7b32..389d559 100644 --- a/hm/default.nix +++ b/hm/default.nix @@ -6,6 +6,7 @@ ./desktop.nix ./dev.nix ./extra.nix + ./ssh.nix ./style.nix ./vim.nix ]; diff --git a/hm/desktop.nix b/hm/desktop.nix index e78d47b..0f0a5c7 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -1,6 +1,18 @@ { pkgs, config, lib, ... }: { config = lib.mkIf config.frogeye.desktop.xorg { + frogeye.shellAliases = { + noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise''; + beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null''; + # FIXME ALSA lib dlmisc.c:337:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_pulse.so (/nix/store/9b06fxbvm07iy9f9dvi5vk2iy9pk8hyz-alsa-lib-1.2.8/lib/alsa-lib/libasound_module_pcm_pulse.so: cannot open shared object file: No such file or directory) + + # n = "$HOME/.config/i3/terminal & disown"; # Not used anymore since alacritty daemon mode doesn't preserve environment variables + x = "startx ${config.xdg.configHome}/xinitrc; logout"; + nx = "nvidia-xrun ${config.xdg.configHome}/xinitrc; sudo systemctl start nvidia-xrun-pm; logout"; + # Was also thinking of not storing the config in .config and use nix-store instead, + # but maybe it's a bad idea as home-manager switch doesn't replace aliases in running shells + # FIXME Is it still relevant with NixOS? + }; xsession = { enable = true; windowManager = { diff --git a/options.nix b/options.nix index 995cffa..6dc3379 100644 --- a/options.nix +++ b/options.nix @@ -18,6 +18,20 @@ fpga = lib.mkEnableOption "FPGA dev stuff"; python = lib.mkEnableOption "Python dev stuff"; }; + shellAliases = lib.mkOption { + default = { }; + example = lib.literalExpression '' + { + ll = "ls -l"; + ".." = "cd .."; + } + ''; + description = '' + An attribute set that maps aliases (the top level attribute names in + this option) to command strings or directly to build outputs. + ''; + type = lib.types.attrsOf lib.types.str; + }; }; config = { From c9156044f81ffaeebd3ba3ada59eb27a9bfda0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 2 Dec 2023 18:50:31 +0100 Subject: [PATCH 094/108] =?UTF-8?q?Add=20documentation=20=F0=9F=A4=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Say whaaaaat? --- README.md | 37 ++++++++++++++++++++++++++++++ build_os.sh | 1 + curacao/os.nix | 2 +- curacao_usb/{disko.nix => dk.nix} | 0 curacao_usb/os.nix | 2 +- install_os.sh | 5 ++-- pindakaas/os.nix | 2 +- pindakaas_sd/{disko.nix => dk.nix} | 0 pindakaas_sd/os.nix | 2 +- 9 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 README.md rename curacao_usb/{disko.nix => dk.nix} (100%) rename pindakaas_sd/{disko.nix => dk.nix} (100%) diff --git a/README.md b/README.md new file mode 100644 index 0000000..6088706 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# Geoffrey Frogeye's dotfiles + +This repo holds most of my systems configuration. +It is built on top of the Nix ecosystem + +## Directory structure + +- `os`, `hm`, `nod`: Re-usable configuration for [NixOS](https://nixos.org/), [home-manager](https://github.com/nix-community/home-manager/#home-manager-using-nix), [Nix-on-Droid](https://github.com/nix-community/nix-on-droid#nix-on-droid) respectively + - ``: Module. Used to separate configuration in separate logical units. + - `default.nix`: Entrypoint for that module. Contains Nix configuration for the module. + - ``: Extra files: scripts to be installed, or ... whatever. + - `default.nix`: Entrypoint for that system. Import all the modules. + - ``: Files non-conforming to the structure above because I'm hurrying to have everything working before cleaning. +- `dk`: Re-usable configuration for [disko](https://github.com/nix-community/disko#disko---declarative-disk-partitioning) + - `.nix`: Partitionning scheme configuration. Don't assume a specific context, it will be imported as Disko and NixOS config. +- `options.nix`: Definition of options exposed to all systems (even though if not relevant for all, it's for simplicity sake). +- `` (e.g. `curacao`): Configurations for my different devices + - `options.nix`: Common options configuration. Don't assume a specific context (for reasons unclear, I'm sure I can do something with that). + - `hardware.nix`: NixOS configuration for that specific device. + - `dk.nix`: Partitionning configuration. Import a top-level `dk` scheme, adding disks ids and other configuration required. + - `os.nix`, `hm.nix`, `nod.nix`: Entrypoint for the device/system configuration. Imports the above files (last two only for NixOS) and contains configuration specific to this combination. +- `_` (e.g. `pindakaas_sd`): Alternate configuration for a device. Used to test a configuration without altering the "main" one. + - `options.nix`: Same as above. Can be a symlink. + - `hardware.nix`: Same as above. Should be a symlink. + - `dk.nix`: Same as above. Should not be a symlink. + - `os.nix`, `hm.nix`, `nod.nix`: Same as above. Should not be a symlink. + +## Scripts + +They all have a `-h` flag. +Except `add_channels.sh`, which should be removed as soon as I migrate to Flakes. + +## Extensions + +There's some things I'm not putting in this public repo: work-related things, and other sensitive things that probably shouldn't be public. +Those are stored in extensions, i.e. repos with a similar structure to this one, and ultimately importing things from it. +This is why you might see options not being seemingly used. diff --git a/build_os.sh b/build_os.sh index 7c15d89..2c655d9 100755 --- a/build_os.sh +++ b/build_os.sh @@ -8,6 +8,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # Parse arguments function help { echo "Usage: $0 [-h|-v|-b] profile" + echo "Build NixOS configuration on the local machine." echo echo "Arguments:" echo " profile: OS/disk profile to use" diff --git a/curacao/os.nix b/curacao/os.nix index fd60a8c..3bd283d 100644 --- a/curacao/os.nix +++ b/curacao/os.nix @@ -4,7 +4,7 @@ ../os ./options.nix ./hardware.nix - ./disko.nix + ./dk.nix ]; networking.hostName = "curacao"; diff --git a/curacao_usb/disko.nix b/curacao_usb/dk.nix similarity index 100% rename from curacao_usb/disko.nix rename to curacao_usb/dk.nix diff --git a/curacao_usb/os.nix b/curacao_usb/os.nix index 32b2211..59d3b3d 100644 --- a/curacao_usb/os.nix +++ b/curacao_usb/os.nix @@ -4,7 +4,7 @@ ../os ../curacao/options.nix ../curacao/hardware.nix - ./disko.nix + ./dk.nix ]; networking.hostName = "curacao_usb"; diff --git a/install_os.sh b/install_os.sh index 87bf1b3..8b642f6 100755 --- a/install_os.sh +++ b/install_os.sh @@ -8,13 +8,14 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # Parse arguments function help { echo "Usage: $0 [-h|-e] profile" + echo "Install NixOS on a device." echo echo "Arguments:" echo " profile: OS/disk profile to use" echo echo "Options:" echo " -h: Display this help message." - echo " -e: Erase the disk. This can be used in case the wanted partition scheme doesn't match." + echo " -e: Erase the disk. For cases where the partition scheme doesn't match the existing one." } disko_mode=mount @@ -49,7 +50,7 @@ then echo "Profile not found." fi -disko_config="${profile_dir}/disko.nix" +disko_config="${profile_dir}/dk.nix" if [ ! -f "$disko_config" ] then echo "Disk configuration not found." diff --git a/pindakaas/os.nix b/pindakaas/os.nix index e0e1f93..9a992d4 100644 --- a/pindakaas/os.nix +++ b/pindakaas/os.nix @@ -3,7 +3,7 @@ imports = [ ../os ./hardware.nix - ./disko.nix + ./dk.nix ./options.nix ]; diff --git a/pindakaas_sd/disko.nix b/pindakaas_sd/dk.nix similarity index 100% rename from pindakaas_sd/disko.nix rename to pindakaas_sd/dk.nix diff --git a/pindakaas_sd/os.nix b/pindakaas_sd/os.nix index 351874c..75219ff 100644 --- a/pindakaas_sd/os.nix +++ b/pindakaas_sd/os.nix @@ -4,7 +4,7 @@ ../os ../pindakaas/options.nix ../pindakaas/hardware.nix - ./disko.nix + ./dk.nix ]; networking.hostName = "pindakaas_sd"; From a137506a1358b9c27e6b1c4e0c17958d8fafba5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 2 Dec 2023 21:50:59 +0100 Subject: [PATCH 095/108] Separate option for gaming --- curacao/options.nix | 1 + full/options.nix | 1 + hm/common.nix | 1 + hm/default.nix | 1 + hm/extra.nix | 8 -------- hm/gaming/default.nix | 15 +++++++++++++++ options.nix | 1 + os/default.nix | 3 ++- os/gaming/default.nix | 7 +++++++ 9 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 hm/gaming/default.nix create mode 100644 os/gaming/default.nix diff --git a/curacao/options.nix b/curacao/options.nix index 0fcf285..be760c1 100644 --- a/curacao/options.nix +++ b/curacao/options.nix @@ -6,5 +6,6 @@ docker = true; }; extra = true; + gaming = true; }; } diff --git a/full/options.nix b/full/options.nix index 33b7620..e4b1dda 100644 --- a/full/options.nix +++ b/full/options.nix @@ -10,5 +10,6 @@ python = true; }; extra = true; + gaming = true; }; } diff --git a/hm/common.nix b/hm/common.nix index 7f3f353..f8a026c 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -395,6 +395,7 @@ in curl python3Packages.pip rename + which # shell zsh-completions diff --git a/hm/default.nix b/hm/default.nix index 389d559..13087c4 100644 --- a/hm/default.nix +++ b/hm/default.nix @@ -6,6 +6,7 @@ ./desktop.nix ./dev.nix ./extra.nix + ./gaming ./ssh.nix ./style.nix ./vim.nix diff --git a/hm/extra.nix b/hm/extra.nix index 22d2eb7..37423c3 100644 --- a/hm/extra.nix +++ b/hm/extra.nix @@ -51,16 +51,8 @@ transmission-qt # FIXME Below not on aarch64 - # wine wine # TODO wine-gecko wine-mono lib32-libpulse (?) - - # gaming - # steam # FIXME Requires i686-linux or something. IIRC the package says to use the NixOS config and not it directly. - yuzu-mainline - minecraft - # TODO factorio - ]); }; } diff --git a/hm/gaming/default.nix b/hm/gaming/default.nix new file mode 100644 index 0000000..3eaf8c2 --- /dev/null +++ b/hm/gaming/default.nix @@ -0,0 +1,15 @@ +{ pkgs, lib, config, ... }: +{ + config = lib.mkIf config.frogeye.gaming { + # Using config.nixpkgs. creates an infinite recursion, + # but the above might not be correct in case of cross-compiling? + home.packages = with pkgs; [ + # gaming + yuzu-mainline + minecraft + # TODO factorio + + steam # Common pitfall: https://github.com/NixOS/nixpkgs/issues/86506#issuecomment-623746883 + ]; + }; +} diff --git a/options.nix b/options.nix index 6dc3379..4b763d5 100644 --- a/options.nix +++ b/options.nix @@ -2,6 +2,7 @@ { options.frogeye = { extra = lib.mkEnableOption "Big software"; + gaming = lib.mkEnableOption "Games"; desktop = { xorg = lib.mkEnableOption "Enable X11 support"; nixGLIntel = lib.mkEnableOption "Enable nixGLIntel/nixVulkanIntel for windows manager"; diff --git a/os/default.nix b/os/default.nix index c60ff95..f693171 100644 --- a/os/default.nix +++ b/os/default.nix @@ -3,9 +3,10 @@ imports = [ ../options.nix ./battery.nix - ./geoffrey.nix ./common.nix ./desktop.nix + ./gaming + ./geoffrey.nix ./wireless.nix "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22.tar.gz"}/module.nix" ]; diff --git a/os/gaming/default.nix b/os/gaming/default.nix new file mode 100644 index 0000000..d4284dd --- /dev/null +++ b/os/gaming/default.nix @@ -0,0 +1,7 @@ +{ pkgs, lib, config, ... }: +{ + config = lib.mkIf config.frogeye.gaming { + programs.steam.enable = true; + hardware.opengl.driSupport32Bit = true; # Enables support for 32bit libs that steam uses + }; +} From 4a5c6d9ad3c9667ac03ff46e6baea8ef5b325073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 2 Dec 2023 22:12:20 +0100 Subject: [PATCH 096/108] Extra should work on aarch64 now --- hm/extra.nix | 5 +++-- pindakaas/options.nix | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hm/extra.nix b/hm/extra.nix index 37423c3..4d65521 100644 --- a/hm/extra.nix +++ b/hm/extra.nix @@ -49,8 +49,9 @@ # downloading transmission-qt - - # FIXME Below not on aarch64 + ] ++ lib.optionals (builtins.currentSystem == "x86_64-linux") [ + # Not sure this works in case of cross-compilation, but couldn't find a + # thing that works in both os and hm context wine # TODO wine-gecko wine-mono lib32-libpulse (?) ]); diff --git a/pindakaas/options.nix b/pindakaas/options.nix index f14ad67..7a7ef11 100644 --- a/pindakaas/options.nix +++ b/pindakaas/options.nix @@ -1,6 +1,6 @@ { ... }: { - frogeye.extra = false; # FIXME Not working yet + frogeye.extra = true; frogeye.desktop.xorg = true; frogeye.dev.docker = true; } From 5169cbc82c938ab94348a7a005cfb1334835a159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 2 Dec 2023 22:45:00 +0100 Subject: [PATCH 097/108] Less things that shouldn't be here :) --- os/common.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/os/common.nix b/os/common.nix index 8332453..2195533 100644 --- a/os/common.nix +++ b/os/common.nix @@ -25,7 +25,6 @@ wget kexec-tools openvpn - update-resolv-conf # TODO Is it what I think it is? # android tools android-udev-rules @@ -64,9 +63,6 @@ }; - # FIXME services.openvpn.servers..updateResolvConf=true - # For profiles in the extensions - # TODO Hibernation? # TEST From 6569596b8ae418a21848f060ff1ba3f5516659a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 2 Dec 2023 22:47:30 +0100 Subject: [PATCH 098/108] Things already fixed --- hm/common.nix | 10 +--------- os/geoffrey.nix | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/hm/common.nix b/hm/common.nix index f8a026c..35b972d 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -198,14 +198,6 @@ in }; extraUpdatePS1 = ''unset __TIMER''; }; - # neovim = { - # enable = true; - # defaultEditor = true; - # vimAlias = true; - # viAlias = true; - # vimdiffAlias = true; - # }; - # FIXME Still want this despite using nixvim gpg = { enable = true; homedir = "${config.xdg.stateHome}/gnupg"; @@ -381,7 +373,7 @@ in stateVersion = "23.11"; language = { base = "en_US.UTF-8"; - # time = "en_DK.UTF-8"; # FIXME Disabled because complaints during nixos-rebuild switch + # time = "en_DK.UTF-8"; # TODO Disabled because complaints during nixos-rebuild switch }; packages = with pkgs; [ # dotfiles dependencies diff --git a/os/geoffrey.nix b/os/geoffrey.nix index 556663d..2884532 100644 --- a/os/geoffrey.nix +++ b/os/geoffrey.nix @@ -32,6 +32,6 @@ useGlobalPkgs = true; }; - # FIXME Make sure I'm the only user & everything is encrypted + # Because everything is encrypted and I'm the only user, this is fine. services.xserver.displayManager.autoLogin.user = "geoffrey"; } From f12ff6a989f420b4ba677c6f2f24c424c7362e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 4 Dec 2023 22:47:02 +0100 Subject: [PATCH 099/108] Fix a lot of FIXMEs --- curacao/options.nix | 7 ++- dk/single_uefi_btrfs.nix | 2 +- hm/common.nix | 8 ++-- hm/desktop.nix | 47 ++++++++++++------- hm/extra.nix | 14 ++++-- hm/frobar/default.nix | 1 - hm/frobar/frobar/display.py | 2 +- hm/style.nix | 5 -- options.nix | 6 +++ os/desktop.nix | 13 +++++ os/sct_aarch64.patch | 10 ++++ pindakaas/options.nix | 6 ++- .../host_vars/pindakaas.geoffrey.frogeye.fr | 16 ------- 13 files changed, 86 insertions(+), 51 deletions(-) create mode 100644 os/sct_aarch64.patch delete mode 100644 unprocessed/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr diff --git a/curacao/options.nix b/curacao/options.nix index be760c1..a941a5f 100644 --- a/curacao/options.nix +++ b/curacao/options.nix @@ -1,7 +1,12 @@ { ... }: { frogeye = { - desktop.xorg = true; + desktop = { + xorg = true; + x11_screens = [ "HDMI-1-0" "eDP1" ]; + maxVideoHeight = 1440; + numlock = true; + }; dev = { docker = true; }; diff --git a/dk/single_uefi_btrfs.nix b/dk/single_uefi_btrfs.nix index b839c1f..979f3c7 100644 --- a/dk/single_uefi_btrfs.nix +++ b/dk/single_uefi_btrfs.nix @@ -26,7 +26,7 @@ content = { type = "luks"; name = "${name}"; - passwordFile = "/tmp/secret.key"; # TODO Generate this somehow + passwordFile = "/tmp/secret.key"; # FIXME Generate this somehow settings = { # Not having SSDs die fast is more important than crypto # nerds that could potentially discover which filesystem I diff --git a/hm/common.nix b/hm/common.nix index 35b972d..746ac95 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -238,7 +238,8 @@ in }; # TODO highlight or bat nix-index = { - enable = true; + enable = false; # TODO Index is impossible to generate, should use https://github.com/nix-community/nix-index-database + # but got no luck without flakes enableZshIntegration = true; }; less.enable = true; @@ -398,8 +399,6 @@ in # terminal essentials moreutils man - # nodePackages.insect # FIXME Don't install on aarch64 - # TODO Use whatever replaces insect unzip unrar p7zip @@ -448,6 +447,9 @@ in # TODO Lots of redundancy with other way things are defined here + ] ++ lib.optionals pkgs.stdenv.isx86_64 [ + nodePackages.insect + # TODO Use whatever replaces insect, hopefully that works on aarch64 ]; sessionVariables = { # Favourite commands diff --git a/hm/desktop.nix b/hm/desktop.nix index 0f0a5c7..f7a5920 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -4,7 +4,6 @@ frogeye.shellAliases = { noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise''; beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null''; - # FIXME ALSA lib dlmisc.c:337:(snd_dlobj_cache_get0) Cannot open shared library libasound_module_pcm_pulse.so (/nix/store/9b06fxbvm07iy9f9dvi5vk2iy9pk8hyz-alsa-lib-1.2.8/lib/alsa-lib/libasound_module_pcm_pulse.so: cannot open shared object file: No such file or directory) # n = "$HOME/.config/i3/terminal & disown"; # Not used anymore since alacritty daemon mode doesn't preserve environment variables x = "startx ${config.xdg.configHome}/xinitrc; logout"; @@ -67,7 +66,7 @@ mode_temp = "Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue"; in { - modifier = "Mod1"; # FIXME Mod1 for VM, Mod4 for not VM + modifier = "Mod4"; terminal = "alacritty"; bars = [ ]; # Using frobar colors = let ignore = "#ff00ff"; in @@ -86,14 +85,14 @@ mod = config.xsession.windowManager.i3.config.modifier; rofi = "exec --no-startup-id ${config.programs.rofi.package}/bin/rofi"; pactl = "exec ${pkgs.pulseaudio}/bin/pactl"; # TODO Use NixOS package if using NixOS - scrot = "${pkgs.scrot}/bin/scrot --exec '${pkgs.coreutils}/bin/mv $f ~/Screenshots/ && ${pkgs.optipng}/bin/optipng ~/Screenshots/$f'"; - # TODO nix path and create directory? + screenshots_dir = config.xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR; + scrot = "${pkgs.scrot}/bin/scrot --exec '${pkgs.coreutils}/bin/mv $f ${screenshots_dir}/ && ${pkgs.optipng}/bin/optipng ${screenshots_dir}/$f'"; in { # Compatibility layer for people coming from other backgrounds - # "Mod1+Tab" = "${rofi} -modi window -show window"; # FIXME When no longer using a VM + "Mod1+Tab" = "${rofi} -modi window -show window"; "Mod1+F2" = "${rofi} -modi drun -show drun"; - # "Mod1+F4" = "kill"; # FIXME When no longer using a VM + "Mod1+F4" = "kill"; # kill focused window "${mod}+z" = "kill"; button2 = "kill"; @@ -140,7 +139,7 @@ }"; # Screenshots "Print" = "exec ${scrot} --focused"; - "${mod}+Print" = "exec ${scrot}"; # FIXME Doesn't work at least in the VM + "${mod}+Print" = "exec ${scrot}"; "Ctrl+Print" = "exec ${pkgs.coreutils}/bin/sleep 1 && ${scrot} --select"; # TODO Try using bindsym --release instead of sleep # change focus @@ -282,13 +281,12 @@ "d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default"; } // return_bindings; "${mode_temp}" = { - # "r" = "exec ${pkgs.sct}/bin/sct 1000"; - # "d" = "exec ${pkgs.sct}/bin/sct 2000"; - # "c" = "exec ${pkgs.sct}/bin/sct 4500"; - # "o" = "exec ${pkgs.sct}/bin/sct"; - # "a" = "exec ${pkgs.sct}/bin/sct 8000"; - # "b" = "exec ${pkgs.sct}/bin/sct 10000"; - # FIXME Not on aarch64 + "r" = "exec ${pkgs.sct}/bin/sct 1000"; + "d" = "exec ${pkgs.sct}/bin/sct 2000"; + "c" = "exec ${pkgs.sct}/bin/sct 4500"; + "o" = "exec ${pkgs.sct}/bin/sct"; + "a" = "exec ${pkgs.sct}/bin/sct 8000"; + "b" = "exec ${pkgs.sct}/bin/sct 10000"; } // return_bindings; }; window = { @@ -312,6 +310,7 @@ ]; }; startup = [ + { notification = false; command = "${pkgs.autorandr}/bin/autorandr --change"; } # Lock screen after 10 minutes { notification = false; command = "${pkgs.xautolock}/bin/xautolock -time 10 -locker '${pkgs.xorg.xset}/bin/xset dpms force standby' -killtime 1 -killer ${locker}"; } { @@ -330,7 +329,7 @@ focus.mouseWarping = true; # i3 only supports warping to workspace, hence ${focus} workspaceOutputAssign = let - x11_screens = [ "HDMI-1-0" "eDP1" ]; # FIXME Per computer thing + x11_screens = config.frogeye.desktop.x11_screens; workspaces = map (i: { name = toString i; key = toString (lib.mod i 10); }) (lib.lists.range 1 10); forEachWorkspace = f: map (w: f { w = w; workspace = ((builtins.elemAt workspaces w)); }) (lib.lists.range 0 ((builtins.length workspaces) - 1)); in @@ -338,7 +337,7 @@ }; }; }; - numlock.enable = true; # FIXME Only on computers with a separate one + numlock.enable = config.frogeye.desktop.numlock; }; programs = { @@ -417,7 +416,14 @@ # Terminal alacritty = { - # FIXME Emojis + # TODO Emojis. Or maybe they work on NixOS? + # Arch (working) shows this with alacritty -vvv: + # [TRACE] [crossfont] Got font path="/usr/share/fonts/twemoji/twemoji.ttf", index=0 + # [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: MONOCHROME | TARGET_MONO | COLOR, render_mode: "Mono", lcd_filter: 1 } + # Nix (not working) shows this: + # [TRACE] [crossfont] Got font path="/nix/store/872g3w9vcr5nh93r0m83a3yzmpvd2qrj-home-manager-path/share/fonts/truetype/TwitterColorEmoji-SVGinOT.ttf", index=0 + # [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT | COLOR, render_mode: "Lcd", lcd_filter: 1 } + enable = true; settings = { bell = { @@ -427,6 +433,11 @@ duration = 100; }; cursor = { vi_mode_style = "Underline"; }; + env = { + WINIT_X11_SCALE_FACTOR = "1"; + # Prevents Alacritty from resizing from one monitor to another. + # Might cause issue on HiDPI screens but we'll get there when we get there + }; hints = { enabled = [ { @@ -681,6 +692,8 @@ ]; sessionVariables = { MPD_PORT = "${toString config.services.mpd.network.port}"; + ALSA_PLUGIN_DIR = "${pkgs.alsa-plugins}/lib/alsa-lib"; # Fixes an issue with sox (Cannot open shared library libasound_module_pcm_pulse.so) + # UPST Patch this upstream like: https://github.com/NixOS/nixpkgs/blob/216b111fb87091632d077898df647d1438fc2edb/pkgs/applications/audio/espeak-ng/default.nix#L84 }; }; }; diff --git a/hm/extra.nix b/hm/extra.nix index 4d65521..c716de5 100644 --- a/hm/extra.nix +++ b/hm/extra.nix @@ -42,18 +42,22 @@ gimp inkscape darktable - blender puddletag - musescore audacity # downloading transmission-qt - ] ++ lib.optionals (builtins.currentSystem == "x86_64-linux") [ - # Not sure this works in case of cross-compilation, but couldn't find a - # thing that works in both os and hm context + # wine only makes sense on x86_64 + ] ++ lib.optionals pkgs.stdenv.isx86_64 [ wine # TODO wine-gecko wine-mono lib32-libpulse (?) + + ] ++ lib.optionals (!stdenv.isAarch64) [ + # Musescore is broken on aarch64 + musescore + # Blender 4.0.1 can't compile on aarch64 + # https://hydra.nixos.org/job/nixos/release-23.11/nixpkgs.blender.aarch64-linux + blender ]); }; } diff --git a/hm/frobar/default.nix b/hm/frobar/default.nix index 5bbfa92..b33ea53 100644 --- a/hm/frobar/default.nix +++ b/hm/frobar/default.nix @@ -32,5 +32,4 @@ let }; in frobar_launcher -# FIXME Not using Nerdfont # TODO Connection with i3 is lost sometimes, more often than with Arch? diff --git a/hm/frobar/frobar/display.py b/hm/frobar/frobar/display.py index 3a18af7..d6113c3 100644 --- a/hm/frobar/frobar/display.py +++ b/hm/frobar/frobar/display.py @@ -56,7 +56,7 @@ class Bar: """ # Constants - FONTS = ["DejaVuSansMono Nerd Font Mono"] + FONTS = ["DejaVuSansM Nerd Font"] FONTSIZE = 10 @staticmethod diff --git a/hm/style.nix b/hm/style.nix index ed8362a..50b1792 100644 --- a/hm/style.nix +++ b/hm/style.nix @@ -19,11 +19,6 @@ in # The background is set on some occasions, autorandr + feh do the rest fonts = { - sizes = { - applications = 10; - terminal = 10; - }; - # FIXME Somehow this seems smaller than Arch on the left screen, yet bigger on the right... monospace = { package = pkgs.nerdfonts.override { fonts = [ "DejaVuSansMono" ]; # Choose from https://github.com/NixOS/nixpkgs/blob/6ba3207643fd27ffa25a172911e3d6825814d155/pkgs/data/fonts/nerdfonts/shas.nix diff --git a/options.nix b/options.nix index 4b763d5..6e7bf15 100644 --- a/options.nix +++ b/options.nix @@ -5,6 +5,12 @@ gaming = lib.mkEnableOption "Games"; desktop = { xorg = lib.mkEnableOption "Enable X11 support"; + numlock = lib.mkEnableOption "Auto-enable numlock"; + x11_screens = lib.mkOption { + default = ["UNSET1"]; + description = "A list of xrandr screen names from left to right."; + type = lib.types.listOf lib.types.str; + }; nixGLIntel = lib.mkEnableOption "Enable nixGLIntel/nixVulkanIntel for windows manager"; maxVideoHeight = lib.mkOption { type = lib.types.int; diff --git a/os/desktop.nix b/os/desktop.nix index c6a2d16..ab3b08c 100644 --- a/os/desktop.nix +++ b/os/desktop.nix @@ -34,5 +34,18 @@ # Enable sound sound.enable = true; hardware.pulseaudio.enable = true; + + # UPST + # TODO Find a way to override packages either at NixOS level or HM level depending on what is used + nixpkgs.overlays = [ + (final: prev: { + sct = prev.sct.overrideAttrs + (old: { + patches = (old.patches or [ ]) ++ [ + ./sct_aarch64.patch + ]; + }); + }) + ]; }; } diff --git a/os/sct_aarch64.patch b/os/sct_aarch64.patch new file mode 100644 index 0000000..8a04378 --- /dev/null +++ b/os/sct_aarch64.patch @@ -0,0 +1,10 @@ +--- a/Makefile ++++ b/Makefile +@@ -32,6 +32,7 @@ LIBDIR_i386=$(PREFIX)/lib + LIBDIR_i686=$(PREFIX)/lib + LIBDIR_amd64=$(PREFIX)/lib + LIBDIR_x86_64=$(PREFIX)/lib64 ++LIBDIR_aarch64=$(PREFIX)/lib + LIBDIR?=$(LIBDIR_$(MACHINE)) + MANDIR_Darwin=$(PREFIX)/share/man + MANDIR_Linux=$(PREFIX)/share/man diff --git a/pindakaas/options.nix b/pindakaas/options.nix index 7a7ef11..b3b7910 100644 --- a/pindakaas/options.nix +++ b/pindakaas/options.nix @@ -1,6 +1,10 @@ { ... }: { frogeye.extra = true; - frogeye.desktop.xorg = true; + frogeye.desktop = { + xorg = true; + x11_screens = [ "DP-1" "eDP-1" ]; + maxVideoHeight = 720; + }; frogeye.dev.docker = true; } diff --git a/unprocessed/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr b/unprocessed/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr deleted file mode 100644 index 0b27504..0000000 --- a/unprocessed/config/automatrop/host_vars/pindakaas.geoffrey.frogeye.fr +++ /dev/null @@ -1,16 +0,0 @@ -root_access: yes -display_server: "x11" -dev_stuffs: - - shell - - network - - ansible - - python -has_battery: yes -encrypt_home_stacked_fs: yes -extensions: - - g - - gh -x11_screens: - - DP-1 - - eDP-1 -max_video_height: 720 From 56544fe94733739f293bf39c67b000df299c34d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 5 Dec 2023 20:57:05 +0100 Subject: [PATCH 100/108] Fix nvim color scheme being different from system --- hm/desktop.nix | 1 + hm/style.nix | 10 +++------- hm/vim.nix | 15 +++++---------- hm/vim/feline.lua | 44 +++++++++++++++++++++----------------------- 4 files changed, 30 insertions(+), 40 deletions(-) diff --git a/hm/desktop.nix b/hm/desktop.nix index f7a5920..41446bb 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -593,6 +593,7 @@ }; services = { unclutter.enable = true; + # FIXME Not starting on curacao_test dunst = { enable = true; diff --git a/hm/style.nix b/hm/style.nix index 50b1792..b29c368 100644 --- a/hm/style.nix +++ b/hm/style.nix @@ -1,10 +1,7 @@ -{ pkgs, config, ... }: +{ pkgs, config, fetchFromGitHub, ... }: let - stylix = builtins.fetchGit { - url = "https://github.com/danth/stylix.git"; - # No 23.11 branch last I checked - rev = "8b3f61727f3b86c27096c3c014ae602aa40670ba"; - }; + # Currently last commit in https://github.com/danth/stylix/pull/194 + stylix = builtins.fetchTarball "https://github.com/willemml/stylix/archive/2ed2b0086b41d582aca26e083c19c0e47c8991e3.tar.gz"; in { imports = [ (import stylix).homeManagerModules.stylix ]; @@ -28,7 +25,6 @@ in }; targets = { - vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR) i3.enable = false; # I prefer my own styles tmux.enable = false; # Using another theme }; diff --git a/hm/vim.nix b/hm/vim.nix index d234871..bf82131 100644 --- a/hm/vim.nix +++ b/hm/vim.nix @@ -68,12 +68,6 @@ in globals = { netrw_fastbrowse = 0; # Close the file explorer once you select a file }; - colorschemes.base16 = { - # FIXME Dynamic... or use stylix - enable = true; - colorscheme = "solarized-light"; - - }; plugins = { # Catches attention when cursor changed position # TODO Unmapped, do I still want to use it? @@ -339,14 +333,15 @@ in ''; autoCmd = [ # Turn off relativenumber only for insert mode - { event = "InsertEnter *"; command = "set norelativenumber"; } - { event = "InsertLeave *"; command = "set relativenumber"; } + { event = "InsertEnter"; pattern = "*"; command = "set norelativenumber"; } + { event = "InsertLeave"; pattern = "*"; command = "set relativenumber"; } # Additional extensions - { event = "BufNewFile,BufRead"; pattern = "*.jinja"; command = "set filetype=jinja2"; } # TODO Probably GH-specific? + { event = "BufRead"; pattern = "*.jinja"; command = "set filetype=jinja2"; } # TODO Probably GH-specific? + { event = "BufNewFile"; pattern = "*.jinja"; command = "set filetype=jinja2"; } # vim-easy-align: Align Markdown tables - { event = "FileType markdown"; command = "vmap :EasyAlign*"; } + { event = "FileType"; pattern = "markdown"; command = "vmap :EasyAlign*"; } ]; userCommands = { diff --git a/hm/vim/feline.lua b/hm/vim/feline.lua index 2b5d8fe..41460d4 100644 --- a/hm/vim/feline.lua +++ b/hm/vim/feline.lua @@ -2,32 +2,30 @@ vim.cmd([[ set noshowmode set laststatus=2 ]]) --- local base16_colors = require('base16-colorscheme').colors --- FIXME Color setting doesn't work, see ./feline_test.vim for a reproducible use case --- that works on Arch but not on Nix (with Plug stuff removed) +local base16_colors = require('base16-colorscheme').colors local vi_mode_utils = require('feline.providers.vi_mode') local lsp = require('feline.providers.lsp') require('feline').setup({ - -- default_bg = 'base01', - -- default_fg = 'base04', - -- theme = { - -- base00 = base16_colors.base00, - -- base01 = base16_colors.base01, - -- base02 = base16_colors.base02, - -- base03 = base16_colors.base03, - -- base04 = base16_colors.base04, - -- base05 = base16_colors.base05, - -- base06 = base16_colors.base06, - -- base07 = base16_colors.base07, - -- base08 = base16_colors.base08, - -- base09 = base16_colors.base09, - -- base0A = base16_colors.base0A, - -- base0B = base16_colors.base0B, - -- base0C = base16_colors.base0C, - -- base0D = base16_colors.base0D, - -- base0E = base16_colors.base0E, - -- base0F = base16_colors.base0F, - -- }, + default_bg = 'base01', + default_fg = 'base04', + theme = { + base00 = base16_colors.base00, + base01 = base16_colors.base01, + base02 = base16_colors.base02, + base03 = base16_colors.base03, + base04 = base16_colors.base04, + base05 = base16_colors.base05, + base06 = base16_colors.base06, + base07 = base16_colors.base07, + base08 = base16_colors.base08, + base09 = base16_colors.base09, + base0A = base16_colors.base0A, + base0B = base16_colors.base0B, + base0C = base16_colors.base0C, + base0D = base16_colors.base0D, + base0E = base16_colors.base0E, + base0F = base16_colors.base0F, + }, components = { active = { { From 94d9bae95b104db7c458baa905f421f3351daeeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 5 Dec 2023 23:11:54 +0100 Subject: [PATCH 101/108] Dynamic theme setting --- curacao/options.nix | 7 +++++++ hm/scripts/crepuscule | 12 ------------ hm/scripts/jour | 12 ------------ hm/scripts/nuit | 12 ------------ hm/style.nix | 37 +++++++++++++++++++++++++++++++++---- options.nix | 7 +++++++ os/common.nix | 1 + pindakaas/options.nix | 7 +++++++ 8 files changed, 55 insertions(+), 40 deletions(-) delete mode 100755 hm/scripts/crepuscule delete mode 100755 hm/scripts/jour delete mode 100755 hm/scripts/nuit diff --git a/curacao/options.nix b/curacao/options.nix index a941a5f..6bed395 100644 --- a/curacao/options.nix +++ b/curacao/options.nix @@ -6,6 +6,13 @@ x11_screens = [ "HDMI-1-0" "eDP1" ]; maxVideoHeight = 1440; numlock = true; + phasesBrightness = { + enable = true; + backlight = "intel_backlight"; + jour = 40000; + crepuscule = 10000; + nuit = 1; + }; }; dev = { docker = true; diff --git a/hm/scripts/crepuscule b/hm/scripts/crepuscule deleted file mode 100755 index bedc04e..0000000 --- a/hm/scripts/crepuscule +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# FIXME - -if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] -then - echo 10000 | sudo tee /sys/class/backlight/intel_backlight/brightness -elif [ "$(cat /etc/hostname)" = "pindakaas.geoffrey.frogeye.fr" ] -then - echo 3000 | sudo tee /sys/class/backlight/edp-backlight/brightness -fi -automatrop -e base16_scheme=solarized-dark --tags color diff --git a/hm/scripts/jour b/hm/scripts/jour deleted file mode 100755 index eb086d5..0000000 --- a/hm/scripts/jour +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# FIXME - -if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] -then - echo 40000 | sudo tee /sys/class/backlight/intel_backlight/brightness -elif [ "$(cat /etc/hostname)" = "pindakaas.geoffrey.frogeye.fr" ] -then - echo 3500 | sudo tee /sys/class/backlight/edp-backlight/brightness -fi -automatrop -e base16_scheme=solarized-light --tags color diff --git a/hm/scripts/nuit b/hm/scripts/nuit deleted file mode 100755 index 5f409ec..0000000 --- a/hm/scripts/nuit +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# FIXME - -if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] -then - echo 1 | sudo tee /sys/class/backlight/intel_backlight/brightness -elif [ "$(cat /etc/hostname)" = "pindakaas.geoffrey.frogeye.fr" ] -then - echo 700 | sudo tee /sys/class/backlight/edp-backlight/brightness -fi -automatrop -e base16_scheme=solarized-dark --tags color diff --git a/hm/style.nix b/hm/style.nix index b29c368..a98707b 100644 --- a/hm/style.nix +++ b/hm/style.nix @@ -1,14 +1,21 @@ -{ pkgs, config, fetchFromGitHub, ... }: +{ pkgs, config, lib, ... }: let # Currently last commit in https://github.com/danth/stylix/pull/194 stylix = builtins.fetchTarball "https://github.com/willemml/stylix/archive/2ed2b0086b41d582aca26e083c19c0e47c8991e3.tar.gz"; + polarityFile = "${config.xdg.stateHome}/theme_polarity"; + polarity = if builtins.pathExists polarityFile then lib.strings.fileContents polarityFile else "light"; + phases = [ + { command = "jour"; polarity = "light"; } + { command = "crepuscule"; polarity = "dark"; } + { command = "nuit"; polarity = "dark"; } + ]; + cfg = config.frogeye.desktop.phasesBrightness; in { imports = [ (import stylix).homeManagerModules.stylix ]; stylix = { - # FIXME Changeable at runtime - base16Scheme = "${pkgs.base16-schemes}/share/themes/solarized-dark.yaml"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/solarized-${polarity}.yaml"; image = builtins.fetchurl { url = "https://get.wallhere.com/photo/sunlight-abstract-minimalism-green-simple-circle-light-leaf-wave-material-line-wing-computer-wallpaper-font-close-up-macro-photography-124350.png"; sha256 = "sha256:1zfq3f3v34i45mi72pkfqphm8kbhczsg260xjfl6dbydy91d7y93"; @@ -30,10 +37,32 @@ in }; }; + # Setting a custom base16 theme via nixvim: + # - Is required so nixvim works + # - For the rest only works on dark polarity, use the colorscheme otherwise... shrug + programs.nixvim.colorschemes.base16.colorscheme = "solarized-${polarity}"; + # Fix https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal # home.packages = [ pkgs.dconf ]; dconf.enable = false; # Otherwise standalone home-manager complains it can't find /etc/dbus-1/session.conf on Arch. # Symlinking it to /usr/share/dbus-1/session.conf goes further but not much. - + # TODO Use xbacklight instead (pindakaas doesn't seem to support it OOTB) + home.packages = map + (phase: (pkgs.writeShellApplication { + name = "${phase.command}"; + text = (lib.optionalString cfg.enable '' + echo ${builtins.toString (builtins.getAttr phase.command cfg)} | sudo tee /sys/class/backlight/${cfg.backlight}/brightness + '') + '' + echo ${phase.polarity} > ${polarityFile} + if command -v home-manager + then + home-manager switch + else + sudo nixos-rebuild switch + fi + ''; + }) + ) + phases; } diff --git a/options.nix b/options.nix index 6e7bf15..a503abd 100644 --- a/options.nix +++ b/options.nix @@ -17,6 +17,13 @@ description = "Maximum video height in pixel the machine can reasonably watch"; default = 1080; }; + phasesBrightness = { + enable = lib.mkEnableOption "Set a specific brightness for the screen when running phases commands"; + backlight = lib.mkOption { type = lib.types.str; description = "Name of the backlight device"; }; + jour = lib.mkOption { type = lib.types.int; description = "brightness value for phase: jour"; }; + crepuscule = lib.mkOption { type = lib.types.int; description = "brightness value for phase: crepuscule"; }; + nuit = lib.mkOption { type = lib.types.int; description = "brightness value for phase: nuit"; }; + }; }; dev = { ansible = lib.mkEnableOption "Ansible dev stuff"; diff --git a/os/common.nix b/os/common.nix index 2195533..35c8d29 100644 --- a/os/common.nix +++ b/os/common.nix @@ -13,6 +13,7 @@ services.printing.enable = true; # Enable passwordless sudo + # TODO execWheelOnly? sudo-rs? security.sudo.extraRules = [{ groups = [ "wheel" ]; commands = [{ diff --git a/pindakaas/options.nix b/pindakaas/options.nix index b3b7910..8435783 100644 --- a/pindakaas/options.nix +++ b/pindakaas/options.nix @@ -5,6 +5,13 @@ xorg = true; x11_screens = [ "DP-1" "eDP-1" ]; maxVideoHeight = 720; + phasesBrightness = { + enable = true; + backlight = "edp-backlight"; + jour = 3500; + crepuscule = 3000; + nuit = 700; + }; }; frogeye.dev.docker = true; } From 85ac63202532c503109b814358cfc7535081f314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 7 Dec 2023 23:10:48 +0100 Subject: [PATCH 102/108] Fix Perl Language server --- hm/vim.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hm/vim.nix b/hm/vim.nix index bf82131..2f15e45 100644 --- a/hm/vim.nix +++ b/hm/vim.nix @@ -1,8 +1,9 @@ { pkgs, lib, config, ... }: let nixvim = import (builtins.fetchGit { - url = "https://github.com/nix-community/nixvim"; - ref = "nixos-23.11"; + # UPST Ready to create a MR once the tests have ran + url = "https://github.com/GeoffreyFrogeye/nixvim"; + ref = "perlls"; }); vim-shot-f = pkgs.vimUtils.buildVimPlugin { pname = "vim-shot-f"; @@ -156,11 +157,11 @@ in }; }; servers = { - # FIXME ansiblels + ansiblels.enable = true; # Ansible bashls.enable = true; # Bash jsonls.enable = true; # JSON lua-ls.enable = true; # Lua (for Neovim debugging) - # FIXME perlls + perlpls.enable = true; # Perl pylsp = lib.mkIf config.frogeye.dev.python { # Python enable = true; @@ -195,7 +196,7 @@ in }; phpactor.enable = true; # PHP rnix-lsp.enable = true; # Nix - # FIXME sqlls + # TODO Something for SQL. sqls is deprecated, sqlls is not in Nixpkgs. Probably needs a DB connection configured anyways? yamlls.enable = true; # YAML # TODO Check out none-ls }; From 41c3266ee2de353cc3030b241b715e2cc241f58c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 8 Dec 2023 18:39:02 +0100 Subject: [PATCH 103/108] Process nvim FIXMEs --- full/options.nix | 2 ++ hm/vim.nix | 29 +++++++++++++++-------------- options.nix | 2 ++ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/full/options.nix b/full/options.nix index e4b1dda..3592025 100644 --- a/full/options.nix +++ b/full/options.nix @@ -7,6 +7,8 @@ c = true; docker = true; fpga = true; + perl = true; + php = true; python = true; }; extra = true; diff --git a/hm/vim.nix b/hm/vim.nix index 2f15e45..a34cf0c 100644 --- a/hm/vim.nix +++ b/hm/vim.nix @@ -1,9 +1,8 @@ { pkgs, lib, config, ... }: let nixvim = import (builtins.fetchGit { - # UPST Ready to create a MR once the tests have ran - url = "https://github.com/GeoffreyFrogeye/nixvim"; - ref = "perlls"; + url = "https://github.com/nix-community/nixvim"; + rev = "c96d7b46d05a78e695ed1c725d1596b65509b4f9"; # 24.05 Anythin after this commit works }); vim-shot-f = pkgs.vimUtils.buildVimPlugin { pname = "vim-shot-f"; @@ -99,10 +98,10 @@ in gS = "search_history"; gC = "commands"; gr = "lsp_references"; + ge = "diagnostics"; # ga = "lsp_code_actions"; - # ge = "lsp_document_diagnostics"; # gE = "lsp_workspace_diagnostics"; - # FIXME Above makes nvim crash on startup, action is not provided + # TODO Above makes nvim crash on startup, action is not provided gd = "lsp_definitions"; gs = "lsp_document_symbols"; }; @@ -157,14 +156,14 @@ in }; }; servers = { - ansiblels.enable = true; # Ansible + ansiblels.enable = config.frogeye.dev.ansible; # Ansible bashls.enable = true; # Bash jsonls.enable = true; # JSON lua-ls.enable = true; # Lua (for Neovim debugging) - perlpls.enable = true; # Perl - pylsp = lib.mkIf config.frogeye.dev.python { + perlpls.enable = config.frogeye.dev.perl; # Perl + pylsp = { # Python - enable = true; + enable = config.frogeye.dev.python; settings.plugins = { black.enabled = true; flake8 = { @@ -188,20 +187,21 @@ in "--disallow-untyped-calls" "--disallow-incomplete-defs" "--disallow-untyped-decorators" + true ]; }; - # FIXME Somehow no warning is shown # TODO Could add some, could also remove some }; }; - phpactor.enable = true; # PHP + phpactor.enable = config.frogeye.dev.php; # PHP rnix-lsp.enable = true; # Nix # TODO Something for SQL. sqls is deprecated, sqlls is not in Nixpkgs. Probably needs a DB connection configured anyways? yamlls.enable = true; # YAML # TODO Check out none-ls }; - # FIXME vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') as onAttach... is it needed? - # FIXME flags = { debounce_text_changes = 150 } is the default value ok? Maybe it was actually ignored + onAttach = '' + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + ''; # Seems needed for auto-completion with nvim-compe }; nvim-lightbulb = { # Shows a lightbulb whenever a codeAction is available under the cursor @@ -289,13 +289,14 @@ in ] ++ lib.optionals config.frogeye.dev.c [ nvim-dap # Debug Adapter Protocol client ] ++ lib.optionals config.frogeye.dev.ansible [ - ansible-vim # FIXME See if it doesn't require to do ./UltiSnips/generate.sh + ansible-vim # TODO Doesn't have snippets ]; extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [ ./vim/feline.lua ./vim/symbols-outline-nvim.lua ./vim/lsp_signature-nvim.lua ./vim/nvim-ts-rainbow.lua + ./vim/nvim-compe.lua ]; extraConfigVim = '' " GENERAL diff --git a/options.nix b/options.nix index a503abd..4b2a554 100644 --- a/options.nix +++ b/options.nix @@ -30,6 +30,8 @@ c = lib.mkEnableOption "C/C++ dev stuff"; docker = lib.mkEnableOption "Docker dev stuff"; fpga = lib.mkEnableOption "FPGA dev stuff"; + perl = lib.mkEnableOption "Perl dev stuff"; + php = lib.mkEnableOption "PHP dev stuff"; python = lib.mkEnableOption "Python dev stuff"; }; shellAliases = lib.mkOption { From 8a4875cf5b2761a986ccf816e6a90453934f0bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 8 Dec 2023 22:44:21 +0100 Subject: [PATCH 104/108] Rework how X session is started --- hm/desktop.nix | 56 ++++++++++++++++++------------------------- hm/frobar/default.nix | 43 +++++++++++++++++++++------------ 2 files changed, 51 insertions(+), 48 deletions(-) diff --git a/hm/desktop.nix b/hm/desktop.nix index 41446bb..e6a720e 100644 --- a/hm/desktop.nix +++ b/hm/desktop.nix @@ -1,20 +1,35 @@ { pkgs, config, lib, ... }: +let + nixgl = import + (builtins.fetchGit { + url = "https://github.com/nix-community/nixGL"; + rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5"; + }) + { }; + nixGLIntelPrefix = "${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel "; + wmPrefix = "${lib.optionalString config.frogeye.desktop.nixGLIntel nixGLIntelPrefix}"; +in { + imports = [ + ./frobar + ]; config = lib.mkIf config.frogeye.desktop.xorg { frogeye.shellAliases = { noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise''; beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null''; # n = "$HOME/.config/i3/terminal & disown"; # Not used anymore since alacritty daemon mode doesn't preserve environment variables - x = "startx ${config.xdg.configHome}/xinitrc; logout"; - nx = "nvidia-xrun ${config.xdg.configHome}/xinitrc; sudo systemctl start nvidia-xrun-pm; logout"; - # Was also thinking of not storing the config in .config and use nix-store instead, - # but maybe it's a bad idea as home-manager switch doesn't replace aliases in running shells - # FIXME Is it still relevant with NixOS? + x = "startx ${config.home.homeDirectory}/${config.xsession.scriptPath}; logout"; + # TODO Is it possible to not start nvidia stuff on nixOS? + # nx = "nvidia-xrun ${config.xsession.scriptPath}; sudo systemctl start nvidia-xrun-pm; logout"; }; xsession = { enable = true; + # Not using config.xdg.configHome because it needs to be $HOME-relative paths and path manipulation is hard + scriptPath = ".config/xsession"; + profilePath = ".config/xprofile"; windowManager = { + command = lib.mkForce "${wmPrefix} ${config.xsession.windowManager.i3.package}/bin/i3"; i3 = { enable = true; config = @@ -68,7 +83,6 @@ { modifier = "Mod4"; terminal = "alacritty"; - bars = [ ]; # Using frobar colors = let ignore = "#ff00ff"; in with config.lib.stylix.colors.withHashtag; lib.mkForce { focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; }; @@ -310,7 +324,6 @@ ]; }; startup = [ - { notification = false; command = "${pkgs.autorandr}/bin/autorandr --change"; } # Lock screen after 10 minutes { notification = false; command = "${pkgs.xautolock}/bin/xautolock -time 10 -locker '${pkgs.xorg.xset}/bin/xset dpms force standby' -killtime 1 -killer ${locker}"; } { @@ -498,14 +511,9 @@ }; autorandr = { enable = true; - hooks.postswitch = - let - frobar = (pkgs.callPackage (import ./frobar) { }); - in - { - "background" = "${pkgs.feh}/bin/feh --no-fehbg --bg-fill ${config.stylix.image}"; - "frobar" = "${pkgs.i3}/bin/i3-msg exec ${frobar}/bin/frobar_launcher"; - }; + hooks.postswitch = { + background = "${pkgs.feh}/bin/feh --no-fehbg --bg-fill ${config.stylix.image}"; + }; }; mpv = { enable = true; @@ -553,23 +561,6 @@ "pulse/client.conf" = { text = ''cookie-file = .config/pulse/pulse-cookie''; }; - "xinitrc" = - let - nixgl = import - (builtins.fetchGit { - url = "https://github.com/nix-community/nixGL"; - rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5"; - }) - { }; - nixGLIntelPrefix = "${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel "; - wmPrefix = "${lib.optionalString config.frogeye.desktop.nixGLIntel nixGLIntelPrefix}"; - in - { - source = pkgs.writeShellScript "xinitrc" '' - ${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path} - ${wmPrefix}${config.xsession.windowManager.command} - ''; - }; "rofimoji.rc" = { text = '' skin-tone = neutral @@ -593,7 +584,6 @@ }; services = { unclutter.enable = true; - # FIXME Not starting on curacao_test dunst = { enable = true; diff --git a/hm/frobar/default.nix b/hm/frobar/default.nix index b33ea53..1cf4ec4 100644 --- a/hm/frobar/default.nix +++ b/hm/frobar/default.nix @@ -1,4 +1,4 @@ -{ pkgs ? import { config = { }; overlays = [ ]; } }: +{ pkgs ? import { config = { }; overlays = [ ]; }, ... }: # Tried using pyproject.nix but mpd2 dependency wouldn't resolve, # is called pyton-mpd2 on PyPi but mpd2 in nixpkgs. let @@ -6,6 +6,7 @@ let pname = "frobar"; version = "2.0"; + runtimeInputs = with pkgs; [ lemonbar-xft wirelesstools ]; propagatedBuildInputs = with pkgs.python3Packages; [ coloredlogs notmuch @@ -15,21 +16,33 @@ let pulsectl pyinotify ]; + makeWrapperArgs = [ "--prefix PATH : ${pkgs.lib.makeBinPath (with pkgs; [ lemonbar-xft wirelesstools ])}" ]; src = ./.; }; - frobar_launcher = pkgs.writeShellApplication - { - name = "frobar_launcher"; - runtimeInputs = with pkgs; [ lemonbar-xft wirelesstools ]; - text = '' - pidfile=$XDG_RUNTIME_DIR/frobar/$DISPLAY.pid - ${pkgs.coreutils}/bin/mkdir -p "$(${pkgs.coreutils}/bin/dirname "$pidfile")" - ([ -f "$pidfile" ] && ${pkgs.procps}/bin/kill "$(<"$pidfile")") || true - ${frobar}/bin/frobar & disown - echo $! > "$pidfile" - ''; - }; in -frobar_launcher -# TODO Connection with i3 is lost sometimes, more often than with Arch? +{ + config = { + xsession.windowManager.i3.config.bars = [ ]; + programs.autorandr.hooks.postswitch = { + frobar = "${pkgs.systemd}/bin/systemctl --user restart frobar"; + }; + systemd.user.services.frobar = { + Unit = { + Description = "frobar"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Service = { + # Wait for i3 to start. Can't use ExecStartPre because otherwise it blocks graphical-session.target, and there's nothing i3/systemd + # TODO Do that better + ExecStart = ''${pkgs.bash}/bin/bash -c "while ! ${pkgs.i3}/bin/i3-msg; do ${pkgs.coreutils}/bin/sleep 1; done; ${frobar}/bin/frobar"''; + }; + + Install = { WantedBy = [ "graphical-session.target" ]; }; + }; + }; +} +# TODO Connection with i3 is lost on start sometimes, more often than with Arch? +# TODO Restore ability to build frobar with nix-build From 54ec1fc9baab2f1a06f55f825c99d85fb8d47618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 9 Dec 2023 00:08:01 +0100 Subject: [PATCH 105/108] Fix adb --- os/common.nix | 4 +--- os/geoffrey.nix | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/os/common.nix b/os/common.nix index 35c8d29..5719d75 100644 --- a/os/common.nix +++ b/os/common.nix @@ -27,9 +27,6 @@ kexec-tools openvpn - # android tools - android-udev-rules - # Needed for all the fetchFromGit in this repo on nixos-rebuild git ]; @@ -37,6 +34,7 @@ nixpkgs.config.allowUnfree = true; programs = { + adb.enable = true; # Enable compilation cache ccache.enable = true; # TODO Not enough, see https://nixos.wiki/wiki/CCache. diff --git a/os/geoffrey.nix b/os/geoffrey.nix index 2884532..cd27181 100644 --- a/os/geoffrey.nix +++ b/os/geoffrey.nix @@ -6,7 +6,7 @@ users.users.geoffrey = { isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + extraGroups = [ "adbusers" "wheel" ]; shell = pkgs.zsh; initialHashedPassword = "$y$j9T$e64bjL7iyVlniEKwKbM9g0$cCn74za0r6L9QMO20Fdxz3/SX0yvhz3Xd6.2BhtbRL1"; # Not a real password From f20678d134a57a0cfa9150c9f9a85ec3e96ae869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 9 Dec 2023 00:09:36 +0100 Subject: [PATCH 106/108] Use actual encryption passwords --- curacao_usb/dk.nix | 3 ++- dk/single_uefi_btrfs.nix | 4 ++-- install_os.sh | 10 +++++++++- pindakaas_sd/dk.nix | 3 ++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/curacao_usb/dk.nix b/curacao_usb/dk.nix index 962cba1..afcae03 100644 --- a/curacao_usb/dk.nix +++ b/curacao_usb/dk.nix @@ -1 +1,2 @@ -import ../dk/single_uefi_btrfs.nix { id = "usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; name = "curacao_usb"; } +{ ... } @ args: +import ../dk/single_uefi_btrfs.nix (args // { id = "usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; name = "curacao_usb"; }) diff --git a/dk/single_uefi_btrfs.nix b/dk/single_uefi_btrfs.nix index 979f3c7..965cc5b 100644 --- a/dk/single_uefi_btrfs.nix +++ b/dk/single_uefi_btrfs.nix @@ -1,4 +1,4 @@ -{ id, name, ... }: +{ id, name, passwordFile ? "/should_not_be_needed_in_this_context", ... }: { disko.devices = { disk = { @@ -26,7 +26,7 @@ content = { type = "luks"; name = "${name}"; - passwordFile = "/tmp/secret.key"; # FIXME Generate this somehow + passwordFile = passwordFile; settings = { # Not having SSDs die fast is more important than crypto # nerds that could potentially discover which filesystem I diff --git a/install_os.sh b/install_os.sh index 8b642f6..eb41b84 100755 --- a/install_os.sh +++ b/install_os.sh @@ -64,6 +64,7 @@ fi mountpoint="/mnt/nixos" nix_flakes_cmd="nix --extra-experimental-features nix-command --extra-experimental-features flakes" +luks_pass_path="luks/$(basename ${profile})" set -x @@ -73,8 +74,15 @@ sudo mkdir -p "$mountpoint" # Not great, but fixable with flakes I guess sudo ./add_channels.sh +# Load encryption password +luks_pass_file="$(mktemp --suffix="luks_password")" +pass $luks_pass_path | head -n1 | tr -d '\n' > $luks_pass_file + # Format or mount disk -sudo $nix_flakes_cmd run github:nix-community/disko -- --root-mountpoint "$mountpoint" --mode "$disko_mode" "$disko_config" +sudo $nix_flakes_cmd run github:nix-community/disko -- --root-mountpoint "$mountpoint" --mode "$disko_mode" --argstr passwordFile "$luks_pass_file" "$disko_config" + +# Unload encryption password +rm "$luks_pass_file" # Generate hardware-config.nix sudo nixos-generate-config --no-filesystems --root "$mountpoint" diff --git a/pindakaas_sd/dk.nix b/pindakaas_sd/dk.nix index f3b4eae..70de3ae 100644 --- a/pindakaas_sd/dk.nix +++ b/pindakaas_sd/dk.nix @@ -1 +1,2 @@ -import ../dk/single_uefi_btrfs.nix { id = "mmc-SN32G_0xfb19ae99"; name = "pindakaas_sd"; } +{ ... } @ args: +import ../dk/single_uefi_btrfs.nix (args // { id = "mmc-SN32G_0xfb19ae99"; name = "pindakaas_sd"; }) From 2ae8bf4fd0cfa559b1fb14e6c3ccfd50c9fefc23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 9 Dec 2023 00:45:33 +0100 Subject: [PATCH 107/108] Remove texlive --- hm/extra.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hm/extra.nix b/hm/extra.nix index c716de5..b346f05 100644 --- a/hm/extra.nix +++ b/hm/extra.nix @@ -27,7 +27,9 @@ # documents visidata - texlive.combined.scheme-full + # texlive.combined.scheme-full + # TODO Convert existing LaTeX documents into using Nix build system + # texlive is big and not that much used, sooo pdftk hunspell hunspellDicts.en_GB-ize From de7b7880a69dd822d3614dccf2cf1a68afb7cbee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 9 Dec 2023 17:34:35 +0100 Subject: [PATCH 108/108] No docker on pindakaas --- pindakaas/options.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pindakaas/options.nix b/pindakaas/options.nix index 8435783..2f7df32 100644 --- a/pindakaas/options.nix +++ b/pindakaas/options.nix @@ -13,5 +13,4 @@ nuit = 700; }; }; - frogeye.dev.docker = true; }