From c5e9651eb722c9b3063777342c98cc38997d62a6 Mon Sep 17 00:00:00 2001 From: Rory& Date: Sun, 13 Oct 2024 06:14:11 +0200 Subject: Desktop changes, build script changes --- host/Rory-desktop/configuration.nix | 22 ++++++++++------------ host/Rory-desktop/hooks/post-rebuild.sh | 7 +++++++ host/Rory-desktop/hooks/pre-rebuild.sh | 7 +++++++ host/Rory-desktop/printing.nix | 4 ++-- host/Rory-nginx/hooks/post-rebuild.sh | 29 +++++++++++++++++++++++++++++ host/Rory-nginx/post-rebuild.sh | 29 ----------------------------- 6 files changed, 55 insertions(+), 43 deletions(-) create mode 100755 host/Rory-desktop/hooks/post-rebuild.sh create mode 100755 host/Rory-desktop/hooks/pre-rebuild.sh create mode 100755 host/Rory-nginx/hooks/post-rebuild.sh delete mode 100755 host/Rory-nginx/post-rebuild.sh (limited to 'host') diff --git a/host/Rory-desktop/configuration.nix b/host/Rory-desktop/configuration.nix index 654b245..db6615d 100644 --- a/host/Rory-desktop/configuration.nix +++ b/host/Rory-desktop/configuration.nix @@ -39,13 +39,13 @@ args@{ efiInstallAsRemovable = true; }; }; - kernelPatches = [ - { - # FIXME: https://gitlab.freedesktop.org/drm/amd/-/issues/3437 - name = "drm-amd-3437-hack"; - patch = ./hacks/drm-amd-3437.patch; - } - ]; + #kernelPatches = [ + # { + # # FIXME: https://gitlab.freedesktop.org/drm/amd/-/issues/3437 + # name = "drm-amd-3437-hack"; + # patch = ./hacks/drm-amd-3437.patch; + # } + #]; #readOnlyNixStore = false; }; @@ -86,7 +86,7 @@ args@{ ]; defaultGateway = "192.168.0.1"; - # useDHCP = true; + #useDHCP = true; # Doesn't work with NetworkManager, investigate }; time.timeZone = "Europe/Brussels"; @@ -120,6 +120,7 @@ args@{ }; }; + services.xserver.desktopManager.gnome.enable = false; environment.systemPackages = with pkgs; [ eog mpv @@ -194,12 +195,11 @@ args@{ xdg = { portal = { - enable = true; extraPortals = with pkgs; [ #xdg-desktop-portal-gtk xdg-desktop-portal-xapp - (callPackage ../../modules/packages/xdg-desktop-portal-gtk.nix { }) +# (callPackage ../../modules/packages/xdg-desktop-portal-gtk.nix { }) ]; config = { common = { @@ -207,8 +207,6 @@ args@{ }; }; xdgOpenUsePortal = true; - #gtkUsePortal = true; # deprecated - }; #sounds.enable = true; #mime.enable = true; diff --git a/host/Rory-desktop/hooks/post-rebuild.sh b/host/Rory-desktop/hooks/post-rebuild.sh new file mode 100755 index 0000000..30733ad --- /dev/null +++ b/host/Rory-desktop/hooks/post-rebuild.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +set -x + +git restore --staged hardware-configuration.nix +git restore --staged Ran.ca +git restore --staged modules/opensuse/ +git restore --staged opensuse/ \ No newline at end of file diff --git a/host/Rory-desktop/hooks/pre-rebuild.sh b/host/Rory-desktop/hooks/pre-rebuild.sh new file mode 100755 index 0000000..d4ec9d3 --- /dev/null +++ b/host/Rory-desktop/hooks/pre-rebuild.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +set -x + +git add -f hardware-configuration.nix +git add -f Ran.ca +git add -f modules/opensuse/ +git add -f opensuse/ \ No newline at end of file diff --git a/host/Rory-desktop/printing.nix b/host/Rory-desktop/printing.nix index f25580f..351b59f 100644 --- a/host/Rory-desktop/printing.nix +++ b/host/Rory-desktop/printing.nix @@ -14,7 +14,7 @@ environment.systemPackages = with pkgs; [ xsane - gnome.simple-scan + simple-scan ]; hardware = { @@ -39,7 +39,7 @@ }; avahi = { enable = true; - nssmdns = true; + nssmdns4 = true; reflector = true; publish = { workstation = true; diff --git a/host/Rory-nginx/hooks/post-rebuild.sh b/host/Rory-nginx/hooks/post-rebuild.sh new file mode 100755 index 0000000..9b0c17c --- /dev/null +++ b/host/Rory-nginx/hooks/post-rebuild.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl gnused nix coreutils jq openssl +#set -x +REG_KEY=`cat /var/lib/matrix-synapse/registration_shared_secret.txt` +LOCALPART='rory.gay' +REACHABLE_DOMAIN='http://localhost:8008' + +# -- LICENSE: CNPL v7+ - https://thufie.lain.haus/files/CNPLv7.md +# Modified from Nyaaori (https://nyaaori.cat) <+@nyaaori.cat> +# Explicit authorisation to use the code has been granted by the original author +# for use by members of the Rory& system (https://rory.gay) + +# the magic function: +register(){ + echo "Registering $1" + _nonce=`curl -s http://localhost:8008/_synapse/admin/v1/register | jq -r .nonce` + #data: nonce, domain, username, password + _hmac=`printf '%s\0%s\0%s\0%s' "$_nonce" "$1" "$2" "admin" | openssl dgst -sha1 -hmac "$REG_KEY" | awk '{print $2}'` + curl -s -XPOST -d '{"nonce": "'"$_nonce"'", "username": "'"$1"'", "displayname": "'"$1"'", "password": "'"$2"'", "admin": true, "mac": "'"$_hmac"'"}' $REACHABLE_DOMAIN/_synapse/admin/v1/register | tee -a matrix-user-tokens.txt + echo +} + +# -- END OF LICENSED CODE + +PASSWD=`cat /etc/matrix-user-pass` +for u in {draupnir,Alicia,Emma,Rory,root,Quetzelle} +do + register $u $PASSWD +done diff --git a/host/Rory-nginx/post-rebuild.sh b/host/Rory-nginx/post-rebuild.sh deleted file mode 100755 index 9b0c17c..0000000 --- a/host/Rory-nginx/post-rebuild.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p curl gnused nix coreutils jq openssl -#set -x -REG_KEY=`cat /var/lib/matrix-synapse/registration_shared_secret.txt` -LOCALPART='rory.gay' -REACHABLE_DOMAIN='http://localhost:8008' - -# -- LICENSE: CNPL v7+ - https://thufie.lain.haus/files/CNPLv7.md -# Modified from Nyaaori (https://nyaaori.cat) <+@nyaaori.cat> -# Explicit authorisation to use the code has been granted by the original author -# for use by members of the Rory& system (https://rory.gay) - -# the magic function: -register(){ - echo "Registering $1" - _nonce=`curl -s http://localhost:8008/_synapse/admin/v1/register | jq -r .nonce` - #data: nonce, domain, username, password - _hmac=`printf '%s\0%s\0%s\0%s' "$_nonce" "$1" "$2" "admin" | openssl dgst -sha1 -hmac "$REG_KEY" | awk '{print $2}'` - curl -s -XPOST -d '{"nonce": "'"$_nonce"'", "username": "'"$1"'", "displayname": "'"$1"'", "password": "'"$2"'", "admin": true, "mac": "'"$_hmac"'"}' $REACHABLE_DOMAIN/_synapse/admin/v1/register | tee -a matrix-user-tokens.txt - echo -} - -# -- END OF LICENSED CODE - -PASSWD=`cat /etc/matrix-user-pass` -for u in {draupnir,Alicia,Emma,Rory,root,Quetzelle} -do - register $u $PASSWD -done -- cgit 1.4.1