Compare commits
2 commits
a99fa15aed
...
8741b32021
Author | SHA1 | Date | |
---|---|---|---|
|
8741b32021 | ||
|
26619394f4 |
12
doctrine/default.nix
Normal file
12
doctrine/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
pkgs,
|
||||
namespace,
|
||||
}: let
|
||||
doctrine = {
|
||||
lib = import ./lib {inherit lib pkgs doctrine;};
|
||||
prefix = "trivium";
|
||||
inherit namespace;
|
||||
};
|
||||
inherit (pkgs) lib;
|
||||
in
|
||||
doctrine
|
10
doctrine/lib/default.nix
Normal file
10
doctrine/lib/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
lib,
|
||||
doctrine,
|
||||
pkgs,
|
||||
}: let
|
||||
close = f: args: f (args // {inherit lib pkgs doctrine;});
|
||||
in {
|
||||
importAll = pkgs.callPackage ./importAll.nix {};
|
||||
mkModule = close (import ./mk-module.nix);
|
||||
}
|
38
doctrine/lib/mk-module.nix
Normal file
38
doctrine/lib/mk-module.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
name,
|
||||
hm ? null,
|
||||
sys ? null,
|
||||
options ? null,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
doctrine,
|
||||
}: let
|
||||
optionsSet = import options {
|
||||
inherit config lib pkgs cfg name doctrine;
|
||||
};
|
||||
|
||||
configSet = import configFiles.${doctrine.namespace} {
|
||||
inherit config lib pkgs doctrine cfg;
|
||||
};
|
||||
|
||||
configFiles = lib.filterAttrs (k: v: v != null) {
|
||||
inherit sys hm;
|
||||
};
|
||||
|
||||
cfg = config.${doctrine.prefix}.${name};
|
||||
in {
|
||||
config =
|
||||
lib.optionalAttrs (configFiles ? ${doctrine.namespace})
|
||||
(lib.mkIf cfg.enable configSet);
|
||||
|
||||
options = lib.optionalAttrs (options
|
||||
!= null
|
||||
&& optionsSet ? ${doctrine.namespace}) {
|
||||
${doctrine.prefix}.${name} =
|
||||
optionsSet.${doctrine.namespace}
|
||||
// {
|
||||
enable = lib.mkEnableOption name;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -45,8 +45,8 @@
|
|||
trivium = overlay;
|
||||
};
|
||||
|
||||
homeManagerModules.default = ./hm;
|
||||
nixosModules.default = ./nixos;
|
||||
homeManagerModules.default = ./modules;
|
||||
nixosModules.default = ./modules;
|
||||
|
||||
lib = {
|
||||
mkSystemFlake = {
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{}
|
5
modules/default.nix
Normal file
5
modules/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./sway
|
||||
];
|
||||
}
|
13
modules/sway/default.nix
Normal file
13
modules/sway/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
doctrine,
|
||||
...
|
||||
}:
|
||||
doctrine.lib.mkModule {
|
||||
inherit config;
|
||||
name = "sway";
|
||||
sys = ./sys.nix;
|
||||
options = ./options.nix;
|
||||
}
|
3
modules/sway/options.nix
Normal file
3
modules/sway/options.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{...}: {
|
||||
sys = {};
|
||||
}
|
45
modules/sway/sys.nix
Normal file
45
modules/sway/sys.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
services.libinput.enable = true;
|
||||
hardware.graphics.enable = true;
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
extraPortals = with pkgs; [xdg-desktop-portal-gtk];
|
||||
xdgOpenUsePortal = true;
|
||||
|
||||
# warning: xdg-desktop-portal 1.17 reworked how portal implementations are loaded, you
|
||||
# should either set `xdg.portal.config` or `xdg.portal.configPackages`
|
||||
# to specify which portal backend to use for the requested interface.
|
||||
#
|
||||
# https://github.com/flatpak/xdg-desktop-portal/blob/1.18.1/doc/portals.conf.rst.in
|
||||
#
|
||||
# If you simply want to keep the behaviour in < 1.17, which uses the first
|
||||
# portal implementation found in lexicographical order, use the following:
|
||||
#
|
||||
# xdg.portal.config.common.default = "*";
|
||||
config.common.default = "*";
|
||||
};
|
||||
|
||||
environment = {
|
||||
sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
systemPackages = with pkgs; [
|
||||
qt5.qtwayland
|
||||
qt6.qtwayland
|
||||
];
|
||||
};
|
||||
|
||||
programs = {
|
||||
gtklock = {
|
||||
enable = lib.mkDefault true;
|
||||
|
||||
config = {};
|
||||
modules = [];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [];
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{callPackage}: {
|
||||
importAll = callPackage ./importAll.nix {};
|
||||
}
|
|
@ -4,74 +4,73 @@
|
|||
nodePackages,
|
||||
lib,
|
||||
writeShellScriptBin,
|
||||
pkgs
|
||||
}:
|
||||
let
|
||||
pkgs,
|
||||
}: let
|
||||
schemaEngine = "${pkgs.prisma-engines}/bin/schema-engine";
|
||||
queryEngineBin = "${pkgs.prisma-engines}/bin/query-engine";
|
||||
queryEngineLib = "${pkgs.prisma-engines}/lib/libquery_engine.node";
|
||||
buildFlags = [ "--ignore-scripts" ];
|
||||
buildFlags = ["--ignore-scripts"];
|
||||
in
|
||||
buildNpmPackage {
|
||||
pname = "spliit2";
|
||||
version = "master-20250420";
|
||||
buildNpmPackage {
|
||||
pname = "spliit2";
|
||||
version = "master-20250420";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
repo = "spliit";
|
||||
owner = "spliit-app";
|
||||
src = fetchFromGitHub {
|
||||
repo = "spliit";
|
||||
owner = "spliit-app";
|
||||
|
||||
rev = "a11efc79c13298c0d282e47496d132538752405f";
|
||||
hash = "sha256-v4gaPzLzBbbqw/LDYxe1fiyficcrqcGOop23YPiTrdc=";
|
||||
};
|
||||
rev = "a11efc79c13298c0d282e47496d132538752405f";
|
||||
hash = "sha256-v4gaPzLzBbbqw/LDYxe1fiyficcrqcGOop23YPiTrdc=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-sd0/7ruNUFxUKTeTwx/v8Vc/G3llkXP6RSDE78h3qVU=";
|
||||
npmDepsHash = "sha256-sd0/7ruNUFxUKTeTwx/v8Vc/G3llkXP6RSDE78h3qVU=";
|
||||
|
||||
nativeBuildInputs = [ pkgs.openssl ];
|
||||
nativeBuildInputs = [pkgs.openssl];
|
||||
|
||||
npmRebuildFlags = buildFlags;
|
||||
npmRebuildFlags = buildFlags;
|
||||
|
||||
PRISMA_SCHEMA_ENGINE_BINARY = schemaEngine;
|
||||
PRISMA_QUERY_ENGINE_BINARY = queryEngineBin;
|
||||
PRISMA_QUERY_ENGINE_LIBRARY = queryEngineLib;
|
||||
PRISMA_SCHEMA_ENGINE_BINARY = schemaEngine;
|
||||
PRISMA_QUERY_ENGINE_BINARY = queryEngineBin;
|
||||
PRISMA_QUERY_ENGINE_LIBRARY = queryEngineLib;
|
||||
|
||||
preBuild = ''
|
||||
cp -v scripts/build.env .env
|
||||
preBuild = ''
|
||||
cp -v scripts/build.env .env
|
||||
|
||||
npx prisma generate
|
||||
'';
|
||||
npx prisma generate
|
||||
'';
|
||||
|
||||
npmBuildFlags = buildFlags;
|
||||
npmBuildFlags = buildFlags;
|
||||
|
||||
postInstall = ''
|
||||
cp -r .next public package.json next.config.mjs $out/lib/node_modules/spliit2
|
||||
postInstall = ''
|
||||
cp -r .next public package.json next.config.mjs $out/lib/node_modules/spliit2
|
||||
|
||||
install -Dvm755 -t $out/bin ${lib.getExe (writeShellScriptBin "spliit2" ''
|
||||
set -euxo pipefail
|
||||
install -Dvm755 -t $out/bin ${lib.getExe (writeShellScriptBin "spliit2" ''
|
||||
set -euxo pipefail
|
||||
|
||||
cd @out@/lib/node_modules/spliit2
|
||||
cd @out@/lib/node_modules/spliit2
|
||||
|
||||
export PATH="$PWD/node_modules/.bin:$PATH"
|
||||
export NEXT_TELEMETRY_DISABLED=1
|
||||
export PATH="$PWD/node_modules/.bin:$PATH"
|
||||
export NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
export PRISMA_SCHEMA_ENGINE_BINARY="${schemaEngine}"
|
||||
export PRISMA_QUERY_ENGINE_BINARY="${queryEngineBin}"
|
||||
export PRISMA_QUERY_ENGINE_LIBRARY="${queryEngineLib}"
|
||||
export PRISMA_SCHEMA_ENGINE_BINARY="${schemaEngine}"
|
||||
export PRISMA_QUERY_ENGINE_BINARY="${queryEngineBin}"
|
||||
export PRISMA_QUERY_ENGINE_LIBRARY="${queryEngineLib}"
|
||||
|
||||
prisma migrate deploy
|
||||
next start
|
||||
'')}
|
||||
prisma migrate deploy
|
||||
next start
|
||||
'')}
|
||||
|
||||
substituteInPlace $out/bin/spliit2 \
|
||||
--replace @out@ $out
|
||||
substituteInPlace $out/bin/spliit2 \
|
||||
--replace @out@ $out
|
||||
|
||||
wrapProgram $out/bin/spliit2 \
|
||||
--prefix PATH : ${lib.makeBinPath [ pkgs.openssl ]}
|
||||
'';
|
||||
wrapProgram $out/bin/spliit2 \
|
||||
--prefix PATH : ${lib.makeBinPath [pkgs.openssl]}
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Free and Open Source Alternative to Splitwise. Share expenses with your friends and family.";
|
||||
homepage = "https://spliit.app";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [];
|
||||
};
|
||||
}
|
||||
meta = {
|
||||
description = "Free and Open Source Alternative to Splitwise. Share expenses with your friends and family.";
|
||||
homepage = "https://spliit.app";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue