From d690ef44d168f330cf8577831fe9b855fc73fe08 Mon Sep 17 00:00:00 2001 From: id3v1669 Date: Wed, 18 Sep 2024 19:26:51 +0800 Subject: [PATCH] update Install.md --- INSTALL.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index e0e1769..8ad76b2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,6 +2,52 @@ We have packaged `swhkd-git`. `swhkd-bin` has been packaged separately by a user of swhkd. +## NixOS + +For now flake users only. + +This repo contains a NixOS Module for swhkd service. +To enable module add an input first and import to modules: +```nix +{ + inputs = { + swhkd.url = "github:id3v1669/swhkd"; + } + + outputs = {nixpkgs, swhkd, ...} @ inputs: { + nixosConfigurations.HOSTNAME = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + ./configuration.nix + swhkd.nixosModules.default + ]; + }; + } +} +``` +After importing you should be able to use it in your configuration.nix file: +```nix +{ inputs +, ... +}: +{ + services.swhkd = { + enable = true; + package = inputs.swhkd.packages.${system}.default; + cooldown = 300; + settings = '' +super + return + alacritty + ''; + }; +} +``` +* Do not forget to start/add to autostart swhkd of your system after login. +* Replace HOSTNAME with your oun + +ps. this module will be updated after refactor of security model, but +it is already good enough to use + # Building: `swhkd` and `swhks` install to `/usr/local/bin/` by default. You can change this behaviour by editing the [Makefile](../Makefile) variable, `DESTDIR`, which acts as a prefix for all installed files. You can also specify it in the make command line, e.g. to install everything in `subdir`: `make DESTDIR="subdir" install`.