dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 3b34d7dfc9dc4b8695d12c76e7bc3ffd9f067be3 parent 1ae0d9cf489f9667f6f3536856bc439980c511a7 Author: maydayv7 <maydayv7@gmail.com> Date: Wed, 22 Feb 2023 11:03:56 +0530 feat(packages): Improve `update.sh` + Add Support for Automatic Updates on Release + Also update various packages and passwords
Diffstat:
| M | README.md | | | 2 | +- |
| M | modules/apps/flatpak.nix | | | 8 | ++++++++ |
| M | modules/gui/gnome.nix | | | 4 | ++-- |
| M | modules/user/passwords/navya.secret | | | 8 | ++++---- |
| M | modules/user/passwords/root.secret | | | 8 | ++++---- |
| M | modules/user/passwords/v7.secret | | | 6 | +++--- |
| D | packages/adw-gtk3.nix | | | 42 | ------------------------------------------ |
| A | packages/adw-gtk3/default.nix | | | 43 | +++++++++++++++++++++++++++++++++++++++++++ |
| A | packages/adw-gtk3/metadata.nix | | | 6 | ++++++ |
| M | packages/firefox-gnome-theme/metadata.nix | | | 4 | ++-- |
| D | packages/top-bar-organizer.nix | | | 40 | ---------------------------------------- |
| M | packages/wine/7zip.nix | | | 6 | +++--- |
| M | scripts/packages.sh | | | 33 | +++++++++++++++++++++++---------- |
| M | site/content/sample.md | | | 2 | +- |
14 files changed, 100 insertions(+), 112 deletions(-)
diff --git a/README.md b/README.md @@ -425,6 +425,7 @@ You can navigate to the `README`'s present in the various directories to know mo - Drop `cod`, `nix-linter` and `mutter-rounded` - Fix GNOME Extensions - Improve XFCE Configuration Handling +- Improve Automatic Package Update Script - Declaratively Configure Flatpak applications using [`declarative-nix-flatpak`](https://github.com/yawnt/declarative-nix-flatpak) ### 22.11 (v11) @@ -606,7 +607,6 @@ You can navigate to the `README`'s present in the various directories to know mo - **GNOME Extensions**: - Fly Pie - - Top Bar Organizer - [Wine](./packages/wine) Applications - [Flatpak](./modules/apps/flatpak.nix) Applications diff --git a/modules/apps/flatpak.nix b/modules/apps/flatpak.nix @@ -45,6 +45,14 @@ in { }; config = mkIf enable { + warnings = [ + '' + Flatpak Configuration is Enabled + - This may Sacrifice Performance and Increase Build Time + '' + ]; + + # Environment services.flatpak.enable = true; xdg.portal.enable = true; diff --git a/modules/gui/gnome.nix b/modules/gui/gnome.nix @@ -87,7 +87,7 @@ in { }; programs = with runtimes; let - default = [freedesktop.platform gnome.platform gnome.theme]; + default = [gnome.platform gnome.theme]; in rec { gradience = { name = "Gradience"; @@ -252,7 +252,7 @@ in { lock-screen-message unstable.gnomeExtensions.pano timepp - custom.top-bar-organizer + top-bar-organizer vitals worksapce-dry-names x11-gestures diff --git a/modules/user/passwords/navya.secret b/modules/user/passwords/navya.secret @@ -1,13 +1,13 @@ { - "data": "ENC[AES256_GCM,data:OmcjMFFsfKqeXvmBXmwjPfPS4X+fRSf5MUf9IwfmC/DooftXV3uTU1Il3IUqmMPBxgIZNfga9iuYqtJ3Nk9BhWxNC60HP+PA19wP3pZyDRFg58XU9IbUVKCCM1IJks5ckGPJDYP3Zw==,iv:v/wBP9xOtevJ+QVDJI7dFc2VEYOBWjgu8mabghfOzY4=,tag:KETPSVljvGKk9WHVQyW8LQ==,type:str]", + "data": "ENC[AES256_GCM,data:XfcK6+N/uSHvmejQrtcU0XxYbNVnT78z08y6++p1yGWXevKCLXv387sbSp4E3Fqv2iiAQFm6R5GzbetC5eUv8GG/wcEE199Bsw==,iv:5qDsD8BJc4GTLIYS1gRwNeN65wnWoJbRFE6p1UjHQ8M=,tag:7kB9u2soOj+tc2n0NszM/w==,type:str]", "sops": { "kms": null, "gcp_kms": null, "azure_kv": null, "hc_vault": null, "age": null, - "lastmodified": "2021-12-01T05:54:57Z", - "mac": "ENC[AES256_GCM,data:K7zXuNK5wPVa9ieLCvMtA0uYjUNG8IGyxkXwGgZKgM1q6xLKAbtGaj0fa7/SF6wdHuuZy/7IdV0pVf30uwSzN5jplXarfJIpuVWKJ/SYC8tZh2bm66h34WuCJo9+M9B76Xjgpjzu8OZxbo4+MTvhRdem3KMxPXJgRX/F5G6uclg=,iv:+bPNFP58FrlUt9WlLqdp/84f0djHS4+czQLXSWU4YA0=,tag:dXRBsCzSDQpTqVLC2NcVbw==,type:str]", + "lastmodified": "2023-02-22T04:23:28Z", + "mac": "ENC[AES256_GCM,data:BgCdGY75ev5tenuOipS9uVq+NH+CQXftSuATlmerK2fC9ZIkR6ywJPAC2zbUH5sHJDAO4pC2Bei8LDSVuT4BSyUP9atKvvmaHIdu66JIvnxB7IAIS7fSGvLiaHjnoyc9ggPJys/FTbUYzpdGLyW3CoOjYwVazejGKD0Gjm3lP8U=,iv:/gU51plMBfwsQUpFhi/VGudaWvkdjYhhQlxwDFewx7A=,tag:Z4AQuO1OOlokkp1mKrVAdQ==,type:str]", "pgp": [ { "created_at": "2022-02-05T06:45:44Z", @@ -21,6 +21,6 @@ } ], "unencrypted_suffix": "_unencrypted", - "version": "3.7.1" + "version": "3.7.3" } } \ No newline at end of file diff --git a/modules/user/passwords/root.secret b/modules/user/passwords/root.secret @@ -1,13 +1,13 @@ { - "data": "ENC[AES256_GCM,data:iUFClErAIZuCwSjx+118VYvC/2XQBaDdWVYr1GDOiCidaEC99lemA8lEBEjyFyR85CJjOqlrBiRlhRqfsAwQcj1X/1zeMXNXhQHXkU1A68uE/pl655W/VaW4XZxoZbUrU6T4JLbWHFo9,iv:BfLArVtqerDJL8PIGltAjyfcADcRMqJF/YOw7hcew10=,tag:lQI1BjbEQWaxulLwUuMYJQ==,type:str]", + "data": "ENC[AES256_GCM,data:Em3HYtbq2fF+jWZ5kGJm5TjIkO7GWU9pmulvHnfdoZHW/seBHIUfvj2eXw+W0zz1A4WXrkMqh6K1VJw/oMpHPgFqBREuuIgj/A==,iv:zsDVb1NrPFm0L5cU1s+geL02NBQuB9BnMeyCF889mig=,tag:SrNwYQ+GqWzIxkvaRQcC0A==,type:str]", "sops": { "kms": null, "gcp_kms": null, "azure_kv": null, "hc_vault": null, "age": null, - "lastmodified": "2021-12-01T05:54:53Z", - "mac": "ENC[AES256_GCM,data:hz1SPH8axns4iB2NMimL4E2dYUI/ZSEiroSG4ySCeB+hSCrrQ9C0bsdRwUt/wOK8H1E3p0CWudyGWiwO5VS8FEXItzfvYIejWw0GNKiiJNAPNqQlJM3tWicfIo/AsAEt9ahXaxFHS2RUWYTLxP33iTx4wfVGRsHW/Pw5hbgXtoI=,iv:hZ9UPu8qQshucd9UJBYf4CmiIQkYf2DqHjKRBZBa4Ek=,tag:R3S+vC/pa7POtJCBVjgOCA==,type:str]", + "lastmodified": "2023-02-22T04:22:35Z", + "mac": "ENC[AES256_GCM,data:T3QQqYx3xjeLk7LrZaSqKRKVOBIPfpvAyNT/DZ9Yp0WBJXDijsJAFlpA6pyrfCmR2Nw6u89Twk75m04af3IEUhgHDuTSMFYQrv4XCBmxnRd5Cy/JL8wXyqywB8XehipH0JUwZwZQuAeqdkXccEUURUgLv70//hyyXj7kNhHB+s4=,iv:6cGQcuI8DxCLkAjW5flGuTMwUQBcUUb50gTVOkKaGBw=,tag:jDwNOjVwrWmdcEIfgJobaQ==,type:str]", "pgp": [ { "created_at": "2022-02-05T06:50:35Z", @@ -21,6 +21,6 @@ } ], "unencrypted_suffix": "_unencrypted", - "version": "3.7.1" + "version": "3.7.3" } } \ No newline at end of file diff --git a/modules/user/passwords/v7.secret b/modules/user/passwords/v7.secret @@ -1,13 +1,13 @@ { - "data": "ENC[AES256_GCM,data:zE0VdZHmSD/LdSU9lzDP0X2+XhS3fvF+3tWAysKmay2kbFHoH3XlgdkxQVJ3YZLWubnbblsii09c2sc2F2qNcQF+3atrIHAerg==,iv:WI08Zgjp4m305IPswCmiUNBIWqF2NzGMX1WRt9LFkDI=,tag:+6xlVAKpzZhQGCnht5v7SA==,type:str]", + "data": "ENC[AES256_GCM,data:49osZeK2IlheygbJpGjILcNQHB2tGOeDW6TWU522sJbnQ+s9EreDd48Yz7YIr3nnxww/4hDHGeP1zN6i5CXY4dsDymR/98WAdw==,iv:1hfp6hEdlqgfDK05bY4GeWX1fzAxQUnyPrTX4CzYkKE=,tag:JmmAYsLN8Tw5bfab3Lk95Q==,type:str]", "sops": { "kms": null, "gcp_kms": null, "azure_kv": null, "hc_vault": null, "age": null, - "lastmodified": "2023-01-26T01:03:55Z", - "mac": "ENC[AES256_GCM,data:AaAUnd1RyFbfXWc4ss/2hH++G1lrvvbeAA3PnEmTax7mI+b0d5ucfXlwWljDzLl82+tRllAdDzQcSvwNf23RUIvawwcvn0SPS2zekvDVbfWxZNGBWei9EJtE8FQVLtqxApBFOxfmN4sBxcFjDPMH6JUtJt1ElGgrSXWQ0xhITew=,iv:AoaJ8c0cifM9AAd7jzyljP0gbKkWB2CG/liZuCi2iqY=,tag:jcWFBaG6rmK4X1J1kvdmmA==,type:str]", + "lastmodified": "2023-02-22T04:22:09Z", + "mac": "ENC[AES256_GCM,data:tV6DXfYKd5EYFkBtoNwpxqYrTVl/yNhG8Elxebg/YiU50BR32ACZBYArFznXpKfgoQG8YawJwCX6idhOaMCsKeDRXtoI4Ark8glz3+uoDmBUR7TWQtNMCkfpWMV1oOFc+CD6YmKvmKwaS+lTG4ml6AgGzH1awKr1ZWTiSzkwTLI=,iv:blHIRefRWqgxV13SS4Yjf24MKCrH9nz0T4ugcS8ZZ78=,tag:eYMNeJ86+fcG+cNnSZfRLQ==,type:str]", "pgp": [ { "created_at": "2022-02-05T06:50:31Z", diff --git a/packages/adw-gtk3.nix b/packages/adw-gtk3.nix @@ -1,42 +0,0 @@ -{ - lib, - pkgs, - ... -}: -with pkgs; - stdenvNoCC.mkDerivation rec { - pname = "adw-gtk3"; - version = "v4.2"; - - src = fetchFromGitHub { - owner = "lassekongo83"; - repo = pname; - rev = version; - sha256 = "sha256-dHSYm52+Wra5rh756sOuAlaKoQtkT8bSNGVnbINy8jA="; - }; - - nativeBuildInputs = [ - meson - ninja - sassc - ]; - - postPatch = '' - chmod +x gtk/src/adw-gtk3-dark/gtk-3.0/install-dark-theme.sh - patchShebangs gtk/src/adw-gtk3-dark/gtk-3.0/install-dark-theme.sh - ''; - - passthru = { - updateScript = nix-update-script { - attrPath = pname; - }; - }; - - meta = with lib; { - description = "The theme from libadwaita ported to GTK-3"; - homepage = "https://github.com/lassekongo83/adw-gtk3"; - license = licenses.lgpl21Only; - platforms = platforms.linux; - maintainers = ["maydayv7"]; - }; - } diff --git a/packages/adw-gtk3/default.nix b/packages/adw-gtk3/default.nix @@ -0,0 +1,43 @@ +{ + lib, + pkgs, + ... +}: +with pkgs; let + metadata = import ./metadata.nix; +in + stdenvNoCC.mkDerivation rec { + pname = "adw-gtk3"; + version = metadata.rev; + + src = fetchFromGitHub { + owner = "lassekongo83"; + repo = pname; + inherit (metadata) rev sha256; + }; + + nativeBuildInputs = [ + meson + ninja + sassc + ]; + + postPatch = '' + chmod +x gtk/src/adw-gtk3-dark/gtk-3.0/install-dark-theme.sh + patchShebangs gtk/src/adw-gtk3-dark/gtk-3.0/install-dark-theme.sh + ''; + + passthru = { + updateScript = nix-update-script { + attrPath = pname; + }; + }; + + meta = with lib; { + description = "The theme from libadwaita ported to GTK-3"; + homepage = metadata.repo; + license = licenses.lgpl21Only; + platforms = platforms.linux; + maintainers = ["maydayv7"]; + }; + } diff --git a/packages/adw-gtk3/metadata.nix b/packages/adw-gtk3/metadata.nix @@ -0,0 +1,6 @@ +{ + repo = "https://github.com/lassekongo83/adw-gtk3"; + rev = "v4.3"; + sha256 = "sha256-/5ZGDEJA05jHZNa6v+g1GvoT8kJNZvQAKNewwNj/zRc="; + release = "true"; +} diff --git a/packages/firefox-gnome-theme/metadata.nix b/packages/firefox-gnome-theme/metadata.nix @@ -1,6 +1,6 @@ { repo = "https://github.com/rafaelmardojai/firefox-gnome-theme"; branch = "master"; - rev = "013ace40efd68bc4b4a6610850576d1654c9cd18"; - sha256 = "sha256-jvvPDDzXlIxBY1LQRiADQUPrwZTK12MIOz8vT+yCKOQ="; + rev = "0d1349acdfe006dfd94cfa3bae58151450ebe844"; + sha256 = "sha256-mqRF41HJkUn2zdnDuG2K2repBRt3SeleVVkHxsUu6no="; } diff --git a/packages/top-bar-organizer.nix b/packages/top-bar-organizer.nix @@ -1,40 +0,0 @@ -{ - lib, - pkgs, - ... -}: -with pkgs; - stdenv.mkDerivation rec { - pname = "gnome-shell-extension-top-bar-organizer"; - version = "v2"; - - src = fetchFromGitLab { - domain = "gitlab.gnome.org"; - owner = "julianschacher"; - repo = "top-bar-organizer"; - rev = version; - sha256 = "sha256-qpvjVT5/+3tw1IUHfK3njtS8AVI6Xy/am8zQ5o2H4uo="; - }; - - dontBuild = true; - buildInputs = [glib]; - installPhase = '' - glib-compile-schemas src/schemas - mkdir -p $out/share/gnome-shell/extensions/top-bar-organizer@julian.gse.jsts.xyz/ - cp -r src/. $out/share/gnome-shell/extensions/top-bar-organizer@julian.gse.jsts.xyz/ - ''; - - passthru = { - extensionUuid = "top-bar-organizer@julian.gse.jsts.xyz"; - extensionPortalSlug = "top-bar-organizer"; - }; - - meta = with lib; { - description = "Gnome Shell Extension for organizing your Top Bar"; - longDescription = "Manually Packaged because v3 doesn't work"; - homepage = "https://extensions.gnome.org/extension/4356/top-bar-organizer/"; - license = licenses.gpl3; - platforms = platforms.linux; - maintainers = ["maydayv7"]; - }; - } diff --git a/packages/wine/7zip.nix b/packages/wine/7zip.nix @@ -12,10 +12,10 @@ in mkWindowsApp rec { inherit wine; pname = "7zip"; - version = "1900"; + version = "2201"; src = fetchurl { - url = "https://www.7-zip.org/a/7z1900.exe"; - sha256 = "107gnx5rimmyr0kndxblkhrwlqn9x1aga7d07ghyxsq3bd6s16km"; + url = "https://www.7-zip.org/a/7z${version}.exe"; + sha256 = "sha256-jI+8+A8EhLSKB70g5RKxA5aZktv4G2WIgysIIF46G0M="; }; dontUnpack = true; diff --git a/scripts/packages.sh b/scripts/packages.sh @@ -1,11 +1,13 @@ #! /usr/bin/env nix-shell #! nix-shell -i bash -p coreutils jq # shellcheck shell=bash +set -euo pipefail # Script to Automatically Update Packages # -set -euo pipefail +# Preset Variables unset NIX_PATH +fakeHash="0000000000000000000000000000000000000000000000000000000000000000" # Logic update() { @@ -24,11 +26,13 @@ update() { fi # Extraction + # Include ${pkg}/metadata.nix according to spec nix eval -f "${metadata}" --json > "${t}" 2>/dev/null - branch="$(cat "${t}" | jq -r .branch)" rev="$(cat "${t}" | jq -r .rev)" sha256="$(cat "${t}" | jq -r .sha256)" - repo="$(cat "${t}" | jq -r .repo)" # Optional + repo="$(cat "${t}" | jq -r .repo)" + branch="$(cat "${t}" | jq -r .branch)" # Optional + release="$(cat "${t}" | jq -r .release)" # Optional cargoSha256="$(cat "${t}" | jq -r .cargoSha256)" # Optional vendorSha256="$(cat "${t}" | jq -r .vendorSha256)" # Optional skip="$(cat "${t}" | jq -r .skip)" # Optional @@ -47,7 +51,16 @@ update() { # Latest Revision if [[ "${repo}" != "null" ]] then - newrev="$(git ls-remote "${repo}" "refs/heads/${branch}" | awk '{ print $1}')" + if [[ "${release}" == "true" ]] + then + newrev="$(git ls-remote --refs --sort="version:refname" --tags ${repo} | cut -d/ -f3-|tail -n1)" + else + if [ -z "${branch}" ] + then + branch="main" + fi + newrev="$(git ls-remote "${repo}" "refs/heads/${branch}" | awk '{ print $1}')" + fi fi # Early Quit @@ -62,7 +75,7 @@ update() { # Sha256 sed -i "s|${rev}|${newrev}|" "${metadata}" - sed -i "s|${sha256}|0000000000000000000000000000000000000000000000000000|" "${metadata}" + sed -i "s|${sha256}|${fakeHash}|" "${metadata}" nix build --no-link "..#${upattr}" &> "${l}" || true newsha256="$(cat "${l}" | grep 'got:' | cut -d':' -f2 | tr -d ' ' || true)" if [[ "${newsha256}" == "sha256" ]] @@ -71,12 +84,12 @@ update() { fi newsha256="$(nix hash to-sri --type sha256 "${newsha256}")" - sed -i "s|0000000000000000000000000000000000000000000000000000|${newsha256}|" "${metadata}" + sed -i "s|${fakeHash}|${newsha256}|" "${metadata}" # CargoSha256 if [[ "${cargoSha256}" != "null" ]] then - sed -i "s|${cargoSha256}|0000000000000000000000000000000000000000000000000000|" "${metadata}" + sed -i "s|${cargoSha256}|${fakeHash}|" "${metadata}" nix build --no-link "..#${upattr}" &> "${l}" || true newcargoSha256="$(cat "${l}" | grep 'got:' | cut -d':' -f2 | tr -d ' ' || true)" if [[ "${newcargoSha256}" == "sha256" ]] @@ -84,13 +97,13 @@ update() { newcargoSha256="$(cat "${l}" | grep 'got:' | cut -d':' -f3 | tr -d ' ' || true)" fi newcargoSha256="$(nix hash to-sri --type sha256 "${newcargoSha256}")" - sed -i "s|0000000000000000000000000000000000000000000000000000|${newcargoSha256}|" "${metadata}" + sed -i "s|${fakeHash}|${newcargoSha256}|" "${metadata}" fi # VendorSha256 if [[ "${vendorSha256}" != "null" ]] then - sed -i "s|${vendorSha256}|0000000000000000000000000000000000000000000000000000|" "${metadata}" + sed -i "s|${vendorSha256}|${fakeHash}|" "${metadata}" nix build --no-link "..#${upattr}" &> "${l}" || true newvendorSha256="$(cat "${l}" | grep 'got:' | cut -d':' -f2 | tr -d ' ' || true)" if [[ "${newvendorSha256}" == "sha256" ]] @@ -98,7 +111,7 @@ update() { newvendorSha256="$(cat "${l}" | grep 'got:' | cut -d':' -f3 | tr -d ' ' || true)" fi newvendorSha256="$(nix hash to-sri --type sha256 "${newvendorSha256}")" - sed -i "s|0000000000000000000000000000000000000000000000000000|${newvendorSha256}|" "${metadata}" + sed -i "s|${fakeHash}|${newvendorSha256}|" "${metadata}" fi # Commit diff --git a/site/content/sample.md b/site/content/sample.md @@ -58,7 +58,7 @@ fn foo(arg: String) -> Result<u32, Io::Error> { ## Block Quote > Do not fall in love with people like me. I will take you to museums, and parks, and monuments, and kiss you in every beautiful place, so that you can never go back to them without tasting me like blood in your mouth. I will destroy you in the most beautiful way possible. And when I leave you will finally understand, why storms are named after people. -> +> > --> **Caitlyn Siehl** > > > Heroes get remembered, but legends never die