Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
|
2bfcb22a22 |
|
@ -16,12 +16,6 @@
|
|||
in
|
||||
flake-utils.lib.eachDefaultSystem (system: {
|
||||
formatter = (import nixpkgs {inherit system;}).alejandra;
|
||||
|
||||
packages =
|
||||
(import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [(mapOverlayOverride "local" (import ./pkgs))];
|
||||
}).local;
|
||||
})
|
||||
// {
|
||||
templates = let
|
||||
|
|
|
@ -1 +1,10 @@
|
|||
{}
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./programs
|
||||
];
|
||||
}
|
||||
|
|
10
hm/programs/default.nix
Normal file
10
hm/programs/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./firefox
|
||||
];
|
||||
}
|
57
hm/programs/firefox/default.nix
Normal file
57
hm/programs/firefox/default.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.options.trivium.programs.firefox;
|
||||
in {
|
||||
options.options.trivium.programs.firefox = {
|
||||
enable = mkEnableOption "firefox settings";
|
||||
|
||||
workspace = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
i3 Workspace in which Firefox should open. If not set, Firefox will not open at startup
|
||||
'';
|
||||
};
|
||||
|
||||
makeDefaultBrowser = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Take a guess
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
programs.firefox.enable = true;
|
||||
|
||||
xsession.windowManager.i3.config.startup = optional (cfg.workspace != null) {
|
||||
command = "${lib.getExe pkgs.i3-gaps} 'workspace ${cfg.workspace}; exec ${lib.getExe pkgs.firefox}'";
|
||||
};
|
||||
}
|
||||
|
||||
(mkIf cfg.makeDefaultBrowser {
|
||||
xdg = {
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
"text/html" = ["firefox"];
|
||||
"text/uri-list" = ["firefox"];
|
||||
"x-scheme-handler/http" = ["firefox"];
|
||||
"x-scheme-handler/https" = ["firefox"];
|
||||
"x-scheme-handler/about" = ["firefox"];
|
||||
"x-scheme-handler/unknown" = ["firefox"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables.DEFAULT_BROWSER = "${lib.getExe pkgs.firefox}";
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -5,6 +5,4 @@ in {
|
|||
lib = callPackage ./lib {};
|
||||
|
||||
override = {};
|
||||
|
||||
spliit = callPackage ./spliit {};
|
||||
}
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
{
|
||||
buildNpmPackage,
|
||||
fetchFromGitHub,
|
||||
nodePackages,
|
||||
lib,
|
||||
writeShellScriptBin,
|
||||
}:
|
||||
buildNpmPackage {
|
||||
pname = "spliit2";
|
||||
version = "master-20250420";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
repo = "spliit";
|
||||
owner = "spliit-app";
|
||||
|
||||
rev = "a11efc79c13298c0d282e47496d132538752405f";
|
||||
hash = "sha256-v4gaPzLzBbbqw/LDYxe1fiyficcrqcGOop23YPiTrdc=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-sd0/7ruNUFxUKTeTwx/v8Vc/G3llkXP6RSDE78h3qVU=";
|
||||
npmRebuildFlags = ["--ignore-scripts"];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
postPatch = ''
|
||||
cp -v .env.example .env
|
||||
'';
|
||||
|
||||
# nixpkgs/pkgs/applications/office/documenso/default.nix (git)-[master] 05:36:05
|
||||
preBuild = ''
|
||||
# somehow for linux, npm is not finding the prisma package with the
|
||||
# packages installed with the lockfile.
|
||||
# This generates a prisma version incompatibility warning and is a kludge
|
||||
# until the upstream package-lock is modified.
|
||||
${lib.getExe nodePackages.prisma} generate
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
install -Dvm755 -t $out/bin ${lib.getExe (writeShellScriptBin "spliit2" ''
|
||||
set -euxo pipefail
|
||||
|
||||
cd @out@/lib/node_modules/spliit2
|
||||
|
||||
export PATH="$PWD/node_modules/.bin:$PATH"
|
||||
export NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
prisma migrate deploy
|
||||
exec next start
|
||||
'')}
|
||||
|
||||
#kk?
|
||||
#${lib.getExe nodePackages.prisma} migrate deploy
|
||||
|
||||
substituteInPlace $out/bin/spliit2 \
|
||||
--replace @out@ $out
|
||||
'';
|
||||
|
||||
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