Manage your wallpapers within a hashed store.
- Go 1.24+
If you use Nix, it's recommended to enable flakes.
To build/install the project you can use Go.
For persistent installation, run:
# if you haven't cloned the repo
go install github.com/shimeoki/wp
# if you are in the root of the repository
go install .For non-persistent usage, you can do this if you have cloned the repository:
# to get the binary 'wp' in the working directory
go build .
# to run it directly
go run .The flake exposes both an application and a package.
To run it once:
# without cloning manually
nix run github:shimeoki/wp
# if you are in the repo directory
nix run .To enter the shell (use multiple times):
# without cloning manually
nix shell github:shimeoki/wp
# if you are in the repo directory
nix shell .For persistent configuration, add the flake to the input and add the exposed
package to your home.packages
(home-manager) or
environment.systemPackages (system-wide):
# flake.nix
{
inputs = {
wp = {
url = "github:shimeoki/wp";
inputs = {
nixpkgs.follows = "nixpkgs";
# follow systems and flake-parts if present
};
};
};
}# then expose inputs to your modules and import it in a module like this:
{ inputs, pkgs, ... }:
{
home.packages = [
inputs.wp.packages.${pkgs.system}.default
];
}The app uses DDD as the core pattern. The layers are as follows:
domain- defines the rich entities, values and repositories. Domain entities use unconditional ID (UUID) generation and have validation.app- defines the actions to interact with the domain through DTOs to fully isolate domain layer from the infrastructure. The actions use UoW in the form of workers and providers. There are no services and commands are fully separated from each other.infra- defines the implementation for the domain repositories and other machine-specific environment.config- defines the configuration and uses it to create the "application" to give the action handlers for other layers (likecli). Usually called "composition root".cli- defines the commands to use the project from the terminal. Many Go projects define this incmd.
Aside from the required Go, it's recommended to install SQLite to interact with the DB. Also, if you are familiar with Nushell, it's also recommended, because Nushell can interact with the SQLite databases directly.
To format the code, install treefmt and corresponding formatters:
- deno (json, markdown)
- golines (go)
- keep-sorted
- nixfmt (nix)
They are all optional - you can install only for the languages you interacted with in the repository.
Run the formatter in the cloned repository with:
treefmt --allow-missing-formatterThe flake exposes a devshell with Nushell, Go and SQLite. To use it, clone the repository, go to the directory and enter the shell:
nix developTo format the code, the flake uses treefmt-nix. So, before a commit or a PR run:
nix fmtThe package is exposed, so if you need to build the project, you can use either
go build directly from the devshell or use Nix to build:
nix build .