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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,24 +2,20 @@
inputs,
rootPath,
...
}:
{
}: {
imports = [
(rootPath + "/treefmt.nix")
];
perSystem =
{
perSystem = {
pkgs,
system,
lib,
self',
inputs',
...
}:
let
}: let
inherit (inputs) nixpkgs;
in
{
in {
_module.args.pkgs = import nixpkgs {
localSystem = {inherit system;};
config = {
@ -36,13 +32,12 @@
typos-lsp
just
nvfetcher
nixfmt-rfc-style
alejandra
lua-language-server
];
};
legacyPackages =
let
legacyPackages = let
inputsScope = lib.makeScope pkgs.newScope (self: {
inherit inputs rootPath;
srcs = self.callPackage (rootPath + "/_sources/generated.nix") {};
@ -57,18 +52,15 @@
directory = rootPath + "/pkgs";
}
);
packages =
let
flattenPkgs =
path: value:
if lib.isDerivation value then
{
packages = let
flattenPkgs = path: value:
if lib.isDerivation value
then {
${lib.concatStringsSep ":" path} = value;
}
else if lib.isAttrs value then
lib.concatMapAttrs (name: flattenPkgs (path ++ [ name ])) value
else
{ };
else if lib.isAttrs value
then lib.concatMapAttrs (name: flattenPkgs (path ++ [name])) value
else {};
in
flattenPkgs [] (
lib.removeAttrs self'.legacyPackages [
@ -87,8 +79,10 @@
"callPackage"
]
);
checks = lib.concatMapAttrs (name: value: {
checks =
lib.concatMapAttrs (name: value: {
"package-${name}" = value;
}) self'.packages;
})
self'.packages;
};
}

View file

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

View file

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

View file

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

View file

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

View file

@ -4,18 +4,15 @@
config,
unixName,
...
}:
{
}: {
imports = lib.youthlic.loadImports ./.;
youthlic = {
xdg-dirs.enable = true;
programs =
let
programs = let
email = config.accounts.email.accounts.ulic-youthlic;
inherit (email) name address;
signKey = email.gpg.key;
in
{
in {
rustypaste-cli.enable = true;
gpg.enable = true;
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 {
waybar.settings =
let
waybar.settings = let
cfg = config.david.programs.niri.waybar;
in
[
in [
(cfg.template // (cfg.helper.mkBacklight "ddcci13") // {output = "DP-1";})
(cfg.template // (cfg.helper.mkBacklight "nvidia_0") // {output = "eDP-2";})
];

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -5,10 +5,10 @@
inputs,
osConfig ? null,
...
}:
let
}: let
inherit (lib) getExe getExe';
inherit (inputs.niri-flake.lib.kdl)
inherit
(inputs.niri-flake.lib.kdl)
# node with args, props and children
# node:: \lambda name -> [argOrProp] -> [child] -> Output
# arg: single value
@ -44,8 +44,7 @@ in
(
let
spawn = leaf "spawn";
in
[
in [
(plain "binds" [
(plain "Mod+V" [
(spawn [cliphist-fuzzel-img])
@ -84,7 +83,8 @@ in
(plain "Mod+Space" [
(spawn [fuzzel])
])
(node "XF86AudioRaiseVolume"
(
node "XF86AudioRaiseVolume"
[{allow-when-locked = true;}]
[
(spawn [
@ -95,7 +95,8 @@ in
])
]
)
(node "XF86AudioLowerVolume"
(
node "XF86AudioLowerVolume"
[{allow-when-locked = true;}]
[
(spawn [
@ -106,7 +107,8 @@ in
])
]
)
(node "XF86AudioMute"
(
node "XF86AudioMute"
[{allow-when-locked = true;}]
[
(spawn [
@ -117,7 +119,8 @@ in
])
]
)
(node "XF86AudioMicMute"
(
node "XF86AudioMicMute"
[{allow-when-locked = true;}]
[
(spawn [
@ -131,7 +134,8 @@ in
(plain "Mod+Q" [
(flag "close-window")
])
(node "Mod+O"
(
node "Mod+O"
[{repeat = false;}]
[
(flag "toggle-overview")
@ -281,13 +285,15 @@ in
(plain "Mod+Ctrl+I" [
(flag "move-workspace-up")
])
(node "Mod+Shift+WheelScrollDown"
(
node "Mod+Shift+WheelScrollDown"
[{cooldown-ms = 150;}]
[
(flag "focus-workspace-down")
]
)
(node "Mod+Shift+WheelScrollUp"
(
node "Mod+Shift+WheelScrollUp"
[{cooldown-ms = 150;}]
[
(flag "focus-workspace-up")
@ -377,13 +383,15 @@ in
(plain "Mod+Period" [
(flag "expel-window-from-column")
])
(node "Mod+R"
(
node "Mod+R"
[{repeat = false;}]
[
(flag "switch-preset-column-width")
]
)
(node "Mod+Shift+R"
(
node "Mod+Shift+R"
[{repeat = false;}]
[
(flag "switch-preset-window-height")
@ -392,19 +400,22 @@ in
(plain "Mod+Ctrl+R" [
(flag "reset-window-height")
])
(node "Mod+M"
(
node "Mod+M"
[{repeat = false;}]
[
(flag "maximize-column")
]
)
(node "Mod+Shift+M"
(
node "Mod+Shift+M"
[{repeat = false;}]
[
(flag "fullscreen-window")
]
)
(node "Mod+Ctrl+M"
(
node "Mod+Ctrl+M"
[{repeat = false;}]
[
(flag "maximize-window-to-edges")
@ -413,25 +424,29 @@ in
(plain "Mod+Z" [
(flag "center-column")
])
(node "Mod+Minus"
(
node "Mod+Minus"
[{repeat = false;}]
[
(leaf "set-column-width" ["-10%"])
]
)
(node "Mod+Equal"
(
node "Mod+Equal"
[{repeat = false;}]
[
(leaf "set-column-width" ["+10%"])
]
)
(node "Mod+Shift+Minus"
(
node "Mod+Shift+Minus"
[{repeat = false;}]
[
(leaf "set-window-height" ["-10%"])
]
)
(node "Mod+Shift+Equal"
(
node "Mod+Shift+Equal"
[{repeat = false;}]
[
(leaf "set-window-height" ["+10%"])
@ -467,8 +482,7 @@ in
++ (
let
spawn-at-startup = leaf "spawn-at-startup";
in
[
in [
(leaf "screenshot-path" ["${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%d_%H:%M:%S.png"])
(plain "hotkey-overlay" [
(flag "skip-at-startup")
@ -571,8 +585,7 @@ in
let
window-rule = plain "window-rule";
match = leaf "match";
in
[
in [
(window-rule [
(leaf "draw-border-with-background" [true])
(leaf "geometry-corner-radius" [0.0])
@ -674,8 +687,7 @@ in
let
layer-rule = plain "layer-rule";
match = leaf "match";
in
[
in [
(layer-rule [
(match [{namespace = "^swaync-notification-window$";}])
(match [{namespace = "^swaync-control-center$";}])

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,11 +2,9 @@
config,
lib,
...
}:
let
}: let
cfg = config.youthlic.programs.bash;
in
{
in {
options = {
youthlic.programs.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 = {
youthlic.programs.direnv = {
enable = lib.mkEnableOption "direnv";

View file

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

View file

@ -3,11 +3,9 @@
lib,
pkgs,
...
}:
let
}: let
cfg = config.youthlic.programs.fish;
in
{
in {
options = {
youthlic.programs.fish = {
enable = lib.mkEnableOption "fish";
@ -25,7 +23,8 @@ in
{
name = with pkgs.fishPlugins.foreign-env; pname + "-" + version;
src = pkgs.fishPlugins.foreign-env.overrideAttrs {
postInstall = # bash
postInstall =
# bash
''
ln -s $out/share/fish/vendor_functions.d $out/functions
'';
@ -41,7 +40,8 @@ in
body = '''';
};
};
shellInitLast = # fish
shellInitLast =
# fish
''
if test -e ~/.config/guix/current/bin/guix
fish_add_path -pPm ~/.config/guix/current/bin

View file

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

View file

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

View file

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

View file

@ -3,20 +3,17 @@
pkgs,
config,
...
}:
let
}: let
cfg = config.youthlic.programs.helix;
defaultLanguagesSettings = config.programs.helix.package.passthru.languages.language;
in
{
in {
options = {
youthlic.programs.helix = {
enable = lib.mkEnableOption "helix";
languageSettings = lib.mkOption {
type = lib.types.attrsOf (
lib.types.submodule (
{ ... }:
{
{...}: {
freeformType = lib.types.anything;
options = {
language-servers = lib.mkOption {
@ -39,8 +36,7 @@ in
type = lib.types.listOf lib.types.package;
default = [];
example = (
with pkgs;
[
with pkgs; [
deno
]
);
@ -56,8 +52,7 @@ in
enable = true;
defaultEditor = true;
extraPackages = cfg.extraPackages;
settings =
with lib;
settings = with lib;
pipe ./config.toml [
builtins.readFile
builtins.fromTOML

View file

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

View file

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

View file

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

View file

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

View file

@ -4,8 +4,7 @@
pkgs,
rootPath,
...
}:
{
}: {
options = {
youthlic.programs.sops = {
enable = lib.mkOption {
@ -25,14 +24,12 @@
};
};
};
config =
let
config = let
cfg = config.youthlic.programs.sops;
in
lib.mkIf cfg.enable {
home.packages = (
with pkgs;
[
with pkgs; [
sops
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 = {
youthlic.programs.spotifyd = {
enable = lib.mkEnableOption "spotifyd";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,11 +3,9 @@
config,
lib,
...
}:
let
}: let
cfg = config.youthlic.containers.forgejo;
in
{
in {
options = {
youthlic.containers.forgejo = {
enable = lib.mkEnableOption "forgejo container";
@ -56,9 +54,7 @@ in
}
];
config =
{ lib, ... }:
{
config = {lib, ...}: {
imports = [
./../programs/forgejo.nix
./../programs/postgresql.nix

View file

@ -3,11 +3,9 @@
config,
lib,
...
}:
let
}: let
cfg = config.youthlic.containers.miniflux;
in
{
in {
options = {
youthlic.containers.miniflux = {
enable = lib.mkEnableOption "miniflux container";
@ -38,9 +36,7 @@ in
};
};
config =
{ lib, ... }:
{
config = {lib, ...}: {
imports = [
./../programs/miniflux.nix
./../programs/postgresql.nix

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,11 +2,9 @@
config,
lib,
...
}:
let
}: let
cfg = config.youthlic.gui;
in
{
in {
config = lib.mkIf (cfg.enabled == "kde") {
# Fix stylix bug
qt.platformTheme = lib.mkForce "kde";

View file

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

View file

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

View file

@ -6,8 +6,7 @@
pkgs,
rootPath,
...
}:
{
}: {
options.youthlic.home-manager = {
enable = lib.mkOption {
type = lib.types.bool;
@ -33,8 +32,7 @@
'';
};
};
config =
let
config = let
cfg = config.youthlic.home-manager;
unixName = cfg.unixName;
hostName = cfg.hostName;
@ -44,8 +42,7 @@
useGlobalPkgs = true;
useUserPackages = true;
users."${cfg.unixName}" = (
{ ... }:
{
{...}: {
imports = [
outputs.homeModules."${unixName}"
(rootPath + "/home/${unixName}/configurations/${hostName}")

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