my nixos configuration
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

clean od screenshot utils

Thunder ab61ee3a 5a6d6a95

-1204
-6
pkgs/screenshot/Setup.hs
··· 1 - module Main (main) where 2 - 3 - import Distribution.Simple 4 - 5 - main :: IO () 6 - main = defaultMain
-29
pkgs/screenshot/default.nix
··· 1 - { 2 - stdenvNoCC, 3 - lib, 4 - haskellPackages, 5 - makeWrapper, 6 - tofi, 7 - wl-clipboard, 8 - grim, 9 - slurp, 10 - }: 11 - stdenvNoCC.mkDerivation { 12 - name = "screenshot"; 13 - src = null; 14 - unpackPhase = "true"; 15 - 16 - nativeBuildInputs = [makeWrapper]; 17 - 18 - buildPhase = ""; 19 - 20 - installPhase = let 21 - pkg = haskellPackages.developPackage { 22 - root = ./.; 23 - }; 24 - in '' 25 - mkdir -p $out/bin 26 - makeWrapper ${pkg}/bin/screenshot $out/bin/screenshot \ 27 - --prefix PATH : ${lib.makeBinPath [tofi wl-clipboard grim slurp]} 28 - ''; 29 - }
-707
pkgs/screenshot/flake.lock
··· 1 - { 2 - "nodes": { 3 - "HTTP": { 4 - "flake": false, 5 - "locked": { 6 - "lastModified": 1451647621, 7 - "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", 8 - "owner": "phadej", 9 - "repo": "HTTP", 10 - "rev": "9bc0996d412fef1787449d841277ef663ad9a915", 11 - "type": "github" 12 - }, 13 - "original": { 14 - "owner": "phadej", 15 - "repo": "HTTP", 16 - "type": "github" 17 - } 18 - }, 19 - "cabal-32": { 20 - "flake": false, 21 - "locked": { 22 - "lastModified": 1603716527, 23 - "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=", 24 - "owner": "haskell", 25 - "repo": "cabal", 26 - "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee", 27 - "type": "github" 28 - }, 29 - "original": { 30 - "owner": "haskell", 31 - "ref": "3.2", 32 - "repo": "cabal", 33 - "type": "github" 34 - } 35 - }, 36 - "cabal-34": { 37 - "flake": false, 38 - "locked": { 39 - "lastModified": 1645834128, 40 - "narHash": "sha256-wG3d+dOt14z8+ydz4SL7pwGfe7SiimxcD/LOuPCV6xM=", 41 - "owner": "haskell", 42 - "repo": "cabal", 43 - "rev": "5ff598c67f53f7c4f48e31d722ba37172230c462", 44 - "type": "github" 45 - }, 46 - "original": { 47 - "owner": "haskell", 48 - "ref": "3.4", 49 - "repo": "cabal", 50 - "type": "github" 51 - } 52 - }, 53 - "cabal-36": { 54 - "flake": false, 55 - "locked": { 56 - "lastModified": 1669081697, 57 - "narHash": "sha256-I5or+V7LZvMxfbYgZATU4awzkicBwwok4mVoje+sGmU=", 58 - "owner": "haskell", 59 - "repo": "cabal", 60 - "rev": "8fd619e33d34924a94e691c5fea2c42f0fc7f144", 61 - "type": "github" 62 - }, 63 - "original": { 64 - "owner": "haskell", 65 - "ref": "3.6", 66 - "repo": "cabal", 67 - "type": "github" 68 - } 69 - }, 70 - "cardano-shell": { 71 - "flake": false, 72 - "locked": { 73 - "lastModified": 1608537748, 74 - "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", 75 - "owner": "input-output-hk", 76 - "repo": "cardano-shell", 77 - "rev": "9392c75087cb9a3d453998f4230930dea3a95725", 78 - "type": "github" 79 - }, 80 - "original": { 81 - "owner": "input-output-hk", 82 - "repo": "cardano-shell", 83 - "type": "github" 84 - } 85 - }, 86 - "flake-compat": { 87 - "flake": false, 88 - "locked": { 89 - "lastModified": 1672831974, 90 - "narHash": "sha256-z9k3MfslLjWQfnjBtEtJZdq3H7kyi2kQtUThfTgdRk0=", 91 - "owner": "input-output-hk", 92 - "repo": "flake-compat", 93 - "rev": "45f2638735f8cdc40fe302742b79f248d23eb368", 94 - "type": "github" 95 - }, 96 - "original": { 97 - "owner": "input-output-hk", 98 - "ref": "hkm/gitlab-fix", 99 - "repo": "flake-compat", 100 - "type": "github" 101 - } 102 - }, 103 - "flake-utils": { 104 - "inputs": { 105 - "systems": "systems" 106 - }, 107 - "locked": { 108 - "lastModified": 1726560853, 109 - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", 110 - "owner": "numtide", 111 - "repo": "flake-utils", 112 - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", 113 - "type": "github" 114 - }, 115 - "original": { 116 - "owner": "numtide", 117 - "repo": "flake-utils", 118 - "type": "github" 119 - } 120 - }, 121 - "ghc-8.6.5-iohk": { 122 - "flake": false, 123 - "locked": { 124 - "lastModified": 1600920045, 125 - "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", 126 - "owner": "input-output-hk", 127 - "repo": "ghc", 128 - "rev": "95713a6ecce4551240da7c96b6176f980af75cae", 129 - "type": "github" 130 - }, 131 - "original": { 132 - "owner": "input-output-hk", 133 - "ref": "release/8.6.5-iohk", 134 - "repo": "ghc", 135 - "type": "github" 136 - } 137 - }, 138 - "hackage": { 139 - "flake": false, 140 - "locked": { 141 - "lastModified": 1728606474, 142 - "narHash": "sha256-w4W3gBIUvtDo4nzBk/nrr0BtYknuzIzYemvK7oMDirA=", 143 - "owner": "input-output-hk", 144 - "repo": "hackage.nix", 145 - "rev": "552c4934bab949dfca917f3b30d215bc2038a665", 146 - "type": "github" 147 - }, 148 - "original": { 149 - "owner": "input-output-hk", 150 - "repo": "hackage.nix", 151 - "type": "github" 152 - } 153 - }, 154 - "haskellNix": { 155 - "inputs": { 156 - "HTTP": "HTTP", 157 - "cabal-32": "cabal-32", 158 - "cabal-34": "cabal-34", 159 - "cabal-36": "cabal-36", 160 - "cardano-shell": "cardano-shell", 161 - "flake-compat": "flake-compat", 162 - "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", 163 - "hackage": "hackage", 164 - "hls-1.10": "hls-1.10", 165 - "hls-2.0": "hls-2.0", 166 - "hls-2.2": "hls-2.2", 167 - "hls-2.3": "hls-2.3", 168 - "hls-2.4": "hls-2.4", 169 - "hls-2.5": "hls-2.5", 170 - "hls-2.6": "hls-2.6", 171 - "hls-2.7": "hls-2.7", 172 - "hls-2.8": "hls-2.8", 173 - "hls-2.9": "hls-2.9", 174 - "hpc-coveralls": "hpc-coveralls", 175 - "hydra": "hydra", 176 - "iserv-proxy": "iserv-proxy", 177 - "nixpkgs": [ 178 - "haskellNix", 179 - "nixpkgs-unstable" 180 - ], 181 - "nixpkgs-2003": "nixpkgs-2003", 182 - "nixpkgs-2105": "nixpkgs-2105", 183 - "nixpkgs-2111": "nixpkgs-2111", 184 - "nixpkgs-2205": "nixpkgs-2205", 185 - "nixpkgs-2211": "nixpkgs-2211", 186 - "nixpkgs-2305": "nixpkgs-2305", 187 - "nixpkgs-2311": "nixpkgs-2311", 188 - "nixpkgs-2405": "nixpkgs-2405", 189 - "nixpkgs-unstable": "nixpkgs-unstable", 190 - "old-ghc-nix": "old-ghc-nix", 191 - "stackage": "stackage" 192 - }, 193 - "locked": { 194 - "lastModified": 1728607853, 195 - "narHash": "sha256-0E+Mana2cucC7XxEdF0MdqUNB+gmu1MmXObeywkYljw=", 196 - "owner": "input-output-hk", 197 - "repo": "haskell.nix", 198 - "rev": "8437c1d93e2e981402f32112a88372270b3d9194", 199 - "type": "github" 200 - }, 201 - "original": { 202 - "owner": "input-output-hk", 203 - "repo": "haskell.nix", 204 - "type": "github" 205 - } 206 - }, 207 - "hls-1.10": { 208 - "flake": false, 209 - "locked": { 210 - "lastModified": 1680000865, 211 - "narHash": "sha256-rc7iiUAcrHxwRM/s0ErEsSPxOR3u8t7DvFeWlMycWgo=", 212 - "owner": "haskell", 213 - "repo": "haskell-language-server", 214 - "rev": "b08691db779f7a35ff322b71e72a12f6e3376fd9", 215 - "type": "github" 216 - }, 217 - "original": { 218 - "owner": "haskell", 219 - "ref": "1.10.0.0", 220 - "repo": "haskell-language-server", 221 - "type": "github" 222 - } 223 - }, 224 - "hls-2.0": { 225 - "flake": false, 226 - "locked": { 227 - "lastModified": 1687698105, 228 - "narHash": "sha256-OHXlgRzs/kuJH8q7Sxh507H+0Rb8b7VOiPAjcY9sM1k=", 229 - "owner": "haskell", 230 - "repo": "haskell-language-server", 231 - "rev": "783905f211ac63edf982dd1889c671653327e441", 232 - "type": "github" 233 - }, 234 - "original": { 235 - "owner": "haskell", 236 - "ref": "2.0.0.1", 237 - "repo": "haskell-language-server", 238 - "type": "github" 239 - } 240 - }, 241 - "hls-2.2": { 242 - "flake": false, 243 - "locked": { 244 - "lastModified": 1693064058, 245 - "narHash": "sha256-8DGIyz5GjuCFmohY6Fa79hHA/p1iIqubfJUTGQElbNk=", 246 - "owner": "haskell", 247 - "repo": "haskell-language-server", 248 - "rev": "b30f4b6cf5822f3112c35d14a0cba51f3fe23b85", 249 - "type": "github" 250 - }, 251 - "original": { 252 - "owner": "haskell", 253 - "ref": "2.2.0.0", 254 - "repo": "haskell-language-server", 255 - "type": "github" 256 - } 257 - }, 258 - "hls-2.3": { 259 - "flake": false, 260 - "locked": { 261 - "lastModified": 1695910642, 262 - "narHash": "sha256-tR58doOs3DncFehHwCLczJgntyG/zlsSd7DgDgMPOkI=", 263 - "owner": "haskell", 264 - "repo": "haskell-language-server", 265 - "rev": "458ccdb55c9ea22cd5d13ec3051aaefb295321be", 266 - "type": "github" 267 - }, 268 - "original": { 269 - "owner": "haskell", 270 - "ref": "2.3.0.0", 271 - "repo": "haskell-language-server", 272 - "type": "github" 273 - } 274 - }, 275 - "hls-2.4": { 276 - "flake": false, 277 - "locked": { 278 - "lastModified": 1699862708, 279 - "narHash": "sha256-YHXSkdz53zd0fYGIYOgLt6HrA0eaRJi9mXVqDgmvrjk=", 280 - "owner": "haskell", 281 - "repo": "haskell-language-server", 282 - "rev": "54507ef7e85fa8e9d0eb9a669832a3287ffccd57", 283 - "type": "github" 284 - }, 285 - "original": { 286 - "owner": "haskell", 287 - "ref": "2.4.0.1", 288 - "repo": "haskell-language-server", 289 - "type": "github" 290 - } 291 - }, 292 - "hls-2.5": { 293 - "flake": false, 294 - "locked": { 295 - "lastModified": 1701080174, 296 - "narHash": "sha256-fyiR9TaHGJIIR0UmcCb73Xv9TJq3ht2ioxQ2mT7kVdc=", 297 - "owner": "haskell", 298 - "repo": "haskell-language-server", 299 - "rev": "27f8c3d3892e38edaef5bea3870161815c4d014c", 300 - "type": "github" 301 - }, 302 - "original": { 303 - "owner": "haskell", 304 - "ref": "2.5.0.0", 305 - "repo": "haskell-language-server", 306 - "type": "github" 307 - } 308 - }, 309 - "hls-2.6": { 310 - "flake": false, 311 - "locked": { 312 - "lastModified": 1705325287, 313 - "narHash": "sha256-+P87oLdlPyMw8Mgoul7HMWdEvWP/fNlo8jyNtwME8E8=", 314 - "owner": "haskell", 315 - "repo": "haskell-language-server", 316 - "rev": "6e0b342fa0327e628610f2711f8c3e4eaaa08b1e", 317 - "type": "github" 318 - }, 319 - "original": { 320 - "owner": "haskell", 321 - "ref": "2.6.0.0", 322 - "repo": "haskell-language-server", 323 - "type": "github" 324 - } 325 - }, 326 - "hls-2.7": { 327 - "flake": false, 328 - "locked": { 329 - "lastModified": 1708965829, 330 - "narHash": "sha256-LfJ+TBcBFq/XKoiNI7pc4VoHg4WmuzsFxYJ3Fu+Jf+M=", 331 - "owner": "haskell", 332 - "repo": "haskell-language-server", 333 - "rev": "50322b0a4aefb27adc5ec42f5055aaa8f8e38001", 334 - "type": "github" 335 - }, 336 - "original": { 337 - "owner": "haskell", 338 - "ref": "2.7.0.0", 339 - "repo": "haskell-language-server", 340 - "type": "github" 341 - } 342 - }, 343 - "hls-2.8": { 344 - "flake": false, 345 - "locked": { 346 - "lastModified": 1715153580, 347 - "narHash": "sha256-Vi/iUt2pWyUJlo9VrYgTcbRviWE0cFO6rmGi9rmALw0=", 348 - "owner": "haskell", 349 - "repo": "haskell-language-server", 350 - "rev": "dd1be1beb16700de59e0d6801957290bcf956a0a", 351 - "type": "github" 352 - }, 353 - "original": { 354 - "owner": "haskell", 355 - "ref": "2.8.0.0", 356 - "repo": "haskell-language-server", 357 - "type": "github" 358 - } 359 - }, 360 - "hls-2.9": { 361 - "flake": false, 362 - "locked": { 363 - "lastModified": 1720003792, 364 - "narHash": "sha256-qnDx8Pk0UxtoPr7BimEsAZh9g2WuTuMB/kGqnmdryKs=", 365 - "owner": "haskell", 366 - "repo": "haskell-language-server", 367 - "rev": "0c1817cb2babef0765e4e72dd297c013e8e3d12b", 368 - "type": "github" 369 - }, 370 - "original": { 371 - "owner": "haskell", 372 - "ref": "2.9.0.1", 373 - "repo": "haskell-language-server", 374 - "type": "github" 375 - } 376 - }, 377 - "hpc-coveralls": { 378 - "flake": false, 379 - "locked": { 380 - "lastModified": 1607498076, 381 - "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", 382 - "owner": "sevanspowell", 383 - "repo": "hpc-coveralls", 384 - "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", 385 - "type": "github" 386 - }, 387 - "original": { 388 - "owner": "sevanspowell", 389 - "repo": "hpc-coveralls", 390 - "type": "github" 391 - } 392 - }, 393 - "hydra": { 394 - "inputs": { 395 - "nix": "nix", 396 - "nixpkgs": [ 397 - "haskellNix", 398 - "hydra", 399 - "nix", 400 - "nixpkgs" 401 - ] 402 - }, 403 - "locked": { 404 - "lastModified": 1671755331, 405 - "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", 406 - "owner": "NixOS", 407 - "repo": "hydra", 408 - "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", 409 - "type": "github" 410 - }, 411 - "original": { 412 - "id": "hydra", 413 - "type": "indirect" 414 - } 415 - }, 416 - "iserv-proxy": { 417 - "flake": false, 418 - "locked": { 419 - "lastModified": 1717479972, 420 - "narHash": "sha256-7vE3RQycHI1YT9LHJ1/fUaeln2vIpYm6Mmn8FTpYeVo=", 421 - "owner": "stable-haskell", 422 - "repo": "iserv-proxy", 423 - "rev": "2ed34002247213fc435d0062350b91bab920626e", 424 - "type": "github" 425 - }, 426 - "original": { 427 - "owner": "stable-haskell", 428 - "ref": "iserv-syms", 429 - "repo": "iserv-proxy", 430 - "type": "github" 431 - } 432 - }, 433 - "lowdown-src": { 434 - "flake": false, 435 - "locked": { 436 - "lastModified": 1633514407, 437 - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", 438 - "owner": "kristapsdz", 439 - "repo": "lowdown", 440 - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", 441 - "type": "github" 442 - }, 443 - "original": { 444 - "owner": "kristapsdz", 445 - "repo": "lowdown", 446 - "type": "github" 447 - } 448 - }, 449 - "nix": { 450 - "inputs": { 451 - "lowdown-src": "lowdown-src", 452 - "nixpkgs": "nixpkgs", 453 - "nixpkgs-regression": "nixpkgs-regression" 454 - }, 455 - "locked": { 456 - "lastModified": 1661606874, 457 - "narHash": "sha256-9+rpYzI+SmxJn+EbYxjGv68Ucp22bdFUSy/4LkHkkDQ=", 458 - "owner": "NixOS", 459 - "repo": "nix", 460 - "rev": "11e45768b34fdafdcf019ddbd337afa16127ff0f", 461 - "type": "github" 462 - }, 463 - "original": { 464 - "owner": "NixOS", 465 - "ref": "2.11.0", 466 - "repo": "nix", 467 - "type": "github" 468 - } 469 - }, 470 - "nixpkgs": { 471 - "locked": { 472 - "lastModified": 1657693803, 473 - "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", 474 - "owner": "NixOS", 475 - "repo": "nixpkgs", 476 - "rev": "365e1b3a859281cf11b94f87231adeabbdd878a2", 477 - "type": "github" 478 - }, 479 - "original": { 480 - "owner": "NixOS", 481 - "ref": "nixos-22.05-small", 482 - "repo": "nixpkgs", 483 - "type": "github" 484 - } 485 - }, 486 - "nixpkgs-2003": { 487 - "locked": { 488 - "lastModified": 1620055814, 489 - "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", 490 - "owner": "NixOS", 491 - "repo": "nixpkgs", 492 - "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", 493 - "type": "github" 494 - }, 495 - "original": { 496 - "owner": "NixOS", 497 - "ref": "nixpkgs-20.03-darwin", 498 - "repo": "nixpkgs", 499 - "type": "github" 500 - } 501 - }, 502 - "nixpkgs-2105": { 503 - "locked": { 504 - "lastModified": 1659914493, 505 - "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", 506 - "owner": "NixOS", 507 - "repo": "nixpkgs", 508 - "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", 509 - "type": "github" 510 - }, 511 - "original": { 512 - "owner": "NixOS", 513 - "ref": "nixpkgs-21.05-darwin", 514 - "repo": "nixpkgs", 515 - "type": "github" 516 - } 517 - }, 518 - "nixpkgs-2111": { 519 - "locked": { 520 - "lastModified": 1659446231, 521 - "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", 522 - "owner": "NixOS", 523 - "repo": "nixpkgs", 524 - "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", 525 - "type": "github" 526 - }, 527 - "original": { 528 - "owner": "NixOS", 529 - "ref": "nixpkgs-21.11-darwin", 530 - "repo": "nixpkgs", 531 - "type": "github" 532 - } 533 - }, 534 - "nixpkgs-2205": { 535 - "locked": { 536 - "lastModified": 1685573264, 537 - "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", 538 - "owner": "NixOS", 539 - "repo": "nixpkgs", 540 - "rev": "380be19fbd2d9079f677978361792cb25e8a3635", 541 - "type": "github" 542 - }, 543 - "original": { 544 - "owner": "NixOS", 545 - "ref": "nixpkgs-22.05-darwin", 546 - "repo": "nixpkgs", 547 - "type": "github" 548 - } 549 - }, 550 - "nixpkgs-2211": { 551 - "locked": { 552 - "lastModified": 1688392541, 553 - "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", 554 - "owner": "NixOS", 555 - "repo": "nixpkgs", 556 - "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", 557 - "type": "github" 558 - }, 559 - "original": { 560 - "owner": "NixOS", 561 - "ref": "nixpkgs-22.11-darwin", 562 - "repo": "nixpkgs", 563 - "type": "github" 564 - } 565 - }, 566 - "nixpkgs-2305": { 567 - "locked": { 568 - "lastModified": 1705033721, 569 - "narHash": "sha256-K5eJHmL1/kev6WuqyqqbS1cdNnSidIZ3jeqJ7GbrYnQ=", 570 - "owner": "NixOS", 571 - "repo": "nixpkgs", 572 - "rev": "a1982c92d8980a0114372973cbdfe0a307f1bdea", 573 - "type": "github" 574 - }, 575 - "original": { 576 - "owner": "NixOS", 577 - "ref": "nixpkgs-23.05-darwin", 578 - "repo": "nixpkgs", 579 - "type": "github" 580 - } 581 - }, 582 - "nixpkgs-2311": { 583 - "locked": { 584 - "lastModified": 1719957072, 585 - "narHash": "sha256-gvFhEf5nszouwLAkT9nWsDzocUTqLWHuL++dvNjMp9I=", 586 - "owner": "NixOS", 587 - "repo": "nixpkgs", 588 - "rev": "7144d6241f02d171d25fba3edeaf15e0f2592105", 589 - "type": "github" 590 - }, 591 - "original": { 592 - "owner": "NixOS", 593 - "ref": "nixpkgs-23.11-darwin", 594 - "repo": "nixpkgs", 595 - "type": "github" 596 - } 597 - }, 598 - "nixpkgs-2405": { 599 - "locked": { 600 - "lastModified": 1726447378, 601 - "narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", 602 - "owner": "NixOS", 603 - "repo": "nixpkgs", 604 - "rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", 605 - "type": "github" 606 - }, 607 - "original": { 608 - "owner": "NixOS", 609 - "ref": "nixpkgs-24.05-darwin", 610 - "repo": "nixpkgs", 611 - "type": "github" 612 - } 613 - }, 614 - "nixpkgs-regression": { 615 - "locked": { 616 - "lastModified": 1643052045, 617 - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", 618 - "owner": "NixOS", 619 - "repo": "nixpkgs", 620 - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", 621 - "type": "github" 622 - }, 623 - "original": { 624 - "owner": "NixOS", 625 - "repo": "nixpkgs", 626 - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", 627 - "type": "github" 628 - } 629 - }, 630 - "nixpkgs-unstable": { 631 - "locked": { 632 - "lastModified": 1726583932, 633 - "narHash": "sha256-zACxiQx8knB3F8+Ze+1BpiYrI+CbhxyWpcSID9kVhkQ=", 634 - "owner": "NixOS", 635 - "repo": "nixpkgs", 636 - "rev": "658e7223191d2598641d50ee4e898126768fe847", 637 - "type": "github" 638 - }, 639 - "original": { 640 - "owner": "NixOS", 641 - "ref": "nixpkgs-unstable", 642 - "repo": "nixpkgs", 643 - "type": "github" 644 - } 645 - }, 646 - "old-ghc-nix": { 647 - "flake": false, 648 - "locked": { 649 - "lastModified": 1631092763, 650 - "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", 651 - "owner": "angerman", 652 - "repo": "old-ghc-nix", 653 - "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", 654 - "type": "github" 655 - }, 656 - "original": { 657 - "owner": "angerman", 658 - "ref": "master", 659 - "repo": "old-ghc-nix", 660 - "type": "github" 661 - } 662 - }, 663 - "root": { 664 - "inputs": { 665 - "flake-utils": "flake-utils", 666 - "haskellNix": "haskellNix", 667 - "nixpkgs": [ 668 - "haskellNix", 669 - "nixpkgs-unstable" 670 - ] 671 - } 672 - }, 673 - "stackage": { 674 - "flake": false, 675 - "locked": { 676 - "lastModified": 1728605449, 677 - "narHash": "sha256-IpOun7VWUKSBAeth3sqItIWCd/SLdyCQQi4Ev1X77M0=", 678 - "owner": "input-output-hk", 679 - "repo": "stackage.nix", 680 - "rev": "fd7c5398bdfb2de97fad87ebc58362051b0d5313", 681 - "type": "github" 682 - }, 683 - "original": { 684 - "owner": "input-output-hk", 685 - "repo": "stackage.nix", 686 - "type": "github" 687 - } 688 - }, 689 - "systems": { 690 - "locked": { 691 - "lastModified": 1681028828, 692 - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 693 - "owner": "nix-systems", 694 - "repo": "default", 695 - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 696 - "type": "github" 697 - }, 698 - "original": { 699 - "owner": "nix-systems", 700 - "repo": "default", 701 - "type": "github" 702 - } 703 - } 704 - }, 705 - "root": "root", 706 - "version": 7 707 - }
-67
pkgs/screenshot/flake.nix
··· 1 - { 2 - # This is a template created by `hix init` 3 - inputs.haskellNix.url = "github:input-output-hk/haskell.nix"; 4 - inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable"; 5 - inputs.flake-utils.url = "github:numtide/flake-utils"; 6 - outputs = { 7 - self, 8 - nixpkgs, 9 - flake-utils, 10 - haskellNix, 11 - }: let 12 - supportedSystems = [ 13 - "x86_64-linux" 14 - "x86_64-darwin" 15 - "aarch64-linux" 16 - "aarch64-darwin" 17 - ]; 18 - in 19 - flake-utils.lib.eachSystem supportedSystems (system: let 20 - overlays = [ 21 - haskellNix.overlay 22 - (final: prev: { 23 - hixProject = final.haskell-nix.hix.project { 24 - src = ./.; 25 - evalSystem = "x86_64-linux"; 26 - }; 27 - }) 28 - ]; 29 - pkgs = import nixpkgs { 30 - inherit system overlays; 31 - inherit (haskellNix) config; 32 - }; 33 - flake = pkgs.hixProject.flake {}; 34 - in 35 - flake 36 - // { 37 - legacyPackages = pkgs; 38 - 39 - packages = 40 - flake.packages 41 - // { 42 - default = pkgs.stdenvNoCC.mkDerivation { 43 - name = "screenshot"; 44 - src = null; 45 - unpackPhase = "true"; 46 - 47 - nativeBuildInputs = with pkgs; [makeWrapper]; 48 - 49 - buildPhase = ""; 50 - 51 - installPhase = let 52 - pkg = flake.packages."screenshot:exe:screenshot"; 53 - in '' 54 - mkdir -p $out/bin 55 - makeWrapper ${pkg}/bin/screenshot $out/bin/screenshot \ 56 - --prefix PATH : ${pkgs.lib.makeBinPath (with pkgs; [tofi wl-clipboard grim slurp])} 57 - ''; 58 - }; 59 - }; 60 - }); 61 - 62 - nixConfig = { 63 - extra-substituters = ["https://cache.iog.io"]; 64 - extra-trusted-public-keys = ["hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="]; 65 - allow-import-from-derivation = "true"; 66 - }; 67 - }
-18
pkgs/screenshot/nix/hix.nix
··· 1 - {pkgs, ...}: { 2 - # name = "screenshot"; 3 - compiler-nix-name = "ghc928"; # Version of GHC to use 4 - 5 - crossPlatforms = p: 6 - pkgs.lib.optionals pkgs.stdenv.hostPlatform.isx86_64 ([ 7 - p.mingwW64 8 - # p.ghcjs # TODO GHCJS support for GHC 9.2 9 - ] 10 - ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [ 11 - p.musl64 12 - ]); 13 - 14 - # Tools to include in the development shell 15 - shell.tools.cabal = "latest"; 16 - # shell.tools.hlint = "latest"; 17 - # shell.tools.haskell-language-server = "latest"; 18 - }
-26
pkgs/screenshot/screenshot.cabal
··· 1 - 2 - -- Instructions on how to write this file are in the Cabal 3 - -- documentation, which can be found here: 4 - -- http://haskell.org/cabal/release/cabal-latest/doc/users-guide/ 5 - 6 - name: screenshot 7 - version: 1.0.0.2 8 - stability: stable 9 - synopsis: Screenshot tool for hyprland environments 10 - cabal-version: >= 1.6 11 - build-type: Simple 12 - 13 - flag threaded 14 - default: False 15 - 16 - executable screenshot 17 - hs-source-dirs: src 18 - main-is: Screenshot.hs 19 - build-depends: base >= 4.2 && < 5 20 - , process 21 - , filepath 22 - , time 23 - , bytestring 24 - 25 - if flag(threaded) 26 - ghc-options: -threaded
-21
pkgs/screenshot/src/CliArgs.hs
··· 1 - {-# LANGUAGE PatternGuards #-} 2 - module CliArgs (parseArgs) where 3 - 4 - import Options 5 - 6 - -- TODO: make the error messages good 7 - parseArg :: Options -> String -> Options 8 - parseArg opts "-c" 9 - | File _ <- save opts = error "Cannot use both clipboard and file." 10 - | otherwise = opts { save = Clipboard } 11 - parseArg opts "-f" 12 - | save opts == Clipboard = error "Cannot use both clipboard and file." 13 - | otherwise = opts { save = File Nothing } 14 - parseArg opts ('-':'f':'=':path) 15 - | save opts == Clipboard = error "Cannot use both clipboard and file." 16 - | otherwise = opts { save = File (Just path)} 17 - parseArg _ a = error $ "Invalid argument " ++ a 18 - 19 - parseArgs :: [String] -> Options 20 - parseArgs = 21 - foldl parseArg defaultOptions
-62
pkgs/screenshot/src/GetDir.hs
··· 1 - {-# LANGUAGE LambdaCase #-} 2 - module GetDir where 3 - 4 - import Data.List (isPrefixOf, intercalate) 5 - import Data.Maybe (mapMaybe) 6 - import System.Environment (lookupEnv) 7 - import System.FilePath ((</>)) 8 - 9 - xdgConfigHome :: IO (Maybe String) 10 - xdgConfigHome = do 11 - xdgConfigHome <- lookupEnv "XDG_CONFIG_HOME" 12 - case xdgConfigHome of 13 - Just e -> return (Just e) 14 - Nothing -> do 15 - home <- lookupEnv "HOME" 16 - case home of 17 - Just homePath -> return (Just (homePath </> "/.config/")) 18 - Nothing -> return Nothing 19 - 20 - xdgDirsFile :: IO (Maybe String) 21 - xdgDirsFile = do 22 - dotConfig <- xdgConfigHome 23 - case dotConfig of 24 - Just dir -> return (Just (dir </> "user-dirs.dirs")) 25 - Nothing -> return Nothing 26 - 27 - parseXdgDirs :: String -> [(String, String)] 28 - parseXdgDirs content = 29 - mapMaybe parseLine (lines content) 30 - where 31 - parseLine :: String -> Maybe (String, String) 32 - parseLine line = case break (=='=') line of 33 - (key, '=':value) -> Just (key, removeQuotes value) 34 - _ -> Nothing 35 - 36 - removeQuotes :: String -> String 37 - removeQuotes str 38 - | isPrefixOf "\"" str && isPrefixOf "\"" (reverse str) = init (tail str) 39 - | otherwise = str 40 - 41 - getPicturesDir :: IO (Maybe String) 42 - getPicturesDir = 43 - xdgDirsFile >>= \case 44 - Just f -> do 45 - cont <- readFile f 46 - let pictures = lookup "XDG_PICTURES_DIR" $ parseXdgDirs cont 47 - in case pictures of 48 - Just dir -> return (Just dir) 49 - Nothing -> assumedPicturesDir 50 - Nothing -> assumedPicturesDir 51 - where 52 - assumedPicturesDir :: IO (Maybe String) 53 - assumedPicturesDir = 54 - lookupEnv "HOME" >>= \case 55 - Just env -> return (Just (env </> "Pictures/")) 56 - Nothing -> return Nothing 57 - 58 - dir :: IO (Maybe String) 59 - dir = 60 - getPicturesDir >>= \case 61 - Just dir -> return (Just (dir </> "screenshots/")) 62 - Nothing -> return Nothing
-87
pkgs/screenshot/src/Grim.hs
··· 1 - {-# LANGUAGE LambdaCase #-} 2 - module Grim ( grimToClipboard 3 - , grimToFile 4 - , GrimError( Success 5 - , GrimFailed 6 - , WlCopyFailed 7 - , DirectoryFailed ) ) where 8 - 9 - import GHC.IO.Handle (Handle) 10 - 11 - import System.Process ( readProcess 12 - , ProcessHandle 13 - , createProcess 14 - , proc 15 - , std_in 16 - , std_out 17 - , std_err 18 - , StdStream ( CreatePipe 19 - , UseHandle) 20 - , waitForProcess ) 21 - 22 - import System.Exit ( ExitCode ( ExitSuccess 23 - , ExitFailure)) 24 - 25 - import System.IO ( openFile 26 - , IOMode ( WriteMode 27 - , ReadMode ) 28 - , hSetBinaryMode ) 29 - 30 - 31 - import qualified Data.ByteString as BS 32 - 33 - data GrimError = Success | GrimFailed | WlCopyFailed | DirectoryFailed 34 - deriving Show 35 - 36 - data Grim = GrimSuccess (Handle, ProcessHandle) | GrimFail 37 - 38 - getRegion :: IO String 39 - getRegion = do 40 - reg <- readProcess "slurp" ["-o"] "" 41 - return $ init reg 42 - 43 - grimStdout :: IO Grim 44 - grimStdout = do 45 - reg <- getRegion 46 - stdin <- openFile "/dev/null" ReadMode 47 - stderr <- openFile "/dev/null" WriteMode 48 - 49 - createProcess (proc "grim" ["-g", reg, "-"]) 50 - { std_out = CreatePipe 51 - , std_in = UseHandle stdin 52 - , std_err = UseHandle stderr 53 - } >>= \case 54 - (_, Just grimStdout, _, grimProc) -> do 55 - hSetBinaryMode grimStdout True 56 - return $ GrimSuccess (grimStdout, grimProc) 57 - _ -> return GrimFail 58 - 59 - grimToClipboard :: IO GrimError 60 - grimToClipboard = 61 - grimStdout >>= \case 62 - GrimSuccess (grimOut, grimProc) -> do 63 - stdout <- openFile "/dev/null" WriteMode 64 - stderr <- openFile "/dev/null" WriteMode 65 - createProcess (proc "wl-copy" ["-t", "image/png"]) 66 - { std_out = UseHandle stdout 67 - , std_in = UseHandle grimOut 68 - , std_err = UseHandle stderr 69 - } >>= \case 70 - (_, _, _, wlProc) -> do 71 - grimExitCode <- waitForProcess grimProc 72 - wlExitCode <- waitForProcess wlProc 73 - 74 - return $ case (grimExitCode, wlExitCode) of 75 - (ExitSuccess, ExitSuccess) -> Success 76 - _ -> WlCopyFailed 77 - 78 - GrimFail -> return GrimFailed 79 - 80 - grimToFile :: FilePath -> IO GrimError 81 - grimToFile file = do 82 - grimStdout >>= \case 83 - GrimSuccess (grimOut, grimProc) -> do 84 - contents <- BS.hGetContents grimOut 85 - BS.writeFile file contents 86 - return Success 87 - GrimFail -> return GrimFailed
-19
pkgs/screenshot/src/MenuArgs.hs
··· 1 - {-# LANGUAGE LambdaCase #-} 2 - module MenuArgs where 3 - 4 - import Options 5 - import Data.List (intercalate) 6 - import System.Process (readProcess) 7 - 8 - callTofi :: [String] -> IO String 9 - callTofi args = 10 - readProcess "tofi" [] (intercalate "\n" args) 11 - 12 - tofiToOpts :: IO Options 13 - tofiToOpts = 14 - callTofi ["clipboard" 15 - , "save" ] >>= \case 16 - "clipboard\n" -> return Options { save = Clipboard } 17 - "save\n" -> return Options { save = File Nothing } 18 - _ -> error "Error: nothing selected" 19 -
-19
pkgs/screenshot/src/Options.hs
··· 1 - module Options where 2 - 3 - data SaveMode = SaveModeNull | Clipboard | File (Maybe String) 4 - deriving (Eq, Show) 5 - 6 - data Options = Options 7 - { save :: SaveMode 8 - } deriving Show 9 - 10 - optionsSanityCheck :: Options -> Options 11 - optionsSanityCheck opts 12 - | save opts == SaveModeNull = 13 - error "Error: You must set a save mode and a selection mode." 14 - | otherwise = opts 15 - 16 - defaultOptions :: Options 17 - defaultOptions = Options 18 - { save = SaveModeNull 19 - }
-49
pkgs/screenshot/src/Screenshot.hs
··· 1 - {-# LANGUAGE LambdaCase #-} 2 - module Main (main) where 3 - 4 - import System.Environment (getArgs) 5 - 6 - import Options 7 - import GetDir (dir) 8 - import CliArgs (parseArgs) 9 - import MenuArgs (callTofi, tofiToOpts) 10 - import Grim ( grimToClipboard 11 - , grimToFile 12 - , GrimError ( Success 13 - , GrimFailed 14 - , WlCopyFailed 15 - , DirectoryFailed ) ) 16 - 17 - import Data.Function ((&)) 18 - import Data.Time ( getCurrentTime 19 - , formatTime 20 - , defaultTimeLocale ) 21 - 22 - import System.FilePath ((</>)) 23 - 24 - timeString :: IO String 25 - timeString = do 26 - formatTime defaultTimeLocale "%Y-%m-%d_%H-%M-%S" <$> getCurrentTime 27 - 28 - createFilePath :: IO (Maybe FilePath) 29 - createFilePath = do 30 - time <- timeString 31 - dir >>= \case 32 - Just d -> return $ Just (d </> (time ++ ".png")) 33 - Nothing -> return Nothing 34 - 35 - takeScreenshot :: Options -> IO GrimError 36 - takeScreenshot opts = 37 - case save opts of 38 - Clipboard -> grimToClipboard 39 - File (Just path) -> grimToFile path 40 - File Nothing -> createFilePath >>= \case 41 - Just p -> grimToFile p 42 - Nothing -> return DirectoryFailed 43 - 44 - main :: IO () 45 - main = do 46 - args <- getArgs 47 - case length args of 48 - 0 -> tofiToOpts >>= takeScreenshot >>= print 49 - _ -> parseArgs args & takeScreenshot >>= print
-94
pkgs/wl_screenshot.nix
··· 1 - { 2 - writeShellApplication, 3 - tofi, 4 - grim, 5 - slurp, 6 - swappy, 7 - hyprland, 8 - wl-clipboard, 9 - picturesDir ? "$HOME/Pictures", 10 - ... 11 - }: 12 - writeShellApplication { 13 - name = "wl_screenshot"; 14 - 15 - excludeShellChecks = ["SC1091"]; 16 - 17 - runtimeInputs = [ 18 - tofi 19 - grim 20 - slurp 21 - swappy 22 - hyprland 23 - wl-clipboard 24 - ]; 25 - 26 - # TODO rewrite good, maybe janet or haskell? also useless dep on hyprland when sway or etc is introduced 27 - text = '' 28 - #!/bin/sh 29 - . "$XDG_CONFIG_HOME/user-dirs.dirs" 30 - 31 - date="$(date +%Y-%m-%d_%H-%M-%S)" 32 - dir="${picturesDir}/screenshots" 33 - 34 - [ "$1" = "region" ] && { 35 - grim -g "$(slurp)" - | wl-copy -t image/png 36 - exit 0 37 - } 38 - 39 - [ ! -d "$dir" ] && mkdir --parents "$dir" 40 - 41 - choice=$(printf "region\nregion save\nregion with annotation\noutput\noutput save\noutput with annotation" | tofi) 42 - 43 - [ "$choice" = "region" ] && grim -g "$(slurp)" - | wl-copy -t image/png 44 - [ "$choice" = "region save" ] && grim -g "$(slurp)" -t png "$dir/$date.png" 45 - [ "$choice" = "region with annotation" ] && grim -g "$(slurp)" - | swappy -f - 46 - 47 - [ "$choice" = "output" ] && { 48 - grim -o "$(hyprctl monitors -j | jq '.[] | .name' | sed 's/"//g' | tofi)" - | wl-copy -t image/png 49 - } 50 - 51 - [ "$choice" = "output save" ] && { 52 - grim -o "$(hyprctl monitors -j | jq '.[] | .name' | sed 's/"//g' | tofi)" -t png "$dir/$date.png" 53 - } 54 - 55 - [ "$choice" = "output with annotation" ] && { 56 - grim -o "$(hyprctl monitors -j | jq '.[] | .name' | sed 's/"//g' | tofi)" - | swappy -f - 57 - } 58 - ''; 59 - } 60 - # screenshot = pkgs.writeShellApplication { 61 - # name = "screenshot"; 62 - # runtimeInputs = with pkgs; [tofi grim slurp swappy hyprland wl-clipboard]; 63 - # text = '' 64 - # dir = "${config.xdg.userDirs.pictures}/screenshots" 65 - # [ ! -d "$dir" ] && mkdir -p "$dir" 66 - # region=0 67 - # output=0 68 - # save=0 69 - # clipboard=0 70 - # annotate=0 71 - # file="" 72 - # exit_parent() { 73 - # echo "Error: $ERROR" > /dev/tty 74 - # exit 1 75 - # } 76 - # while getopts 'roascf:' OPTION; do 77 - # case "$OPTION" in 78 - # r) region=1 ;; 79 - # o) output=1 ;; 80 - # s) save=1 ;; 81 - # c) clipboard=1 ;; 82 - # a) annotate=1 ;; 83 - # f) file=$OPTARG ;; 84 - # esac 85 - # done 86 - # [ $region & $output ] && { ERROR="Cannot specify both region and output at the same time" trap exit_parent EXIT; } 87 - # [ $save & $clipboard ] && { ERROR="Cannot specify both save and clipboard at the same time" trap exit_parent EXIT; } 88 - # if [ $region & $clipboard ]; then 89 - # grim -g "$(slurp)" 90 - # elif 91 - # fi 92 - # ''; 93 - # }; 94 -