Compare commits

..

1 commit

Author SHA1 Message Date
Bruno BELANYI 42ea0f97b1 WIP: setup lua LSP
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2024-03-12 15:33:48 +00:00
49 changed files with 299 additions and 410 deletions

18
.nvim.lua Normal file
View file

@ -0,0 +1,18 @@
local lspconfig = require("lspconfig")
-- FIXME: https://github.com/folke/neodev.nvim ?
lspconfig.lua_ls.setup({
settings = {
Lua = {
runtime = {
version = "LuaJIT",
},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
},
},
},
},
})

View file

@ -9,15 +9,15 @@ steps:
- name: notifiy
image: bash
environment:
ADDRESS:
from_secret: matrix_homeserver
ROOM:
from_secret: matrix_roomid
USER:
from_secret: matrix_username
PASS:
from_secret: matrix_password
secrets:
- source: matrix_homeserver
target: address
- source: matrix_roomid
target: room
- source: matrix_username
target: user
- source: matrix_password
target: pass
commands:
- nix run '.#matrix-notifier'
when:

View file

@ -14,11 +14,11 @@
]
},
"locked": {
"lastModified": 1715290355,
"narHash": "sha256-2T7CHTqBXJJ3ZC6R/4TXTcKoXWHcvubKNj9SfomURnw=",
"lastModified": 1707830867,
"narHash": "sha256-PAdwm5QqdlwIqGrfzzvzZubM+FXtilekQ/FA0cI49/o=",
"owner": "ryantm",
"repo": "agenix",
"rev": "8d37c5bdeade12b6479c85acd133063ab53187a0",
"rev": "8cb01a0e717311680e0cbca06a76cbceba6f3ed6",
"type": "github"
},
"original": {
@ -73,11 +73,11 @@
]
},
"locked": {
"lastModified": 1715865404,
"narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=",
"lastModified": 1709336216,
"narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9",
"rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2",
"type": "github"
},
"original": {
@ -94,11 +94,11 @@
]
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"lastModified": 1709126324,
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
"type": "github"
},
"original": {
@ -116,11 +116,11 @@
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"lastModified": 1703887061,
"narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
"type": "github"
},
"original": {
@ -136,11 +136,11 @@
]
},
"locked": {
"lastModified": 1715930644,
"narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=",
"lastModified": 1709988192,
"narHash": "sha256-qxwIkl85P0I1/EyTT+NJwzbXdOv86vgZxcv4UKicjK8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d",
"rev": "b0b0c3d94345050a7f86d1ebc6c56eea4389d030",
"type": "github"
},
"original": {
@ -152,11 +152,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1715961556,
"narHash": "sha256-+NpbZRCRisUHKQJZF3CT+xn14ZZQO+KjxIIanH3Pvn4=",
"lastModified": 1709703039,
"narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4a6b83b05df1a8bd7d99095ec4b4d271f2956b64",
"rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d",
"type": "github"
},
"original": {
@ -168,11 +168,11 @@
},
"nur": {
"locked": {
"lastModified": 1716149933,
"narHash": "sha256-0Ui2HmmKvSqxXfT5kCzTu2EO+kqYxavPZHROxQLsI14=",
"lastModified": 1710013455,
"narHash": "sha256-qzOpU4APTso6JLA+/F4zlO/yL8++n/CsUpmxbQAsy/4=",
"owner": "nix-community",
"repo": "NUR",
"rev": "0d0e224fe23a49977d871ae2fe2f14c84b03322a",
"rev": "cf1e9b0e085368cc489c765f285f1d07c2ec8d36",
"type": "github"
},
"original": {
@ -185,6 +185,9 @@
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": [
"futils"
],
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
@ -194,11 +197,11 @@
]
},
"locked": {
"lastModified": 1715870890,
"narHash": "sha256-nacSOeXtUEM77Gn0G4bTdEOeFIrkCBXiyyFZtdGwuH0=",
"lastModified": 1708018599,
"narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "fa606cccd7b0ccebe2880051208e4a0f61bfc8c1",
"rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431",
"type": "github"
},
"original": {

View file

@ -63,6 +63,7 @@
repo = "pre-commit-hooks.nix";
ref = "master";
inputs = {
flake-utils.follows = "futils";
nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs";
};

View file

@ -7,6 +7,7 @@
nativeBuildInputs = with pkgs; [
gitAndTools.pre-commit
lua-language-server
nixpkgs-fmt
];

View file

@ -2,7 +2,7 @@
{
my.home = {
# Use graphical pinentry
bitwarden.pinentry = pkgs.pinentry-gtk2;
bitwarden.pinentry = "gtk2";
# Ebook library
calibre.enable = true;
# Some amount of social life
@ -14,7 +14,7 @@
# Blue light filter
gammastep.enable = true;
# Use a small popup to enter passwords
gpg.pinentry = pkgs.pinentry-gtk2;
gpg.pinentry = "gtk2";
# Machine specific packages
packages.additionalPackages = with pkgs; [
element-desktop # Matrix client

View file

@ -31,14 +31,8 @@ in
publicKeys = all;
};
"lohr/secret.age" = {
owner = "lohr";
publicKeys = all;
};
"lohr/ssh-key.age" = {
owner = "lohr";
publicKeys = all;
};
"lohr/secret.age".publicKeys = all;
"lohr/ssh-key.age".publicKeys = all;
"matrix/mail.age" = {
owner = "matrix-synapse";

View file

@ -10,11 +10,6 @@ in
adblock = {
enable = true;
};
# Audiobook and podcast library
audiobookshelf = {
enable = true;
port = 9599;
};
# Backblaze B2 backup
backup = {
enable = true;
@ -139,7 +134,6 @@ in
podgrab = {
enable = true;
passwordFile = secrets."podgrab/password".path;
dataDir = "/data/media/podcasts";
port = 9598;
};
# Regular backups

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ config, lib, ... }:
let
cfg = config.my.home.bitwarden;
in
@ -6,7 +6,12 @@ in
options.my.home.bitwarden = with lib; {
enable = my.mkDisableOption "bitwarden configuration";
pinentry = mkPackageOption pkgs "pinentry" { default = [ "pinentry-tty" ]; };
pinentry = mkOption {
type = types.str;
default = "tty";
example = "gtk2";
description = "Which pinentry interface to use";
};
};
config = lib.mkIf cfg.enable {

View file

@ -7,9 +7,9 @@ in
enable = my.mkDisableOption "direnv configuration";
defaultFlake = mkOption {
type = with types; nullOr str;
default = null;
example = "pkgs";
type = types.str;
default = "pkgs";
example = "nixpkgs";
description = ''
Which flake from the registry should be used for
<command>use pkgs</command> by default.
@ -39,7 +39,7 @@ in
in
lib.my.genAttrs' files linkLibFile;
home.sessionVariables = lib.mkIf (cfg.defaultFlake != null) {
home.sessionVariables = {
DIRENV_DEFAULT_FLAKE = cfg.defaultFlake;
};
};

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ config, lib, ... }:
let
cfg = config.my.home.gpg;
in
@ -6,7 +6,12 @@ in
options.my.home.gpg = with lib; {
enable = my.mkDisableOption "gpg configuration";
pinentry = mkPackageOption pkgs "pinentry" { default = [ "pinentry-tty" ]; };
pinentry = mkOption {
type = types.str;
default = "tty";
example = "gtk2";
description = "Which pinentry interface to use";
};
};
config = lib.mkIf cfg.enable {
@ -17,7 +22,7 @@ in
services.gpg-agent = {
enable = true;
enableSshSupport = true; # One agent to rule them all
pinentryPackage = cfg.pinentry;
pinentryFlavor = cfg.pinentry;
extraConfig = ''
allow-loopback-pinentry
'';

View file

@ -1,7 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Add comment format
setlocal comments=b://,s1:/*,mb:*,ex:*/
setlocal commentstring=//\ %s
let b:undo_ftplugin.='|setlocal comments< commentstring<'

View file

@ -1,6 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use a small indentation value on JSON files
setlocal shiftwidth=2
let b:undo_ftplugin.='|setlocal shiftwidth<'

View file

@ -1,6 +0,0 @@
-- Use `bp` filetype for Blueprint files
vim.filetype.add({
extension = {
bp = "bp",
},
})

View file

@ -88,23 +88,6 @@ set background=dark
" 24 bit colors
set termguicolors
" Setup some overrides for gruvbox
lua << EOF
local gruvbox = require("gruvbox")
local colors = gruvbox.palette
gruvbox.setup({
overrides = {
-- Only URLs should be underlined
["@string.special.path"] = { link = "GruvboxOrange" },
-- Revert back to the better diff highlighting
DiffAdd = { fg = colors.green, bg = "NONE" },
DiffChange = { fg = colors.aqua, bg = "NONE" },
DiffDelete = { fg = colors.red, bg = "NONE" },
DiffText = { fg = colors.yellow, bg = colors.bg0 },
}
})
EOF
" Use my preferred colorscheme
colorscheme gruvbox
" }}}

View file

@ -18,6 +18,16 @@ null_ls.register({
}),
})
-- C, C++
null_ls.register({
null_ls.builtins.formatting.clang_format.with({
-- Only used if available, but prefer clangd formatting if available
condition = function()
return utils.is_executable("clang-format") and not utils.is_executable("clangd")
end,
}),
})
-- Nix
null_ls.register({
null_ls.builtins.formatting.nixpkgs_fmt.with({

View file

@ -9,7 +9,7 @@ in
config = lib.mkIf cfg.enable {
# Enable touchpad support
services.libinput.enable = true;
services.xserver.libinput.enable = true;
# Enable TLP power management
my.services.tlp.enable = true;

View file

@ -1,39 +0,0 @@
# Audiobook and podcast library
{ config, lib, ... }:
let
cfg = config.my.services.audiobookshelf;
in
{
options.my.services.audiobookshelf = with lib; {
enable = mkEnableOption "Audiobookshelf, a self-hosted podcast manager";
port = mkOption {
type = types.port;
default = 8000;
example = 4242;
description = "The port on which Audiobookshelf will listen for incoming HTTP traffic.";
};
};
config = lib.mkIf cfg.enable {
services.audiobookshelf = {
enable = true;
inherit (cfg) port;
group = "media";
};
# Set-up media group
users.groups.media = { };
my.services.nginx.virtualHosts = {
audiobookshelf = {
inherit (cfg) port;
# Proxy websockets for RPC
extraConfig = {
locations."/".proxyWebsockets = true;
};
};
};
};
}

View file

@ -4,7 +4,6 @@
imports = [
./adblock
./aria
./audiobookshelf
./backup
./blog
./calibre-web

View file

@ -99,7 +99,7 @@ in
};
};
"${lohrHome}/.ssh/id_ed25519" = {
"L+" = {
"f+" = {
user = "lohr";
group = "lohr";
mode = "0700";

View file

@ -66,13 +66,6 @@ in
my.services.nginx.virtualHosts = {
mealie = {
inherit (cfg) port;
extraConfig = {
# Allow bulk upload of recipes for import/export
locations."/".extraConfig = ''
client_max_body_size 0;
'';
};
};
};
};

View file

@ -31,7 +31,7 @@ in
config = lib.mkIf cfg.enable {
services.nextcloud = {
enable = true;
package = pkgs.nextcloud29;
package = pkgs.nextcloud28;
hostName = "nextcloud.${config.networking.domain}";
home = "/var/lib/nextcloud";
maxUploadSize = cfg.maxSize;

View file

@ -17,15 +17,6 @@ in
'';
};
dataDir = mkOption {
type = with types; nullOr str;
default = null;
example = "/mnt/podgrab";
description = ''
Path to the directory to store the podcasts. Use default if null
'';
};
port = mkOption {
type = types.port;
default = 8080;
@ -38,14 +29,8 @@ in
services.podgrab = {
enable = true;
inherit (cfg) passwordFile port;
group = "media";
dataDirectory = lib.mkIf (cfg.dataDir != null) cfg.dataDir;
};
# Set-up media group
users.groups.media = { };
my.services.nginx.virtualHosts = {
podgrab = {
inherit (cfg) port;

View file

@ -20,28 +20,24 @@ in
# Taken from the manual
(lib.mkIf cfg.upgradeScript {
containers.temp-pg.config.services.postgresql = {
enable = true;
package = pkgs.postgresql_13;
};
environment.systemPackages =
let
pgCfg = config.services.postgresql;
newPackage' = pkgs.postgresql_13;
oldPackage = if pgCfg.enableJIT then pgCfg.package.withJIT else pgCfg.package;
oldData = pgCfg.dataDir;
oldBin = "${if pgCfg.extraPlugins == [] then oldPackage else oldPackage.withPackages pgCfg.extraPlugins}/bin";
newPackage = if pgCfg.enableJIT then newPackage'.withJIT else newPackage';
newData = "/var/lib/postgresql/${newPackage.psqlSchema}";
newBin = "${if pgCfg.extraPlugins == [] then newPackage else newPackage.withPackages pgCfg.extraPlugins}/bin";
newpg = config.containers.temp-pg.config.services.postgresql;
in
[
(pkgs.writeScriptBin "upgrade-pg-cluster" ''
#!/usr/bin/env bash
set -eux
export OLDDATA="${oldData}"
export NEWDATA="${newData}"
export OLDBIN="${oldBin}"
export NEWBIN="${newBin}"
set -x
export OLDDATA="${config.services.postgresql.dataDir}"
export NEWDATA="${newpg.dataDir}"
export OLDBIN="${config.services.postgresql.package}/bin"
export NEWBIN="${newpg.package}/bin"
if [ "$OLDDATA" -ef "$NEWDATA" ]; then
echo "Cannot migrate to same data directory" >&2
@ -50,21 +46,14 @@ in
install -d -m 0700 -o postgres -g postgres "$NEWDATA"
cd "$NEWDATA"
sudo -u postgres "$NEWBIN/initdb" -D "$NEWDATA"
sudo -u postgres $NEWBIN/initdb -D "$NEWDATA"
systemctl stop postgresql # old one
sudo -u postgres "$NEWBIN/pg_upgrade" \
sudo -u postgres $NEWBIN/pg_upgrade \
--old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \
--old-bindir "$OLDBIN" --new-bindir "$NEWBIN" \
--old-bindir $OLDBIN --new-bindir $NEWBIN \
"$@"
cat << EOF
Run the following commands after setting:
services.postgresql.package = pkgs.postgresql_${lib.versions.major newPackage.version}
sudo -u postgres vacuumdb --all --analyze-in-stages
${newData}/delete_old_cluster.sh
EOF
'')
];
})

View file

@ -11,9 +11,7 @@ in
config = lib.mkIf cfg.enable {
services.rss-bridge = {
enable = true;
config = {
system.enabled_bridges = [ "*" ]; # Whitelist all
};
whitelist = [ "*" ]; # Whitelist all
virtualHost = "rss-bridge.${config.networking.domain}";
};

View file

@ -73,13 +73,6 @@ in
my.services.nginx.virtualHosts = {
recipes = {
inherit (cfg) port;
extraConfig = {
# Allow bulk upload of recipes for import/export
locations."/".extraConfig = ''
client_max_body_size 0;
'';
};
};
};
};

View file

@ -44,8 +44,6 @@ in
serviceConfig = {
# Same option as upstream, without @setuid
SystemCallFilter = lib.mkForce "~@clock @privileged @cpu-emulation @debug @keyring @module @mount @obsolete @raw-io @reboot @swap";
# NodeJS requires RWX memory...
MemoryDenyWriteExecute = lib.mkForce false;
BindPaths = [
"/nix/var/nix/daemon-socket/socket"

View file

@ -0,0 +1,28 @@
From 416b3c9c5e783d173ac0fd5310a76c1b144b92c1 Mon Sep 17 00:00:00 2001
From: eeeXun <sdes96303@gmail.com>
Date: Thu, 19 Oct 2023 02:34:12 +0800
Subject: Use better diff colours
---
README.md | 3 ++-
lua/gruvbox.lua | 7 ++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lua/gruvbox.lua b/lua/gruvbox.lua
index ceba0735..a319fc6a 100644
--- a/lua/gruvbox.lua
+++ b/lua/gruvbox.lua
@@ -360,9 +361,9 @@ local function get_groups()
PmenuSel = { fg = colors.bg2, bg = colors.blue, bold = config.bold },
PmenuSbar = { bg = colors.bg2 },
PmenuThumb = { bg = colors.bg4 },
- DiffDelete = { bg = colors.dark_red },
- DiffAdd = { bg = colors.dark_green },
- DiffChange = { bg = colors.dark_aqua },
- DiffText = { bg = colors.yellow, fg = colors.bg0 },
+ DiffDelete = { fg = colors.red },
+ DiffAdd = { fg = colors.green },
+ DiffChange = { fg = colors.aqua },
+ DiffText = { fg = colors.yellow, bg = colors.bg0 },
SpellCap = { link = "GruvboxBlueUnderline" },
SpellBad = { link = "GruvboxRedUnderline" },

View file

@ -0,0 +1,10 @@
{ ... }:
_final: prev: {
gruvbox-nvim = prev.gruvbox-nvim.overrideAttrs (oa: {
patches = (oa.patches or [ ]) ++ [
# Inspired by https://github.com/ellisonleao/gruvbox.nvim/pull/291
./colours.patch
];
});
}

View file

@ -1,14 +0,0 @@
{ fetchpatch, ... }:
_final: prev: {
gruvbox-nvim = prev.gruvbox-nvim.overrideAttrs (oa: {
patches = (oa.patches or [ ]) ++ [
# https://github.com/ellisonleao/gruvbox.nvim/pull/319
(fetchpatch {
name = "expose-color-palette.patch";
url = "https://github.com/ellisonleao/gruvbox.nvim/commit/07a493ba4f8b650aab9ed9e486caa89822be0996.patch";
hash = "sha256-iGwt8qIHe2vaiAUcpaUxyGlM472F89vobTdQ7CF/H70=";
})
];
});
}

View file

@ -0,0 +1,61 @@
{ lib
, boost
, cmake
, cxxopts
, digestpp
, fetchFromGitHub
, fmt
, jsoncons
, pugixml
, sqlite_orm
, stdenv
}:
stdenv.mkDerivation {
pname = "bt-migrate";
version = "0-unstable-2023-08-17";
src = fetchFromGitHub {
owner = "mikedld";
repo = "bt-migrate";
rev = "e15a489c0c76f98355586ebbee08223af4e9bf50";
hash = "sha256-kA6yxhbIh3ThmgF8Zyoe3I79giLVmdNr9IIrw5Xx4s0=";
};
nativeBuildInputs = [
cmake
];
buildInputs = [
boost
cxxopts
fmt
jsoncons
pugixml
sqlite_orm
];
cmakeFlags = [
(lib.strings.cmakeBool "USE_VCPKG" false)
# NOTE: digestpp does not have proper CMake packaging (yet?)
(lib.strings.cmakeBool "USE_FETCHCONTENT" true)
(lib.strings.cmakeFeature "FETCHCONTENT_SOURCE_DIR_DIGESTPP" "${digestpp}/include/digestpp")
];
# NOTE: no install target in CMake...
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp BtMigrate $out/bin
runHook postInstall
'';
meta = with lib; {
description = "Torrent state migration tool";
homepage = "https://github.com/mikedld/bt-migrate";
license = licenses.gpl3Only;
maintainers = with maintainers; [ ambroisie ];
mainProgram = "BtMigrate";
};
}

View file

@ -1,5 +1,7 @@
{ pkgs }:
pkgs.lib.makeScope pkgs.newScope (pkgs: {
bt-migrate = pkgs.callPackage ./bt-migrate { };
bw-pass = pkgs.callPackage ./bw-pass { };
change-audio = pkgs.callPackage ./change-audio { };
@ -10,6 +12,8 @@ pkgs.lib.makeScope pkgs.newScope (pkgs: {
diff-flake = pkgs.callPackage ./diff-flake { };
digestpp = pkgs.callPackage ./digestpp { };
dragger = pkgs.callPackage ./dragger { };
drone-rsync = pkgs.callPackage ./drone-rsync { };
@ -26,6 +30,8 @@ pkgs.lib.makeScope pkgs.newScope (pkgs: {
rbw-pass = pkgs.callPackage ./rbw-pass { };
sqlite_orm = pkgs.callPackage ./sqlite_orm { };
unbound-zones-adblock = pkgs.callPackage ./unbound-zones-adblock { };
zsh-done = pkgs.callPackage ./zsh-done { };

31
pkgs/digestpp/default.nix Normal file
View file

@ -0,0 +1,31 @@
{ lib
, fetchFromGitHub
, stdenv
}:
stdenv.mkDerivation {
pname = "digestpp";
version = "0-unstable-2023-11-07";
src = fetchFromGitHub {
owner = "kerukuro";
repo = "digestpp";
rev = "ebb699402c244e22c3aff61d2239bcb2e87b8ef8";
hash = "sha256-9X/P7DgZB6bSYjQWRli4iAXEFjhmACOVv3EYQrXuH5c=";
};
installPhase = ''
runHook preInstall
mkdir -p $out/include/digestpp
cp -r *.hpp algorithm/ detail/ $out/include/digestpp
runHook postInstall
'';
meta = with lib; {
description = "C++11 header-only message digest library";
homepage = "https://github.com/kerukuro/digestpp";
license = licenses.unlicense;
maintainers = with maintainers; [ ambroisie ];
};
}

View file

@ -0,0 +1,32 @@
{ lib
, cmake
, fetchFromGitHub
, sqlite
, stdenv
}:
stdenv.mkDerivation (finalAttrs: {
pname = "sqlite_orm";
version = "1.8.2";
src = fetchFromGitHub {
owner = "fnc12";
repo = "sqlite_orm";
rev = "v${finalAttrs.version}";
hash = "sha256-KqphGFcnR1Y11KqL7sxODSv7lEvcURdF6kLd3cg84kc=";
};
nativeBuildInputs = [
cmake
];
propagatedBuildInputs = [
sqlite
];
meta = with lib; {
description = "Light header only SQLite ORM";
homepage = "https://sqliteorm.com/";
license = licenses.agpl3Only; # MIT license is commercial
maintainers = with maintainers; [ ambroisie ];
};
})

View file

@ -26,7 +26,7 @@ stdenvNoCC.mkDerivation rec {
description = ''
A zsh plug-in to receive notifications when long processes finish
'';
homepage = "https://git.belanyi.fr/ambroisie/zsh-done";
homepage = "https://gitea.belanyi.fr/ambroisie/zsh-done";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ ambroisie ];

View file

@ -14,17 +14,17 @@ steps:
- name: notifiy
image: bash
environment:
ADDRESS:
from_secret: matrix_homeserver
ROOM:
from_secret: matrix_roomid
USER:
from_secret: matrix_username
PASS:
from_secret: matrix_password
secrets:
- source: matrix_homeserver
target: address
- source: matrix_roomid
target: room
- source: matrix_username
target: user
- source: matrix_password
target: pass
commands:
- nix run github:ambroisie/matrix-notifier
- nix run '.#matrix-notifier'
when:
status:
- failure

View file

@ -52,7 +52,7 @@
meta = with lib; {
description = "A C++ project";
homepage = "https://git.belanyi.fr/ambroisie/project";
homepage = "https://gitea.belanyi.fr/ambroisie/project";
license = licenses.mit;
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.unix;

View file

@ -14,17 +14,17 @@ steps:
- name: notifiy
image: bash
environment:
ADDRESS:
from_secret: matrix_homeserver
ROOM:
from_secret: matrix_roomid
USER:
from_secret: matrix_username
PASS:
from_secret: matrix_password
secrets:
- source: matrix_homeserver
target: address
- source: matrix_roomid
target: room
- source: matrix_username
target: user
- source: matrix_password
target: pass
commands:
- nix run github:ambroisie/matrix-notifier
- nix run '.#matrix-notifier'
when:
status:
- failure

View file

@ -52,7 +52,7 @@
meta = with lib; {
description = "A C++ project";
homepage = "https://git.belanyi.fr/ambroisie/project";
homepage = "https://gitea.belanyi.fr/ambroisie/project";
license = licenses.mit;
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.unix;

View file

@ -5,10 +5,6 @@
};
"c++-meson" = {
path = ./c++-meson;
description = "A C++ project using Meson";
};
"rust-cargo" = {
path = ./rust-cargo;
description = "A Rust project using Cargo";
description = "A C++ project using CMake";
};
}

View file

@ -1,5 +0,0 @@
if ! has nix_direnv_version || ! nix_direnv_version 3.0.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.0/direnvrc" "sha256-21TMnI2xWX7HkSTjFFri2UaohXVj854mgvWapWrxRXg="
fi
use flake

View file

@ -1,6 +0,0 @@
# Rust build directory
/target
# Nix generated files
/.pre-commit-config.yaml
/result

View file

@ -1,31 +0,0 @@
labels:
backend: local
steps:
- name: pre-commit check
image: bash
commands:
- nix develop --command pre-commit run --all
- name: nix flake check
image: bash
commands:
- nix flake check
- name: notifiy
image: bash
environment:
ADDRESS:
from_secret: matrix_homeserver
ROOM:
from_secret: matrix_roomid
USER:
from_secret: matrix_username
PASS:
from_secret: matrix_password
commands:
- nix run github:ambroisie/matrix-notifier
when:
status:
- failure
- success

View file

@ -1,7 +0,0 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "project"
version = "0.0.0"

View file

@ -1,8 +0,0 @@
[package]
name = "project"
version = "0.0.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View file

@ -1,112 +0,0 @@
{
description = "A Rust project";
inputs = {
futils = {
type = "github";
owner = "numtide";
repo = "flake-utils";
ref = "main";
};
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-unstable";
};
pre-commit-hooks = {
type = "github";
owner = "cachix";
repo = "pre-commit-hooks.nix";
ref = "master";
inputs = {
flake-utils.follows = "futils";
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { self, futils, nixpkgs, pre-commit-hooks }:
{
overlays = {
default = final: _prev: {
project = with final; rustPlatform.buildRustPackage {
pname = "project";
version = (final.lib.importTOML ./Cargo.toml).package.version;
src = self;
cargoLock = {
lockFile = "${self}/Cargo.lock";
};
meta = with lib; {
description = "A Rust project";
homepage = "https://git.belanyi.fr/ambroisie/project";
license = licenses.mit;
maintainers = with maintainers; [ ambroisie ];
};
};
};
};
} // futils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.default
];
};
pre-commit = pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
clippy = {
enable = true;
settings = {
denyWarnings = true;
};
};
nixpkgs-fmt = {
enable = true;
};
rustfmt = {
enable = true;
};
};
};
in
{
checks = {
inherit (self.packages.${system}) project;
};
devShells = {
default = pkgs.mkShell {
inputsFrom = with self.packages.${system}; [
project
];
packages = with pkgs; [
clippy
rust-analyzer
rustfmt
];
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
inherit (pre-commit) shellHook;
};
};
packages = futils.lib.flattenTree {
default = pkgs.project;
inherit (pkgs) project;
};
});
}

View file

@ -1,3 +0,0 @@
fn main() {
println!("Hello, world!");
}