open-goverance/flake.nix

89 lines
2.9 KiB
Nix
Raw Permalink Normal View History

{
description = "UL Computer Society Open Governance";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
2024-05-12 14:53:25 +00:00
utils.url = "github:numtide/flake-utils";
bfom.url = "gitlab:silver_rust/bfom";
};
2024-05-12 14:53:25 +00:00
/*
sudo nano /etc/nix/nix.conf
trusted-users = {username}
*/
2024-05-11 17:14:35 +00:00
nixConfig = {
2024-05-12 02:14:39 +00:00
extra-substituters = "https://nix-cache.skynet.ie/skynet-cache";
2024-07-01 22:36:55 +00:00
extra-trusted-public-keys = "skynet-cache:zMFLzcRZPhUpjXUy8SF8Cf7KGAZwo98SKrzeXvdWABo=";
2024-05-11 17:14:35 +00:00
};
2024-05-12 14:53:25 +00:00
outputs = {
self,
nixpkgs,
utils,
bfom,
}:
utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
system = "${system}";
config = {
allowUnfree = true;
permittedInsecurePackages = [
# for obsidian
"electron-25.9.0"
# for wkhtmltopdf
"qtwebkit-5.212.0-alpha4"
2024-05-12 14:53:25 +00:00
];
};
};
in rec {
# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [obsidian];
shellHook = ''
${pkgs.obsidian}/bin/obsidian &
BG_PID=$!
trap "kill -9 $BG_PID" EXIT
'';
};
2024-05-12 14:53:25 +00:00
packages = {
handovers = pkgs.writeShellScriptBin "format_handovers" ''
export PATH=${pkgs.lib.makeBinPath [pkgs.wkhtmltopdf bfom.defaultPackage.x86_64-linux]}:$PATH
2024-05-12 14:53:25 +00:00
${./_scripts/format_handovers.sh}
'';
handovers_html = pkgs.writeShellScriptBin "format_handovers_html" ''
export PATH=${pkgs.lib.makeBinPath [pkgs.wkhtmltopdf bfom.defaultPackage.x86_64-linux]}:$PATH
${./_scripts/format_handovers.sh} html
'';
2024-05-12 14:53:25 +00:00
minutes = pkgs.writeShellScriptBin "format_minutes" ''
export PATH=${pkgs.lib.makeBinPath [pkgs.wkhtmltopdf bfom.defaultPackage.x86_64-linux]}:$PATH
2024-05-12 14:53:25 +00:00
${./_scripts/format_minutes.sh}
'';
minutes_html = pkgs.writeShellScriptBin "format_minutes_html" ''
export PATH=${pkgs.lib.makeBinPath [pkgs.wkhtmltopdf bfom.defaultPackage.x86_64-linux]}:$PATH
${./_scripts/format_minutes.sh} html
'';
budget = pkgs.writeShellScriptBin "format_budget" ''
export PATH=${pkgs.lib.makeBinPath [pkgs.wkhtmltopdf bfom.defaultPackage.x86_64-linux]}:$PATH
${./_scripts/format_budget.sh}
'';
budget_html = pkgs.writeShellScriptBin "format_budget_html" ''
export PATH=${pkgs.lib.makeBinPath [pkgs.wkhtmltopdf bfom.defaultPackage.x86_64-linux]}:$PATH
${./_scripts/format_budget.sh} html
'';
events = pkgs.writeShellScriptBin "format_events" ''
export PATH=${pkgs.lib.makeBinPath [pkgs.wkhtmltopdf bfom.defaultPackage.x86_64-linux]}:$PATH
${./_scripts/format_events.sh}
'';
events_html = pkgs.writeShellScriptBin "format_events_html" ''
export PATH=${pkgs.lib.makeBinPath [pkgs.wkhtmltopdf bfom.defaultPackage.x86_64-linux]}:$PATH
${./_scripts/format_events.sh} html
'';
2024-05-12 14:53:25 +00:00
};
});
}