-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor pass-secret-service configuration
- Loading branch information
1 parent
4a02faf
commit e489d42
Showing
2 changed files
with
64 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,6 @@ | |
# }; | ||
|
||
# } | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,64 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: | ||
# { | ||
# config, | ||
# lib, | ||
# pkgs, | ||
# ... | ||
# }: | ||
|
||
# with lib; | ||
|
||
# let | ||
# cfg = config.services.pass-secret-service; | ||
# in | ||
# { | ||
# disabledModules = [ "services/pass-secret-service.nix" ]; | ||
|
||
# meta.maintainers = with maintainers; [ cab404 cyntheticfox ]; | ||
|
||
# options.services.pass-secret-service = { | ||
# enable = mkEnableOption "Pass libsecret service"; | ||
|
||
# package = mkPackageOption pkgs "pass-secret-service" { }; | ||
|
||
with lib; | ||
# storePath = mkOption { | ||
# type = with types; nullOr str; | ||
# default = null; | ||
# defaultText = "~/.password-store"; | ||
# example = "/home/user/.local/share/password-store"; | ||
# description = "Absolute path to password store."; | ||
# }; | ||
|
||
let | ||
cfg = config.services.pass-secret-service; | ||
in | ||
# extraArgs = lib.mkOption { | ||
# type = with lib.types; listOf str; | ||
# default = [ ]; | ||
# description = "Extra command-line arguments to be passed to the service."; | ||
# }; | ||
# }; | ||
|
||
# config = mkIf cfg.enable { | ||
# assertions = [ | ||
# (hm.assertions.assertPlatform "services.pass-secret-service" pkgs | ||
# platforms.linux) | ||
# ]; | ||
|
||
# services.pass-secret-service.extraArgs = optional (cfg.storePath != null) "--path=${cfg.storePath}"; | ||
|
||
# systemd.user.services.pass-secret-service = { | ||
# Unit = { | ||
# AssertFileIsExecutable = "${cfg.package}/bin/pass_secret_service"; | ||
# Description = "Pass libsecret service"; | ||
# Documentation = "https://github.com/mdellweg/pass_secret_service"; | ||
# PartOf = [ "default.target" ]; | ||
# }; | ||
|
||
# Service = { | ||
# ExecStart = "${cfg.package}/bin/pass_secret_service ${lib.escapeShellArgs cfg.extraArgs}"; | ||
# }; | ||
|
||
# Install = { WantedBy = [ "default.target" ]; }; | ||
# }; | ||
# }; | ||
# } | ||
{ | ||
disabledModules = [ "services/pass-secret-service.nix" ]; | ||
|
||
meta.maintainers = with maintainers; [ cab404 cyntheticfox ]; | ||
|
||
options.services.pass-secret-service = { | ||
enable = mkEnableOption "Pass libsecret service"; | ||
|
||
package = mkPackageOption pkgs "pass-secret-service" { }; | ||
|
||
storePath = mkOption { | ||
type = with types; nullOr str; | ||
default = null; | ||
defaultText = "~/.password-store"; | ||
example = "/home/user/.local/share/password-store"; | ||
description = "Absolute path to password store."; | ||
}; | ||
|
||
extraArgs = lib.mkOption { | ||
type = with lib.types; listOf str; | ||
default = [ ]; | ||
description = "Extra command-line arguments to be passed to the service."; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
assertions = [ | ||
(hm.assertions.assertPlatform "services.pass-secret-service" pkgs | ||
platforms.linux) | ||
]; | ||
|
||
services.pass-secret-service.extraArgs = optional (cfg.storePath != null) "--path=${cfg.storePath}"; | ||
|
||
systemd.user.services.pass-secret-service = { | ||
Unit = { | ||
AssertFileIsExecutable = "${cfg.package}/bin/pass_secret_service"; | ||
Description = "Pass libsecret service"; | ||
Documentation = "https://github.com/mdellweg/pass_secret_service"; | ||
PartOf = [ "default.target" ]; | ||
}; | ||
|
||
Service = { | ||
ExecStart = "${cfg.package}/bin/pass_secret_service ${lib.escapeShellArgs cfg.extraArgs}"; | ||
}; | ||
|
||
Install = { WantedBy = [ "default.target" ]; }; | ||
}; | ||
}; | ||
} | ||
|
||
} |