Compare commits

...

2 commits

Author SHA1 Message Date
Fabian Montero 8741b32021
add sway module 2025-08-06 13:40:06 -06:00
Fabian Montero 26619394f4
add doctrine 2025-08-06 13:36:43 -06:00
13 changed files with 176 additions and 63 deletions

12
doctrine/default.nix Normal file
View 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
View 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);
}

View 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;
};
};
}

View file

@ -45,8 +45,8 @@
trivium = overlay; trivium = overlay;
}; };
homeManagerModules.default = ./hm; homeManagerModules.default = ./modules;
nixosModules.default = ./nixos; nixosModules.default = ./modules;
lib = { lib = {
mkSystemFlake = { mkSystemFlake = {

View file

@ -1 +0,0 @@
{}

5
modules/default.nix Normal file
View file

@ -0,0 +1,5 @@
{
imports = [
./sway
];
}

13
modules/sway/default.nix Normal file
View 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
View file

@ -0,0 +1,3 @@
{...}: {
sys = {};
}

45
modules/sway/sys.nix Normal file
View 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 = [];
};
};
}

View file

@ -1,8 +0,0 @@
{
config,
lib,
pkgs,
...
}: {
imports = [];
}

View file

@ -1,3 +0,0 @@
{callPackage}: {
importAll = callPackage ./importAll.nix {};
}

View file

@ -4,9 +4,8 @@
nodePackages, nodePackages,
lib, lib,
writeShellScriptBin, writeShellScriptBin,
pkgs pkgs,
}: }: let
let
schemaEngine = "${pkgs.prisma-engines}/bin/schema-engine"; schemaEngine = "${pkgs.prisma-engines}/bin/schema-engine";
queryEngineBin = "${pkgs.prisma-engines}/bin/query-engine"; queryEngineBin = "${pkgs.prisma-engines}/bin/query-engine";
queryEngineLib = "${pkgs.prisma-engines}/lib/libquery_engine.node"; queryEngineLib = "${pkgs.prisma-engines}/lib/libquery_engine.node";