diff --git a/.remoteenv b/.remoteenv index 89b2866..c2fbc98 100644 --- a/.remoteenv +++ b/.remoteenv @@ -1,3 +1,3 @@ #!/usr/bin/env bash eval "$(nix print-dev-env .#nomos-rebuild)" -eval "$(nix print-dev-env .#nomos-rebuild)" +echo Entered $(hostname --fqdn) diff --git a/base.nix b/base.nix index 34a77cf..2bfb0fd 100644 --- a/base.nix +++ b/base.nix @@ -45,7 +45,9 @@ environment.shells = with pkgs; [ bash zsh ]; - nix.settings.trusted-users = [ "root" ]; # default, but will stick around after a mergins with ./users + nix.settings.allowed-users = [ "*" ]; # default + #nix.settings.allowed-users = [ "@nixbld" "@builders" ]; # TODO: this + nix.settings.trusted-users = [ "root" "@wheel" ]; nix.settings.auto-optimise-store = true; # deduplicate with hardlinks, expensive. Alternative: nix-store --optimise #nix.optimize.automatic = true; # periodic optimization nix.gc.automatic = true; diff --git a/flake.nix b/flake.nix index 9fc328d..93a13b9 100644 --- a/flake.nix +++ b/flake.nix @@ -102,6 +102,10 @@ }); devShells = forAllSystems (system: { # TODO: apply my overlays? + #default = nixpkgs.legacyPackages.${system}.mkShell { + # packages = with nixpkgs.legacyPackages.${system}; [ + # ]; + #}; nomos-rebuild = nixpkgs.legacyPackages.${system}.mkShell { packages = with nixpkgs.legacyPackages.${system}; [ (writeScriptBin "nixos-rebuild" '' diff --git a/hosts/nord/default.nix b/hosts/nord/default.nix index cb114f2..adcdabb 100644 --- a/hosts/nord/default.nix +++ b/hosts/nord/default.nix @@ -5,36 +5,32 @@ boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.efiSysMountPoint = "/boot/efi"; + services.xserver.displayManager.autoLogin.enable = true; + services.xserver.displayManager.autoLogin.user = "pbsds"; + # tmp: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229 + systemd.services."getty@tty1".enable = false; + systemd.services."autovt@tty1".enable = false; + + boot.kernelPackages = pkgs.linuxPackages_latest; # amdgpu audio fix when at 4k@60fps + imports = [ ./hardware-configuration.nix + ../../hardware/rocm.nix + ../../hardware/opengl-intel.nix ../../users # home-manager ../../users/pbsds - ../../hardware/rocm.nix - ../../hardware/opengl-intel.nix - - - ../../profiles/graphical/gnome # with gdm - ../../profiles/graphical/pipewire + ../../profiles/desktop/gnome # with gdm + ../../profiles/desktop/sound/pulseaudio.nix + #../../profiles/desktop/sound/pipewire.nix + #../../profiles/desktop/sound/alsa.nix ../../profiles/nfs/reidun.nix - /** / - ../../profiles/web - ../../profiles/web/index - ../../profiles/web/docs - ../../profiles/web/docs/pdoc.nix - ../../profiles/web/docs/python-docs.nix - ../../profiles/web/docs/nixpkgs.nix - ../../profiles/web/docs/linux-docs.nix - ../../profiles/web/docs/yagcd.nix - /**/ - - #../../profiles/domeneshop-dyndns # TODO: olavtr is hardcoded... - #../../profiles/code-remote #../../profiles/remote-builders # #../../profiles/autossh-reverse-tunnels + #../../profiles/domeneshop-dyndns # handled by noximilien ]; @@ -186,11 +182,10 @@ dejavu_fonts ]; + # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; - - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It's perfectly fine and recommended to leave diff --git a/hosts/noximilien/default.nix b/hosts/noximilien/default.nix index 22755bd..7e70221 100644 --- a/hosts/noximilien/default.nix +++ b/hosts/noximilien/default.nix @@ -75,6 +75,7 @@ ../../profiles/autossh-reverse-tunnels #../../profiles/xrdp ]; + services.domeneshop-updater.target = "olavtr.pbsds.net"; # TODO: remove? Move to where relevant= nixpkgs.overlays = [ diff --git a/profiles/graphical/gnome/default.nix b/profiles/desktop/gnome/default.nix similarity index 97% rename from profiles/graphical/gnome/default.nix rename to profiles/desktop/gnome/default.nix index 8379d16..6249eee 100644 --- a/profiles/graphical/gnome/default.nix +++ b/profiles/desktop/gnome/default.nix @@ -1,3 +1,4 @@ +{ pkgs, ... }: { services.xserver.enable = true; services.xserver.displayManager.gdm.enable = true; diff --git a/profiles/desktop/sound/alsa.nix b/profiles/desktop/sound/alsa.nix new file mode 100644 index 0000000..0c9d3ec --- /dev/null +++ b/profiles/desktop/sound/alsa.nix @@ -0,0 +1,6 @@ +{ + sound.enable = true; # alsa sound? + #sound.mediaKeys.enable = true # only enable if headless + + security.rtkit.enable = true; # optional +} diff --git a/profiles/graphical/pipewire/default.nix b/profiles/desktop/sound/pipewire.nix similarity index 62% rename from profiles/graphical/pipewire/default.nix rename to profiles/desktop/sound/pipewire.nix index ab9d080..efc2190 100644 --- a/profiles/graphical/pipewire/default.nix +++ b/profiles/desktop/sound/pipewire.nix @@ -1,7 +1,8 @@ { - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; + hardware.pulseaudio.enable = false; # gnome defaults it to true + + #sound.enable = true # alsa? likely conflicts with pipewire + #sound.mediaKeys.enable = true # alsa? only enable if headless services.pipewire.enable = true; services.pipewire.alsa.enable = true; services.pipewire.alsa.support32Bit = true; @@ -10,4 +11,6 @@ # use the example session manager (no others are packaged yet so this is enabled by default, # no need to redefine it in your config for now) #services.pipewire.media-session.enable = true; + + security.rtkit.enable = true; # optional } diff --git a/profiles/desktop/sound/pulseaudio.nix b/profiles/desktop/sound/pulseaudio.nix new file mode 100644 index 0000000..c1cd897 --- /dev/null +++ b/profiles/desktop/sound/pulseaudio.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + sound.enable = true; # alsa, needed? + #sound.mediaKeys.enable = true # only enable if headless + hardware.pulseaudio.enable = true; + hardware.pulseaudio.package = pkgs.pulseaudioFull; # optional + #hardware.pulseaudio.support32Bit = true; + nixpkgs.config.pulseaudio = true; + + security.rtkit.enable = true; # optional +} diff --git a/profiles/domeneshop-dyndns/default.nix b/profiles/domeneshop-dyndns/default.nix index d090da6..61acc75 100644 --- a/profiles/domeneshop-dyndns/default.nix +++ b/profiles/domeneshop-dyndns/default.nix @@ -1,40 +1,55 @@ { config, pkgs, lib, ... }: +let + cfg = config.services.domeneshop-updater; +in { # auto domain update - systemd.services.domeneshop-updater = { - description = "domene.shop domain updater"; - after = [ "network-online.target" ]; # TODO: multi-user ? - wants = [ "network-online.target" ]; # TODO: multi-user ? - serviceConfig = let - prog = pkgs.writeShellApplication { - name = "domeneshop-dyndns-updater.sh"; - runtimeInputs = with pkgs; [ curl yq ]; - text = '' - test -s /var/lib/secrets/domeneshop.toml || { - >&2 echo "ERROR: /var/lib/secrets/domeneshop.toml not found!" - exit 1 - } - DOMENESHOP_TOKEN="$( tomlq &2 echo "ERROR: /var/lib/secrets/domeneshop.toml not found!" + exit 1 + } + DOMENESHOP_TOKEN="$( tomlq n +new_tab_accel=t +close_tab_accel=w +close_window_accel=q +copy_accel=c +paste_accel=v +name_tab_accel=i +previous_tab_accel=Page_Up +next_tab_accel=Page_Down +move_tab_left_accel=Page_Up +move_tab_right_accel=Page_Down +zoom_in_accel=plus +zoom_out_accel=minus +zoom_reset_accel=0 diff --git a/users/pbsds/home/files/opt/open-microsoft-url-files.py b/users/pbsds/home/files/opt/open-microsoft-url-files.py new file mode 100755 index 0000000..e183c9c --- /dev/null +++ b/users/pbsds/home/files/opt/open-microsoft-url-files.py @@ -0,0 +1,36 @@ +#1/usr/bin/env python +import configparser +import os +import urllib.parse +import shutil +import subprocess +import sys + +c = configparser.RawConfigParser() +c.read(sys.argv[1]) + +def input(query): + if shutil.which("zenity"): + return subprocess.run(["zenity", "--forms", "--add-entry=" + query], capture_output=True).stdout.decode().strip() + #if shutil.which("xdialog"): TODO + assert 0 + +try: + url=c["InternetShortcut"]["URL"] + + if not url.strip(): + c["InternetShortcut"]["URL"] = input("Set URL") + with open(sys.argv[1], "w") as f: + c.write(f, space_around_delimiters=False) + exit(0) + + if urllib.parse.urlparse(url).scheme not in ["http","https","ftp","ssh","zotero"]: + raise Exception("Invalid scheme in URI") + + os.execv(shutil.which("xdg-open"), ["xdg-open", url]) + assert 0 + +except Exception as e: + print(f"{e.__class__.__name__}: {e}",file=sys.stderr) + +exit(3) diff --git a/users/pbsds/home/files/opt/python-interactive-imports.py b/users/pbsds/home/files/opt/python-interactive-imports.py new file mode 100755 index 0000000..fd7542c --- /dev/null +++ b/users/pbsds/home/files/opt/python-interactive-imports.py @@ -0,0 +1,102 @@ +#!/usb/bin/env python3 + +#run with: +#gnome-terminal --hide-menubar --window-with-profile=manjaro -x python -i $HOME/.local/opt/python-interactive-imports.py + +import numpy as np +from numpy import gcd, array, arange, linspace, meshgrid +from numpy import cos, pi, sin, exp, log, log10, sqrt +#from math import cos, pi, sin, exp, log, log10, sqrt, acos, asin, atan +from math import acos, asin, atan, factorial +from statistics import * +from pprint import pprint +from dis import dis +import os, sys +import functools +import typing +from functools import reduce +from pathlib import Path +from objexplore import explore + +p = pprint + +def plot(x, *args, label=[]): + import matplotlib.pyplot as plt + for i in args: + plt.plot(x[:len(i)], i) + plt.show() + + +def hist(x, bins=20): + import matplotlib.pyplot as plt + plt.hist(x, bins) + plt.show() + +def scatter(x, *args): + import matplotlib.pyplot as plt + for i in args: + plt.plot(x[:len(i)], i, ".") + plt.show() + +def imshow(image, cmap="gray"): + import matplotlib.pyplot as plt + plt.imshow(image.astype(np.float32), cmap=cmap) + plt.show() + +def image(filepath=None, gray=False): + if not filepath: + import cv2 + cam = cv2.VideoCapture(0) + s, im = cam.read() # captures image + cv2.destroyAllWindows() + im = im.astype(np.float64) / 256 + if not gray: + return np.dstack(( + im[:,:,2], + im[:,:,1], + im[:,:,0], + )) + else: + return ( im[:,:,2] + im[:,:,1] + im[:,:,0]) / 3 + else: + import matplotlib.image as mpimg + img=mpimg.imread('image_name.png') + + +def rad(degrees): + return degrees * pi / 180 + +def deg(radians): + return radians / pi * 180 + +def clip(data): + "xclip -sel clip" + import subprocess + p = subprocess.Popen(("xclip", "-sel", "clip"), stdin=subprocess.PIPE) + p.communicate(str(data).encode("utf-8")) + +def prod(args): + return functools.reduce(lambda x, y: x*y, args) + +def add(*args): + return sum(args) + +def mul(*args): + return prod(args) + + +def history(n=None): + import readline + return "\n".join([ + readline.get_history_item(i + 1) + for i in range(readline.get_current_history_length()) + ][-(n+1) if n is not None else 0:-1]) + + +def integral(data, initial=0, step=None): + if step is None: + step = (data[-1] - data[0]) / len(data) + out = [initial] + for i in data: + out.append(out[-1] + i*step) + return out[1:] diff --git a/users/pbsds/home/files/opt/sympy-interactive-imports.py b/users/pbsds/home/files/opt/sympy-interactive-imports.py new file mode 100755 index 0000000..f385547 --- /dev/null +++ b/users/pbsds/home/files/opt/sympy-interactive-imports.py @@ -0,0 +1,9 @@ +#!/usb/bin/env python3 + +#run with: +#gnome-terminal --hide-menubar --window-with-profile=manjaro -x python -i $HOME/.local/opt/sympy-interactive-imports.py + +from sympy import * +x, y, z, t = symbols('x y z t') +k, m, n = symbols('k m n', integer=True) +f, g, h = symbols('f g h', cls=Function) diff --git a/users/pbsds/home/files/screensaver.jpg b/users/pbsds/home/files/screensaver.jpg new file mode 100755 index 0000000..d42f828 Binary files /dev/null and b/users/pbsds/home/files/screensaver.jpg differ diff --git a/users/pbsds/home/files/wallpaper.jpg b/users/pbsds/home/files/wallpaper.jpg new file mode 100755 index 0000000..3c4b483 Binary files /dev/null and b/users/pbsds/home/files/wallpaper.jpg differ diff --git a/users/pbsds/home/gnome.nix b/users/pbsds/home/gnome.nix index 2f242b1..3e6f86e 100644 --- a/users/pbsds/home/gnome.nix +++ b/users/pbsds/home/gnome.nix @@ -3,75 +3,10 @@ { imports = [ ./default.nix - #./profiles/gnome.nix + ./profiles/gnome ]; - # TODO: dbus - - dconf.settings = { - "org/gnome/shell" = { - disable-user-extensions = false; - enabled-extensions = [ - "just-perfection-desktop@just-perfection" - ]; - }; - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - enable-hot-corners = false; - clock-show-weekday = true; - }; - "org/gnome/desktop/privacy" = { - report-technical-problems = "false"; - }; - "org/gnome/desktop/wm/preferences" = { - button-layout = ":minimize,close"; - }; - "org/gnome/settings-daemon/plugins/power" = { - sleep-interactive-ac-type = "nothing"; - }; - "org/gnome/settings-daemon/plugins/media-keys" = { - custom-keybindings = [ - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" - ]; - }; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { - binding = "e"; - command = "nautilus"; - name = "open-file-browser"; - }; - "org/gnome/shell/extensions/just-perfection" = { - theme = true; - activities-button = false; - }; - /** / - "org/gnome/shell/extensions/blur-my-shell" = { - brightness = 0.9; - }; - "org/gnome/shell/extensions/blur-my-shell/panel" = { - customize = true; - sigma = 0; - }; - "org/gnome/shell/extensions/blur-my-shell/overview" = { # Temporary = D2D Bug - customize = true; - sigma = 0; - }; - /**/ - - }; home.packages = with pkgs; [ - gnome.gnome-tweaks - lxterminal - - gnomeExtensions.just-perfection - /** / - gnomeExtensions.blur-my-shell - gnomeExtensions.tray-icons-reloaded - gnomeExtensions.removable-drive-menu - gnomeExtensions.battery-indicator-upower - gnomeExtensions.workspace-indicator-2 - gnomeExtensions.bluetooth-quick-connect - gnomeExtensions.forge - /**/ ]; } diff --git a/users/pbsds/home/profiles/gnome/dconf-gnome-bindings.nix b/users/pbsds/home/profiles/gnome/dconf-gnome-bindings.nix new file mode 100644 index 0000000..9950db4 --- /dev/null +++ b/users/pbsds/home/profiles/gnome/dconf-gnome-bindings.nix @@ -0,0 +1,137 @@ +# Generated via dconf2nix: https://github.com/gvolpe/dconf2nix +{ lib, ... }: + +with lib.hm.gvariant; + +{ + dconf.settings = { + "org/gnome/desktop/wm/keybindings" = { + close = [ "F4" ]; + maximize = [ "Up" ]; + move-to-monitor-down = []; + move-to-monitor-up = []; + move-to-workspace-1 = []; + move-to-workspace-down = [ "Page_Down" "Down" ]; + move-to-workspace-last = []; + move-to-workspace-left = [ "Left" "Left" ]; + move-to-workspace-right = [ "Right" "Right" ]; + move-to-workspace-up = [ "Page_Up" "Up" ]; + panel-main-menu = [ "F1" ]; + switch-applications = []; + switch-applications-backward = []; + switch-to-workspace-1 = []; + switch-to-workspace-down = [ "Page_Down" "Down" ]; + switch-to-workspace-last = []; + switch-to-workspace-left = [ "Left" "Left" ]; + switch-to-workspace-right = [ "Right" "Right" ]; + switch-to-workspace-up = [ "Page_Up" "Up" ]; + switch-windows = [ "Tab" ]; + switch-windows-backward = [ "Tab" ]; + unmaximize = [ "Down" ]; + }; + + "org/gnome/mutter/keybindings" = { + switch-monitor = [ "XF86Display" ]; + toggle-tiled-left = [ "Left" ]; + toggle-tiled-right = [ "Right" ]; + }; + + "org/gnome/shell/keybindings" = { + screenshot = [ "Print" ]; + show-screenshot-ui = [ "Print" ]; + }; + + "org/gnome/settings-daemon/plugins/media-keys" = { + area-screenshot = [ "Print" ]; + area-screenshot-clip = [ "Print" ]; + custom-keybindings = [ "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom6/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom7/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom8/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom9/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom10/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom12/" ]; + home = [ "e" ]; + magnifier = [ "Escape" ]; + magnifier-zoom-in = [ "plus" ]; + magnifier-zoom-out = [ "minus" ]; + next = [ "aring" ]; + play = [ "p" ]; + previous = [ "o" ]; + screenshot = [ "Print" ]; + screenshot-clip = [ "Print" ]; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { + binding = "t"; + command = "lxterminal"; + name = "Open Terminal"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = { + binding = ""; + command = "sh -c \"$HOME/.local/opt/center-window.sh\""; + name = "Window to Center"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom10" = { + binding = ""; + command = "bash -c 'dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous'"; + name = "spotify prev"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom11" = { + binding = ""; + command = "sh -c \"$HOME/.local/opt/toggle_sticky.sh\""; + name = "Toggle stickyness"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom12" = { + binding = "space"; + command = "sh -c \"lxterminal -e python3 -i $HOME/.local/opt/sympy-interactive-imports.py\""; + name = "Open SymPy terminal"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2" = { + binding = ""; + command = "sh -c \"$HOME/.local/opt/left-window.sh\""; + name = "Window to Left"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3" = { + binding = ""; + command = "sh -c \"$HOME/.local/opt/right-window.sh\""; + name = "Window to Right"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4" = { + binding = ""; + command = "sh -c \"$HOME/.local/opt/center-small-window.sh\""; + name = "Window to Center Small"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5" = { + binding = "space"; + command = "sh -c \"lxterminal -e `command -v ptpython || echo python3` -i $HOME/.local/opt/python-interactive-imports.py\""; + name = "Open Python Terminal"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom6" = { + command = "sh -c \"$HOME/.local/opt/toggle_decoration.sh\""; + name = "Toggle window decorations"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom7" = { + binding = ""; + command = "sh -c \"$HOME/.local/opt/toggle_theme.sh\""; + name = "Toggle gtk theme"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom8" = { + binding = ""; + command = "bash -c 'dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause'"; + name = "spotify play"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom9" = { + binding = ""; + command = "bash -c 'dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.next'"; + name = "spotify next"; + }; + + }; +} diff --git a/users/pbsds/home/profiles/gnome/dconf-gnome-extensions.nix b/users/pbsds/home/profiles/gnome/dconf-gnome-extensions.nix new file mode 100644 index 0000000..91c2d58 --- /dev/null +++ b/users/pbsds/home/profiles/gnome/dconf-gnome-extensions.nix @@ -0,0 +1,97 @@ +# Generated via dconf2nix: https://github.com/gvolpe/dconf2nix +{ lib, ... }: + +with lib.hm.gvariant; + +{ + dconf.settings = { + "org/gnome/shell/extensions/vertical-overview" = { + override-dash = false; + scaling-workspace-background = false; + static-background = false; + }; + + "org/gnome/shell/extensions/big-avatar" = { + fontsize = 16; + horizontalmode = true; + picturesize = 48; + }; + + "org/gnome/shell/extensions/gtile" = { + autotile-1 = [ "" ]; + autotile-10 = [ "" ]; + autotile-2 = [ "" ]; + autotile-3 = [ "" ]; + autotile-4 = [ "" ]; + autotile-5 = [ "" ]; + autotile-6 = [ "" ]; + autotile-7 = [ "" ]; + autotile-8 = [ "" ]; + autotile-9 = [ "" ]; + autotile-main = [ "" ]; + global-presets = false; + grid-sizes = "8x5"; + insets-primary-bottom = 3; + insets-primary-left = 3; + insets-primary-right = 3; + insets-primary-top = 3; + insets-secondary-bottom = 0; + insets-secondary-left = 0; + insets-secondary-right = 0; + insets-secondary-top = 0; + max-timeout = 1600; + move-down-vi = [ "" ]; + move-left-vi = [ "" ]; + move-right-vi = [ "" ]; + move-up-vi = [ "" ]; + moveresize-enabled = false; + preset-resize-1 = [ "" ]; + preset-resize-11 = [ "" ]; + preset-resize-12 = [ "" ]; + preset-resize-13 = [ "" ]; + preset-resize-14 = [ "" ]; + preset-resize-15 = [ "" ]; + preset-resize-16 = [ "" ]; + preset-resize-17 = [ "" ]; + preset-resize-18 = [ "" ]; + preset-resize-19 = [ "" ]; + preset-resize-2 = [ "" ]; + preset-resize-21 = [ "" ]; + preset-resize-22 = [ "" ]; + preset-resize-23 = [ "" ]; + preset-resize-24 = [ "" ]; + preset-resize-25 = [ "" ]; + preset-resize-26 = [ "" ]; + preset-resize-27 = [ "" ]; + preset-resize-28 = [ "" ]; + preset-resize-29 = [ "" ]; + preset-resize-3 = [ "" ]; + preset-resize-4 = [ "" ]; + preset-resize-5 = [ "" ]; + preset-resize-6 = [ "" ]; + preset-resize-7 = [ "" ]; + preset-resize-8 = [ "" ]; + preset-resize-9 = [ "" ]; + resize-down-vi = [ "" ]; + resize-left-vi = [ "" ]; + resize-right-vi = [ "" ]; + resize-up-vi = [ "" ]; + resize1 = "7x2 0:2 0:2, 2:5 0:2"; + show-icon = false; + snap-to-neighbors = [ "" ]; + window-margin = 4; + }; + + "org/gnome/shell/extensions/just-perfection" = { + activities-button = true; + app-menu = true; + dash = false; + dash-separator = true; + panel = true; + quick-settings = true; + top-panel-position = 1; + window-demands-attention-focus = true; + }; + + }; +} diff --git a/users/pbsds/home/profiles/gnome/dconf-gnome-theme.nix b/users/pbsds/home/profiles/gnome/dconf-gnome-theme.nix new file mode 100644 index 0000000..5f41ba2 --- /dev/null +++ b/users/pbsds/home/profiles/gnome/dconf-gnome-theme.nix @@ -0,0 +1,60 @@ +# Generated via dconf2nix: https://github.com/gvolpe/dconf2nix +{ lib, ... }: + +with lib.hm.gvariant; + +{ + dconf.settings = { + "org/gnome/shell/extensions/user-theme" = { + name = "vimix-dark-laptop-ruby"; + }; + + "org/gnome/desktop/interface" = { + clock-show-date = true; + clock-show-seconds = false; + clock-show-weekday = true; + color-scheme = "prefer-dark"; + cursor-theme = "Adwaita"; + document-font-name = "Sans 10"; + enable-animations = true; + enable-hot-corners = false; + font-antialiasing = "grayscale"; + font-hinting = "slight"; + font-name = "Noto Sans 10"; + gtk-theme = "Colloid-Dark"; + icon-theme = "Flat-Remix-Blue-Dark"; + locate-pointer = false; + monospace-font-name = "Hack 11"; + show-battery-percentage = true; + text-scaling-factor = 1.0; + toolkit-accessibility = false; + }; + + "org/gnome/desktop/wm/preferences" = { + action-middle-click-titlebar = "none"; + auto-raise = false; + button-layout = "appmenu:minimize,maximize,close"; + focus-mode = "click"; + focus-new-windows = "strict"; + resize-with-right-button = false; + titlebar-font = "Cantarell Bold 11"; + }; + + "org/gnome/shell/overrides" = { + dynamic-workspaces = true; + }; + + "org/gnome/tweaks" = { + show-extensions-notice = false; + }; + + "org/gnome/desktop/calendar" = { + show-weekdate = true; + }; + + "org/gnome/desktop/privacy" = { + disable-microphone = false; + }; + + }; +} diff --git a/users/pbsds/home/profiles/gnome/dconf-pull.sh b/users/pbsds/home/profiles/gnome/dconf-pull.sh new file mode 100755 index 0000000..9cbe8aa --- /dev/null +++ b/users/pbsds/home/profiles/gnome/dconf-pull.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p dconf2nix sd +set -euo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +dump() { + ROOT="$1" + shift + dconf dump "/$ROOT/" \ + | sd '^\[([^/])' "[$ROOT/\$1" \ + | sd '^\[/\]$' "[$ROOT]" +} + +{ + dump "org/gnome/desktop/wm/keybindings" + dump "org/gnome/mutter/keybindings" + dump "org/gnome/shell/keybindings" + dump "org/gnome/settings-daemon/plugins/media-keys" +} | dconf2nix > dconf-gnome-bindings.nix + +{ + #dump "org/gnome/shell" + dump "org/gnome/shell/extensions/vertical-overview" + dump "org/gnome/shell/extensions/big-avatar" + dump "org/gnome/shell/extensions/gtile" + dump "org/gnome/shell/extensions/just-perfection" +} | dconf2nix > dconf-gnome-extensions.nix + +{ + dump "org/gnome/shell/extensions/user-theme" + dump "org/gnome/desktop/interface" # features stuff already set by home-manager + dump "org/gnome/desktop/wm/preferences" + dump "org/gnome/shell/overrides" + dump "org/gnome/tweaks" + dump "org/gnome/desktop/calendar" + dump "org/gnome/desktop/privacy" +} | dconf2nix | sd --string-mode \ + '"/org/gnome/desktop/interface" = {' \ + '"/org/gnome/desktop/interface" = lib.mkDefault {' \ + > dconf-gnome-theme.nix diff --git a/users/pbsds/home/profiles/gnome/default.nix b/users/pbsds/home/profiles/gnome/default.nix new file mode 100644 index 0000000..1e88565 --- /dev/null +++ b/users/pbsds/home/profiles/gnome/default.nix @@ -0,0 +1,91 @@ +# Handwritten! +{ pkgs, config, ... }: +{ + home.file.".local/opt/open-microsoft-url-files.py".source = ../../files/opt/open-microsoft-url-files.py; + home.file.".local/opt/python-interactive-imports.py".source = ../../files/opt/python-interactive-imports.py; + home.file.".local/opt/sympy-interactive-imports.py".source = ../../files/opt/sympy-interactive-imports.py; + home.file.".config/lxterminal/lxterminal.conf".source = ../../files/lxterminal.conf; + + imports = [ + ./dconf-gnome-bindings.nix + ./dconf-gnome-extensions.nix + ./dconf-gnome-theme.nix + ]; + + home.packages = with pkgs; [ + lxterminal + gnome.gnome-tweaks + pkgs.vimix-gtk-themes # shell theme + gnomeExtensions.big-avatar + gnomeExtensions.bluetooth-quick-connect + gnomeExtensions.gtile + gnomeExtensions.just-perfection + gnomeExtensions.keep-awake + gnomeExtensions.middle-click-to-close-in-overview + gnomeExtensions.vertical-overview + gnomeExtensions.appindicator + gnomeExtensions.removable-drive-menu + /* TODO: + gnomeExtensions.night-light-slider + gnomeExtensions.tray-icons-reloaded + gnomeExtensions.removable-drive-menu + gnomeExtensions.battery-indicator-upower + gnomeExtensions.workspace-indicator-2 + gnomeExtensions.forge + */ + ]; + #dump "org/gnome/settings-daemon/plugins/power" + + dconf.settings = { + "org/gnome/shell" = { + disable-user-extensions = false; + # remote-quick dconf dump /org/gnome/shell/ | grep ^enabled-extensions= + enabled-extensions = [ + "bluetooth-quick-connect@bjarosze.gmail.com" + "gTile@vibou" + "just-perfection-desktop@just-perfection" + "KeepAwake@jepfa.de" + "middleclickclose@paolo.tranquilli.gmail.com" + "user-theme@gnome-shell-extensions.gcampax.github.com" + "vertical-overview@RensAlthuis.github.com" + "appindicatorsupport@rgcjonas.gmail.com" + "drive-menu@gnome-shell-extensions.gcampax.github.com" + ]; + }; + + # wallpaper + "org/gnome/desktop/background" = { + color-shading-type = "solid"; + picture-options = "zoom"; + picture-uri = "file://${../../files/wallpaper.jpg}"; + picture-uri-dark = "file://${../../files/wallpaper.jpg}"; + }; + "org/gnome/desktop/screensaver" = { + idle-activation-enabled = false; + picture-uri = "file://${../../files/screensaver.jpg}"; + }; + + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + enable-hot-corners = false; + clock-show-weekday = true; + }; + #"org/gnome/desktop/wm/preferences" = { + # button-layout = ":minimize,close"; + #}; + "org/gnome/desktop/peripherals/touchpad" = { + disable-while-typing = false; + natural-scroll = false; + two-finger-scrolling-enabled = true; + }; + "org/gnome/nautilus/preferences" = { + confirm-trash = true; + executable-text-activation = "display"; + show-create-link = true; + sort-directories-first = true; + #recursive-search = "never"; + #show-image-thumbnails = "always"; + }; + + }; +} diff --git a/users/pbsds/home/profiles/gtk.nix b/users/pbsds/home/profiles/gtk.nix index d721966..d0f78c8 100644 --- a/users/pbsds/home/profiles/gtk.nix +++ b/users/pbsds/home/profiles/gtk.nix @@ -7,8 +7,4 @@ gtk.theme.package = pkgs.colloid-gtk-theme; gtk.iconTheme.name = "Flat-Remix-Blue-Dark"; gtk.iconTheme.package = pkgs.flat-remix-icon-theme; - dconf.settings."org/gnome/desktop/background" = { - "picture-uri" = "file:///mnt/reidun/Images/Wallpapers/1575232313831.jpg"; - "picture-uri-dark" = "file:///mnt/reidun/Images/Wallpapers/1575232313831.jpg"; - }; }