feat: Change nix formatter to alejandra

This commit is contained in:
ulic-youthlic 2025-11-09 06:25:03 +08:00
parent 0b8b647f05
commit b4c3dfec42
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
229 changed files with 2528 additions and 2884 deletions

1
.nvim.lua Normal file
View file

@ -0,0 +1 @@
require("conform").formatters_by_ft.nix = { "alejandra" }

12
.zed/settings.json Normal file
View file

@ -0,0 +1,12 @@
{
"languages": {
"Nix": {
"formatter": {
"external": {
"command": "alejandra",
"arguments": ["-"]
}
}
}
}
}

View file

@ -1,16 +1,14 @@
{ {
description = "A simple NixOS flakes"; description = "A simple NixOS flakes";
outputs = outputs = {
{
flake-parts, flake-parts,
flake-utils, flake-utils,
home-manager, home-manager,
treefmt-nix, treefmt-nix,
nixpkgs, nixpkgs,
... ...
}@inputs: } @ inputs: let
let
nixpkgs-lib = nixpkgs.lib; nixpkgs-lib = nixpkgs.lib;
lib = nixpkgs-lib.extend (import ./lib); lib = nixpkgs-lib.extend (import ./lib);
in in
@ -23,10 +21,10 @@
}; };
} }
( (
{ lib, ... }: {lib, ...}: {
{
systems = flake-utils.lib.defaultSystems; systems = flake-utils.lib.defaultSystems;
imports = [ imports =
[
home-manager.flakeModules.home-manager home-manager.flakeModules.home-manager
treefmt-nix.flakeModule treefmt-nix.flakeModule
] ]
@ -35,8 +33,7 @@
inherit lib; inherit lib;
nix.settings = { nix.settings = {
# substituters shared in home-manager and nixos configuration # substituters shared in home-manager and nixos configuration
substituters = substituters = let
let
cachix = x: "https://${x}.cachix.org"; cachix = x: "https://${x}.cachix.org";
in in
lib.flatten [ lib.flatten [

View file

@ -4,18 +4,15 @@
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}";
@ -28,8 +25,7 @@ let
}; };
}; };
}; };
in in {
{
options = { options = {
flake = flake-parts-lib.mkSubmoduleOptions { flake = flake-parts-lib.mkSubmoduleOptions {
deploy = lib.mkOption { deploy = lib.mkOption {
@ -38,8 +34,7 @@ in
}; };
}; };
config = { config = {
flake.deploy.nodes = flake.deploy.nodes = with lib;
with lib;
pipe pipe
[ [
"Cape" "Cape"

View file

@ -4,8 +4,7 @@
self, self,
rootPath, rootPath,
... ...
}: }: let
let
inherit (self) outputs; inherit (self) outputs;
homeModules = homeModules =
( (
@ -28,20 +27,19 @@ let
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; [
@ -68,11 +66,9 @@ let
}; };
}; };
}; };
in in {
{
flake = { flake = {
homeConfigurations = homeConfigurations = with lib;
with lib;
foldr (a: b: a // b) {} ( foldr (a: b: a // b) {} (
pipe pipe
[ [

View file

@ -4,20 +4,16 @@
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 = nixosConfigurations = let
let makeNixosConfiguration = hostName:
makeNixosConfiguration =
hostName:
lib.nixosSystem { lib.nixosSystem {
modules = [(rootPath + "/nixos/configurations/${hostName}")]; modules = [(rootPath + "/nixos/configurations/${hostName}")];
specialArgs = { specialArgs = {

View file

@ -4,14 +4,11 @@
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,24 +2,20 @@
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
inherit (inputs) nixpkgs; inherit (inputs) nixpkgs;
in in {
{
_module.args.pkgs = import nixpkgs { _module.args.pkgs = import nixpkgs {
localSystem = {inherit system;}; localSystem = {inherit system;};
config = { config = {
@ -36,13 +32,12 @@
typos-lsp typos-lsp
just just
nvfetcher nvfetcher
nixfmt-rfc-style alejandra
lua-language-server lua-language-server
]; ];
}; };
legacyPackages = legacyPackages = let
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") {};
@ -57,18 +52,15 @@
directory = rootPath + "/pkgs"; directory = rootPath + "/pkgs";
} }
); );
packages = packages = let
let flattenPkgs = path: value:
flattenPkgs = if lib.isDerivation value
path: value: then {
if lib.isDerivation value then
{
${lib.concatStringsSep ":" path} = value; ${lib.concatStringsSep ":" path} = value;
} }
else if lib.isAttrs value then else if lib.isAttrs value
lib.concatMapAttrs (name: flattenPkgs (path ++ [ name ])) value then lib.concatMapAttrs (name: flattenPkgs (path ++ [name])) value
else else {};
{ };
in in
flattenPkgs [] ( flattenPkgs [] (
lib.removeAttrs self'.legacyPackages [ lib.removeAttrs self'.legacyPackages [
@ -87,8 +79,10 @@
"callPackage" "callPackage"
] ]
); );
checks = lib.concatMapAttrs (name: value: { checks =
lib.concatMapAttrs (name: value: {
"package-${name}" = value; "package-${name}" = value;
}) self'.packages; })
self'.packages;
}; };
} }

View file

@ -3,8 +3,7 @@
lib, lib,
rootPath, rootPath,
... ...
}: }: {
{
options = { options = {
flake = flake-parts-lib.mkSubmoduleOptions { flake = flake-parts-lib.mkSubmoduleOptions {
templates = lib.mkOption { templates = lib.mkOption {

View file

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

View file

@ -4,18 +4,15 @@
unixName, unixName,
config, config,
... ...
}: }: {
{
imports = lib.youthlic.loadImports ./.; imports = lib.youthlic.loadImports ./.;
youthlic = { youthlic = {
xdg-dirs.enable = true; xdg-dirs.enable = true;
programs = programs = let
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

@ -2,17 +2,13 @@
config, config,
inputs, inputs,
... ...
}: }: let
let
inherit (inputs.niri-flake.lib.kdl) node leaf flag; inherit (inputs.niri-flake.lib.kdl) node leaf flag;
in in {
{
david.programs.niri = { david.programs.niri = {
waybar.settings = waybar.settings = let
let
cfg = config.david.programs.niri.waybar; cfg = config.david.programs.niri.waybar;
in in [(cfg.template // (cfg.helper.mkBacklight "intel_backlight") // {output = "eDP-1";})];
[ (cfg.template // (cfg.helper.mkBacklight "intel_backlight") // { output = "eDP-1"; }) ];
wluma.extraSettings = { wluma.extraSettings = {
output = { output = {
backlight = [ backlight = [
@ -24,12 +20,11 @@ in
]; ];
}; };
}; };
extraConfig = extraConfig = let
let
output = node "output"; output = node "output";
in in [
[ (
(output output
["eDP-1"] ["eDP-1"]
[ [
(leaf "mode" ["1920x1200@60.018"]) (leaf "mode" ["1920x1200@60.018"])

View file

@ -4,18 +4,15 @@
config, config,
unixName, unixName,
... ...
}: }: {
{
imports = lib.youthlic.loadImports ./.; imports = lib.youthlic.loadImports ./.;
youthlic = { youthlic = {
xdg-dirs.enable = true; xdg-dirs.enable = true;
programs = programs = let
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

@ -1,14 +1,14 @@
{ config, lib, ... }:
let
cfg = config.david.programs.niri;
in
{ {
config,
lib,
...
}: let
cfg = config.david.programs.niri;
in {
david.programs.niri = lib.mkIf cfg.enable { david.programs.niri = lib.mkIf cfg.enable {
waybar.settings = waybar.settings = let
let
cfg = config.david.programs.niri.waybar; cfg = config.david.programs.niri.waybar;
in in [
[
(cfg.template // (cfg.helper.mkBacklight "ddcci13") // {output = "DP-1";}) (cfg.template // (cfg.helper.mkBacklight "ddcci13") // {output = "DP-1";})
(cfg.template // (cfg.helper.mkBacklight "nvidia_0") // {output = "eDP-2";}) (cfg.template // (cfg.helper.mkBacklight "nvidia_0") // {output = "eDP-2";})
]; ];

View file

@ -2,8 +2,7 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: {
{
imports = lib.youthlic.loadImports ./.; imports = lib.youthlic.loadImports ./.;
config = { config = {
youthlic.programs = { youthlic.programs = {

View file

@ -2,11 +2,9 @@
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,11 +3,9 @@
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,11 +2,9 @@
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,11 +3,9 @@
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

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

View file

@ -2,11 +2,9 @@
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,11 +2,9 @@
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

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

View file

@ -3,11 +3,9 @@
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,11 +2,9 @@
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

@ -2,11 +2,9 @@
lib, lib,
config, config,
... ...
}: }: 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

@ -5,10 +5,10 @@
inputs, inputs,
osConfig ? null, osConfig ? null,
... ...
}: }: let
let
inherit (lib) getExe getExe'; inherit (lib) getExe getExe';
inherit (inputs.niri-flake.lib.kdl) inherit
(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
@ -44,8 +44,7 @@ in
( (
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])
@ -84,7 +83,8 @@ in
(plain "Mod+Space" [ (plain "Mod+Space" [
(spawn [fuzzel]) (spawn [fuzzel])
]) ])
(node "XF86AudioRaiseVolume" (
node "XF86AudioRaiseVolume"
[{allow-when-locked = true;}] [{allow-when-locked = true;}]
[ [
(spawn [ (spawn [
@ -95,7 +95,8 @@ in
]) ])
] ]
) )
(node "XF86AudioLowerVolume" (
node "XF86AudioLowerVolume"
[{allow-when-locked = true;}] [{allow-when-locked = true;}]
[ [
(spawn [ (spawn [
@ -106,7 +107,8 @@ in
]) ])
] ]
) )
(node "XF86AudioMute" (
node "XF86AudioMute"
[{allow-when-locked = true;}] [{allow-when-locked = true;}]
[ [
(spawn [ (spawn [
@ -117,7 +119,8 @@ in
]) ])
] ]
) )
(node "XF86AudioMicMute" (
node "XF86AudioMicMute"
[{allow-when-locked = true;}] [{allow-when-locked = true;}]
[ [
(spawn [ (spawn [
@ -131,7 +134,8 @@ in
(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")
@ -281,13 +285,15 @@ in
(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")
@ -377,13 +383,15 @@ in
(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")
@ -392,19 +400,22 @@ in
(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")
@ -413,25 +424,29 @@ in
(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%"])
@ -467,8 +482,7 @@ in
++ ( ++ (
let let
spawn-at-startup = leaf "spawn-at-startup"; spawn-at-startup = leaf "spawn-at-startup";
in in [
[
(leaf "screenshot-path" ["${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%d_%H:%M:%S.png"]) (leaf "screenshot-path" ["${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%d_%H:%M:%S.png"])
(plain "hotkey-overlay" [ (plain "hotkey-overlay" [
(flag "skip-at-startup") (flag "skip-at-startup")
@ -571,8 +585,7 @@ in
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])
@ -674,8 +687,7 @@ in
let let
layer-rule = plain "layer-rule"; layer-rule = plain "layer-rule";
match = leaf "match"; match = leaf "match";
in in [
[
(layer-rule [ (layer-rule [
(match [{namespace = "^swaync-notification-window$";}]) (match [{namespace = "^swaync-notification-window$";}])
(match [{namespace = "^swaync-control-center$";}]) (match [{namespace = "^swaync-control-center$";}])

View file

@ -6,15 +6,15 @@
osConfig ? null, osConfig ? null,
options, options,
... ...
}@args: } @ args: let
let
cfg = config.david.programs.niri; cfg = config.david.programs.niri;
niri = osConfig.programs.niri.package; niri = osConfig.programs.niri.package;
in in {
{
options = { options = {
david.programs.niri = { david.programs.niri = {
enable = (lib.mkEnableOption "niri") // { enable =
(lib.mkEnableOption "niri")
// {
default = osConfig.youthlic.gui.enabled == "niri"; default = osConfig.youthlic.gui.enabled == "niri";
}; };
extraConfig = lib.mkOption { extraConfig = lib.mkOption {
@ -62,17 +62,16 @@ in
!niri.cargoBuildNoDefaultFeatures || builtins.elem "xdp-gnome-screencast" niri.cargoBuildFeatures !niri.cargoBuildNoDefaultFeatures || builtins.elem "xdp-gnome-screencast" niri.cargoBuildFeatures
) [pkgs.xdg-desktop-portal-gnome]; ) [pkgs.xdg-desktop-portal-gnome];
}; };
xdg.configFile = xdg.configFile = let
let qtctConf =
qtctConf = '' ''
[Appearance] [Appearance]
standard_dialogs=xdgdesktopportal standard_dialogs=xdgdesktopportal
'' ''
+ lib.optionalString (config.qt.style ? name) '' + lib.optionalString (config.qt.style ? name) ''
style=${config.qt.style.name} style=${config.qt.style.name}
''; '';
in in {
{
"qt5ct/qt5ct.conf" = lib.mkForce { "qt5ct/qt5ct.conf" = lib.mkForce {
text = qtctConf; text = qtctConf;
}; };

View file

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

View file

@ -3,11 +3,9 @@
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

@ -4,8 +4,7 @@
lib, lib,
inputs, inputs,
... ...
}: }: let
let
inherit (inputs) nixpkgs emacs-overlay spacemacs; inherit (inputs) nixpkgs emacs-overlay spacemacs;
inherit (pkgs) system; inherit (pkgs) system;
cfg = config.david.programs.spacemacs; cfg = config.david.programs.spacemacs;
@ -13,8 +12,7 @@ let
localSystem = {inherit system;}; localSystem = {inherit system;};
overlays = [emacs-overlay.overlays.default]; overlays = [emacs-overlay.overlays.default];
}; };
in in {
{
options = { options = {
david.programs.spacemacs = { david.programs.spacemacs = {
enable = lib.mkEnableOption "spacemacs"; enable = lib.mkEnableOption "spacemacs";
@ -30,8 +28,7 @@ in
}; };
programs.emacs = { programs.emacs = {
enable = true; enable = true;
package = package = with pkgs';
with pkgs';
(emacsPackagesFor emacs-pgtk).emacsWithPackages (_epkgs: [ (emacsPackagesFor emacs-pgtk).emacsWithPackages (_epkgs: [
git git
gnutar gnutar

View file

@ -3,11 +3,9 @@
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,11 +2,9 @@
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

@ -2,11 +2,9 @@
config, config,
lib, lib,
... ...
}: }: 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,11 +4,9 @@
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,11 +3,9 @@
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,11 +3,9 @@
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";
@ -35,7 +33,8 @@ 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,11 +3,9 @@
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,11 +3,9 @@
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,8 +2,7 @@
lib, lib,
inputs, inputs,
... ...
}: }: {
{
imports = imports =
(with inputs; [ (with inputs; [
niri-flake.homeModules.niri niri-flake.homeModules.niri

View file

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

View file

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

View file

@ -2,11 +2,9 @@
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,11 +3,9 @@
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,11 +2,9 @@
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

@ -1,8 +1,10 @@
{ config, lib, ... }:
let
cfg = config.youthlic.programs.direnv;
in
{ {
config,
lib,
...
}: let
cfg = config.youthlic.programs.direnv;
in {
options = { options = {
youthlic.programs.direnv = { youthlic.programs.direnv = {
enable = lib.mkEnableOption "direnv"; enable = lib.mkEnableOption "direnv";

View file

@ -2,14 +2,12 @@
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,11 +3,9 @@
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";
@ -25,7 +23,8 @@ in
{ {
name = with pkgs.fishPlugins.foreign-env; pname + "-" + version; name = with pkgs.fishPlugins.foreign-env; pname + "-" + version;
src = pkgs.fishPlugins.foreign-env.overrideAttrs { src = pkgs.fishPlugins.foreign-env.overrideAttrs {
postInstall = # bash postInstall =
# bash
'' ''
ln -s $out/share/fish/vendor_functions.d $out/functions ln -s $out/share/fish/vendor_functions.d $out/functions
''; '';
@ -41,7 +40,8 @@ in
body = ''''; body = '''';
}; };
}; };
shellInitLast = # fish shellInitLast =
# fish
'' ''
if test -e ~/.config/guix/current/bin/guix if test -e ~/.config/guix/current/bin/guix
fish_add_path -pPm ~/.config/guix/current/bin fish_add_path -pPm ~/.config/guix/current/bin

View file

@ -2,13 +2,11 @@
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,8 +2,7 @@
config, config,
lib, lib,
... ...
}: }: {
{
options = { options = {
youthlic.programs.git = { youthlic.programs.git = {
email = lib.mkOption { email = lib.mkOption {
@ -31,8 +30,7 @@
encrypt-credential = lib.mkEnableOption "encrypt git credential"; encrypt-credential = lib.mkEnableOption "encrypt git credential";
}; };
}; };
config = config = let
let
cfg = config.youthlic.programs.git; cfg = config.youthlic.programs.git;
in in
lib.mkMerge [ lib.mkMerge [

View file

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

View file

@ -3,20 +3,17 @@
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";
languageSettings = lib.mkOption { languageSettings = lib.mkOption {
type = lib.types.attrsOf ( type = lib.types.attrsOf (
lib.types.submodule ( lib.types.submodule (
{ ... }: {...}: {
{
freeformType = lib.types.anything; freeformType = lib.types.anything;
options = { options = {
language-servers = lib.mkOption { language-servers = lib.mkOption {
@ -39,8 +36,7 @@ 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
] ]
); );
@ -56,8 +52,7 @@ in
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
extraPackages = cfg.extraPackages; extraPackages = cfg.extraPackages;
settings = settings = with lib;
with lib;
pipe ./config.toml [ pipe ./config.toml [
builtins.readFile builtins.readFile
builtins.fromTOML builtins.fromTOML

View file

@ -2,11 +2,9 @@
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,11 +3,9 @@
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";

View file

@ -2,11 +2,9 @@
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

@ -3,11 +3,9 @@
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,8 +4,7 @@
pkgs, pkgs,
rootPath, rootPath,
... ...
}: }: {
{
options = { options = {
youthlic.programs.sops = { youthlic.programs.sops = {
enable = lib.mkOption { enable = lib.mkOption {
@ -25,14 +24,12 @@
}; };
}; };
}; };
config = config = let
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

@ -1,8 +1,10 @@
{ config, lib, ... }:
let
cfg = config.youthlic.programs.spotifyd;
in
{ {
config,
lib,
...
}: let
cfg = config.youthlic.programs.spotifyd;
in {
options = { options = {
youthlic.programs.spotifyd = { youthlic.programs.spotifyd = {
enable = lib.mkEnableOption "spotifyd"; enable = lib.mkEnableOption "spotifyd";

View file

@ -2,14 +2,12 @@
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";
@ -20,8 +18,7 @@ in
programs.starship = { programs.starship = {
enable = true; enable = true;
enableTransience = true; enableTransience = true;
settings = settings = let
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,13 +3,11 @@
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";
@ -23,7 +21,8 @@ in
programs.yazi = { programs.yazi = {
enable = true; enable = true;
plugins = { plugins = {
inherit (pkgs.yaziPlugins) inherit
(pkgs.yaziPlugins)
ouch ouch
starship starship
piper piper

View file

@ -2,13 +2,11 @@
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,11 +2,9 @@
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,18 +1,15 @@
final: _prev: { final: _prev: {
youthlic = { youthlic = {
loadImports' = loadImports' = dir: f:
dir: f:
final.pipe dir [ final.pipe dir [
final.youthlic.loadImports final.youthlic.loadImports
f f
]; ];
loadImports = loadImports = dir:
dir:
with final; with final;
if !(pathExists dir && builtins.readFileType dir == "directory") then if !(pathExists dir && builtins.readFileType dir == "directory")
[ ] then []
else else let
let
items = pipe dir [ items = pipe dir [
builtins.readDir builtins.readDir
attrNames attrNames
@ -20,17 +17,21 @@ final: _prev: {
in in
pipe items [ pipe items [
(concatMap ( (concatMap (
name: name: let
let
path = dir + "/${name}"; path = dir + "/${name}";
type = builtins.readFileType path; type = builtins.readFileType path;
in in
if type == "directory" then if type == "directory"
if pathExists (path + "/default.nix") then [ path ] else youthlic.loadImports path then
else if type == "regular" then if pathExists (path + "/default.nix")
if hasSuffix ".nix" name then [ path ] else [ ] then [path]
else else youthlic.loadImports path
[ ] 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,8 +4,7 @@
lib, lib,
outputs, outputs,
... ...
}: }: {
{
imports = imports =
(with inputs.nixos-hardware.nixosModules; [ (with inputs.nixos-hardware.nixosModules; [
common-cpu-intel common-cpu-intel

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
youthlic.gui = { youthlic.gui = {
enabled = "niri"; enabled = "niri";
}; };

View file

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

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
systemd.network = { systemd.network = {
enable = true; enable = true;
wait-online.enable = false; wait-online.enable = false;

View file

@ -2,8 +2,7 @@
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,8 +2,7 @@
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

@ -1,5 +1,4 @@
{ config, ... }: {config, ...}: {
{
youthlic.containers.forgejo = { youthlic.containers.forgejo = {
enable = true; enable = true;
domain = "forgejo.youthlic.social"; domain = "forgejo.youthlic.social";

View file

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

View file

@ -1,5 +1,4 @@
{ config, ... }: {config, ...}: {
{
sops.secrets."miniflux" = { sops.secrets."miniflux" = {
}; };
youthlic.containers.miniflux = { youthlic.containers.miniflux = {

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
systemd.network = { systemd.network = {
enable = true; enable = true;
wait-online.enable = true; wait-online.enable = true;

View file

@ -1,5 +1,4 @@
{ config, ... }: {config, ...}: {
{
sops.secrets."ssh-private-key/radicle/Cape" = {}; sops.secrets."ssh-private-key/radicle/Cape" = {};
youthlic.programs.radicle = { youthlic.programs.radicle = {
enable = true; enable = true;

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
stylix = { stylix = {
enable = false; enable = false;
}; };

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
users.users.alice = { users.users.alice = {
initialHashedPassword = "$y$j9T$eS5zCi4W.4IPpf3P8Tb/o1$xhumXY1.PJKmTguNi/zlljLbLemNGiubWoUEc878S36"; initialHashedPassword = "$y$j9T$eS5zCi4W.4IPpf3P8Tb/o1$xhumXY1.PJKmTguNi/zlljLbLemNGiubWoUEc878S36";
isNormalUser = true; isNormalUser = true;

View file

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

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
disko.devices = { disko.devices = {
disk = { disk = {
disk1 = { disk1 = {

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
youthlic.gui = { youthlic.gui = {
enabled = "niri"; enabled = "niri";
}; };

View file

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

View file

@ -3,8 +3,7 @@
lib, lib,
config, config,
... ...
}: }: {
{
nixpkgs.config.cudaSupport = true; nixpkgs.config.cudaSupport = true;
services = { services = {
hardware.bolt.enable = true; hardware.bolt.enable = true;
@ -61,8 +60,7 @@
conflicts = ["shutdown.target"]; conflicts = ["shutdown.target"];
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
ExecStart = ExecStart = let
let
script = pkgs.writeShellApplication { script = pkgs.writeShellApplication {
name = "ddcci-handler"; name = "ddcci-handler";
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [
@ -86,8 +84,7 @@
done done
''; '';
}; };
in in "${lib.getExe' script "ddcci-handler"} %i";
"${lib.getExe' script "ddcci-handler"} %i";
}; };
}; };
services.udev.extraRules = '' services.udev.extraRules = ''

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
systemd.network = { systemd.network = {
enable = true; enable = true;
wait-online.enable = false; wait-online.enable = false;

View file

@ -1,5 +1,4 @@
{ lib, ... }: {lib, ...}: {
{
config.specialisation.cosmic = { config.specialisation.cosmic = {
inheritParentConfig = true; inheritParentConfig = true;
configuration = { configuration = {

View file

@ -1,5 +1,4 @@
{ lib, ... }: {lib, ...}: {
{
config.specialisation.kde = { config.specialisation.kde = {
inheritParentConfig = true; inheritParentConfig = true;
configuration = { configuration = {

View file

@ -2,8 +2,7 @@
inputs, inputs,
lib, lib,
... ...
}: }: {
{
config.specialisation.niri-hybrid = { config.specialisation.niri-hybrid = {
inheritParentConfig = true; inheritParentConfig = true;
configuration = { configuration = {

View file

@ -2,8 +2,7 @@
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,8 +2,7 @@
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,11 +2,9 @@
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,11 +3,9 @@
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";
@ -56,9 +54,7 @@ in
} }
]; ];
config = config = {lib, ...}: {
{ lib, ... }:
{
imports = [ imports = [
./../programs/forgejo.nix ./../programs/forgejo.nix
./../programs/postgresql.nix ./../programs/postgresql.nix

View file

@ -3,11 +3,9 @@
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";
@ -38,9 +36,7 @@ in
}; };
}; };
config = config = {lib, ...}: {
{ lib, ... }:
{
imports = [ imports = [
./../programs/miniflux.nix ./../programs/miniflux.nix
./../programs/postgresql.nix ./../programs/postgresql.nix

View file

@ -1,6 +1,4 @@
{ 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,11 +2,9 @@
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

@ -21,8 +21,7 @@ lib.mkMerge [
inherit (pkgs.writers) writeFish; inherit (pkgs.writers) writeFish;
cfg = config.documentation.man.man-db; cfg = config.documentation.man.man-db;
cachePath = "/var/cache/man/nixos"; cachePath = "/var/cache/man/nixos";
in in {
{
documentation.man.generateCaches = false; documentation.man.generateCaches = false;
systemd.services."man-db" = { systemd.services."man-db" = {

View file

@ -2,11 +2,9 @@
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

@ -3,11 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: 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 = {

View file

@ -2,11 +2,9 @@
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") {
# Fix stylix bug # Fix stylix bug
qt.platformTheme = lib.mkForce "kde"; qt.platformTheme = lib.mkForce "kde";

View file

@ -3,11 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
let
cfg = config.youthlic.gui; cfg = config.youthlic.gui;
in in {
{
options = { options = {
youthlic.gui.niri = { youthlic.gui.niri = {
}; };

View file

@ -2,11 +2,9 @@
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,8 +6,7 @@
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;
@ -33,8 +32,7 @@
''; '';
}; };
}; };
config = config = let
let
cfg = config.youthlic.home-manager; cfg = config.youthlic.home-manager;
unixName = cfg.unixName; unixName = cfg.unixName;
hostName = cfg.hostName; hostName = cfg.hostName;
@ -44,8 +42,7 @@
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
users."${cfg.unixName}" = ( users."${cfg.unixName}" = (
{ ... }: {...}: {
{
imports = [ imports = [
outputs.homeModules."${unixName}" outputs.homeModules."${unixName}"
(rootPath + "/home/${unixName}/configurations/${hostName}") (rootPath + "/home/${unixName}/configurations/${hostName}")

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