Compare commits
9 commits
2b628fb0d6
...
ef4e5e3ccc
| Author | SHA1 | Date | |
|---|---|---|---|
| ef4e5e3ccc | |||
| 6be0ace3b0 | |||
| 17e7892a6e | |||
| 92b26e9d54 | |||
| 25143be03d | |||
| fc7e011d41 | |||
| 9245acf8ef | |||
| c4319e9c2f | |||
| ac618e999b |
21 changed files with 149 additions and 76 deletions
30
flake.lock
generated
30
flake.lock
generated
|
|
@ -11,11 +11,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1689334118,
|
||||
"narHash": "sha256-djk5AZv1yU84xlKFaVHqFWvH73U7kIRstXwUAnDJPsk=",
|
||||
"lastModified": 1690228878,
|
||||
"narHash": "sha256-9Xe7JV0krp4RJC9W9W9WutZVlw6BlHTFMiUP/k48LQY=",
|
||||
"owner": "ryantm",
|
||||
"repo": "agenix",
|
||||
"rev": "0d8c5325fc81daf00532e3e26c6752f7bcde1143",
|
||||
"rev": "d8c973fd228949736dedf61b7f8cc1ece3236792",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -131,11 +131,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1689891262,
|
||||
"narHash": "sha256-Pc4wDczbdgd6QXKJIXprgxe7L9AVDsoAkMnvm5vmpUU=",
|
||||
"lastModified": 1690476848,
|
||||
"narHash": "sha256-PSmzyuEbMxEn2uwwLYUN2l1psoJXb7jm/kfHD12Sq0k=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "ee5673246de0254186e469935909e821b8f4ec15",
|
||||
"rev": "8d243f7da13d6ee32f722a3f1afeced150b6d4da",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -147,11 +147,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1689850295,
|
||||
"narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=",
|
||||
"lastModified": 1690367991,
|
||||
"narHash": "sha256-2VwOn1l8y6+cu7zjNE8MgeGJNNz1eat1HwHrINeogFA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5df4d78d54f7a34e9ea1f84a22b4fd9baebc68d0",
|
||||
"rev": "c9cf0708f00fbe553319258e48ca89ff9a413703",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -163,11 +163,11 @@
|
|||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1689968828,
|
||||
"narHash": "sha256-5qA6R/cBeLsS09ZMRKzhJq74nOGWEgGYpjdbKXDnCow=",
|
||||
"lastModified": 1690541304,
|
||||
"narHash": "sha256-EypV1o52D9SdHWyH3Wf6RLdDiDnKIqqXiUROrtN2KyQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"rev": "876b9498f36a394fcf8472f62ecf6685585c0509",
|
||||
"rev": "03f02d6f7b5c284fe6ed12f86debb21429ca124c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -192,11 +192,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1689668210,
|
||||
"narHash": "sha256-XAATwDkaUxH958yXLs1lcEOmU6pSEIkatY3qjqk8X0E=",
|
||||
"lastModified": 1690464206,
|
||||
"narHash": "sha256-38V4kmOh6ikpfGiAS+Kt2H/TA2DubSqE66veP/jmB4Q=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "eb433bff05b285258be76513add6f6c57b441775",
|
||||
"rev": "9289996dcac62fd45836db7c07b87d2521eb526d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
27
home/bitwarden/default.nix
Normal file
27
home/bitwarden/default.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.bitwarden;
|
||||
in
|
||||
{
|
||||
options.my.home.bitwarden = with lib; {
|
||||
enable = my.mkDisableOption "bitwarden configuration";
|
||||
|
||||
pinentry = mkOption {
|
||||
type = types.str;
|
||||
default = "tty";
|
||||
example = "gtk2";
|
||||
description = "Which pinentry interface to use";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.rbw = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
email = lib.my.mkMailAddress "bruno" "belanyi.fr";
|
||||
inherit (cfg) pinentry;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
./aliases
|
||||
./atuin
|
||||
./bat
|
||||
./bitwarden
|
||||
./bluetooth
|
||||
./calibre
|
||||
./comma
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ let
|
|||
realName = lib.mkDefault "Bruno BELANYI";
|
||||
userName = lib.mkDefault (mkMailAddress address domain);
|
||||
passwordCommand =
|
||||
lib.mkDefault [ "${pkgs.ambroisie.bw-pass}/bin/bw-pass" "Mail" passName ];
|
||||
lib.mkDefault [ (lib.getExe pkgs.ambroisie.rbw-pass) "Mail" passName ];
|
||||
|
||||
address = mkMailAddress address domain;
|
||||
aliases = builtins.map (lib.flip mkMailAddress domain) aliases;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ in
|
|||
settings = {
|
||||
notify-cmd =
|
||||
let
|
||||
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||
notify-send = lib.getExe pkgs.libnotify;
|
||||
in
|
||||
pkgs.writeScript "mail-notifier" ''
|
||||
SENDER="$1"
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ in
|
|||
|
||||
command = mkOption {
|
||||
type = types.str;
|
||||
default = "${pkgs.i3lock}/bin/i3lock -n -c 000000";
|
||||
example = "\${pkgs.i3lock}/bin/i3lock -n -i lock.png";
|
||||
default = "${lib.getExe pkgs.i3lock} -n -c 000000";
|
||||
example = "\${lib.getExe pkgs.i3lock} -n -i lock.png";
|
||||
description = "Locker command to run";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@ let
|
|||
genMovementBindings = f: addVimKeyBindings (lib.my.genAttrs' movementKeys f);
|
||||
|
||||
# Used in multiple scripts to show messages through keybindings
|
||||
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||
notify-send = lib.getExe pkgs.libnotify;
|
||||
|
||||
# Screen backlight management
|
||||
changeBacklight = "${pkgs.ambroisie.change-backlight}/bin/change-backlight";
|
||||
changeBacklight = lib.getExe pkgs.ambroisie.change-backlight;
|
||||
|
||||
# Audio and volume management
|
||||
changeAudio = "${pkgs.ambroisie.change-audio}/bin/change-audio";
|
||||
changeAudio = lib.getExe pkgs.ambroisie.change-audio;
|
||||
|
||||
# Lock management
|
||||
toggleXautolock =
|
||||
|
|
@ -61,8 +61,8 @@ in
|
|||
ambroisie.dragger # drag-and-drop from the CLI
|
||||
ambroisie.i3-get-window-criteria # little helper for i3 configuration
|
||||
arandr # Used by a mapping
|
||||
pamixer # Used by a mapping
|
||||
playerctl # Used by a mapping
|
||||
xdotool # Used by 'rofi-rbw', in a mapping
|
||||
];
|
||||
|
||||
xsession.windowManager.i3 = {
|
||||
|
|
@ -189,6 +189,7 @@ in
|
|||
"${modifier}+d" = "exec rofi -show drun -disable-history";
|
||||
"${modifier}+Shift+d" = "exec rofi -show run -disable-history";
|
||||
"${modifier}+p" = "exec --no-startup-id flameshot gui";
|
||||
"${modifier}+Ctrl+p" = "exec ${lib.getExe pkgs.rofi-rbw}";
|
||||
"${modifier}+Shift+p" = "exec rofi -show emoji";
|
||||
"${modifier}+b" =
|
||||
let
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ let
|
|||
notficationCmd =
|
||||
let
|
||||
duration = toString (cfg.notify.delay * 1000);
|
||||
notifyCmd = "${pkgs.libnotify}/bin/notify-send -u critical -t ${duration}";
|
||||
notifyCmd = "${lib.getExe pkgs.libnotify} -u critical -t ${duration}";
|
||||
in
|
||||
# Needs to be surrounded by quotes for systemd to launch it correctly
|
||||
''"${notifyCmd} -- 'Locking in ${toString cfg.notify.delay} seconds'"'';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
my.home = {
|
||||
# Use graphical pinentry
|
||||
bitwarden.pinentry = "gtk2";
|
||||
# Ebook library
|
||||
calibre.enable = true;
|
||||
# Some amount of social life
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
let
|
||||
cfg = config.my.services.drone;
|
||||
hasRunner = (name: builtins.elem name cfg.runners);
|
||||
dockerPkg = pkgs.drone-runner-docker;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (cfg.enable && hasRunner "docker") {
|
||||
|
|
@ -25,7 +24,7 @@ in
|
|||
EnvironmentFile = [
|
||||
cfg.sharedSecretFile
|
||||
];
|
||||
ExecStart = "${dockerPkg}/bin/drone-runner-docker";
|
||||
ExecStart = lib.getExe pkgs.drone-runner-docker;
|
||||
User = "drone-runner-docker";
|
||||
Group = "drone-runner-docker";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
let
|
||||
cfg = config.my.services.drone;
|
||||
hasRunner = (name: builtins.elem name cfg.runners);
|
||||
execPkg = pkgs.drone-runner-exec;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (cfg.enable && hasRunner "exec") {
|
||||
|
|
@ -53,7 +52,7 @@ in
|
|||
EnvironmentFile = [
|
||||
cfg.sharedSecretFile
|
||||
];
|
||||
ExecStart = "${execPkg}/bin/drone-runner-exec";
|
||||
ExecStart = lib.getExe pkgs.drone-runner-exec;
|
||||
User = "drone-runner-exec";
|
||||
Group = "drone-runner-exec";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ in
|
|||
|
||||
serviceConfig = {
|
||||
ExecStart = lib.concatStringsSep " " [
|
||||
"${pkgs.flood}/bin/flood"
|
||||
(lib.getExe pkgs.flood)
|
||||
"--port ${builtins.toString cfg.port}"
|
||||
"--rundir /var/lib/${cfg.stateDir}"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ let
|
|||
cfg = config.my.services.lohr;
|
||||
settingsFormat = pkgs.formats.yaml { };
|
||||
|
||||
lohrPkg = pkgs.ambroisie.lohr;
|
||||
|
||||
lohrStateDirectory = "lohr";
|
||||
lohrHome = "/var/lib/lohr/";
|
||||
in
|
||||
|
|
@ -80,7 +78,7 @@ in
|
|||
let
|
||||
configFile = settingsFormat.generate "lohr-config.yaml" cfg.setting;
|
||||
in
|
||||
"${lohrPkg}/bin/lohr --config ${configFile}";
|
||||
"${lib.getExe pkgs.ambroisie.lohr} --config ${configFile}";
|
||||
StateDirectory = lohrStateDirectory;
|
||||
WorkingDirectory = lohrHome;
|
||||
User = "lohr";
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ in
|
|||
WorkingDirectory = "/var/lib/nginx-sso";
|
||||
# The files to be merged might not have the correct permissions
|
||||
ExecStartPre = ''+${pkgs.writeScript "merge-nginx-sso-config" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
#!${lib.getExe pkgs.bash}
|
||||
rm -f '${confPath}'
|
||||
${utils.genJqSecretsReplacementSnippet cfg.configuration confPath}
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ in
|
|||
''
|
||||
}'';
|
||||
ExecStart = lib.mkForce ''
|
||||
${pkg}/bin/nginx-sso \
|
||||
${lib.getExe pkg} \
|
||||
--config ${confPath} \
|
||||
--frontend-dir ${pkg}/share/frontend
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ in
|
|||
restartIfChanged = false;
|
||||
|
||||
path = with pkgs; [
|
||||
ambroisie.woodpecker-plugin-git
|
||||
woodpecker-plugin-git
|
||||
bash
|
||||
coreutils
|
||||
git
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ pkgs.lib.makeScope pkgs.newScope (pkgs: {
|
|||
|
||||
osc52 = pkgs.callPackage ./osc52 { };
|
||||
|
||||
rbw-pass = pkgs.callPackage ./rbw-pass { };
|
||||
|
||||
unbound-zones-adblock = pkgs.callPackage ./unbound-zones-adblock { };
|
||||
|
||||
unified-hosts-lists = pkgs.callPackage ./unified-hosts-lists { };
|
||||
|
|
@ -42,7 +44,5 @@ pkgs.lib.makeScope pkgs.newScope (pkgs: {
|
|||
|
||||
woodpecker-frontend = pkgs.callPackage ./woodpecker/frontend.nix { };
|
||||
|
||||
woodpecker-plugin-git = pkgs.callPackage ./woodpecker-plugin-git { };
|
||||
|
||||
woodpecker-server = pkgs.callPackage ./woodpecker/server.nix { };
|
||||
})
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ buildGoModule rec {
|
|||
vendorHash = null;
|
||||
|
||||
postPatch = ''
|
||||
sed -i -e 's,"mpv","${mpv}/bin/mpv",' ff2mpv.go
|
||||
sed -i -e 's,"mpv","${lib.getExe mpv}",' ff2mpv.go
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
|
|
|
|||
40
pkgs/rbw-pass/default.nix
Normal file
40
pkgs/rbw-pass/default.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ lib, coreutils, makeWrapper, rbw, rofi, stdenvNoCC }:
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "rbw-pass";
|
||||
version = "0.1.0";
|
||||
|
||||
src = ./rbw-pass;
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp $src $out/bin/${pname}
|
||||
chmod a+x $out/bin/${pname}
|
||||
'';
|
||||
|
||||
wrapperPath = lib.makeBinPath [
|
||||
rbw
|
||||
coreutils
|
||||
rofi
|
||||
];
|
||||
|
||||
fixupPhase = ''
|
||||
patchShebangs $out/bin/${pname}
|
||||
wrapProgram $out/bin/${pname} --prefix PATH : "${wrapperPath}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A simple script to query a password from rbw";
|
||||
homepage = "https://git.belanyi.fr/ambroisie/nix-config";
|
||||
license = with licenses; [ mit ];
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ ambroisie ];
|
||||
};
|
||||
}
|
||||
43
pkgs/rbw-pass/rbw-pass
Executable file
43
pkgs/rbw-pass/rbw-pass
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
usage() {
|
||||
printf '%s\n' "Usage: bw-pass [directory name] <account name>" >&2
|
||||
}
|
||||
|
||||
error_out() {
|
||||
printf '%s\n' "$1" >&2
|
||||
rofi -dmenu -no-fixed-num-lines -p "$1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
ensure_logged_in() {
|
||||
rbw login
|
||||
}
|
||||
|
||||
query_password() {
|
||||
# Either use with `query_password <directory> <account name>
|
||||
# Or `query_password <account name>` when the account has no directory
|
||||
|
||||
local FOLDER_ARGS=()
|
||||
local PASSWORD
|
||||
|
||||
# FIXME: no way to enforce filering by "no folder"
|
||||
if [ $# -eq 2 ]; then
|
||||
FOLDER_ARGS+=(--folder "$1")
|
||||
shift
|
||||
fi
|
||||
PASSWORD="$(rbw get "${FOLDER_ARGS[@]}" "$1")"
|
||||
|
||||
if [ -z "$PASSWORD" ]; then
|
||||
error_out "Did not find password for '$1'"
|
||||
fi
|
||||
printf '%s\n' "$PASSWORD"
|
||||
}
|
||||
|
||||
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ensure_logged_in
|
||||
query_password "$@"
|
||||
|
|
@ -10,7 +10,7 @@ stdenvNoCC.mkDerivation {
|
|||
installPhase =
|
||||
let
|
||||
gawkCmd = lib.concatStringsSep " " [
|
||||
''${gawk}/bin/awk''
|
||||
(lib.getExe gawk)
|
||||
'''{sub(/\r$/,"")}''
|
||||
''{sub(/^127\.0\.0\.1/,"0.0.0.0")}''
|
||||
''BEGIN { OFS = "" }''
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, fetchpatch }:
|
||||
buildGoModule rec {
|
||||
pname = "woodpecker-plugin-git";
|
||||
version = "2.0.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "woodpecker-ci";
|
||||
repo = "plugin-git";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-KU/A3V7KS8R1nAZoJJwkDc9C8y3t148kUzGnkeYtFjs=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-63Ly/9yIJu2K/DwOfGs9pYU3fokbs2senZkl3MJ1UIY=";
|
||||
|
||||
patches = [
|
||||
# https://github.com/woodpecker-ci/plugin-git/pull/67
|
||||
(fetchpatch {
|
||||
name = "do-not-overwrite-command-env.patch";
|
||||
url = "https://github.com/woodpecker-ci/plugin-git/commit/970cc63a9b212872deac565c6292feb3f4cf4b51.patch";
|
||||
hash = "sha256-izu0X7j+OyNbrOkksf+7VF3KiKVylVv2o00xaX/b1Rg=";
|
||||
})
|
||||
];
|
||||
|
||||
CGO_ENABLED = "0";
|
||||
|
||||
# Checks fail because they require network access.
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Woodpecker plugin for cloning Git repositories.";
|
||||
homepage = "https://woodpecker-ci.org/";
|
||||
license = licenses.asl20;
|
||||
mainProgram = "pluging-git";
|
||||
maintainers = with maintainers; [ thehedgeh0g ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue