├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ ├── custom.md │ └── feature_request.md └── PULL_REQUEST_TEMPLATE.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── flake.lock ├── flake.nix └── modules └── home └── prism └── default.nix /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: iogamaster 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 12 | polar: # Replace with a single Polar username 13 | buy_me_a_coffee: # Replace with a single Buy Me a Coffee username 14 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: 'bug' 6 | assignees: '' 7 | --- 8 | 9 | ### Describe the bug 10 | A clear and concise description of what the bug is. 11 | 12 | ### Steps To Reproduce 13 | Steps to reproduce the behavior: 14 | 1. ... 15 | 2. ... 16 | 3. ... 17 | 18 | ### Expected behavior 19 | A clear and concise description of what you expected to happen. 20 | 21 | 22 | ### Environment 23 | 24 | Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result. 25 | ```console 26 | [user@system:~]$ nix-shell -p nix-info --run "nix-info -m" 27 | output here 28 | ``` 29 | 30 | --- 31 | 32 | #### Notify maintainers 33 | 34 | 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Other issue 4 | title: '' 5 | labels: '' 6 | assignees: IogaMaster 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Feature request" 3 | about: Suggest an idea for this project 4 | labels: 'enhancement' 5 | --- 6 | 7 | 12 | 13 | **Is your feature request related to a problem? Please describe.** 14 | Please describe the problem you are trying to solve. 15 | 16 | **Describe the solution you'd like** 17 | Please describe the desired behavior. 18 | 19 | **Describe alternatives you've considered (Optional)** 20 | 21 | Please describe alternative solutions or features you have considered. 22 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description of changes 2 | 3 | 4 | 5 | ## Relevant Issues 6 | 7 | 8 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to prism 2 | 3 | This document is mainly intended for people who want to contribute to prism. 4 | As a short reminder, this is generally what you would need to do: 5 | 6 | 1. Fork and clone the repository 7 | 2. Either stay on the `main` branch, or create a new branch for your feature `[feat|fix|...]/`. 8 | If you are working on multiple PRs at the same time, you should create new branches. 9 | 3. Run `nix develop`. You will be put into a shell with a pre-commit-hook that automatically 10 | checks and lints your changes before you push. 11 | 4. Read the chapter below and implement your changes 12 | 5. Once finished, create a commit, push your changes and submit a PR. 13 | 14 | ## Requirements for submitted changes 15 | 16 | If you want to submit a change, please make sure you have checked the following things: 17 | 18 | - All checks must pass. You can run them with `nix flake check`, which will also check formatting. 19 | - This repository follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) style. 20 | So each commit in your PR should contain only one logical change and the commit message 21 | should reflect that accordingly. 22 | 23 | Example: If your PR changes two builders, you should also have two commits: 24 | - `feat(builders/mkMinecraftServer): fix longstanding issue` 25 | - `feat(helpers/fetchSteam): speed up` 26 | 27 | Changes to builders should be scoped like `feat(builders/)`, 28 | same for `helpers/` and `modules/`. If a change 29 | doesn't fit any of these scopes, then just don't add a scope. 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice (including the next 11 | paragraph) shall be included in all copies or substantial portions of the 12 | Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 17 | OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 19 | OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

prism

2 | 3 |

4 | 5 |

6 | 21 | 22 |

23 |
24 | 25 | With prism you can recolor wallpapers at build time and place them in a home dir. 26 | 27 | - ⚙️ A module for recoloring wallpapers: 28 | - 🏭 Runs a command to recolor the wallpaper 29 | - 🫙 Uses home-manager to place them into ~/ 30 | 31 |
32 | 🖼️ Gallery 33 | 34 | | Original | Oxocarbon | Gruvbox Dark | 35 | |---|---|---| 36 | | ![space324dhsj](https://github.com/IogaMaster/prism/assets/67164465/293620a2-ee45-4d8f-b899-020fb67c2b6f) | ![image](https://github.com/IogaMaster/prism/assets/67164465/ea04e94b-c063-4d29-8e61-1743b92ecf14) | ![image](https://github.com/IogaMaster/prism/assets/67164465/2997db23-ba38-490f-a408-392783edbb2c) | 37 | | ![rose_pine_shape](https://github.com/IogaMaster/prism/assets/67164465/b4592096-7729-489c-97eb-dc91b2df8dde) | ![image](https://github.com/IogaMaster/prism/assets/67164465/019d149f-54f4-441e-999e-98c426ae1ca8) | ![image](https://github.com/IogaMaster/prism/assets/67164465/fbb3bbc2-e2fa-4f77-88b7-33974594f019) 38 | | ![spiral](https://github.com/IogaMaster/prism/assets/67164465/2d72c231-2bff-4f35-8d2a-320c210e120e) | ![image](https://github.com/IogaMaster/prism/assets/67164465/c2ad3db8-3cae-4a8d-bd96-a2eec92a0e36)| ![image](https://github.com/IogaMaster/prism/assets/67164465/ddaab71c-d30f-4ddb-8998-31ef661d163e) | 39 | 40 | 41 | 42 |
43 | 44 | #### Why? 45 | 46 | I have many wallpapers, finding ones I like that are in the colorscheme I am using is a pain. 47 | Recoloring them manually is also time consuming. So I made this module to do it for me. 48 | Hopefully it's useful to you as well! 49 | 50 | ## 📦 Installation and Usage 51 | 52 | Include in your flake 53 | ```nix 54 | inputs.prism.url = "github:IogaMaster/prism"; 55 | ``` 56 | 57 | Include the `prism.homeModules.prism` module the way you like. 58 | 59 | > \[!NOTE\]\ 60 | > If you add or remove an image from the wallpapers path, ALL wallpapers will be rebuilt. 61 | > 62 | > Depending on the number and resolution of wallpapers, switching to a new generation can take a long time. 63 | 64 | Here are all the colorschemes: 65 | https://github.com/ozwaldorf/lutgen-rs/blob/main/palettes/palettes.json 66 | 67 | To use `Gruvbox Dark` you need to specify `colorscheme = "gruvbox-dark";` 68 | 69 | Using the module: 70 | ```nix 71 | prism = { 72 | enable = true; 73 | wallpapers = ./wallpapers; # Path to the wallpapers directory in your config. (IMAGES ONLY) 74 | outPath = ".config/wallpapers"; # Where in your home directory to output to. 75 | 76 | # There are a few different ways of setting the colorscheme. 77 | 78 | # If you pass the name it will use a lutgen builtin scheme 79 | colorscheme = "catppuccin-mocha"; 80 | 81 | # If you pass a list of colors, it will build a scheme from them. 82 | # They are formatted like base16 schemes 83 | # colorscheme = [ "FFFFFF" "FAFAFA" ... ]; 84 | 85 | # You can also pass a nix-colors scheme attrset and it will parse the colors. 86 | # colorscheme = nix-colors.colorscheme.nord; 87 | }; 88 | ``` 89 | 90 | ## ❤️ Contributing 91 | 92 | Contributions are whole-heartedly welcome! Please feel free to suggest new features, 93 | implement additional builders, helpers, or generally assist if you'd like. We'd be happy to have you. 94 | There's more information in [CONTRIBUTING.md](CONTRIBUTING.md). 95 | 96 | ## 📜 License 97 | 98 | Licensed under the MIT license ([LICENSE](LICENSE) or ). 99 | Unless you explicitly state otherwise, any contribution intentionally 100 | submitted for inclusion in this project by you, shall be licensed as above, without any additional terms or conditions. 101 | 102 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-compat": { 4 | "flake": false, 5 | "locked": { 6 | "lastModified": 1650374568, 7 | "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", 8 | "owner": "edolstra", 9 | "repo": "flake-compat", 10 | "rev": "b4a34015c698c7793d592d66adbab377907a2be8", 11 | "type": "github" 12 | }, 13 | "original": { 14 | "owner": "edolstra", 15 | "repo": "flake-compat", 16 | "type": "github" 17 | } 18 | }, 19 | "flake-utils": { 20 | "inputs": { 21 | "systems": "systems" 22 | }, 23 | "locked": { 24 | "lastModified": 1694529238, 25 | "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", 26 | "owner": "numtide", 27 | "repo": "flake-utils", 28 | "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", 29 | "type": "github" 30 | }, 31 | "original": { 32 | "owner": "numtide", 33 | "repo": "flake-utils", 34 | "type": "github" 35 | } 36 | }, 37 | "flake-utils-plus": { 38 | "inputs": { 39 | "flake-utils": "flake-utils" 40 | }, 41 | "locked": { 42 | "lastModified": 1696331477, 43 | "narHash": "sha256-YkbRa/1wQWdWkVJ01JvV+75KIdM37UErqKgTf0L54Fk=", 44 | "owner": "gytis-ivaskevicius", 45 | "repo": "flake-utils-plus", 46 | "rev": "bfc53579db89de750b25b0c5e7af299e0c06d7d3", 47 | "type": "github" 48 | }, 49 | "original": { 50 | "owner": "gytis-ivaskevicius", 51 | "repo": "flake-utils-plus", 52 | "type": "github" 53 | } 54 | }, 55 | "home-manager": { 56 | "inputs": { 57 | "nixpkgs": [ 58 | "nixpkgs" 59 | ] 60 | }, 61 | "locked": { 62 | "lastModified": 1698162493, 63 | "narHash": "sha256-Zehw3cWiTXGGlDDjzTgIX1BhWG+049D/RcSMAiypAcM=", 64 | "owner": "nix-community", 65 | "repo": "home-manager", 66 | "rev": "14b54157201fd574b0fa1b3ce7394c9d3a87fbc1", 67 | "type": "github" 68 | }, 69 | "original": { 70 | "owner": "nix-community", 71 | "ref": "master", 72 | "repo": "home-manager", 73 | "type": "github" 74 | } 75 | }, 76 | "nixpkgs": { 77 | "locked": { 78 | "lastModified": 1697723726, 79 | "narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=", 80 | "owner": "nixos", 81 | "repo": "nixpkgs", 82 | "rev": "7c9cc5a6e5d38010801741ac830a3f8fd667a7a0", 83 | "type": "github" 84 | }, 85 | "original": { 86 | "owner": "nixos", 87 | "ref": "nixos-unstable", 88 | "repo": "nixpkgs", 89 | "type": "github" 90 | } 91 | }, 92 | "root": { 93 | "inputs": { 94 | "home-manager": "home-manager", 95 | "nixpkgs": "nixpkgs", 96 | "snowfall-lib": "snowfall-lib" 97 | } 98 | }, 99 | "snowfall-lib": { 100 | "inputs": { 101 | "flake-compat": "flake-compat", 102 | "flake-utils-plus": "flake-utils-plus", 103 | "nixpkgs": [ 104 | "nixpkgs" 105 | ] 106 | }, 107 | "locked": { 108 | "lastModified": 1696432959, 109 | "narHash": "sha256-oJQZv2MYyJaVyVJY5IeevzqpGvMGKu5pZcCCJvb+xjc=", 110 | "owner": "snowfallorg", 111 | "repo": "lib", 112 | "rev": "92803a029b5314d4436a8d9311d8707b71d9f0b6", 113 | "type": "github" 114 | }, 115 | "original": { 116 | "owner": "snowfallorg", 117 | "repo": "lib", 118 | "type": "github" 119 | } 120 | }, 121 | "systems": { 122 | "locked": { 123 | "lastModified": 1681028828, 124 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 125 | "owner": "nix-systems", 126 | "repo": "default", 127 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 128 | "type": "github" 129 | }, 130 | "original": { 131 | "owner": "nix-systems", 132 | "repo": "default", 133 | "type": "github" 134 | } 135 | } 136 | }, 137 | "root": "root", 138 | "version": 7 139 | } 140 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "My NixOS modules"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 6 | home-manager.url = "github:nix-community/home-manager/master"; 7 | home-manager.inputs.nixpkgs.follows = "nixpkgs"; 8 | 9 | snowfall-lib = { 10 | url = "github:snowfallorg/lib"; 11 | inputs.nixpkgs.follows = "nixpkgs"; 12 | }; 13 | }; 14 | 15 | outputs = inputs: 16 | inputs.snowfall-lib.mkFlake { 17 | inherit inputs; 18 | 19 | src = ./.; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /modules/home/prism/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | config, 4 | pkgs, 5 | ... 6 | }: let 7 | cfg = config.prism; 8 | in { 9 | options.prism = { 10 | enable = lib.mkEnableOption "Enable prism"; 11 | outPath = lib.mkOption { 12 | description = '' 13 | The directory the the wallpapers are outputted to. 14 | ''; 15 | type = lib.types.str; 16 | default = ".config/wallpapers/"; 17 | example = lib.literalExample '' 18 | .config/wallpapers/ 19 | ''; 20 | }; 21 | wallpapers = lib.mkOption { 22 | description = '' 23 | The directory the the wallpapers are stored in. 24 | ''; 25 | type = lib.types.path; 26 | default = ""; 27 | example = lib.literalExample '' 28 | ./wallpapers 29 | ''; 30 | }; 31 | colorscheme = lib.mkOption { 32 | description = '' 33 | The colorscheme to convert the wallpapers into. 34 | Can be a string like "catppuccin-mocha" or a list of strings containing each hex code to use. 35 | It also can be a colorscheme from nix-colors. 36 | ''; 37 | type = with lib.types; oneOf [str (listOf str) attrs]; 38 | default = ""; 39 | }; 40 | onChange = lib.mkOption { 41 | type = lib.types.lines; 42 | default = ""; 43 | description = '' 44 | Shell commands to run when wallpapers have changed between 45 | generations. The script will be run 46 | *after* the new files have been linked 47 | into place. 48 | ''; 49 | }; 50 | }; 51 | 52 | config = lib.mkIf cfg.enable { 53 | home.file."${cfg.outPath}" = { 54 | recursive = true; 55 | source = let 56 | scheme = 57 | if builtins.isAttrs cfg.colorscheme 58 | then lib.attrsets.attrValues cfg.colorscheme.palette 59 | else cfg.colorscheme; 60 | colors = 61 | # If colorscheme is a attrset, convert to a list. 62 | # Otherwise pass colorscheme. 63 | if builtins.isList scheme 64 | # This is really dumb but it's the only way i could think to do this. 65 | # If cfg.colorscheme is a list we separate it and wrap each one with ''. 66 | # We have to put the ' on the outside and then use `' '` to as a separator to make them individual strings. 67 | then "-- '${builtins.concatStringsSep "' '" scheme}'" 68 | else "-p ${scheme}"; 69 | in 70 | pkgs.runCommand "prism" {} '' 71 | mkdir $out 72 | for WALLPAPER in $(find ${cfg.wallpapers} -type f) 73 | do 74 | ${pkgs.lutgen}/bin/lutgen apply $WALLPAPER -o $out/$(basename $WALLPAPER) ${colors} 75 | done 76 | ''; 77 | inherit (cfg) onChange; 78 | }; 79 | }; 80 | } 81 | --------------------------------------------------------------------------------