Initial commit

This commit is contained in:
kirbara 2025-12-01 13:23:24 +07:00
commit cfcc57a8bd
Signed by: exp
GPG key ID: D7E63AD0019E75D9
353 changed files with 18756 additions and 0 deletions

View file

@ -0,0 +1,15 @@
{
# autologin is context-aware, parametric aspect.
# it applies only if the context has at least { user }
# meaning that has access to user data
eg.autologin =
{ user, ... }:
{
nixos =
{ config, lib, ... }:
lib.mkIf config.services.displayManager.enable {
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = user.userName;
};
};
}

View file

@ -0,0 +1,9 @@
{
eg.ci-no-boot = {
description = "Disables booting during CI";
nixos = {
boot.loader.grub.enable = false;
fileSystems."/".device = "/dev/null";
};
};
}

View file

@ -0,0 +1,37 @@
# This example implements an aspect "routing" pattern.
#
# Unlike `den.default` which is `parametric.atLeast`
# we use `parametric.fixedTo` here, which help us
# propagate an already computed context to all includes.
#
# This aspect, when installed in a `parametric.atLeast`
# will just forward the same context.
# The `mutual` helper returns an static configuration which
# is ignored by parametric aspects, thus allowing
# non-existing aspects to be just ignored.
#
# Be sure to read: https://vic.github.io/den/dependencies.html
# See usage at: defaults.nix, alice.nix, igloo.nix
#
{ den, eg, ... }:
{
# Usage: `den.default.includes [ eg.routes ]`
eg.routes =
let
inherit (den.lib) parametric;
# eg, `<user>._.<host>` and `<host>._.<user>`
mutual = from: to: den.aspects.${from.aspect}._.${to.aspect} or { };
routes =
{ host, user, ... }@ctx:
{
__functor = parametric.fixedTo ctx;
includes = [
(mutual user host)
(mutual host user)
];
};
in
routes;
}

View file

@ -0,0 +1,16 @@
let
installer = variant: {
nixos =
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-${variant}.nix") ];
};
};
in
{
# make USB/VM installers.
eg.vm-bootable.provides = {
tui = installer "minimal";
gui = installer "graphical-base";
};
}

View file

@ -0,0 +1,15 @@
{ eg, ... }:
{
eg.vm.provides = {
gui.includes = [
eg.vm
eg.vm-bootable._.gui
eg.xfce-desktop
];
tui.includes = [
eg.vm
eg.vm-bootable._.tui
];
};
}

View file

@ -0,0 +1,19 @@
{
eg.xfce-desktop.nixos =
{ lib, ... }:
{
# https://gist.github.com/nat-418/1101881371c9a7b419ba5f944a7118b0
services.xserver = {
enable = true;
desktopManager = {
xterm.enable = false;
xfce.enable = true;
};
};
services.displayManager = {
defaultSession = lib.mkDefault "xfce";
enable = true;
};
};
}