diff --git a/.editorconfig b/.editorconfig index cef70f21..e814d0f4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,7 +6,7 @@ end_of_line = lf indent_style = space insert_final_newline = true trim_trailing_whitespace = true -charset = utf-8 +charset = unset [*.{diff,patch}] end_of_line = unset diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 098d7bac..914b0c82 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,6 +7,6 @@ updates: target-branch: "master" schedule: interval: daily - labels: ["topic: dependencies", "backport: release-25.05"] + labels: ["topic: dependencies", "backport: release-25.11"] commit-message: prefix: "ci" diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 482e5b6f..aa31ee03 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -45,7 +45,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} token: ${{ steps.app-token.outputs.token }} - - uses: korthout/backport-action@v3.4.1 + - uses: korthout/backport-action@v4.0.1 id: backport with: github_token: ${{ steps.app-token.outputs.token }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index b444280a..00000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -name: Check - -on: - push: - branches: - - master - - release-** - pull_request: - -permissions: - contents: read - -defaults: - run: - shell: bash - -jobs: - check: - name: ${{ matrix.name }} - runs-on: ${{ matrix.runs-on }} - - # https://docs.github.com/en/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job#choosing-github-hosted-runners - strategy: - matrix: - include: - - name: aarch64-linux - runs-on: ubuntu-24.04-arm - - name: aarch64-darwin - runs-on: macos-15 - - name: x86_64-linux - runs-on: ubuntu-24.04 - - name: x86_64-darwin - runs-on: macos-15-intel - - steps: - - uses: actions/checkout@v6 - with: - persist-credentials: false - - # TODO: Lock this Action to a release tag once commit [1] ("fix: relocate - # TMPDIR to /mnt to improve Nix installer compatibility") is part of a - # release, resolving [2] ("does not work with cachix install nix action"). - # - # [1]: https://github.com/wimpysworld/nothing-but-nix/pull/25 - # [2]: https://github.com/wimpysworld/nothing-but-nix/issues/24 - - uses: wimpysworld/nothing-but-nix@10c936d9e46521bf923f75458e0cbd4fa309300d # yamllint disable-line rule:line-length - if: runner.os == 'Linux' - with: - hatchet-protocol: rampage - - - uses: cachix/install-nix-action@v31 - - - uses: cachix/cachix-action@v16 - with: - name: nix-community - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - continue-on-error: true - - - run: nix develop --command stylix-check --no-nom diff --git a/.github/workflows/update-flake.yml b/.github/workflows/update-flake.yml index 5b447f73..31283bf8 100644 --- a/.github/workflows/update-flake.yml +++ b/.github/workflows/update-flake.yml @@ -16,7 +16,7 @@ jobs: if: vars.APP_ID strategy: matrix: - branch: [master, release-25.05] + branch: [master, release-25.11] steps: - id: generate-token uses: actions/create-github-app-token@v2 @@ -57,30 +57,23 @@ jobs: - name: update lock files run: | - nix flake update \ - --commit-lock-file \ - --option commit-lock-file-summary "flake: update public inputs" + nix flake update & + nix flake update --flake ./flake/dev & - nix flake update \ - --commit-lock-file \ - --flake ./flake/dev \ - --option commit-lock-file-summary "flake: update dev inputs" + wait + + git add {,flake/dev/}flake.lock # The nixpkgs maintainers may have changed, so keep all-maintainers # in sync if nix run .#all-maintainers; then git add generated/all-maintainers.nix - - if - ! git commit --message "stylix: update all-maintainers list" - then - echo "::debug::generated/all-maintainers.nix has no changes" - fi - else echo "::error::failed to update generated/all-maintainers.nix" fi + git commit --message "flake: update all inputs" + - name: create pull request env: GH_TOKEN: ${{ steps.generate-token.outputs.token }} @@ -88,7 +81,7 @@ jobs: body: "This is an automated update triggered by the [workflow run #${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})." # yamllint disable-line rule:line-length label: "topic: dependencies" pr_branch: update_flake_lock_action_${{ matrix.branch }} - title: "${{ startsWith(matrix.branch, 'release') && format('[{0}] ', matrix.branch) || '' }}flake: update public and dev inputs" # yamllint disable-line rule:line-length + title: "${{ startsWith(matrix.branch, 'release') && format('[{0}] ', matrix.branch) || '' }}flake: update all inputs" # yamllint disable-line rule:line-length run: | git switch --create "$pr_branch" git push origin "$pr_branch" --force --set-upstream @@ -104,8 +97,8 @@ jobs: if ((pr_count)); then gh pr edit \ + --add-label "$label" \ --body "$body" \ - --label "$label" \ --title "$title" else diff --git a/doc/src/installation.md b/doc/src/installation.md index 88768647..d86b9171 100644 --- a/doc/src/installation.md +++ b/doc/src/installation.md @@ -36,8 +36,8 @@ Stylix release. For example: ```nix { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; - stylix.url = "github:nix-community/stylix/release-25.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + stylix.url = "github:nix-community/stylix/release-25.11"; } ``` @@ -190,9 +190,9 @@ matching Stylix release. For example: ```nix { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; - home-manager.url = "github:nix-community/home-manager/release-25.05"; - stylix.url = "github:nix-community/stylix/release-25.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + home-manager.url = "github:nix-community/home-manager/release-25.11"; + stylix.url = "github:nix-community/stylix/release-25.11"; } ``` diff --git a/doc/src/modules.md b/doc/src/modules.md index 615f268e..95c4e932 100644 --- a/doc/src/modules.md +++ b/doc/src/modules.md @@ -49,10 +49,7 @@ documentation for more details): ```nix { config, lib, mkTarget ... }: mkTarget { - name = "«name»"; - humanName = "«human readable name»"; - - configElements = + config = { colors }: { programs.«name».theme.background = colors.base00; diff --git a/flake.lock b/flake.lock index 09eba77b..c958f4d5 100644 --- a/flake.lock +++ b/flake.lock @@ -21,28 +21,28 @@ "base16-fish": { "flake": false, "locked": { - "lastModified": 1754405784, - "narHash": "sha256-l9xHIy+85FN+bEo6yquq2IjD1rSg9fjfjpyGP1W8YXo=", + "lastModified": 1765809053, + "narHash": "sha256-XCUQLoLfBJ8saWms2HCIj4NEN+xNsWBlU1NrEPcQG4s=", "owner": "tomyun", "repo": "base16-fish", - "rev": "23ae20a0093dca0d7b39d76ba2401af0ccf9c561", + "rev": "86cbea4dca62e08fb7fd83a70e96472f92574782", "type": "github" }, "original": { "owner": "tomyun", "repo": "base16-fish", - "rev": "23ae20a0093dca0d7b39d76ba2401af0ccf9c561", + "rev": "86cbea4dca62e08fb7fd83a70e96472f92574782", "type": "github" } }, "base16-helix": { "flake": false, "locked": { - "lastModified": 1752979451, - "narHash": "sha256-0CQM+FkYy0fOO/sMGhOoNL80ftsAzYCg9VhIrodqusM=", + "lastModified": 1760703920, + "narHash": "sha256-m82fGUYns4uHd+ZTdoLX2vlHikzwzdu2s2rYM2bNwzw=", "owner": "tinted-theming", "repo": "base16-helix", - "rev": "27cf1e66e50abc622fb76a3019012dc07c678fac", + "rev": "d646af9b7d14bff08824538164af99d0c521b185", "type": "github" }, "original": { @@ -71,11 +71,11 @@ "firefox-gnome-theme": { "flake": false, "locked": { - "lastModified": 1758112371, - "narHash": "sha256-lizRM2pj6PHrR25yimjyFn04OS4wcdbc38DCdBVa2rk=", + "lastModified": 1764724327, + "narHash": "sha256-OkFLrD3pFR952TrjQi1+Vdj604KLcMnkpa7lkW7XskI=", "owner": "rafaelmardojai", "repo": "firefox-gnome-theme", - "rev": "0909cfe4a2af8d358ad13b20246a350e14c2473d", + "rev": "66b7c635763d8e6eb86bd766de5a1e1fbfcc1047", "type": "github" }, "original": { @@ -91,11 +91,11 @@ ] }, "locked": { - "lastModified": 1756770412, - "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "lastModified": 1763759067, + "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "4524271976b625a4a605beefd893f270620fd751", + "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", "type": "github" }, "original": { @@ -124,11 +124,11 @@ "flake": false, "locked": { "host": "gitlab.gnome.org", - "lastModified": 1762869044, - "narHash": "sha256-nwm/GJ2Syigf7VccLAZ66mFC8mZJFqpJmIxSGKl7+Ds=", + "lastModified": 1764524476, + "narHash": "sha256-bTmNn3Q4tMQ0J/P0O5BfTQwqEnCiQIzOGef9/aqAZvk=", "owner": "GNOME", "repo": "gnome-shell", - "rev": "680e3d195a92203f28d4bf8c6e8bb537cc3ed4ad", + "rev": "c0e1ad9f0f703fd0519033b8f46c3267aab51a22", "type": "gitlab" }, "original": { @@ -141,16 +141,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1762977756, - "narHash": "sha256-4PqRErxfe+2toFJFgcRKZ0UI9NSIOJa+7RXVtBhy4KE=", + "lastModified": 1764522689, + "narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c5ae371f1a6a7fd27823bc500d9390b38c05fa55", + "rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } @@ -165,11 +165,11 @@ ] }, "locked": { - "lastModified": 1758998580, - "narHash": "sha256-VLx0z396gDCGSiowLMFz5XRO/XuNV+4EnDYjdJhHvUk=", + "lastModified": 1764773531, + "narHash": "sha256-mCBl7MD1WZ7yCG6bR9MmpPO2VydpNkWFgnslJRIT1YU=", "owner": "nix-community", "repo": "NUR", - "rev": "ba8d9c98f5f4630bcb0e815ab456afd90c930728", + "rev": "1d9616689e98beded059ad0384b9951e967a17fa", "type": "github" }, "original": { @@ -248,11 +248,11 @@ "tinted-schemes": { "flake": false, "locked": { - "lastModified": 1757716333, - "narHash": "sha256-d4km8W7w2zCUEmPAPUoLk1NlYrGODuVa3P7St+UrqkM=", + "lastModified": 1763914658, + "narHash": "sha256-Hju0WtMf3iForxtOwXqGp3Ynipo0EYx1AqMKLPp9BJw=", "owner": "tinted-theming", "repo": "schemes", - "rev": "317a5e10c35825a6c905d912e480dfe8e71c7559", + "rev": "0f6be815d258e435c9b137befe5ef4ff24bea32c", "type": "github" }, "original": { @@ -264,11 +264,11 @@ "tinted-tmux": { "flake": false, "locked": { - "lastModified": 1757811970, - "narHash": "sha256-n5ZJgmzGZXOD9pZdAl1OnBu3PIqD+X3vEBUGbTi4JiI=", + "lastModified": 1764465359, + "narHash": "sha256-lbSVPqLEk2SqMrnpvWuKYGCaAlfWFMA6MVmcOFJjdjE=", "owner": "tinted-theming", "repo": "tinted-tmux", - "rev": "d217ba31c846006e9e0ae70775b0ee0f00aa6b1e", + "rev": "edf89a780e239263cc691a987721f786ddc4f6aa", "type": "github" }, "original": { @@ -280,11 +280,11 @@ "tinted-zed": { "flake": false, "locked": { - "lastModified": 1757811247, - "narHash": "sha256-4EFOUyLj85NRL3OacHoLGEo0wjiRJzfsXtR4CZWAn6w=", + "lastModified": 1764464512, + "narHash": "sha256-rCD/pAhkMdCx6blsFwxIyvBJbPZZ1oL2sVFrH07lmqg=", "owner": "tinted-theming", "repo": "base16-zed", - "rev": "824fe0aacf82b3c26690d14e8d2cedd56e18404e", + "rev": "907dbba5fb8cf69ebfd90b00813418a412d0a29a", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 9a0502da..bd5791b7 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Theming framework for NixOS, Home Manager, nix-darwin, and Nix-on-Droid"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; flake-parts = { url = "github:hercules-ci/flake-parts"; @@ -13,16 +13,13 @@ # keep-sorted start block=yes newline_separated=yes base16-fish = { - # Lock the base16-fish input to a custom patch [2] ("Make autosuggestion - # and comment base03"), since it is currently impossible to apply patches + # Lock the base16-fish input to a custom patchset that cherry-picks + # pending patches [2], since it is currently impossible to apply patches # to flake inputs [1] ("Support flake references to patches"). # - # Once this single-patch approach no longer scales, the repository should - # be properly forked, if [2] has still not been merged. - # # [1]: https://github.com/NixOS/nix/issues/3920 - # [2]: https://github.com/tomyun/base16-fish/pull/12 - url = "github:tomyun/base16-fish/23ae20a0093dca0d7b39d76ba2401af0ccf9c561"; + # [2]: https://github.com/tomyun/base16-fish/pull/16 + url = "github:tomyun/base16-fish/86cbea4dca62e08fb7fd83a70e96472f92574782"; flake = false; }; @@ -99,6 +96,13 @@ # keep-sorted end }; + nixConfig = { + extra-substituters = [ "https://nix-community.cachix.org" ]; + extra-trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + outputs = { flake-parts, systems, ... }@inputs: flake-parts.lib.mkFlake { inherit inputs; } { diff --git a/flake/default.nix b/flake/default.nix index 4932617d..18d4cafc 100644 --- a/flake/default.nix +++ b/flake/default.nix @@ -15,10 +15,7 @@ extraInputsFlake = ./dev; }; - partitionedAttrs = lib.genAttrs [ - "checks" - "ci" - "devShells" - "formatter" - ] (_: "dev"); + partitionedAttrs = lib.genAttrs [ "checks" "ci" "devShells" "formatter" ] ( + _: "dev" + ); } diff --git a/flake/deprecation/default.nix b/flake/deprecation/default.nix index da7cb8e6..7fe73e3b 100644 --- a/flake/deprecation/default.nix +++ b/flake/deprecation/default.nix @@ -1,12 +1,6 @@ +{ lib, self, ... }: { - lib, - self, - ... -}: -{ - imports = [ - ./per-system-option.nix - ]; + imports = [ ./per-system-option.nix ]; # NOTE: the `flake` submodule has a `lazyAttrsOf` freeform type. # diff --git a/flake/dev/dev-shell.nix b/flake/dev/dev-shell.nix index 53ff15f1..df6c4244 100644 --- a/flake/dev/dev-shell.nix +++ b/flake/dev/dev-shell.nix @@ -39,6 +39,8 @@ ''; in { + ci.buildbot = { inherit (config) devShells; }; + devShells = { default = pkgs.mkShell { # Install git-hooks when activating the shell diff --git a/flake/dev/flake.lock b/flake/dev/flake.lock index d839b015..bf7de24a 100644 --- a/flake/dev/flake.lock +++ b/flake/dev/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1756770412, - "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "lastModified": 1763759067, + "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "4524271976b625a4a605beefd893f270620fd751", + "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", "type": "github" }, "original": { @@ -22,16 +22,16 @@ }, "dev-nixpkgs": { "locked": { - "lastModified": 1762977756, - "narHash": "sha256-4PqRErxfe+2toFJFgcRKZ0UI9NSIOJa+7RXVtBhy4KE=", + "lastModified": 1764522689, + "narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c5ae371f1a6a7fd27823bc500d9390b38c05fa55", + "rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } @@ -53,11 +53,11 @@ }, "flake-compat": { "locked": { - "lastModified": 1761588595, - "narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=", + "lastModified": 1764712249, + "narHash": "sha256-DhsrZsMebdvpjZC2EzPsqiLGI84tD7kZz7zc6tTCmqg=", "owner": "NixOS", "repo": "flake-compat", - "rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5", + "rev": "3b279e4317ccfa4865356387935310531357d919", "type": "github" }, "original": { @@ -66,26 +66,6 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": [ - "dev-systems" - ] - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "git-hooks": { "inputs": { "flake-compat": [ @@ -97,11 +77,11 @@ ] }, "locked": { - "lastModified": 1758108966, - "narHash": "sha256-ytw7ROXaWZ7OfwHrQ9xvjpUWeGVm86pwnEd1QhzawIo=", + "lastModified": 1763988335, + "narHash": "sha256-QlcnByMc8KBjpU37rbq5iP7Cp97HvjRP0ucfdh+M4Qc=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "54df955a695a84cd47d4a43e08e1feaf90b1fd9b", + "rev": "50b9238891e388c9fdc6a5c49e49c42533a1b5ce", "type": "github" }, "original": { @@ -117,26 +97,27 @@ ] }, "locked": { - "lastModified": 1760809591, - "narHash": "sha256-OxGcFcQdfOK8veZkPdQuqXIotFYiy4sBQB58dMNLeHY=", + "lastModified": 1765859973, + "narHash": "sha256-LN5O0h9GSgcDE/sz4+sLS3CbQALru1x4lh9hrxpeHwI=", "owner": "nix-community", "repo": "home-manager", - "rev": "870883ba11ba1c84f756c0c1f9fa74cdb2a16c1e", + "rev": "7df150f0d3857cf68dae443813b27acfb201b2d8", "type": "github" }, "original": { "owner": "nix-community", + "ref": "release-25.11", "repo": "home-manager", "type": "github" } }, "mnw": { "locked": { - "lastModified": 1756659871, - "narHash": "sha256-v6Rh4aQ6RKjM2N02kK9Usn0Ix7+OY66vNpeklc1MnGE=", + "lastModified": 1758834834, + "narHash": "sha256-Y7IvY4F8vajZyp3WGf+KaiIVwondEkMFkt92Cr9NZmg=", "owner": "Gerg-L", "repo": "mnw", - "rev": "ed6cc3e48557ba18266e598a5ebb6602499ada16", + "rev": "cfbc7d1cc832e318d0863a5fc91d940a96034001", "type": "github" }, "original": { @@ -159,19 +140,40 @@ ] }, "locked": { - "lastModified": 1763393971, - "narHash": "sha256-FhgZD8pk3VE2SL0g4nCYKF0L6IO3uL110tfrBaZkdG0=", + "lastModified": 1764755396, + "narHash": "sha256-f6UrlGdwg+TIxxyDjeq1M7WGNZH/vpbOm0yzPgkMy9c=", "owner": "nix-community", "repo": "nixvim", - "rev": "7a30e6cf259d8db84aefc626058c074bd995d482", + "rev": "64d9e2616f4ee2acee380d61ccf1f3d610e7e969", "type": "github" }, "original": { "owner": "nix-community", + "ref": "nixos-25.11", "repo": "nixvim", "type": "github" } }, + "noctalia-shell": { + "inputs": { + "nixpkgs": [ + "dev-nixpkgs" + ] + }, + "locked": { + "lastModified": 1765201259, + "narHash": "sha256-6btxUos1OY0LSk9hBVnLRcklLGBKCA2SCq9WkoLa91E=", + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "rev": "c2b245703021e65a761a7de06b3b6b91d609a6c5", + "type": "github" + }, + "original": { + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "type": "github" + } + }, "nvf": { "inputs": { "flake-compat": [], @@ -187,11 +189,11 @@ ] }, "locked": { - "lastModified": 1758271661, - "narHash": "sha256-ENqd2/33uP5vB44ClDjjAV+J78oF8q1er4QUZuT8Z7g=", + "lastModified": 1762622004, + "narHash": "sha256-NpzzgaoMK8aRHnndHWbYNKLcZN0r1y6icCoJvGoBsoE=", "owner": "NotAShelf", "repo": "nvf", - "rev": "b7571df4d6e9ac08506a738ddceeec0b141751b0", + "rev": "09470524a214ed26633ddc2b6ec0c9bf31a8b909", "type": "github" }, "original": { @@ -209,6 +211,7 @@ "git-hooks": "git-hooks", "home-manager": "home-manager", "nixvim": "nixvim", + "noctalia-shell": "noctalia-shell", "nvf": "nvf", "spicetify-nix": "spicetify-nix", "treefmt-nix": "treefmt-nix", @@ -226,11 +229,11 @@ ] }, "locked": { - "lastModified": 1758584568, - "narHash": "sha256-FDxTheW6ynpbro/8eTZHhAY7J+HOf0jXeXq3jrJDcS8=", + "lastModified": 1764698597, + "narHash": "sha256-4f0y9Fo3AChngd/qRQ7wbcy6FH33NFZbyFXn7IeUI14=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "9e9e48ca16628bf09a02bc5449d4b0761e15eebd", + "rev": "1da6ebbbcf0301ff773e9c43bdd4c051af9523f7", "type": "github" }, "original": { @@ -261,17 +264,19 @@ }, "vicinae": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": [ "dev-nixpkgs" + ], + "systems": [ + "dev-systems" ] }, "locked": { - "lastModified": 1763505293, - "narHash": "sha256-huleUPkt0iZJZy4e/KPhcHK4ueeqaqiMUu7Ft6NVDFU=", + "lastModified": 1764768018, + "narHash": "sha256-wgQUCbnfUPBWvhMnFUcwABH4qmNE8cxjFc+40u4ReB4=", "owner": "vicinaehq", "repo": "vicinae", - "rev": "e600ffc4ad1e87f3389327adfab8bb8d2f34261e", + "rev": "c5648e0a0727dd99ff2e2e18c683474881987641", "type": "github" }, "original": { @@ -290,11 +295,11 @@ ] }, "locked": { - "lastModified": 1759033338, - "narHash": "sha256-03GJ6F5jXuxEgazHE2A3WB/kEyHO/rF1VPA9qYodq0E=", + "lastModified": 1764736168, + "narHash": "sha256-CQcj/oWKH4zN8Xkc1RglX+uOJTW1fwNWvMQWRXRlEys=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "9f3b1a6f32771e47d1bab71fa38f4d74873540b3", + "rev": "df63ce4f706567e6efa083ba63d5e7792bf70ffa", "type": "github" }, "original": { diff --git a/flake/dev/flake.nix b/flake/dev/flake.nix index 1f0143a0..c85db98a 100644 --- a/flake/dev/flake.nix +++ b/flake/dev/flake.nix @@ -120,7 +120,7 @@ # # [1]: https://github.com/NixOS/nix/blob/d4f67fd46dfe2bc950bdfa14273f87b8a4c32e47/doc/manual/source/release-notes/rl-2.26.md?plain=1#L3-L11 inputs = { - dev-nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + dev-nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; dev-flake-parts = { url = "github:hercules-ci/flake-parts"; @@ -142,12 +142,12 @@ }; home-manager = { - url = "github:nix-community/home-manager"; + url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "dev-nixpkgs"; }; nixvim = { - url = "github:nix-community/nixvim"; + url = "github:nix-community/nixvim/nixos-25.11"; inputs = { flake-parts.follows = "dev-flake-parts"; nixpkgs.follows = "dev-nixpkgs"; @@ -156,6 +156,11 @@ }; }; + noctalia-shell = { + url = "github:noctalia-dev/noctalia-shell"; + inputs.nixpkgs.follows = "dev-nixpkgs"; + }; + nvf = { url = "github:NotAShelf/nvf"; inputs = { @@ -183,7 +188,7 @@ url = "github:vicinaehq/vicinae"; inputs = { nixpkgs.follows = "dev-nixpkgs"; - flake-utils.inputs.systems.follows = "dev-systems"; + systems.follows = "dev-systems"; }; }; diff --git a/flake/dev/packages.nix b/flake/dev/packages.nix index dc6ed95f..20217c89 100644 --- a/flake/dev/packages.nix +++ b/flake/dev/packages.nix @@ -12,9 +12,7 @@ # Testbeds are virtual machines based on NixOS, therefore they are # only available for Linux systems. testbeds = lib.mkIf pkgs.stdenv.hostPlatform.isLinux ( - import ../../stylix/testbed { - inherit pkgs inputs lib; - } + import ../../stylix/testbed { inherit pkgs inputs lib; } ); ci.buildbot = { diff --git a/flake/dev/pre-commit.nix b/flake/dev/pre-commit.nix index 360f12c6..8717ef4c 100644 --- a/flake/dev/pre-commit.nix +++ b/flake/dev/pre-commit.nix @@ -1,12 +1,12 @@ { inputs, ... }: { - imports = [ - inputs.git-hooks.flakeModule - ]; + imports = [ inputs.git-hooks.flakeModule ]; perSystem = { config, ... }: { + ci.buildbot = { inherit (config.checks) pre-commit; }; + pre-commit = { check.enable = true; diff --git a/flake/dev/public-and-dev-version-consistency.nix b/flake/dev/public-and-dev-version-consistency.nix index 6cad4644..8ae2d1fe 100644 --- a/flake/dev/public-and-dev-version-consistency.nix +++ b/flake/dev/public-and-dev-version-consistency.nix @@ -1,41 +1,44 @@ { inputs, ... }: { perSystem = - { lib, pkgs, ... }: { - checks = lib.mkMerge ( - map - ( - input: - let - name = "${input}-and-dev-${input}-version-consistency"; - in - { - ${name} = - let - dev = inputs."dev-${input}".narHash; - public = inputs.${input}.narHash; - in - pkgs.runCommand name { } '' - if [ "${public}" != "${dev}" ]; then - printf \ - 'inconsistent ${input} (%s) and dev-${input} (%s) versions\n' \ - "${public}" \ - "${dev}" \ - >&2 + lib, + pkgs, + system, + ... + }: + let + checks = lib.genAttrs' [ "flake-parts" "nixpkgs" "systems" ] ( + input: + let + name = "${input}-and-dev-${input}-version-consistency"; + in + lib.nameValuePair name ( + let + dev = inputs."dev-${input}".narHash; + public = inputs.${input}.narHash; + in + pkgs.runCommand name { } '' + if [ "${public}" != "${dev}" ]; then + printf \ + 'inconsistent ${input} (%s) and dev-${input} (%s) versions\n' \ + "${public}" \ + "${dev}" \ + >&2 - exit 1 - fi + exit 1 + fi - mkdir "$out" - ''; - } - ) - [ - "flake-parts" - "nixpkgs" - "systems" - ] + mkdir "$out" + '' + ) ); + in + { + inherit checks; + + ci.buildbot = lib.mkIf (system == "x86_64-linux") { + public-and-dev-version-consistency = pkgs.linkFarm "public-and-dev-version-consistency" checks; + }; }; } diff --git a/flake/dev/treefmt.nix b/flake/dev/treefmt.nix index c899074d..47afc03c 100644 --- a/flake/dev/treefmt.nix +++ b/flake/dev/treefmt.nix @@ -28,6 +28,7 @@ nixfmt = { enable = true; width = 80; + strict = true; }; ruff-format = { enable = true; diff --git a/flake/packages.nix b/flake/packages.nix index 88648577..4e11148c 100644 --- a/flake/packages.nix +++ b/flake/packages.nix @@ -7,9 +7,7 @@ apps.doc.program = config.packages.serve-docs; packages = { - doc = pkgs.callPackage ../doc { - inherit (inputs) self; - }; + doc = pkgs.callPackage ../doc { inherit (inputs) self; }; serve-docs = pkgs.callPackage ../doc/server.nix { inherit (config.packages) doc; }; diff --git a/flake/propagated-packages.nix b/flake/propagated-packages.nix index ebc2a75b..020258e5 100644 --- a/flake/propagated-packages.nix +++ b/flake/propagated-packages.nix @@ -16,9 +16,7 @@ { pkgs, system, ... }: lib.optionalAttrs (partitionStack == [ ]) { apps = { - inherit (config.partitions.dev.module.flake.apps.${system}) - all-maintainers - ; + inherit (config.partitions.dev.module.flake.apps.${system}) all-maintainers; }; packages = lib.mkMerge [ { diff --git a/generated/all-maintainers.nix b/generated/all-maintainers.nix index eedf152d..50a83380 100644 --- a/generated/all-maintainers.nix +++ b/generated/all-maintainers.nix @@ -52,9 +52,7 @@ github = "TheColorman"; githubId = 18369995; keys = [ - { - fingerprint = "3D8C A43C FBA2 5D28 0196 19F0 AB11 0475 B417 291D"; - } + { fingerprint = "3D8C A43C FBA2 5D28 0196 19F0 AB11 0475 B417 291D"; } ]; name = "colorman"; }; @@ -81,9 +79,7 @@ github = "brckd"; githubId = 92804487; keys = [ - { - fingerprint = "58A2 81E6 2FBD 6E4E 664C B603 7B4D 2A02 BB0E C28C"; - } + { fingerprint = "58A2 81E6 2FBD 6E4E 664C B603 7B4D 2A02 BB0E C28C"; } ]; name = "bricked"; }; @@ -104,9 +100,7 @@ github = "danth"; githubId = 28959268; keys = [ - { - fingerprint = "4779 D1D5 3C97 2EAE 34A5 ED3D D8AF C4BF 0567 0F9D"; - } + { fingerprint = "4779 D1D5 3C97 2EAE 34A5 ED3D D8AF C4BF 0567 0F9D"; } ]; matrix = "@danth:danth.me"; name = "Daniel Thwaites"; @@ -146,9 +140,7 @@ github = "make-42"; githubId = 17462236; keys = [ - { - fingerprint = "36BC 916D DD4E B1EE EE82 4BBF DC95 900F 6DA7 9992"; - } + { fingerprint = "36BC 916D DD4E B1EE EE82 4BBF DC95 900F 6DA7 9992"; } ]; matrix = "@ontake:matrix.ontake.dev"; name = "Louis Dalibard"; @@ -158,9 +150,7 @@ github = "mateusauler"; githubId = 24767687; keys = [ - { - fingerprint = "A09D C093 3C37 4BFC 2B5A 269F 80A5 D62F 6EB7 D9F0"; - } + { fingerprint = "A09D C093 3C37 4BFC 2B5A 269F 80A5 D62F 6EB7 D9F0"; } ]; name = "Mateus Auler"; }; @@ -181,9 +171,7 @@ github = "nukdokplex"; githubId = 25458915; keys = [ - { - fingerprint = "7CE2 4C42 942D 58EA 99F6 F00A A47E 7374 3EF6 FCC4"; - } + { fingerprint = "7CE2 4C42 942D 58EA 99F6 F00A A47E 7374 3EF6 FCC4"; } ]; name = "Viktor Titov"; }; @@ -204,9 +192,7 @@ github = "panchoh"; githubId = 471059; keys = [ - { - fingerprint = "4430 F502 8B19 FAF4 A40E C4E8 11E0 447D 4ABB A7D0"; - } + { fingerprint = "4430 F502 8B19 FAF4 A40E C4E8 11E0 447D 4ABB A7D0"; } ]; matrix = "@panchoh:matrix.org"; name = "pancho horrillo"; @@ -217,6 +203,12 @@ githubId = 45952970; name = "repparw"; }; + rwxae = { + email = "wardxela@gmail.com"; + github = "rwxae"; + githubId = 63157919; + name = "Alexander"; + }; skiletro = { email = "git@skilet.ro"; github = "skiletro"; @@ -233,9 +225,7 @@ github = "trueNAHO"; githubId = 90870942; keys = [ - { - fingerprint = "5FC6 088A FB1A 609D 4532 F919 0C1C 177B 3B64 68E0"; - } + { fingerprint = "5FC6 088A FB1A 609D 4532 F919 0C1C 177B 3B64 68E0"; } ]; name = "Noah Pierre Biewesch"; }; diff --git a/modules/alacritty/hm.nix b/modules/alacritty/hm.nix index ed54e3bb..eb9bbfd6 100644 --- a/modules/alacritty/hm.nix +++ b/modules/alacritty/hm.nix @@ -3,9 +3,7 @@ # - `man 5 alacritty` { mkTarget, ... }: mkTarget { - name = "alacritty"; - humanName = "Alacritty"; - configElements = [ + config = [ ( { colors }: { diff --git a/modules/anki/hm.nix b/modules/anki/hm.nix index 9f3c3808..2276c4d6 100644 --- a/modules/anki/hm.nix +++ b/modules/anki/hm.nix @@ -5,10 +5,7 @@ ... }: mkTarget { - name = "anki"; - humanName = "Anki"; - - configElements = + config = { colors }: { programs.anki.addons = lib.singleton ( diff --git a/modules/anki/testbeds/anki.nix b/modules/anki/testbeds/anki.nix index 66ca7c77..ccf35b01 100644 --- a/modules/anki/testbeds/anki.nix +++ b/modules/anki/testbeds/anki.nix @@ -2,7 +2,5 @@ { stylix.testbed.ui.command.text = "anki"; - home-manager.sharedModules = lib.singleton { - programs.anki.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.anki.enable = true; }; } diff --git a/modules/ashell/hm.nix b/modules/ashell/hm.nix index 41616ac8..e369229d 100644 --- a/modules/ashell/hm.nix +++ b/modules/ashell/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "ashell"; - humanName = "Ashell"; - - configElements = [ + config = [ ( { colors }: { diff --git a/modules/ashell/testbeds/ashell.nix b/modules/ashell/testbeds/ashell.nix index 474e51ea..f0c62ed1 100644 --- a/modules/ashell/testbeds/ashell.nix +++ b/modules/ashell/testbeds/ashell.nix @@ -5,7 +5,5 @@ command.text = "ashell"; }; - home-manager.sharedModules = lib.singleton { - programs.ashell.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.ashell.enable = true; }; } diff --git a/modules/avizo/hm.nix b/modules/avizo/hm.nix index 25900638..60696649 100644 --- a/modules/avizo/hm.nix +++ b/modules/avizo/hm.nix @@ -1,10 +1,7 @@ { mkTarget, ... }: mkTarget { - name = "avizo"; - humanName = "Avizo"; - # Referenced https://github.com/stacyharper/base16-mako - configElements = + config = { colors, opacity }: { services.avizo = { diff --git a/modules/bat/hm.nix b/modules/bat/hm.nix index ff424fca..c9bf3475 100644 --- a/modules/bat/hm.nix +++ b/modules/bat/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "bat"; - humanName = "Bat"; - - configElements = + config = { colors }: { programs.bat = { diff --git a/modules/bemenu/hm.nix b/modules/bemenu/hm.nix index ca0d5a6a..ee7817b6 100644 --- a/modules/bemenu/hm.nix +++ b/modules/bemenu/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "bemenu"; - humanName = "bemenu"; - - extraOptions = + options = { fonts }: { fontSize = lib.mkOption { @@ -24,7 +21,7 @@ mkTarget { }; }; - configElements = [ + config = [ ( { cfg, fonts }: { diff --git a/modules/blender/hm.nix b/modules/blender/hm.nix index 34e5b292..4971ebd7 100644 --- a/modules/blender/hm.nix +++ b/modules/blender/hm.nix @@ -1,19 +1,12 @@ -{ - mkTarget, - lib, - ... -}: +{ mkTarget, lib, ... }: mkTarget { - name = "blender"; - humanName = "Blender"; - - extraOptions.themeBody = lib.mkOption { + options.themeBody = lib.mkOption { type = lib.types.lines; default = ""; internal = true; }; - configElements = [ + config = [ ./color-theme.nix ./font-theme.nix ( diff --git a/modules/bspwm/hm.nix b/modules/bspwm/hm.nix index fb51e970..54596468 100644 --- a/modules/bspwm/hm.nix +++ b/modules/bspwm/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "bspwm"; - humanName = "bspwm"; - - configElements = + config = { colors }: { xsession.windowManager.bspwm.settings = with colors.withHashtag; { diff --git a/modules/btop/hm.nix b/modules/btop/hm.nix index 7e804c0d..a6792c79 100644 --- a/modules/btop/hm.nix +++ b/modules/btop/hm.nix @@ -1,13 +1,6 @@ -{ - mkTarget, - lib, - ... -}: +{ mkTarget, lib, ... }: mkTarget { - name = "btop"; - humanName = "btop"; - - configElements = [ + config = [ ( { opacity }: { diff --git a/modules/btop/testbeds/btop.nix b/modules/btop/testbeds/btop.nix index 4072523f..20b180a1 100644 --- a/modules/btop/testbeds/btop.nix +++ b/modules/btop/testbeds/btop.nix @@ -5,7 +5,5 @@ useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.btop.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.btop.enable = true; }; } diff --git a/modules/cava/hm.nix b/modules/cava/hm.nix index 1ba12135..0a793165 100644 --- a/modules/cava/hm.nix +++ b/modules/cava/hm.nix @@ -1,13 +1,8 @@ { mkTarget, lib, ... }: mkTarget { - name = "cava"; - humanName = "CAVA"; + options.rainbow.enable = lib.mkEnableOption "rainbow gradient theming"; - extraOptions = { - rainbow.enable = lib.mkEnableOption "rainbow gradient theming"; - }; - - configElements = + config = { cfg, colors }: let mkGradient = diff --git a/modules/cava/testbeds/cava.nix b/modules/cava/testbeds/cava.nix index a8d5d1b8..1719ea29 100644 --- a/modules/cava/testbeds/cava.nix +++ b/modules/cava/testbeds/cava.nix @@ -8,7 +8,5 @@ useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.cava.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.cava.enable = true; }; } diff --git a/modules/cavalier/hm.nix b/modules/cavalier/hm.nix index e5979cc7..3e106048 100644 --- a/modules/cavalier/hm.nix +++ b/modules/cavalier/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "cavalier"; - humanName = "Cavalier"; - - configElements = + config = { colors }: { programs.cavalier.settings.general = { diff --git a/modules/chromium/nixos.nix b/modules/chromium/nixos.nix index d0d2201b..fa20b10a 100644 --- a/modules/chromium/nixos.nix +++ b/modules/chromium/nixos.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "chromium"; - humanName = "Chromium, Google Chrome and Brave"; - - configElements = + config = { colors }: { programs.chromium = { diff --git a/modules/console/droid.nix b/modules/console/droid.nix index caf1f42d..087426c6 100644 --- a/modules/console/droid.nix +++ b/modules/console/droid.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "console"; - humanName = "the Nix-on-Droid console"; - - configElements = + config = { colors }: { terminal.colors = with colors.withHashtag; rec { diff --git a/modules/console/nixos.nix b/modules/console/nixos.nix index e63ab5f8..9f1ddf12 100644 --- a/modules/console/nixos.nix +++ b/modules/console/nixos.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "console"; - humanName = "the Linux kernel console"; - - configElements = + config = { colors }: { console.colors = with colors; [ diff --git a/modules/discord/common/theme-elements.nix b/modules/discord/common/theme-elements.nix index 19366d29..964a72b5 100644 --- a/modules/discord/common/theme-elements.nix +++ b/modules/discord/common/theme-elements.nix @@ -1,7 +1,5 @@ name: [ - { - stylix.targets.${name}.themeBody = import ./theme-header.nix; - } + { stylix.targets.${name}.themeBody = import ./theme-header.nix; } ( { fonts }: { diff --git a/modules/discord/hm.nix b/modules/discord/hm.nix index 82ed017e..6a98ce57 100644 --- a/modules/discord/hm.nix +++ b/modules/discord/hm.nix @@ -1,8 +1,4 @@ -{ - mkTarget, - lib, - ... -}: +{ mkTarget, lib, ... }: { imports = map (module: lib.modules.importApply module mkTarget) [ ./nixcord.nix diff --git a/modules/discord/nixcord.nix b/modules/discord/nixcord.nix index 08fb1180..af86da35 100644 --- a/modules/discord/nixcord.nix +++ b/modules/discord/nixcord.nix @@ -10,7 +10,7 @@ mkTarget { name = "nixcord"; humanName = "Nixcord"; - extraOptions = { + options = { themeBody = lib.mkOption { type = lib.types.lines; default = ""; @@ -23,7 +23,7 @@ mkTarget { }; }; - configElements = (import ./common/theme-elements.nix "nixcord") ++ [ + config = (import ./common/theme-elements.nix "nixcord") ++ [ ( { cfg }: let @@ -53,9 +53,7 @@ mkTarget { writePath "Equicord" )) (lib.mkIf nixcord.equibop.enable (writePath "equibop")) - { - programs.nixcord.config.enabledThemes = [ "stylix.theme.css" ]; - } + { programs.nixcord.config.enabledThemes = [ "stylix.theme.css" ]; } ] ) ) diff --git a/modules/discord/testbeds/vencord.nix b/modules/discord/testbeds/vencord.nix index 15177749..fda8dcd7 100644 --- a/modules/discord/testbeds/vencord.nix +++ b/modules/discord/testbeds/vencord.nix @@ -1,8 +1,6 @@ { lib, pkgs, ... }: let - package = pkgs.discord.override { - withVencord = true; - }; + package = pkgs.discord.override { withVencord = true; }; in { stylix.testbed = { @@ -17,8 +15,5 @@ in environment.systemPackages = [ package ]; nixpkgs.config.allowUnfreePredicate = - pkg: - builtins.elem (lib.getName pkg) [ - "discord" - ]; + pkg: builtins.elem (lib.getName pkg) [ "discord" ]; } diff --git a/modules/discord/vencord.nix b/modules/discord/vencord.nix index 623006f0..f7647412 100644 --- a/modules/discord/vencord.nix +++ b/modules/discord/vencord.nix @@ -4,7 +4,7 @@ mkTarget { name = "vencord"; humanName = "Vencord"; - extraOptions = { + options = { themeBody = lib.mkOption { type = lib.types.lines; default = ""; @@ -17,7 +17,7 @@ mkTarget { }; }; - configElements = (import ./common/theme-elements.nix "vencord") ++ [ + config = (import ./common/theme-elements.nix "vencord") ++ [ ( { cfg }: lib.mkIf diff --git a/modules/discord/vesktop.nix b/modules/discord/vesktop.nix index afd98c8d..24103a48 100644 --- a/modules/discord/vesktop.nix +++ b/modules/discord/vesktop.nix @@ -4,13 +4,13 @@ mkTarget { name = "vesktop"; humanName = "Vesktop"; - extraOptions.themeBody = lib.mkOption { + options.themeBody = lib.mkOption { type = lib.types.lines; default = ""; internal = true; }; - configElements = (import ./common/theme-elements.nix "vesktop") ++ [ + config = (import ./common/theme-elements.nix "vesktop") ++ [ ( { cfg }: lib.mkIf (cfg.themeBody != (import ./common/theme-header.nix)) { diff --git a/modules/dunst/hm.nix b/modules/dunst/hm.nix index 9614aca2..d83b35fc 100644 --- a/modules/dunst/hm.nix +++ b/modules/dunst/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "dunst"; - humanName = "Dunst"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/dunst/testbeds/dunst.nix b/modules/dunst/testbeds/dunst.nix index 83971065..0bb36d95 100644 --- a/modules/dunst/testbeds/dunst.nix +++ b/modules/dunst/testbeds/dunst.nix @@ -5,7 +5,5 @@ sendNotifications = true; }; - home-manager.sharedModules = lib.singleton { - services.dunst.enable = true; - }; + home-manager.sharedModules = lib.singleton { services.dunst.enable = true; }; } diff --git a/modules/emacs/hm.nix b/modules/emacs/hm.nix index 70a2d776..6b7827f9 100644 --- a/modules/emacs/hm.nix +++ b/modules/emacs/hm.nix @@ -1,9 +1,6 @@ { mkTarget, pkgs, ... }: mkTarget { - name = "emacs"; - humanName = "Emacs"; - - configElements = [ + config = [ ( { opacity }: { diff --git a/modules/eog/hm.nix b/modules/eog/hm.nix index 7f1cd9f9..9e88c888 100644 --- a/modules/eog/hm.nix +++ b/modules/eog/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "eog"; - humanName = "Eye of GNOME Image Viewer"; - - configElements = + config = { colors }: { dconf.settings."org/gnome/eog/view" = { diff --git a/modules/fcitx5/highlight.svg.mustache b/modules/fcitx5/highlight.svg.mustache index d9fc2f75..7a6d23da 100644 --- a/modules/fcitx5/highlight.svg.mustache +++ b/modules/fcitx5/highlight.svg.mustache @@ -79,5 +79,5 @@ sodipodi:type="rect" d="m 25.000001,10.000001 h 10 a 15,15 45 0 1 15,15 v 10 a 15,15 135 0 1 -15,15 h -10 a 15,15 45 0 1 -15,-15 v -10 a 15,15 135 0 1 15,-15 z" inkscape:path-effect="#path-effect998" - style="fill:#{{base04-hex}};fill-opacity:1" /> + style="fill:#{{base02-hex}};fill-opacity:1" /> diff --git a/modules/fcitx5/hm.nix b/modules/fcitx5/hm.nix index a31096fd..ee31f5eb 100644 --- a/modules/fcitx5/hm.nix +++ b/modules/fcitx5/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "fcitx5"; - humanName = "fcitx5"; - - configElements = [ + config = [ ( { fonts }: { @@ -34,9 +31,7 @@ mkTarget { template = ./panel.svg.mustache; extension = ".svg"; }; - theme = import ./template.nix { - colors = colors.withHashtag; - }; + theme = import ./template.nix { colors = colors.withHashtag; }; }; }; } diff --git a/modules/fcitx5/meta.nix b/modules/fcitx5/meta.nix index c43ae716..5928c941 100644 --- a/modules/fcitx5/meta.nix +++ b/modules/fcitx5/meta.nix @@ -2,5 +2,8 @@ { name = "Fcitx 5"; homepage = "https://fcitx-im.org/wiki/Fcitx_5"; - maintainers = [ lib.maintainers.make-42 ]; + maintainers = with lib.maintainers; [ + da157 + make-42 + ]; } diff --git a/modules/fcitx5/template.nix b/modules/fcitx5/template.nix index cd9103f6..c13de7fd 100644 --- a/modules/fcitx5/template.nix +++ b/modules/fcitx5/template.nix @@ -12,7 +12,7 @@ with colors; HighlightCandidateColor = base06; EnableBlur = false; FullWidthHighlight = true; - HighlightColor = base04; + HighlightColor = base02; HighlightBackgroundColor = base0E; }; "InputPanel/BlurMargin" = { @@ -83,16 +83,14 @@ with colors; Top = 6; Bottom = 7; }; - "InputPanel/PrevPage" = { - }; + "InputPanel/PrevPage" = { }; "InputPanel/PrevPage/ClickMargin" = { Left = 5; Right = 5; Top = 4; Bottom = 4; }; - "InputPanel/NextPage" = { - }; + "InputPanel/NextPage" = { }; "InputPanel/NextPage/ClickMargin" = { Left = 5; Right = 5; diff --git a/modules/fcitx5/testbeds/fcitx5.nix b/modules/fcitx5/testbeds/fcitx5.nix new file mode 100644 index 00000000..330488ba --- /dev/null +++ b/modules/fcitx5/testbeds/fcitx5.nix @@ -0,0 +1,14 @@ +{ pkgs, lib, ... }: +{ + stylix.testbed.ui.command.text = "fcitx5-config-qt"; + home-manager.sharedModules = lib.singleton { + i18n.inputMethod = { + enable = true; + type = "fcitx5"; + fcitx5.addons = with pkgs; [ + fcitx5-mozc + fcitx5-gtk + ]; + }; + }; +} diff --git a/modules/feh/hm.nix b/modules/feh/hm.nix index d0187ebf..0b1fa739 100644 --- a/modules/feh/hm.nix +++ b/modules/feh/hm.nix @@ -6,8 +6,6 @@ ... }: mkTarget { - name = "feh"; - humanName = "the desktop background using Feh"; autoEnable = with config.xsession.windowManager; bspwm.enable @@ -24,7 +22,7 @@ mkTarget { || xmonad.enable ''; - configElements = + config = { imageScalingMode, image }: { xsession.initExtra = diff --git a/modules/feh/nixos.nix b/modules/feh/nixos.nix index cc0ee85e..3debf1a9 100644 --- a/modules/feh/nixos.nix +++ b/modules/feh/nixos.nix @@ -6,8 +6,6 @@ ... }: mkTarget { - name = "feh"; - humanName = "the desktop background using Feh"; autoEnable = with config.services.xserver.windowManager; xmonad.enable || i3.enable; @@ -16,7 +14,7 @@ mkTarget { xmonad.enable || i3.enable ''; - configElements = + config = { image, imageScalingMode }: { services.xserver.displayManager.sessionCommands = diff --git a/modules/firefox/each-config.nix b/modules/firefox/each-config.nix index 79c1e0ef..82b730d0 100644 --- a/modules/firefox/each-config.nix +++ b/modules/firefox/each-config.nix @@ -12,9 +12,9 @@ ... }: mkTarget { - inherit name humanName; + inherit humanName name; - extraOptions = { + options = { profileNames = lib.mkOption { description = "The ${humanName} profile names to apply styling on."; type = lib.types.listOf lib.types.str; @@ -26,7 +26,7 @@ mkTarget { firefoxGnomeTheme.enable = lib.mkEnableOption "[Firefox GNOME theme](https://github.com/rafaelmardojai/firefox-gnome-theme) on ${humanName}"; }; - configElements = [ + config = [ ( { cfg }: { @@ -102,9 +102,7 @@ mkTarget { b = colors."${color}-rgb-b"; }; inherit (pkgs.stdenv.hostPlatform) system; - inherit (inputs.nur.legacyPackages.${system}.repos.rycee) - firefox-addons - ; + inherit (inputs.nur.legacyPackages.${system}.repos.rycee) firefox-addons; in { programs.${name}.profiles = lib.mkIf cfg.colorTheme.enable ( diff --git a/modules/firefox/hm.nix b/modules/firefox/hm.nix index 74faf8ec..8e8e12d4 100644 --- a/modules/firefox/hm.nix +++ b/modules/firefox/hm.nix @@ -1,16 +1,10 @@ -{ - lib, - mkTarget, - ... -}: +{ lib, mkTarget, ... }: { imports = lib.mapAttrsToList ( name: humanName: - lib.modules.importApply ./each-config.nix { - inherit mkTarget name humanName; - } + lib.modules.importApply ./each-config.nix { inherit mkTarget name humanName; } ) { "firefox" = "Firefox"; diff --git a/modules/fish/hm.nix b/modules/fish/hm.nix index 9763c50b..6acc5e13 100644 --- a/modules/fish/hm.nix +++ b/modules/fish/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "fish"; - humanName = "Fish"; - - configElements = + config = { colors, inputs }: { programs.fish.interactiveShellInit = import ./prompt.nix { diff --git a/modules/fish/nixos.nix b/modules/fish/nixos.nix index 02affea0..8487e280 100644 --- a/modules/fish/nixos.nix +++ b/modules/fish/nixos.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "fish"; - humanName = "Fish"; - - configElements = + config = { colors, inputs }: { programs.fish.promptInit = import ./prompt.nix { inherit colors inputs; }; diff --git a/modules/fish/testbeds/fish-hm.nix b/modules/fish/testbeds/fish-hm.nix index 692a0bd9..b6bd4e50 100644 --- a/modules/fish/testbeds/fish-hm.nix +++ b/modules/fish/testbeds/fish-hm.nix @@ -5,7 +5,5 @@ useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.fish.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.fish.enable = true; }; } diff --git a/modules/fnott/hm.nix b/modules/fnott/hm.nix index 984459b4..473b9398 100644 --- a/modules/fnott/hm.nix +++ b/modules/fnott/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "fnott"; - humanName = "Fnott"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/fnott/testbeds/fnott.nix b/modules/fnott/testbeds/fnott.nix index 668b6ce7..de39d2eb 100644 --- a/modules/fnott/testbeds/fnott.nix +++ b/modules/fnott/testbeds/fnott.nix @@ -5,7 +5,5 @@ sendNotifications = true; }; - home-manager.sharedModules = lib.singleton { - services.fnott.enable = true; - }; + home-manager.sharedModules = lib.singleton { services.fnott.enable = true; }; } diff --git a/modules/foliate/hm.nix b/modules/foliate/hm.nix index 43ce4f3d..01a29b9a 100644 --- a/modules/foliate/hm.nix +++ b/modules/foliate/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "foliate"; - humanName = "Foliate"; - - configElements = + config = { colors }: { programs.foliate = { diff --git a/modules/font-packages/darwin.nix b/modules/font-packages/darwin.nix index 0a73d502..359d862d 100644 --- a/modules/font-packages/darwin.nix +++ b/modules/font-packages/darwin.nix @@ -1,13 +1,8 @@ { mkTarget, ... }: mkTarget { - name = "font-packages"; - humanName = "Font packages"; - - configElements = + config = { fonts }: { - fonts = { - inherit (fonts) packages; - }; + fonts = { inherit (fonts) packages; }; }; } diff --git a/modules/font-packages/hm.nix b/modules/font-packages/hm.nix index 81a37dff..c2097750 100644 --- a/modules/font-packages/hm.nix +++ b/modules/font-packages/hm.nix @@ -1,13 +1,8 @@ { mkTarget, ... }: mkTarget { - name = "font-packages"; - humanName = "Font packages"; - - configElements = + config = { fonts }: { - home = { - inherit (fonts) packages; - }; + home = { inherit (fonts) packages; }; }; } diff --git a/modules/font-packages/nixos.nix b/modules/font-packages/nixos.nix index 0a73d502..359d862d 100644 --- a/modules/font-packages/nixos.nix +++ b/modules/font-packages/nixos.nix @@ -1,13 +1,8 @@ { mkTarget, ... }: mkTarget { - name = "font-packages"; - humanName = "Font packages"; - - configElements = + config = { fonts }: { - fonts = { - inherit (fonts) packages; - }; + fonts = { inherit (fonts) packages; }; }; } diff --git a/modules/fontconfig/fontconfig.nix b/modules/fontconfig/fontconfig.nix index b2fadd2c..77eadf1a 100644 --- a/modules/fontconfig/fontconfig.nix +++ b/modules/fontconfig/fontconfig.nix @@ -1,10 +1,7 @@ { mkTarget }: { lib, ... }: mkTarget { - name = "fontconfig"; - humanName = "Fontconfig"; - - configElements = + config = { listTargetIndex, fonts }: { fonts.fontconfig.defaultFonts = lib.genAttrs [ diff --git a/modules/fontconfig/hm.nix b/modules/fontconfig/hm.nix index 9e14cdbc..0fd01d7a 100644 --- a/modules/fontconfig/hm.nix +++ b/modules/fontconfig/hm.nix @@ -1,6 +1,4 @@ { lib, mkTarget, ... }: { - imports = [ - (lib.modules.importApply ./fontconfig.nix { inherit mkTarget; }) - ]; + imports = [ (lib.modules.importApply ./fontconfig.nix { inherit mkTarget; }) ]; } diff --git a/modules/fontconfig/nixos.nix b/modules/fontconfig/nixos.nix index 9e14cdbc..0fd01d7a 100644 --- a/modules/fontconfig/nixos.nix +++ b/modules/fontconfig/nixos.nix @@ -1,6 +1,4 @@ { lib, mkTarget, ... }: { - imports = [ - (lib.modules.importApply ./fontconfig.nix { inherit mkTarget; }) - ]; + imports = [ (lib.modules.importApply ./fontconfig.nix { inherit mkTarget; }) ]; } diff --git a/modules/foot/hm.nix b/modules/foot/hm.nix index b1afc764..08ed47d1 100644 --- a/modules/foot/hm.nix +++ b/modules/foot/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "foot"; - humanName = "Foot"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/forge/hm.nix b/modules/forge/hm.nix index 04000a72..330d2ae1 100644 --- a/modules/forge/hm.nix +++ b/modules/forge/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "forge"; - humanName = "Forge"; - - configElements = + config = { colors }: { xdg.configFile."forge/stylesheet/forge/stylesheet.css".source = colors { diff --git a/modules/fuzzel/hm.nix b/modules/fuzzel/hm.nix index 29b4836f..7d7a1db2 100644 --- a/modules/fuzzel/hm.nix +++ b/modules/fuzzel/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "fuzzel"; - humanName = "Fuzzel"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/fuzzel/testbeds/fuzzel.nix b/modules/fuzzel/testbeds/fuzzel.nix index c371e791..9e9f73b7 100644 --- a/modules/fuzzel/testbeds/fuzzel.nix +++ b/modules/fuzzel/testbeds/fuzzel.nix @@ -5,7 +5,5 @@ command.text = "fuzzel"; }; - home-manager.sharedModules = lib.singleton { - programs.fuzzel.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.fuzzel.enable = true; }; } diff --git a/modules/fzf/hm.nix b/modules/fzf/hm.nix index 08df42e2..dda229b2 100644 --- a/modules/fzf/hm.nix +++ b/modules/fzf/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "fzf"; - humanName = "Fzf"; - - configElements = + config = { colors }: { programs.fzf.colors = with colors.withHashtag; { diff --git a/modules/fzf/testbeds/fzf.nix b/modules/fzf/testbeds/fzf.nix index d17f32b2..b79f742f 100644 --- a/modules/fzf/testbeds/fzf.nix +++ b/modules/fzf/testbeds/fzf.nix @@ -5,7 +5,5 @@ useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.fzf.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.fzf.enable = true; }; } diff --git a/modules/gdu/hm.nix b/modules/gdu/hm.nix index 48910178..c1f2e4b4 100644 --- a/modules/gdu/hm.nix +++ b/modules/gdu/hm.nix @@ -1,12 +1,6 @@ -{ - mkTarget, - ... -}: +{ mkTarget, ... }: mkTarget { - name = "go DiskUsage()"; - humanName = "go DiskUsage()"; - - configElements = + config = { colors }: { xdg.configFile."gdu/gdu.yaml" = { diff --git a/modules/gdu/meta.nix b/modules/gdu/meta.nix index 0b9140b7..071250e8 100644 --- a/modules/gdu/meta.nix +++ b/modules/gdu/meta.nix @@ -1,6 +1,6 @@ { lib, ... }: { - name = "gdu"; + name = "go DiskUsage()"; homepage = "https://github.com/dundee/gdu"; maintainers = [ lib.maintainers.omega-800 ]; } diff --git a/modules/gdu/testbeds/gdu.nix b/modules/gdu/testbeds/gdu.nix index e1db9e66..15ce7a22 100644 --- a/modules/gdu/testbeds/gdu.nix +++ b/modules/gdu/testbeds/gdu.nix @@ -5,7 +5,5 @@ useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - home.packages = [ pkgs.gdu ]; - }; + home-manager.sharedModules = lib.singleton { home.packages = [ pkgs.gdu ]; }; } diff --git a/modules/gedit/hm.nix b/modules/gedit/hm.nix index b31c47ec..82959a30 100644 --- a/modules/gedit/hm.nix +++ b/modules/gedit/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "gedit"; - humanName = "GEdit"; - - configElements = + config = { colors }: { xdg.dataFile = { diff --git a/modules/ghostty/hm.nix b/modules/ghostty/hm.nix index 5ebb8ef6..a3ffec41 100644 --- a/modules/ghostty/hm.nix +++ b/modules/ghostty/hm.nix @@ -3,10 +3,7 @@ # - `man 5 ghostty` { mkTarget, pkgs, ... }: mkTarget { - name = "ghostty"; - humanName = "Ghostty"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/gitui/hm.nix b/modules/gitui/hm.nix index 7246cd04..aba87841 100644 --- a/modules/gitui/hm.nix +++ b/modules/gitui/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "gitui"; - humanName = "GitUI"; - - configElements = + config = { colors }: { programs.gitui.theme = with colors.withHashtag; '' diff --git a/modules/glance/hm.nix b/modules/glance/hm.nix index 6448d12b..da68e487 100644 --- a/modules/glance/hm.nix +++ b/modules/glance/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "glance"; - humanName = "Glance"; - - configElements = [ + config = [ ( { polarity }: { diff --git a/modules/glance/nixos.nix b/modules/glance/nixos.nix index 6448d12b..da68e487 100644 --- a/modules/glance/nixos.nix +++ b/modules/glance/nixos.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "glance"; - humanName = "Glance"; - - configElements = [ + config = [ ( { polarity }: { diff --git a/modules/gnome-text-editor/hm.nix b/modules/gnome-text-editor/hm.nix index 8caea6ba..32a007ec 100644 --- a/modules/gnome-text-editor/hm.nix +++ b/modules/gnome-text-editor/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "gnome-text-editor"; - humanName = "GNOME Text Editor"; - - configElements = { + config = { dconf.settings."org/gnome/TextEditor".style-scheme = "stylix"; }; } diff --git a/modules/gnome-text-editor/nixos.nix b/modules/gnome-text-editor/nixos.nix index 148b3cbd..22a0afa6 100644 --- a/modules/gnome-text-editor/nixos.nix +++ b/modules/gnome-text-editor/nixos.nix @@ -1,5 +1 @@ -{ mkTarget, ... }: -mkTarget { - name = "gnome-text-editor"; - humanName = "GNOME Text Editor"; -} +{ mkTarget, ... }: mkTarget { } diff --git a/modules/gnome/hm.nix b/modules/gnome/hm.nix index 4807fe3a..0e43b209 100644 --- a/modules/gnome/hm.nix +++ b/modules/gnome/hm.nix @@ -6,15 +6,12 @@ ... }: mkTarget { - name = "gnome"; - humanName = "GNOME"; - autoEnable = pkgs.stdenv.hostPlatform.isLinux; autoEnableExpr = "pkgs.stdenv.hostPlatform.isLinux"; - extraOptions.useWallpaper = config.lib.stylix.mkEnableWallpaper "GNOME" true; + options.useWallpaper = config.lib.stylix.mkEnableWallpaper "GNOME" true; - configElements = [ + config = [ ( { cfg, image }: { @@ -114,9 +111,7 @@ mkTarget { dataFile."themes/Stylix/gnome-shell/gnome-shell.css" = { source = let - theme = pkgs.callPackage ./theme.nix { - inherit inputs colors; - }; + theme = pkgs.callPackage ./theme.nix { inherit inputs colors; }; in "${theme}/share/gnome-shell/gnome-shell.css"; diff --git a/modules/gnome/nixos.nix b/modules/gnome/nixos.nix index e2d15e02..5d80941e 100644 --- a/modules/gnome/nixos.nix +++ b/modules/gnome/nixos.nix @@ -29,12 +29,14 @@ in ) ) { - # As Stylix is controlling the wallpaper, there is no need for this + # If Stylix is controlling the wallpaper, there is no need for this # pack of default wallpapers to be installed. # If you want to use one, you can set stylix.image to something like # "${pkgs.gnome-backgrounds}/path/to/your/preferred/background" # which will then download the pack regardless of its exclusion below. - environment.gnome.excludePackages = [ pkgs.gnome-backgrounds ]; + environment.gnome.excludePackages = lib.mkIf (config.stylix.image != null) [ + pkgs.gnome-backgrounds + ]; nixpkgs.overlays = [ (_: super: { @@ -46,9 +48,7 @@ in cp ${theme}/share/gnome-shell/gnome-shell-theme.gresource \ $out/share/gnome-shell/gnome-shell-theme.gresource ''; - patches = (oldAttrs.patches or [ ]) ++ [ - ./shell_remove_dark_mode.patch - ]; + patches = (oldAttrs.patches or [ ]) ++ [ ./shell_remove_dark_mode.patch ]; }); }) ]; @@ -56,14 +56,9 @@ in # Cursor and icon settings are usually applied via Home Manager, # but the login screen uses a separate database. services.displayManager.environment.XDG_DATA_DIRS = lib.mkIf (iconCfg != null) ( - (lib.makeSearchPath "share" [ - iconCfg.package - ]) - + ":" + (lib.makeSearchPath "share" [ iconCfg.package ]) + ":" ); - environment.systemPackages = lib.mkIf (cursorCfg != null) [ - cursorCfg.package - ]; + environment.systemPackages = lib.mkIf (cursorCfg != null) [ cursorCfg.package ]; programs.dconf.profiles.gdm.databases = lib.mkMerge [ (lib.mkIf (cursorCfg != null) [ { @@ -80,12 +75,7 @@ in settings."org/gnome/desktop/interface" = { icon-theme = builtins.head ( lib.filter (x: null != x) [ - ( - { - inherit (iconCfg) dark light; - } - ."${polarity}" or null - ) + ({ inherit (iconCfg) dark light; }."${polarity}" or null) iconCfg.dark iconCfg.light ] diff --git a/modules/gnome/testbeds/gnome.nix b/modules/gnome/testbeds/gnome.nix index ba4edd89..b25848ab 100644 --- a/modules/gnome/testbeds/gnome.nix +++ b/modules/gnome/testbeds/gnome.nix @@ -1,3 +1 @@ -{ - stylix.testbed.ui.graphicalEnvironment = "gnome"; -} +{ stylix.testbed.ui.graphicalEnvironment = "gnome"; } diff --git a/modules/gtk/hm.nix b/modules/gtk/hm.nix index 1a1d8aec..e3eb283d 100644 --- a/modules/gtk/hm.nix +++ b/modules/gtk/hm.nix @@ -7,10 +7,7 @@ ... }: mkTarget { - name = "gtk"; - humanName = "all GTK3, GTK4 and Libadwaita apps"; - - extraOptions = { + options = { extraCss = lib.mkOption { description = '' Extra code added to `gtk-3.0/gtk.css` and `gtk-4.0/gtk.css`. @@ -26,7 +23,7 @@ mkTarget { flatpakSupport.enable = config.lib.stylix.mkEnableTarget "support for theming Flatpak apps" true; }; - configElements = [ + config = [ { warnings = lib.optional (config.gtk.gtk3.extraCss != "" || config.gtk.gtk4.extraCss != "") diff --git a/modules/gtk/nixos.nix b/modules/gtk/nixos.nix index 90ff4712..cb208716 100644 --- a/modules/gtk/nixos.nix +++ b/modules/gtk/nixos.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "gtk"; - humanName = "all GTK3, GTK4 and Libadwaita apps"; - - configElements = { + config = { # Required for Home Manager's GTK settings to work programs.dconf.enable = true; }; diff --git a/modules/gtksourceview/hm.nix b/modules/gtksourceview/hm.nix index 5aa58b62..02bf853b 100644 --- a/modules/gtksourceview/hm.nix +++ b/modules/gtksourceview/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "gtksourceview"; - humanName = "GTKSourceView"; - - configElements = + config = { colors, ... }: { xdg.dataFile = builtins.listToAttrs ( diff --git a/modules/gtksourceview/nixos.nix b/modules/gtksourceview/nixos.nix index e42e2d1c..40f8bd18 100644 --- a/modules/gtksourceview/nixos.nix +++ b/modules/gtksourceview/nixos.nix @@ -1,7 +1,3 @@ { mkTarget, ... }: -mkTarget { - name = "gtksourceview"; - humanName = "GTKSourceView"; - - # Used to enable overlay. -} +# Used to enable overlay. +mkTarget { } diff --git a/modules/halloy/hm.nix b/modules/halloy/hm.nix index b91f02c5..fae67f7c 100644 --- a/modules/halloy/hm.nix +++ b/modules/halloy/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "halloy"; - humanName = "Halloy"; - - configElements = + config = { colors }: { programs.halloy = { diff --git a/modules/helix/hm.nix b/modules/helix/hm.nix index 7d583b6d..d7e37529 100644 --- a/modules/helix/hm.nix +++ b/modules/helix/hm.nix @@ -5,15 +5,12 @@ ... }: mkTarget { - name = "helix"; - humanName = "Helix"; - - extraOptions.transparent = lib.mkEnableOption "transparent theming" // { + options.transparent = lib.mkEnableOption "transparent theming" // { internal = true; default = false; }; - configElements = [ + config = [ ( { opacity }: { @@ -32,9 +29,7 @@ mkTarget { themes.stylix = let - theme = colors { - templateRepo = inputs.base16-helix; - }; + theme = colors { templateRepo = inputs.base16-helix; }; # Removing the background exposes transparency from the terminal. The # background might be helpful if the terminal isn't themed, so we only diff --git a/modules/helix/testbeds/helix.nix b/modules/helix/testbeds/helix.nix index ddbe26f0..a61563f4 100644 --- a/modules/helix/testbeds/helix.nix +++ b/modules/helix/testbeds/helix.nix @@ -5,7 +5,5 @@ useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.helix.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.helix.enable = true; }; } diff --git a/modules/hyprland/hm.nix b/modules/hyprland/hm.nix index 119ba797..1a7e1e00 100644 --- a/modules/hyprland/hm.nix +++ b/modules/hyprland/hm.nix @@ -5,9 +5,7 @@ ... }: mkTarget { - name = "hyprland"; - humanName = "Hyprland"; - extraOptions = + options = { image }: { hyprpaper.enable = config.lib.stylix.mkEnableTargetWith { @@ -17,7 +15,7 @@ mkTarget { }; }; - configElements = [ + config = [ ( { colors }: { diff --git a/modules/hyprlock/hm.nix b/modules/hyprlock/hm.nix index bf2d8ee2..74c54a9c 100644 --- a/modules/hyprlock/hm.nix +++ b/modules/hyprlock/hm.nix @@ -5,14 +5,9 @@ ... }: mkTarget { - name = "hyprlock"; - humanName = "Hyprlock"; + options.useWallpaper = config.lib.stylix.mkEnableWallpaper "Hyprlock" true; - extraOptions = { - useWallpaper = config.lib.stylix.mkEnableWallpaper "Hyprlock" true; - }; - - configElements = [ + config = [ ( { cfg, image }: { diff --git a/modules/hyprpanel/hm.nix b/modules/hyprpanel/hm.nix index 32e38df8..8b3af480 100644 --- a/modules/hyprpanel/hm.nix +++ b/modules/hyprpanel/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "hyprpanel"; - humanName = "HyprPanel"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/hyprpanel/testbeds/hyprpanel.nix b/modules/hyprpanel/testbeds/hyprpanel.nix index 5d01739e..a92958a6 100644 --- a/modules/hyprpanel/testbeds/hyprpanel.nix +++ b/modules/hyprpanel/testbeds/hyprpanel.nix @@ -1,8 +1,4 @@ -{ - lib, - pkgs, - ... -}: +{ lib, pkgs, ... }: { stylix.testbed.ui.graphicalEnvironment = "hyprland"; diff --git a/modules/hyprpaper/hm.nix b/modules/hyprpaper/hm.nix index f088a3ed..6018b217 100644 --- a/modules/hyprpaper/hm.nix +++ b/modules/hyprpaper/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "hyprpaper"; - humanName = "Hyprpaper"; - - configElements = + config = { image }: { services.hyprpaper.settings = { diff --git a/modules/i3/hm.nix b/modules/i3/hm.nix index 1bf4298d..192ecf96 100644 --- a/modules/i3/hm.nix +++ b/modules/i3/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "i3"; - humanName = "i3"; - - extraOptions.exportedBarConfig = lib.mkOption { + options.exportedBarConfig = lib.mkOption { type = lib.types.attrs; default = { }; description = '' @@ -29,7 +26,7 @@ mkTarget { } ); - configElements = [ + config = [ ( { fonts }: let @@ -104,9 +101,7 @@ mkTarget { inherit border background; text = focused; }; - inactiveWorkspace = { - inherit text border background; - }; + inactiveWorkspace = { inherit text border background; }; urgentWorkspace = { inherit text background; border = urgent; diff --git a/modules/i3bar-river/hm.nix b/modules/i3bar-river/hm.nix index 2b194987..d72d3f1c 100644 --- a/modules/i3bar-river/hm.nix +++ b/modules/i3bar-river/hm.nix @@ -1,13 +1,6 @@ -{ - mkTarget, - lib, - ... -}: +{ mkTarget, lib, ... }: mkTarget { - name = "i3bar-river"; - humanName = "i3bar-river"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/jankyborders/darwin.nix b/modules/jankyborders/darwin.nix index 21a08fcc..10cd9402 100644 --- a/modules/jankyborders/darwin.nix +++ b/modules/jankyborders/darwin.nix @@ -5,10 +5,7 @@ ... }: mkTarget { - name = "jankyborders"; - humanName = "JankyBorders"; - - configElements = + config = { colors, opacity }: { services.jankyborders = diff --git a/modules/k9s/hm.nix b/modules/k9s/hm.nix index e172b99b..5f31999a 100644 --- a/modules/k9s/hm.nix +++ b/modules/k9s/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "k9s"; - humanName = "k9s"; - - configElements = + config = { colors }: { programs.k9s = { diff --git a/modules/kde/hm.nix b/modules/kde/hm.nix index 98e70a8e..7bf93fee 100644 --- a/modules/kde/hm.nix +++ b/modules/kde/hm.nix @@ -7,14 +7,8 @@ let cfg = config.stylix.targets.kde; - inherit (config.lib.stylix) - colors - mkEnableTarget - mkEnableWallpaper - ; - inherit (config.stylix) - image - ; + inherit (config.lib.stylix) colors mkEnableTarget mkEnableWallpaper; + inherit (config.stylix) image; mergeWithImage = default: withImage: @@ -165,9 +159,7 @@ let Name = "Stylix"; wallpaperMetadata = { - KPlugin = { - inherit Id Name; - }; + KPlugin = { inherit Id Name; }; }; lookAndFeelMetadata = { @@ -257,9 +249,7 @@ let # The gtkconfig module copies settings from KDE to the GTK configuration. # This blocks Home Manager activation because the same files are already # managed by Stylix. - Module-gtkconfig = makeImmutable { - autoload = false; - }; + Module-gtkconfig = makeImmutable { autoload = false; }; }; kdeglobals = rec { diff --git a/modules/kde/testbeds/kde.nix b/modules/kde/testbeds/kde.nix index c9b8493b..e367b71a 100644 --- a/modules/kde/testbeds/kde.nix +++ b/modules/kde/testbeds/kde.nix @@ -1,7 +1,4 @@ -{ - lib, - ... -}: +{ lib, ... }: { config = { stylix.testbed.ui.graphicalEnvironment = "kde"; diff --git a/modules/kitty/hm.nix b/modules/kitty/hm.nix index 573d1985..e7349475 100644 --- a/modules/kitty/hm.nix +++ b/modules/kitty/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "kitty"; - humanName = "Kitty"; - - extraOptions = { + options = { variant256Colors = lib.mkOption { description = '' Whether to use the [256-color variant](https://github.com/kdrag0n/base16-kitty#256-color-variants) @@ -14,7 +11,7 @@ mkTarget { }; }; - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/kmscon/nixos.nix b/modules/kmscon/nixos.nix index 83c6f6b2..03b52795 100644 --- a/modules/kmscon/nixos.nix +++ b/modules/kmscon/nixos.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "kmscon"; - humanName = "the kmscon virtual console"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/kubecolor/hm.nix b/modules/kubecolor/hm.nix index 0670526c..f0fe9bc8 100644 --- a/modules/kubecolor/hm.nix +++ b/modules/kubecolor/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "kubecolor"; - humanName = "kubecolor"; - - configElements = [ + config = [ ( { polarity }: { diff --git a/modules/lazygit/hm.nix b/modules/lazygit/hm.nix index d13c4601..570178f3 100644 --- a/modules/lazygit/hm.nix +++ b/modules/lazygit/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "lazygit"; - humanName = "lazygit"; - - configElements = + config = { colors }: { programs.lazygit.settings.gui.theme = with colors.withHashtag; { diff --git a/modules/lightdm/nixos.nix b/modules/lightdm/nixos.nix index 405cfbac..fe512f0f 100644 --- a/modules/lightdm/nixos.nix +++ b/modules/lightdm/nixos.nix @@ -5,14 +5,9 @@ ... }: mkTarget { - name = "lightdm"; - humanName = "LightDM"; + options.useWallpaper = config.lib.stylix.mkEnableWallpaper "LightDM" true; - extraOptions = { - useWallpaper = config.lib.stylix.mkEnableWallpaper "LightDM" true; - }; - - configElements = + config = { cfg, image }: { services.xserver.displayManager.lightdm.background = diff --git a/modules/limine/nixos.nix b/modules/limine/nixos.nix index d352fd85..0283c07a 100644 --- a/modules/limine/nixos.nix +++ b/modules/limine/nixos.nix @@ -5,12 +5,9 @@ ... }: mkTarget { - name = "limine"; - humanName = "Limine"; + options.useWallpaper = config.lib.stylix.mkEnableWallpaper "Limine" true; - extraOptions.useWallpaper = config.lib.stylix.mkEnableWallpaper "Limine" true; - - configElements = [ + config = [ ( { colors }: { @@ -30,9 +27,7 @@ mkTarget { ( { cfg, image }: { - boot.loader.limine.style.wallpapers = lib.mkIf cfg.useWallpaper [ - image - ]; + boot.loader.limine.style.wallpapers = lib.mkIf cfg.useWallpaper [ image ]; } ) ( diff --git a/modules/mako/hm.nix b/modules/mako/hm.nix index 3314f0e5..e93621f1 100644 --- a/modules/mako/hm.nix +++ b/modules/mako/hm.nix @@ -1,10 +1,7 @@ { mkTarget, lib, ... }: mkTarget { - name = "mako"; - humanName = "Mako"; - # Referenced https://github.com/stacyharper/base16-mako - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/mako/testbeds/mako.nix b/modules/mako/testbeds/mako.nix index b020b1b0..af2e0930 100644 --- a/modules/mako/testbeds/mako.nix +++ b/modules/mako/testbeds/mako.nix @@ -5,7 +5,5 @@ sendNotifications = true; }; - home-manager.sharedModules = lib.singleton { - services.mako.enable = true; - }; + home-manager.sharedModules = lib.singleton { services.mako.enable = true; }; } diff --git a/modules/mangohud/hm.nix b/modules/mangohud/hm.nix index cad9acc3..fdb6ba45 100644 --- a/modules/mangohud/hm.nix +++ b/modules/mangohud/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "mangohud"; - humanName = "mangohud"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/micro/hm.nix b/modules/micro/hm.nix index 36f26d11..a234583c 100644 --- a/modules/micro/hm.nix +++ b/modules/micro/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "micro"; - humanName = "micro"; - - configElements = { + config = { # TODO: Provide a real colorscheme once [1] is resolved. # # [1]: https://github.com/nix-community/stylix/issues/249 diff --git a/modules/micro/testbeds/micro.nix b/modules/micro/testbeds/micro.nix index 5a722290..29fbd88d 100644 --- a/modules/micro/testbeds/micro.nix +++ b/modules/micro/testbeds/micro.nix @@ -5,7 +5,5 @@ useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.micro.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.micro.enable = true; }; } diff --git a/modules/mpv/hm.nix b/modules/mpv/hm.nix index 7cc67582..9c66f375 100644 --- a/modules/mpv/hm.nix +++ b/modules/mpv/hm.nix @@ -1,8 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "mpv"; - humanName = "mpv"; - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/ncspot/hm.nix b/modules/ncspot/hm.nix index e5192474..41e8d1eb 100644 --- a/modules/ncspot/hm.nix +++ b/modules/ncspot/hm.nix @@ -1,16 +1,13 @@ { mkTarget, lib, ... }: mkTarget { - name = "ncspot"; - humanName = "Ncspot"; - - extraOptions.background = lib.mkOption { + options.background = lib.mkOption { type = lib.types.nullOr lib.types.str; description = "Used to set bg even if `opacity` or `colors` is null."; internal = true; default = null; }; - configElements = [ + config = [ ( { cfg }: lib.mkIf (cfg.background != null) { diff --git a/modules/ncspot/testbeds/ncspot.nix b/modules/ncspot/testbeds/ncspot.nix index 157abb61..133cc362 100644 --- a/modules/ncspot/testbeds/ncspot.nix +++ b/modules/ncspot/testbeds/ncspot.nix @@ -4,7 +4,5 @@ text = lib.getExe pkgs.ncspot; useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.ncspot.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.ncspot.enable = true; }; } diff --git a/modules/neovim/neovide.nix b/modules/neovim/neovide.nix index 519949b7..5dc67924 100644 --- a/modules/neovim/neovide.nix +++ b/modules/neovim/neovide.nix @@ -3,7 +3,7 @@ mkTarget: mkTarget { name = "neovide"; humanName = "Neovide"; - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/neovim/neovim.nix b/modules/neovim/neovim.nix index e1b7d39c..fef4c98e 100644 --- a/modules/neovim/neovim.nix +++ b/modules/neovim/neovim.nix @@ -1,13 +1,9 @@ mkTarget: -{ - lib, - pkgs, - ... -}: +{ lib, pkgs, ... }: mkTarget { name = "neovim"; humanName = "Neovim"; - extraOptions = { + options = { plugin = lib.mkOption { type = lib.types.enum [ "base16-nvim" @@ -29,7 +25,7 @@ mkTarget { }; }; - configElements = [ + config = [ ( { colors, cfg }: { diff --git a/modules/neovim/nixvim.nix b/modules/neovim/nixvim.nix index 6f53d471..b9a7e49b 100644 --- a/modules/neovim/nixvim.nix +++ b/modules/neovim/nixvim.nix @@ -1,13 +1,9 @@ mkTarget: -{ - lib, - options, - ... -}: +{ lib, options, ... }: mkTarget { name = "nixvim"; humanName = "NixVim"; - extraOptions = { + options = { plugin = lib.mkOption { type = lib.types.enum [ "base16-nvim" @@ -41,7 +37,7 @@ mkTarget { }; }; - configElements = [ + config = [ ( { colors }: { diff --git a/modules/neovim/nvf.nix b/modules/neovim/nvf.nix index b3e74c71..4f5bc749 100644 --- a/modules/neovim/nvf.nix +++ b/modules/neovim/nvf.nix @@ -1,13 +1,10 @@ mkTarget: -{ - lib, - options, - ... -}: +{ lib, options, ... }: mkTarget { name = "nvf"; humanName = "nvf"; - extraOptions = { + + options = { plugin = lib.mkOption { type = lib.types.enum [ "base16" @@ -19,7 +16,7 @@ mkTarget { transparentBackground = lib.mkEnableOption "background transparency for the main Neovim window"; }; - configElements = lib.optionals (options.programs ? nvf) [ + config = lib.optionals (options.programs ? nvf) [ ( { colors, cfg }: { @@ -48,9 +45,7 @@ mkTarget { ; }; }; - statusline = lib.mkIf (cfg.plugin == "base16") { - lualine.theme = "base16"; - }; + statusline = lib.mkIf (cfg.plugin == "base16") { lualine.theme = "base16"; }; }; } ) diff --git a/modules/neovim/testbeds/neovim.nix b/modules/neovim/testbeds/neovim.nix index 823f1db7..6e7540cc 100644 --- a/modules/neovim/testbeds/neovim.nix +++ b/modules/neovim/testbeds/neovim.nix @@ -5,7 +5,5 @@ useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.neovim.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.neovim.enable = true; }; } diff --git a/modules/neovim/testbeds/vim.nix b/modules/neovim/testbeds/vim.nix index 3bc44930..424cd082 100644 --- a/modules/neovim/testbeds/vim.nix +++ b/modules/neovim/testbeds/vim.nix @@ -5,7 +5,5 @@ useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.vim.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.vim.enable = true; }; } diff --git a/modules/neovim/vim.nix b/modules/neovim/vim.nix index 11b3bac5..84effd99 100644 --- a/modules/neovim/vim.nix +++ b/modules/neovim/vim.nix @@ -1,14 +1,10 @@ mkTarget: -{ - lib, - pkgs, - ... -}: +{ lib, pkgs, ... }: mkTarget { name = "vim"; humanName = "Vim"; - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/noctalia-shell/hm.nix b/modules/noctalia-shell/hm.nix new file mode 100644 index 00000000..006cfe6c --- /dev/null +++ b/modules/noctalia-shell/hm.nix @@ -0,0 +1,69 @@ +{ + mkTarget, + lib, + options, + ... +}: +mkTarget { + config = lib.optionals (options.programs ? noctalia-shell) [ + ( + { colors }: + { + programs.noctalia-shell = { + colors = with colors.withHashtag; { + mPrimary = base05; + mOnPrimary = base00; + mSecondary = base05; + mOnSecondary = base00; + mTertiary = base04; + mOnTertiary = base00; + mError = base08; + mOnError = base00; + mSurface = base00; + mOnSurface = base05; + mHover = base04; + mOnHover = base00; + mSurfaceVariant = base01; + mOnSurfaceVariant = base04; + mOutline = base02; + mShadow = base00; + }; + }; + } + ) + ( + { opacity }: + { + programs.noctalia-shell = { + settings = { + bar.backgroundOpacity = opacity.desktop; + bar.capsuleOpacity = opacity.desktop; + ui.panelBackgroundOpacity = opacity.desktop; + dock.backgroundOpacity = opacity.desktop; + osd.backgroundOpacity = opacity.popups; + notifications.backgroundOpacity = opacity.popups; + }; + }; + } + ) + ( + { fonts }: + { + programs.noctalia-shell = { + settings = { + ui.fontDefault = fonts.sansSerif.name; + ui.fontFixed = fonts.monospace.name; + }; + }; + } + ) + ( + { image }: + { + home.file.".cache/noctalia/wallpapers.json" = { + text = builtins.toJSON { defaultWallpaper = image; }; + }; + } + ) + ]; +} diff --git a/modules/noctalia-shell/meta.nix b/modules/noctalia-shell/meta.nix new file mode 100644 index 00000000..bf44ed74 --- /dev/null +++ b/modules/noctalia-shell/meta.nix @@ -0,0 +1,6 @@ +{ lib, ... }: +{ + name = "Noctalia shell"; + homepage = "https://docs.noctalia.dev"; + maintainers = [ lib.maintainers.rwxae ]; +} diff --git a/modules/noctalia-shell/testbeds/noctalia-shell.nix b/modules/noctalia-shell/testbeds/noctalia-shell.nix new file mode 100644 index 00000000..970c47bc --- /dev/null +++ b/modules/noctalia-shell/testbeds/noctalia-shell.nix @@ -0,0 +1,11 @@ +{ lib, ... }: +{ + stylix.testbed.ui = { + graphicalEnvironment = "hyprland"; + command.text = "noctalia-shell --no-duplicate"; + }; + + home-manager.sharedModules = lib.singleton { + programs.noctalia-shell.enable = true; + }; +} diff --git a/modules/nushell/hm.nix b/modules/nushell/hm.nix index 05d6f0a6..12b4b1fa 100644 --- a/modules/nushell/hm.nix +++ b/modules/nushell/hm.nix @@ -1,10 +1,7 @@ { mkTarget, ... }: mkTarget { - name = "nushell"; - humanName = "Nushell"; - # Adapted from https://www.nushell.sh/book/coloring_and_theming.html#theming - configElements = + config = { colors }: { programs.nushell.extraConfig = with colors.withHashtag; '' diff --git a/modules/nushell/testbeds/nushell.nix b/modules/nushell/testbeds/nushell.nix index b045f270..22f0180d 100644 --- a/modules/nushell/testbeds/nushell.nix +++ b/modules/nushell/testbeds/nushell.nix @@ -5,7 +5,5 @@ useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.nushell.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.nushell.enable = true; }; } diff --git a/modules/obsidian/hm.nix b/modules/obsidian/hm.nix index 91f2dc75..9ed3ab15 100644 --- a/modules/obsidian/hm.nix +++ b/modules/obsidian/hm.nix @@ -1,19 +1,12 @@ -{ - mkTarget, - lib, - ... -}: +{ mkTarget, lib, ... }: mkTarget { - name = "obsidian"; - humanName = "Obsidian"; - - extraOptions.vaultNames = lib.mkOption { + options.vaultNames = lib.mkOption { description = "The obsidian vault names to apply styling on."; type = lib.types.listOf lib.types.str; default = [ ]; }; - configElements = [ + config = [ ( { cfg, fonts }: { diff --git a/modules/obsidian/testbeds/obsidian.nix b/modules/obsidian/testbeds/obsidian.nix index 4607f91e..12067ba3 100644 --- a/modules/obsidian/testbeds/obsidian.nix +++ b/modules/obsidian/testbeds/obsidian.nix @@ -4,10 +4,7 @@ let in { nixpkgs.config.allowUnfreePredicate = - pkg: - builtins.elem (lib.getName pkg) [ - "obsidian" - ]; + pkg: builtins.elem (lib.getName pkg) [ "obsidian" ]; stylix.testbed.ui.application = { name = "obsidian"; diff --git a/modules/opencode/hm.nix b/modules/opencode/hm.nix index bb603458..ce83cfe2 100644 --- a/modules/opencode/hm.nix +++ b/modules/opencode/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "opencode"; - humanName = "OpenCode"; - - configElements = + config = { colors }: { programs.opencode = diff --git a/modules/opencode/testbeds/opencode.nix b/modules/opencode/testbeds/opencode.nix index d2f350ab..fe1eda0e 100644 --- a/modules/opencode/testbeds/opencode.nix +++ b/modules/opencode/testbeds/opencode.nix @@ -5,7 +5,5 @@ useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.opencode.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.opencode.enable = true; }; } diff --git a/modules/plymouth/nixos.nix b/modules/plymouth/nixos.nix index acb1c48d..6dc3deb4 100644 --- a/modules/plymouth/nixos.nix +++ b/modules/plymouth/nixos.nix @@ -5,10 +5,7 @@ ... }: mkTarget { - name = "plymouth"; - humanName = "the Plymouth boot screen"; - - extraOptions = { + options = { logo = lib.mkOption { description = "Logo to be used on the boot screen."; type = with lib.types; either path package; @@ -35,7 +32,7 @@ mkTarget { ) ]; - configElements = + config = { cfg, colors }: let themeScript = import ./theme-script.nix { inherit lib cfg colors; }; diff --git a/modules/qt/hm.nix b/modules/qt/hm.nix index aee2206d..732a9623 100644 --- a/modules/qt/hm.nix +++ b/modules/qt/hm.nix @@ -28,6 +28,28 @@ type = lib.types.str; default = "qtct"; }; + + standardDialogs = lib.mkOption { + description = '' + Selects the standard dialogs theme to be used by Qt. + + Using `xdgdesktopportal` integrates with the native desktop portal. + ''; + + # The enum variants are derived from the qt6ct platform theme integration + # [1]. + # + # [1]: https://www.opencode.net/trialuser/qt6ct/-/blob/00823e41aa60e8fe266d5aee328e82ad1ad94348/src/qt6ct/appearancepage.cpp#L83-L92 + type = lib.types.enum [ + "default" + "gtk2" + "gtk3" + "kde" + "xdgdesktopportal" + ]; + + default = "default"; + }; }; config = lib.mkIf (config.stylix.enable && config.stylix.targets.qt.enable) ( @@ -75,47 +97,38 @@ home.packages = lib.optional (config.qt.style.name == "kvantum") kvantumPackage; - qt = { - enable = true; - style.name = recommendedStyle; - platformTheme.name = config.stylix.targets.qt.platform; - }; - - xdg.configFile = + qt = let - qtctConf = '' - [Appearance] - '' - + lib.optionalString (config.qt.style ? name) '' - style=${config.qt.style.name} - '' - + lib.optionalString (icons != null) '' - icon_theme=${icons} - '' - + '' - [Fonts] - fixed="${config.stylix.fonts.monospace.name},${toString config.stylix.fonts.sizes.applications}" - general="${config.stylix.fonts.sansSerif.name},${toString config.stylix.fonts.sizes.applications}" - ''; + qtctSettings = { + Appearance = { + custom_palette = true; + standard_dialogs = config.stylix.targets.qt.standardDialogs; + style = lib.mkIf (config.qt.style ? name) config.qt.style.name; + icon_theme = lib.mkIf (icons != null) icons; + }; + Fonts = { + fixed = ''"${config.stylix.fonts.monospace.name},${toString config.stylix.fonts.sizes.applications}"''; + general = ''"${config.stylix.fonts.sansSerif.name},${toString config.stylix.fonts.sizes.applications}"''; + }; + }; in - lib.mkMerge [ - (lib.mkIf (config.qt.style.name == "kvantum") { - "Kvantum/kvantum.kvconfig".source = - (pkgs.formats.ini { }).generate "kvantum.kvconfig" - { - General.theme = "Base16Kvantum"; - }; + { + enable = true; + style.name = recommendedStyle; + platformTheme.name = config.stylix.targets.qt.platform; - "Kvantum/Base16Kvantum".source = - "${kvantumPackage}/share/Kvantum/Base16Kvantum"; - }) + qt5ctSettings = lib.mkIf (config.qt.platformTheme.name == "qtct") qtctSettings; + qt6ctSettings = lib.mkIf (config.qt.platformTheme.name == "qtct") qtctSettings; + }; - (lib.mkIf (config.qt.platformTheme.name == "qtct") { - "qt5ct/qt5ct.conf".text = qtctConf; - "qt6ct/qt6ct.conf".text = qtctConf; - }) - ]; + xdg.configFile = lib.mkIf (config.qt.style.name == "kvantum") { + "Kvantum/kvantum.kvconfig".source = + (pkgs.formats.ini { }).generate "kvantum.kvconfig" + { General.theme = "Base16Kvantum"; }; + "Kvantum/Base16Kvantum".source = + "${kvantumPackage}/share/Kvantum/Base16Kvantum"; + }; } ); } diff --git a/modules/qt/kvconfig.mustache b/modules/qt/kvconfig.mustache index 99714d65..a5575c43 100644 --- a/modules/qt/kvconfig.mustache +++ b/modules/qt/kvconfig.mustache @@ -1,6 +1,7 @@ [%General] author=Bluskript based on Catppuccin Frappe Mauve theme comment=base16-qt +combo_focus_rect=true spread_menuitems=true left_tabs=true mirror_doc_tabs=true @@ -79,14 +80,15 @@ light.color=#{{base03-hex}} mid.light.color=#{{base03-hex}} dark.color=#{{base00-hex}} mid.color=#{{base00-hex}} -highlight.color=#{{base03-hex}} +highlight.color=#{{base0E-hex}} inactive.highlight.color=#{{base03-hex}} +tooltip.base.color=#{{base00-hex}} text.color=#{{base05-hex}} window.text.color=#{{base05-hex}} button.text.color=#{{base05-hex}} disabled.text.color=#{{base04-hex}} tooltip.text.color=#{{base05-hex}} -highlight.text.color=#{{base05-hex}} +highlight.text.color=#{{base00-hex}} link.color=#{{base0D-hex}} link.visited.color=#{{base0E-hex}} @@ -98,6 +100,7 @@ interior.element=itemview frame=true interior=true text.iconspacing=3 +text.press.color=#{{base05-hex}} text.toggle.color=#{{base05-hex}} [RadioButton] @@ -317,6 +320,10 @@ text.press.color=#{{base05-hex}} text.toggle.color=#{{base05-hex}} text.bold=false +[ToolbarLineEdit] +frame.element=lineedit +interior.element=lineedit + [Scrollbar] inherits=PanelButtonCommand indicator.size=0 @@ -382,6 +389,10 @@ frame.right=3 inherits=PanelButtonCommand interior.element=menuitem indicator.size=8 +frame=true +frame.element=menuitem +frame.right=10 +frame.left=10 text.focus.color=#{{base05-hex}} text.press.color=#{{base05-hex}} @@ -423,6 +434,7 @@ text.margin.top=1 text.margin.bottom=1 text.margin.left=3 text.margin.right=3 +text.press.color=#{{base05-hex}} text.toggle.color=#{{base05-hex}} [ToolboxTab] @@ -452,7 +464,7 @@ blur_translucent=true centered_forms=false kinetic_scrolling=false middle_click_scroll=false -no_selection_tint=false +no_selection_tint=true noninteger_translucency=false style_vertical_toolbars=false blur_only_active_window=false diff --git a/modules/qutebrowser/hm.nix b/modules/qutebrowser/hm.nix index 1f2e0158..2a3aae27 100644 --- a/modules/qutebrowser/hm.nix +++ b/modules/qutebrowser/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "qutebrowser"; - humanName = "Qutebrowser"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/regreet/gtk.css.mustache b/modules/regreet/gtk.css.mustache new file mode 100644 index 00000000..3b2e9224 --- /dev/null +++ b/modules/regreet/gtk.css.mustache @@ -0,0 +1,88 @@ +@define-color accent_color #{{base0D-hex}}; +@define-color accent_bg_color #{{base0D-hex}}; +@define-color accent_fg_color #{{base00-hex}}; +@define-color destructive_color #{{base08-hex}}; +@define-color destructive_bg_color #{{base08-hex}}; +@define-color destructive_fg_color #{{base00-hex}}; +@define-color success_color #{{base0B-hex}}; +@define-color success_bg_color #{{base0B-hex}}; +@define-color success_fg_color #{{base00-hex}}; +@define-color warning_color #{{base0E-hex}}; +@define-color warning_bg_color #{{base0E-hex}}; +@define-color warning_fg_color #{{base00-hex}}; +@define-color error_color #{{base08-hex}}; +@define-color error_bg_color #{{base08-hex}}; +@define-color error_fg_color #{{base00-hex}}; +@define-color window_bg_color #{{base00-hex}}; +@define-color window_fg_color #{{base05-hex}}; +@define-color view_bg_color #{{base00-hex}}; +@define-color view_fg_color #{{base05-hex}}; +@define-color headerbar_bg_color #{{base01-hex}}; +@define-color headerbar_fg_color #{{base05-hex}}; +@define-color headerbar_border_color rgba({{base01-dec-r}}, {{base01-dec-g}}, {{base01-dec-b}}, 0.7); +@define-color headerbar_backdrop_color @window_bg_color; +@define-color headerbar_shade_color rgba(0, 0, 0, 0.07); +@define-color headerbar_darker_shade_color rgba(0, 0, 0, 0.07); +@define-color sidebar_bg_color #{{base01-hex}}; +@define-color sidebar_fg_color #{{base05-hex}}; +@define-color sidebar_backdrop_color @window_bg_color; +@define-color sidebar_shade_color rgba(0, 0, 0, 0.07); +@define-color secondary_sidebar_bg_color @sidebar_bg_color; +@define-color secondary_sidebar_fg_color @sidebar_fg_color; +@define-color secondary_sidebar_backdrop_color @sidebar_backdrop_color; +@define-color secondary_sidebar_shade_color @sidebar_shade_color; +@define-color card_bg_color #{{base01-hex}}; +@define-color card_fg_color #{{base05-hex}}; +@define-color card_shade_color rgba(0, 0, 0, 0.07); +@define-color dialog_bg_color #{{base01-hex}}; +@define-color dialog_fg_color #{{base05-hex}}; +@define-color popover_bg_color #{{base01-hex}}; +@define-color popover_fg_color #{{base05-hex}}; +@define-color popover_shade_color rgba(0, 0, 0, 0.07); +@define-color shade_color rgba(0, 0, 0, 0.07); +@define-color scrollbar_outline_color #{{base02-hex}}; +@define-color blue_1 #{{base0D-hex}}; +@define-color blue_2 #{{base0D-hex}}; +@define-color blue_3 #{{base0D-hex}}; +@define-color blue_4 #{{base0D-hex}}; +@define-color blue_5 #{{base0D-hex}}; +@define-color green_1 #{{base0B-hex}}; +@define-color green_2 #{{base0B-hex}}; +@define-color green_3 #{{base0B-hex}}; +@define-color green_4 #{{base0B-hex}}; +@define-color green_5 #{{base0B-hex}}; +@define-color yellow_1 #{{base0A-hex}}; +@define-color yellow_2 #{{base0A-hex}}; +@define-color yellow_3 #{{base0A-hex}}; +@define-color yellow_4 #{{base0A-hex}}; +@define-color yellow_5 #{{base0A-hex}}; +@define-color orange_1 #{{base09-hex}}; +@define-color orange_2 #{{base09-hex}}; +@define-color orange_3 #{{base09-hex}}; +@define-color orange_4 #{{base09-hex}}; +@define-color orange_5 #{{base09-hex}}; +@define-color red_1 #{{base08-hex}}; +@define-color red_2 #{{base08-hex}}; +@define-color red_3 #{{base08-hex}}; +@define-color red_4 #{{base08-hex}}; +@define-color red_5 #{{base08-hex}}; +@define-color purple_1 #{{base0E-hex}}; +@define-color purple_2 #{{base0E-hex}}; +@define-color purple_3 #{{base0E-hex}}; +@define-color purple_4 #{{base0E-hex}}; +@define-color purple_5 #{{base0E-hex}}; +@define-color brown_1 #{{base0F-hex}}; +@define-color brown_2 #{{base0F-hex}}; +@define-color brown_3 #{{base0F-hex}}; +@define-color brown_4 #{{base0F-hex}}; +@define-color brown_5 #{{base0F-hex}}; +@define-color light_1 #{{base05-hex}}; +@define-color light_2 #{{base05-hex}}; +@define-color light_3 #{{base05-hex}}; +@define-color light_4 #{{base05-hex}}; +@define-color light_5 #{{base05-hex}}; +@define-color dark_1 #{{base05-hex}}; +@define-color dark_2 #{{base05-hex}}; +@define-color dark_3 #{{base05-hex}}; +@define-color dark_4 #{{base05-hex}}; +@define-color dark_5 #{{base05-hex}}; diff --git a/modules/regreet/nixos.nix b/modules/regreet/nixos.nix index fc85a757..234294b4 100644 --- a/modules/regreet/nixos.nix +++ b/modules/regreet/nixos.nix @@ -6,15 +6,22 @@ ... }: mkTarget { - name = "regreet"; - humanName = "ReGreet"; - autoEnable = pkgs.stdenv.hostPlatform.isLinux; autoEnableExpr = "pkgs.stdenv.hostPlatform.isLinux"; - extraOptions.useWallpaper = config.lib.stylix.mkEnableWallpaper "ReGreet" true; + options = { + useWallpaper = config.lib.stylix.mkEnableWallpaper "ReGreet" true; + extraCss = lib.mkOption { + description = '' + Extra code added to `programs.regreet.extraCss` option. + ''; + type = lib.types.lines; + default = ""; + example = "window.background { border-radius: 0; }"; + }; + }; - configElements = [ + config = [ { warnings = let @@ -34,6 +41,24 @@ mkTarget { name = "adw-gtk3"; }; } + ( + { cfg, colors }: + let + baseCss = colors { + # This is strongly inspired by ../gtk/gtk.mustache. + template = ./gtk.css.mustache; + extension = ".css"; + }; + + finalCss = pkgs.runCommandLocal "gtk.css" { } '' + cat ${baseCss} >>$out + echo ${lib.escapeShellArg cfg.extraCss} >>$out + ''; + in + { + programs.regreet.extraCss = finalCss.outPath; + } + ) ( { polarity }: { @@ -66,16 +91,21 @@ mkTarget { ( { fonts }: { - programs.regreet.font = { - inherit (fonts.sansSerif) name package; - }; + programs.regreet.font = { inherit (fonts.sansSerif) name package; }; } ) ( { cursor }: { - programs.regreet.cursorTheme = { - inherit (cursor) name package; + programs.regreet.cursorTheme = { inherit (cursor) name package; }; + } + ) + ( + { polarity, icons }: + { + programs.regreet.iconTheme = { + inherit (icons) package; + name = if (polarity == "dark") then icons.dark else icons.light; }; } ) diff --git a/modules/regreet/testbeds/regreet.nix b/modules/regreet/testbeds/regreet.nix new file mode 100644 index 00000000..a4ec92ae --- /dev/null +++ b/modules/regreet/testbeds/regreet.nix @@ -0,0 +1 @@ +{ programs.regreet.enable = true; } diff --git a/modules/rio/hm.nix b/modules/rio/hm.nix index ac6bdb5e..073cf4e1 100644 --- a/modules/rio/hm.nix +++ b/modules/rio/hm.nix @@ -2,10 +2,7 @@ # - https://raphamorim.io/rio/docs/config { mkTarget, ... }: mkTarget { - name = "rio"; - humanName = "Rio"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/rofi/hm.nix b/modules/rofi/hm.nix index a0b03942..7ccd1fdc 100644 --- a/modules/rofi/hm.nix +++ b/modules/rofi/hm.nix @@ -1,9 +1,6 @@ { mkTarget, config, ... }: mkTarget { - name = "rofi"; - humanName = "Rofi"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/spicetify/spicetify.nix b/modules/spicetify/spicetify.nix index 045230c6..6c22479d 100644 --- a/modules/spicetify/spicetify.nix +++ b/modules/spicetify/spicetify.nix @@ -6,10 +6,7 @@ ... }: mkTarget { - name = "spicetify"; - humanName = "Spicetify"; - - configElements = + config = { colors }: lib.optionalAttrs (options.programs ? spicetify) { programs.spicetify = { diff --git a/modules/spicetify/testbeds/spicetify.nix b/modules/spicetify/testbeds/spicetify.nix index d5673f99..72cf9226 100644 --- a/modules/spicetify/testbeds/spicetify.nix +++ b/modules/spicetify/testbeds/spicetify.nix @@ -17,8 +17,5 @@ programs.spicetify.enable = true; nixpkgs.config.allowUnfreePredicate = - pkg: - builtins.elem (lib.getName pkg) [ - "spotify" - ]; + pkg: builtins.elem (lib.getName pkg) [ "spotify" ]; } diff --git a/modules/spotify-player/hm.nix b/modules/spotify-player/hm.nix index 6df7c5d8..5d09be62 100644 --- a/modules/spotify-player/hm.nix +++ b/modules/spotify-player/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "spotify-player"; - humanName = "spotify-player"; - - configElements = + config = { colors }: { programs.spotify-player = { diff --git a/modules/starship/hm.nix b/modules/starship/hm.nix index bdcc4a1f..ae832927 100644 --- a/modules/starship/hm.nix +++ b/modules/starship/hm.nix @@ -1,10 +1,7 @@ # Starship configuration documentation: https://starship.rs/config { mkTarget, ... }: mkTarget { - name = "starship"; - humanName = "Starship"; - - configElements = + config = { colors }: { programs.starship.settings = { diff --git a/modules/swaylock/hm.nix b/modules/swaylock/hm.nix index 910ef72f..ee0e3570 100644 --- a/modules/swaylock/hm.nix +++ b/modules/swaylock/hm.nix @@ -6,9 +6,6 @@ ... }: mkTarget { - name = "swaylock"; - humanName = "Swaylock"; - # When the state version is older than 23.05, Swaylock enables itself # automatically if `settings != {}` [1]. Therefore, Swaylock theming # shouldn't be enabled by default for such state versions, to avoid @@ -26,9 +23,9 @@ mkTarget { lib.versionAtLeast config.home.stateVersion "23.05" && pkgs.stdenv.hostPlatform.isLinux ''; - extraOptions.useWallpaper = config.lib.stylix.mkEnableWallpaper "Swaylock" true; + options.useWallpaper = config.lib.stylix.mkEnableWallpaper "Swaylock" true; - configElements = [ + config = [ ( { colors }: { diff --git a/modules/swaync/hm.nix b/modules/swaync/hm.nix index 271a437d..9a4395a6 100644 --- a/modules/swaync/hm.nix +++ b/modules/swaync/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "swaync"; - humanName = "SwayNC"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/sxiv/hm.nix b/modules/sxiv/hm.nix index 6fce9add..d40dc9d9 100644 --- a/modules/sxiv/hm.nix +++ b/modules/sxiv/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "sxiv"; - humanName = "Sxiv"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/sxiv/testbeds/sxiv.nix b/modules/sxiv/testbeds/sxiv.nix index 28d54508..dc0efe0b 100644 --- a/modules/sxiv/testbeds/sxiv.nix +++ b/modules/sxiv/testbeds/sxiv.nix @@ -11,7 +11,5 @@ in "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; ''; - home-manager.sharedModules = lib.singleton { - home.packages = [ package ]; - }; + home-manager.sharedModules = lib.singleton { home.packages = [ package ]; }; } diff --git a/modules/tmux/hm.nix b/modules/tmux/hm.nix index 44310c10..8aae5500 100644 --- a/modules/tmux/hm.nix +++ b/modules/tmux/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "tmux"; - humanName = "Tmux"; - - configElements = + config = { colors, inputs }: { programs.tmux.extraConfig = '' diff --git a/modules/tmux/testbeds/tmux.nix b/modules/tmux/testbeds/tmux.nix index fe9581ae..1b1dfc54 100644 --- a/modules/tmux/testbeds/tmux.nix +++ b/modules/tmux/testbeds/tmux.nix @@ -4,7 +4,5 @@ text = lib.getExe pkgs.tmux; useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.tmux.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.tmux.enable = true; }; } diff --git a/modules/tofi/hm.nix b/modules/tofi/hm.nix index 5e68f946..7fc5b1b5 100644 --- a/modules/tofi/hm.nix +++ b/modules/tofi/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "tofi"; - humanName = "Tofi"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/vicinae/hm.nix b/modules/vicinae/hm.nix index fc17baa3..baaa0ac0 100644 --- a/modules/vicinae/hm.nix +++ b/modules/vicinae/hm.nix @@ -5,10 +5,7 @@ ... }: mkTarget { - name = "vicinae"; - humanName = "Vicinae"; - - configElements = lib.optionals (options.services ? vicinae) [ + config = lib.optionals (options.services ? vicinae) [ ( { colors, polarity }: { diff --git a/modules/vicinae/testbeds/vicinae.nix b/modules/vicinae/testbeds/vicinae.nix index 87d921ad..bb1698d5 100644 --- a/modules/vicinae/testbeds/vicinae.nix +++ b/modules/vicinae/testbeds/vicinae.nix @@ -5,7 +5,5 @@ command.text = "sleep 5 && vicinae open"; }; - home-manager.sharedModules = lib.singleton { - services.vicinae.enable = true; - }; + home-manager.sharedModules = lib.singleton { services.vicinae.enable = true; }; } diff --git a/modules/vscode/hm.nix b/modules/vscode/hm.nix index 42b3fcc9..04a4a955 100644 --- a/modules/vscode/hm.nix +++ b/modules/vscode/hm.nix @@ -6,16 +6,13 @@ ... }: mkTarget { - name = "vscode"; - humanName = "VSCode"; - - extraOptions.profileNames = lib.mkOption { + options.profileNames = lib.mkOption { description = "The VSCode profile names to apply styling on."; type = lib.types.listOf lib.types.str; default = [ "default" ]; }; - configElements = [ + config = [ ( { cfg }: { diff --git a/modules/vscode/templates/theme.nix b/modules/vscode/templates/theme.nix index a3cc3563..f1957317 100644 --- a/modules/vscode/templates/theme.nix +++ b/modules/vscode/templates/theme.nix @@ -999,9 +999,7 @@ colors: with colors.withHashtag; { } { name = "Block Level Variables"; - scope = [ - "meta.block variable.other" - ]; + scope = [ "meta.block variable.other" ]; settings.foreground = base08; } { @@ -1096,9 +1094,7 @@ colors: with colors.withHashtag; { } { name = "Language methods"; - scope = [ - "variable.language" - ]; + scope = [ "variable.language" ]; settings = { fontStyle = "italic"; foreground = base08; @@ -1106,9 +1102,7 @@ colors: with colors.withHashtag; { } { name = "entity.name.method.js"; - scope = [ - "entity.name.method.js" - ]; + scope = [ "entity.name.method.js" ]; settings = { fontStyle = "italic"; foreground = base0D; @@ -1195,9 +1189,7 @@ colors: with colors.withHashtag; { } { name = "ES7 Bind Operator"; - scope = [ - "source.js constant.other.object.key.js string.unquoted.label.js" - ]; + scope = [ "source.js constant.other.object.key.js string.unquoted.label.js" ]; settings = { fontStyle = "italic"; foreground = base0E; @@ -1302,9 +1294,7 @@ colors: with colors.withHashtag; { } { name = "Markup - Italic"; - scope = [ - "markup.italic" - ]; + scope = [ "markup.italic" ]; settings = { fontStyle = "italic"; foreground = base08; @@ -1381,9 +1371,7 @@ colors: with colors.withHashtag; { } { name = "Markdown - Fenced Bode Block"; - scope = [ - "punctuation.definition.fenced.markdown" - ]; + scope = [ "punctuation.definition.fenced.markdown" ]; settings.foreground = "#00000050"; } { diff --git a/modules/waybar/hm.nix b/modules/waybar/hm.nix index 273bf2bf..4ad22dfa 100644 --- a/modules/waybar/hm.nix +++ b/modules/waybar/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "waybar"; - humanName = "Waybar"; - - extraOptions = { + options = { background = lib.mkOption { type = lib.types.nullOr lib.types.str; description = "Used to set bg even if `opacity` or `colors` is null"; @@ -43,7 +40,7 @@ mkTarget { }; }; - configElements = [ + config = [ ( { cfg }: { @@ -72,10 +69,7 @@ mkTarget { } ) ( - { - cfg, - colors, - }: + { cfg, colors }: let colorlessModules = place: '' .modules-${place} #workspaces button { diff --git a/modules/waybar/testbeds/waybar.nix b/modules/waybar/testbeds/waybar.nix index 454c9c56..a4c0f68a 100644 --- a/modules/waybar/testbeds/waybar.nix +++ b/modules/waybar/testbeds/waybar.nix @@ -14,9 +14,7 @@ "hyprland/submap" "custom/media" ]; - modules-center = [ - "hyprland/window" - ]; + modules-center = [ "hyprland/window" ]; modules-right = [ "mpd" "idle_inhibitor" diff --git a/modules/wayfire/hm.nix b/modules/wayfire/hm.nix index 437cc6bb..d090e89d 100644 --- a/modules/wayfire/hm.nix +++ b/modules/wayfire/hm.nix @@ -6,12 +6,9 @@ ... }: mkTarget { - name = "wayfire"; - humanName = "Wayfire"; + options.useWallpaper = config.lib.stylix.mkEnableWallpaper "wayfire" true; - extraOptions.useWallpaper = config.lib.stylix.mkEnableWallpaper "wayfire" true; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/wayprompt/hm.nix b/modules/wayprompt/hm.nix index 8f5486a5..6f88c9cf 100644 --- a/modules/wayprompt/hm.nix +++ b/modules/wayprompt/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "wayprompt"; - humanName = "Wayprompt"; - - configElements = + config = { colors, opacity }: let opacity' = lib.toHexString (builtins.ceil (opacity.popups * 255)); diff --git a/modules/wezterm/hm.nix b/modules/wezterm/hm.nix index cd26a74e..12d14f84 100644 --- a/modules/wezterm/hm.nix +++ b/modules/wezterm/hm.nix @@ -5,14 +5,12 @@ ... }: mkTarget { - name = "wezterm"; - humanName = "WezTerm"; - extraOptions.luaBody = lib.mkOption { + options.luaBody = lib.mkOption { type = lib.types.lines; default = ""; internal = true; }; - configElements = [ + config = [ ( { colors }: with colors; diff --git a/modules/wob/hm.nix b/modules/wob/hm.nix index 6e2b7cef..383affaf 100644 --- a/modules/wob/hm.nix +++ b/modules/wob/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "wob"; - humanName = "wob"; - - configElements = + config = { colors }: { services.wob.settings = { diff --git a/modules/wofi/hm.nix b/modules/wofi/hm.nix index 7a4684e3..5bb41e1d 100644 --- a/modules/wofi/hm.nix +++ b/modules/wofi/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "wofi"; - humanName = "wofi"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/wpaperd/hm.nix b/modules/wpaperd/hm.nix index 2ee840e4..35cd1e21 100644 --- a/modules/wpaperd/hm.nix +++ b/modules/wpaperd/hm.nix @@ -1,9 +1,6 @@ { mkTarget, lib, ... }: mkTarget { - name = "wpaperd"; - humanName = "wpaperd"; - - configElements = + config = { imageScalingMode, image }: ( let diff --git a/modules/xfce/hm.nix b/modules/xfce/hm.nix index 0eeae1b7..01573694 100644 --- a/modules/xfce/hm.nix +++ b/modules/xfce/hm.nix @@ -1,11 +1,9 @@ { mkTarget, ... }: mkTarget { - name = "xfce"; - humanName = "Xfce"; # Disabled by default due to https://github.com/nix-community/stylix/issues/180 autoEnable = false; - configElements = + config = { fonts }: { xfconf.settings = with fonts; { diff --git a/modules/xresources/hm.nix b/modules/xresources/hm.nix index 3a9fafb8..a9a5929b 100644 --- a/modules/xresources/hm.nix +++ b/modules/xresources/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "xresources"; - humanName = "Xresources"; - - configElements = [ + config = [ ( { fonts }: { diff --git a/modules/yazi/hm.nix b/modules/yazi/hm.nix index bf01e02e..b00eb4fb 100644 --- a/modules/yazi/hm.nix +++ b/modules/yazi/hm.nix @@ -1,18 +1,13 @@ # Based on the official catppuccin themes https://github.com/yazi-rs/themes { mkTarget, lib, ... }: mkTarget { - name = "yazi"; - humanName = "Yazi"; - - extraOptions = { - boldDirectory = lib.mkOption { - description = "Whether to use bold font for directories."; - type = lib.types.bool; - default = true; - }; + options.boldDirectory = lib.mkOption { + description = "Whether to use bold font for directories."; + type = lib.types.bool; + default = true; }; - configElements = + config = { cfg, colors }: { programs.yazi.theme = diff --git a/modules/yazi/testbeds/yazi.nix b/modules/yazi/testbeds/yazi.nix index b0eafb91..a3af3808 100644 --- a/modules/yazi/testbeds/yazi.nix +++ b/modules/yazi/testbeds/yazi.nix @@ -14,8 +14,6 @@ in inherit package; }; - home.packages = [ - pkgs.nerd-fonts.fira-mono - ]; + home.packages = [ pkgs.nerd-fonts.fira-mono ]; }; } diff --git a/modules/zathura/hm.nix b/modules/zathura/hm.nix index cfaec37e..0feb61d7 100644 --- a/modules/zathura/hm.nix +++ b/modules/zathura/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "zathura"; - humanName = "Zathura"; - - configElements = + config = { colors, opacity }: { programs.zathura.options = diff --git a/modules/zed/hm.nix b/modules/zed/hm.nix index 2b864190..b7300c1a 100644 --- a/modules/zed/hm.nix +++ b/modules/zed/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "zed"; - humanName = "zed"; - - configElements = [ + config = [ ( { fonts }: { @@ -22,9 +19,7 @@ mkTarget { { programs.zed-editor = { userSettings.theme = "Base16 ${colors.scheme-name}"; - themes.stylix = colors { - templateRepo = inputs.tinted-zed; - }; + themes.stylix = colors { templateRepo = inputs.tinted-zed; }; }; } ) diff --git a/modules/zellij/hm.nix b/modules/zellij/hm.nix index 2580aa6a..2142b68d 100644 --- a/modules/zellij/hm.nix +++ b/modules/zellij/hm.nix @@ -1,9 +1,6 @@ { mkTarget, ... }: mkTarget { - name = "zellij"; - humanName = "zellij"; - - configElements = + config = { colors }: { programs.zellij.themes.stylix = { diff --git a/modules/zellij/testbeds/zellij.nix b/modules/zellij/testbeds/zellij.nix index 40ff609c..521d9924 100644 --- a/modules/zellij/testbeds/zellij.nix +++ b/modules/zellij/testbeds/zellij.nix @@ -5,7 +5,5 @@ useTerminal = true; }; - home-manager.sharedModules = lib.singleton { - programs.zellij.enable = true; - }; + home-manager.sharedModules = lib.singleton { programs.zellij.enable = true; }; } diff --git a/modules/zen-browser/hm.nix b/modules/zen-browser/hm.nix index 09573dee..cf2d1d76 100644 --- a/modules/zen-browser/hm.nix +++ b/modules/zen-browser/hm.nix @@ -6,10 +6,7 @@ ... }: mkTarget { - name = "zen-browser"; - humanName = "Zen Browser"; - - extraOptions = { + options = { profileNames = lib.mkOption { description = "The Zen Browser profile names to apply styling on."; type = lib.types.listOf lib.types.str; @@ -25,7 +22,7 @@ mkTarget { }; }; - configElements = lib.optionals (options.programs ? zen-browser) [ + config = lib.optionals (options.programs ? zen-browser) [ ( { cfg }: { @@ -35,10 +32,7 @@ mkTarget { } ) ( - { - cfg, - fonts, - }: + { cfg, fonts }: { programs.zen-browser.profiles = lib.genAttrs cfg.profileNames (_: { settings = { @@ -50,10 +44,7 @@ mkTarget { } ) ( - { - cfg, - colors, - }: + { cfg, colors }: { programs.zen-browser.profiles = lib.mkIf cfg.enableCss ( lib.genAttrs cfg.profileNames (_: { diff --git a/stylix/autoload.nix b/stylix/autoload.nix index 86babf57..3eeaf2f4 100644 --- a/stylix/autoload.nix +++ b/stylix/autoload.nix @@ -1,7 +1,10 @@ -{ lib }: +{ lib, pkgs }: # string -> [ path ] # List include path for either nixos modules or hm modules platform: +let + meta = import ./meta.nix { inherit lib pkgs; }; +in builtins.concatLists ( lib.mapAttrsToList ( target: kind: @@ -15,7 +18,10 @@ builtins.concatLists ( # NOTE: `mkTarget` cannot be distributed normally through the module system # due to issues of infinite recursion. - mkTarget = import ./mk-target.nix; + mkTarget = import ./mk-target.nix { + humanName = meta.${target}.name; + name = target; + }; in lib.optional (kind == "directory" && builtins.pathExists file) ( if useMkTarget then diff --git a/stylix/darwin/default.nix b/stylix/darwin/default.nix index 1f0bbb68..7e61dd00 100644 --- a/stylix/darwin/default.nix +++ b/stylix/darwin/default.nix @@ -1,10 +1,11 @@ { lib, + pkgs, config, ... }: let - autoload = import ../autoload.nix { inherit lib; } "darwin"; + autoload = import ../autoload.nix { inherit lib pkgs; } "darwin"; in { imports = [ diff --git a/stylix/droid/default.nix b/stylix/droid/default.nix index 91ca5196..0394fc14 100644 --- a/stylix/droid/default.nix +++ b/stylix/droid/default.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ lib, pkgs, ... }: let - autoload = import ../autoload.nix { inherit lib; } "droid"; + autoload = import ../autoload.nix { inherit lib pkgs; } "droid"; in { imports = [ @@ -19,7 +19,5 @@ in ++ autoload; # See https://github.com/nix-community/nix-on-droid/issues/436 - options.lib = lib.mkOption { - type = with lib.types; attrsOf attrs; - }; + options.lib = lib.mkOption { type = with lib.types; attrsOf attrs; }; } diff --git a/stylix/hm/default.nix b/stylix/hm/default.nix index 5dcd1ce5..7aacf5a1 100644 --- a/stylix/hm/default.nix +++ b/stylix/hm/default.nix @@ -1,10 +1,11 @@ { lib, + pkgs, config, ... }: let - autoload = import ../autoload.nix { inherit lib; } "hm"; + autoload = import ../autoload.nix { inherit lib pkgs; } "hm"; in { imports = [ diff --git a/stylix/hm/icons.nix b/stylix/hm/icons.nix index 76b4b560..b23c8742 100644 --- a/stylix/hm/icons.nix +++ b/stylix/hm/icons.nix @@ -10,12 +10,7 @@ in inherit (cfg) package; name = builtins.head ( lib.filter (x: null != x) [ - ( - { - inherit (cfg) dark light; - } - ."${polarity}" or null - ) + ({ inherit (cfg) dark light; }."${polarity}" or null) cfg.dark cfg.light ] diff --git a/stylix/maintainers.nix b/stylix/maintainers.nix index aa4fa235..c9c12d46 100644 --- a/stylix/maintainers.nix +++ b/stylix/maintainers.nix @@ -65,6 +65,12 @@ github = "osipog"; githubId = 87434959; }; + rwxae = { + email = "wardxela@gmail.com"; + name = "Alexander"; + github = "rwxae"; + githubId = 63157919; + }; skiletro = { email = "git@skilet.ro"; name = "jamie"; diff --git a/stylix/meta.nix b/stylix/meta.nix index 5557bf0b..05379671 100644 --- a/stylix/meta.nix +++ b/stylix/meta.nix @@ -1,7 +1,4 @@ -{ - pkgs, - lib, -}: +{ pkgs, lib }: builtins.mapAttrs ( _: value: diff --git a/stylix/mk-target.nix b/stylix/mk-target.nix index 49f95ca4..9b29f5b4 100644 --- a/stylix/mk-target.nix +++ b/stylix/mk-target.nix @@ -19,15 +19,12 @@ ```nix { mkTarget, lib... }: mkTarget { - name = "«name»"; - humanName = "«human readable name»"; - - generalConfig = + unconditionalConfig = lib.mkIf complexCondition { home.packages = [ pkgs.hello ]; }; - configElements = [ + config = [ { programs.«name».theme.name = "stylix"; } ( @@ -51,15 +48,7 @@ `config` (Attribute set) - : `name` (String) - : The target name used to generate options in the `stylix.targets.${name}` - namespace. - - `humanName` (String) - : The descriptive target name passed to the lib.mkEnableOption function - when generating the `stylix.targets.${name}.enable` option. - - `autoEnable` (Boolean) + : `autoEnable` (Boolean) : Whether the target should be automatically enabled by default according to the `stylix.autoEnable` option. @@ -82,22 +71,7 @@ The default (`true`) is inherited from `mkEnableTargetWith`. - `enableExample` (Boolean or literal expression) - : An example to include on the enable option. The default is calculated - automatically by `mkEnableTargetWith` and depends on `autoEnable` and - whether an `autoEnableExpr` is used. - - `extraOptions` (Attribute set) - : Additional options to be added in the `stylix.targets.${name}` namespace - along the `stylix.targets.${name}.enable` option. - - For example, an extension guard used in the configuration can be declared - as follows: - ```nix - { extension.enable = lib.mkEnableOption "the bloated dependency"; } - ``` - - `configElements` (List or attribute set or function or path) + `config` (List or attribute set or function or path) : Configuration functions that are automatically safeguarded when any of their arguments is disabled. The provided `cfg` argument conveniently aliases to `config.stylix.targets.${name}`. @@ -125,10 +99,36 @@ ) ``` - `generalConfig` (Attribute set or function or path) - : This argument mirrors the `configElements` argument but intentionally - lacks automatic safeguarding and should only be used for complex - configurations where `configElements` is unsuitable. + `enableExample` (Boolean or literal expression) + : An example to include on the enable option. The default is calculated + automatically by `mkEnableTargetWith` and depends on `autoEnable` and + whether an `autoEnableExpr` is used. + + `humanName` (String) + : The descriptive target name passed to the lib.mkEnableOption function + when generating the `stylix.targets.${name}.enable` option. + +   `imports` (List) +   : The `imports` option forwarded to the Nixpkgs module system. + + `options` (List or attribute set or function or path) + : Additional options to be added in the `stylix.targets.${name}` namespace, + normalized identically to `config`. + + For example, an extension guard used in the configuration can be declared + as follows: + ```nix + { extension.enable = lib.mkEnableOption "the bloated dependency"; } + ``` + + `name` (String) + : The target name used to generate options in the `stylix.targets.${name}` + namespace. + + `unconditionalConfig` (Attribute set or function or path) + : This argument mirrors the `config` argument but intentionally lacks + automatic safeguarding and should only be used for complex configurations + where `config` is unsuitable. # Environment @@ -143,16 +143,13 @@ # of modules: # # { -# name = "example"; -# humanName = "Example Target"; -# -# generalConfig = +# unconditionalConfig = # { lib, pkgs }: # lib.mkIf complexCondition { # home.packages = [ pkgs.hello ]; # }; # -# configElements = [ +# config = [ # { programs.example.theme.name = "stylix"; } # # ( @@ -170,73 +167,164 @@ # ) # ]; # } +{ humanName, name }: +let + humanName' = humanName; + name' = name; +in { - name, - humanName, autoEnable ? null, autoEnableExpr ? null, autoWrapEnableExpr ? null, + config ? [ ], enableExample ? null, - extraOptions ? { }, - configElements ? [ ], - generalConfig ? null, + humanName ? humanName', imports ? [ ], + name ? name', + options ? [ ], + unconditionalConfig ? { }, }@args: let + mkTargetConfig = config; + module = { config, lib, ... }: let + callModule = + let + areArgumentsEnabled = lib.flip lib.pipe [ + lib.attrsToList + (builtins.all ( + { name, value }: value.enable or (value != null) && cfg.${name}.enable or true + )) + ]; + in + safeguard: config': + let + arguments = getArguments config'; + in + if builtins.isFunction config' then + if safeguard then + lib.mkIf (areArgumentsEnabled arguments) (config' arguments) + else + config' arguments + + else if builtins.isAttrs config' then + config' + + else if builtins.isPath config' then + throw "stylix: unexpected unresolved path: ${toString config'}" + + else + throw "stylix: mkTarget expected a configuration to be a function, an attribute set, or a path, but got ${builtins.typeOf config'}: ${ + lib.generators.toPretty { } config' + }"; + cfg = config.stylix.targets.${name}; - # Get the list of function de-structured argument names. - functionArgNames = - fn: - lib.pipe fn [ - lib.functionArgs - builtins.attrNames - ]; + getArguments = + function: + lib.genAttrs + (lib.pipe function [ + lib.functionArgs + builtins.attrNames + ]) + ( + argument: + if argument == "cfg" then + cfg - getStylixAttrs = - fn: - lib.genAttrs (functionArgNames fn) ( - arg: - if arg == "cfg" then - cfg - else if arg == "colors" then - config.lib.stylix.colors - else - config.stylix.${arg} - or (throw "stylix: mkTarget expected one of `cfg`, `colors`, ${ - lib.concatMapStringsSep ", " (name: "`${name}`") ( - builtins.attrNames config.stylix + else + ( + config': + let + inherit (cfg.${argument}) override; + in + if override == null then + config' + else if builtins.typeOf override != builtins.typeOf config' then + throw "stylix: expected `config.stylix.targets.${name}.${argument}.override` to be a ${builtins.typeOf config'}, but got: ${builtins.typeOf override}" + else if builtins.isAttrs override then + lib.recursiveUpdate config' override + else + override + ) + ( + if argument == "colors" then + config.lib.stylix.colors + + else + config.stylix.${argument} or (throw "stylix: mkTarget expected one of ${ + lib.concatMapStringsSep ", " (expected: "`${expected}`") ( + lib.naturalSort ( + [ + "cfg" + "colors" + ] + ++ builtins.attrNames config.stylix + ) + ) + }, but got: ${argument}") ) - }, but got: ${arg}") - ); + ); - # Call the configuration function with its required Stylix arguments. - mkConfig = fn: fn (getStylixAttrs fn); + normalize = + config: + map (lib.fix ( + self: config': + if builtins.isPath config' then self (import config') else config' + )) (lib.toList config); - # Safeguard configuration functions when any of their arguments is - # disabled. - mkConditionalConfig = - c: - if builtins.isFunction c then - let - allAttrsEnabled = lib.pipe c [ - getStylixAttrs - builtins.attrValues - # If the attr has no enable option, it is instead disabled when null - (builtins.all (attr: attr.enable or (attr != null))) - ]; - in - lib.mkIf allAttrsEnabled (mkConfig c) - else - c; + normalizedConfig = normalize mkTargetConfig; + normalizedOptions = normalize options; in { - imports = imports ++ [ - { options.stylix.targets.${name} = mkConfig (lib.toFunction extraOptions); } - ]; + imports = + lib.singleton { + options.stylix.targets.${name} = + lib.genAttrs + (lib.concatLists ( + map (lib.flip lib.pipe [ + ( + config': lib.optionalAttrs (builtins.isFunction config') (getArguments config') + ) + builtins.attrNames + (lib.remove "cfg") + ]) (normalizedConfig ++ normalizedOptions) + )) + ( + argument: + let + config = "`${ + if argument == "colors" then + "config.lib.stylix.colors" + else + "config.stylix.${argument}" + }`"; + in + { + enable = lib.mkEnableOption "${config} for ${humanName}" // { + default = true; + example = false; + }; + + override = lib.mkOption { + default = null; + + description = '' + Attribute sets are recursively merged with ${config}, + while all other non-`null` types override ${config}. + ''; + + type = lib.types.anything; + }; + } + ); + } + ++ imports + ++ map (option: { + options.stylix.targets.${name} = callModule false option; + }) normalizedOptions; options.stylix.targets.${name}.enable = let @@ -254,14 +342,8 @@ let config = lib.mkIf (config.stylix.enable && cfg.enable) ( lib.mkMerge ( - lib.optional (generalConfig != null) ( - mkConfig ( - if builtins.isPath generalConfig then import generalConfig else generalConfig - ) - ) - ++ map (c: mkConditionalConfig (if builtins.isPath c then import c else c)) ( - lib.toList configElements - ) + lib.singleton (callModule false unconditionalConfig) + ++ map (callModule true) normalizedConfig ) ); }; diff --git a/stylix/nixos/default.nix b/stylix/nixos/default.nix index ebf2d807..beced139 100644 --- a/stylix/nixos/default.nix +++ b/stylix/nixos/default.nix @@ -1,10 +1,11 @@ { lib, + pkgs, config, ... }: let - autoload = import ../autoload.nix { inherit lib; } "nixos"; + autoload = import ../autoload.nix { inherit lib pkgs; } "nixos"; in { imports = [ diff --git a/stylix/overlays.nix b/stylix/overlays.nix index 0d8f76e3..a6fdc6ea 100644 --- a/stylix/overlays.nix +++ b/stylix/overlays.nix @@ -32,5 +32,5 @@ attrs.overlay ]; } - ) (import ./autoload.nix { inherit lib; } "overlay"); + ) (import ./autoload.nix { inherit lib pkgs; } "overlay"); } diff --git a/stylix/target.nix b/stylix/target.nix index 0f6da2ed..7846e8e9 100644 --- a/stylix/target.nix +++ b/stylix/target.nix @@ -85,9 +85,7 @@ example ? if args ? autoEnableExpr then true else !autoEnable, }@args: let - wrapExpr = wrapExprWith { - inherit autoWrapExpr; - }; + wrapExpr = wrapExprWith { inherit autoWrapExpr; }; in self.mkEnableIf { description = "Whether to enable theming for ${name}."; @@ -129,11 +127,7 @@ lib.mkOption { type = lib.types.bool; defaultText = if args ? defaultText then defaultText else default; - inherit - default - description - example - ; + inherit default description example; }; }; } diff --git a/stylix/testbed/default.nix b/stylix/testbed/default.nix index 2ea28306..510f0109 100644 --- a/stylix/testbed/default.nix +++ b/stylix/testbed/default.nix @@ -43,6 +43,10 @@ let ; }; + noctalia-shell.home-manager.sharedModules = [ + inputs.noctalia-shell.homeModules.default + ]; + nvf = inputs.nvf.nixosModules.default; vicinae.home-manager.sharedModules = [ diff --git a/stylix/testbed/graphical-environments/kde.nix b/stylix/testbed/graphical-environments/kde.nix index b9aaf0b4..0a1cf31a 100644 --- a/stylix/testbed/graphical-environments/kde.nix +++ b/stylix/testbed/graphical-environments/kde.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: +{ config, lib, ... }: { config = lib.mkIf (config.stylix.testbed.ui.graphicalEnvironment or null == "kde") diff --git a/stylix/testbed/images.nix b/stylix/testbed/images.nix index 1b5bde79..f03b0be2 100644 --- a/stylix/testbed/images.nix +++ b/stylix/testbed/images.nix @@ -1,7 +1,4 @@ -{ - fetchurl, - runCommandLocal, -}: +{ fetchurl, runCommandLocal }: { dark = fetchurl { name = "mountains.jpg"; diff --git a/stylix/testbed/is-enabled.nix b/stylix/testbed/is-enabled.nix index 4fd02ace..72029045 100644 --- a/stylix/testbed/is-enabled.nix +++ b/stylix/testbed/is-enabled.nix @@ -1,7 +1,4 @@ -{ - lib, - pkgs, -}: +{ lib, pkgs }: /** Creates a minimal configuration to extract the `stylix.testbed.enable` option value. diff --git a/stylix/testbed/modules/application.nix b/stylix/testbed/modules/application.nix index bab7e5eb..6d891bce 100644 --- a/stylix/testbed/modules/application.nix +++ b/stylix/testbed/modules/application.nix @@ -119,17 +119,39 @@ in name = "stylix-notification-check"; desktopName = "stylix-notification-check"; terminal = false; - exec = pkgs.writeShellScript "stylix-send-notifications" ( - lib.concatMapStringsSep " && " - ( - urgency: "${lib.getExe pkgs.libnotify} --urgency ${urgency} ${urgency} urgency" - ) + exec = + lib.pipe + { + name = "stylix-send-notifications"; + runtimeInputs = [ pkgs.libnotify ]; + + text = '' + for percent in {0..100}; do + ${lib.concatMapStrings + (urgency: '' + notify-send \ + --hint="int:value:$percent" \ + --hint=string:x-dunst-stack-tag:${urgency} \ + --urgency ${urgency} \ + ${urgency} \ + urgency \ + & + '') + [ + "low" + "normal" + "critical" + ] + } + + wait + done + ''; + } [ - "low" - "normal" - "critical" - ] - ); + pkgs.writeShellApplication + lib.getExe + ]; }; } )