Compare commits

..

No commits in common. "ef4e5e3ccc4b980f496b3d554b49e0c976a6d18e" and "2b628fb0d676c4f4a13ee2ba149168bf40e19eab" have entirely different histories.

21 changed files with 76 additions and 149 deletions

30
flake.lock generated
View file

@ -11,11 +11,11 @@
]
},
"locked": {
"lastModified": 1690228878,
"narHash": "sha256-9Xe7JV0krp4RJC9W9W9WutZVlw6BlHTFMiUP/k48LQY=",
"lastModified": 1689334118,
"narHash": "sha256-djk5AZv1yU84xlKFaVHqFWvH73U7kIRstXwUAnDJPsk=",
"owner": "ryantm",
"repo": "agenix",
"rev": "d8c973fd228949736dedf61b7f8cc1ece3236792",
"rev": "0d8c5325fc81daf00532e3e26c6752f7bcde1143",
"type": "github"
},
"original": {
@ -131,11 +131,11 @@
]
},
"locked": {
"lastModified": 1690476848,
"narHash": "sha256-PSmzyuEbMxEn2uwwLYUN2l1psoJXb7jm/kfHD12Sq0k=",
"lastModified": 1689891262,
"narHash": "sha256-Pc4wDczbdgd6QXKJIXprgxe7L9AVDsoAkMnvm5vmpUU=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "8d243f7da13d6ee32f722a3f1afeced150b6d4da",
"rev": "ee5673246de0254186e469935909e821b8f4ec15",
"type": "github"
},
"original": {
@ -147,11 +147,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1690367991,
"narHash": "sha256-2VwOn1l8y6+cu7zjNE8MgeGJNNz1eat1HwHrINeogFA=",
"lastModified": 1689850295,
"narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c9cf0708f00fbe553319258e48ca89ff9a413703",
"rev": "5df4d78d54f7a34e9ea1f84a22b4fd9baebc68d0",
"type": "github"
},
"original": {
@ -163,11 +163,11 @@
},
"nur": {
"locked": {
"lastModified": 1690541304,
"narHash": "sha256-EypV1o52D9SdHWyH3Wf6RLdDiDnKIqqXiUROrtN2KyQ=",
"lastModified": 1689968828,
"narHash": "sha256-5qA6R/cBeLsS09ZMRKzhJq74nOGWEgGYpjdbKXDnCow=",
"owner": "nix-community",
"repo": "NUR",
"rev": "03f02d6f7b5c284fe6ed12f86debb21429ca124c",
"rev": "876b9498f36a394fcf8472f62ecf6685585c0509",
"type": "github"
},
"original": {
@ -192,11 +192,11 @@
]
},
"locked": {
"lastModified": 1690464206,
"narHash": "sha256-38V4kmOh6ikpfGiAS+Kt2H/TA2DubSqE66veP/jmB4Q=",
"lastModified": 1689668210,
"narHash": "sha256-XAATwDkaUxH958yXLs1lcEOmU6pSEIkatY3qjqk8X0E=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "9289996dcac62fd45836db7c07b87d2521eb526d",
"rev": "eb433bff05b285258be76513add6f6c57b441775",
"type": "github"
},
"original": {

View file

@ -1,27 +0,0 @@
{ 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;
};
};
};
}

View file

@ -4,7 +4,6 @@
./aliases
./atuin
./bat
./bitwarden
./bluetooth
./calibre
./comma

View file

@ -8,7 +8,7 @@ let
realName = lib.mkDefault "Bruno BELANYI";
userName = lib.mkDefault (mkMailAddress address domain);
passwordCommand =
lib.mkDefault [ (lib.getExe pkgs.ambroisie.rbw-pass) "Mail" passName ];
lib.mkDefault [ "${pkgs.ambroisie.bw-pass}/bin/bw-pass" "Mail" passName ];
address = mkMailAddress address domain;
aliases = builtins.map (lib.flip mkMailAddress domain) aliases;

View file

@ -9,7 +9,7 @@ in
settings = {
notify-cmd =
let
notify-send = lib.getExe pkgs.libnotify;
notify-send = "${pkgs.libnotify}/bin/notify-send";
in
pkgs.writeScript "mail-notifier" ''
SENDER="$1"

View file

@ -47,8 +47,8 @@ in
command = mkOption {
type = types.str;
default = "${lib.getExe pkgs.i3lock} -n -c 000000";
example = "\${lib.getExe pkgs.i3lock} -n -i lock.png";
default = "${pkgs.i3lock}/bin/i3lock -n -c 000000";
example = "\${pkgs.i3lock}/bin/i3lock -n -i lock.png";
description = "Locker command to run";
};

View file

@ -27,13 +27,13 @@ let
genMovementBindings = f: addVimKeyBindings (lib.my.genAttrs' movementKeys f);
# Used in multiple scripts to show messages through keybindings
notify-send = lib.getExe pkgs.libnotify;
notify-send = "${pkgs.libnotify}/bin/notify-send";
# Screen backlight management
changeBacklight = lib.getExe pkgs.ambroisie.change-backlight;
changeBacklight = "${pkgs.ambroisie.change-backlight}/bin/change-backlight";
# Audio and volume management
changeAudio = lib.getExe pkgs.ambroisie.change-audio;
changeAudio = "${pkgs.ambroisie.change-audio}/bin/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,7 +189,6 @@ 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

View file

@ -5,7 +5,7 @@ let
notficationCmd =
let
duration = toString (cfg.notify.delay * 1000);
notifyCmd = "${lib.getExe pkgs.libnotify} -u critical -t ${duration}";
notifyCmd = "${pkgs.libnotify}/bin/notify-send -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'"'';

View file

@ -1,8 +1,6 @@
{ pkgs, ... }:
{
my.home = {
# Use graphical pinentry
bitwarden.pinentry = "gtk2";
# Ebook library
calibre.enable = true;
# Some amount of social life

View file

@ -2,6 +2,7 @@
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") {
@ -24,7 +25,7 @@ in
EnvironmentFile = [
cfg.sharedSecretFile
];
ExecStart = lib.getExe pkgs.drone-runner-docker;
ExecStart = "${dockerPkg}/bin/drone-runner-docker";
User = "drone-runner-docker";
Group = "drone-runner-docker";
};

View file

@ -2,6 +2,7 @@
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") {
@ -52,7 +53,7 @@ in
EnvironmentFile = [
cfg.sharedSecretFile
];
ExecStart = lib.getExe pkgs.drone-runner-exec;
ExecStart = "${execPkg}/bin/drone-runner-exec";
User = "drone-runner-exec";
Group = "drone-runner-exec";
};

View file

@ -30,7 +30,7 @@ in
serviceConfig = {
ExecStart = lib.concatStringsSep " " [
(lib.getExe pkgs.flood)
"${pkgs.flood}/bin/flood"
"--port ${builtins.toString cfg.port}"
"--rundir /var/lib/${cfg.stateDir}"
];

View file

@ -4,6 +4,8 @@ let
cfg = config.my.services.lohr;
settingsFormat = pkgs.formats.yaml { };
lohrPkg = pkgs.ambroisie.lohr;
lohrStateDirectory = "lohr";
lohrHome = "/var/lib/lohr/";
in
@ -78,7 +80,7 @@ in
let
configFile = settingsFormat.generate "lohr-config.yaml" cfg.setting;
in
"${lib.getExe pkgs.ambroisie.lohr} --config ${configFile}";
"${lohrPkg}/bin/lohr --config ${configFile}";
StateDirectory = lohrStateDirectory;
WorkingDirectory = lohrHome;
User = "lohr";

View file

@ -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" ''
#!${lib.getExe pkgs.bash}
#!${pkgs.bash}/bin/bash
rm -f '${confPath}'
${utils.genJqSecretsReplacementSnippet cfg.configuration confPath}
@ -70,7 +70,7 @@ in
''
}'';
ExecStart = lib.mkForce ''
${lib.getExe pkg} \
${pkg}/bin/nginx-sso \
--config ${confPath} \
--frontend-dir ${pkg}/share/frontend
'';

View file

@ -33,7 +33,7 @@ in
restartIfChanged = false;
path = with pkgs; [
woodpecker-plugin-git
ambroisie.woodpecker-plugin-git
bash
coreutils
git

View file

@ -26,8 +26,6 @@ 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 { };
@ -44,5 +42,7 @@ 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 { };
})

View file

@ -12,7 +12,7 @@ buildGoModule rec {
vendorHash = null;
postPatch = ''
sed -i -e 's,"mpv","${lib.getExe mpv}",' ff2mpv.go
sed -i -e 's,"mpv","${mpv}/bin/mpv",' ff2mpv.go
'';
postInstall = ''

View file

@ -1,40 +0,0 @@
{ 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 ];
};
}

View file

@ -1,43 +0,0 @@
#!/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 "$@"

View file

@ -10,7 +10,7 @@ stdenvNoCC.mkDerivation {
installPhase =
let
gawkCmd = lib.concatStringsSep " " [
(lib.getExe gawk)
''${gawk}/bin/awk''
'''{sub(/\r$/,"")}''
''{sub(/^127\.0\.0\.1/,"0.0.0.0")}''
''BEGIN { OFS = "" }''

View file

@ -0,0 +1,37 @@
{ 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;
};
}