summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell/default.nix
blob: 8414007200355cc39698906a5243e9cf038b81ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{ config, pkgs, lib, ... }:

{
  config = {
    programs.quickshell = {
      enable = true;
      config = {
        src = ./quickshell;
        replacements = {
          ignore_workspaces = builtins.toJSON (map ({ name, ... }: name) config.programs.niri.scratchspaces);
          wallpapers = builtins.toJSON (pkgs.stdenvNoCC.mkDerivation {
            name = "wallpapers";
            srcs = [
              (pkgs.fetchurl {
                url = "https://esawebb.org/media/archives/images/publicationtiff10k/carinanebula3.tif";
                hash = "sha256-YxZEweDKJfvfrdxb/QFmgJhcZDEJYxotoHrG+RRn1tw=";
              })
              (pkgs.fetchurl {
                url = "https://esawebb.org/media/archives/images/original/pillarsofcreation_composite.tif";
                hash = "sha256-qRiODxR0lZWdxgYXna0fNRFFDErpBJDwOJuQl6sNjRc=";
              })
              (pkgs.fetchurl {
                url = "https://esawebb.org/media/archives/images/publicationtiff10k/weic2212a.tif";
                hash = "sha256-l2fqE/z//C1a0xkvZwsnwPbTSb+WuA11h+SUl3E1dhw=";
              })
              (pkgs.fetchurl {
                url = "https://esawebb.org/media/archives/images/publicationtiff10k/weic2415a.tif";
                hash = "sha256-onBy7cPoUpDuzQStbY2E+qmlGgSLXPwFCLX53ukAb4c=";
              })
              (pkgs.fetchurl {
                url = "https://esawebb.org/media/archives/images/publicationtiff10k/weic2330a.tif";
                hash = "sha256-nn0ZtjZIrPcpj3YcLTsrL7XiXvyh3QYgCSmdDMD+3OM=";
              })
              (pkgs.fetchurl {
                url = "https://esawebb.org/media/archives/images/original/weic2426a.tif";
                hash = "sha256-EDnfPn3GE9jt6XPqiGInP7E2F3Az7d25NqATSWltDv0=";
              })
              (pkgs.fetchurl {
                url = "https://esawebb.org/media/archives/images/original/weic2503a.tif";
                hash = "sha256-3/RX6RQp8naELcgReHPd5/zhJkoCjnA10w5BEnNo+qI=";
              })
              (pkgs.fetchurl {
                url = "https://esawebb.org/media/archives/images/original/weic2506a.tif";
                hash = "sha256-aDld0aoY1owRxDVf7Jcyw71TH42M1foYotxn2thyFYw=";
              })
              (pkgs.fetchurl {
                url = "https://esawebb.org/media/archives/images/original/weic2514a.tif";
                hash = "sha256-jTi1G1Ofo5xsF6ggrbtYJHxqLaCQ7edM5B3uORiVQtg=";
              })
              (pkgs.fetchurl {
                url = "https://esawebb.org/media/archives/images/original/weic2425c.tif";
                hash = "sha256-oaEOexSJHEGj090dJF3ct5HAoR+Y5gRiPrUlxdvnTRo=";
              })
            ];

            dontUnpack = true;

            buildInputs = [ pkgs.imagemagick ];
            buildPhase = ''
              runHook preBuild

              typeset sources=($srcs)

              mkdir -p $out
              magick ''${sources[0]} -crop 10000x5625+0+79 +repage -define jpeg:extent=10MB $out/carinanebula3.jpeg
              magick ''${sources[1]} -crop 6716x3778+329+80 +repage -define jpeg:extent=10MB $out/pillarsofcreation_composite.jpeg
              magick ''${sources[2]} -crop 10000x5625+0+79 +repage -define jpeg:extent=10MB $out/weic2212a.jpeg
              magick ''${sources[3]} -crop 7650x4302+1166+389 +repage -define jpeg:extent=10MB $out/weic2415a.jpeg
              magick ''${sources[4]} -crop 8732x4912+0+434 +repage -define jpeg:extent=10MB $out/weic2330a.jpeg
              magick ''${sources[5]} -crop 5302x2982+636+0 +repage -define jpeg:extent=10MB $out/weic2426a.jpeg
              magick ''${sources[6]} -crop 4328x2434+0+906 +repage -define jpeg:extent=10MB $out/weic2503a.jpeg
              magick ''${sources[7]} -crop 4152x2335+0+666 +repage -define jpeg:extent=10MB $out/weic2506a.jpeg
              magick ''${sources[8]} -crop 4320x2430+0+0 +repage -define jpeg:extent=10MB $out/weic2514a.jpeg
              magick ''${sources[9]} -crop 5863x3298+0+477 +repage -define jpeg:extent=10MB $out/weic2425c.jpeg

              runHook postBuild
            '';
          });
        };
      };
    };
    systemd.user.services.quickshell = {
      Service = {
        Environment = "QML_IMPORT_PATH=${pkgs.qt6Packages.callPackage ./quickshell-plugins {}}/${pkgs.qt6.qtbase.qtQmlPrefix}";
      };
    };
  };
}