chore: Use nixfmt reformat all nix source code

This commit is contained in:
ulic-youthlic 2026-07-04 23:11:21 +08:00
parent 1cdf00cefe
commit 11337b8f9e
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
184 changed files with 2349 additions and 1943 deletions

View file

@ -4,15 +4,18 @@
flake-parts-lib, flake-parts-lib,
self, self,
... ...
}: let }:
let
inherit (self) outputs; inherit (self) outputs;
inherit (inputs) deploy-rs; inherit (inputs) deploy-rs;
mkDeployNode = { mkDeployNode =
{
hostName, hostName,
unixName ? "deploy", unixName ? "deploy",
system ? "x86_64-linux", system ? "x86_64-linux",
sshName ? hostName, sshName ? hostName,
}: { }:
{
"${hostName}" = { "${hostName}" = {
hostname = "${sshName}"; hostname = "${sshName}";
sshUser = "${unixName}"; sshUser = "${unixName}";
@ -25,7 +28,8 @@
}; };
}; };
}; };
in { in
{
options = { options = {
flake = flake-parts-lib.mkSubmoduleOptions { flake = flake-parts-lib.mkSubmoduleOptions {
deploy = lib.mkOption { deploy = lib.mkOption {
@ -34,7 +38,8 @@ in {
}; };
}; };
config = { config = {
flake.deploy.nodes = with lib; flake.deploy.nodes =
with lib;
pipe pipe
[ [
"Cape" "Cape"

View file

@ -4,7 +4,8 @@
self, self,
rootPath, rootPath,
... ...
}: let }:
let
inherit (self) outputs; inherit (self) outputs;
homeModules = homeModules =
( (
@ -27,19 +28,20 @@
default = import "${toString rootPath}/home/modules"; default = import "${toString rootPath}/home/modules";
extra = import "${toString rootPath}/home/extra"; extra = import "${toString rootPath}/home/extra";
}; };
makeHomeConfiguration = { makeHomeConfiguration =
{
hostName, hostName,
unixName ? "david", unixName ? "david",
system ? "x86_64-linux", system ? "x86_64-linux",
nixpkgs ? inputs.nixpkgs, nixpkgs ? inputs.nixpkgs,
home-manager ? inputs.home-manager, home-manager ? inputs.home-manager,
}: { }:
{
"${unixName}@${hostName}" = home-manager.lib.homeManagerConfiguration { "${unixName}@${hostName}" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs { pkgs = import nixpkgs {
localSystem = { inherit system; }; localSystem = { inherit system; };
}; };
modules = modules = [
[
(rootPath + "/home/${unixName}/configurations/${hostName}") (rootPath + "/home/${unixName}/configurations/${hostName}")
] ]
++ (with homeModules; [ ++ (with homeModules; [
@ -66,9 +68,11 @@
}; };
}; };
}; };
in { in
{
flake = { flake = {
homeConfigurations = with lib; homeConfigurations =
with lib;
foldr (a: b: a // b) { } ( foldr (a: b: a // b) { } (
pipe pipe
[ [

View file

@ -4,16 +4,20 @@
self, self,
rootPath, rootPath,
... ...
}: let }:
let
inherit (self) outputs; inherit (self) outputs;
in { in
{
flake = { flake = {
nixosModules = { nixosModules = {
default = import (rootPath + "/nixos/modules/top-level"); default = import (rootPath + "/nixos/modules/top-level");
gui = import (rootPath + "/nixos/modules/top-level/gui.nix"); gui = import (rootPath + "/nixos/modules/top-level/gui.nix");
}; };
nixosConfigurations = let nixosConfigurations =
makeNixosConfiguration = hostName: let
makeNixosConfiguration =
hostName:
lib.nixpkgs-patcher.nixosSystem { lib.nixpkgs-patcher.nixosSystem {
nixpkgsPatcher.inputs = inputs; nixpkgsPatcher.inputs = inputs;
modules = [ (rootPath + "/nixos/configurations/${hostName}") ]; modules = [ (rootPath + "/nixos/configurations/${hostName}") ];

View file

@ -4,11 +4,14 @@
lib, lib,
rootPath, rootPath,
... ...
}: let }:
let
inherit (self) outputs; inherit (self) outputs;
importWithArgs = lib.flip import { inherit inputs outputs; }; importWithArgs = lib.flip import { inherit inputs outputs; };
in { in
flake.overlays = with lib; {
flake.overlays =
with lib;
pipe pipe
[ [
"modifications" "modifications"

View file

@ -2,22 +2,26 @@
inputs, inputs,
rootPath, rootPath,
... ...
}: { }:
{
imports = [ imports = [
(rootPath + "/treefmt.nix") (rootPath + "/treefmt.nix")
]; ];
perSystem = { perSystem =
{
pkgs, pkgs,
system, system,
lib, lib,
self', self',
inputs', inputs',
... ...
}: let }:
let
patchedNixpkgs = lib.nixpkgs-patcher.patchNixpkgs { patchedNixpkgs = lib.nixpkgs-patcher.patchNixpkgs {
inherit system inputs; inherit system inputs;
}; };
in { in
{
_module.args.pkgs = import patchedNixpkgs { _module.args.pkgs = import patchedNixpkgs {
localSystem = { inherit system; }; localSystem = { inherit system; };
config = { config = {
@ -40,7 +44,8 @@
lua-language-server lua-language-server
]; ];
}; };
legacyPackages = let legacyPackages =
let
inputsScope = lib.makeScope pkgs.newScope (self: { inputsScope = lib.makeScope pkgs.newScope (self: {
inherit inputs rootPath; inherit inputs rootPath;
srcs = self.callPackage (rootPath + "/_sources/generated.nix") { }; srcs = self.callPackage (rootPath + "/_sources/generated.nix") { };
@ -53,15 +58,18 @@
directory = rootPath + "/pkgs"; directory = rootPath + "/pkgs";
} }
); );
packages = let packages =
flattenPkgs = path: value: let
if lib.isDerivation value flattenPkgs =
then { path: value:
if lib.isDerivation value then
{
${lib.concatStringsSep ":" path} = value; ${lib.concatStringsSep ":" path} = value;
} }
else if lib.isAttrs value else if lib.isAttrs value then
then lib.concatMapAttrs (name: flattenPkgs (path ++ [name])) value lib.concatMapAttrs (name: flattenPkgs (path ++ [ name ])) value
else {}; else
{ };
in in
flattenPkgs [ ] ( flattenPkgs [ ] (
lib.removeAttrs self'.legacyPackages [ lib.removeAttrs self'.legacyPackages [
@ -77,10 +85,8 @@
"callPackage" "callPackage"
] ]
); );
checks = checks = lib.concatMapAttrs (name: value: {
lib.concatMapAttrs (name: value: {
"package-${name}" = value; "package-${name}" = value;
}) }) self'.packages;
self'.packages;
}; };
} }

View file

@ -2,7 +2,8 @@
pkgs, pkgs,
unixName, unixName,
... ...
}: { }:
{
youthlic = { youthlic = {
xdg-dirs.enable = true; xdg-dirs.enable = true;
programs = { programs = {

View file

@ -4,15 +4,18 @@
unixName, unixName,
config, config,
... ...
}: { }:
{
imports = lib.youthlic.loadImports ./.; imports = lib.youthlic.loadImports ./.;
youthlic = { youthlic = {
xdg-dirs.enable = true; xdg-dirs.enable = true;
programs = let programs =
let
email = config.accounts.email.accounts.ulic-youthlic; email = config.accounts.email.accounts.ulic-youthlic;
inherit (email) address name; inherit (email) address name;
signKey = email.gpg.key; signKey = email.gpg.key;
in { in
{
gpg.enable = true; gpg.enable = true;
git = { git = {
inherit name signKey; inherit name signKey;

View file

@ -4,15 +4,18 @@
config, config,
unixName, unixName,
... ...
}: { }:
{
imports = lib.youthlic.loadImports ./.; imports = lib.youthlic.loadImports ./.;
youthlic = { youthlic = {
xdg-dirs.enable = true; xdg-dirs.enable = true;
programs = let programs =
let
email = config.accounts.email.accounts.ulic-youthlic; email = config.accounts.email.accounts.ulic-youthlic;
inherit (email) name address; inherit (email) name address;
signKey = email.gpg.key; signKey = email.gpg.key;
in { in
{
rustypaste-cli.enable = true; rustypaste-cli.enable = true;
gpg.enable = true; gpg.enable = true;
jujutsu = { jujutsu = {

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.david.programs.niri; cfg = config.david.programs.niri;
in { in
{
david.programs.niri = lib.mkIf cfg.enable { david.programs.niri = lib.mkIf cfg.enable {
wluma.extraSettings = { wluma.extraSettings = {
output = { output = {

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.david.accounts.email; cfg = config.david.accounts.email;
in { in
{
options = { options = {
david.accounts.email = { david.accounts.email = {
enable = lib.mkEnableOption "emails"; enable = lib.mkEnableOption "emails";

View file

@ -3,9 +3,11 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.david.programs.alacritty; cfg = config.david.programs.alacritty;
in { in
{
options = { options = {
david.programs.alacritty = { david.programs.alacritty = {
enable = lib.mkEnableOption "alacritty"; enable = lib.mkEnableOption "alacritty";

View file

@ -2,9 +2,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.david.programs.chromium; cfg = config.david.programs.chromium;
in { in
{
options = { options = {
david.programs.chromium = { david.programs.chromium = {
enable = lib.mkEnableOption "chromium"; enable = lib.mkEnableOption "chromium";

View file

@ -3,9 +3,11 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.david.programs.espanso; cfg = config.david.programs.espanso;
in { in
{
options = { options = {
david.programs.espanso = { david.programs.espanso = {
enable = lib.mkEnableOption "espanso"; enable = lib.mkEnableOption "espanso";

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.david.programs.foot; cfg = config.david.programs.foot;
in { in
{
options = { options = {
david.programs.foot = { david.programs.foot = {
enable = lib.mkEnableOption "foot"; enable = lib.mkEnableOption "foot";

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.david.programs.fuzzel; cfg = config.david.programs.fuzzel;
in { in
{
options = { options = {
david.programs.fuzzel = { david.programs.fuzzel = {
enable = lib.mkEnableOption "fuzzel"; enable = lib.mkEnableOption "fuzzel";

View file

@ -2,15 +2,18 @@
config, config,
lib, lib,
... ...
}: { }:
{
options = { options = {
david.programs.ghostty = { david.programs.ghostty = {
enable = lib.mkEnableOption "ghostty"; enable = lib.mkEnableOption "ghostty";
}; };
}; };
config = let config =
let
cfg = config.david.programs.ghostty; cfg = config.david.programs.ghostty;
in (lib.mkIf cfg.enable { in
(lib.mkIf cfg.enable {
stylix.targets.ghostty.enable = false; stylix.targets.ghostty.enable = false;
programs.ghostty = lib.mkMerge [ programs.ghostty = lib.mkMerge [
{ {

View file

@ -3,9 +3,11 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.david.programs.helix; cfg = config.david.programs.helix;
in { in
{
options = { options = {
david.programs.helix = { david.programs.helix = {
enable = lib.mkEnableOption "helix"; enable = lib.mkEnableOption "helix";

View file

@ -2,9 +2,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.david.programs.kanshi; cfg = config.david.programs.kanshi;
in { in
{
options = { options = {
david.programs.kanshi = { david.programs.kanshi = {
enable = lib.mkEnableOption "kanshi"; enable = lib.mkEnableOption "kanshi";

View file

@ -3,9 +3,11 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.david.programs.mpv; cfg = config.david.programs.mpv;
in { in
{
options = { options = {
david.programs.mpv = { david.programs.mpv = {
enable = lib.mkEnableOption "mpv"; enable = lib.mkEnableOption "mpv";

View file

@ -3,12 +3,12 @@
lib, lib,
inputs, inputs,
... ...
}: { }:
{
config.david.programs.niri.config = config.david.programs.niri.config =
let let
inherit (lib) getExe getExe'; inherit (lib) getExe getExe';
inherit inherit (inputs.niri-flake.lib.kdl)
(inputs.niri-flake.lib.kdl)
# node with args, props and children # node with args, props and children
# node:: \lambda name -> [argOrProp] -> [child] -> Output # node:: \lambda name -> [argOrProp] -> [child] -> Output
# arg: single value # arg: single value
@ -43,7 +43,8 @@
( (
let let
spawn = leaf "spawn"; spawn = leaf "spawn";
in [ in
[
(plain "binds" [ (plain "binds" [
# (plain "Mod+V" [ # (plain "Mod+V" [
# (spawn [cliphist-fuzzel-img]) # (spawn [cliphist-fuzzel-img])
@ -136,8 +137,7 @@
(plain "Mod+Q" [ (plain "Mod+Q" [
(flag "close-window") (flag "close-window")
]) ])
( (node "Mod+O"
node "Mod+O"
[ { repeat = false; } ] [ { repeat = false; } ]
[ [
(flag "toggle-overview") (flag "toggle-overview")
@ -287,15 +287,13 @@
(plain "Mod+Ctrl+I" [ (plain "Mod+Ctrl+I" [
(flag "move-workspace-up") (flag "move-workspace-up")
]) ])
( (node "Mod+Shift+WheelScrollDown"
node "Mod+Shift+WheelScrollDown"
[ { cooldown-ms = 150; } ] [ { cooldown-ms = 150; } ]
[ [
(flag "focus-workspace-down") (flag "focus-workspace-down")
] ]
) )
( (node "Mod+Shift+WheelScrollUp"
node "Mod+Shift+WheelScrollUp"
[ { cooldown-ms = 150; } ] [ { cooldown-ms = 150; } ]
[ [
(flag "focus-workspace-up") (flag "focus-workspace-up")
@ -385,15 +383,13 @@
(plain "Mod+Period" [ (plain "Mod+Period" [
(flag "expel-window-from-column") (flag "expel-window-from-column")
]) ])
( (node "Mod+R"
node "Mod+R"
[ { repeat = false; } ] [ { repeat = false; } ]
[ [
(flag "switch-preset-column-width") (flag "switch-preset-column-width")
] ]
) )
( (node "Mod+Shift+R"
node "Mod+Shift+R"
[ { repeat = false; } ] [ { repeat = false; } ]
[ [
(flag "switch-preset-window-height") (flag "switch-preset-window-height")
@ -402,22 +398,19 @@
(plain "Mod+Ctrl+R" [ (plain "Mod+Ctrl+R" [
(flag "reset-window-height") (flag "reset-window-height")
]) ])
( (node "Mod+M"
node "Mod+M"
[ { repeat = false; } ] [ { repeat = false; } ]
[ [
(flag "maximize-column") (flag "maximize-column")
] ]
) )
( (node "Mod+Shift+M"
node "Mod+Shift+M"
[ { repeat = false; } ] [ { repeat = false; } ]
[ [
(flag "fullscreen-window") (flag "fullscreen-window")
] ]
) )
( (node "Mod+Ctrl+M"
node "Mod+Ctrl+M"
[ { repeat = false; } ] [ { repeat = false; } ]
[ [
(flag "maximize-window-to-edges") (flag "maximize-window-to-edges")
@ -426,29 +419,25 @@
(plain "Mod+Z" [ (plain "Mod+Z" [
(flag "center-column") (flag "center-column")
]) ])
( (node "Mod+Minus"
node "Mod+Minus"
[ { repeat = false; } ] [ { repeat = false; } ]
[ [
(leaf "set-column-width" [ "-10%" ]) (leaf "set-column-width" [ "-10%" ])
] ]
) )
( (node "Mod+Equal"
node "Mod+Equal"
[ { repeat = false; } ] [ { repeat = false; } ]
[ [
(leaf "set-column-width" [ "+10%" ]) (leaf "set-column-width" [ "+10%" ])
] ]
) )
( (node "Mod+Shift+Minus"
node "Mod+Shift+Minus"
[ { repeat = false; } ] [ { repeat = false; } ]
[ [
(leaf "set-window-height" [ "-10%" ]) (leaf "set-window-height" [ "-10%" ])
] ]
) )
( (node "Mod+Shift+Equal"
node "Mod+Shift+Equal"
[ { repeat = false; } ] [ { repeat = false; } ]
[ [
(leaf "set-window-height" [ "+10%" ]) (leaf "set-window-height" [ "+10%" ])
@ -595,7 +584,8 @@
let let
window-rule = plain "window-rule"; window-rule = plain "window-rule";
match = leaf "match"; match = leaf "match";
in [ in
[
(window-rule [ (window-rule [
(leaf "draw-border-with-background" [ true ]) (leaf "draw-border-with-background" [ true ])
(leaf "geometry-corner-radius" [ 0.0 ]) (leaf "geometry-corner-radius" [ 0.0 ])

View file

@ -3,20 +3,22 @@
lib, lib,
inputs, inputs,
pkgs, pkgs,
osConfig ? (throw "Trying to access osConfig, the home-manager module is not being used in the nixos module"), osConfig ? (
throw "Trying to access osConfig, the home-manager module is not being used in the nixos module"
),
options, options,
... ...
}: let }:
let
cfg = config.david.programs.niri; cfg = config.david.programs.niri;
in { in
{
imports = [ imports = [
./config.nix ./config.nix
]; ];
options = { options = {
david.programs.niri = { david.programs.niri = {
enable = enable = (lib.mkEnableOption "niri") // {
(lib.mkEnableOption "niri")
// {
default = osConfig.youthlic.gui.enabled == "niri"; default = osConfig.youthlic.gui.enabled == "niri";
}; };
config = lib.mkOption { config = lib.mkOption {
@ -25,8 +27,10 @@ in {
configHelper = lib.mkOption { configHelper = lib.mkOption {
type = lib.types.anything; type = lib.types.anything;
default = { default = {
validated-config-for = configuration: validated-config-for =
pkgs.runCommand "config.kdl" { configuration:
pkgs.runCommand "config.kdl"
{
inherit configuration; inherit configuration;
passAsFile = [ "configuration" ]; passAsFile = [ "configuration" ];
buildInputs = [ config.programs.niri.package ]; buildInputs = [ config.programs.niri.package ];
@ -52,12 +56,14 @@ in {
swayimg swayimg
seahorse seahorse
]; ];
xdg.configFile = let xdg.configFile =
let
qtctConf = '' qtctConf = ''
[Appearance] [Appearance]
standard_dialogs=xdgdesktopportal standard_dialogs=xdgdesktopportal
''; '';
in { in
{
"qt5ct/qt5ct.conf" = { "qt5ct/qt5ct.conf" = {
text = qtctConf; text = qtctConf;
}; };
@ -83,10 +89,10 @@ in {
}; };
programs = { programs = {
niri = { niri = {
config = config = cfg.config ++ [
cfg.config (inputs.niri-flake.lib.kdl.leaf "include" [
++ [ (toString config.david.programs.noctalia.niriExtraConfig)
(inputs.niri-flake.lib.kdl.leaf "include" [(toString config.david.programs.noctalia.niriExtraConfig)]) ])
]; ];
}; };
}; };

View file

@ -4,15 +4,31 @@
inputs, inputs,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.david.programs.noctalia; cfg = config.david.programs.noctalia;
inherit (inputs.niri-flake.lib.kdl) node leaf flag plain; inherit (inputs.niri-flake.lib.kdl)
node
leaf
flag
plain
;
spawn = leaf "spawn"; spawn = leaf "spawn";
noctalia = args: (spawn (["noctalia-shell" "ipc" "call"] ++ args)); noctalia =
args:
(spawn (
[
"noctalia-shell"
"ipc"
"call"
]
++ args
));
layer-rule = plain "layer-rule"; layer-rule = plain "layer-rule";
match = leaf "match"; match = leaf "match";
in { in
{
options = { options = {
david.programs.noctalia = { david.programs.noctalia = {
enable = lib.mkEnableOption "noctalia"; enable = lib.mkEnableOption "noctalia";
@ -21,17 +37,60 @@ in {
default = [ default = [
(leaf "spawn-at-startup" [ (lib.getExe config.programs.noctalia-shell.package) ]) (leaf "spawn-at-startup" [ (lib.getExe config.programs.noctalia-shell.package) ])
(plain "binds" [ (plain "binds" [
(plain "Mod+V" [(noctalia ["launcher" "clipboard"])]) (plain "Mod+V" [
(plain "Mod+Shift+P" [(noctalia ["lockScreen" "lock"])]) (noctalia [
(plain "Mod+Space" [(noctalia ["launcher" "toggle"])]) "launcher"
(node "XF86AudioRaiseVolume" [{allow-when-locked = true;}] "clipboard"
[(noctalia ["volume" "increase"])]) ])
(node "XF86AudioLowerVolume" [{allow-when-locked = true;}] ])
[(noctalia ["volume" "decrease"])]) (plain "Mod+Shift+P" [
(node "XF86AudioMute" [{allow-when-locked = true;}] (noctalia [
[(noctalia ["volume" "muteOutput"])]) "lockScreen"
(node "XF86AudioMicMute" [{allow-when-locked = true;}] "lock"
[(noctalia ["volume" "muteInput"])]) ])
])
(plain "Mod+Space" [
(noctalia [
"launcher"
"toggle"
])
])
(node "XF86AudioRaiseVolume"
[ { allow-when-locked = true; } ]
[
(noctalia [
"volume"
"increase"
])
]
)
(node "XF86AudioLowerVolume"
[ { allow-when-locked = true; } ]
[
(noctalia [
"volume"
"decrease"
])
]
)
(node "XF86AudioMute"
[ { allow-when-locked = true; } ]
[
(noctalia [
"volume"
"muteOutput"
])
]
)
(node "XF86AudioMicMute"
[ { allow-when-locked = true; } ]
[
(noctalia [
"volume"
"muteInput"
])
]
)
]) ])
(layer-rule [ (layer-rule [
(match [ { namespace = "^noctalia-wallpaper-.*$"; } ]) (match [ { namespace = "^noctalia-wallpaper-.*$"; } ])
@ -54,38 +113,46 @@ in {
]) ])
]) ])
]; ];
apply = configuration: config.david.programs.niri.configHelper.validated-config-for (inputs.niri-flake.lib.kdl.serialize.nodes configuration); apply =
configuration:
config.david.programs.niri.configHelper.validated-config-for (
inputs.niri-flake.lib.kdl.serialize.nodes configuration
);
}; };
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
stylix.targets.noctalia-shell.enable = false; stylix.targets.noctalia-shell.enable = false;
home.packages = [pkgs.app2unit pkgs.gpu-screen-recorder]; home.packages = [
pkgs.app2unit
pkgs.gpu-screen-recorder
];
programs.noctalia-shell = { programs.noctalia-shell = {
enable = true; enable = true;
plugins = builtins.fromJSON (builtins.readFile ./plugins.json); plugins = builtins.fromJSON (builtins.readFile ./plugins.json);
pluginSettings = let pluginSettings =
enabledPlugins = with lib; let
enabledPlugins =
with lib;
flip pipe [ flip pipe [
(filterAttrs (_name: settings: settings.enabled or false)) (filterAttrs (_name: settings: settings.enabled or false))
builtins.attrNames builtins.attrNames
] ] config.programs.noctalia-shell.plugins.states;
config.programs.noctalia-shell.plugins.states; staticSettings = lib.genAttrs enabledPlugins (
staticSettings = lib.genAttrs enabledPlugins (name: let name:
let
pluginSettingPath = ./plugin + "/${name}.json"; pluginSettingPath = ./plugin + "/${name}.json";
in in
if lib.pathIsRegularFile pluginSettingPath if lib.pathIsRegularFile pluginSettingPath then
then builtins.fromJSON (builtins.readFile pluginSettingPath) builtins.fromJSON (builtins.readFile pluginSettingPath)
else {}); else
{ }
);
in in
lib.recursiveUpdate lib.recursiveUpdate staticSettings {
staticSettings {
screen-recorder.directory = "${config.xdg.userDirs.videos}/records"; screen-recorder.directory = "${config.xdg.userDirs.videos}/records";
}; };
settings = settings = lib.recursiveUpdate (builtins.fromJSON (builtins.readFile ./settings.json)) {
lib.recursiveUpdate
(builtins.fromJSON (builtins.readFile ./settings.json))
{
general.avatarImage = "${config.home.homeDirectory}/.face"; general.avatarImage = "${config.home.homeDirectory}/.face";
wallpaper.directory = "${config.home.homeDirectory}/${config.david.wallpaper.path}"; wallpaper.directory = "${config.home.homeDirectory}/${config.david.wallpaper.path}";
}; };

View file

@ -3,9 +3,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.david.programs.openssh; cfg = config.david.programs.openssh;
in { in
{
options = { options = {
david.programs.openssh = { david.programs.openssh = {
enable = lib.mkEnableOption "openssh"; enable = lib.mkEnableOption "openssh";

View file

@ -2,9 +2,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.david.programs.radicle; cfg = config.david.programs.radicle;
in { in
{
options = { options = {
david.programs.radicle = { david.programs.radicle = {
enable = lib.mkEnableOption "radicle"; enable = lib.mkEnableOption "radicle";

View file

@ -4,10 +4,12 @@
inputs, inputs,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.david.programs.spotify; cfg = config.david.programs.spotify;
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in { in
{
options = { options = {
david.programs.spotify = { david.programs.spotify = {
enable = lib.mkEnableOption "spotify"; enable = lib.mkEnableOption "spotify";

View file

@ -3,9 +3,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.david.programs.swaylock; cfg = config.david.programs.swaylock;
in { in
{
options = { options = {
david.programs.swaylock = { david.programs.swaylock = {
enable = lib.mkEnableOption "swaylock"; enable = lib.mkEnableOption "swaylock";

View file

@ -2,9 +2,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.david.programs.swaync; cfg = config.david.programs.swaync;
in { in
{
options = { options = {
david.programs.swaync = { david.programs.swaync = {
enable = lib.mkEnableOption "swaync"; enable = lib.mkEnableOption "swaync";

View file

@ -3,9 +3,11 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.david.programs.thunderbird; cfg = config.david.programs.thunderbird;
in { in
{
options = { options = {
david.programs.thunderbird = { david.programs.thunderbird = {
enable = lib.mkEnableOption "thunderbird"; enable = lib.mkEnableOption "thunderbird";

View file

@ -4,9 +4,11 @@
lib, lib,
options, options,
... ...
}: let }:
let
cfg = config.david.programs.waybar; cfg = config.david.programs.waybar;
in { in
{
options = { options = {
david.programs.waybar = { david.programs.waybar = {
enable = lib.mkEnableOption "waybar"; enable = lib.mkEnableOption "waybar";

View file

@ -3,9 +3,11 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.david.programs.waypaper; cfg = config.david.programs.waypaper;
in { in
{
options = { options = {
david.programs.waypaper = { david.programs.waypaper = {
enable = lib.mkEnableOption "waypaper"; enable = lib.mkEnableOption "waypaper";

View file

@ -3,9 +3,11 @@
config, config,
options, options,
... ...
}: let }:
let
cfg = config.david.programs.wluma; cfg = config.david.programs.wluma;
in { in
{
options = { options = {
david.programs.wluma = { david.programs.wluma = {
enable = lib.mkEnableOption "wluma"; enable = lib.mkEnableOption "wluma";
@ -33,8 +35,7 @@ in {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.wluma = { services.wluma = {
enable = true; enable = true;
settings = settings = {
{
als = { als = {
webcam = { webcam = {
video = 0; video = 0;

View file

@ -3,9 +3,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.david.programs.zed-editor; cfg = config.david.programs.zed-editor;
in { in
{
options = { options = {
david.programs.zed-editor = { david.programs.zed-editor = {
enable = lib.mkEnableOption "zed-editor"; enable = lib.mkEnableOption "zed-editor";

View file

@ -3,9 +3,11 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.david.programs.zen-browser; cfg = config.david.programs.zen-browser;
in { in
{
options = { options = {
david.programs.zen-browser = { david.programs.zen-browser = {
enable = lib.mkEnableOption "zen-browser"; enable = lib.mkEnableOption "zen-browser";
@ -215,11 +217,14 @@ in {
}; };
policies = { policies = {
DisableAppUpdate = true; DisableAppUpdate = true;
Preferences = let Preferences =
mkLockedAttrs = builtins.mapAttrs (_: value: { let
mkLockedAttrs = builtins.mapAttrs (
_: value: {
Value = value; Value = value;
Status = "locked"; Status = "locked";
}); }
);
in in
mkLockedAttrs { mkLockedAttrs {
"browser.tabs.closeTabByDblclick" = true; "browser.tabs.closeTabByDblclick" = true;

View file

@ -3,9 +3,11 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.david.wallpaper; cfg = config.david.wallpaper;
in { in
{
options = { options = {
david.wallpaper = { david.wallpaper = {
enable = lib.mkEnableOption "wallpaper"; enable = lib.mkEnableOption "wallpaper";

View file

@ -2,7 +2,8 @@
lib, lib,
inputs, inputs,
... ...
}: { }:
{
imports = imports =
(with inputs; [ (with inputs; [
niri-flake.homeModules.niri niri-flake.homeModules.niri

View file

@ -4,7 +4,8 @@
pkgs, pkgs,
inputs, inputs,
... ...
}: { }:
{
config = { config = {
nixpkgs = { nixpkgs = {
config = { config = {

View file

@ -2,7 +2,8 @@
lib, lib,
inputs, inputs,
... ...
}: { }:
{
imports = imports =
(with inputs; [ (with inputs; [
sops-nix.homeManagerModules.sops sops-nix.homeManagerModules.sops

View file

@ -2,9 +2,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.youthlic.programs.atuin; cfg = config.youthlic.programs.atuin;
in { in
{
options = { options = {
youthlic.programs.atuin = { youthlic.programs.atuin = {
enable = lib.mkEnableOption "atuin"; enable = lib.mkEnableOption "atuin";

View file

@ -3,9 +3,11 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.youthlic.programs.awscli; cfg = config.youthlic.programs.awscli;
in { in
{
options = { options = {
youthlic.programs.awscli = { youthlic.programs.awscli = {
enable = lib.mkEnableOption "awscli"; enable = lib.mkEnableOption "awscli";

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.bash; cfg = config.youthlic.programs.bash;
in { in
{
options = { options = {
youthlic.programs.bash = { youthlic.programs.bash = {
enable = lib.mkEnableOption "bash"; enable = lib.mkEnableOption "bash";

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.direnv; cfg = config.youthlic.programs.direnv;
in { in
{
options = { options = {
youthlic.programs.direnv = { youthlic.programs.direnv = {
enable = lib.mkEnableOption "direnv"; enable = lib.mkEnableOption "direnv";

View file

@ -2,12 +2,14 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.eza; cfg = config.youthlic.programs.eza;
fish-cfg = config.youthlic.programs.fish; fish-cfg = config.youthlic.programs.fish;
bash-cfg = config.youthlic.programs.bash; bash-cfg = config.youthlic.programs.bash;
ion-cfg = config.youthlic.programs.ion; ion-cfg = config.youthlic.programs.ion;
in { in
{
options = { options = {
youthlic.programs.eza = { youthlic.programs.eza = {
enable = lib.mkEnableOption "eza"; enable = lib.mkEnableOption "eza";

View file

@ -3,9 +3,11 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.youthlic.programs.fish; cfg = config.youthlic.programs.fish;
in { in
{
options = { options = {
youthlic.programs.fish = { youthlic.programs.fish = {
enable = lib.mkEnableOption "fish"; enable = lib.mkEnableOption "fish";
@ -37,7 +39,7 @@ in {
onEvent = "fish_command_not_found"; onEvent = "fish_command_not_found";
}; };
fish_greeting = { fish_greeting = {
body = ''''; body = "";
}; };
nani = { nani = {
body = body =

View file

@ -2,11 +2,13 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.fzf; cfg = config.youthlic.programs.fzf;
fish-cfg = config.youthlic.programs.fish; fish-cfg = config.youthlic.programs.fish;
bash-cfg = config.youthlic.programs.bash; bash-cfg = config.youthlic.programs.bash;
in { in
{
options = { options = {
youthlic.programs.fzf = { youthlic.programs.fzf = {
enable = lib.mkEnableOption "fzf"; enable = lib.mkEnableOption "fzf";

View file

@ -2,7 +2,8 @@
config, config,
lib, lib,
... ...
}: { }:
{
options = { options = {
youthlic.programs.git = { youthlic.programs.git = {
email = lib.mkOption { email = lib.mkOption {
@ -13,7 +14,7 @@
}; };
name = lib.mkOption { name = lib.mkOption {
type = lib.types.str; type = lib.types.str;
example = ''youthlic''; example = "youthlic";
description = '' description = ''
git name git name
''; '';
@ -30,7 +31,8 @@
encrypt-credential = lib.mkEnableOption "encrypt git credential"; encrypt-credential = lib.mkEnableOption "encrypt git credential";
}; };
}; };
config = let config =
let
cfg = config.youthlic.programs.git; cfg = config.youthlic.programs.git;
in in
lib.mkMerge [ lib.mkMerge [

View file

@ -4,13 +4,15 @@
lib, lib,
outputs, outputs,
... ...
}: { }:
{
options = { options = {
youthlic.programs.gpg = { youthlic.programs.gpg = {
enable = lib.mkEnableOption "gpg"; enable = lib.mkEnableOption "gpg";
}; };
}; };
config = let config =
let
cfg = config.youthlic.programs.gpg; cfg = config.youthlic.programs.gpg;
in in
lib.mkIf cfg.enable { lib.mkIf cfg.enable {

View file

@ -3,10 +3,12 @@
pkgs, pkgs,
config, config,
... ...
}: let }:
let
cfg = config.youthlic.programs.helix; cfg = config.youthlic.programs.helix;
defaultLanguagesSettings = config.programs.helix.package.passthru.languages.language; defaultLanguagesSettings = config.programs.helix.package.passthru.languages.language;
in { in
{
options = { options = {
youthlic.programs.helix = { youthlic.programs.helix = {
enable = lib.mkEnableOption "helix"; enable = lib.mkEnableOption "helix";
@ -36,7 +38,8 @@ in {
type = lib.types.listOf lib.types.package; type = lib.types.listOf lib.types.package;
default = [ ]; default = [ ];
example = ( example = (
with pkgs; [ with pkgs;
[
deno deno
] ]
); );
@ -53,7 +56,8 @@ in {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
extraPackages = cfg.extraPackages; extraPackages = cfg.extraPackages;
settings = with lib; settings =
with lib;
pipe ./config.toml [ pipe ./config.toml [
builtins.readFile builtins.readFile
fromTOML fromTOML

View file

@ -2,9 +2,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.youthlic.programs.ion; cfg = config.youthlic.programs.ion;
in { in
{
options = { options = {
youthlic.programs.ion = { youthlic.programs.ion = {
enable = lib.mkEnableOption "ion"; enable = lib.mkEnableOption "ion";

View file

@ -3,9 +3,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.jujutsu; cfg = config.youthlic.programs.jujutsu;
in { in
{
options = { options = {
youthlic.programs.jujutsu = { youthlic.programs.jujutsu = {
enable = lib.mkEnableOption "jujutsu"; enable = lib.mkEnableOption "jujutsu";
@ -26,7 +28,7 @@ in {
}; };
name = lib.mkOption { name = lib.mkOption {
type = lib.types.str; type = lib.types.str;
example = ''youthlic''; example = "youthlic";
description = '' description = ''
jujutsu name jujutsu name
''; '';
@ -43,10 +45,27 @@ in {
settings = { settings = {
"$schema" = "https://jj-vcs.github.io/jj/latest/config-schema.json"; "$schema" = "https://jj-vcs.github.io/jj/latest/config-schema.json";
aliases = { aliases = {
dlog = ["log" "-r"]; dlog = [
l = ["log" "-r" "(trunk()..@):: | (trunk()..@)-"]; "log"
fresh = ["new" "trunk()"]; "-r"
tug = ["bookmark" "move" "--from" "closest_bookmark(@)" "--to" "closest_pushable(@)"]; ];
l = [
"log"
"-r"
"(trunk()..@):: | (trunk()..@)-"
];
fresh = [
"new"
"trunk()"
];
tug = [
"bookmark"
"move"
"--from"
"closest_bookmark(@)"
"--to"
"closest_pushable(@)"
];
}; };
snapshot = { snapshot = {
auto-track = "true"; auto-track = "true";
@ -84,7 +103,8 @@ in {
}; };
revset-aliases = { revset-aliases = {
"closest_bookmark(to)" = "heads(::to & bookmarks())"; "closest_bookmark(to)" = "heads(::to & bookmarks())";
"closest_pushable(to)" = "heads(::to & mutable() & ~description(exact:\"\") & (~empty() | merges()))"; "closest_pushable(to)" =
"heads(::to & mutable() & ~description(exact:\"\") & (~empty() | merges()))";
"desc(x)" = "description(x)"; "desc(x)" = "description(x)";
"pending()" = ".. ~ ::tags() ~ ::remote_bookmarks() ~ @ ~ private()"; "pending()" = ".. ~ ::tags() ~ ::remote_bookmarks() ~ @ ~ private()";
"private()" = '' "private()" = ''

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.kvm; cfg = config.youthlic.programs.kvm;
in { in
{
options = { options = {
youthlic.programs.kvm = { youthlic.programs.kvm = {
enable = lib.mkEnableOption "kvm"; enable = lib.mkEnableOption "kvm";

View file

@ -2,9 +2,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.youthlic.programs.radicle; cfg = config.youthlic.programs.radicle;
in { in
{
options = { options = {
youthlic.programs.radicle = { youthlic.programs.radicle = {
enable = lib.mkEnableOption "radicle"; enable = lib.mkEnableOption "radicle";

View file

@ -3,9 +3,11 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.youthlic.programs.rustypaste-cli; cfg = config.youthlic.programs.rustypaste-cli;
in { in
{
options = { options = {
youthlic.programs.rustypaste-cli = { youthlic.programs.rustypaste-cli = {
enable = lib.mkEnableOption "rustypaste-cli"; enable = lib.mkEnableOption "rustypaste-cli";

View file

@ -4,7 +4,8 @@
pkgs, pkgs,
rootPath, rootPath,
... ...
}: { }:
{
options = { options = {
youthlic.programs.sops = { youthlic.programs.sops = {
enable = lib.mkOption { enable = lib.mkOption {
@ -24,12 +25,14 @@
}; };
}; };
}; };
config = let config =
let
cfg = config.youthlic.programs.sops; cfg = config.youthlic.programs.sops;
in in
lib.mkIf cfg.enable { lib.mkIf cfg.enable {
home.packages = ( home.packages = (
with pkgs; [ with pkgs;
[
sops sops
age age
] ]

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.spotifyd; cfg = config.youthlic.programs.spotifyd;
in { in
{
options = { options = {
youthlic.programs.spotifyd = { youthlic.programs.spotifyd = {
enable = lib.mkEnableOption "spotifyd"; enable = lib.mkEnableOption "spotifyd";

View file

@ -2,12 +2,14 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.youthlic.programs.starship; cfg = config.youthlic.programs.starship;
fish-cfg = config.youthlic.programs.fish; fish-cfg = config.youthlic.programs.fish;
bash-cfg = config.youthlic.programs.bash; bash-cfg = config.youthlic.programs.bash;
ion-cfg = config.youthlic.programs.ion; ion-cfg = config.youthlic.programs.ion;
in { in
{
options = { options = {
youthlic.programs.starship = { youthlic.programs.starship = {
enable = lib.mkEnableOption "starship"; enable = lib.mkEnableOption "starship";
@ -18,7 +20,8 @@ in {
programs.starship = { programs.starship = {
enable = true; enable = true;
enableTransience = true; enableTransience = true;
settings = let settings =
let
config-file = builtins.readFile ./config.toml; config-file = builtins.readFile ./config.toml;
in in
builtins.fromTOML config-file; builtins.fromTOML config-file;

View file

@ -3,11 +3,13 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.youthlic.programs.yazi; cfg = config.youthlic.programs.yazi;
fish-cfg = config.youthlic.programs.fish; fish-cfg = config.youthlic.programs.fish;
bash-cfg = config.youthlic.programs.bash; bash-cfg = config.youthlic.programs.bash;
in { in
{
options = { options = {
youthlic.programs.yazi = { youthlic.programs.yazi = {
enable = lib.mkEnableOption "yazi"; enable = lib.mkEnableOption "yazi";
@ -22,8 +24,7 @@ in {
enable = true; enable = true;
shellWrapperName = "y"; shellWrapperName = "y";
plugins = { plugins = {
inherit inherit (pkgs.yaziPlugins)
(pkgs.yaziPlugins)
ouch ouch
starship starship
piper piper

View file

@ -2,11 +2,13 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.zoxide; cfg = config.youthlic.programs.zoxide;
fish-cfg = config.youthlic.programs.fish; fish-cfg = config.youthlic.programs.fish;
bash-cfg = config.youthlic.programs.bash; bash-cfg = config.youthlic.programs.bash;
in { in
{
options = { options = {
youthlic.programs.zoxide = { youthlic.programs.zoxide = {
enable = lib.mkEnableOption "zoxide"; enable = lib.mkEnableOption "zoxide";

View file

@ -2,9 +2,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.youthlic.xdg-dirs; cfg = config.youthlic.xdg-dirs;
in { in
{
options = { options = {
youthlic.xdg-dirs = { youthlic.xdg-dirs = {
enable = lib.mkEnableOption "xdg-dirs"; enable = lib.mkEnableOption "xdg-dirs";

View file

@ -1,15 +1,18 @@
final: _prev: { final: _prev: {
youthlic = { youthlic = {
loadImports' = dir: f: loadImports' =
dir: f:
final.pipe dir [ final.pipe dir [
final.youthlic.loadImports final.youthlic.loadImports
f f
]; ];
loadImports = dir: loadImports =
dir:
with final; with final;
if !(pathExists dir && builtins.readFileType dir == "directory") if !(pathExists dir && builtins.readFileType dir == "directory") then
then [] [ ]
else let else
let
items = pipe dir [ items = pipe dir [
builtins.readDir builtins.readDir
attrNames attrNames
@ -17,21 +20,17 @@ final: _prev: {
in in
pipe items [ pipe items [
(concatMap ( (concatMap (
name: let name:
let
path = dir + "/${name}"; path = dir + "/${name}";
type = builtins.readFileType path; type = builtins.readFileType path;
in in
if type == "directory" if type == "directory" then
then if pathExists (path + "/default.nix") then [ path ] else youthlic.loadImports path
if pathExists (path + "/default.nix") else if type == "regular" then
then [path] if hasSuffix ".nix" name then [ path ] else [ ]
else youthlic.loadImports path else
else if type == "regular" [ ]
then
if hasSuffix ".nix" name
then [path]
else []
else []
)) ))
(filter (name: !hasSuffix "/default.nix" (toString name))) (filter (name: !hasSuffix "/default.nix" (toString name)))
]; ];

View file

@ -4,7 +4,8 @@
lib, lib,
outputs, outputs,
... ...
}: { }:
{
imports = imports =
(with inputs.nixos-hardware.nixosModules; [ (with inputs.nixos-hardware.nixosModules; [
common-cpu-intel common-cpu-intel

View file

@ -7,7 +7,8 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];

View file

@ -2,7 +2,8 @@
pkgs, pkgs,
rootPath, rootPath,
... ...
}: { }:
{
stylix = { stylix = {
enable = true; enable = true;
image = rootPath + "/assets/wallpaper/01.png"; image = rootPath + "/assets/wallpaper/01.png";

View file

@ -2,7 +2,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: { }:
{
users = { users = {
mutableUsers = true; mutableUsers = true;
users.david = { users.david = {

View file

@ -3,9 +3,9 @@
lib, lib,
outputs, outputs,
... ...
}: { }:
imports = {
[ imports = [
outputs.nixosModules.default outputs.nixosModules.default
] ]
++ (lib.youthlic.loadImports ./.); ++ (lib.youthlic.loadImports ./.);

View file

@ -7,7 +7,8 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
]; ];

View file

@ -5,7 +5,8 @@
outputs, outputs,
config, config,
... ...
}: { }:
{
imports = imports =
(with inputs.nixos-hardware.nixosModules; [ (with inputs.nixos-hardware.nixosModules; [
common-hidpi common-hidpi
@ -43,9 +44,11 @@
programs = { programs = {
miniserve = { miniserve = {
enable = true; enable = true;
apps = let apps =
let
cinny-template = config.youthlic.programs.miniserve.templates.cinny; cinny-template = config.youthlic.programs.miniserve.templates.cinny;
in { in
{
cinny-1 = cinny-template { cinny-1 = cinny-template {
port = 9093; port = 9093;
}; };

View file

@ -7,7 +7,8 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];

View file

@ -3,7 +3,8 @@
lib, lib,
config, config,
... ...
}: { }:
{
virtualisation.libvirtd.hooks.qemu = { virtualisation.libvirtd.hooks.qemu = {
"dynamic-cpu-isolation" = "dynamic-cpu-isolation" =
pkgs.writeShellScript "dynamic-cpu-isolation.sh" pkgs.writeShellScript "dynamic-cpu-isolation.sh"
@ -111,7 +112,8 @@
conflicts = [ "shutdown.target" ]; conflicts = [ "shutdown.target" ];
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
ExecStart = let ExecStart =
let
script = pkgs.writeShellApplication { script = pkgs.writeShellApplication {
name = "ddcci-handler"; name = "ddcci-handler";
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [
@ -135,7 +137,8 @@
done done
''; '';
}; };
in "${lib.getExe' script "ddcci-handler"} %i"; in
"${lib.getExe' script "ddcci-handler"} %i";
}; };
}; };
services.udev.extraRules = '' services.udev.extraRules = ''

View file

@ -2,7 +2,8 @@
pkgs, pkgs,
rootPath, rootPath,
... ...
}: { }:
{
stylix = { stylix = {
enable = true; enable = true;
image = rootPath + "/assets/wallpaper/01.png"; image = rootPath + "/assets/wallpaper/01.png";

View file

@ -2,7 +2,8 @@
lib, lib,
pkgs, pkgs,
... ...
}: { }:
{
users.users.david = { users.users.david = {
initialHashedPassword = "$y$j9T$eS5zCi4W.4IPpf3P8Tb/o1$xhumXY1.PJKmTguNi/zlljLbLemNGiubWoUEc878S36"; initialHashedPassword = "$y$j9T$eS5zCi4W.4IPpf3P8Tb/o1$xhumXY1.PJKmTguNi/zlljLbLemNGiubWoUEc878S36";
isNormalUser = true; isNormalUser = true;

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.containers; cfg = config.youthlic.containers;
in { in
{
imports = lib.youthlic.loadImports ./.; imports = lib.youthlic.loadImports ./.;
options = { options = {
youthlic.containers = { youthlic.containers = {

View file

@ -3,9 +3,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.containers.forgejo; cfg = config.youthlic.containers.forgejo;
in { in
{
options = { options = {
youthlic.containers.forgejo = { youthlic.containers.forgejo = {
enable = lib.mkEnableOption "forgejo container"; enable = lib.mkEnableOption "forgejo container";

View file

@ -3,9 +3,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.containers.miniflux; cfg = config.youthlic.containers.miniflux;
in { in
{
options = { options = {
youthlic.containers.miniflux = { youthlic.containers.miniflux = {
enable = lib.mkEnableOption "miniflux container"; enable = lib.mkEnableOption "miniflux container";

View file

@ -1,4 +1,5 @@
{ lib, ... }: { { lib, ... }: {
imports = with lib; imports =
with lib;
youthlic.loadImports' ./. (filter (name: !hasSuffix "/top-level" (toString name))); youthlic.loadImports' ./. (filter (name: !hasSuffix "/top-level" (toString name)));
} }

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.users.deploy; cfg = config.youthlic.users.deploy;
in { in
{
options = { options = {
youthlic.users.deploy = { youthlic.users.deploy = {
enable = lib.mkEnableOption "deploy"; enable = lib.mkEnableOption "deploy";

View file

@ -1,7 +1,6 @@
{ pkgs, ... }: { { pkgs, ... }: {
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit inherit (pkgs)
(pkgs)
man-pages man-pages
man-pages-posix man-pages-posix
; ;

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.gui; cfg = config.youthlic.gui;
in { in
{
config = lib.mkIf (cfg.enabled == "cosmic") { config = lib.mkIf (cfg.enabled == "cosmic") {
services = { services = {
desktopManager.cosmic = { desktopManager.cosmic = {

View file

@ -4,9 +4,11 @@
pkgs, pkgs,
rootPath, rootPath,
... ...
}: let }:
let
cfg = config.youthlic.gui; cfg = config.youthlic.gui;
in { in
{
imports = with lib; youthlic.loadImports ./.; imports = with lib; youthlic.loadImports ./.;
options = { options = {
youthlic.gui = { youthlic.gui = {
@ -28,7 +30,8 @@ in {
fontconfig fontconfig
]; ];
sops.secrets = with lib; sops.secrets =
with lib;
with builtins; with builtins;
pipe (rootPath + "/secrets/dummy_font") [ pipe (rootPath + "/secrets/dummy_font") [
readDir readDir

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.gui; cfg = config.youthlic.gui;
in { in
{
config = lib.mkIf (cfg.enabled == "kde") { config = lib.mkIf (cfg.enabled == "kde") {
services = { services = {
desktopManager.plasma6.enable = true; desktopManager.plasma6.enable = true;

View file

@ -3,9 +3,11 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.youthlic.gui; cfg = config.youthlic.gui;
in { in
{
options = { options = {
youthlic.gui.niri = { youthlic.gui.niri = {
}; };
@ -14,7 +16,8 @@ in {
# Enabled to support trash of nautilus # Enabled to support trash of nautilus
services.gvfs.enable = true; services.gvfs.enable = true;
systemd.user.services.niri-flake-polkit.serviceConfig.ExecStart = lib.mkForce "${pkgs.mate-polkit}/libexec/polkit-mate-authentication-agent-1"; systemd.user.services.niri-flake-polkit.serviceConfig.ExecStart =
lib.mkForce "${pkgs.mate-polkit}/libexec/polkit-mate-authentication-agent-1";
environment = { environment = {
pathsToLink = [ "share/thumbnailers" ]; pathsToLink = [ "share/thumbnailers" ];
@ -41,12 +44,14 @@ in {
default = [ "com.mitchellh.ghostty.desktop" ]; default = [ "com.mitchellh.ghostty.desktop" ];
}; };
}; };
mime = let mime =
let
browsers = [ browsers = [
"zen-twilight.desktop" "zen-twilight.desktop"
"chromium-browser.desktop" "chromium-browser.desktop"
]; ];
in { in
{
enable = true; enable = true;
defaultApplications = { defaultApplications = {
"application/pdf" = [ "application/pdf" = [

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.hardware; cfg = config.youthlic.hardware;
in { in
{
options = { options = {
youthlic.hardware = { youthlic.hardware = {
asus = { asus = {

View file

@ -6,7 +6,8 @@
pkgs, pkgs,
rootPath, rootPath,
... ...
}: { }:
{
options.youthlic.home-manager = { options.youthlic.home-manager = {
enable = lib.mkOption { enable = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
@ -32,7 +33,8 @@
''; '';
}; };
}; };
config = let config =
let
cfg = config.youthlic.home-manager; cfg = config.youthlic.home-manager;
unixName = cfg.unixName; unixName = cfg.unixName;
hostName = cfg.hostName; hostName = cfg.hostName;

View file

@ -3,9 +3,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.youthlic.i18n; cfg = config.youthlic.i18n;
in { in
{
options = { options = {
youthlic.i18n = { youthlic.i18n = {
enable = lib.mkEnableOption "zh env"; enable = lib.mkEnableOption "zh env";

View file

@ -3,9 +3,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.youthlic.lix; cfg = config.youthlic.lix;
in { in
{
options = { options = {
youthlic.lix = { youthlic.lix = {
enable = lib.mkEnableOption "lix"; enable = lib.mkEnableOption "lix";
@ -13,9 +15,9 @@ in {
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
nixpkgs.overlays = [ nixpkgs.overlays = [
(lib.mkBefore (final: _prev: { (lib.mkBefore (
inherit final: _prev: {
(final.lixPackageSets.latest) inherit (final.lixPackageSets.latest)
nixpkgs-review nixpkgs-review
nixpkgs-reviewFull nixpkgs-reviewFull
nurl nurl
@ -24,7 +26,8 @@ in {
nix-fast-build nix-fast-build
colmena colmena
; ;
})) }
))
]; ];
nix.package = pkgs.lixPackageSets.latest.lix; nix.package = pkgs.lixPackageSets.latest.lix;
}; };

View file

@ -4,9 +4,11 @@
outputs, outputs,
lib, lib,
... ...
}: { }:
{
config = { config = {
environment.etc = with lib; environment.etc =
with lib;
pipe inputs [ pipe inputs [
(mapAttrs' ( (mapAttrs' (
name: value: name: value:
@ -18,7 +20,8 @@
nixpkgs = { nixpkgs = {
config = { config = {
allowUnfree = true; allowUnfree = true;
allowInsecurePredicate = p: allowInsecurePredicate =
p:
builtins.elem (lib.getName p) [ builtins.elem (lib.getName p) [
"electron" "electron"
@ -62,7 +65,8 @@
use-xdg-base-directories = true; use-xdg-base-directories = true;
builders-use-substitutes = true; builders-use-substitutes = true;
}; };
registry = with lib; registry =
with lib;
pipe inputs [ pipe inputs [
(filterAttrs (name: _value: name != "nixpkgs")) (filterAttrs (name: _value: name != "nixpkgs"))
(mapAttrs ( (mapAttrs (

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.asusd; cfg = config.youthlic.programs.asusd;
in { in
{
options = { options = {
youthlic.programs.asusd = { youthlic.programs.asusd = {
enable = lib.mkEnableOption "asusd"; enable = lib.mkEnableOption "asusd";

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.bash; cfg = config.youthlic.programs.bash;
in { in
{
options = { options = {
youthlic.programs.bash = { youthlic.programs.bash = {
enable = lib.mkEnableOption "bash"; enable = lib.mkEnableOption "bash";

View file

@ -3,10 +3,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.youthlic.programs.caddy.outer-wilds-text-adventure; cfg = config.youthlic.programs.caddy.outer-wilds-text-adventure;
caddy-cfg = config.youthlic.programs.caddy; caddy-cfg = config.youthlic.programs.caddy;
in { in
{
options = { options = {
youthlic.programs.caddy.outer-wilds-text-adventure = { youthlic.programs.caddy.outer-wilds-text-adventure = {
enable = lib.mkEnableOption "caddy.OuterWildsTextAdventure"; enable = lib.mkEnableOption "caddy.OuterWildsTextAdventure";

View file

@ -3,10 +3,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.youthlic.programs.caddy.cinny; cfg = config.youthlic.programs.caddy.cinny;
caddy-cfg = config.youthlic.programs.caddy; caddy-cfg = config.youthlic.programs.caddy;
in { in
{
options = { options = {
youthlic.programs.caddy.cinny = { youthlic.programs.caddy.cinny = {
enable = lib.mkEnableOption "caddy.cinny"; enable = lib.mkEnableOption "caddy.cinny";

View file

@ -2,9 +2,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.youthlic.programs.caddy; cfg = config.youthlic.programs.caddy;
in { in
{
imports = lib.youthlic.loadImports ./.; imports = lib.youthlic.loadImports ./.;
options = { options = {
youthlic.programs.caddy = { youthlic.programs.caddy = {

View file

@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.caddy.garage; cfg = config.youthlic.programs.caddy.garage;
caddy-cfg = config.youthlic.programs.caddy; caddy-cfg = config.youthlic.programs.caddy;
in { in
{
options = { options = {
youthlic.programs.caddy.garage = { youthlic.programs.caddy.garage = {
enable = lib.mkEnableOption "caddy.garage"; enable = lib.mkEnableOption "caddy.garage";

View file

@ -3,10 +3,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.youthlic.programs.caddy.radicle-explorer; cfg = config.youthlic.programs.caddy.radicle-explorer;
caddy-cfg = config.youthlic.programs.caddy; caddy-cfg = config.youthlic.programs.caddy;
in { in
{
options = { options = {
youthlic.programs.caddy.radicle-explorer = { youthlic.programs.caddy.radicle-explorer = {
enable = lib.mkEnableOption "caddy.radicle-explorer"; enable = lib.mkEnableOption "caddy.radicle-explorer";

View file

@ -2,9 +2,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.clash-verge; cfg = config.youthlic.programs.clash-verge;
in { in
{
options = { options = {
youthlic.programs.clash-verge = { youthlic.programs.clash-verge = {
enable = lib.mkEnableOption "clash-verge"; enable = lib.mkEnableOption "clash-verge";

View file

@ -3,9 +3,11 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.youthlic.programs.emacs; cfg = config.youthlic.programs.emacs;
in { in
{
options = { options = {
youthlic.programs.emacs = { youthlic.programs.emacs = {
enable = lib.mkEnableOption "emacs"; enable = lib.mkEnableOption "emacs";
@ -15,10 +17,10 @@ in {
services.emacs = { services.emacs = {
enable = true; enable = true;
install = true; install = true;
package = with pkgs; package =
with pkgs;
(emacsPackagesFor emacs-pgtk).emacsWithPackages ( (emacsPackagesFor emacs-pgtk).emacsWithPackages (
p: p: with p; [
with p; [
vterm vterm
evil evil
gruvbox-theme gruvbox-theme

View file

@ -3,9 +3,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.youthlic.programs.forgejo; cfg = config.youthlic.programs.forgejo;
in { in
{
options = { options = {
youthlic.programs.forgejo = { youthlic.programs.forgejo = {
enable = lib.mkEnableOption "forgejo"; enable = lib.mkEnableOption "forgejo";

View file

@ -3,9 +3,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.youthlic.programs.garage; cfg = config.youthlic.programs.garage;
in { in
{
options = { options = {
youthlic.programs.garage = { youthlic.programs.garage = {
enable = lib.mkEnableOption "garage"; enable = lib.mkEnableOption "garage";

View file

@ -3,9 +3,11 @@
config, config,
options, options,
... ...
}: let }:
let
cfg = config.youthlic.programs.guix; cfg = config.youthlic.programs.guix;
in { in
{
options = { options = {
youthlic.programs.guix = { youthlic.programs.guix = {
enable = lib.mkEnableOption "guix"; enable = lib.mkEnableOption "guix";
@ -18,8 +20,7 @@ in {
enable = true; enable = true;
dates = "weekly"; dates = "weekly";
}; };
substituters.urls = substituters.urls = [
[
"https://mirror.sjtu.edu.cn/guix/" "https://mirror.sjtu.edu.cn/guix/"
] ]
++ options.services.guix.substituters.urls.default; ++ options.services.guix.substituters.urls.default;

View file

@ -3,9 +3,11 @@
lib, lib,
config, config,
... ...
}: let }:
let
cfg = config.youthlic.programs.juicity; cfg = config.youthlic.programs.juicity;
in { in
{
imports = lib.youthlic.loadImports ./.; imports = lib.youthlic.loadImports ./.;
options = { options = {
youthlic.programs.juicity = { youthlic.programs.juicity = {

View file

@ -3,18 +3,22 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.services.juicity; cfg = config.services.juicity;
settingsFormat = pkgs.formats.json { }; settingsFormat = pkgs.formats.json { };
clientConfigFile = clientConfigFile =
if (cfg.client.configFile != null) if (cfg.client.configFile != null) then
then cfg.client.configFile cfg.client.configFile
else settingsFormat cfg.client.settings; else
settingsFormat cfg.client.settings;
serverConfigFile = serverConfigFile =
if (cfg.server.configFile != null) if (cfg.server.configFile != null) then
then cfg.server.configFile cfg.server.configFile
else settingsFormat cfg.server.settings; else
in { settingsFormat cfg.server.settings;
in
{
options = { options = {
services.juicity = { services.juicity = {
client = { client = {

View file

@ -3,9 +3,11 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
cfg = config.youthlic.programs.kanata; cfg = config.youthlic.programs.kanata;
in { in
{
options = { options = {
youthlic.programs.kanata = { youthlic.programs.kanata = {
enable = lib.mkEnableOption "kanata"; enable = lib.mkEnableOption "kanata";

Some files were not shown because too many files have changed in this diff Show more